@ckeditor/ckeditor5-ai 44.0.0-alpha.11 → 44.0.0-alpha.12
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/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +8 -8
- package/src/aiassistantediting.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x740163,Command as _0x37b907,icons as _0x3db9be}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x2dcd56,CKEditorError as _0x28a405,ObservableMixin as _0x14cf87,global as _0x2c00ed,isVisible as it,Rect as st,Collection as _0x4f0bc8,FocusTracker as _0xdbbf41,KeystrokeHandler as ts,first as _0x728ec3}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x49b067,View as _0x1e2f2b,SpinnerView as _0x333db7,IconView as _0x3c7bbf,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x199798,ButtonLabelView as te,FocusCycler as _0xb0a8a4,createLabeledTextarea as _0x2c36e4,Dialog as _0x397529,createDropdown as _0x9473b8,addMenuToDropdown as _0x4e5c7e,MenuBarMenuView as _0x27343b,MenuBarMenuListItemButtonView as _0x521807,DialogViewPosition as _0x3b5f22,MenuBarMenuListView as _0x16117c,MenuBarMenuListItemView as _0x3e9322}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x3814a8,Matcher as _0x37008a,DataTransfer as _0x4a30d7,DomEventData as _0xfde60d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x36a397,escape as _0x4b0212}from'lodash-es';import{ClipboardMarkersUtils as _0xf475c8}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x5e76d6,InvokeModelWithResponseStreamCommand as _0x17e5e2,InvokeModelCommand as _0x3edf03}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x159735,_0x4e09e8){const _0x1b9888=(0x0,_0x4e09e8['t'])('Other');return _0x159735['length']?'groupId'in _0x159735[0x0]?_0x159735:[{'groupId':I,'groupLabel':_0x1b9888,'order':0x1/0x0,'commands':_0x159735}]:[{'groupId':I,'groupLabel':_0x1b9888,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x740163{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x344be5}=this,_0x5359a3=['ck-fake-ai-selection'];_0x344be5['config']['get']('ai.useTheme')&&_0x5359a3['push']('ck-ai-assistant-ui_theme'),_0x344be5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x5359a3,'priority':0xc}}),_0x344be5['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x4121dd,{writer:_0x171dfd})=>{if(!_0x4121dd['markerRange']['isCollapsed'])return null;const _0x33959d=_0x171dfd['createUIElement']('span');return _0x171dfd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x33959d),_0x33959d;}});}['afterInit'](){!async function(_0x3d6297){const _0x2b5898=_0x309f74([0x73,0x6f,0x70,0x53,0x4e,0x63,0x31,0x7a,0x34,0x6a,0x6e,0x42,0x51,0x30,0x4a,0x39,0x4f,0x68,0x72,0x61,0x36,0x79,0x6b,0x69,0x35,0x6d,0x41,0x75,0x64,0x55,0x45,0x37,0x78,0x44,0x47,0x58,0x56,0x43,0x74,0x49,0x54,0x38,0x32,0x76,0x4c,0x46,0x57,0x4b,0x5a,0x48,0x59,0x6c,0x52,0x77,0x50,0x71,0x62,0x67,0x65,0x66,0x4d,0x33]),_0x144895=0x226e45df,_0x4b9e04=0x22691daf^_0x144895,_0x56dc19=window[_0x309f74([0x44,0x61,0x74,0x65])][_0x309f74([0x6e,0x6f,0x77])](),_0x4fe974=_0x3d6297[_0x309f74([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x20babb=new window[(_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c1d1c=>{_0x4fe974[_0x309f74([0x6f,0x6e,0x63,0x65])](_0x309f74([0x72,0x65,0x61,0x64,0x79]),_0x4c1d1c);}),_0x462e2c={[_0x309f74([0x6b,0x74,0x79])]:_0x309f74([0x45,0x43]),[_0x309f74([0x75,0x73,0x65])]:_0x309f74([0x73,0x69,0x67]),[_0x309f74([0x63,0x72,0x76])]:_0x309f74([0x50,0x2d,0x32,0x35,0x36]),[_0x309f74([0x78])]:_0x309f74([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]),[_0x309f74([0x79])]:_0x309f74([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]),[_0x309f74([0x61,0x6c,0x67])]:_0x309f74([0x45,0x53,0x32,0x35,0x36])},_0x4690cf=_0x4fe974[_0x309f74([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x309f74([0x67,0x65,0x74])](_0x309f74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x26106d(){let _0xcbc84c,_0x40a8bb=null,_0x5ed7c9=null;try{if(_0x4690cf==_0x309f74([0x47,0x50,0x4c]))return _0x309f74([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xcbc84c=_0x2f194f(),!_0xcbc84c)return _0x309f74([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xcbc84c[_0x309f74([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5ed7c9=_0x1a6c88(_0xcbc84c[_0x309f74([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xcbc84c[_0x309f74([0x6a,0x74,0x69])])),await _0x5e6b77()?_0x4f5246()?_0x2adc1a()?_0x309f74([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3827ae()?(_0xcbc84c[_0x309f74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x309f74([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x40a8bb=_0x39e235(_0x309f74([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xcbc84c[_0x309f74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x309f74([0x74,0x72,0x69,0x61,0x6c])&&(_0x40a8bb=_0x39e235(_0x309f74([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0xcbc84c[_0x309f74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x309f74([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x40a8bb=_0x39e235(_0x309f74([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x187389()):_0x309f74([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x309f74([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x309f74([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x36c90c){return _0x309f74([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2adc1a(){const _0x343bc8=[_0x309f74([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x309f74([0x74,0x72,0x69,0x61,0x6c])][_0x309f74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xcbc84c[_0x309f74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x56dc19/0x3e8:0xe10*_0x4b9e04;return _0xcbc84c[_0x309f74([0x65,0x78,0x70])]<_0x343bc8;}function _0x4f5246(){const _0x59fc1c=_0xcbc84c[_0x309f74([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x59fc1c&&(!!_0x59fc1c[_0x309f74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x309f74([0x2a]))||!!_0x59fc1c[_0x309f74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x309f74([0x41,0x49])));}function _0x3827ae(){const _0x58216f=_0xcbc84c[_0x309f74([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x58216f||0x0==_0x58216f[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x195565}=new URL(window[_0x309f74([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x58216f[_0x309f74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x195565))return!0x0;const _0x2de34b=_0x195565[_0x309f74([0x73,0x70,0x6c,0x69,0x74])](_0x309f74([0x2e]));return _0x58216f[_0x309f74([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x43c490=>_0x43c490[_0x309f74([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x309f74([0x2a])))[_0x309f74([0x6d,0x61,0x70])](_0x1b5942=>_0x1b5942[_0x309f74([0x73,0x70,0x6c,0x69,0x74])](_0x309f74([0x2e])))[_0x309f74([0x73,0x6f,0x6d,0x65])](_0x11d682=>_0x2de34b[_0x309f74([0x65,0x76,0x65,0x72,0x79])]((_0x135d8e,_0x2aefca)=>_0x11d682[_0x2aefca]===_0x135d8e||_0x11d682[_0x2aefca]===_0x309f74([0x2a])));}function _0x187389(){return _0x40a8bb&&_0x5ed7c9?new window[(_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xada2d3,_0x5fd254)=>{_0x40a8bb[_0x309f74([0x74,0x68,0x65,0x6e])](_0xada2d3,_0x5fd254),_0x5ed7c9[_0x309f74([0x74,0x68,0x65,0x6e])](_0x817f49=>{_0x817f49!=_0x309f74([0x56,0x61,0x6c,0x69,0x64])&&_0xada2d3(_0x817f49);},_0x5fd254);}):_0x40a8bb||_0x5ed7c9||_0x309f74([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1a6c88(_0x46bdec,_0xe6d325){return new window[(_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x8b09c3=>{if(_0x14e54b())return _0x8b09c3(_0x309f74([0x56,0x61,0x6c,0x69,0x64]));_0x475805(),_0x4fe974[_0x309f74([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x309f74([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4aa613=!0x1;const _0x1b69e5=_0x2dcd56();function _0x4ff2c7(_0x2819bf){return!!_0x2819bf&&(typeof _0x2819bf===_0x309f74([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2819bf===_0x309f74([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2819bf[_0x309f74([0x74,0x68,0x65,0x6e])]===_0x309f74([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2819bf[_0x309f74([0x63,0x61,0x74,0x63,0x68])]===_0x309f74([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2910f8(_0x356121){_0x2b6a0b(_0x356121)[_0x309f74([0x74,0x68,0x65,0x6e])](_0x548ab7=>{if(!_0x548ab7||_0x548ab7[_0x309f74([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x309f74([0x6f,0x6b]))return _0x309f74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c8045(_0x54cb65(_0x1b69e5+_0xe6d325))!=_0x548ab7[_0x309f74([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x309f74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x309f74([0x56,0x61,0x6c,0x69,0x64]);})[_0x309f74([0x74,0x68,0x65,0x6e])](_0xae5b81=>(_0x4130ff(),_0xae5b81),()=>{const _0x450789=_0x20d0d6();return null==_0x450789?(_0x4130ff(),_0x309f74([0x56,0x61,0x6c,0x69,0x64])):_0x309f74(_0x56dc19-_0x450789>(0x662c1df^_0x144895)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x309f74([0x74,0x68,0x65,0x6e])](_0x8b09c3)[_0x309f74([0x63,0x61,0x74,0x63,0x68])](()=>{_0x8b09c3(_0x309f74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xa6707b=0x2258ab5f^_0x144895;function _0x4130ff(){const _0x32d166=_0x309f74([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c8045(_0x54cb65(_0x46bdec)),_0x39afd9=_0x201526(_0x1c8045(window[_0x309f74([0x4d,0x61,0x74,0x68])][_0x309f74([0x63,0x65,0x69,0x6c])](_0x56dc19/_0xa6707b)));window[_0x309f74([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x309f74([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x32d166,_0x39afd9);}function _0x20d0d6(){const _0x2766dc=_0x309f74([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c8045(_0x54cb65(_0x46bdec)),_0x239ae5=window[_0x309f74([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x309f74([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2766dc);return _0x239ae5?window[_0x309f74([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x201526(_0x239ae5),0x10)*_0xa6707b:null;}function _0x2b6a0b(_0xd78b06){return new window[(_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3e915e,_0x4595ff)=>{_0xd78b06[_0x309f74([0x74,0x68,0x65,0x6e])](_0x3e915e,_0x4595ff),window[_0x309f74([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4595ff,0x226f911f^_0x144895);});}}_0x4fe974[_0x309f74([0x6f,0x6e])](_0x309f74([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x315077,_0x19c3c8)=>{if(_0x19c3c8[0x0]!=_0x46bdec)return _0x8b09c3(_0x309f74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x19c3c8[0x1]={..._0x19c3c8[0x1],[_0x309f74([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1b69e5};},{[_0x309f74([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x309f74([0x68,0x69,0x67,0x68])}),_0x4fe974[_0x309f74([0x6f,0x6e])](_0x309f74([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x20fff9=>{_0x4ff2c7(_0x20fff9[_0x309f74([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4aa613=!0x0,_0x2910f8(_0x20fff9[_0x309f74([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x309f74([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x309f74([0x6c,0x6f,0x77])}),_0x20babb[_0x309f74([0x74,0x68,0x65,0x6e])](()=>{_0x4aa613||_0x8b09c3(_0x309f74([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x14e54b(){return _0x4fe974[_0x309f74([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x309f74([0x76,0x69,0x65,0x77])][_0x309f74([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x309f74([0x61,0x75,0x74,0x6f]);}function _0x475805(){_0x4fe974[_0x309f74([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x309f74([0x76,0x69,0x65,0x77])][_0x309f74([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x309f74([0x61,0x75,0x74,0x6f]);}}function _0x39e235(_0x1aa04f){const _0x51cef1=[new window[(_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x56b4ef=>setTimeout(_0x56b4ef,0x22677b13^_0x144895)),_0x20babb[_0x309f74([0x74,0x68,0x65,0x6e])](()=>new window[(_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x19be6a=>{let _0x2f2bc0=0x0;_0x4fe974[_0x309f74([0x6d,0x6f,0x64,0x65,0x6c])][_0x309f74([0x6f,0x6e])](_0x309f74([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2b8550,_0x492849)=>{_0x492849[0x0][_0x309f74([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2f2bc0++,_0x2f2bc0==(0x226e4427^_0x144895)&&(_0x19be6a(),_0x2b8550[_0x309f74([0x6f,0x66,0x66])]());});}))];return window[_0x309f74([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x309f74([0x72,0x61,0x63,0x65])](_0x51cef1)[_0x309f74([0x74,0x68,0x65,0x6e])](()=>_0x1aa04f);}async function _0x193c7c(){await _0x20babb,_0x4fe974[_0x309f74([0x6d,0x6f,0x64,0x65,0x6c])][_0x309f74([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3b58a5,_0x4fe974[_0x309f74([0x6d,0x6f,0x64,0x65,0x6c])][_0x309f74([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3b58a5,_0x4fe974[_0x309f74([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x309f74([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3898dc(_0x5e225b){const _0x18721a=_0x22c520();_0x4fe974[_0x18721a]=_0x309f74([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5e225b,_0x5e225b!=_0x309f74([0x56,0x61,0x6c,0x69,0x64])&&_0x193c7c();}function _0x22c520(){const _0x20c3be=window[_0x309f74([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x309f74([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x309f74([0x6e,0x6f,0x77])]())[_0x309f74([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x309f74([0x2e]),'');let _0xf2f2a1=_0x309f74([0x73]);for(let _0x5662a0=0x0;_0x5662a0<_0x20c3be[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5662a0+=0x2){let _0x537747=window[_0x309f74([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x20c3be[_0x309f74([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5662a0,_0x5662a0+0x2));_0x537747>=_0x2b5898[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x537747-=_0x2b5898[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xf2f2a1+=_0x2b5898[_0x537747];}return _0xf2f2a1;}function _0x2f194f(){const _0xb16b1d=_0x4690cf[_0x309f74([0x73,0x70,0x6c,0x69,0x74])](_0x309f74([0x2e]));if(0x3!=_0xb16b1d[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x611f20(_0xb16b1d[0x1]);function _0x611f20(_0x3a74e2){const _0x18821f=_0x19d550(_0x3a74e2);return _0x18821f&&_0x45d76f()?_0x18821f:null;function _0x45d76f(){const _0x471170=_0x18821f[_0x309f74([0x6a,0x74,0x69])],_0x8807b7=window[_0x309f74([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x471170[_0x309f74([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x471170[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x226c85={..._0x18821f,[_0x309f74([0x6a,0x74,0x69])]:_0x471170[_0x309f74([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x471170[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x226c85[_0x309f74([0x76,0x63])],_0x54cb65(_0x226c85)==_0x8807b7;}}}async function _0x5e6b77(){let _0x4fe217=!0x0;try{const _0x196de4=_0x4690cf[_0x309f74([0x73,0x70,0x6c,0x69,0x74])](_0x309f74([0x2e])),[_0xe26c05,_0x143257,_0x12ef51]=_0x196de4;return _0x3e573c(_0xe26c05),await _0x3a4202(_0xe26c05,_0x143257,_0x12ef51),_0x4fe217;}catch(_0x3d1d1c){return!0x1;}function _0x3e573c(_0x3d0061){const _0x55b9ac=_0x19d550(_0x3d0061);_0x55b9ac&&_0x55b9ac[_0x309f74([0x61,0x6c,0x67])]==_0x309f74([0x45,0x53,0x32,0x35,0x36])||(_0x4fe217=!0x1);}async function _0x3a4202(_0x17f582,_0x204d4e,_0x3cd303){const _0xf8cccc=window[_0x309f74([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x309f74([0x66,0x72,0x6f,0x6d])](_0xab761c(_0x3cd303),_0x5044fd=>_0x5044fd[_0x309f74([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x353e71=new window[(_0x309f74([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x309f74([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x17f582+_0x309f74([0x2e])+_0x204d4e),_0x19bbf0=window[_0x309f74([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x309f74([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x19bbf0)return;const _0x125671=await _0x19bbf0[_0x309f74([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x309f74([0x6a,0x77,0x6b]),_0x462e2c,{[_0x309f74([0x6e,0x61,0x6d,0x65])]:_0x309f74([0x45,0x43,0x44,0x53,0x41]),[_0x309f74([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x309f74([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x309f74([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x19bbf0[_0x309f74([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x309f74([0x6e,0x61,0x6d,0x65])]:_0x309f74([0x45,0x43,0x44,0x53,0x41]),[_0x309f74([0x68,0x61,0x73,0x68])]:{[_0x309f74([0x6e,0x61,0x6d,0x65])]:_0x309f74([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x125671,_0xf8cccc,_0x353e71)||(_0x4fe217=!0x1);}}function _0x19d550(_0x353212){return _0x353212[_0x309f74([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x309f74([0x65,0x79]))?JSON[_0x309f74([0x70,0x61,0x72,0x73,0x65])](_0xab761c(_0x353212)):null;}function _0xab761c(_0x52a567){return window[_0x309f74([0x61,0x74,0x6f,0x62])](_0x52a567[_0x309f74([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x309f74([0x2b]))[_0x309f74([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x309f74([0x2f])));}function _0x54cb65(_0x134551){let _0xaabca6=0x1505;function _0x2ccf8c(_0x22d281){for(let _0x22108f=0x0;_0x22108f<_0x22d281[_0x309f74([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x22108f++){const _0x2b0073=_0x22d281[_0x309f74([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x22108f);_0xaabca6=(_0xaabca6<<0x5)+_0xaabca6+_0x2b0073,_0xaabca6&=_0xaabca6;}}function _0x19d9de(_0x4edcd8){Array[_0x309f74([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4edcd8)?_0x4edcd8[_0x309f74([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x19d9de):_0x4edcd8&&typeof _0x4edcd8==_0x309f74([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x309f74([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4edcd8)[_0x309f74([0x73,0x6f,0x72,0x74])]()[_0x309f74([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x34acfe,_0x41dead])=>{_0x2ccf8c(_0x34acfe),_0x19d9de(_0x41dead);}):_0x2ccf8c(window[_0x309f74([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4edcd8));}return _0x19d9de(_0x134551),_0xaabca6>>>0x0;}function _0x1c8045(_0x50f54a){return _0x50f54a[_0x309f74([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x309f74([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x309f74([0x30]));}function _0x201526(_0x4db04f){return _0x4db04f[_0x309f74([0x73,0x70,0x6c,0x69,0x74])]('')[_0x309f74([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x309f74([0x6a,0x6f,0x69,0x6e])]('');}function _0x3b58a5(){}function _0x309f74(_0x2a67b8){return _0x2a67b8['map'](_0x2923bb=>String['fromCharCode'](_0x2923bb))['join']('');}_0x3898dc(await _0x26106d());}(this);}['showFakeVisualSelection'](){const _0x229ac4=this['editor']['model'];_0x229ac4['change'](_0x188fde=>{const _0x28d22c=_0x229ac4['document']['selection']['getFirstRange']();if(_0x229ac4['markers']['has'](u))_0x188fde['updateMarker'](u,{'range':_0x28d22c});else{if(_0x28d22c['start']['isAtEnd']){const _0x51e06d=_0x28d22c['start']['getLastMatchingPosition'](({item:_0x5f078e})=>!_0x229ac4['schema']['isContent'](_0x5f078e),{'boundaries':_0x28d22c});_0x188fde['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x188fde['createRange'](_0x51e06d,_0x28d22c['end'])});}else _0x188fde['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x28d22c});}});}['hideFakeVisualSelection'](){const _0x75c822=this['editor']['model'];_0x75c822['markers']['has'](u)&&_0x75c822['change'](_0x4f56fb=>{_0x4f56fb['removeMarker'](u);});}['insertContent'](_0xd4601e,_0x5abe56){const _0x19a80a=_0x5abe56||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x19a80a))return;const _0x783123=this['editor']['data']['processor']['toView'](_0xd4601e),_0x5c7695=this['editor']['data']['toModel'](_0x783123);this['editor']['model']['change'](_0x4fe2b3=>{this['hideFakeVisualSelection']();const _0x3af65f=this['editor']['model']['insertContent'](_0x5c7695,_0x19a80a);_0x3af65f&&_0x4fe2b3['setSelection'](_0x3af65f);});}['insertContentBelow'](_0x4dbd3c){const {model:_0x861fbc}=this['editor'],_0x459380=Array['from'](_0x861fbc['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x159416=_0x459380['length']?_0x861fbc['createPositionAfter'](_0x459380['pop']()):_0x861fbc['document']['selection']['getLastPosition']();this['insertContent'](_0x4dbd3c,_0x159416);}}class v extends _0x740163{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x28a405('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x278ed4){super(_0x278ed4),this['name']='AIRequestError';}}function i(_0x105345,_0x2edd63,_0x1228c5){const t=_0x105345['t'];switch(_0x2edd63){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',_0x1228c5);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1228c5);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'},_0x1228c5);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 _0x2edd63;}}class y extends _0x37b907{['_commandDefinitions'];constructor(_0x155d9a,_0x497d20){super(_0x155d9a),this['_commandDefinitions']=_0x497d20,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xd6da34,_0xda03ad,_0x5a595d)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x5a595d));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2b7f47,_0x2b4bd9,_0xd85455)=>{this['enabledCommandsIds']=_0xd85455?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5ad0d5=this['editor']['model'];this['_hasContext']=function(_0xba4dae){const _0x553079=_0xba4dae['document']['selection'];return _0x553079['isCollapsed']?0x0!==[..._0x553079['getSelectedBlocks']()]['length']&&![..._0x553079['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xba4dae['hasContent'](_0x553079['getFirstRange']());}(_0x5ad0d5);const _0x6f87cf=_0x5ad0d5['document']['selection'],_0x59b6f0=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1a7dfb of _0x6f87cf['getRanges']())for(const _0x573d98 of _0x1a7dfb['getItems']())if(_0x573d98['is']('element')&&_0x59b6f0['includes'](_0x573d98['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x19bd8c='',_0x2199b4='',_0xcfc69f='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x19bd8c,_0x2199b4,_0xcfc69f);}}function G(_0x2595e8,_0x421e98){const _0x2ee73f=new Set();for(const _0xdcd120 of _0x2595e8['values']())(_0x421e98||!0x1===_0xdcd120['requiresContent'])&&_0x2ee73f['add'](_0xdcd120['id']);return Array['from'](_0x2ee73f);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x14cf87(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x41d0fb,_0x8741c2,_0x452277){super(),this['editor']=_0x41d0fb,this['textAdapter']=_0x8741c2,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x452277,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4ad3c5,_0x1bf53c,_0x5785cf)=>{this['view']['value']=this['_sanitizeHTML'](_0x5785cf);}),this['listenTo'](this['view'],'submitPrompt',(_0x3813a,_0x446c6b)=>{const _0x2cf8c0=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x446c6b,_0x2cf8c0,'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:_0x1e827b,query:_0x39e79c,htmlContent:_0x594e24,label:_0x162834,mainActionLabel:_0x4fe82d}){this['view']['prompt']=_0x162834,this['view']['mainAction']=_0x4fe82d,this['initialContext']=_0x594e24,_0x39e79c&&(this['view']['isRendered']?this['_handleQuery'](_0x39e79c,_0x594e24,_0x1e827b,_0x162834):this['view']['once']('render',()=>{this['_handleQuery'](_0x39e79c,_0x594e24,_0x1e827b,_0x162834);}));}['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'](_0x10394f,_0x48073f,_0x145795,_0x1e58c0){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x48073f,this['previousQuery']=_0x10394f,this['previousLabel']=_0x1e58c0||_0x10394f,this['previousActionId']=_0x145795,new Promise(_0xbd5690=>{this['textAdapter']['makeRequest']({'query':_0x10394f,'context':_0x48073f,'onData':_0x216283=>{this['currentResponse']=_0x216283,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x145795})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1fa87f=>{_0x1fa87f instanceof R?this['view']['handleError'](_0x1fa87f['message']):this['view']['handleError'](),_0xbd5690();})['finally'](()=>{this['stopProcessing'](),_0xbd5690();});});}['_parseAndNormalizeContent'](_0x576177,_0x567963=!0x1){const _0x1f70b5=Z['exec'](_0x576177);_0x576177=_0x1f70b5?_0x576177['substring'](_0x1f70b5[0x1]['length']):_0x576177['length']<0x64&&!_0x567963?'':this['_stripMarkdownSyntax'](_0x576177);const _0x567594=this['_domParser']['parseFromString'](_0x576177,'text/html');if(_0x1f70b5){const _0x20a71f=Array['from'](_0x567594['body']['childNodes']);_0x20a71f['reverse']();for(const _0x29edae of _0x20a71f){if(_0x29edae['nodeType']==Node['ELEMENT_NODE'])break;_0x29edae['remove']();}}const _0x2921b3=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x567594['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2921b3),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x2921b3));}['_normalizeResponseHeadings'](_0x3b0e9b){const _0x5ec3e6=new _0x3814a8(this['editor']['editing']['view']['document']),_0x5750c4=new _0x37008a({'name':/^h[1-5]$/}),_0x5ec90c=[];let _0x4521c5=!0x1;for(const _0x50022a of _0x3b0e9b)_0x50022a['is']('element')&&_0x5750c4['match'](_0x50022a)&&(_0x5ec90c['push'](_0x50022a),'h1'==_0x50022a['name']&&(_0x4521c5=!0x0));if(_0x4521c5){for(const _0x36d1f9 of _0x5ec90c)_0x5ec3e6['rename']('h'+(parseInt(_0x36d1f9['name'][0x1])+0x1),_0x36d1f9);}}['_isH1TagSupportEnabled'](){const {data:_0x5d20ee,editing:_0x2941fa}=this['editor'],_0x53cdd9=_0x5d20ee['htmlProcessor']['toView']('<h1></h1>'),_0x4e749d=_0x5d20ee['toView'](_0x5d20ee['toModel'](_0x53cdd9));return!!_0x2941fa['view']['domConverter']['viewToDom'](_0x4e749d)['querySelector']('h1');}['_sanitizeHTML'](_0x3e0927){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3e0927),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xf28369){const _0x415824=_0xf28369['trim']();return _0x415824['startsWith']('```html')?_0x415824['endsWith']('```')?_0x415824['substring'](0x7,_0x415824['length']-0x3):_0x415824['substring'](0x7):_0xf28369;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x5d5558){super(_0x5d5558),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xdd2cee=>i(_0x5d5558,'AI_'+_0xdd2cee['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5d5558,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5d5558,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5d5558,'Stop'));const _0x5ede44=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5ede44['if']('isVisible','ck-hidden',_0x2180e3=>!_0x2180e3)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4f3758,_0x58cb5b){const _0x2efb50=new _0x49b067(this['locale']);return _0x2efb50['set']({'label':_0x4f3758,'class':_0x58cb5b||'','isVisible':!0x0,'withText':!0x0}),_0x2efb50;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x1e2f2b{['contentFieldView'];['copyButtonView'];constructor(_0x4cd36d,_0x2917db=''){super(_0x4cd36d),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3d177d=this['bindTemplate'];this['contentFieldView']=new ct(_0x4cd36d,_0x2917db),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3d177d['if']('isVisible','ck-hidden',_0x5b287e=>!_0x5b287e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3d177d['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 _0x354ea2=!0x1;this['on']('change:value',(_0x34830d,_0x6c3c49,_0x414345)=>{const _0x27828c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x414345),this['isProcessing']&&_0x27828c&&!_0x354ea2&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4412e3,_0x26dc6a,_0x451d51)=>{_0x354ea2=!0x1,_0x451d51?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x354ea2=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x354ea2=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x558a41=this['locale'],_0x5d8520=new _0x49b067(this['locale']),_0x17c54d='ck-ai-form__copy-button';return _0x5d8520['set']({'label':i(_0x558a41,'Copy'),'icon':U,'class':_0x17c54d,'tooltip':!0x0}),_0x5d8520['bind']('isVisible')['to'](this,'value',_0x4402a0=>!!_0x4402a0),_0x5d8520['bind']('isEnabled')['to'](this,'isProcessing',_0x45c6e9=>!_0x45c6e9),_0x5d8520['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5d8520['icon']=_0x3db9be['check'],_0x5d8520['class']=_0x17c54d+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5d8520['icon']=U,_0x5d8520['class']=_0x17c54d;},0x3e8);}),_0x5d8520;}['_copyHTMLToClipboard'](_0x11d67b){const {window:_0x9a84e1,document:_0x3a5f9b}=_0x2c00ed;if(_0x9a84e1['ClipboardItem']){const {Blob:_0x5aba67,ClipboardItem:_0x1a3e0e}=_0x9a84e1,_0x1dfe39=[new _0x1a3e0e({'text/html':new _0x5aba67([_0x11d67b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5aba67([_0x11d67b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1dfe39);}else{const _0x11f884=_0x3a5f9b['createElement']('div');_0x11f884['style']['position']='absolute',_0x11f884['style']['left']='-9999px',_0x11f884['innerHTML']='<span>[</span>'+_0x11d67b['innerHTML']+'<span>]</span>',_0x3a5f9b['body']['appendChild'](_0x11f884);const _0x149307=_0x3a5f9b['createRange']();_0x149307['setStartAfter'](_0x11f884['firstElementChild']),_0x149307['setEndBefore'](_0x11f884['lastElementChild']);const _0x5a3f88=_0x9a84e1['getSelection']();_0x5a3f88['removeAllRanges'](),_0x5a3f88['addRange'](_0x149307),_0x3a5f9b['execCommand']('copy'),_0x11f884['remove']();}}}class ct extends _0x1e2f2b{constructor(_0x3d3f81,_0x3102ab=''){super(_0x3d3f81),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3102ab,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1cba8c){this['element']['innerHTML']=_0x1cba8c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x310ff0=new _0x1e2f2b(),_0x2b3420=this['locale'],_0x2a7d06=new _0x333db7();return _0x2a7d06['isVisible']=!0x0,_0x310ff0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2a7d06,{'text':i(_0x2b3420,'AI\x20is\x20writing...')}]}),_0x310ff0['render'](),_0x310ff0;}}class tt extends _0x1e2f2b{constructor(_0x4a72f2,_0x1f95eb=''){super(_0x4a72f2);const _0x572f2e=new _0x3c7bbf(),_0x1d4640=this['bindTemplate'];this['set']('text',_0x1f95eb),_0x572f2e['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x572f2e,{'text':_0x1d4640['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2d94f7,_0xc9ccac){super(_0x2d94f7,_0xc9ccac),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',(_0x483325,_0x591dde)=>{_0x483325['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x591dde());});}['_createSubmitButton'](){const _0xa99908=new _0x49b067(this['locale']),_0x43bade=this['locale'];return _0xa99908['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x43bade,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xa99908['on']('execute',()=>{this['submit']();}),_0xa99908['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5df8c5,_0x37bb5a)=>!_0x5df8c5&&_0x37bb5a),_0xa99908;}['_createShowHistoryButton'](){const _0x3b5b2a=new _0x49b067(this['locale']),_0x4b1916=this['resultsView'],_0x282c61=this['locale'];_0x3b5b2a['set']({'label':i(_0x282c61,'History'),'withText':!0x1,'icon':_0x3db9be['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3b5b2a['bind']('isOn')['to'](_0x4b1916,'isVisible'),_0x3b5b2a['bind']('isEnabled')['to'](this,'isEnabled'),_0x3b5b2a['on']('execute',()=>{_0x4b1916['isVisible']=!_0x4b1916['isVisible'],_0x4b1916['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x558d76=()=>{_0x2c00ed['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x2f4a08=new st(this['queryView']['fieldView']['element']),_0x1b265d=_0x2f4a08['width'],_0x5513b3='rtl'===_0x282c61['uiLanguageDirection']?'left':'right';_0x2f4a08['excludeScrollbarsAndBorders'](),_0x3b5b2a['element']['style'][_0x5513b3]=_0x1b265d-_0x2f4a08['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x558d76),this['on']('render',_0x558d76),_0x3b5b2a;}['submit'](){const _0x316500=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x316500);}['focus'](_0x5b8234){-0x1===_0x5b8234?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x1e76b9){super(_0x1e76b9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x1e76b9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2bd864=0x0;for(const _0x5531c1 of this['items'])_0x2bd864+=_0x5531c1['items']['length'];return{'resultsCount':_0x2bd864,'totalItemsCount':_0x2bd864};}['_createClearHistoryButton'](){const _0x2cb519=this['locale'],_0x1fc91f=new _0x49b067(this['locale']);return _0x1fc91f['set']({'label':'('+i(_0x2cb519,'Clear')+')','withText':!0x0}),_0x1fc91f['on']('execute',()=>this['fire']('clearHistory')),_0x1fc91f;}}class hs extends _0x199798{constructor(_0x2673e3){super();const _0x347e76=new te(),_0x2b69ba=new _0x49b067(this['locale'],_0x347e76);this['children']['add'](_0x2b69ba),_0x2b69ba['set']({'label':_0x2673e3['prompt'],'withText':!0x0}),_0x2b69ba['on']('execute',()=>{this['fire']('execute',{'value':_0x36a397(_0x2673e3['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4f0bc8{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x59fbc0,_0x35aed7)=>{const _0x344369=Ss(_0x35aed7['prompt']);for(const _0x49a30d of this)if(_0x49a30d!=_0x35aed7&&Ss(_0x49a30d['prompt'])===_0x344369){this['remove'](_0x49a30d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4da9ad=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x4da9ad));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x256c95=>_0x256c95)));}}function Ss(_0x34d5f1){return _0x34d5f1['toLowerCase']()['trim']();}class K extends _0x1e2f2b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x98758f,_0x4b2c03,_0x50b4b4=''){super(_0x98758f),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x98758f),this['contentArea']=new W(_0x98758f,_0x50b4b4),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 _0xdbbf41(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0xb0a8a4({'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 _0x159d51=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4b2c03],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x159d51['if']('isError','ck-hidden',_0x15ffd3=>!_0x15ffd3)]},'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'](_0x207eb9=0x1){-0x1===_0x207eb9?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 _0x418cd8=this['locale'],_0x61cc66=new ht(_0x418cd8,{'queryView':{'label':i(_0x418cd8,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2c36e4,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x418cd8,'Empty\x20history'),'secondary':i(_0x418cd8,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x61cc66['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2021c4,_0x3155dc)=>_0x2021c4&&!_0x3155dc),this['listenTo'](_0x61cc66,'submit',(_0x4a9299,_0x2d7d43)=>{this['prompt']=_0x2d7d43;const _0x581311=_0x4b0212(_0x2d7d43);this['fire']('submitPrompt',_0x581311),_0x2d7d43['trim']()&&this['_promptHistory']['add']({'prompt':_0x581311},0x0);},{'priority':'high'}),_0x61cc66;}['_createHistoryView'](){const _0x34a533=new rs(this['locale']);return _0x34a533['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x34a533['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x34a533;}['_createToolbar'](){const _0x4e3cb9=new nt(this['locale']);return _0x4e3cb9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4db0ab,_0x290012,_0x512eef)=>_0x4db0ab&&!_0x290012&&!!_0x512eef),_0x4e3cb9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4e3cb9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x8c0bcf,_0x43411f,_0x53d08c)=>_0x8c0bcf&&!_0x43411f&&!!_0x53d08c),_0x4e3cb9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4e3cb9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x305002,_0x550496)=>_0x305002&&!_0x550496),_0x4e3cb9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4e3cb9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4e3cb9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4e3cb9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x164091=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x164091,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4bd6ed){const _0x113362=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4bd6ed||i(_0x113362,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x740163{['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[_0xf475c8,a,v,_0x397529];}constructor(_0x414e7f){super(_0x414e7f),_0x414e7f['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x414e7f['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x414e7f['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x414e7f['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x40b06f}=this;this['_aiAdapter']=_0x40b06f['plugins']['get'](v),this['_dialog']=_0x40b06f['plugins']['get'](_0x397529),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x24c5de=new y(_0x40b06f,Array['from'](this['_commandDefinitions']['values']()));_0x40b06f['commands']['add']('showAIAssistant',_0x24c5de),_0x40b06f['ui']['componentFactory']['add']('aiCommands',_0x20b2ca=>{const _0x1bcb60=_0x9473b8(_0x20b2ca);return _0x1bcb60['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1bcb60['buttonView']['set']({'label':i(_0x20b2ca,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x1bcb60['on']('execute',_0x394841=>this['_onExecute'](_0x394841['source']['id'])),_0x4e5c7e(_0x1bcb60,_0x40b06f['ui']['view']['body'],function(_0x2ecba6){const _0x284b81=o(_0x2ecba6['config']['get']('ai.aiAssistant.commands'),_0x2ecba6['locale']),_0x5d4320=B(_0x2ecba6,_0x284b81)['filter'](_0x4d56f3=>_0x4d56f3['commands']['length']);if(0x1===_0x5d4320['length'])return B(_0x2ecba6,_0x5d4320[0x0]['commands'])['map'](_0x420e97=>({'id':_0x420e97['id'],'label':_0x420e97['label']}));return _0x5d4320['map'](_0x18c12c=>{const {groupId:_0x40ef2c,groupLabel:_0xfc267e,commands:_0x3c91e5}=_0x18c12c,_0x491718=B(_0x2ecba6,_0x3c91e5)['map'](_0x15c635=>({'id':_0x15c635['id'],'label':_0x15c635['label']}));return{'id':_0x40ef2c,'menu':_0xfc267e||_0x40ef2c,'children':_0x491718};});}(_0x40b06f),{'ariaLabel':i(_0x20b2ca,'AI\x20Commands')}),_0x1bcb60['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x24c5de['on']('change:enabledCommandsIds',_0x377a2e),_0x1bcb60['menuView']['once']('render',_0x377a2e),_0x1bcb60;function _0x377a2e(){_0x1bcb60['isEnabled']=_0x24c5de['enabledCommandsIds']['length']>0x0;for(const _0x24a234 of _0x1bcb60['menuView']['buttons'])_0x24a234['isEnabled']=_0x24c5de['enabledCommandsIds']['includes'](_0x24a234['id']);}}),_0x40b06f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x138527=>{const _0x4033ec=new _0x27343b(_0x138527);_0x4033ec['buttonView']['set']({'label':i(_0x138527,'AI\x20Commands'),'icon':E}),_0x4033ec['bind']('isEnabled')['to'](_0x24c5de,'enabledCommandsIds',_0x37a590=>_0x37a590['length']>0x0);const _0x4761aa=o(_0x40b06f['config']['get']('ai.aiAssistant.commands'),_0x138527);return this['_populateMenuBarMenu'](_0x24c5de,_0x4033ec,_0x4761aa,_0x5b4513=>this['_onExecute'](_0x5b4513)),_0x4033ec;}),_0x40b06f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3783f5=this['_createAIAssistantUIButton'](_0x49b067);return _0x3783f5['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3783f5;}),_0x40b06f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5850e6=this['_createAIAssistantUIButton'](_0x521807);return _0x5850e6['set']({'role':'menuitemcheckbox'}),_0x5850e6;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x7217e4=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4bb33f;for(const _0x219d84 in _0x7217e4){const _0x1896ee=_0x219d84,_0x1c3dee=_0x7217e4[_0x1896ee];if('aiLicenseKeyValid'==_0x1c3dee||'aiLicenseKeyInvalid'==_0x1c3dee||'aiLicenseKeyExpired'==_0x1c3dee||'aiLicenseKeyDomainLimit'==_0x1c3dee||'aiLicenseKeyNotAllowed'==_0x1c3dee||'aiLicenseKeyEvaluationLimit'==_0x1c3dee||'aiLicenseKeyTrialLimit'==_0x1c3dee||'aiLicenseKeyDevelopmentLimit'==_0x1c3dee||'aiLicenseKeyUsageLimit'==_0x1c3dee){delete _0x7217e4[_0x1896ee],_0x4bb33f=_0x1c3dee,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4bb33f&&_0x7217e4['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4bb33f&&_0x7217e4['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4bb33f&&_0x7217e4['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4bb33f&&_0x7217e4['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4bb33f&&_0x7217e4['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4bb33f&&_0x7217e4['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x4bb33f&&_0x7217e4['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x4bb33f&&_0x7217e4['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x58b27e='',_0x5194d9='',_0x1b4150='custom'){const _0x207e3f=this['editor'],_0x5396cd=_0x207e3f['editing']['view'],_0xa20819=_0x207e3f['plugins']['get'](a),_0x36c97d=_0x207e3f['plugins']['get'](_0xf475c8);_0xa20819['showFakeVisualSelection']();const _0x9b0b2c=new j(),_0x13ed4b=new ClipboardEvent('copy',{'clipboardData':_0x9b0b2c}),_0x598787=new _0x4a30d7(_0x9b0b2c),_0x118ca6=new _0xfde60d(_0x5396cd,_0x13ed4b,{'dataTransfer':_0x598787});_0x36c97d['_forceMarkersCopy']('comment',()=>{_0x5396cd['document']['fire']('copy',_0x118ca6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x207e3f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2191d4=_0x598787['getData']('text/html');const _0x37b22a=_0x207e3f['model']['document']['selection'],_0x526b1c=Array['from'](_0x37b22a['getRanges']());0x1===_0x526b1c['length']&&_0x526b1c[0x0]['isFlat']&&!_0x37b22a['getSelectedElement']()&&''!==_0x2191d4['replace'](/ /g,'')['trim']()&&(_0x2191d4='<p>'+_0x2191d4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1b4150,'query':_0x58b27e,'htmlContent':_0x2191d4,'label':_0x5194d9,'mainActionLabel':x[_0x207e3f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3b5f22['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xa20819['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x504b1b=new Map(),_0x39f914=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x5b4a4e of _0x39f914)for(const _0x5c7ad4 of _0x5b4a4e['commands'])_0x504b1b['set'](_0x5c7ad4['id'],{..._0x5c7ad4,'groupId':_0x5b4a4e['groupId'],'groupLabel':_0x5b4a4e['groupLabel']||_0x5b4a4e['groupId']});return _0x504b1b;}['_createAIAssistantUIButton'](_0x46babf){const _0x1ecce5=this['editor'],_0x4a6adb=_0x1ecce5['commands']['get']('showAIAssistant'),_0x504519=new _0x46babf(_0x1ecce5['locale']);return _0x504519['set']({'label':i(_0x1ecce5['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x504519['bind']('isEnabled')['to'](_0x4a6adb),_0x504519['bind']('isOn')['to'](this['_dialog'],'id',_0x61ed7e=>'aiAssistant'===_0x61ed7e),this['listenTo'](_0x504519,'execute',()=>{_0x504519['isOn']?this['hideUI']():_0x4a6adb['execute']();}),_0x504519;}['_initView'](){const _0x4055c7=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',()=>{_0x4055c7['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4055c7['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x31e643,ui:{ariaLiveAnnouncer:_0x2329fd}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x12101d,_0x5e1ed1,_0x3e79a2)=>{const _0x4fcda2=this['_aiAssistantController']['currentContext'];_0x3e79a2?_0x2329fd['announce'](i(_0x31e643,'AI\x20is\x20writing')):_0x4fcda2&&_0x2329fd['announce'](i(_0x31e643,'Generated\x20content:\x20%0',_0x4fcda2),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4cc9de,_0x57b8da,_0x395cf5)=>{if(_0x395cf5){const _0x7d94ae=this['_formView']['errorView']['text'];_0x2329fd['announce'](i(_0x31e643,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x7d94ae));}});}['_onExecute'](_0x37a26e){const _0x5f1a77=this['_commandDefinitions']['get'](_0x37a26e),_0x17cbdc=this['editor'],_0x5d3e93=_0x17cbdc['model']['document']['selection'],_0x3b4900=_0x17cbdc['commands']['get']('showAIAssistant'),_0x296e4b=_0x17cbdc['plugins']['get'](a),_0x2382a3=''+(_0x5f1a77['groupId']!==I?_0x5f1a77['groupLabel']+':\x20':'')+_0x5f1a77['label'];if(!0x1!==_0x5f1a77['requiresContent']&&_0x5d3e93['isCollapsed']){const _0x12fe6f=_0x728ec3(_0x5d3e93['getSelectedBlocks']())||_0x17cbdc['model']['schema']['getLimitElement'](_0x5d3e93);_0x17cbdc['model']['change'](_0x11de0e=>{_0x11de0e['setSelection'](_0x12fe6f,'in');});}_0x296e4b['showFakeVisualSelection'](),_0x3b4900['execute'](_0x5f1a77['prompt'],_0x2382a3,'command:'+_0x37a26e);}['_populateMenuBarMenu'](_0x17242d,_0x64d004,_0x13695f,_0x381264){const _0x5f5938=this['editor'],_0x255a5b=_0x5f5938['locale'],_0x56eb28=new _0x16117c(_0x255a5b),_0x36184f=B(_0x5f5938,_0x13695f)['filter'](_0x53b7c4=>_0x53b7c4['commands']['length']);0x1===_0x36184f['length']?this['_getMenuBarGroupButtons']({'command':_0x17242d,'commands':_0x36184f[0x0]['commands'],'parentMenuView':_0x64d004,'onExecute':_0x381264})['forEach'](_0x4c6573=>_0x56eb28['items']['add'](_0x4c6573)):_0x36184f['forEach'](({groupId:_0x1138e3,groupLabel:_0x31576,commands:_0x1747f2})=>{const _0x1723c0=new _0x3e9322(_0x255a5b,_0x64d004),_0xba0eb8=new _0x27343b(_0x255a5b),_0x4f6148=new _0x16117c(_0x255a5b),_0x15708f=this['_getMenuBarGroupButtons']({'command':_0x17242d,'commands':_0x1747f2,'parentMenuView':_0xba0eb8,'onExecute':_0x381264});_0xba0eb8['buttonView']['set']({'label':_0x31576||_0x1138e3}),_0xba0eb8['delegate']('execute')['to'](_0x64d004),_0x4f6148['items']['addMany'](_0x15708f),_0xba0eb8['panelView']['children']['add'](_0x4f6148),_0x1723c0['children']['add'](_0xba0eb8),_0x56eb28['items']['add'](_0x1723c0);}),_0x64d004['panelView']['children']['add'](_0x56eb28);}['_getMenuBarGroupButtons']({command:_0x575e66,commands:_0x3ead74,parentMenuView:_0x23db51,onExecute:_0x596299}){const _0x4a8e84=this['editor'],_0x35df28=_0x4a8e84['locale'];return B(_0x4a8e84,_0x3ead74)['map'](_0x41a4a4=>{const _0x38bf8a=new _0x3e9322(_0x35df28,_0x23db51),_0x5cd99f=new _0x521807(_0x35df28);return _0x5cd99f['set']({'label':_0x41a4a4['label']}),_0x5cd99f['delegate']('execute')['to'](_0x23db51),_0x5cd99f['on']('execute',()=>_0x596299(_0x41a4a4['id'])),_0x5cd99f['bind']('isEnabled')['to'](_0x575e66,'enabledCommandsIds',_0x5245ba=>_0x5245ba['includes'](_0x41a4a4['id'])),_0x38bf8a['children']['add'](_0x5cd99f),_0x38bf8a;});}}function _(_0x137b01,_0x85434e){return void 0x0!==_0x137b01['order']&&void 0x0===_0x85434e['order']?0x1:void 0x0===_0x137b01['order']&&void 0x0!==_0x85434e['order']?-0x1:void 0x0!==_0x137b01['order']&&void 0x0!==_0x85434e['order']?_0x137b01['order']-_0x85434e['order']:0x0;}function B(_0x185608,_0x7db59d){_0x7db59d['sort'](_);const _0x66a7a2={},_0x38135d=[];for(const _0x5460a0 of _0x7db59d)if(void 0x0!==_0x5460a0['order']){if(_0x5460a0['order']in _0x66a7a2)throw new _0x28a405('ai-commands-config-order-collision',_0x185608,{'conflictingDefinitions':[_0x5460a0,_0x66a7a2[_0x5460a0['order']]]});_0x66a7a2[_0x5460a0['order']]=_0x5460a0,_0x38135d['splice'](_0x5460a0['order'],0x0,_0x5460a0);}else _0x38135d['push'](_0x5460a0);return _0x38135d;}class r extends _0x740163{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x223aa4){super(_0x223aa4);const _0x1f6010=_0x223aa4['config'],_0x1eed84=_0x223aa4['locale'];_0x1f6010['define']('ai.aiAssistant.commands',function(_0xbf1484){return[{'groupId':'editOrReview','groupLabel':i(_0xbf1484,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xbf1484,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xbf1484,'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(_0xbf1484,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xbf1484,'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(_0xbf1484,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xbf1484,'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(_0xbf1484,'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(_0xbf1484,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xbf1484,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xbf1484,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xbf1484,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xbf1484,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xbf1484,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xbf1484,'Change\x20style'),'commands':[{'id':'business','label':i(_0xbf1484,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xbf1484,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xbf1484,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xbf1484,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xbf1484,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xbf1484,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xbf1484,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xbf1484,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xbf1484,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xbf1484,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xbf1484,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xbf1484,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xbf1484,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x1eed84)),_0x1f6010['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1f6010['define']('ai.aiAssistant.removeCommands',[]);const _0x4fb4c5=o(_0x1f6010['get']('ai.aiAssistant.commands'),_0x1eed84),_0x2717ef=_0x1f6010['get']('ai.aiAssistant.extraCommandGroups'),_0x41aa0a=_0x1f6010['get']('ai.aiAssistant.removeCommands');_0x2717ef['forEach'](_0x16d754=>{const _0x4de538=_0x4fb4c5['find'](_0x4b19a7=>_0x4b19a7['groupId']===_0x16d754['groupId']);_0x4de538?_0x4de538['commands']=_0x4de538['commands']['concat'](_0x16d754['commands']):_0x4fb4c5['push'](_0x16d754);}),_0x4fb4c5['forEach'](_0xc7dc07=>{_0xc7dc07['commands']=_0xc7dc07['commands']['filter'](_0xfa26d=>!_0x41aa0a['includes'](_0xfa26d['id']));}),_0x1f6010['set']('ai.aiAssistant.commands',_0x4fb4c5);}}class P extends _0x740163{['abortController'];static get['requires'](){return[v];}constructor(_0x145117){super(_0x145117),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x284294){return this['sendRequest'](_0x284294)['catch'](_0x73f3f6=>{if(_0x73f3f6 instanceof R)return Promise['reject'](_0x73f3f6);if('AbortError'==_0x73f3f6['name'])return Promise['resolve']();throw console['error'](_0x73f3f6),new _0x28a405('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x344ec3,_0x3b6891){const _0x3aa336=this['editor']['locale'],_0xa9150f={'Content-Type':'application/json'};if('object'==typeof _0x344ec3)Object['assign'](_0xa9150f,_0x344ec3);else{if(_0x344ec3)try{const _0x5a3599=await _0x344ec3(_0x3b6891);Object['assign'](_0xa9150f,_0x5a3599);}catch(_0x99ca26){return Promise['reject'](new R(i(_0x3aa336,'AI_ERROR_GET_HEADERS')));}}return _0xa9150f;}async['_prepareRequestParameters'](_0x4a50f1,_0x4b8ae6){const _0x5d3feb=this['editor']['locale'];if('object'==typeof _0x4a50f1)return _0x4a50f1;try{return await _0x4a50f1(_0x4b8ae6);}catch(_0x1df958){return Promise['reject'](new R(i(_0x5d3feb,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x48d96b){super(_0x48d96b),_0x48d96b['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x48d96b['config']['get']('ai.openAI.requestParameters')||_0x48d96b['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x48d96b['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x48d96b['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x48d96b['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x317fbe,context:_0x42f290,onData:_0x412175,actionId:_0x3cf896}){const _0x29e610=this['editor']['locale'],_0x28eb8f=await this['prepareMessages'](_0x317fbe,_0x42f290,_0x3cf896),_0xa9a36=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3cf896),_0x242af2=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3cf896),_0x21e027={'messages':_0x28eb8f,..._0x242af2},_0x406ce0={'method':'POST','headers':_0xa9a36,'body':JSON['stringify'](_0x21e027),'signal':this['abortController']['signal']},_0x153627=await fetch(this['_apiUrl'],_0x406ce0);if(_0x153627['ok'])return _0x242af2['stream']?await this['_readStreamableResponse'](_0x153627,_0x412175):await this['_readStaticResponse'](_0x153627,_0x412175),Promise['resolve']();{const _0x42599f=await _0x153627['text']();return _0x42599f['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x29e610,'AI_ERROR_CONTEXT_LENGTH'))):_0x42599f['includes']('Moderation')?Promise['reject'](new R(i(_0x29e610,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x42599f));}}async['prepareMessages'](_0x26d138,_0x5494ac,_0x5697c6){let _0x5b6b18,_0x473059;return _0x5494ac?(_0x5b6b18='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.',_0x473059='Instruction:\x0a'+_0x26d138+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5494ac):(_0x5b6b18='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.',_0x473059=_0x26d138),[{'role':'system','content':_0x5b6b18},{'role':'user','content':_0x473059}];}async['_readStreamableResponse'](_0x3cdc9f,_0x30f3bc){const _0x353509=_0x3cdc9f['body']['getReader'](),_0xf4660c=new TextDecoder();let _0x141012='',_0x40e144='',_0x11a5b7='',_0x121fb9=!0x1;for(;!_0x121fb9;){const {done:_0x4b5d5b,value:_0x38a6f8}=await _0x353509['read'](),_0x2c8d28=_0x141012+_0xf4660c['decode'](_0x38a6f8);let _0x582fa7='';_0x121fb9=_0x4b5d5b;try{_0x582fa7=this['_cleanUpData'](_0x2c8d28),_0x141012='';}catch(_0xd0fbb0){_0x141012=_0x2c8d28;continue;}_0x40e144+=_0x582fa7,!_0x121fb9&&this['_isBufferIncomplete'](_0x40e144)||_0x40e144&&(_0x11a5b7+=_0x40e144,_0x40e144='',_0x30f3bc(_0x11a5b7));}return Promise['resolve']();}async['_readStaticResponse'](_0x2128ce,_0x843611){return _0x843611((await _0x2128ce['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xe435ec){const _0x344f28=_0xe435ec['split']('<')['length']!==_0xe435ec['split']('>')['length'],_0x35e34b=_0xe435ec['length']<0x1e;return _0x344f28&&_0x35e34b;}['_cleanUpData'](_0x10dac0){return _0x10dac0['split'](/\n(?![^{]*\})/g)['map'](_0x967fbd=>_0x967fbd['replace']('data:\x20',''))['filter'](_0x21a5eb=>_0x21a5eb&&_0x21a5eb['length']>0x0&&'[DONE]'!==_0x21a5eb)['map'](_0x407773=>{const {choices:_0x481677}=JSON['parse'](_0x407773);if(_0x481677[0x0]&&_0x481677[0x0]['delta']&&_0x481677[0x0]['delta']['content'])return _0x481677[0x0]['delta']['content'];})['filter'](_0x503a99=>_0x503a99)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3f3f04){super(_0x3f3f04),_0x3f3f04['config']['get']('ai.aws.requestParameters')||_0x3f3f04['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']=_0x3f3f04['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3f3f04['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3f3f04['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3f3f04['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5ec6f5,context:_0x431a24,onData:_0x42cc13,actionId:_0x7fc780}){const {model:_0x546349,stream:_0x10cb2d,..._0x929fac}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x7fc780),_0x145373={'prompt':await this['preparePrompt'](_0x5ec6f5,_0x431a24,_0x546349,_0x7fc780),..._0x929fac};this['_apiUrl']?await this['_processProxyRequest'](_0x145373,_0x546349,_0x10cb2d,_0x42cc13,_0x7fc780):await this['_processAWSRequest'](_0x145373,_0x546349,_0x10cb2d,_0x42cc13);}async['preparePrompt'](_0x53b48d,_0x1e5193,_0x1804bf,_0x1a227c){let _0x45f824,_0x5f3c67;return _0x1e5193?(_0x45f824='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.',_0x5f3c67='Instruction:\x0a'+_0x53b48d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1e5193):(_0x45f824='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.',_0x5f3c67=_0x53b48d),'meta.llama'==this['getModelFamily'](_0x1804bf)?'<<SYS>>\x0a'+_0x45f824+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5f3c67+'\x0a[/INST]':'Human:\x0a'+_0x45f824+'\x0a'+_0x5f3c67+'\x0a\x0aAssistant:';}['getModelFamily'](_0x38e158){if(/^anthropic\.claude/['test'](_0x38e158))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x38e158))return'ai21.j2';if(/^cohere\.command/['test'](_0x38e158))return'cohere.command';if(/^meta\.llama/['test'](_0x38e158))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x38e158));}async['_processProxyRequest'](_0x301752,_0x1fa53c,_0x29bb44,_0x56155c,_0x2328dc){const _0x33d01e={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2328dc),'body':JSON['stringify']({..._0x301752,'model':_0x1fa53c,'stream':_0x29bb44}),'signal':this['abortController']['signal']},_0x33fa57=await fetch(this['_apiUrl'],_0x33d01e);_0x29bb44?await this['_readStreamableResponse'](_0x33fa57,_0x1fa53c,_0x56155c):await this['_readStaticResponse'](_0x33fa57,_0x1fa53c,_0x56155c);}async['_processAWSRequest'](_0x179665,_0x4b5d70,_0x5a9da3,_0x4bf7af){const _0x37b452=new _0x5e76d6(this['_bedrockClientConfig']),_0x3a8e47={'body':JSON['stringify'](_0x179665),'contentType':'application/json','accept':'application/json','modelId':_0x4b5d70};let _0x385a27;if(_0x5a9da3){const _0x41dd29=new _0x17e5e2(_0x3a8e47);_0x385a27=await _0x37b452['send'](_0x41dd29,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x385a27,_0x4b5d70,_0x4bf7af);}else{const _0xf5900=new _0x3edf03(_0x3a8e47);_0x385a27=await _0x37b452['send'](_0xf5900,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x385a27,_0x4b5d70,_0x4bf7af);}}async['_readAsyncIterableResponse'](_0x2ea45f,_0x22ebdb,_0x373a6e){const _0x3f5d96=_0x2ea45f['body'],_0x3b8217=new TextDecoder('utf-8');let _0x3a9225='';for await(const _0x2cd5fc of _0x3f5d96)if(_0x2cd5fc['chunk']){const _0x4ea533=_0x3b8217['decode'](_0x2cd5fc['chunk']['bytes']),_0x2c30d9=JSON['parse'](_0x4ea533);_0x3a9225+=this['_getGeneratedText'](_0x2c30d9,_0x22ebdb),_0x373a6e(_0x3a9225);}return Promise['resolve']();}async['_readStreamableResponse'](_0x25725f,_0x1d2185,_0x977169){const _0x34bf15=_0x25725f['body'],_0x162967=new TextDecoder('utf-8'),_0x2ce629=_0x34bf15['getReader']();let _0x465dd4='',_0x9481aa='',_0x2f9be0=!0x1;for(;!_0x2f9be0;){const {done:_0x104dc2,value:_0x12b527}=await _0x2ce629['read']();if(_0x2f9be0=_0x104dc2,_0x2f9be0)break;const _0x5b6de7=(_0x465dd4+_0x162967['decode'](_0x12b527))['split']('\x0a')['map'](_0x351ce7=>{try{return _0x465dd4='',JSON['parse'](_0x351ce7);}catch(_0x2e300c){return _0x465dd4=_0x351ce7,null;}})['filter'](_0x5d40ad=>null!==_0x5d40ad);_0x5b6de7['length']&&(_0x9481aa+=_0x5b6de7['map'](_0x56a28e=>this['_getGeneratedText'](_0x56a28e,_0x1d2185))['join'](''),_0x977169(_0x9481aa));}return Promise['resolve']();}async['_readStaticResponse'](_0x300091,_0x5754bc,_0x599bef){let _0x13e91d;return _0x13e91d=_0x300091 instanceof Response?await _0x300091['json']():JSON['parse'](Buffer['from'](_0x300091['body'])['toString']('utf8')),(_0x599bef(this['_getGeneratedText'](_0x13e91d,_0x5754bc)),Promise['resolve']());}['_getGeneratedText'](_0x1a3942,_0xa16eed){switch(this['getModelFamily'](_0xa16eed)){case'anthropic.claude':return _0x1a3942['completion'];case'ai21.j2':return _0x1a3942['completions'][0x0]['data']['text'];case'cohere.command':return _0x1a3942['generations'][0x0]['text'];case'meta.llama':return _0x1a3942['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x4118d5,Command as _0x3fe314,icons as _0x1f5b21}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x7db9a6,CKEditorError as _0x3dae1c,ObservableMixin as _0x3a78f0,global as _0x264feb,isVisible as it,Rect as st,Collection as _0x33f3a0,FocusTracker as _0x3bfe8b,KeystrokeHandler as ts,first as _0x394c8a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x4a1e32,View as _0x4db403,SpinnerView as _0x144044,IconView as _0x20b7cf,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x527391,ButtonLabelView as te,FocusCycler as _0x2e3072,createLabeledTextarea as _0x670262,Dialog as _0x256d65,createDropdown as _0x1a9681,addMenuToDropdown as _0x4caf28,MenuBarMenuView as _0xb1b468,MenuBarMenuListItemButtonView as _0x3da23c,DialogViewPosition as _0x2ee351,MenuBarMenuListView as _0x2b5e04,MenuBarMenuListItemView as _0x3dda89}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x979892,Matcher as _0x39ba42,DataTransfer as _0x3aa88c,DomEventData as _0x444174}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x44196b,escape as _0x4578be}from'lodash-es';import{ClipboardMarkersUtils as _0x8abf7d}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x1745da,InvokeModelWithResponseStreamCommand as _0xf8a334,InvokeModelCommand as _0x52b96e}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x3308c3,_0x5a013d){const _0x2e4925=(0x0,_0x5a013d['t'])('Other');return _0x3308c3['length']?'groupId'in _0x3308c3[0x0]?_0x3308c3:[{'groupId':I,'groupLabel':_0x2e4925,'order':0x1/0x0,'commands':_0x3308c3}]:[{'groupId':I,'groupLabel':_0x2e4925,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x4118d5{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c2f91}=this,_0x4c8ea3=['ck-fake-ai-selection'];_0x2c2f91['config']['get']('ai.useTheme')&&_0x4c8ea3['push']('ck-ai-assistant-ui_theme'),_0x2c2f91['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x4c8ea3,'priority':0xc}}),_0x2c2f91['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x35c9bb,{writer:_0x568e3c})=>{if(!_0x35c9bb['markerRange']['isCollapsed'])return null;const _0x1bfc46=_0x568e3c['createUIElement']('span');return _0x568e3c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1bfc46),_0x1bfc46;}});}['afterInit'](){!async function(_0x3623e6){const _0x5ce2aa=_0x4856bb([0x6c,0x42,0x54,0x5a,0x4e,0x75,0x65,0x31,0x56,0x64,0x62,0x69,0x33,0x63,0x30,0x35,0x6a,0x70,0x39,0x47,0x38,0x44,0x48,0x34,0x46,0x71,0x74,0x55,0x68,0x45,0x78,0x76,0x67,0x50,0x53,0x4a,0x79,0x7a,0x57,0x59,0x77,0x32,0x6f,0x4d,0x51,0x58,0x6b,0x36,0x61,0x43,0x52,0x4b,0x6e,0x66,0x73,0x72,0x37,0x6d,0x41,0x4c,0x4f,0x49]),_0x58f072=0x49b2cb93,_0x4fbce5=0x49b5931b^_0x58f072,_0x1d1a4e=window[_0x4856bb([0x44,0x61,0x74,0x65])][_0x4856bb([0x6e,0x6f,0x77])](),_0x4cc419=_0x3623e6[_0x4856bb([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x596e2a=new window[(_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x225c44=>{_0x4cc419[_0x4856bb([0x6f,0x6e,0x63,0x65])](_0x4856bb([0x72,0x65,0x61,0x64,0x79]),_0x225c44);}),_0x4c04bc={[_0x4856bb([0x6b,0x74,0x79])]:_0x4856bb([0x45,0x43]),[_0x4856bb([0x75,0x73,0x65])]:_0x4856bb([0x73,0x69,0x67]),[_0x4856bb([0x63,0x72,0x76])]:_0x4856bb([0x50,0x2d,0x32,0x35,0x36]),[_0x4856bb([0x78])]:_0x4856bb([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]),[_0x4856bb([0x79])]:_0x4856bb([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]),[_0x4856bb([0x61,0x6c,0x67])]:_0x4856bb([0x45,0x53,0x32,0x35,0x36])},_0x44a111=_0x4cc419[_0x4856bb([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4856bb([0x67,0x65,0x74])](_0x4856bb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xa0c5dc(){let _0x3fcc86,_0x46fc21=null,_0x187209=null;try{if(_0x44a111==_0x4856bb([0x47,0x50,0x4c]))return _0x4856bb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3fcc86=_0x58bc28(),!_0x3fcc86)return _0x4856bb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3fcc86[_0x4856bb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x187209=_0x279ae6(_0x3fcc86[_0x4856bb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3fcc86[_0x4856bb([0x6a,0x74,0x69])])),await _0x34d680()?_0x173aa9()?_0x2fb122()?_0x4856bb([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3581e4()?(_0x3fcc86[_0x4856bb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4856bb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x46fc21=_0x346f58(_0x4856bb([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3fcc86[_0x4856bb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4856bb([0x74,0x72,0x69,0x61,0x6c])&&(_0x46fc21=_0x346f58(_0x4856bb([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x3fcc86[_0x4856bb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4856bb([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x46fc21=_0x346f58(_0x4856bb([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x597e27()):_0x4856bb([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4856bb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4856bb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x22ad20){return _0x4856bb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2fb122(){const _0x49ff92=[_0x4856bb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4856bb([0x74,0x72,0x69,0x61,0x6c])][_0x4856bb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3fcc86[_0x4856bb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1d1a4e/0x3e8:0xe10*_0x4fbce5;return _0x3fcc86[_0x4856bb([0x65,0x78,0x70])]<_0x49ff92;}function _0x173aa9(){const _0x4fd076=_0x3fcc86[_0x4856bb([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4fd076&&(!!_0x4fd076[_0x4856bb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4856bb([0x2a]))||!!_0x4fd076[_0x4856bb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4856bb([0x41,0x49])));}function _0x3581e4(){const _0x3fff84=_0x3fcc86[_0x4856bb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3fff84||0x0==_0x3fff84[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3be105}=new URL(window[_0x4856bb([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3fff84[_0x4856bb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3be105))return!0x0;const _0x492652=_0x3be105[_0x4856bb([0x73,0x70,0x6c,0x69,0x74])](_0x4856bb([0x2e]));return _0x3fff84[_0x4856bb([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xdbcc59=>_0xdbcc59[_0x4856bb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4856bb([0x2a])))[_0x4856bb([0x6d,0x61,0x70])](_0x240026=>_0x240026[_0x4856bb([0x73,0x70,0x6c,0x69,0x74])](_0x4856bb([0x2e])))[_0x4856bb([0x73,0x6f,0x6d,0x65])](_0x56c2fe=>_0x492652[_0x4856bb([0x65,0x76,0x65,0x72,0x79])]((_0x46c069,_0x4f1774)=>_0x56c2fe[_0x4f1774]===_0x46c069||_0x56c2fe[_0x4f1774]===_0x4856bb([0x2a])));}function _0x597e27(){return _0x46fc21&&_0x187209?new window[(_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5bd2c1,_0x28020c)=>{_0x46fc21[_0x4856bb([0x74,0x68,0x65,0x6e])](_0x5bd2c1,_0x28020c),_0x187209[_0x4856bb([0x74,0x68,0x65,0x6e])](_0x1c3ffe=>{_0x1c3ffe!=_0x4856bb([0x56,0x61,0x6c,0x69,0x64])&&_0x5bd2c1(_0x1c3ffe);},_0x28020c);}):_0x46fc21||_0x187209||_0x4856bb([0x56,0x61,0x6c,0x69,0x64]);}}function _0x279ae6(_0x859c9d,_0x2919d0){return new window[(_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fef1c=>{if(_0x85dd4a())return _0x1fef1c(_0x4856bb([0x56,0x61,0x6c,0x69,0x64]));_0x520874(),_0x4cc419[_0x4856bb([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4856bb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4f712e=!0x1;const _0x3b40af=_0x7db9a6();function _0xc1450b(_0x31a5bc){return!!_0x31a5bc&&(typeof _0x31a5bc===_0x4856bb([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x31a5bc===_0x4856bb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x31a5bc[_0x4856bb([0x74,0x68,0x65,0x6e])]===_0x4856bb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x31a5bc[_0x4856bb([0x63,0x61,0x74,0x63,0x68])]===_0x4856bb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x127ec5(_0x20dd7d){_0x2a55f2(_0x20dd7d)[_0x4856bb([0x74,0x68,0x65,0x6e])](_0x21eb51=>{if(!_0x21eb51||_0x21eb51[_0x4856bb([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4856bb([0x6f,0x6b]))return _0x4856bb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2ee71a(_0x2a6b22(_0x3b40af+_0x2919d0))!=_0x21eb51[_0x4856bb([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4856bb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4856bb([0x56,0x61,0x6c,0x69,0x64]);})[_0x4856bb([0x74,0x68,0x65,0x6e])](_0x422e2d=>(_0x12a2c5(),_0x422e2d),()=>{const _0x4349f5=_0x4d1093();return null==_0x4349f5?(_0x12a2c5(),_0x4856bb([0x56,0x61,0x6c,0x69,0x64])):_0x4856bb(_0x1d1a4e-_0x4349f5>(0x6dbe4f93^_0x58f072)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4856bb([0x74,0x68,0x65,0x6e])](_0x1fef1c)[_0x4856bb([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1fef1c(_0x4856bb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2f012c=0x49842513^_0x58f072;function _0x12a2c5(){const _0x438876=_0x4856bb([0x6c,0x6c,0x63,0x74,0x2d])+_0x2ee71a(_0x2a6b22(_0x859c9d)),_0x265841=_0x48fb54(_0x2ee71a(window[_0x4856bb([0x4d,0x61,0x74,0x68])][_0x4856bb([0x63,0x65,0x69,0x6c])](_0x1d1a4e/_0x2f012c)));window[_0x4856bb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4856bb([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x438876,_0x265841);}function _0x4d1093(){const _0x175ef8=_0x4856bb([0x6c,0x6c,0x63,0x74,0x2d])+_0x2ee71a(_0x2a6b22(_0x859c9d)),_0xa2696b=window[_0x4856bb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4856bb([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x175ef8);return _0xa2696b?window[_0x4856bb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x48fb54(_0xa2696b),0x10)*_0x2f012c:null;}function _0x2a55f2(_0x10e871){return new window[(_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x24576a,_0x552092)=>{_0x10e871[_0x4856bb([0x74,0x68,0x65,0x6e])](_0x24576a,_0x552092),window[_0x4856bb([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x552092,0x49b31f53^_0x58f072);});}}_0x4cc419[_0x4856bb([0x6f,0x6e])](_0x4856bb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1f838a,_0x16e009)=>{if(_0x16e009[0x0]!=_0x859c9d)return _0x1fef1c(_0x4856bb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x16e009[0x1]={..._0x16e009[0x1],[_0x4856bb([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3b40af};},{[_0x4856bb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4856bb([0x68,0x69,0x67,0x68])}),_0x4cc419[_0x4856bb([0x6f,0x6e])](_0x4856bb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1f0f46=>{_0xc1450b(_0x1f0f46[_0x4856bb([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4f712e=!0x0,_0x127ec5(_0x1f0f46[_0x4856bb([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4856bb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4856bb([0x6c,0x6f,0x77])}),_0x596e2a[_0x4856bb([0x74,0x68,0x65,0x6e])](()=>{_0x4f712e||_0x1fef1c(_0x4856bb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x85dd4a(){return _0x4cc419[_0x4856bb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4856bb([0x76,0x69,0x65,0x77])][_0x4856bb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4856bb([0x61,0x75,0x74,0x6f]);}function _0x520874(){_0x4cc419[_0x4856bb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4856bb([0x76,0x69,0x65,0x77])][_0x4856bb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4856bb([0x61,0x75,0x74,0x6f]);}}function _0x346f58(_0x62b477){const _0x183afd=[new window[(_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x572604=>setTimeout(_0x572604,0x49bbf55f^_0x58f072)),_0x596e2a[_0x4856bb([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4e882d=>{let _0x3b912d=0x0;_0x4cc419[_0x4856bb([0x6d,0x6f,0x64,0x65,0x6c])][_0x4856bb([0x6f,0x6e])](_0x4856bb([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2e196e,_0x1f46d8)=>{_0x1f46d8[0x0][_0x4856bb([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3b912d++,_0x3b912d==(0x49b2ca6b^_0x58f072)&&(_0x4e882d(),_0x2e196e[_0x4856bb([0x6f,0x66,0x66])]());});}))];return window[_0x4856bb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4856bb([0x72,0x61,0x63,0x65])](_0x183afd)[_0x4856bb([0x74,0x68,0x65,0x6e])](()=>_0x62b477);}async function _0x12b625(){await _0x596e2a,_0x4cc419[_0x4856bb([0x6d,0x6f,0x64,0x65,0x6c])][_0x4856bb([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3c62d4,_0x4cc419[_0x4856bb([0x6d,0x6f,0x64,0x65,0x6c])][_0x4856bb([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3c62d4,_0x4cc419[_0x4856bb([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4856bb([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2630d9(_0x4ada7a){const _0x32434b=_0x18d966();_0x4cc419[_0x32434b]=_0x4856bb([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4ada7a,_0x4ada7a!=_0x4856bb([0x56,0x61,0x6c,0x69,0x64])&&_0x12b625();}function _0x18d966(){const _0x500f6e=window[_0x4856bb([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4856bb([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4856bb([0x6e,0x6f,0x77])]())[_0x4856bb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4856bb([0x2e]),'');let _0xb6672b=_0x4856bb([0x6c]);for(let _0x18c49d=0x0;_0x18c49d<_0x500f6e[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x18c49d+=0x2){let _0x14e8a9=window[_0x4856bb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x500f6e[_0x4856bb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x18c49d,_0x18c49d+0x2));_0x14e8a9>=_0x5ce2aa[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x14e8a9-=_0x5ce2aa[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xb6672b+=_0x5ce2aa[_0x14e8a9];}return _0xb6672b;}function _0x58bc28(){const _0x3b7f07=_0x44a111[_0x4856bb([0x73,0x70,0x6c,0x69,0x74])](_0x4856bb([0x2e]));if(0x3!=_0x3b7f07[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x223227(_0x3b7f07[0x1]);function _0x223227(_0x1bb3e8){const _0xa74052=_0x1b6429(_0x1bb3e8);return _0xa74052&&_0x5a5f32()?_0xa74052:null;function _0x5a5f32(){const _0x832ec8=_0xa74052[_0x4856bb([0x6a,0x74,0x69])],_0xe80731=window[_0x4856bb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x832ec8[_0x4856bb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x832ec8[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1beb4e={..._0xa74052,[_0x4856bb([0x6a,0x74,0x69])]:_0x832ec8[_0x4856bb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x832ec8[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1beb4e[_0x4856bb([0x76,0x63])],_0x2a6b22(_0x1beb4e)==_0xe80731;}}}async function _0x34d680(){let _0x1a3ea3=!0x0;try{const _0x30934c=_0x44a111[_0x4856bb([0x73,0x70,0x6c,0x69,0x74])](_0x4856bb([0x2e])),[_0x1359f4,_0x4dea1a,_0x3d39fe]=_0x30934c;return _0x5966d7(_0x1359f4),await _0x1ed545(_0x1359f4,_0x4dea1a,_0x3d39fe),_0x1a3ea3;}catch(_0x278826){return!0x1;}function _0x5966d7(_0x5c5c6b){const _0x408200=_0x1b6429(_0x5c5c6b);_0x408200&&_0x408200[_0x4856bb([0x61,0x6c,0x67])]==_0x4856bb([0x45,0x53,0x32,0x35,0x36])||(_0x1a3ea3=!0x1);}async function _0x1ed545(_0x47d7ed,_0x3fc99c,_0x10d98d){const _0x2c97bf=window[_0x4856bb([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4856bb([0x66,0x72,0x6f,0x6d])](_0xc48326(_0x10d98d),_0x3e5eda=>_0x3e5eda[_0x4856bb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x7f2bf=new window[(_0x4856bb([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4856bb([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x47d7ed+_0x4856bb([0x2e])+_0x3fc99c),_0x24b7fc=window[_0x4856bb([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4856bb([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x24b7fc)return;const _0x1c359f=await _0x24b7fc[_0x4856bb([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4856bb([0x6a,0x77,0x6b]),_0x4c04bc,{[_0x4856bb([0x6e,0x61,0x6d,0x65])]:_0x4856bb([0x45,0x43,0x44,0x53,0x41]),[_0x4856bb([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4856bb([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4856bb([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x24b7fc[_0x4856bb([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4856bb([0x6e,0x61,0x6d,0x65])]:_0x4856bb([0x45,0x43,0x44,0x53,0x41]),[_0x4856bb([0x68,0x61,0x73,0x68])]:{[_0x4856bb([0x6e,0x61,0x6d,0x65])]:_0x4856bb([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1c359f,_0x2c97bf,_0x7f2bf)||(_0x1a3ea3=!0x1);}}function _0x1b6429(_0x133ac8){return _0x133ac8[_0x4856bb([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4856bb([0x65,0x79]))?JSON[_0x4856bb([0x70,0x61,0x72,0x73,0x65])](_0xc48326(_0x133ac8)):null;}function _0xc48326(_0x5927f1){return window[_0x4856bb([0x61,0x74,0x6f,0x62])](_0x5927f1[_0x4856bb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4856bb([0x2b]))[_0x4856bb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4856bb([0x2f])));}function _0x2a6b22(_0x392787){let _0x2d879b=0x1505;function _0x5e1c6e(_0x23b677){for(let _0x5b4b51=0x0;_0x5b4b51<_0x23b677[_0x4856bb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5b4b51++){const _0x3f5b4=_0x23b677[_0x4856bb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5b4b51);_0x2d879b=(_0x2d879b<<0x5)+_0x2d879b+_0x3f5b4,_0x2d879b&=_0x2d879b;}}function _0x534f82(_0x56be1d){Array[_0x4856bb([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x56be1d)?_0x56be1d[_0x4856bb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x534f82):_0x56be1d&&typeof _0x56be1d==_0x4856bb([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4856bb([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x56be1d)[_0x4856bb([0x73,0x6f,0x72,0x74])]()[_0x4856bb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4673fa,_0x442074])=>{_0x5e1c6e(_0x4673fa),_0x534f82(_0x442074);}):_0x5e1c6e(window[_0x4856bb([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x56be1d));}return _0x534f82(_0x392787),_0x2d879b>>>0x0;}function _0x2ee71a(_0x4e2540){return _0x4e2540[_0x4856bb([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4856bb([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4856bb([0x30]));}function _0x48fb54(_0x1eb921){return _0x1eb921[_0x4856bb([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4856bb([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4856bb([0x6a,0x6f,0x69,0x6e])]('');}function _0x3c62d4(){}function _0x4856bb(_0x5892ac){return _0x5892ac['map'](_0x5d18a4=>String['fromCharCode'](_0x5d18a4))['join']('');}_0x2630d9(await _0xa0c5dc());}(this);}['showFakeVisualSelection'](){const _0x3e2780=this['editor']['model'];_0x3e2780['change'](_0x309ce8=>{const _0x1a10bf=_0x3e2780['document']['selection']['getFirstRange']();if(_0x3e2780['markers']['has'](u))_0x309ce8['updateMarker'](u,{'range':_0x1a10bf});else{if(_0x1a10bf['start']['isAtEnd']){const _0x1c5ccd=_0x1a10bf['start']['getLastMatchingPosition'](({item:_0x227a6b})=>!_0x3e2780['schema']['isContent'](_0x227a6b),{'boundaries':_0x1a10bf});_0x309ce8['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x309ce8['createRange'](_0x1c5ccd,_0x1a10bf['end'])});}else _0x309ce8['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1a10bf});}});}['hideFakeVisualSelection'](){const _0x2cd2a2=this['editor']['model'];_0x2cd2a2['markers']['has'](u)&&_0x2cd2a2['change'](_0x11b5c1=>{_0x11b5c1['removeMarker'](u);});}['insertContent'](_0x158d79,_0x56e527){const _0x71f080=_0x56e527||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x71f080))return;const _0x4f5dac=this['editor']['data']['processor']['toView'](_0x158d79),_0x5f53b7=this['editor']['data']['toModel'](_0x4f5dac);this['editor']['model']['change'](_0x57ce37=>{this['hideFakeVisualSelection']();const _0x2b7ad4=this['editor']['model']['insertContent'](_0x5f53b7,_0x71f080);_0x2b7ad4&&_0x57ce37['setSelection'](_0x2b7ad4);});}['insertContentBelow'](_0xafdda5){const {model:_0x29845f}=this['editor'],_0x36bd7d=Array['from'](_0x29845f['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x5dff36=_0x36bd7d['length']?_0x29845f['createPositionAfter'](_0x36bd7d['pop']()):_0x29845f['document']['selection']['getLastPosition']();this['insertContent'](_0xafdda5,_0x5dff36);}}class v extends _0x4118d5{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3dae1c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3d0f85){super(_0x3d0f85),this['name']='AIRequestError';}}function i(_0x55ddf3,_0x33975b,_0x1c664c){const t=_0x55ddf3['t'];switch(_0x33975b){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',_0x1c664c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1c664c);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'},_0x1c664c);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 _0x33975b;}}class y extends _0x3fe314{['_commandDefinitions'];constructor(_0x188f3a,_0x37da7d){super(_0x188f3a),this['_commandDefinitions']=_0x37da7d,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xa1468f,_0x114474,_0x405876)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x405876));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x52ae10,_0x406146,_0x5b579f)=>{this['enabledCommandsIds']=_0x5b579f?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5a821c=this['editor']['model'];this['_hasContext']=function(_0x5e66d1){const _0xae67b1=_0x5e66d1['document']['selection'];return _0xae67b1['isCollapsed']?0x0!==[..._0xae67b1['getSelectedBlocks']()]['length']&&![..._0xae67b1['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5e66d1['hasContent'](_0xae67b1['getFirstRange']());}(_0x5a821c);const _0x282ca1=_0x5a821c['document']['selection'],_0xcbc5c1=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1aa58d of _0x282ca1['getRanges']())for(const _0x4871cf of _0x1aa58d['getItems']())if(_0x4871cf['is']('element')&&_0xcbc5c1['includes'](_0x4871cf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1e0192='',_0x15721c='',_0x54b0db='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1e0192,_0x15721c,_0x54b0db);}}function G(_0x344df2,_0x575992){const _0x3c0a00=new Set();for(const _0x22e469 of _0x344df2['values']())(_0x575992||!0x1===_0x22e469['requiresContent'])&&_0x3c0a00['add'](_0x22e469['id']);return Array['from'](_0x3c0a00);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x3a78f0(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x51167e,_0x465d08,_0x480e23){super(),this['editor']=_0x51167e,this['textAdapter']=_0x465d08,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x480e23,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x148c12,_0x30fcdd,_0x4d1b18)=>{this['view']['value']=this['_sanitizeHTML'](_0x4d1b18);}),this['listenTo'](this['view'],'submitPrompt',(_0x21b140,_0xd275ea)=>{const _0x36a10f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xd275ea,_0x36a10f,'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:_0x2898ab,query:_0x3999c1,htmlContent:_0x102f7b,label:_0x879caf,mainActionLabel:_0x20eddc}){this['view']['prompt']=_0x879caf,this['view']['mainAction']=_0x20eddc,this['initialContext']=_0x102f7b,_0x3999c1&&(this['view']['isRendered']?this['_handleQuery'](_0x3999c1,_0x102f7b,_0x2898ab,_0x879caf):this['view']['once']('render',()=>{this['_handleQuery'](_0x3999c1,_0x102f7b,_0x2898ab,_0x879caf);}));}['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'](_0x112ab4,_0xcbb9d2,_0x23e18c,_0x3d960f){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xcbb9d2,this['previousQuery']=_0x112ab4,this['previousLabel']=_0x3d960f||_0x112ab4,this['previousActionId']=_0x23e18c,new Promise(_0x81fd1e=>{this['textAdapter']['makeRequest']({'query':_0x112ab4,'context':_0xcbb9d2,'onData':_0x2d288a=>{this['currentResponse']=_0x2d288a,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x23e18c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5b1bd1=>{_0x5b1bd1 instanceof R?this['view']['handleError'](_0x5b1bd1['message']):this['view']['handleError'](),_0x81fd1e();})['finally'](()=>{this['stopProcessing'](),_0x81fd1e();});});}['_parseAndNormalizeContent'](_0x199899,_0x235b1f=!0x1){const _0x41d6b7=Z['exec'](_0x199899);_0x199899=_0x41d6b7?_0x199899['substring'](_0x41d6b7[0x1]['length']):_0x199899['length']<0x64&&!_0x235b1f?'':this['_stripMarkdownSyntax'](_0x199899);const _0x530cfd=this['_domParser']['parseFromString'](_0x199899,'text/html');if(_0x41d6b7){const _0x310fd6=Array['from'](_0x530cfd['body']['childNodes']);_0x310fd6['reverse']();for(const _0x590d74 of _0x310fd6){if(_0x590d74['nodeType']==Node['ELEMENT_NODE'])break;_0x590d74['remove']();}}const _0x157605=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x530cfd['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x157605),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x157605));}['_normalizeResponseHeadings'](_0x332cf6){const _0x4c9884=new _0x979892(this['editor']['editing']['view']['document']),_0x348ecf=new _0x39ba42({'name':/^h[1-5]$/}),_0x44f554=[];let _0x40bf00=!0x1;for(const _0x36b475 of _0x332cf6)_0x36b475['is']('element')&&_0x348ecf['match'](_0x36b475)&&(_0x44f554['push'](_0x36b475),'h1'==_0x36b475['name']&&(_0x40bf00=!0x0));if(_0x40bf00){for(const _0x3fc89f of _0x44f554)_0x4c9884['rename']('h'+(parseInt(_0x3fc89f['name'][0x1])+0x1),_0x3fc89f);}}['_isH1TagSupportEnabled'](){const {data:_0x3aad11,editing:_0x5bb649}=this['editor'],_0x48ea80=_0x3aad11['htmlProcessor']['toView']('<h1></h1>'),_0x5677bd=_0x3aad11['toView'](_0x3aad11['toModel'](_0x48ea80));return!!_0x5bb649['view']['domConverter']['viewToDom'](_0x5677bd)['querySelector']('h1');}['_sanitizeHTML'](_0x458580){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x458580),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x144dc1){const _0x4d99ff=_0x144dc1['trim']();return _0x4d99ff['startsWith']('```html')?_0x4d99ff['endsWith']('```')?_0x4d99ff['substring'](0x7,_0x4d99ff['length']-0x3):_0x4d99ff['substring'](0x7):_0x144dc1;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x4e60c7){super(_0x4e60c7),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x12befb=>i(_0x4e60c7,'AI_'+_0x12befb['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x4e60c7,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x4e60c7,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x4e60c7,'Stop'));const _0x157770=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x157770['if']('isVisible','ck-hidden',_0x11dea0=>!_0x11dea0)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x59d9f8,_0x7453ad){const _0x480efa=new _0x4a1e32(this['locale']);return _0x480efa['set']({'label':_0x59d9f8,'class':_0x7453ad||'','isVisible':!0x0,'withText':!0x0}),_0x480efa;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x4db403{['contentFieldView'];['copyButtonView'];constructor(_0xee6d5c,_0x24d978=''){super(_0xee6d5c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3cd960=this['bindTemplate'];this['contentFieldView']=new ct(_0xee6d5c,_0x24d978),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3cd960['if']('isVisible','ck-hidden',_0xb28c2e=>!_0xb28c2e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3cd960['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 _0x3231e5=!0x1;this['on']('change:value',(_0x4d223b,_0x2fca27,_0x14834d)=>{const _0x5e49ac=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x14834d),this['isProcessing']&&_0x5e49ac&&!_0x3231e5&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x563f61,_0x34ef75,_0x43775c)=>{_0x3231e5=!0x1,_0x43775c?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3231e5=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3231e5=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4df1c7=this['locale'],_0x12449a=new _0x4a1e32(this['locale']),_0x1fd645='ck-ai-form__copy-button';return _0x12449a['set']({'label':i(_0x4df1c7,'Copy'),'icon':U,'class':_0x1fd645,'tooltip':!0x0}),_0x12449a['bind']('isVisible')['to'](this,'value',_0x5dec9d=>!!_0x5dec9d),_0x12449a['bind']('isEnabled')['to'](this,'isProcessing',_0x333ba4=>!_0x333ba4),_0x12449a['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x12449a['icon']=_0x1f5b21['check'],_0x12449a['class']=_0x1fd645+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x12449a['icon']=U,_0x12449a['class']=_0x1fd645;},0x3e8);}),_0x12449a;}['_copyHTMLToClipboard'](_0x41caf6){const {window:_0x36b611,document:_0x1f7c9e}=_0x264feb;if(_0x36b611['ClipboardItem']){const {Blob:_0x41d4c3,ClipboardItem:_0x6c2cef}=_0x36b611,_0x3bf725=[new _0x6c2cef({'text/html':new _0x41d4c3([_0x41caf6['innerHTML']],{'type':'text/html'}),'text/plain':new _0x41d4c3([_0x41caf6['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3bf725);}else{const _0x46e795=_0x1f7c9e['createElement']('div');_0x46e795['style']['position']='absolute',_0x46e795['style']['left']='-9999px',_0x46e795['innerHTML']='<span>[</span>'+_0x41caf6['innerHTML']+'<span>]</span>',_0x1f7c9e['body']['appendChild'](_0x46e795);const _0x2102a4=_0x1f7c9e['createRange']();_0x2102a4['setStartAfter'](_0x46e795['firstElementChild']),_0x2102a4['setEndBefore'](_0x46e795['lastElementChild']);const _0x2cbc6a=_0x36b611['getSelection']();_0x2cbc6a['removeAllRanges'](),_0x2cbc6a['addRange'](_0x2102a4),_0x1f7c9e['execCommand']('copy'),_0x46e795['remove']();}}}class ct extends _0x4db403{constructor(_0x557561,_0x5f25e8=''){super(_0x557561),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5f25e8,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1ebcba){this['element']['innerHTML']=_0x1ebcba;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x35c734=new _0x4db403(),_0xc3fdf2=this['locale'],_0x3c4731=new _0x144044();return _0x3c4731['isVisible']=!0x0,_0x35c734['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3c4731,{'text':i(_0xc3fdf2,'AI\x20is\x20writing...')}]}),_0x35c734['render'](),_0x35c734;}}class tt extends _0x4db403{constructor(_0x2c41e9,_0x59b217=''){super(_0x2c41e9);const _0x4362d3=new _0x20b7cf(),_0x5392d8=this['bindTemplate'];this['set']('text',_0x59b217),_0x4362d3['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4362d3,{'text':_0x5392d8['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3fe02c,_0x4818a5){super(_0x3fe02c,_0x4818a5),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',(_0x294362,_0x308e3f)=>{_0x294362['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x308e3f());});}['_createSubmitButton'](){const _0x5a80d7=new _0x4a1e32(this['locale']),_0x201923=this['locale'];return _0x5a80d7['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x201923,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5a80d7['on']('execute',()=>{this['submit']();}),_0x5a80d7['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3644c3,_0x595f69)=>!_0x3644c3&&_0x595f69),_0x5a80d7;}['_createShowHistoryButton'](){const _0x137c75=new _0x4a1e32(this['locale']),_0x3c58f6=this['resultsView'],_0x141346=this['locale'];_0x137c75['set']({'label':i(_0x141346,'History'),'withText':!0x1,'icon':_0x1f5b21['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x137c75['bind']('isOn')['to'](_0x3c58f6,'isVisible'),_0x137c75['bind']('isEnabled')['to'](this,'isEnabled'),_0x137c75['on']('execute',()=>{_0x3c58f6['isVisible']=!_0x3c58f6['isVisible'],_0x3c58f6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2571f6=()=>{_0x264feb['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x11bfa5=new st(this['queryView']['fieldView']['element']),_0xa68166=_0x11bfa5['width'],_0x30be5c='rtl'===_0x141346['uiLanguageDirection']?'left':'right';_0x11bfa5['excludeScrollbarsAndBorders'](),_0x137c75['element']['style'][_0x30be5c]=_0xa68166-_0x11bfa5['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2571f6),this['on']('render',_0x2571f6),_0x137c75;}['submit'](){const _0x144dc3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x144dc3);}['focus'](_0x36fe98){-0x1===_0x36fe98?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0xc44cb9){super(_0xc44cb9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xc44cb9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x22315a=0x0;for(const _0x2c8926 of this['items'])_0x22315a+=_0x2c8926['items']['length'];return{'resultsCount':_0x22315a,'totalItemsCount':_0x22315a};}['_createClearHistoryButton'](){const _0x132170=this['locale'],_0x20fd1c=new _0x4a1e32(this['locale']);return _0x20fd1c['set']({'label':'('+i(_0x132170,'Clear')+')','withText':!0x0}),_0x20fd1c['on']('execute',()=>this['fire']('clearHistory')),_0x20fd1c;}}class hs extends _0x527391{constructor(_0x2cd01b){super();const _0x1aaacd=new te(),_0x76074b=new _0x4a1e32(this['locale'],_0x1aaacd);this['children']['add'](_0x76074b),_0x76074b['set']({'label':_0x2cd01b['prompt'],'withText':!0x0}),_0x76074b['on']('execute',()=>{this['fire']('execute',{'value':_0x44196b(_0x2cd01b['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x33f3a0{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2f8771,_0xd97650)=>{const _0x15af27=Ss(_0xd97650['prompt']);for(const _0x3e9314 of this)if(_0x3e9314!=_0xd97650&&Ss(_0x3e9314['prompt'])===_0x15af27){this['remove'](_0x3e9314);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2694fa=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x2694fa));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x39b023=>_0x39b023)));}}function Ss(_0x241543){return _0x241543['toLowerCase']()['trim']();}class K extends _0x4db403{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1201c6,_0x1bc757,_0x2d3c29=''){super(_0x1201c6),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x1201c6),this['contentArea']=new W(_0x1201c6,_0x2d3c29),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 _0x3bfe8b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2e3072({'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 _0x199740=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1bc757],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x199740['if']('isError','ck-hidden',_0x425d77=>!_0x425d77)]},'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'](_0x47f8e8=0x1){-0x1===_0x47f8e8?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 _0xb9daf=this['locale'],_0x30f0d0=new ht(_0xb9daf,{'queryView':{'label':i(_0xb9daf,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x670262,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0xb9daf,'Empty\x20history'),'secondary':i(_0xb9daf,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x30f0d0['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xef021e,_0x552825)=>_0xef021e&&!_0x552825),this['listenTo'](_0x30f0d0,'submit',(_0x3755d9,_0x291c00)=>{this['prompt']=_0x291c00;const _0x48fe41=_0x4578be(_0x291c00);this['fire']('submitPrompt',_0x48fe41),_0x291c00['trim']()&&this['_promptHistory']['add']({'prompt':_0x48fe41},0x0);},{'priority':'high'}),_0x30f0d0;}['_createHistoryView'](){const _0x12b2d6=new rs(this['locale']);return _0x12b2d6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x12b2d6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x12b2d6;}['_createToolbar'](){const _0xbeed4a=new nt(this['locale']);return _0xbeed4a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xcb6264,_0x4562b5,_0x542fef)=>_0xcb6264&&!_0x4562b5&&!!_0x542fef),_0xbeed4a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xbeed4a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x45c5a8,_0x30bdc9,_0x53f8c0)=>_0x45c5a8&&!_0x30bdc9&&!!_0x53f8c0),_0xbeed4a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xbeed4a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x28d296,_0x168d51)=>_0x28d296&&!_0x168d51),_0xbeed4a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xbeed4a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xbeed4a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xbeed4a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2b346e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2b346e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x522b69){const _0xe5819f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x522b69||i(_0xe5819f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x4118d5{['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[_0x8abf7d,a,v,_0x256d65];}constructor(_0x44b9f8){super(_0x44b9f8),_0x44b9f8['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x44b9f8['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x44b9f8['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x44b9f8['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x47bcf8}=this;this['_aiAdapter']=_0x47bcf8['plugins']['get'](v),this['_dialog']=_0x47bcf8['plugins']['get'](_0x256d65),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x44779e=new y(_0x47bcf8,Array['from'](this['_commandDefinitions']['values']()));_0x47bcf8['commands']['add']('showAIAssistant',_0x44779e),_0x47bcf8['ui']['componentFactory']['add']('aiCommands',_0x232523=>{const _0x5b93fd=_0x1a9681(_0x232523);return _0x5b93fd['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5b93fd['buttonView']['set']({'label':i(_0x232523,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x5b93fd['on']('execute',_0x4d9119=>this['_onExecute'](_0x4d9119['source']['id'])),_0x4caf28(_0x5b93fd,_0x47bcf8['ui']['view']['body'],function(_0x22dea3){const _0x3a0ae5=o(_0x22dea3['config']['get']('ai.aiAssistant.commands'),_0x22dea3['locale']),_0x52196a=B(_0x22dea3,_0x3a0ae5)['filter'](_0x90dc77=>_0x90dc77['commands']['length']);if(0x1===_0x52196a['length'])return B(_0x22dea3,_0x52196a[0x0]['commands'])['map'](_0x43a64b=>({'id':_0x43a64b['id'],'label':_0x43a64b['label']}));return _0x52196a['map'](_0x33551b=>{const {groupId:_0x2135da,groupLabel:_0x359de3,commands:_0x5bee2e}=_0x33551b,_0x36dae4=B(_0x22dea3,_0x5bee2e)['map'](_0x27b37c=>({'id':_0x27b37c['id'],'label':_0x27b37c['label']}));return{'id':_0x2135da,'menu':_0x359de3||_0x2135da,'children':_0x36dae4};});}(_0x47bcf8),{'ariaLabel':i(_0x232523,'AI\x20Commands')}),_0x5b93fd['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x44779e['on']('change:enabledCommandsIds',_0x5278c2),_0x5b93fd['menuView']['once']('render',_0x5278c2),_0x5b93fd;function _0x5278c2(){_0x5b93fd['isEnabled']=_0x44779e['enabledCommandsIds']['length']>0x0;for(const _0x52628d of _0x5b93fd['menuView']['buttons'])_0x52628d['isEnabled']=_0x44779e['enabledCommandsIds']['includes'](_0x52628d['id']);}}),_0x47bcf8['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1fafdf=>{const _0x546a7d=new _0xb1b468(_0x1fafdf);_0x546a7d['buttonView']['set']({'label':i(_0x1fafdf,'AI\x20Commands'),'icon':E}),_0x546a7d['bind']('isEnabled')['to'](_0x44779e,'enabledCommandsIds',_0x27a499=>_0x27a499['length']>0x0);const _0x26c2fe=o(_0x47bcf8['config']['get']('ai.aiAssistant.commands'),_0x1fafdf);return this['_populateMenuBarMenu'](_0x44779e,_0x546a7d,_0x26c2fe,_0x1a1bdb=>this['_onExecute'](_0x1a1bdb)),_0x546a7d;}),_0x47bcf8['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x535f41=this['_createAIAssistantUIButton'](_0x4a1e32);return _0x535f41['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x535f41;}),_0x47bcf8['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x452c71=this['_createAIAssistantUIButton'](_0x3da23c);return _0x452c71['set']({'role':'menuitemcheckbox'}),_0x452c71;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5a5af3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x335476;for(const _0x411d1a in _0x5a5af3){const _0x524459=_0x411d1a,_0x4b5795=_0x5a5af3[_0x524459];if('aiLicenseKeyValid'==_0x4b5795||'aiLicenseKeyInvalid'==_0x4b5795||'aiLicenseKeyExpired'==_0x4b5795||'aiLicenseKeyDomainLimit'==_0x4b5795||'aiLicenseKeyNotAllowed'==_0x4b5795||'aiLicenseKeyEvaluationLimit'==_0x4b5795||'aiLicenseKeyTrialLimit'==_0x4b5795||'aiLicenseKeyDevelopmentLimit'==_0x4b5795||'aiLicenseKeyUsageLimit'==_0x4b5795){delete _0x5a5af3[_0x524459],_0x335476=_0x4b5795,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x335476&&_0x5a5af3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x335476&&_0x5a5af3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x335476&&_0x5a5af3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x335476&&_0x5a5af3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x335476&&_0x5a5af3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x335476&&_0x5a5af3['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x335476&&_0x5a5af3['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x335476&&_0x5a5af3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3721db='',_0x40c0d8='',_0x277f89='custom'){const _0x2b6a21=this['editor'],_0x2fcb86=_0x2b6a21['editing']['view'],_0x280294=_0x2b6a21['plugins']['get'](a),_0xfdd1f7=_0x2b6a21['plugins']['get'](_0x8abf7d);_0x280294['showFakeVisualSelection']();const _0xd964c3=new j(),_0x1b0f1a=new ClipboardEvent('copy',{'clipboardData':_0xd964c3}),_0x513df6=new _0x3aa88c(_0xd964c3),_0x1161ea=new _0x444174(_0x2fcb86,_0x1b0f1a,{'dataTransfer':_0x513df6});_0xfdd1f7['_forceMarkersCopy']('comment',()=>{_0x2fcb86['document']['fire']('copy',_0x1161ea);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x2b6a21,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4b112f=_0x513df6['getData']('text/html');const _0x43ada8=_0x2b6a21['model']['document']['selection'],_0x19bedb=Array['from'](_0x43ada8['getRanges']());0x1===_0x19bedb['length']&&_0x19bedb[0x0]['isFlat']&&!_0x43ada8['getSelectedElement']()&&''!==_0x4b112f['replace'](/ /g,'')['trim']()&&(_0x4b112f='<p>'+_0x4b112f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x277f89,'query':_0x3721db,'htmlContent':_0x4b112f,'label':_0x40c0d8,'mainActionLabel':x[_0x2b6a21['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2ee351['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x280294['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5a40ab=new Map(),_0x5b5e1a=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3b943e of _0x5b5e1a)for(const _0x47067a of _0x3b943e['commands'])_0x5a40ab['set'](_0x47067a['id'],{..._0x47067a,'groupId':_0x3b943e['groupId'],'groupLabel':_0x3b943e['groupLabel']||_0x3b943e['groupId']});return _0x5a40ab;}['_createAIAssistantUIButton'](_0x38c12e){const _0x13520d=this['editor'],_0x3ab6b7=_0x13520d['commands']['get']('showAIAssistant'),_0x259861=new _0x38c12e(_0x13520d['locale']);return _0x259861['set']({'label':i(_0x13520d['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x259861['bind']('isEnabled')['to'](_0x3ab6b7),_0x259861['bind']('isOn')['to'](this['_dialog'],'id',_0x1b3d4d=>'aiAssistant'===_0x1b3d4d),this['listenTo'](_0x259861,'execute',()=>{_0x259861['isOn']?this['hideUI']():_0x3ab6b7['execute']();}),_0x259861;}['_initView'](){const _0x1ca78a=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',()=>{_0x1ca78a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1ca78a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x49fd67,ui:{ariaLiveAnnouncer:_0x2caf02}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3718fa,_0x22f34e,_0x75fd34)=>{const _0x563fff=this['_aiAssistantController']['currentContext'];_0x75fd34?_0x2caf02['announce'](i(_0x49fd67,'AI\x20is\x20writing')):_0x563fff&&_0x2caf02['announce'](i(_0x49fd67,'Generated\x20content:\x20%0',_0x563fff),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3439e0,_0x2f2efe,_0x14ed23)=>{if(_0x14ed23){const _0x7471d7=this['_formView']['errorView']['text'];_0x2caf02['announce'](i(_0x49fd67,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x7471d7));}});}['_onExecute'](_0x5be611){const _0x640b48=this['_commandDefinitions']['get'](_0x5be611),_0x39ccb6=this['editor'],_0x394568=_0x39ccb6['model']['document']['selection'],_0x4aa937=_0x39ccb6['commands']['get']('showAIAssistant'),_0x347e5b=_0x39ccb6['plugins']['get'](a),_0x275aad=''+(_0x640b48['groupId']!==I?_0x640b48['groupLabel']+':\x20':'')+_0x640b48['label'];if(!0x1!==_0x640b48['requiresContent']&&_0x394568['isCollapsed']){const _0x516642=_0x394c8a(_0x394568['getSelectedBlocks']())||_0x39ccb6['model']['schema']['getLimitElement'](_0x394568);_0x39ccb6['model']['change'](_0x4ff424=>{_0x4ff424['setSelection'](_0x516642,'in');});}_0x347e5b['showFakeVisualSelection'](),_0x4aa937['execute'](_0x640b48['prompt'],_0x275aad,'command:'+_0x5be611);}['_populateMenuBarMenu'](_0x45b352,_0x1187d5,_0x4035de,_0x3f9290){const _0x4e61c3=this['editor'],_0x15759f=_0x4e61c3['locale'],_0x490a38=new _0x2b5e04(_0x15759f),_0x223687=B(_0x4e61c3,_0x4035de)['filter'](_0xc9c910=>_0xc9c910['commands']['length']);0x1===_0x223687['length']?this['_getMenuBarGroupButtons']({'command':_0x45b352,'commands':_0x223687[0x0]['commands'],'parentMenuView':_0x1187d5,'onExecute':_0x3f9290})['forEach'](_0x2c5e86=>_0x490a38['items']['add'](_0x2c5e86)):_0x223687['forEach'](({groupId:_0x14f6de,groupLabel:_0x3c6eb7,commands:_0x2f081b})=>{const _0x56a3b5=new _0x3dda89(_0x15759f,_0x1187d5),_0x5af806=new _0xb1b468(_0x15759f),_0xc5821b=new _0x2b5e04(_0x15759f),_0x26ced5=this['_getMenuBarGroupButtons']({'command':_0x45b352,'commands':_0x2f081b,'parentMenuView':_0x5af806,'onExecute':_0x3f9290});_0x5af806['buttonView']['set']({'label':_0x3c6eb7||_0x14f6de}),_0x5af806['delegate']('execute')['to'](_0x1187d5),_0xc5821b['items']['addMany'](_0x26ced5),_0x5af806['panelView']['children']['add'](_0xc5821b),_0x56a3b5['children']['add'](_0x5af806),_0x490a38['items']['add'](_0x56a3b5);}),_0x1187d5['panelView']['children']['add'](_0x490a38);}['_getMenuBarGroupButtons']({command:_0x4819c1,commands:_0x31f68d,parentMenuView:_0x3cef9e,onExecute:_0x10642c}){const _0x1753a9=this['editor'],_0x3d3ec3=_0x1753a9['locale'];return B(_0x1753a9,_0x31f68d)['map'](_0x921d42=>{const _0x207610=new _0x3dda89(_0x3d3ec3,_0x3cef9e),_0x3900c8=new _0x3da23c(_0x3d3ec3);return _0x3900c8['set']({'label':_0x921d42['label']}),_0x3900c8['delegate']('execute')['to'](_0x3cef9e),_0x3900c8['on']('execute',()=>_0x10642c(_0x921d42['id'])),_0x3900c8['bind']('isEnabled')['to'](_0x4819c1,'enabledCommandsIds',_0xeecedf=>_0xeecedf['includes'](_0x921d42['id'])),_0x207610['children']['add'](_0x3900c8),_0x207610;});}}function _(_0xd39593,_0x26082e){return void 0x0!==_0xd39593['order']&&void 0x0===_0x26082e['order']?0x1:void 0x0===_0xd39593['order']&&void 0x0!==_0x26082e['order']?-0x1:void 0x0!==_0xd39593['order']&&void 0x0!==_0x26082e['order']?_0xd39593['order']-_0x26082e['order']:0x0;}function B(_0x3fa509,_0x444b7c){_0x444b7c['sort'](_);const _0xb4bc03={},_0xd92fc6=[];for(const _0x35e817 of _0x444b7c)if(void 0x0!==_0x35e817['order']){if(_0x35e817['order']in _0xb4bc03)throw new _0x3dae1c('ai-commands-config-order-collision',_0x3fa509,{'conflictingDefinitions':[_0x35e817,_0xb4bc03[_0x35e817['order']]]});_0xb4bc03[_0x35e817['order']]=_0x35e817,_0xd92fc6['splice'](_0x35e817['order'],0x0,_0x35e817);}else _0xd92fc6['push'](_0x35e817);return _0xd92fc6;}class r extends _0x4118d5{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c2aba){super(_0x4c2aba);const _0x3a08bd=_0x4c2aba['config'],_0x17d382=_0x4c2aba['locale'];_0x3a08bd['define']('ai.aiAssistant.commands',function(_0x54305e){return[{'groupId':'editOrReview','groupLabel':i(_0x54305e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x54305e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x54305e,'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(_0x54305e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x54305e,'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(_0x54305e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x54305e,'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(_0x54305e,'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(_0x54305e,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x54305e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x54305e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x54305e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x54305e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x54305e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x54305e,'Change\x20style'),'commands':[{'id':'business','label':i(_0x54305e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x54305e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x54305e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x54305e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x54305e,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x54305e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x54305e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x54305e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x54305e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x54305e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x54305e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x54305e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x54305e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x17d382)),_0x3a08bd['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3a08bd['define']('ai.aiAssistant.removeCommands',[]);const _0x459ab0=o(_0x3a08bd['get']('ai.aiAssistant.commands'),_0x17d382),_0x15182f=_0x3a08bd['get']('ai.aiAssistant.extraCommandGroups'),_0x39f371=_0x3a08bd['get']('ai.aiAssistant.removeCommands');_0x15182f['forEach'](_0x13de3e=>{const _0xafafdf=_0x459ab0['find'](_0x113bc4=>_0x113bc4['groupId']===_0x13de3e['groupId']);_0xafafdf?_0xafafdf['commands']=_0xafafdf['commands']['concat'](_0x13de3e['commands']):_0x459ab0['push'](_0x13de3e);}),_0x459ab0['forEach'](_0x178400=>{_0x178400['commands']=_0x178400['commands']['filter'](_0x1be5e2=>!_0x39f371['includes'](_0x1be5e2['id']));}),_0x3a08bd['set']('ai.aiAssistant.commands',_0x459ab0);}}class P extends _0x4118d5{['abortController'];static get['requires'](){return[v];}constructor(_0x12462f){super(_0x12462f),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x44d78e){return this['sendRequest'](_0x44d78e)['catch'](_0x3aa993=>{if(_0x3aa993 instanceof R)return Promise['reject'](_0x3aa993);if('AbortError'==_0x3aa993['name'])return Promise['resolve']();throw console['error'](_0x3aa993),new _0x3dae1c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4a1bcc,_0x530d8e){const _0x5194e0=this['editor']['locale'],_0x37b47b={'Content-Type':'application/json'};if('object'==typeof _0x4a1bcc)Object['assign'](_0x37b47b,_0x4a1bcc);else{if(_0x4a1bcc)try{const _0xdeb61b=await _0x4a1bcc(_0x530d8e);Object['assign'](_0x37b47b,_0xdeb61b);}catch(_0x16d8c4){return Promise['reject'](new R(i(_0x5194e0,'AI_ERROR_GET_HEADERS')));}}return _0x37b47b;}async['_prepareRequestParameters'](_0x4fef6f,_0xe9ee69){const _0x191030=this['editor']['locale'];if('object'==typeof _0x4fef6f)return _0x4fef6f;try{return await _0x4fef6f(_0xe9ee69);}catch(_0x2ebf0b){return Promise['reject'](new R(i(_0x191030,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x23cc73){super(_0x23cc73),_0x23cc73['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x23cc73['config']['get']('ai.openAI.requestParameters')||_0x23cc73['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x23cc73['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x23cc73['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x23cc73['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x413155,context:_0x3d90ff,onData:_0x3fe833,actionId:_0x557915}){const _0x1b6ca9=this['editor']['locale'],_0x5c9d6a=await this['prepareMessages'](_0x413155,_0x3d90ff,_0x557915),_0x4da85d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x557915),_0x4c47f7=await this['_prepareRequestParameters'](this['_requestParameters'],_0x557915),_0x445d28={'messages':_0x5c9d6a,..._0x4c47f7},_0x2a9c5f={'method':'POST','headers':_0x4da85d,'body':JSON['stringify'](_0x445d28),'signal':this['abortController']['signal']},_0x4b4d95=await fetch(this['_apiUrl'],_0x2a9c5f);if(_0x4b4d95['ok'])return _0x4c47f7['stream']?await this['_readStreamableResponse'](_0x4b4d95,_0x3fe833):await this['_readStaticResponse'](_0x4b4d95,_0x3fe833),Promise['resolve']();{const _0x57e05=await _0x4b4d95['text']();return _0x57e05['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x1b6ca9,'AI_ERROR_CONTEXT_LENGTH'))):_0x57e05['includes']('Moderation')?Promise['reject'](new R(i(_0x1b6ca9,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x57e05));}}async['prepareMessages'](_0x199173,_0x5761db,_0x1966e5){let _0x4d4035,_0x375471;return _0x5761db?(_0x4d4035='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.',_0x375471='Instruction:\x0a'+_0x199173+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5761db):(_0x4d4035='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.',_0x375471=_0x199173),[{'role':'system','content':_0x4d4035},{'role':'user','content':_0x375471}];}async['_readStreamableResponse'](_0x3afda8,_0x555433){const _0x4383e6=_0x3afda8['body']['getReader'](),_0x5cdb0f=new TextDecoder();let _0x2ca8bb='',_0x4d6cc9='',_0x35a40a='',_0x3eea0f=!0x1;for(;!_0x3eea0f;){const {done:_0x839a9f,value:_0x2cded3}=await _0x4383e6['read'](),_0x79606b=_0x2ca8bb+_0x5cdb0f['decode'](_0x2cded3);let _0x53a0f8='';_0x3eea0f=_0x839a9f;try{_0x53a0f8=this['_cleanUpData'](_0x79606b),_0x2ca8bb='';}catch(_0x65d759){_0x2ca8bb=_0x79606b;continue;}_0x4d6cc9+=_0x53a0f8,!_0x3eea0f&&this['_isBufferIncomplete'](_0x4d6cc9)||_0x4d6cc9&&(_0x35a40a+=_0x4d6cc9,_0x4d6cc9='',_0x555433(_0x35a40a));}return Promise['resolve']();}async['_readStaticResponse'](_0x461d2b,_0x2a7d18){return _0x2a7d18((await _0x461d2b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x279b3d){const _0xeae18e=_0x279b3d['split']('<')['length']!==_0x279b3d['split']('>')['length'],_0x44c846=_0x279b3d['length']<0x1e;return _0xeae18e&&_0x44c846;}['_cleanUpData'](_0x1cecbd){return _0x1cecbd['split'](/\n(?![^{]*\})/g)['map'](_0x28ecbb=>_0x28ecbb['replace']('data:\x20',''))['filter'](_0x2d1cf0=>_0x2d1cf0&&_0x2d1cf0['length']>0x0&&'[DONE]'!==_0x2d1cf0)['map'](_0x3f792e=>{const {choices:_0x177ea2}=JSON['parse'](_0x3f792e);if(_0x177ea2[0x0]&&_0x177ea2[0x0]['delta']&&_0x177ea2[0x0]['delta']['content'])return _0x177ea2[0x0]['delta']['content'];})['filter'](_0x2d5b77=>_0x2d5b77)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xc7ee22){super(_0xc7ee22),_0xc7ee22['config']['get']('ai.aws.requestParameters')||_0xc7ee22['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']=_0xc7ee22['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0xc7ee22['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0xc7ee22['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0xc7ee22['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x1fa9cb,context:_0x4e31cb,onData:_0x36be22,actionId:_0x4c11e5}){const {model:_0x59f548,stream:_0x5f2d64,..._0x216538}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4c11e5),_0x398dde={'prompt':await this['preparePrompt'](_0x1fa9cb,_0x4e31cb,_0x59f548,_0x4c11e5),..._0x216538};this['_apiUrl']?await this['_processProxyRequest'](_0x398dde,_0x59f548,_0x5f2d64,_0x36be22,_0x4c11e5):await this['_processAWSRequest'](_0x398dde,_0x59f548,_0x5f2d64,_0x36be22);}async['preparePrompt'](_0x5c9be6,_0x21753f,_0x2d6e86,_0x466f90){let _0x372199,_0x410727;return _0x21753f?(_0x372199='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.',_0x410727='Instruction:\x0a'+_0x5c9be6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x21753f):(_0x372199='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.',_0x410727=_0x5c9be6),'meta.llama'==this['getModelFamily'](_0x2d6e86)?'<<SYS>>\x0a'+_0x372199+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x410727+'\x0a[/INST]':'Human:\x0a'+_0x372199+'\x0a'+_0x410727+'\x0a\x0aAssistant:';}['getModelFamily'](_0x192725){if(/^anthropic\.claude/['test'](_0x192725))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x192725))return'ai21.j2';if(/^cohere\.command/['test'](_0x192725))return'cohere.command';if(/^meta\.llama/['test'](_0x192725))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x192725));}async['_processProxyRequest'](_0x4ac1b6,_0x254909,_0x671d94,_0x3dc5c2,_0x29370c){const _0x374db1={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x29370c),'body':JSON['stringify']({..._0x4ac1b6,'model':_0x254909,'stream':_0x671d94}),'signal':this['abortController']['signal']},_0x311ac4=await fetch(this['_apiUrl'],_0x374db1);_0x671d94?await this['_readStreamableResponse'](_0x311ac4,_0x254909,_0x3dc5c2):await this['_readStaticResponse'](_0x311ac4,_0x254909,_0x3dc5c2);}async['_processAWSRequest'](_0x62db52,_0x36669a,_0x3e2382,_0x4c36ab){const _0x6c5cfc=new _0x1745da(this['_bedrockClientConfig']),_0x4d0722={'body':JSON['stringify'](_0x62db52),'contentType':'application/json','accept':'application/json','modelId':_0x36669a};let _0x534975;if(_0x3e2382){const _0x59d46c=new _0xf8a334(_0x4d0722);_0x534975=await _0x6c5cfc['send'](_0x59d46c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x534975,_0x36669a,_0x4c36ab);}else{const _0x4472ba=new _0x52b96e(_0x4d0722);_0x534975=await _0x6c5cfc['send'](_0x4472ba,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x534975,_0x36669a,_0x4c36ab);}}async['_readAsyncIterableResponse'](_0x4cc13e,_0x1ca50c,_0x3b424a){const _0x4d6345=_0x4cc13e['body'],_0x14635c=new TextDecoder('utf-8');let _0x30fe72='';for await(const _0x13ec0a of _0x4d6345)if(_0x13ec0a['chunk']){const _0x51e6f0=_0x14635c['decode'](_0x13ec0a['chunk']['bytes']),_0x2cb859=JSON['parse'](_0x51e6f0);_0x30fe72+=this['_getGeneratedText'](_0x2cb859,_0x1ca50c),_0x3b424a(_0x30fe72);}return Promise['resolve']();}async['_readStreamableResponse'](_0x518796,_0x30430f,_0x286cac){const _0x374630=_0x518796['body'],_0x3071da=new TextDecoder('utf-8'),_0x36866f=_0x374630['getReader']();let _0x4a31fe='',_0x5be9b1='',_0x43b6d4=!0x1;for(;!_0x43b6d4;){const {done:_0x35a1aa,value:_0x221b6a}=await _0x36866f['read']();if(_0x43b6d4=_0x35a1aa,_0x43b6d4)break;const _0x36c500=(_0x4a31fe+_0x3071da['decode'](_0x221b6a))['split']('\x0a')['map'](_0x415350=>{try{return _0x4a31fe='',JSON['parse'](_0x415350);}catch(_0x194f00){return _0x4a31fe=_0x415350,null;}})['filter'](_0x7893be=>null!==_0x7893be);_0x36c500['length']&&(_0x5be9b1+=_0x36c500['map'](_0x1db2dc=>this['_getGeneratedText'](_0x1db2dc,_0x30430f))['join'](''),_0x286cac(_0x5be9b1));}return Promise['resolve']();}async['_readStaticResponse'](_0x1997d5,_0x2304c3,_0x443693){let _0x21d30e;return _0x21d30e=_0x1997d5 instanceof Response?await _0x1997d5['json']():JSON['parse'](Buffer['from'](_0x1997d5['body'])['toString']('utf8')),(_0x443693(this['_getGeneratedText'](_0x21d30e,_0x2304c3)),Promise['resolve']());}['_getGeneratedText'](_0x398deb,_0x2c0087){switch(this['getModelFamily'](_0x2c0087)){case'anthropic.claude':return _0x398deb['completion'];case'ai21.j2':return _0x398deb['completions'][0x0]['data']['text'];case'cohere.command':return _0x398deb['generations'][0x0]['text'];case'meta.llama':return _0x398deb['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "44.0.0-alpha.
|
|
3
|
+
"version": "44.0.0-alpha.12",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@aws-sdk/client-bedrock-runtime": "3.621.0",
|
|
27
|
-
"@ckeditor/ckeditor5-clipboard": "44.0.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-core": "44.0.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "44.0.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "44.0.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "44.0.0-alpha.
|
|
32
|
-
"ckeditor5": "44.0.0-alpha.
|
|
33
|
-
"ckeditor5-collaboration": "44.0.0-alpha.
|
|
27
|
+
"@ckeditor/ckeditor5-clipboard": "44.0.0-alpha.12",
|
|
28
|
+
"@ckeditor/ckeditor5-core": "44.0.0-alpha.12",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "44.0.0-alpha.12",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "44.0.0-alpha.12",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "44.0.0-alpha.12",
|
|
32
|
+
"ckeditor5": "44.0.0-alpha.12",
|
|
33
|
+
"ckeditor5-collaboration": "44.0.0-alpha.12",
|
|
34
34
|
"lodash-es": "4.17.21"
|
|
35
35
|
},
|
|
36
36
|
"type": "module",
|