@ckeditor/ckeditor5-ai 44.2.0-alpha.16 → 44.2.0-alpha.3

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.
Files changed (168) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +9 -9
  148. package/src/adapters/aiadapter.js +1 -1
  149. package/src/adapters/aitextadapter.js +1 -1
  150. package/src/adapters/awstextadapter.js +1 -1
  151. package/src/adapters/openaitextadapter.js +1 -1
  152. package/src/aiassistant.js +1 -1
  153. package/src/aiassistantediting.js +1 -1
  154. package/src/aiassistantui.js +1 -1
  155. package/src/index.js +1 -1
  156. package/src/legacyerrors.js +1 -1
  157. package/src/ui/aiassistantcontroller.js +2 -2
  158. package/src/ui/form/aiformcontentarea.js +1 -1
  159. package/src/ui/form/aiformerrorview.js +1 -1
  160. package/src/ui/form/aiformpromptview.js +1 -1
  161. package/src/ui/form/aiformtoolbarview.js +1 -1
  162. package/src/ui/form/aiformview.js +1 -1
  163. package/src/ui/form/aihistorylistitemview.js +1 -1
  164. package/src/ui/form/aihistorylistview.js +1 -1
  165. package/src/ui/form/prompthistory.js +1 -1
  166. package/src/ui/showaiassistantcommand.js +1 -1
  167. package/src/utils/common-translations.js +1 -1
  168. package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x272b82,Command as _0x508b34,icons as _0x4d9a8e}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x45bd61,CKEditorError as _0x408e3e,ObservableMixin as _0x203a81,global as _0x29a193,isVisible as it,Rect as st,Collection as _0x4ead29,FocusTracker as _0x4c386e,KeystrokeHandler as ts,first as _0x10be42}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x49582f,View as _0x1dccbb,SpinnerView as _0x466c87,IconView as _0x38278f,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x3a5975,ButtonLabelView as te,FocusCycler as _0x92b2be,createLabeledTextarea as _0x1e6665,Dialog as _0x23a0a2,createDropdown as _0x3f9797,addMenuToDropdown as _0x584a34,MenuBarMenuView as _0x2fb236,MenuBarMenuListItemButtonView as _0x4377e8,DialogViewPosition as _0xeb43c1,MenuBarMenuListView as _0x232dc0,MenuBarMenuListItemView as _0x18fb33}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x189943,ClipboardMarkersUtils as _0x56be98}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2ddc91,DataTransfer as _0x2f6fb1,UpcastWriter as _0x33f780,Matcher as _0x2eb3b1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x22049a,escape as _0x517628}from'lodash-es';import{BedrockRuntimeClient as _0x6058e5,InvokeModelWithResponseStreamCommand as _0x45a65c,InvokeModelCommand as _0x397cc5}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x4c4629,_0x7a6ddc){const _0x20cf4d=(0x0,_0x7a6ddc['t'])('Other');return _0x4c4629['length']?'groupId'in _0x4c4629[0x0]?_0x4c4629:[{'groupId':x,'groupLabel':_0x20cf4d,'order':0x1/0x0,'commands':_0x4c4629}]:[{'groupId':x,'groupLabel':_0x20cf4d,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x272b82{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2bd698}=this,_0x15819e=['ck-fake-ai-selection'];_0x2bd698['config']['get']('ai.useTheme')&&_0x15819e['push']('ck-ai-assistant-ui_theme'),_0x2bd698['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x15819e,'priority':0xc}}),_0x2bd698['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x1d1324,{writer:_0x17e0c7})=>{if(!_0x1d1324['markerRange']['isCollapsed'])return null;const _0x1722bd=_0x17e0c7['createUIElement']('span');return _0x17e0c7['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1722bd),_0x1722bd;}});}['afterInit'](){!async function(_0x2f7f07){const _0x27aa68=_0x4c1332([0x61,0x44,0x6d,0x6c,0x72,0x35,0x4e,0x64,0x65,0x57,0x48,0x68,0x52,0x47,0x67,0x34,0x30,0x31,0x41,0x6f,0x77,0x69,0x53,0x55,0x4f,0x4d,0x66,0x56,0x75,0x7a,0x58,0x71,0x6b,0x76,0x33,0x79,0x46,0x32,0x59,0x6a,0x37,0x73,0x45,0x63,0x4b,0x78,0x36,0x4c,0x6e,0x38,0x50,0x42,0x43,0x5a,0x49,0x4a,0x70,0x54,0x74,0x51,0x39,0x62]),_0x9ac34b=0x3ea4246e,_0x2694d9=0x3ea37b26^_0x9ac34b,_0x1caed0=window[_0x4c1332([0x44,0x61,0x74,0x65])][_0x4c1332([0x6e,0x6f,0x77])](),_0x527a54=_0x2f7f07[_0x4c1332([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x138638=new window[(_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1ccfce=>{_0x527a54[_0x4c1332([0x6f,0x6e,0x63,0x65])](_0x4c1332([0x72,0x65,0x61,0x64,0x79]),_0x1ccfce);}),_0x358cb5={[_0x4c1332([0x6b,0x74,0x79])]:_0x4c1332([0x45,0x43]),[_0x4c1332([0x75,0x73,0x65])]:_0x4c1332([0x73,0x69,0x67]),[_0x4c1332([0x63,0x72,0x76])]:_0x4c1332([0x50,0x2d,0x32,0x35,0x36]),[_0x4c1332([0x78])]:_0x4c1332([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]),[_0x4c1332([0x79])]:_0x4c1332([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]),[_0x4c1332([0x61,0x6c,0x67])]:_0x4c1332([0x45,0x53,0x32,0x35,0x36])},_0x3d03ba=_0x527a54[_0x4c1332([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4c1332([0x67,0x65,0x74])](_0x4c1332([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1ad8dc(){let _0x51abb9,_0x59220d=null,_0x1ea900=null;try{if(_0x3d03ba==_0x4c1332([0x47,0x50,0x4c]))return _0x4c1332([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x51abb9=_0x566b85(),!_0x51abb9)return _0x4c1332([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x51abb9[_0x4c1332([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1ea900=_0x27859f(_0x51abb9[_0x4c1332([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x51abb9[_0x4c1332([0x6a,0x74,0x69])])),await _0x3712f8()?_0x30d386()?_0x34fdf5()?_0x4c1332([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3a3d9d()?(_0x51abb9[_0x4c1332([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4c1332([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x59220d=_0x5c5f0a(_0x4c1332([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x51abb9[_0x4c1332([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4c1332([0x74,0x72,0x69,0x61,0x6c])&&(_0x59220d=_0x5c5f0a(_0x4c1332([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x566e1e()):_0x4c1332([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4c1332([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4c1332([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x50c95c){return _0x4c1332([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x34fdf5(){const _0x2cbffc=[_0x4c1332([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4c1332([0x74,0x72,0x69,0x61,0x6c])][_0x4c1332([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51abb9[_0x4c1332([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1caed0/0x3e8:0xe10*_0x2694d9;return _0x51abb9[_0x4c1332([0x65,0x78,0x70])]<_0x2cbffc;}function _0x30d386(){const _0x46b835=_0x51abb9[_0x4c1332([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x46b835&&(!!_0x46b835[_0x4c1332([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c1332([0x2a]))||!!_0x46b835[_0x4c1332([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c1332([0x41,0x49])));}function _0x3a3d9d(){const _0x10ed88=_0x51abb9[_0x4c1332([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x10ed88||0x0==_0x10ed88[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2e38db}=new URL(window[_0x4c1332([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x10ed88[_0x4c1332([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2e38db))return!0x0;const _0x43ca1b=_0x2e38db[_0x4c1332([0x73,0x70,0x6c,0x69,0x74])](_0x4c1332([0x2e]));return _0x10ed88[_0x4c1332([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1809ff=>_0x1809ff[_0x4c1332([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c1332([0x2a])))[_0x4c1332([0x6d,0x61,0x70])](_0xeddc86=>_0xeddc86[_0x4c1332([0x73,0x70,0x6c,0x69,0x74])](_0x4c1332([0x2e])))[_0x4c1332([0x73,0x6f,0x6d,0x65])](_0x442a0c=>_0x43ca1b[_0x4c1332([0x65,0x76,0x65,0x72,0x79])]((_0x2508c6,_0x13392e)=>_0x442a0c[_0x13392e]===_0x2508c6||_0x442a0c[_0x13392e]===_0x4c1332([0x2a])));}function _0x566e1e(){return _0x59220d&&_0x1ea900?new window[(_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x14a98d,_0x3d7214)=>{_0x59220d[_0x4c1332([0x74,0x68,0x65,0x6e])](_0x14a98d,_0x3d7214),_0x1ea900[_0x4c1332([0x74,0x68,0x65,0x6e])](_0x32983a=>{_0x32983a!=_0x4c1332([0x56,0x61,0x6c,0x69,0x64])&&_0x14a98d(_0x32983a);},_0x3d7214);}):_0x59220d||_0x1ea900||_0x4c1332([0x56,0x61,0x6c,0x69,0x64]);}}function _0x27859f(_0x42a635,_0x5f0707){return new window[(_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4851be=>{if(_0x25ed4b())return _0x4851be(_0x4c1332([0x56,0x61,0x6c,0x69,0x64]));_0x1ba91b(),_0x527a54[_0x4c1332([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4c1332([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x185619=!0x1;const _0x31bb60=_0x45bd61();function _0x2244b9(_0x35c137){return!!_0x35c137&&(typeof _0x35c137===_0x4c1332([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x35c137===_0x4c1332([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x35c137[_0x4c1332([0x74,0x68,0x65,0x6e])]===_0x4c1332([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x35c137[_0x4c1332([0x63,0x61,0x74,0x63,0x68])]===_0x4c1332([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x33b07e(_0x161ee5){_0x2ae075(_0x161ee5)[_0x4c1332([0x74,0x68,0x65,0x6e])](_0x1dc23b=>{if(!_0x1dc23b||_0x1dc23b[_0x4c1332([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4c1332([0x6f,0x6b]))return _0x4c1332([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x474299(_0x2ea2a2(_0x31bb60+_0x5f0707))!=_0x1dc23b[_0x4c1332([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4c1332([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4c1332([0x56,0x61,0x6c,0x69,0x64]);})[_0x4c1332([0x74,0x68,0x65,0x6e])](_0x1e6f0c=>(_0x2f7f73(),_0x1e6f0c),()=>{const _0x9ffe2b=_0x46eb5c();return null==_0x9ffe2b?(_0x2f7f73(),_0x4c1332([0x56,0x61,0x6c,0x69,0x64])):_0x4c1332(_0x1caed0-_0x9ffe2b>(0x1aa8a06e^_0x9ac34b)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4c1332([0x74,0x68,0x65,0x6e])](_0x4851be)[_0x4c1332([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4851be(_0x4c1332([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x297da3=0x3e92caee^_0x9ac34b;function _0x2f7f73(){const _0x19d4c2=_0x4c1332([0x6c,0x6c,0x63,0x74,0x2d])+_0x474299(_0x2ea2a2(_0x42a635)),_0x1ab0c3=_0x4f46d9(_0x474299(window[_0x4c1332([0x4d,0x61,0x74,0x68])][_0x4c1332([0x63,0x65,0x69,0x6c])](_0x1caed0/_0x297da3)));window[_0x4c1332([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4c1332([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x19d4c2,_0x1ab0c3);}function _0x46eb5c(){const _0x28c145=_0x4c1332([0x6c,0x6c,0x63,0x74,0x2d])+_0x474299(_0x2ea2a2(_0x42a635)),_0xd0aeae=window[_0x4c1332([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4c1332([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x28c145);return _0xd0aeae?window[_0x4c1332([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f46d9(_0xd0aeae),0x10)*_0x297da3:null;}function _0x2ae075(_0x47fe9d){return new window[(_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5a5b9b,_0x820800)=>{_0x47fe9d[_0x4c1332([0x74,0x68,0x65,0x6e])](_0x5a5b9b,_0x820800),window[_0x4c1332([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x820800,0x3ea5f0ae^_0x9ac34b);});}}_0x527a54[_0x4c1332([0x6f,0x6e])](_0x4c1332([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x210ff0,_0x12b22b)=>{if(_0x12b22b[0x0]!=_0x42a635)return _0x4851be(_0x4c1332([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x12b22b[0x1]={..._0x12b22b[0x1],[_0x4c1332([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x31bb60};},{[_0x4c1332([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4c1332([0x68,0x69,0x67,0x68])}),_0x527a54[_0x4c1332([0x6f,0x6e])](_0x4c1332([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x10295a=>{_0x2244b9(_0x10295a[_0x4c1332([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x185619=!0x0,_0x33b07e(_0x10295a[_0x4c1332([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4c1332([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4c1332([0x6c,0x6f,0x77])}),_0x138638[_0x4c1332([0x74,0x68,0x65,0x6e])](()=>{_0x185619||_0x4851be(_0x4c1332([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x25ed4b(){return _0x527a54[_0x4c1332([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4c1332([0x76,0x69,0x65,0x77])][_0x4c1332([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4c1332([0x61,0x75,0x74,0x6f]);}function _0x1ba91b(){_0x527a54[_0x4c1332([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4c1332([0x76,0x69,0x65,0x77])][_0x4c1332([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4c1332([0x61,0x75,0x74,0x6f]);}}function _0x5c5f0a(_0x2a1021){const _0x2d657f=[new window[(_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xc6e96=>setTimeout(_0xc6e96,0x3ead1aa2^_0x9ac34b)),_0x138638[_0x4c1332([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3eeb5a=>{let _0x1e9332=0x0;_0x527a54[_0x4c1332([0x6d,0x6f,0x64,0x65,0x6c])][_0x4c1332([0x6f,0x6e])](_0x4c1332([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x502deb,_0x1fa2e3)=>{_0x1fa2e3[0x0][_0x4c1332([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1e9332++,_0x1e9332==(0x3ea42596^_0x9ac34b)&&(_0x3eeb5a(),_0x502deb[_0x4c1332([0x6f,0x66,0x66])]());});}))];return window[_0x4c1332([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4c1332([0x72,0x61,0x63,0x65])](_0x2d657f)[_0x4c1332([0x74,0x68,0x65,0x6e])](()=>_0x2a1021);}async function _0x54b345(){await _0x138638,_0x527a54[_0x4c1332([0x6d,0x6f,0x64,0x65,0x6c])][_0x4c1332([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5d1b45,_0x527a54[_0x4c1332([0x6d,0x6f,0x64,0x65,0x6c])][_0x4c1332([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5d1b45,_0x527a54[_0x4c1332([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4c1332([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xac64bb(_0x1d5eac){const _0x1787a2=_0x4872be();_0x527a54[_0x1787a2]=_0x4c1332([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1d5eac,_0x1d5eac!=_0x4c1332([0x56,0x61,0x6c,0x69,0x64])&&_0x54b345();}function _0x4872be(){const _0x39ecec=window[_0x4c1332([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4c1332([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4c1332([0x6e,0x6f,0x77])]())[_0x4c1332([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4c1332([0x2e]),'');let _0x26c264=_0x4c1332([0x61]);for(let _0x54259c=0x0;_0x54259c<_0x39ecec[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x54259c+=0x2){let _0x45f6f8=window[_0x4c1332([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x39ecec[_0x4c1332([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x54259c,_0x54259c+0x2));_0x45f6f8>=_0x27aa68[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x45f6f8-=_0x27aa68[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x26c264+=_0x27aa68[_0x45f6f8];}return _0x26c264;}function _0x566b85(){const _0xeb0287=_0x3d03ba[_0x4c1332([0x73,0x70,0x6c,0x69,0x74])](_0x4c1332([0x2e]));if(0x3!=_0xeb0287[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x7c97ad(_0xeb0287[0x1]);function _0x7c97ad(_0x3ddf22){const _0x1751b2=_0xf66720(_0x3ddf22);return _0x1751b2&&_0x214e4f()?_0x1751b2:null;function _0x214e4f(){const _0xafe39a=_0x1751b2[_0x4c1332([0x6a,0x74,0x69])],_0x13be42=window[_0x4c1332([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xafe39a[_0x4c1332([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xafe39a[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2d02d1={..._0x1751b2,[_0x4c1332([0x6a,0x74,0x69])]:_0xafe39a[_0x4c1332([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xafe39a[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2d02d1[_0x4c1332([0x76,0x63])],_0x2ea2a2(_0x2d02d1)==_0x13be42;}}}async function _0x3712f8(){let _0x513ea8=!0x0;try{const _0x174205=_0x3d03ba[_0x4c1332([0x73,0x70,0x6c,0x69,0x74])](_0x4c1332([0x2e])),[_0x5b84a7,_0x46a21e,_0x30d7c7]=_0x174205;return _0x1636a5(_0x5b84a7),await _0x4af10e(_0x5b84a7,_0x46a21e,_0x30d7c7),_0x513ea8;}catch(_0x48db62){return!0x1;}function _0x1636a5(_0x2801b2){const _0x5821c2=_0xf66720(_0x2801b2);_0x5821c2&&_0x5821c2[_0x4c1332([0x61,0x6c,0x67])]==_0x4c1332([0x45,0x53,0x32,0x35,0x36])||(_0x513ea8=!0x1);}async function _0x4af10e(_0x3d827e,_0x2d445f,_0xc0914d){const _0x37ee4b=window[_0x4c1332([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4c1332([0x66,0x72,0x6f,0x6d])](_0x5ddbeb(_0xc0914d),_0x25eff5=>_0x25eff5[_0x4c1332([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5e3cd8=new window[(_0x4c1332([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4c1332([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3d827e+_0x4c1332([0x2e])+_0x2d445f),_0x12764d=window[_0x4c1332([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4c1332([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x12764d)return;const _0x27c27c=await _0x12764d[_0x4c1332([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4c1332([0x6a,0x77,0x6b]),_0x358cb5,{[_0x4c1332([0x6e,0x61,0x6d,0x65])]:_0x4c1332([0x45,0x43,0x44,0x53,0x41]),[_0x4c1332([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4c1332([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4c1332([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x12764d[_0x4c1332([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4c1332([0x6e,0x61,0x6d,0x65])]:_0x4c1332([0x45,0x43,0x44,0x53,0x41]),[_0x4c1332([0x68,0x61,0x73,0x68])]:{[_0x4c1332([0x6e,0x61,0x6d,0x65])]:_0x4c1332([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x27c27c,_0x37ee4b,_0x5e3cd8)||(_0x513ea8=!0x1);}}function _0xf66720(_0x48e3db){return _0x48e3db[_0x4c1332([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4c1332([0x65,0x79]))?JSON[_0x4c1332([0x70,0x61,0x72,0x73,0x65])](_0x5ddbeb(_0x48e3db)):null;}function _0x5ddbeb(_0x1d15aa){return window[_0x4c1332([0x61,0x74,0x6f,0x62])](_0x1d15aa[_0x4c1332([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4c1332([0x2b]))[_0x4c1332([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4c1332([0x2f])));}function _0x2ea2a2(_0x5531e2){let _0x5e793e=0x1505;function _0x212ecf(_0x6649fd){for(let _0x518795=0x0;_0x518795<_0x6649fd[_0x4c1332([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x518795++){const _0x12efb8=_0x6649fd[_0x4c1332([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x518795);_0x5e793e=(_0x5e793e<<0x5)+_0x5e793e+_0x12efb8,_0x5e793e&=_0x5e793e;}}function _0x6bdca8(_0x46771c){Array[_0x4c1332([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x46771c)?_0x46771c[_0x4c1332([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x6bdca8):_0x46771c&&typeof _0x46771c==_0x4c1332([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4c1332([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x46771c)[_0x4c1332([0x73,0x6f,0x72,0x74])]()[_0x4c1332([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x498257,_0x57565b])=>{_0x212ecf(_0x498257),_0x6bdca8(_0x57565b);}):_0x212ecf(window[_0x4c1332([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x46771c));}return _0x6bdca8(_0x5531e2),_0x5e793e>>>0x0;}function _0x474299(_0x3f8066){return _0x3f8066[_0x4c1332([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4c1332([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4c1332([0x30]));}function _0x4f46d9(_0x2adaf){return _0x2adaf[_0x4c1332([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4c1332([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4c1332([0x6a,0x6f,0x69,0x6e])]('');}function _0x5d1b45(){}function _0x4c1332(_0x2e92f8){return _0x2e92f8['map'](_0x1ed340=>String['fromCharCode'](_0x1ed340))['join']('');}_0xac64bb(await _0x1ad8dc());}(this);}['showFakeVisualSelection'](){const _0x4f78b2=this['editor']['model'];_0x4f78b2['change'](_0x33dc6e=>{const _0x24ec3b=_0x4f78b2['document']['selection']['getRanges']();let _0x9d0b93=0x0;for(const _0x247c17 of _0x24ec3b){const _0x1deb7f=f+':'+_0x9d0b93;if(_0x4f78b2['markers']['has'](_0x1deb7f))_0x33dc6e['updateMarker'](_0x1deb7f,{'range':_0x247c17});else{if(_0x247c17['start']['isAtEnd']){const _0x5ca6bc=_0x247c17['start']['getLastMatchingPosition'](({item:_0x1c2e43})=>!_0x4f78b2['schema']['isContent'](_0x1c2e43),{'boundaries':_0x247c17});_0x33dc6e['addMarker'](_0x1deb7f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x33dc6e['createRange'](_0x5ca6bc,_0x247c17['end'])});}else _0x33dc6e['addMarker'](_0x1deb7f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x247c17});}_0x9d0b93++;}});}['hideFakeVisualSelection'](){const _0x56d61c=this['editor']['model'],_0x319c05=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x319c05['length']&&_0x56d61c['change'](_0x531518=>{_0x319c05['forEach'](_0x39d7d3=>{_0x531518['removeMarker'](_0x39d7d3);});});}['insertContent'](_0x415a00,_0x42ce91){const _0x59f796=this['_getAISelection'](),_0x17d3ce=_0x42ce91||_0x59f796['getFirstRange']();this['editor']['model']['canEditAt'](_0x17d3ce)&&this['editor']['model']['change'](_0x1c3d6c=>{this['hideFakeVisualSelection'](),_0x42ce91||this['_resetContentOfSelectedTableCells'](_0x1c3d6c,_0x59f796),this['_pasteHTMLUsingClipboard']({'insertAt':_0x17d3ce,'writer':_0x1c3d6c,'html':_0x415a00});});}['insertContentBelow'](_0x39e46b){const {model:_0x3395be}=this['editor'],_0x45d34b=this['_getAISelection']();_0x3395be['change'](()=>{const _0x2b3656=this['_prepareTableInsertBelowPosition'](_0x39e46b,_0x45d34b)||this['_getDefaultInsertBelowPosition'](_0x45d34b);this['insertContent'](_0x39e46b,_0x2b3656);});}['_getAISelection'](){const _0x222f98=this['editor']['model'],_0x21b06a=Array['from'](_0x222f98['markers']['getMarkersGroup'](f))['map'](_0x3eb063=>_0x3eb063['getRange']());return _0x222f98['createSelection'](_0x21b06a);}['_pasteHTMLUsingClipboard']({writer:_0xd34895,html:_0x20429d,insertAt:_0x623c3f}){const {view:_0x22a065}=this['editor']['editing'],_0x38b3d0=this['editor']['plugins']['get'](_0x189943),_0x179e96=new dt();_0x179e96['setData']('text/html',_0x20429d);const _0x28a1d9=new ClipboardEvent('paste',{'clipboardData':_0x179e96}),_0x623c3=new _0x2ddc91(_0x22a065,_0x28a1d9,{'dataTransfer':new _0x2f6fb1(_0x179e96)});_0xd34895['setSelection'](_0x623c3f);const _0x56b0f7=(_0x191baa,_0x3a5965)=>{_0x3a5965['resultRange']&&_0xd34895['setSelection'](_0x3a5965['resultRange']);};_0x38b3d0['once']('contentInsertion',_0x56b0f7,{'priority':'lowest'}),_0x22a065['document']['fire']('paste',_0x623c3),_0x38b3d0['off']('contentInsertion',_0x56b0f7);}['_getDefaultInsertBelowPosition'](_0x4c26b9){const {model:_0x20c07b}=this['editor'],_0x396e5e=Array['from'](_0x4c26b9['getSelectedBlocks']());return _0x396e5e['length']?_0x20c07b['createPositionAfter'](_0x396e5e['pop']()):_0x4c26b9['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x35abfc,_0x48648e){const {model:_0x9fbc90,plugins:_0x1a8bb1}=this['editor'];if(_0x1a8bb1['has']('TableUtils')){const _0x3f1ce1=_0x1a8bb1['get']('TableUtils')['getSelectedTableCells'](_0x48648e);if(_0x3f1ce1['length']){const _0x5d0a60=this['_getTableRowCountFromContent'](_0x35abfc),_0x2c9a91=this['_createEmptyTableRows'](_0x3f1ce1,_0x5d0a60);return _0x9fbc90['createPositionAt'](_0x2c9a91,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1e503d){const _0x204bf9=this['editor']['plugins']['get']('TableUtils'),_0x4ffded=this['editor']['data']['parse'](_0x1e503d),_0x2de351=Array['from'](_0x4ffded['getChildren']())['filter'](_0x31c5d9=>_0x31c5d9['is']('element','table'));let _0x39b25e=0x0;return _0x2de351['forEach'](_0x529037=>{_0x39b25e+=_0x204bf9['getRows'](_0x529037);}),_0x39b25e;}['_createEmptyTableRows'](_0x13cf83,_0x546d8b){const _0x519964=this['editor']['plugins']['get']('TableUtils'),_0x59c61b=_0x519964['getRowIndexes'](_0x13cf83),_0x38f768=_0x519964['getColumnIndexes'](_0x13cf83),_0x2f996e=_0x59c61b['last']+0x1,_0xaacbbb=_0x38f768['first'],_0x240f94=_0x13cf83[0x0]['findAncestor']('table');for(let _0x20284e=0x0;_0x20284e<_0x546d8b;_0x20284e++)_0x519964['insertRows'](_0x240f94,{'at':_0x2f996e});return _0x240f94['getChild'](_0x2f996e)['getChild'](_0xaacbbb);}['_resetContentOfSelectedTableCells'](_0x2632ab,_0x51912d){const {plugins:_0x41f2b0}=this['editor'],{model:_0x4edebd}=_0x2632ab;if(!_0x41f2b0['has']('TableUtils'))return;_0x41f2b0['get']('TableUtils')['getSelectedTableCells'](_0x51912d)['length']&&_0x4edebd['deleteContent'](_0x51912d);}}class K extends _0x272b82{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x408e3e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x29c0c8){super(_0x29c0c8),this['name']='AIRequestError';}}function i(_0x3900d7,_0x4988b3,_0x17db13){const t=_0x3900d7['t'];switch(_0x4988b3){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',_0x17db13);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x17db13);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'},_0x17db13);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 _0x4988b3;}}class E extends _0x508b34{['_commandDefinitions'];constructor(_0x414a9d,_0x3e29e9){super(_0x414a9d),this['_commandDefinitions']=_0x3e29e9,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1e6e5e,_0x4d4fbf,_0x15eedf)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x15eedf));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x78b27f,_0x237dea,_0x129163)=>{this['enabledCommandsIds']=_0x129163?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x25fe51=this['editor']['model'];this['_hasContext']=function(_0x635086){const _0x139500=_0x635086['document']['selection'];return _0x139500['isCollapsed']?0x0!==[..._0x139500['getSelectedBlocks']()]['length']&&![..._0x139500['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x635086['hasContent'](_0x139500['getFirstRange']());}(_0x25fe51);const _0x46fd49=_0x25fe51['document']['selection'],_0x4330a3=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x22366c of _0x46fd49['getRanges']())for(const _0x3763e2 of _0x22366c['getItems']())if(_0x3763e2['is']('element')&&_0x4330a3['includes'](_0x3763e2['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5e58f7='',_0x449587='',_0x38879b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5e58f7,_0x449587,_0x38879b);}}function G(_0xdc1809,_0x4b15e9){const _0x3ffca7=new Set();for(const _0xd278cf of _0xdc1809['values']())(_0x4b15e9||!0x1===_0xd278cf['requiresContent'])&&_0x3ffca7['add'](_0xd278cf['id']);return Array['from'](_0x3ffca7);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x203a81(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xa1489e,_0x39839d,_0x445f52){super(),this['editor']=_0xa1489e,this['textAdapter']=_0x39839d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x445f52,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x243acf,_0x2a1b47,_0x19469c)=>{this['view']['value']=this['_sanitizeHTML'](_0x19469c);}),this['listenTo'](this['view'],'submitPrompt',(_0x3667ba,_0x1874df)=>{const _0x260a4f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1874df,_0x260a4f,'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:_0x30c63c,query:_0x2d44d5,htmlContent:_0x1eddae,label:_0x61d924,mainActionLabel:_0x1279a9}){this['view']['prompt']=_0x61d924,this['view']['mainAction']=_0x1279a9,this['initialContext']=_0x1eddae,_0x2d44d5&&(this['view']['isRendered']?this['_handleQuery'](_0x2d44d5,_0x1eddae,_0x30c63c,_0x61d924):this['view']['once']('render',()=>{this['_handleQuery'](_0x2d44d5,_0x1eddae,_0x30c63c,_0x61d924);}));}['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'](_0x4d757a,_0x109926,_0x27882f,_0x4abc04){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x109926,this['previousQuery']=_0x4d757a,this['previousLabel']=_0x4abc04||_0x4d757a,this['previousActionId']=_0x27882f,new Promise(_0x2af6cb=>{this['textAdapter']['makeRequest']({'query':_0x4d757a,'context':_0x109926,'onData':_0x3c25b5=>{this['currentResponse']=_0x3c25b5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x27882f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5b6dbd=>{_0x5b6dbd instanceof R?this['view']['handleError'](_0x5b6dbd['message']):this['view']['handleError'](),_0x2af6cb();})['finally'](()=>{this['stopProcessing'](),_0x2af6cb();});});}['_parseAndNormalizeContent'](_0x3fe253,_0xcb78dd=!0x1){const _0x3251fb=Z['exec'](_0x3fe253);_0x3fe253=_0x3251fb?_0x3fe253['substring'](_0x3251fb[0x1]['length']):_0x3fe253['length']<0x64&&!_0xcb78dd?'':this['_stripMarkdownSyntax'](_0x3fe253);const _0xce99e0=this['_domParser']['parseFromString'](_0x3fe253,'text/html');if(_0x3251fb){const _0x31b8d5=Array['from'](_0xce99e0['body']['childNodes']);_0x31b8d5['reverse']();for(const _0x47db72 of _0x31b8d5){if(_0x47db72['nodeType']==Node['ELEMENT_NODE'])break;_0x47db72['remove']();}}const _0x67995d=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xce99e0['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x67995d);const _0x498f4c=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x59f296=this['editor']['data']['toModel'](_0x67995d);return _0x498f4c||_0x59f296['markers']['clear'](),this['editor']['data']['stringify'](_0x59f296);}['_normalizeResponseHeadings'](_0x4b7550){const _0x387975=new _0x33f780(this['editor']['editing']['view']['document']),_0x37aadf=new _0x2eb3b1({'name':/^h[1-5]$/}),_0x5bcc31=[];let _0x2989fe=!0x1;for(const _0x5790d2 of _0x4b7550)_0x5790d2['is']('element')&&_0x37aadf['match'](_0x5790d2)&&(_0x5bcc31['push'](_0x5790d2),'h1'==_0x5790d2['name']&&(_0x2989fe=!0x0));if(_0x2989fe){for(const _0x471a73 of _0x5bcc31)_0x387975['rename']('h'+(parseInt(_0x471a73['name'][0x1])+0x1),_0x471a73);}}['_isH1TagSupportEnabled'](){const {data:_0x520225,editing:_0x4d6594}=this['editor'],_0x1dcaf6=_0x520225['htmlProcessor']['toView']('<h1></h1>'),_0x3ad081=_0x520225['toView'](_0x520225['toModel'](_0x1dcaf6));return!!_0x4d6594['view']['domConverter']['viewToDom'](_0x3ad081)['querySelector']('h1');}['_sanitizeHTML'](_0x14058a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x14058a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1d81b2){const _0x183af1=_0x1d81b2['trim']();return _0x183af1['startsWith']('```html')?_0x183af1['endsWith']('```')?_0x183af1['substring'](0x7,_0x183af1['length']-0x3):_0x183af1['substring'](0x7):_0x1d81b2;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x17243c){super(_0x17243c),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x210e32=>i(_0x17243c,'AI_'+_0x210e32['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x17243c,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x17243c,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x17243c,'Stop'));const _0x2992ab=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2992ab['if']('isVisible','ck-hidden',_0x43c50b=>!_0x43c50b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4da1b0,_0x430a4b){const _0x58d492=new _0x49582f(this['locale']);return _0x58d492['set']({'label':_0x4da1b0,'class':_0x430a4b||'','isVisible':!0x0,'withText':!0x0}),_0x58d492;}}var W='<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 X extends _0x1dccbb{['contentFieldView'];['copyButtonView'];constructor(_0x3a2f55,_0x619472=''){super(_0x3a2f55),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xf44cf1=this['bindTemplate'];this['contentFieldView']=new mt(_0x3a2f55,_0x619472),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xf44cf1['if']('isVisible','ck-hidden',_0x5e0b24=>!_0x5e0b24)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xf44cf1['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 _0x45ce79=!0x1;this['on']('change:value',(_0x54a0a7,_0x368888,_0x530606)=>{const _0x49d16c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x530606),this['isProcessing']&&_0x49d16c&&!_0x45ce79&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x95072b,_0x446973,_0x163047)=>{_0x45ce79=!0x1,_0x163047?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x45ce79=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x45ce79=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5c7921=this['locale'],_0x57002d=new _0x49582f(this['locale']),_0x21ffea='ck-ai-form__copy-button';return _0x57002d['set']({'label':i(_0x5c7921,'Copy'),'icon':W,'class':_0x21ffea,'tooltip':!0x0}),_0x57002d['bind']('isVisible')['to'](this,'value',_0x1d66ea=>!!_0x1d66ea),_0x57002d['bind']('isEnabled')['to'](this,'isProcessing',_0x493aa2=>!_0x493aa2),_0x57002d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x57002d['icon']=_0x4d9a8e['check'],_0x57002d['class']=_0x21ffea+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x57002d['icon']=W,_0x57002d['class']=_0x21ffea;},0x3e8);}),_0x57002d;}['_copyHTMLToClipboard'](_0x38a41b){const {window:_0x3e5729,document:_0xcfb3b4}=_0x29a193;if(_0x3e5729['ClipboardItem']){const {Blob:_0x5e35df,ClipboardItem:_0x50e9af}=_0x3e5729,_0x5138d3=[new _0x50e9af({'text/html':new _0x5e35df([_0x38a41b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5e35df([_0x38a41b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5138d3);}else{const _0x7d49bb=_0xcfb3b4['createElement']('div');_0x7d49bb['style']['position']='absolute',_0x7d49bb['style']['left']='-9999px',_0x7d49bb['innerHTML']='<span>[</span>'+_0x38a41b['innerHTML']+'<span>]</span>',_0xcfb3b4['body']['appendChild'](_0x7d49bb);const _0x3a7256=_0xcfb3b4['createRange']();_0x3a7256['setStartAfter'](_0x7d49bb['firstElementChild']),_0x3a7256['setEndBefore'](_0x7d49bb['lastElementChild']);const _0x460798=_0x3e5729['getSelection']();_0x460798['removeAllRanges'](),_0x460798['addRange'](_0x3a7256),_0xcfb3b4['execCommand']('copy'),_0x7d49bb['remove']();}}}class mt extends _0x1dccbb{constructor(_0x1655b9,_0x4fec4a=''){super(_0x1655b9),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4fec4a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x11e8e0){this['element']['innerHTML']=_0x11e8e0;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xe4c6cf=new _0x1dccbb(),_0x3b0b7a=this['locale'],_0x223da7=new _0x466c87();return _0x223da7['isVisible']=!0x0,_0xe4c6cf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x223da7,{'text':i(_0x3b0b7a,'AI\x20is\x20writing...')}]}),_0xe4c6cf['render'](),_0xe4c6cf;}}class rt extends _0x1dccbb{constructor(_0x191211,_0x54498e=''){super(_0x191211);const _0x371251=new _0x38278f(),_0x5c1140=this['bindTemplate'];this['set']('text',_0x54498e),_0x371251['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':[_0x371251,{'text':_0x5c1140['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x412da3,_0x4b53bf){super(_0x412da3,_0x4b53bf),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',(_0x5ce7e9,_0x3e01d3)=>{_0x5ce7e9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3e01d3());});}['_createSubmitButton'](){const _0x168d44=new _0x49582f(this['locale']),_0x1ee357=this['locale'];return _0x168d44['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(_0x1ee357,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x168d44['on']('execute',()=>{this['submit']();}),_0x168d44['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x140ad0,_0x181ecb)=>!_0x140ad0&&_0x181ecb),_0x168d44;}['_createShowHistoryButton'](){const _0x3eecfa=new _0x49582f(this['locale']),_0x1d0eb4=this['resultsView'],_0x5dca85=this['locale'];_0x3eecfa['set']({'label':i(_0x5dca85,'History'),'withText':!0x1,'icon':_0x4d9a8e['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3eecfa['bind']('isOn')['to'](_0x1d0eb4,'isVisible'),_0x3eecfa['bind']('isEnabled')['to'](this,'isEnabled'),_0x3eecfa['on']('execute',()=>{_0x1d0eb4['isVisible']=!_0x1d0eb4['isVisible'],_0x1d0eb4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3a62da=()=>{_0x29a193['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x1d47a9=new st(this['queryView']['fieldView']['element']),_0x5391af=_0x1d47a9['width'],_0x5926de='rtl'===_0x5dca85['uiLanguageDirection']?'left':'right';_0x1d47a9['excludeScrollbarsAndBorders'](),_0x3eecfa['element']['style'][_0x5926de]=_0x5391af-_0x1d47a9['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3a62da),this['on']('render',_0x3a62da),_0x3eecfa;}['submit'](){const _0x53d45c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x53d45c);}['focus'](_0x365a88){-0x1===_0x365a88?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x8fa404){super(_0x8fa404),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x8fa404,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3aeb13=0x0;for(const _0x1ba39 of this['items'])_0x3aeb13+=_0x1ba39['items']['length'];return{'resultsCount':_0x3aeb13,'totalItemsCount':_0x3aeb13};}['_createClearHistoryButton'](){const _0x59a54a=this['locale'],_0x486136=new _0x49582f(this['locale']);return _0x486136['set']({'label':'('+i(_0x59a54a,'Clear')+')','withText':!0x0}),_0x486136['on']('execute',()=>this['fire']('clearHistory')),_0x486136;}}class hs extends _0x3a5975{constructor(_0x3f8676){super();const _0x44d922=new te(),_0x378cca=new _0x49582f(this['locale'],_0x44d922);this['children']['add'](_0x378cca),_0x378cca['set']({'label':_0x3f8676['prompt'],'withText':!0x0}),_0x378cca['on']('execute',()=>{this['fire']('execute',{'value':_0x22049a(_0x3f8676['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4ead29{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x19eedd,_0x2c4d34)=>{const _0x31a9be=Ss(_0x2c4d34['prompt']);for(const _0x46bdca of this)if(_0x46bdca!=_0x2c4d34&&Ss(_0x46bdca['prompt'])===_0x31a9be){this['remove'](_0x46bdca);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x121891=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x121891));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x4eb654=>_0x4eb654)));}}function Ss(_0x264d1c){return _0x264d1c['toLowerCase']()['trim']();}class k extends _0x1dccbb{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x31e06c,_0x4d094f,_0x5b22e5=''){super(_0x31e06c),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x31e06c),this['contentArea']=new X(_0x31e06c,_0x5b22e5),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 _0x4c386e(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x92b2be({'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 _0x3b8944=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4d094f],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3b8944['if']('isError','ck-hidden',_0x4024b2=>!_0x4024b2)]},'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'](_0x13da78=0x1){-0x1===_0x13da78?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 _0x513622=this['locale'],_0x2db7f1=new ht(_0x513622,{'queryView':{'label':i(_0x513622,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1e6665,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x513622,'Empty\x20history'),'secondary':i(_0x513622,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2db7f1['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x22de6b,_0xceab93)=>_0x22de6b&&!_0xceab93),this['listenTo'](_0x2db7f1,'submit',(_0x28570,_0x1ec4c1)=>{this['prompt']=_0x1ec4c1;const _0x4f99f4=_0x517628(_0x1ec4c1);this['fire']('submitPrompt',_0x4f99f4),_0x1ec4c1['trim']()&&this['_promptHistory']['add']({'prompt':_0x4f99f4},0x0);},{'priority':'high'}),_0x2db7f1;}['_createHistoryView'](){const _0x1d49ec=new rs(this['locale']);return _0x1d49ec['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x1d49ec['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1d49ec;}['_createToolbar'](){const _0x36d90c=new at(this['locale']);return _0x36d90c['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3051dc,_0x4348ec,_0xd12e8b)=>_0x3051dc&&!_0x4348ec&&!!_0xd12e8b),_0x36d90c['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x36d90c['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x46695a,_0x2a4478,_0x46268a)=>_0x46695a&&!_0x2a4478&&!!_0x46268a),_0x36d90c['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x36d90c['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3669fd,_0x3eb67a)=>_0x3669fd&&!_0x3eb67a),_0x36d90c['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x36d90c['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x36d90c['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x36d90c;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2f92da=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2f92da,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x457da2){const _0x21417c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x457da2||i(_0x21417c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<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 w=globalThis['DataTransfer'];class n extends _0x272b82{['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[_0x56be98,a,K,_0x23a0a2];}constructor(_0x1e2730){super(_0x1e2730),_0x1e2730['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1e2730['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1e2730['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1e2730['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x55d275}=this;this['_aiAdapter']=_0x55d275['plugins']['get'](K),this['_dialog']=_0x55d275['plugins']['get'](_0x23a0a2),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x38510c=new E(_0x55d275,Array['from'](this['_commandDefinitions']['values']()));_0x55d275['commands']['add']('showAIAssistant',_0x38510c),_0x55d275['ui']['componentFactory']['add']('aiCommands',_0x12d5b9=>{const _0x1c7506=_0x3f9797(_0x12d5b9);return _0x1c7506['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1c7506['buttonView']['set']({'label':i(_0x12d5b9,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x1c7506['on']('execute',_0x17ee1a=>this['_onExecute'](_0x17ee1a['source']['id'])),_0x584a34(_0x1c7506,_0x55d275['ui']['view']['body'],function(_0x3529c0){const _0x7304c=o(_0x3529c0['config']['get']('ai.aiAssistant.commands'),_0x3529c0['locale']),_0x2a5224=U(_0x3529c0,_0x7304c)['filter'](_0x48cf9d=>_0x48cf9d['commands']['length']);if(0x1===_0x2a5224['length'])return U(_0x3529c0,_0x2a5224[0x0]['commands'])['map'](_0x3e32a0=>({'id':_0x3e32a0['id'],'label':_0x3e32a0['label']}));return _0x2a5224['map'](_0x55f527=>{const {groupId:_0x1aff78,groupLabel:_0x315120,commands:_0x486a40}=_0x55f527,_0x1e2256=U(_0x3529c0,_0x486a40)['map'](_0x338a8d=>({'id':_0x338a8d['id'],'label':_0x338a8d['label']}));return{'id':_0x1aff78,'menu':_0x315120||_0x1aff78,'children':_0x1e2256};});}(_0x55d275),{'ariaLabel':i(_0x12d5b9,'AI\x20Commands')}),_0x1c7506['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x38510c['on']('change:enabledCommandsIds',_0x595ada),_0x1c7506['menuView']['once']('render',_0x595ada),_0x1c7506;function _0x595ada(){_0x1c7506['isEnabled']=_0x38510c['enabledCommandsIds']['length']>0x0;for(const _0x37f275 of _0x1c7506['menuView']['buttons'])_0x37f275['isEnabled']=_0x38510c['enabledCommandsIds']['includes'](_0x37f275['id']);}}),_0x55d275['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4b9ef5=>{const _0x380d55=new _0x2fb236(_0x4b9ef5);_0x380d55['buttonView']['set']({'label':i(_0x4b9ef5,'AI\x20Commands'),'icon':T}),_0x380d55['bind']('isEnabled')['to'](_0x38510c,'enabledCommandsIds',_0xdfd62d=>_0xdfd62d['length']>0x0);const _0x15d461=o(_0x55d275['config']['get']('ai.aiAssistant.commands'),_0x4b9ef5);return this['_populateMenuBarMenu'](_0x38510c,_0x380d55,_0x15d461,_0x30f2bc=>this['_onExecute'](_0x30f2bc)),_0x380d55;}),_0x55d275['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x156d2f=this['_createAIAssistantUIButton'](_0x49582f);return _0x156d2f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x156d2f;}),_0x55d275['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x87a483=this['_createAIAssistantUIButton'](_0x4377e8);return _0x87a483['set']({'role':'menuitemcheckbox'}),_0x87a483;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1c00d2=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xdc8631;for(const _0x1843bc in _0x1c00d2){const _0x303f30=_0x1843bc,_0x28262e=_0x1c00d2[_0x303f30];if('aiLicenseKeyValid'==_0x28262e||'aiLicenseKeyInvalid'==_0x28262e||'aiLicenseKeyExpired'==_0x28262e||'aiLicenseKeyDomainLimit'==_0x28262e||'aiLicenseKeyNotAllowed'==_0x28262e||'aiLicenseKeyEvaluationLimit'==_0x28262e||'aiLicenseKeyTrialLimit'==_0x28262e||'aiLicenseKeyUsageLimit'==_0x28262e){delete _0x1c00d2[_0x303f30],_0xdc8631=_0x28262e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xdc8631&&_0x1c00d2['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xdc8631&&_0x1c00d2['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xdc8631&&_0x1c00d2['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xdc8631&&_0x1c00d2['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xdc8631&&_0x1c00d2['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xdc8631&&_0x1c00d2['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xdc8631&&_0x1c00d2['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x49cb5b='',_0x191a73='',_0x4ed5b5='custom'){const _0x3bea48=this['editor'],_0x1c567c=_0x3bea48['editing']['view'],_0x1dd1f3=_0x3bea48['plugins']['get'](a),_0x295009=_0x3bea48['plugins']['get'](_0x56be98);_0x1dd1f3['showFakeVisualSelection']();const _0x52ccf8=new w(),_0x5a3090=new ClipboardEvent('copy',{'clipboardData':_0x52ccf8}),_0x172aee=new _0x2f6fb1(_0x52ccf8),_0x488056=new _0x2ddc91(_0x1c567c,_0x5a3090,{'dataTransfer':_0x172aee});_0x295009['_forceMarkersCopy']('comment',()=>{_0x1c567c['document']['fire']('copy',_0x488056);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3bea48,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x21be29=_0x172aee['getData']('text/html');const _0x5d038a=_0x3bea48['model']['document']['selection'],_0x5c5dc1=Array['from'](_0x5d038a['getRanges']());0x1===_0x5c5dc1['length']&&_0x5c5dc1[0x0]['isFlat']&&!_0x5d038a['getSelectedElement']()&&''!==_0x21be29['replace'](/&nbsp;/g,'')['trim']()&&(_0x21be29='<p>'+_0x21be29+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4ed5b5,'query':_0x49cb5b,'htmlContent':_0x21be29,'label':_0x191a73,'mainActionLabel':M[_0x3bea48['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xeb43c1['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1dd1f3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x178d32=new Map(),_0x4e6cfe=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x13edb5 of _0x4e6cfe)for(const _0x435e3e of _0x13edb5['commands'])_0x178d32['set'](_0x435e3e['id'],{..._0x435e3e,'groupId':_0x13edb5['groupId'],'groupLabel':_0x13edb5['groupLabel']||_0x13edb5['groupId']});return _0x178d32;}['_createAIAssistantUIButton'](_0x1d8204){const _0x12c77d=this['editor'],_0x272040=_0x12c77d['commands']['get']('showAIAssistant'),_0x28f6c7=new _0x1d8204(_0x12c77d['locale']);return _0x28f6c7['set']({'label':i(_0x12c77d['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x28f6c7['bind']('isEnabled')['to'](_0x272040),_0x28f6c7['bind']('isOn')['to'](this['_dialog'],'id',_0x2ec266=>'aiAssistant'===_0x2ec266),this['listenTo'](_0x28f6c7,'execute',()=>{_0x28f6c7['isOn']?this['hideUI']():_0x272040['execute']();}),_0x28f6c7;}['_initView'](){const _0x4472cf=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',()=>{_0x4472cf['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4472cf['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x115877,ui:{ariaLiveAnnouncer:_0xe394ab}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2af5f3,_0x53cb35,_0x2d2f59)=>{const _0x424c85=this['_aiAssistantController']['currentContext'];_0x2d2f59?_0xe394ab['announce'](i(_0x115877,'AI\x20is\x20writing')):_0x424c85&&_0xe394ab['announce'](i(_0x115877,'Generated\x20content:\x20%0',_0x424c85),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5cf1be,_0x2ce6f4,_0x175d03)=>{if(_0x175d03){const _0x424058=this['_formView']['errorView']['text'];_0xe394ab['announce'](i(_0x115877,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x424058));}});}['_onExecute'](_0xd61c15){const _0x2beb61=this['_commandDefinitions']['get'](_0xd61c15),_0x2b5c20=this['editor'],_0x2ce7b7=_0x2b5c20['model']['document']['selection'],_0x4fea16=_0x2b5c20['commands']['get']('showAIAssistant'),_0x353b5b=_0x2b5c20['plugins']['get'](a),_0x3bce60=''+(_0x2beb61['groupId']!==x?_0x2beb61['groupLabel']+':\x20':'')+_0x2beb61['label'];if(!0x1!==_0x2beb61['requiresContent']&&_0x2ce7b7['isCollapsed']){const _0x569047=_0x10be42(_0x2ce7b7['getSelectedBlocks']())||_0x2b5c20['model']['schema']['getLimitElement'](_0x2ce7b7);_0x2b5c20['model']['change'](_0x86f8f8=>{_0x86f8f8['setSelection'](_0x569047,'in');});}_0x353b5b['showFakeVisualSelection'](),_0x4fea16['execute'](_0x2beb61['prompt'],_0x3bce60,'command:'+_0xd61c15);}['_populateMenuBarMenu'](_0x37ce15,_0x18c1d7,_0x26a374,_0x200c94){const _0x44dc0b=this['editor'],_0x3db2d8=_0x44dc0b['locale'],_0x411f82=new _0x232dc0(_0x3db2d8),_0xc6fa35=U(_0x44dc0b,_0x26a374)['filter'](_0x60dfb0=>_0x60dfb0['commands']['length']);0x1===_0xc6fa35['length']?this['_getMenuBarGroupButtons']({'command':_0x37ce15,'commands':_0xc6fa35[0x0]['commands'],'parentMenuView':_0x18c1d7,'onExecute':_0x200c94})['forEach'](_0x18cac5=>_0x411f82['items']['add'](_0x18cac5)):_0xc6fa35['forEach'](({groupId:_0x17c84d,groupLabel:_0x344378,commands:_0x4e7601})=>{const _0x56f55d=new _0x18fb33(_0x3db2d8,_0x18c1d7),_0x196f76=new _0x2fb236(_0x3db2d8),_0x27cf11=new _0x232dc0(_0x3db2d8),_0x393ecb=this['_getMenuBarGroupButtons']({'command':_0x37ce15,'commands':_0x4e7601,'parentMenuView':_0x196f76,'onExecute':_0x200c94});_0x196f76['buttonView']['set']({'label':_0x344378||_0x17c84d}),_0x196f76['delegate']('execute')['to'](_0x18c1d7),_0x27cf11['items']['addMany'](_0x393ecb),_0x196f76['panelView']['children']['add'](_0x27cf11),_0x56f55d['children']['add'](_0x196f76),_0x411f82['items']['add'](_0x56f55d);}),_0x18c1d7['panelView']['children']['add'](_0x411f82);}['_getMenuBarGroupButtons']({command:_0x149f9f,commands:_0x4b4f37,parentMenuView:_0x561f42,onExecute:_0x4113f4}){const _0x1b4762=this['editor'],_0x38d1c4=_0x1b4762['locale'];return U(_0x1b4762,_0x4b4f37)['map'](_0x2ee7f2=>{const _0x45428f=new _0x18fb33(_0x38d1c4,_0x561f42),_0x516d48=new _0x4377e8(_0x38d1c4);return _0x516d48['set']({'label':_0x2ee7f2['label']}),_0x516d48['delegate']('execute')['to'](_0x561f42),_0x516d48['on']('execute',()=>_0x4113f4(_0x2ee7f2['id'])),_0x516d48['bind']('isEnabled')['to'](_0x149f9f,'enabledCommandsIds',_0x1f2c5d=>_0x1f2c5d['includes'](_0x2ee7f2['id'])),_0x45428f['children']['add'](_0x516d48),_0x45428f;});}}function B(_0x1ecdb1,_0x255453){return void 0x0!==_0x1ecdb1['order']&&void 0x0===_0x255453['order']?0x1:void 0x0===_0x1ecdb1['order']&&void 0x0!==_0x255453['order']?-0x1:void 0x0!==_0x1ecdb1['order']&&void 0x0!==_0x255453['order']?_0x1ecdb1['order']-_0x255453['order']:0x0;}function U(_0x142cf8,_0x38b7b9){_0x38b7b9['sort'](B);const _0x535141={},_0x180d2f=[];for(const _0x47642a of _0x38b7b9)if(void 0x0!==_0x47642a['order']){if(_0x47642a['order']in _0x535141)throw new _0x408e3e('ai-commands-config-order-collision',_0x142cf8,{'conflictingDefinitions':[_0x47642a,_0x535141[_0x47642a['order']]]});_0x535141[_0x47642a['order']]=_0x47642a,_0x180d2f['splice'](_0x47642a['order'],0x0,_0x47642a);}else _0x180d2f['push'](_0x47642a);return _0x180d2f;}class r extends _0x272b82{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2eb966){super(_0x2eb966);const _0x5896e9=_0x2eb966['config'],_0x13f574=_0x2eb966['locale'];_0x5896e9['define']('ai.aiAssistant.preserveComments',!0x0),_0x5896e9['define']('ai.aiAssistant.commands',function(_0x2ba93c){return[{'groupId':'editOrReview','groupLabel':i(_0x2ba93c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2ba93c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2ba93c,'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(_0x2ba93c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2ba93c,'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(_0x2ba93c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2ba93c,'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(_0x2ba93c,'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(_0x2ba93c,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2ba93c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2ba93c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2ba93c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2ba93c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2ba93c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2ba93c,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2ba93c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2ba93c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2ba93c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2ba93c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2ba93c,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2ba93c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2ba93c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2ba93c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2ba93c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2ba93c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2ba93c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2ba93c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2ba93c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x13f574)),_0x5896e9['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5896e9['define']('ai.aiAssistant.removeCommands',[]);let _0x53a8ad=o(_0x5896e9['get']('ai.aiAssistant.commands'),_0x13f574);const _0x165dcc=_0x5896e9['get']('ai.aiAssistant.extraCommandGroups'),_0x1a8a17=_0x5896e9['get']('ai.aiAssistant.removeCommands');_0x165dcc['forEach'](_0x4a7599=>{const _0x1aba09=_0x53a8ad['find'](_0x5ac999=>_0x5ac999['groupId']===_0x4a7599['groupId']);_0x1aba09?_0x1aba09['commands']=_0x1aba09['commands']['concat'](_0x4a7599['commands']):_0x53a8ad['push'](_0x4a7599);}),_0x53a8ad=_0x53a8ad['filter'](_0x334f22=>!_0x1a8a17['includes'](_0x334f22['groupId'])),_0x53a8ad['forEach'](_0x11608f=>{_0x11608f['commands']=_0x11608f['commands']['filter'](_0x12b465=>!_0x1a8a17['includes'](_0x12b465['id']));}),_0x5896e9['set']('ai.aiAssistant.commands',_0x53a8ad);}}class P extends _0x272b82{['abortController'];static get['requires'](){return[K];}constructor(_0x26a83e){super(_0x26a83e),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x242372){return this['sendRequest'](_0x242372)['catch'](_0x53d745=>{if(_0x53d745 instanceof R)return Promise['reject'](_0x53d745);if('AbortError'==_0x53d745['name'])return Promise['resolve']();throw console['error'](_0x53d745),new _0x408e3e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2014fb,_0x49230d){const _0x4c4870=this['editor']['locale'],_0xbcd0e7={'Content-Type':'application/json'};if('object'==typeof _0x2014fb)Object['assign'](_0xbcd0e7,_0x2014fb);else{if(_0x2014fb)try{const _0x3dfd72=await _0x2014fb(_0x49230d);Object['assign'](_0xbcd0e7,_0x3dfd72);}catch(_0xf9a70f){return Promise['reject'](new R(i(_0x4c4870,'AI_ERROR_GET_HEADERS')));}}return _0xbcd0e7;}async['_prepareRequestParameters'](_0x3f9305,_0x415485){const _0x2c1607=this['editor']['locale'];if('object'==typeof _0x3f9305)return _0x3f9305;try{return await _0x3f9305(_0x415485);}catch(_0x4b46eb){return Promise['reject'](new R(i(_0x2c1607,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2a7bc2){super(_0x2a7bc2),_0x2a7bc2['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2a7bc2['config']['get']('ai.openAI.requestParameters')||_0x2a7bc2['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2a7bc2['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2a7bc2['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2a7bc2['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0xd1a64a,context:_0x551ab8,onData:_0x1c1670,actionId:_0x28e999}){const _0x56aa95=this['editor']['locale'],_0x241b95=await this['prepareMessages'](_0xd1a64a,_0x551ab8,_0x28e999),_0xe2767a=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x28e999),_0x40d765=await this['_prepareRequestParameters'](this['_requestParameters'],_0x28e999),_0x2b5302={'messages':_0x241b95,..._0x40d765},_0x5e72c5={'method':'POST','headers':_0xe2767a,'body':JSON['stringify'](_0x2b5302),'signal':this['abortController']['signal']},_0x1df863=await fetch(this['_apiUrl'],_0x5e72c5);if(_0x1df863['ok'])return _0x40d765['stream']?await this['_readStreamableResponse'](_0x1df863,_0x1c1670):await this['_readStaticResponse'](_0x1df863,_0x1c1670),Promise['resolve']();{const _0x48c50b=await _0x1df863['text']();return _0x48c50b['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x56aa95,'AI_ERROR_CONTEXT_LENGTH'))):_0x48c50b['includes']('Moderation')?Promise['reject'](new R(i(_0x56aa95,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x48c50b));}}async['prepareMessages'](_0x1b76f6,_0x5217ef,_0x2003bf){let _0x2225c5,_0xa5a468;return _0x5217ef?(_0x2225c5='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.',_0xa5a468='Instruction:\x0a'+_0x1b76f6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5217ef):(_0x2225c5='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.',_0xa5a468=_0x1b76f6),[{'role':'system','content':_0x2225c5},{'role':'user','content':_0xa5a468}];}async['_readStreamableResponse'](_0x385a4e,_0x19c859){const _0xd62666=_0x385a4e['body']['getReader'](),_0x3da288=new TextDecoder();let _0x5d3f52='',_0x387d10='',_0x29d69e='',_0x3266f6=!0x1;for(;!_0x3266f6;){const {done:_0x3d5989,value:_0x1f579a}=await _0xd62666['read'](),_0x2b184b=_0x5d3f52+_0x3da288['decode'](_0x1f579a);let _0x4883d0='';_0x3266f6=_0x3d5989;try{_0x4883d0=this['_cleanUpData'](_0x2b184b),_0x5d3f52='';}catch(_0x28f1f6){_0x5d3f52=_0x2b184b;continue;}_0x387d10+=_0x4883d0,!_0x3266f6&&this['_isBufferIncomplete'](_0x387d10)||_0x387d10&&(_0x29d69e+=_0x387d10,_0x387d10='',_0x19c859(_0x29d69e));}return Promise['resolve']();}async['_readStaticResponse'](_0x1f8534,_0x44ab1c){return _0x44ab1c((await _0x1f8534['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2473dc){const _0x5d3672=_0x2473dc['split']('<')['length']!==_0x2473dc['split']('>')['length'],_0xf5924c=_0x2473dc['length']<0x1e;return _0x5d3672&&_0xf5924c;}['_cleanUpData'](_0x5132da){return _0x5132da['split'](/\n(?![^{]*\})/g)['map'](_0x17e7f1=>_0x17e7f1['replace']('data:\x20',''))['filter'](_0x34ed29=>_0x34ed29&&_0x34ed29['length']>0x0&&'[DONE]'!==_0x34ed29)['map'](_0x4e5c4b=>{const {choices:_0x28f522}=JSON['parse'](_0x4e5c4b);if(_0x28f522[0x0]&&_0x28f522[0x0]['delta']&&_0x28f522[0x0]['delta']['content'])return _0x28f522[0x0]['delta']['content'];})['filter'](_0x2f6e05=>_0x2f6e05)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2d1d22){super(_0x2d1d22),_0x2d1d22['config']['get']('ai.aws.requestParameters')||_0x2d1d22['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']=_0x2d1d22['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2d1d22['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2d1d22['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2d1d22['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3eca95,context:_0x33ceda,onData:_0x285147,actionId:_0x10ee1c}){const {model:_0x3a7629,stream:_0x4176f8,..._0x4d6ba3}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x10ee1c),_0x3cd3bb={'prompt':await this['preparePrompt'](_0x3eca95,_0x33ceda,_0x3a7629,_0x10ee1c),..._0x4d6ba3};this['_apiUrl']?await this['_processProxyRequest'](_0x3cd3bb,_0x3a7629,_0x4176f8,_0x285147,_0x10ee1c):await this['_processAWSRequest'](_0x3cd3bb,_0x3a7629,_0x4176f8,_0x285147);}async['preparePrompt'](_0x1e2beb,_0x387e20,_0x2a64ca,_0x51efea){let _0x1b90c7,_0x2f0308;return _0x387e20?(_0x1b90c7='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.',_0x2f0308='Instruction:\x0a'+_0x1e2beb+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x387e20):(_0x1b90c7='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.',_0x2f0308=_0x1e2beb),'meta.llama'==this['getModelFamily'](_0x2a64ca)?'<<SYS>>\x0a'+_0x1b90c7+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2f0308+'\x0a[/INST]':'Human:\x0a'+_0x1b90c7+'\x0a'+_0x2f0308+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2b5adb){if(/^anthropic\.claude/['test'](_0x2b5adb))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2b5adb))return'ai21.j2';if(/^cohere\.command/['test'](_0x2b5adb))return'cohere.command';if(/^meta\.llama/['test'](_0x2b5adb))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2b5adb));}async['_processProxyRequest'](_0x3c5b63,_0x4fffef,_0x4119de,_0xe3a23b,_0x429d4a){const _0x4d7935={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x429d4a),'body':JSON['stringify']({..._0x3c5b63,'model':_0x4fffef,'stream':_0x4119de}),'signal':this['abortController']['signal']},_0x431d71=await fetch(this['_apiUrl'],_0x4d7935);_0x4119de?await this['_readStreamableResponse'](_0x431d71,_0x4fffef,_0xe3a23b):await this['_readStaticResponse'](_0x431d71,_0x4fffef,_0xe3a23b);}async['_processAWSRequest'](_0x435a36,_0x1b7145,_0x564eaa,_0x5b9328){const _0x24ecc0=new _0x6058e5(this['_bedrockClientConfig']),_0x43438c={'body':JSON['stringify'](_0x435a36),'contentType':'application/json','accept':'application/json','modelId':_0x1b7145};let _0x1e1539;if(_0x564eaa){const _0x44cb51=new _0x45a65c(_0x43438c);_0x1e1539=await _0x24ecc0['send'](_0x44cb51,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1e1539,_0x1b7145,_0x5b9328);}else{const _0x56fccf=new _0x397cc5(_0x43438c);_0x1e1539=await _0x24ecc0['send'](_0x56fccf,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1e1539,_0x1b7145,_0x5b9328);}}async['_readAsyncIterableResponse'](_0x479626,_0x1b3a58,_0x59695c){const _0xccb291=_0x479626['body'],_0x2d89ac=new TextDecoder('utf-8');let _0x5ec3ed='';for await(const _0x1ca84c of _0xccb291)if(_0x1ca84c['chunk']){const _0x4202d2=_0x2d89ac['decode'](_0x1ca84c['chunk']['bytes']),_0x159122=JSON['parse'](_0x4202d2);_0x5ec3ed+=this['_getGeneratedText'](_0x159122,_0x1b3a58),_0x59695c(_0x5ec3ed);}return Promise['resolve']();}async['_readStreamableResponse'](_0x7b1ff2,_0x3dd164,_0x14ac49){const _0x2ea8e8=_0x7b1ff2['body'],_0x34dbc8=new TextDecoder('utf-8'),_0x1c3ff9=_0x2ea8e8['getReader']();let _0x36ee75='',_0x4d3eef='',_0x128c4e=!0x1;for(;!_0x128c4e;){const {done:_0x3650b0,value:_0xdd770f}=await _0x1c3ff9['read']();if(_0x128c4e=_0x3650b0,_0x128c4e)break;const _0x434f34=(_0x36ee75+_0x34dbc8['decode'](_0xdd770f))['split']('\x0a')['map'](_0x168cae=>{try{return _0x36ee75='',JSON['parse'](_0x168cae);}catch(_0xa9102a){return _0x36ee75=_0x168cae,null;}})['filter'](_0x3bfbf3=>null!==_0x3bfbf3);_0x434f34['length']&&(_0x4d3eef+=_0x434f34['map'](_0x1a12cd=>this['_getGeneratedText'](_0x1a12cd,_0x3dd164))['join'](''),_0x14ac49(_0x4d3eef));}return Promise['resolve']();}async['_readStaticResponse'](_0x3f61b1,_0x40ccaf,_0x19c607){let _0x49cef5;return _0x49cef5=_0x3f61b1 instanceof Response?await _0x3f61b1['json']():JSON['parse'](Buffer['from'](_0x3f61b1['body'])['toString']('utf8')),(_0x19c607(this['_getGeneratedText'](_0x49cef5,_0x40ccaf)),Promise['resolve']());}['_getGeneratedText'](_0x29b892,_0x438cb5){switch(this['getModelFamily'](_0x438cb5)){case'anthropic.claude':return _0x29b892['completion'];case'ai21.j2':return _0x29b892['completions'][0x0]['data']['text'];case'cohere.command':return _0x29b892['generations'][0x0]['text'];case'meta.llama':return _0x29b892['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
23
+ import{Plugin as _0xc924d8,Command as _0x301361,icons as _0x522d83}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x136710,CKEditorError as _0x567ba8,ObservableMixin as _0x198539,global as _0x1dd5c9,isVisible as it,Rect as st,Collection as _0x1cb9bb,FocusTracker as _0x21e63b,KeystrokeHandler as ts,first as _0x32d55e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x2b981b,View as _0x5b848a,SpinnerView as _0x41e295,IconView as _0x5c1326,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x39988d,ButtonLabelView as te,FocusCycler as _0x48bbf9,createLabeledTextarea as _0xebfc45,Dialog as _0x407e06,createDropdown as _0xf86420,addMenuToDropdown as _0x10552a,MenuBarMenuView as _0x4507e7,MenuBarMenuListItemButtonView as _0x467b5c,DialogViewPosition as _0x2f2b27,MenuBarMenuListView as _0x458fdc,MenuBarMenuListItemView as _0x563a5a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x49a6d8,ClipboardMarkersUtils as _0x2a385d}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2aaf62,DataTransfer as _0x525304,UpcastWriter as _0xb35fc7,Matcher as _0x4dc0c1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x522a75,escape as _0x1ca36f}from'lodash-es';import{BedrockRuntimeClient as _0x14af6e,InvokeModelWithResponseStreamCommand as _0x5b5899,InvokeModelCommand as _0x463689}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2c25e7,_0x238c75){const _0x19f1d8=(0x0,_0x238c75['t'])('Other');return _0x2c25e7['length']?'groupId'in _0x2c25e7[0x0]?_0x2c25e7:[{'groupId':x,'groupLabel':_0x19f1d8,'order':0x1/0x0,'commands':_0x2c25e7}]:[{'groupId':x,'groupLabel':_0x19f1d8,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0xc924d8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x12bc48}=this,_0x552071=['ck-fake-ai-selection'];_0x12bc48['config']['get']('ai.useTheme')&&_0x552071['push']('ck-ai-assistant-ui_theme'),_0x12bc48['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x552071,'priority':0xc}}),_0x12bc48['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4b3cc4,{writer:_0x747f4c})=>{if(!_0x4b3cc4['markerRange']['isCollapsed'])return null;const _0x1a780a=_0x747f4c['createUIElement']('span');return _0x747f4c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1a780a),_0x1a780a;}});}['afterInit'](){!async function(_0x38d694){const _0x14f7fd=_0x2d546e([0x47,0x6e,0x45,0x71,0x35,0x34,0x41,0x44,0x66,0x51,0x76,0x48,0x77,0x50,0x59,0x6a,0x73,0x72,0x38,0x49,0x53,0x33,0x6c,0x32,0x39,0x7a,0x4e,0x63,0x62,0x6f,0x74,0x68,0x67,0x4a,0x4d,0x61,0x57,0x4f,0x42,0x4b,0x58,0x78,0x43,0x79,0x52,0x54,0x37,0x75,0x65,0x31,0x70,0x4c,0x55,0x6d,0x30,0x36,0x46,0x6b,0x69,0x64,0x56,0x5a]),_0x2e8c79=0x62df0cca,_0x39cb9c=0x62d852e2^_0x2e8c79,_0x1b5d30=window[_0x2d546e([0x44,0x61,0x74,0x65])][_0x2d546e([0x6e,0x6f,0x77])](),_0x4aca7f=_0x38d694[_0x2d546e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x50d31b=new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x317107=>{_0x4aca7f[_0x2d546e([0x6f,0x6e,0x63,0x65])](_0x2d546e([0x72,0x65,0x61,0x64,0x79]),_0x317107);}),_0x2dd10c={[_0x2d546e([0x6b,0x74,0x79])]:_0x2d546e([0x45,0x43]),[_0x2d546e([0x75,0x73,0x65])]:_0x2d546e([0x73,0x69,0x67]),[_0x2d546e([0x63,0x72,0x76])]:_0x2d546e([0x50,0x2d,0x32,0x35,0x36]),[_0x2d546e([0x78])]:_0x2d546e([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]),[_0x2d546e([0x79])]:_0x2d546e([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]),[_0x2d546e([0x61,0x6c,0x67])]:_0x2d546e([0x45,0x53,0x32,0x35,0x36])},_0x472ee6=_0x4aca7f[_0x2d546e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2d546e([0x67,0x65,0x74])](_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5cfa95(){let _0x17fb3a,_0x121f29=null,_0x2aed36=null;try{if(_0x472ee6==_0x2d546e([0x47,0x50,0x4c]))return _0x2d546e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x17fb3a=_0x575b5b(),!_0x17fb3a)return _0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x17fb3a[_0x2d546e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2aed36=_0x17f849(_0x17fb3a[_0x2d546e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x17fb3a[_0x2d546e([0x6a,0x74,0x69])])),await _0x3ffeb0()?_0x2ff653()?_0x56aa80()?_0x2d546e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x388c7e()?(_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2d546e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x121f29=_0x22f1e1(_0x2d546e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2d546e([0x74,0x72,0x69,0x61,0x6c])&&(_0x121f29=_0x22f1e1(_0x2d546e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x54262b()):_0x2d546e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2d546e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xfd2cc3){return _0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x56aa80(){const _0x50ef53=[_0x2d546e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2d546e([0x74,0x72,0x69,0x61,0x6c])][_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1b5d30/0x3e8:0xe10*_0x39cb9c;return _0x17fb3a[_0x2d546e([0x65,0x78,0x70])]<_0x50ef53;}function _0x2ff653(){const _0x4c8416=_0x17fb3a[_0x2d546e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4c8416&&(!!_0x4c8416[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x2a]))||!!_0x4c8416[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x41,0x49])));}function _0x388c7e(){const _0x370c40=_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x370c40||0x0==_0x370c40[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x9fd667}=new URL(window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x370c40[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9fd667))return!0x0;const _0x5f065a=_0x9fd667[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e]));return _0x370c40[_0x2d546e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x28f80e=>_0x28f80e[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x2a])))[_0x2d546e([0x6d,0x61,0x70])](_0x9499b8=>_0x9499b8[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e])))[_0x2d546e([0x73,0x6f,0x6d,0x65])](_0x34e2c4=>_0x5f065a[_0x2d546e([0x65,0x76,0x65,0x72,0x79])]((_0x48030d,_0x1e77a7)=>_0x34e2c4[_0x1e77a7]===_0x48030d||_0x34e2c4[_0x1e77a7]===_0x2d546e([0x2a])));}function _0x54262b(){return _0x121f29&&_0x2aed36?new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x23b72f,_0x2d0d9a)=>{_0x121f29[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x23b72f,_0x2d0d9a),_0x2aed36[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x1f78ce=>{_0x1f78ce!=_0x2d546e([0x56,0x61,0x6c,0x69,0x64])&&_0x23b72f(_0x1f78ce);},_0x2d0d9a);}):_0x121f29||_0x2aed36||_0x2d546e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x17f849(_0x2bda66,_0x425b91){return new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30ab6e=>{if(_0x12530e())return _0x30ab6e(_0x2d546e([0x56,0x61,0x6c,0x69,0x64]));_0x3289c2(),_0x4aca7f[_0x2d546e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x6609d0=!0x1;const _0x28b2db=_0x136710();function _0x4c1378(_0x3975b6){return!!_0x3975b6&&(typeof _0x3975b6===_0x2d546e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3975b6===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3975b6[_0x2d546e([0x74,0x68,0x65,0x6e])]===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3975b6[_0x2d546e([0x63,0x61,0x74,0x63,0x68])]===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2394f2(_0x37f7a9){_0x4d39d7(_0x37f7a9)[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x3fda3c=>{if(!_0x3fda3c||_0x3fda3c[_0x2d546e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2d546e([0x6f,0x6b]))return _0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x15c2ff(_0x226bc6(_0x28b2db+_0x425b91))!=_0x3fda3c[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2d546e([0x56,0x61,0x6c,0x69,0x64]);})[_0x2d546e([0x74,0x68,0x65,0x6e])](_0xc33e57=>(_0x2c619f(),_0xc33e57),()=>{const _0x105887=_0x48553b();return null==_0x105887?(_0x2c619f(),_0x2d546e([0x56,0x61,0x6c,0x69,0x64])):_0x2d546e(_0x1b5d30-_0x105887>(0x46d388ca^_0x2e8c79)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x30ab6e)[_0x2d546e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1a01cf=0x62e9e24a^_0x2e8c79;function _0x2c619f(){const _0x24fb53=_0x2d546e([0x6c,0x6c,0x63,0x74,0x2d])+_0x15c2ff(_0x226bc6(_0x2bda66)),_0x40a45=_0x47225b(_0x15c2ff(window[_0x2d546e([0x4d,0x61,0x74,0x68])][_0x2d546e([0x63,0x65,0x69,0x6c])](_0x1b5d30/_0x1a01cf)));window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2d546e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x24fb53,_0x40a45);}function _0x48553b(){const _0x3b7620=_0x2d546e([0x6c,0x6c,0x63,0x74,0x2d])+_0x15c2ff(_0x226bc6(_0x2bda66)),_0x49ce05=window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2d546e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3b7620);return _0x49ce05?window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47225b(_0x49ce05),0x10)*_0x1a01cf:null;}function _0x4d39d7(_0x5a4605){return new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2af823,_0x2d5535)=>{_0x5a4605[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x2af823,_0x2d5535),window[_0x2d546e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2d5535,0x62ded80a^_0x2e8c79);});}}_0x4aca7f[_0x2d546e([0x6f,0x6e])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xac1148,_0x1552cb)=>{if(_0x1552cb[0x0]!=_0x2bda66)return _0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1552cb[0x1]={..._0x1552cb[0x1],[_0x2d546e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x28b2db};},{[_0x2d546e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2d546e([0x68,0x69,0x67,0x68])}),_0x4aca7f[_0x2d546e([0x6f,0x6e])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4afd9e=>{_0x4c1378(_0x4afd9e[_0x2d546e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x6609d0=!0x0,_0x2394f2(_0x4afd9e[_0x2d546e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2d546e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2d546e([0x6c,0x6f,0x77])}),_0x50d31b[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>{_0x6609d0||_0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x12530e(){return _0x4aca7f[_0x2d546e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2d546e([0x76,0x69,0x65,0x77])][_0x2d546e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2d546e([0x61,0x75,0x74,0x6f]);}function _0x3289c2(){_0x4aca7f[_0x2d546e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2d546e([0x76,0x69,0x65,0x77])][_0x2d546e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2d546e([0x61,0x75,0x74,0x6f]);}}function _0x22f1e1(_0x3e6619){const _0x3c4321=[new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x52b3be=>setTimeout(_0x52b3be,0x62d63206^_0x2e8c79)),_0x50d31b[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2da23f=>{let _0x526f2b=0x0;_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x6f,0x6e])](_0x2d546e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x27dc63,_0x1a1eb2)=>{_0x1a1eb2[0x0][_0x2d546e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x526f2b++,_0x526f2b==(0x62df0d32^_0x2e8c79)&&(_0x2da23f(),_0x27dc63[_0x2d546e([0x6f,0x66,0x66])]());});}))];return window[_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2d546e([0x72,0x61,0x63,0x65])](_0x3c4321)[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>_0x3e6619);}async function _0x27251a(){await _0x50d31b,_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x35e9d6,_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x35e9d6,_0x4aca7f[_0x2d546e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x25117c(_0x2f7984){const _0x36beda=_0x2726e6();_0x4aca7f[_0x36beda]=_0x2d546e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2f7984,_0x2f7984!=_0x2d546e([0x56,0x61,0x6c,0x69,0x64])&&_0x27251a();}function _0x2726e6(){const _0x35e4fe=window[_0x2d546e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2d546e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2d546e([0x6e,0x6f,0x77])]())[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2d546e([0x2e]),'');let _0x5e9211=_0x2d546e([0x47]);for(let _0x5b9363=0x0;_0x5b9363<_0x35e4fe[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5b9363+=0x2){let _0x476b5a=window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x35e4fe[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5b9363,_0x5b9363+0x2));_0x476b5a>=_0x14f7fd[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x476b5a-=_0x14f7fd[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5e9211+=_0x14f7fd[_0x476b5a];}return _0x5e9211;}function _0x575b5b(){const _0x371fb4=_0x472ee6[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e]));if(0x3!=_0x371fb4[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xe06b59(_0x371fb4[0x1]);function _0xe06b59(_0xd31e9e){const _0x5272d5=_0x4a1f64(_0xd31e9e);return _0x5272d5&&_0x32273c()?_0x5272d5:null;function _0x32273c(){const _0x28ccea=_0x5272d5[_0x2d546e([0x6a,0x74,0x69])],_0x5eb492=window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x28ccea[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x28ccea[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5202c3={..._0x5272d5,[_0x2d546e([0x6a,0x74,0x69])]:_0x28ccea[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x28ccea[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5202c3[_0x2d546e([0x76,0x63])],_0x226bc6(_0x5202c3)==_0x5eb492;}}}async function _0x3ffeb0(){let _0x27a3f3=!0x0;try{const _0x6a8c5b=_0x472ee6[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e])),[_0x26968e,_0x2dc9a3,_0x5214d5]=_0x6a8c5b;return _0x9e79ac(_0x26968e),await _0x5ea7a4(_0x26968e,_0x2dc9a3,_0x5214d5),_0x27a3f3;}catch(_0x2d9a66){return!0x1;}function _0x9e79ac(_0x5cfcfe){const _0x3c2d62=_0x4a1f64(_0x5cfcfe);_0x3c2d62&&_0x3c2d62[_0x2d546e([0x61,0x6c,0x67])]==_0x2d546e([0x45,0x53,0x32,0x35,0x36])||(_0x27a3f3=!0x1);}async function _0x5ea7a4(_0x4f0652,_0x447f26,_0x13e122){const _0x3ea824=window[_0x2d546e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2d546e([0x66,0x72,0x6f,0x6d])](_0x5a314c(_0x13e122),_0x1bc275=>_0x1bc275[_0x2d546e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x17c97c=new window[(_0x2d546e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2d546e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f0652+_0x2d546e([0x2e])+_0x447f26),_0x1afbb1=window[_0x2d546e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2d546e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1afbb1)return;const _0x970227=await _0x1afbb1[_0x2d546e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2d546e([0x6a,0x77,0x6b]),_0x2dd10c,{[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x45,0x43,0x44,0x53,0x41]),[_0x2d546e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2d546e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1afbb1[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x45,0x43,0x44,0x53,0x41]),[_0x2d546e([0x68,0x61,0x73,0x68])]:{[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x970227,_0x3ea824,_0x17c97c)||(_0x27a3f3=!0x1);}}function _0x4a1f64(_0x49fbf0){return _0x49fbf0[_0x2d546e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2d546e([0x65,0x79]))?JSON[_0x2d546e([0x70,0x61,0x72,0x73,0x65])](_0x5a314c(_0x49fbf0)):null;}function _0x5a314c(_0x1a7ea1){return window[_0x2d546e([0x61,0x74,0x6f,0x62])](_0x1a7ea1[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2d546e([0x2b]))[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2d546e([0x2f])));}function _0x226bc6(_0x33c7dc){let _0xce51ed=0x1505;function _0x22c1fe(_0x4dc0f8){for(let _0x5ea99d=0x0;_0x5ea99d<_0x4dc0f8[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ea99d++){const _0x29e03b=_0x4dc0f8[_0x2d546e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5ea99d);_0xce51ed=(_0xce51ed<<0x5)+_0xce51ed+_0x29e03b,_0xce51ed&=_0xce51ed;}}function _0x270139(_0x292d88){Array[_0x2d546e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x292d88)?_0x292d88[_0x2d546e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x270139):_0x292d88&&typeof _0x292d88==_0x2d546e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2d546e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x292d88)[_0x2d546e([0x73,0x6f,0x72,0x74])]()[_0x2d546e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x544076,_0x45c07d])=>{_0x22c1fe(_0x544076),_0x270139(_0x45c07d);}):_0x22c1fe(window[_0x2d546e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x292d88));}return _0x270139(_0x33c7dc),_0xce51ed>>>0x0;}function _0x15c2ff(_0x3b1e5a){return _0x3b1e5a[_0x2d546e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2d546e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2d546e([0x30]));}function _0x47225b(_0x2320c8){return _0x2320c8[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2d546e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2d546e([0x6a,0x6f,0x69,0x6e])]('');}function _0x35e9d6(){}function _0x2d546e(_0x1dbca2){return _0x1dbca2['map'](_0xcadf7e=>String['fromCharCode'](_0xcadf7e))['join']('');}_0x25117c(await _0x5cfa95());}(this);}['showFakeVisualSelection'](){const _0x2eddd7=this['editor']['model'];_0x2eddd7['change'](_0x5c24de=>{const _0x3d9bf0=_0x2eddd7['document']['selection']['getRanges']();let _0x2619f0=0x0;for(const _0x29883b of _0x3d9bf0){const _0x396afa=f+':'+_0x2619f0;if(_0x2eddd7['markers']['has'](_0x396afa))_0x5c24de['updateMarker'](_0x396afa,{'range':_0x29883b});else{if(_0x29883b['start']['isAtEnd']){const _0x4e3517=_0x29883b['start']['getLastMatchingPosition'](({item:_0x185d41})=>!_0x2eddd7['schema']['isContent'](_0x185d41),{'boundaries':_0x29883b});_0x5c24de['addMarker'](_0x396afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c24de['createRange'](_0x4e3517,_0x29883b['end'])});}else _0x5c24de['addMarker'](_0x396afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29883b});}_0x2619f0++;}});}['hideFakeVisualSelection'](){const _0x4583d6=this['editor']['model'],_0x5ba8cf=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5ba8cf['length']&&_0x4583d6['change'](_0x50ccdf=>{_0x5ba8cf['forEach'](_0x4056d7=>{_0x50ccdf['removeMarker'](_0x4056d7);});});}['insertContent'](_0x66af6,_0x5b1581){const _0x5477ce=this['_getAISelection'](),_0x57845a=_0x5b1581||_0x5477ce['getFirstRange']();this['editor']['model']['canEditAt'](_0x57845a)&&this['editor']['model']['change'](_0x8f511d=>{this['hideFakeVisualSelection'](),_0x5b1581||this['_resetContentOfSelectedTableCells'](_0x8f511d,_0x5477ce),this['_pasteHTMLUsingClipboard']({'insertAt':_0x57845a,'writer':_0x8f511d,'html':_0x66af6});});}['insertContentBelow'](_0xdba881){const {model:_0x4ea55e}=this['editor'],_0x455062=this['_getAISelection']();_0x4ea55e['change'](()=>{const _0x13b1a4=this['_prepareTableInsertBelowPosition'](_0xdba881,_0x455062)||this['_getDefaultInsertBelowPosition'](_0x455062);this['insertContent'](_0xdba881,_0x13b1a4);});}['_getAISelection'](){const _0x5a080a=this['editor']['model'],_0x89f7a3=Array['from'](_0x5a080a['markers']['getMarkersGroup'](f))['map'](_0x33b0af=>_0x33b0af['getRange']());return _0x5a080a['createSelection'](_0x89f7a3);}['_pasteHTMLUsingClipboard']({writer:_0x24886b,html:_0x114714,insertAt:_0x256638}){const {view:_0x33156c}=this['editor']['editing'],_0x47b1ee=this['editor']['plugins']['get'](_0x49a6d8),_0x5e85ee=new dt();_0x5e85ee['setData']('text/html',_0x114714);const _0x434a4c=new ClipboardEvent('paste',{'clipboardData':_0x5e85ee}),_0x20b8ea=new _0x2aaf62(_0x33156c,_0x434a4c,{'dataTransfer':new _0x525304(_0x5e85ee)});_0x24886b['setSelection'](_0x256638);const _0x123a59=(_0x2bac12,_0x46092e)=>{_0x46092e['resultRange']&&_0x24886b['setSelection'](_0x46092e['resultRange']);};_0x47b1ee['once']('contentInsertion',_0x123a59,{'priority':'lowest'}),_0x33156c['document']['fire']('paste',_0x20b8ea),_0x47b1ee['off']('contentInsertion',_0x123a59);}['_getDefaultInsertBelowPosition'](_0x55c9eb){const {model:_0x3780a3}=this['editor'],_0x3ec9f9=Array['from'](_0x55c9eb['getSelectedBlocks']());return _0x3ec9f9['length']?_0x3780a3['createPositionAfter'](_0x3ec9f9['pop']()):_0x55c9eb['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3bc9c8,_0x33bf0a){const {model:_0x4440fc,plugins:_0x38f683}=this['editor'];if(_0x38f683['has']('TableUtils')){const _0x40a6a2=_0x38f683['get']('TableUtils')['getSelectedTableCells'](_0x33bf0a);if(_0x40a6a2['length']){const _0x4d1400=this['_getTableRowCountFromContent'](_0x3bc9c8),_0x3aa798=this['_createEmptyTableRows'](_0x40a6a2,_0x4d1400);return _0x4440fc['createPositionAt'](_0x3aa798,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5b441c){const _0x275090=this['editor']['plugins']['get']('TableUtils'),_0x22044c=this['editor']['data']['parse'](_0x5b441c),_0x1d2cce=Array['from'](_0x22044c['getChildren']())['filter'](_0x33c46d=>_0x33c46d['is']('element','table'));let _0x31f7eb=0x0;return _0x1d2cce['forEach'](_0x8d989a=>{_0x31f7eb+=_0x275090['getRows'](_0x8d989a);}),_0x31f7eb;}['_createEmptyTableRows'](_0x5cee67,_0x29c7c7){const _0x25eec2=this['editor']['plugins']['get']('TableUtils'),_0x27dc3c=_0x25eec2['getRowIndexes'](_0x5cee67),_0x5d6046=_0x25eec2['getColumnIndexes'](_0x5cee67),_0xf87ff4=_0x27dc3c['last']+0x1,_0x3946c0=_0x5d6046['first'],_0x642f3f=_0x5cee67[0x0]['findAncestor']('table');for(let _0x51ce69=0x0;_0x51ce69<_0x29c7c7;_0x51ce69++)_0x25eec2['insertRows'](_0x642f3f,{'at':_0xf87ff4});return _0x642f3f['getChild'](_0xf87ff4)['getChild'](_0x3946c0);}['_resetContentOfSelectedTableCells'](_0x29926c,_0x202fe4){const {plugins:_0x43354d}=this['editor'],{model:_0x3df98c}=_0x29926c;if(!_0x43354d['has']('TableUtils'))return;_0x43354d['get']('TableUtils')['getSelectedTableCells'](_0x202fe4)['length']&&_0x3df98c['deleteContent'](_0x202fe4);}}class K extends _0xc924d8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x567ba8('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2c0fff){super(_0x2c0fff),this['name']='AIRequestError';}}function i(_0xc2cc5,_0xcd20bc,_0x187e13){const t=_0xc2cc5['t'];switch(_0xcd20bc){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',_0x187e13);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x187e13);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'},_0x187e13);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 _0xcd20bc;}}class E extends _0x301361{['_commandDefinitions'];constructor(_0x5d7d7d,_0x5d6c82){super(_0x5d7d7d),this['_commandDefinitions']=_0x5d6c82,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3c2c5d,_0x471a31,_0x56c68a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x56c68a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5dbac2,_0x991980,_0x4ebfed)=>{this['enabledCommandsIds']=_0x4ebfed?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xdb609e=this['editor']['model'];this['_hasContext']=function(_0x4bf303){const _0x4c352f=_0x4bf303['document']['selection'];return _0x4c352f['isCollapsed']?0x0!==[..._0x4c352f['getSelectedBlocks']()]['length']&&![..._0x4c352f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4bf303['hasContent'](_0x4c352f['getFirstRange']());}(_0xdb609e);const _0x5b7568=_0xdb609e['document']['selection'],_0x353828=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x704cdc of _0x5b7568['getRanges']())for(const _0x17f8d7 of _0x704cdc['getItems']())if(_0x17f8d7['is']('element')&&_0x353828['includes'](_0x17f8d7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2ff211='',_0x3d6b3d='',_0x1d0f1a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2ff211,_0x3d6b3d,_0x1d0f1a);}}function G(_0x58e10b,_0x1ee453){const _0x45ec3e=new Set();for(const _0x3d104a of _0x58e10b['values']())(_0x1ee453||!0x1===_0x3d104a['requiresContent'])&&_0x45ec3e['add'](_0x3d104a['id']);return Array['from'](_0x45ec3e);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x198539(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x270f04,_0x1f8a7b,_0x22c4da){super(),this['editor']=_0x270f04,this['textAdapter']=_0x1f8a7b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x22c4da,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x479483,_0x18014a,_0x1dacf4)=>{this['view']['value']=this['_sanitizeHTML'](_0x1dacf4);}),this['listenTo'](this['view'],'submitPrompt',(_0x16490c,_0x6710bd)=>{const _0x27d4f9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x6710bd,_0x27d4f9,'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:_0x2a265a,query:_0x533be8,htmlContent:_0x35f790,label:_0x23a607,mainActionLabel:_0x42f1d6}){this['view']['prompt']=_0x23a607,this['view']['mainAction']=_0x42f1d6,this['initialContext']=_0x35f790,_0x533be8&&(this['view']['isRendered']?this['_handleQuery'](_0x533be8,_0x35f790,_0x2a265a,_0x23a607):this['view']['once']('render',()=>{this['_handleQuery'](_0x533be8,_0x35f790,_0x2a265a,_0x23a607);}));}['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'](_0x3cb08f,_0x3ec7d7,_0x3623a9,_0x831ac4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3ec7d7,this['previousQuery']=_0x3cb08f,this['previousLabel']=_0x831ac4||_0x3cb08f,this['previousActionId']=_0x3623a9,new Promise(_0x1696bc=>{this['textAdapter']['makeRequest']({'query':_0x3cb08f,'context':_0x3ec7d7,'onData':_0x3cdd1d=>{this['currentResponse']=_0x3cdd1d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3623a9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x10ed5a=>{_0x10ed5a instanceof R?this['view']['handleError'](_0x10ed5a['message']):this['view']['handleError'](),_0x1696bc();})['finally'](()=>{this['stopProcessing'](),_0x1696bc();});});}['_parseAndNormalizeContent'](_0x2ae1b4,_0x5386a4=!0x1){const _0x34ecea=Z['exec'](_0x2ae1b4);_0x2ae1b4=_0x34ecea?_0x2ae1b4['substring'](_0x34ecea[0x1]['length']):_0x2ae1b4['length']<0x64&&!_0x5386a4?'':this['_stripMarkdownSyntax'](_0x2ae1b4);const _0xd758dc=this['_domParser']['parseFromString'](_0x2ae1b4,'text/html');if(_0x34ecea){const _0x1bb3b5=Array['from'](_0xd758dc['body']['childNodes']);_0x1bb3b5['reverse']();for(const _0xf61f77 of _0x1bb3b5){if(_0xf61f77['nodeType']==Node['ELEMENT_NODE'])break;_0xf61f77['remove']();}}const _0x797a71=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xd758dc['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x797a71);const _0x79e174=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2c51e8=this['editor']['data']['toModel'](_0x797a71);return _0x79e174||_0x2c51e8['markers']['clear'](),this['editor']['data']['stringify'](_0x2c51e8);}['_normalizeResponseHeadings'](_0x32dd72){const _0xf4ce21=new _0xb35fc7(this['editor']['editing']['view']['document']),_0x5cfc55=new _0x4dc0c1({'name':/^h[1-5]$/}),_0x16eab5=[];let _0x53f1eb=!0x1;for(const _0x270af5 of _0x32dd72)_0x270af5['is']('element')&&_0x5cfc55['match'](_0x270af5)&&(_0x16eab5['push'](_0x270af5),'h1'==_0x270af5['name']&&(_0x53f1eb=!0x0));if(_0x53f1eb){for(const _0x2bdfe6 of _0x16eab5)_0xf4ce21['rename']('h'+(parseInt(_0x2bdfe6['name'][0x1])+0x1),_0x2bdfe6);}}['_isH1TagSupportEnabled'](){const {data:_0x442adc,editing:_0x4f0692}=this['editor'],_0x46777f=_0x442adc['htmlProcessor']['toView']('<h1></h1>'),_0xbf028c=_0x442adc['toView'](_0x442adc['toModel'](_0x46777f));return!!_0x4f0692['view']['domConverter']['viewToDom'](_0xbf028c)['querySelector']('h1');}['_sanitizeHTML'](_0x50c86c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x50c86c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x133f92){const _0x49c9c8=_0x133f92['trim']();return _0x49c9c8['startsWith']('```html')?_0x49c9c8['endsWith']('```')?_0x49c9c8['substring'](0x7,_0x49c9c8['length']-0x3):_0x49c9c8['substring'](0x7):_0x133f92;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x13f7a0){super(_0x13f7a0),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x280d61=>i(_0x13f7a0,'AI_'+_0x280d61['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x13f7a0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x13f7a0,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x13f7a0,'Stop'));const _0x237f94=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x237f94['if']('isVisible','ck-hidden',_0x3a8133=>!_0x3a8133)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f2f14,_0x5550bd){const _0x3b8191=new _0x2b981b(this['locale']);return _0x3b8191['set']({'label':_0x2f2f14,'class':_0x5550bd||'','isVisible':!0x0,'withText':!0x0}),_0x3b8191;}}var W='<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 X extends _0x5b848a{['contentFieldView'];['copyButtonView'];constructor(_0x539328,_0xe58597=''){super(_0x539328),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x249177=this['bindTemplate'];this['contentFieldView']=new mt(_0x539328,_0xe58597),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x249177['if']('isVisible','ck-hidden',_0x25d8c1=>!_0x25d8c1)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x249177['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 _0x4e8160=!0x1;this['on']('change:value',(_0x223f86,_0x4fb59b,_0x43df78)=>{const _0x459b67=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x43df78),this['isProcessing']&&_0x459b67&&!_0x4e8160&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5f008b,_0x596696,_0x25979d)=>{_0x4e8160=!0x1,_0x25979d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4e8160=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4e8160=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3bf47e=this['locale'],_0x4dd4d5=new _0x2b981b(this['locale']),_0x2bd4a3='ck-ai-form__copy-button';return _0x4dd4d5['set']({'label':i(_0x3bf47e,'Copy'),'icon':W,'class':_0x2bd4a3,'tooltip':!0x0}),_0x4dd4d5['bind']('isVisible')['to'](this,'value',_0x9cd81e=>!!_0x9cd81e),_0x4dd4d5['bind']('isEnabled')['to'](this,'isProcessing',_0x18f895=>!_0x18f895),_0x4dd4d5['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4dd4d5['icon']=_0x522d83['check'],_0x4dd4d5['class']=_0x2bd4a3+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4dd4d5['icon']=W,_0x4dd4d5['class']=_0x2bd4a3;},0x3e8);}),_0x4dd4d5;}['_copyHTMLToClipboard'](_0x1c1ac0){const {window:_0x366b14,document:_0x4fc14e}=_0x1dd5c9;if(_0x366b14['ClipboardItem']){const {Blob:_0x3189b4,ClipboardItem:_0x3a9ed2}=_0x366b14,_0xa62ea6=[new _0x3a9ed2({'text/html':new _0x3189b4([_0x1c1ac0['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3189b4([_0x1c1ac0['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xa62ea6);}else{const _0x4b0003=_0x4fc14e['createElement']('div');_0x4b0003['style']['position']='absolute',_0x4b0003['style']['left']='-9999px',_0x4b0003['innerHTML']='<span>[</span>'+_0x1c1ac0['innerHTML']+'<span>]</span>',_0x4fc14e['body']['appendChild'](_0x4b0003);const _0x197114=_0x4fc14e['createRange']();_0x197114['setStartAfter'](_0x4b0003['firstElementChild']),_0x197114['setEndBefore'](_0x4b0003['lastElementChild']);const _0x54436e=_0x366b14['getSelection']();_0x54436e['removeAllRanges'](),_0x54436e['addRange'](_0x197114),_0x4fc14e['execCommand']('copy'),_0x4b0003['remove']();}}}class mt extends _0x5b848a{constructor(_0x2530c3,_0x41b38f=''){super(_0x2530c3),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x41b38f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3213c4){this['element']['innerHTML']=_0x3213c4;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x59037e=new _0x5b848a(),_0xa1795f=this['locale'],_0x8cc092=new _0x41e295();return _0x8cc092['isVisible']=!0x0,_0x59037e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x8cc092,{'text':i(_0xa1795f,'AI\x20is\x20writing...')}]}),_0x59037e['render'](),_0x59037e;}}class rt extends _0x5b848a{constructor(_0x3a1219,_0x5e4ad4=''){super(_0x3a1219);const _0x5990b5=new _0x5c1326(),_0x1ed605=this['bindTemplate'];this['set']('text',_0x5e4ad4),_0x5990b5['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':[_0x5990b5,{'text':_0x1ed605['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x145833,_0x2ce6b6){super(_0x145833,_0x2ce6b6),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',(_0x1902f8,_0x1f4df0)=>{_0x1902f8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1f4df0());});}['_createSubmitButton'](){const _0x46dd25=new _0x2b981b(this['locale']),_0x5b5785=this['locale'];return _0x46dd25['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(_0x5b5785,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x46dd25['on']('execute',()=>{this['submit']();}),_0x46dd25['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x27133d,_0x3e0c07)=>!_0x27133d&&_0x3e0c07),_0x46dd25;}['_createShowHistoryButton'](){const _0x24738b=new _0x2b981b(this['locale']),_0x38d4e8=this['resultsView'],_0x3c7798=this['locale'];_0x24738b['set']({'label':i(_0x3c7798,'History'),'withText':!0x1,'icon':_0x522d83['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x24738b['bind']('isOn')['to'](_0x38d4e8,'isVisible'),_0x24738b['bind']('isEnabled')['to'](this,'isEnabled'),_0x24738b['on']('execute',()=>{_0x38d4e8['isVisible']=!_0x38d4e8['isVisible'],_0x38d4e8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x128573=()=>{_0x1dd5c9['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x102e0c=new st(this['queryView']['fieldView']['element']),_0x1e86ba=_0x102e0c['width'],_0x1880cc='rtl'===_0x3c7798['uiLanguageDirection']?'left':'right';_0x102e0c['excludeScrollbarsAndBorders'](),_0x24738b['element']['style'][_0x1880cc]=_0x1e86ba-_0x102e0c['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x128573),this['on']('render',_0x128573),_0x24738b;}['submit'](){const _0x380cba=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x380cba);}['focus'](_0x5093a0){-0x1===_0x5093a0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4736ba){super(_0x4736ba),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4736ba,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x19adfd=0x0;for(const _0x4d34dc of this['items'])_0x19adfd+=_0x4d34dc['items']['length'];return{'resultsCount':_0x19adfd,'totalItemsCount':_0x19adfd};}['_createClearHistoryButton'](){const _0x1656d7=this['locale'],_0x291595=new _0x2b981b(this['locale']);return _0x291595['set']({'label':'('+i(_0x1656d7,'Clear')+')','withText':!0x0}),_0x291595['on']('execute',()=>this['fire']('clearHistory')),_0x291595;}}class hs extends _0x39988d{constructor(_0x70fe87){super();const _0x5df28f=new te(),_0x49364c=new _0x2b981b(this['locale'],_0x5df28f);this['children']['add'](_0x49364c),_0x49364c['set']({'label':_0x70fe87['prompt'],'withText':!0x0}),_0x49364c['on']('execute',()=>{this['fire']('execute',{'value':_0x522a75(_0x70fe87['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x1cb9bb{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x46c30e,_0x47a0fc)=>{const _0x213433=Ss(_0x47a0fc['prompt']);for(const _0x4c0866 of this)if(_0x4c0866!=_0x47a0fc&&Ss(_0x4c0866['prompt'])===_0x213433){this['remove'](_0x4c0866);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x367bc8=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x367bc8));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x3352ca=>_0x3352ca)));}}function Ss(_0x10d7c1){return _0x10d7c1['toLowerCase']()['trim']();}class k extends _0x5b848a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x258948,_0x4c1def,_0x15b3fb=''){super(_0x258948),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x258948),this['contentArea']=new X(_0x258948,_0x15b3fb),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 _0x21e63b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x48bbf9({'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 _0x5800ef=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c1def],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5800ef['if']('isError','ck-hidden',_0x1ecc39=>!_0x1ecc39)]},'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'](_0x40459e=0x1){-0x1===_0x40459e?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 _0x249f13=this['locale'],_0xf54625=new ht(_0x249f13,{'queryView':{'label':i(_0x249f13,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xebfc45,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x249f13,'Empty\x20history'),'secondary':i(_0x249f13,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf54625['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x45dc9f,_0x5035a6)=>_0x45dc9f&&!_0x5035a6),this['listenTo'](_0xf54625,'submit',(_0x4c852b,_0x6ca3d2)=>{this['prompt']=_0x6ca3d2;const _0x40f572=_0x1ca36f(_0x6ca3d2);this['fire']('submitPrompt',_0x40f572),_0x6ca3d2['trim']()&&this['_promptHistory']['add']({'prompt':_0x40f572},0x0);},{'priority':'high'}),_0xf54625;}['_createHistoryView'](){const _0x23d4d1=new rs(this['locale']);return _0x23d4d1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x23d4d1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x23d4d1;}['_createToolbar'](){const _0x46f669=new at(this['locale']);return _0x46f669['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5e4498,_0x4e8729,_0x3d3438)=>_0x5e4498&&!_0x4e8729&&!!_0x3d3438),_0x46f669['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x46f669['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4bf38c,_0x19b7b8,_0x25eb3c)=>_0x4bf38c&&!_0x19b7b8&&!!_0x25eb3c),_0x46f669['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x46f669['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3f181c,_0x5ea2bb)=>_0x3f181c&&!_0x5ea2bb),_0x46f669['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x46f669['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x46f669['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x46f669;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2b95e3=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2b95e3,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x9db727){const _0x32748b=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x9db727||i(_0x32748b,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<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 w=globalThis['DataTransfer'];class n extends _0xc924d8{['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[_0x2a385d,a,K,_0x407e06];}constructor(_0x2209f3){super(_0x2209f3),_0x2209f3['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2209f3['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2209f3['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2209f3['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x38108f}=this;this['_aiAdapter']=_0x38108f['plugins']['get'](K),this['_dialog']=_0x38108f['plugins']['get'](_0x407e06),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b1adc=new E(_0x38108f,Array['from'](this['_commandDefinitions']['values']()));_0x38108f['commands']['add']('showAIAssistant',_0x1b1adc),_0x38108f['ui']['componentFactory']['add']('aiCommands',_0x5c4421=>{const _0x2e6cf5=_0xf86420(_0x5c4421);return _0x2e6cf5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2e6cf5['buttonView']['set']({'label':i(_0x5c4421,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x2e6cf5['on']('execute',_0x19c48c=>this['_onExecute'](_0x19c48c['source']['id'])),_0x10552a(_0x2e6cf5,_0x38108f['ui']['view']['body'],function(_0x3ab41c){const _0x852f7=o(_0x3ab41c['config']['get']('ai.aiAssistant.commands'),_0x3ab41c['locale']),_0x18a840=U(_0x3ab41c,_0x852f7)['filter'](_0x44097b=>_0x44097b['commands']['length']);if(0x1===_0x18a840['length'])return U(_0x3ab41c,_0x18a840[0x0]['commands'])['map'](_0x301726=>({'id':_0x301726['id'],'label':_0x301726['label']}));return _0x18a840['map'](_0x47fbf1=>{const {groupId:_0x2cad27,groupLabel:_0x21a72b,commands:_0x26a7db}=_0x47fbf1,_0x2f4f80=U(_0x3ab41c,_0x26a7db)['map'](_0x1075ea=>({'id':_0x1075ea['id'],'label':_0x1075ea['label']}));return{'id':_0x2cad27,'menu':_0x21a72b||_0x2cad27,'children':_0x2f4f80};});}(_0x38108f),{'ariaLabel':i(_0x5c4421,'AI\x20Commands')}),_0x2e6cf5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b1adc['on']('change:enabledCommandsIds',_0x589c17),_0x2e6cf5['menuView']['once']('render',_0x589c17),_0x2e6cf5;function _0x589c17(){_0x2e6cf5['isEnabled']=_0x1b1adc['enabledCommandsIds']['length']>0x0;for(const _0x555775 of _0x2e6cf5['menuView']['buttons'])_0x555775['isEnabled']=_0x1b1adc['enabledCommandsIds']['includes'](_0x555775['id']);}}),_0x38108f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3e2d0b=>{const _0x59b0c1=new _0x4507e7(_0x3e2d0b);_0x59b0c1['buttonView']['set']({'label':i(_0x3e2d0b,'AI\x20Commands'),'icon':T}),_0x59b0c1['bind']('isEnabled')['to'](_0x1b1adc,'enabledCommandsIds',_0x46df04=>_0x46df04['length']>0x0);const _0x148a95=o(_0x38108f['config']['get']('ai.aiAssistant.commands'),_0x3e2d0b);return this['_populateMenuBarMenu'](_0x1b1adc,_0x59b0c1,_0x148a95,_0x241e8d=>this['_onExecute'](_0x241e8d)),_0x59b0c1;}),_0x38108f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2d7e18=this['_createAIAssistantUIButton'](_0x2b981b);return _0x2d7e18['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2d7e18;}),_0x38108f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1caca9=this['_createAIAssistantUIButton'](_0x467b5c);return _0x1caca9['set']({'role':'menuitemcheckbox'}),_0x1caca9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x119911=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x47e627;for(const _0x22fb42 in _0x119911){const _0x270c51=_0x22fb42,_0x4e5a5b=_0x119911[_0x270c51];if('aiLicenseKeyValid'==_0x4e5a5b||'aiLicenseKeyInvalid'==_0x4e5a5b||'aiLicenseKeyExpired'==_0x4e5a5b||'aiLicenseKeyDomainLimit'==_0x4e5a5b||'aiLicenseKeyNotAllowed'==_0x4e5a5b||'aiLicenseKeyEvaluationLimit'==_0x4e5a5b||'aiLicenseKeyTrialLimit'==_0x4e5a5b||'aiLicenseKeyUsageLimit'==_0x4e5a5b){delete _0x119911[_0x270c51],_0x47e627=_0x4e5a5b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x47e627&&_0x119911['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x47e627&&_0x119911['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x47e627&&_0x119911['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x47e627&&_0x119911['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x47e627&&_0x119911['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x47e627&&_0x119911['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x47e627&&_0x119911['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x222a68='',_0x474b77='',_0x245f14='custom'){const _0x25b0bc=this['editor'],_0x443ed5=_0x25b0bc['editing']['view'],_0x4a7246=_0x25b0bc['plugins']['get'](a),_0x4c6809=_0x25b0bc['plugins']['get'](_0x2a385d);_0x4a7246['showFakeVisualSelection']();const _0x279897=new w(),_0x1fa33c=new ClipboardEvent('copy',{'clipboardData':_0x279897}),_0x1cb2e8=new _0x525304(_0x279897),_0x51810b=new _0x2aaf62(_0x443ed5,_0x1fa33c,{'dataTransfer':_0x1cb2e8});_0x4c6809['_forceMarkersCopy']('comment',()=>{_0x443ed5['document']['fire']('copy',_0x51810b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x25b0bc,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25ca45=_0x1cb2e8['getData']('text/html');const _0x88a02a=_0x25b0bc['model']['document']['selection'],_0x911428=Array['from'](_0x88a02a['getRanges']());0x1===_0x911428['length']&&_0x911428[0x0]['isFlat']&&!_0x88a02a['getSelectedElement']()&&''!==_0x25ca45['replace'](/&nbsp;/g,'')['trim']()&&(_0x25ca45='<p>'+_0x25ca45+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x245f14,'query':_0x222a68,'htmlContent':_0x25ca45,'label':_0x474b77,'mainActionLabel':M[_0x25b0bc['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2f2b27['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4a7246['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x98e5f2=new Map(),_0x3ac554=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x45461a of _0x3ac554)for(const _0x57fbf4 of _0x45461a['commands'])_0x98e5f2['set'](_0x57fbf4['id'],{..._0x57fbf4,'groupId':_0x45461a['groupId'],'groupLabel':_0x45461a['groupLabel']||_0x45461a['groupId']});return _0x98e5f2;}['_createAIAssistantUIButton'](_0x1a2d92){const _0x5f0235=this['editor'],_0x317791=_0x5f0235['commands']['get']('showAIAssistant'),_0x383e22=new _0x1a2d92(_0x5f0235['locale']);return _0x383e22['set']({'label':i(_0x5f0235['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x383e22['bind']('isEnabled')['to'](_0x317791),_0x383e22['bind']('isOn')['to'](this['_dialog'],'id',_0x375469=>'aiAssistant'===_0x375469),this['listenTo'](_0x383e22,'execute',()=>{_0x383e22['isOn']?this['hideUI']():_0x317791['execute']();}),_0x383e22;}['_initView'](){const _0x55119c=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',()=>{_0x55119c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x55119c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5539b0,ui:{ariaLiveAnnouncer:_0x43ee24}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x39e496,_0x106564,_0xc5771c)=>{const _0x24bd18=this['_aiAssistantController']['currentContext'];_0xc5771c?_0x43ee24['announce'](i(_0x5539b0,'AI\x20is\x20writing')):_0x24bd18&&_0x43ee24['announce'](i(_0x5539b0,'Generated\x20content:\x20%0',_0x24bd18),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3dc347,_0x431245,_0x190fc2)=>{if(_0x190fc2){const _0x508177=this['_formView']['errorView']['text'];_0x43ee24['announce'](i(_0x5539b0,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x508177));}});}['_onExecute'](_0x8407f1){const _0x5dcf19=this['_commandDefinitions']['get'](_0x8407f1),_0x19ad4a=this['editor'],_0x239989=_0x19ad4a['model']['document']['selection'],_0x1c8292=_0x19ad4a['commands']['get']('showAIAssistant'),_0x286e08=_0x19ad4a['plugins']['get'](a),_0x5c43d4=''+(_0x5dcf19['groupId']!==x?_0x5dcf19['groupLabel']+':\x20':'')+_0x5dcf19['label'];if(!0x1!==_0x5dcf19['requiresContent']&&_0x239989['isCollapsed']){const _0x4e9cb1=_0x32d55e(_0x239989['getSelectedBlocks']())||_0x19ad4a['model']['schema']['getLimitElement'](_0x239989);_0x19ad4a['model']['change'](_0x32a567=>{_0x32a567['setSelection'](_0x4e9cb1,'in');});}_0x286e08['showFakeVisualSelection'](),_0x1c8292['execute'](_0x5dcf19['prompt'],_0x5c43d4,'command:'+_0x8407f1);}['_populateMenuBarMenu'](_0xf122d5,_0x12bdf7,_0x1b8ba6,_0x3280bf){const _0x1058d1=this['editor'],_0x18fe87=_0x1058d1['locale'],_0x3a683c=new _0x458fdc(_0x18fe87),_0x1b2e7d=U(_0x1058d1,_0x1b8ba6)['filter'](_0x42edc7=>_0x42edc7['commands']['length']);0x1===_0x1b2e7d['length']?this['_getMenuBarGroupButtons']({'command':_0xf122d5,'commands':_0x1b2e7d[0x0]['commands'],'parentMenuView':_0x12bdf7,'onExecute':_0x3280bf})['forEach'](_0x3c4855=>_0x3a683c['items']['add'](_0x3c4855)):_0x1b2e7d['forEach'](({groupId:_0x23b9f2,groupLabel:_0x1ae647,commands:_0x3f6a09})=>{const _0x3f0f02=new _0x563a5a(_0x18fe87,_0x12bdf7),_0x444191=new _0x4507e7(_0x18fe87),_0x453304=new _0x458fdc(_0x18fe87),_0x220dbf=this['_getMenuBarGroupButtons']({'command':_0xf122d5,'commands':_0x3f6a09,'parentMenuView':_0x444191,'onExecute':_0x3280bf});_0x444191['buttonView']['set']({'label':_0x1ae647||_0x23b9f2}),_0x444191['delegate']('execute')['to'](_0x12bdf7),_0x453304['items']['addMany'](_0x220dbf),_0x444191['panelView']['children']['add'](_0x453304),_0x3f0f02['children']['add'](_0x444191),_0x3a683c['items']['add'](_0x3f0f02);}),_0x12bdf7['panelView']['children']['add'](_0x3a683c);}['_getMenuBarGroupButtons']({command:_0x2ded4e,commands:_0x3ccf27,parentMenuView:_0x472e13,onExecute:_0x534cfb}){const _0x257529=this['editor'],_0x328af7=_0x257529['locale'];return U(_0x257529,_0x3ccf27)['map'](_0x9bbdbd=>{const _0x55dbfc=new _0x563a5a(_0x328af7,_0x472e13),_0x4991e0=new _0x467b5c(_0x328af7);return _0x4991e0['set']({'label':_0x9bbdbd['label']}),_0x4991e0['delegate']('execute')['to'](_0x472e13),_0x4991e0['on']('execute',()=>_0x534cfb(_0x9bbdbd['id'])),_0x4991e0['bind']('isEnabled')['to'](_0x2ded4e,'enabledCommandsIds',_0x4755cf=>_0x4755cf['includes'](_0x9bbdbd['id'])),_0x55dbfc['children']['add'](_0x4991e0),_0x55dbfc;});}}function B(_0xd026c3,_0x46f277){return void 0x0!==_0xd026c3['order']&&void 0x0===_0x46f277['order']?0x1:void 0x0===_0xd026c3['order']&&void 0x0!==_0x46f277['order']?-0x1:void 0x0!==_0xd026c3['order']&&void 0x0!==_0x46f277['order']?_0xd026c3['order']-_0x46f277['order']:0x0;}function U(_0x577f11,_0xf78836){_0xf78836['sort'](B);const _0x3ee315={},_0x674185=[];for(const _0x1e33ff of _0xf78836)if(void 0x0!==_0x1e33ff['order']){if(_0x1e33ff['order']in _0x3ee315)throw new _0x567ba8('ai-commands-config-order-collision',_0x577f11,{'conflictingDefinitions':[_0x1e33ff,_0x3ee315[_0x1e33ff['order']]]});_0x3ee315[_0x1e33ff['order']]=_0x1e33ff,_0x674185['splice'](_0x1e33ff['order'],0x0,_0x1e33ff);}else _0x674185['push'](_0x1e33ff);return _0x674185;}class r extends _0xc924d8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cf5d8){super(_0x3cf5d8);const _0x2923b5=_0x3cf5d8['config'],_0x435828=_0x3cf5d8['locale'];_0x2923b5['define']('ai.aiAssistant.preserveComments',!0x0),_0x2923b5['define']('ai.aiAssistant.commands',function(_0xb50aa8){return[{'groupId':'editOrReview','groupLabel':i(_0xb50aa8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xb50aa8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xb50aa8,'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(_0xb50aa8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xb50aa8,'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(_0xb50aa8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xb50aa8,'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(_0xb50aa8,'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(_0xb50aa8,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xb50aa8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xb50aa8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xb50aa8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xb50aa8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xb50aa8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xb50aa8,'Change\x20style'),'commands':[{'id':'business','label':i(_0xb50aa8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xb50aa8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xb50aa8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xb50aa8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xb50aa8,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xb50aa8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xb50aa8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xb50aa8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xb50aa8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xb50aa8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xb50aa8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xb50aa8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xb50aa8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x435828)),_0x2923b5['define']('ai.aiAssistant.extraCommandGroups',[]),_0x2923b5['define']('ai.aiAssistant.removeCommands',[]);let _0x55d13e=o(_0x2923b5['get']('ai.aiAssistant.commands'),_0x435828);const _0x24f21e=_0x2923b5['get']('ai.aiAssistant.extraCommandGroups'),_0x45fca8=_0x2923b5['get']('ai.aiAssistant.removeCommands');_0x24f21e['forEach'](_0x15501f=>{const _0x3f23cd=_0x55d13e['find'](_0x555274=>_0x555274['groupId']===_0x15501f['groupId']);_0x3f23cd?_0x3f23cd['commands']=_0x3f23cd['commands']['concat'](_0x15501f['commands']):_0x55d13e['push'](_0x15501f);}),_0x55d13e=_0x55d13e['filter'](_0x3317c2=>!_0x45fca8['includes'](_0x3317c2['groupId'])),_0x55d13e['forEach'](_0x3666f7=>{_0x3666f7['commands']=_0x3666f7['commands']['filter'](_0x58c809=>!_0x45fca8['includes'](_0x58c809['id']));}),_0x2923b5['set']('ai.aiAssistant.commands',_0x55d13e);}}class P extends _0xc924d8{['abortController'];static get['requires'](){return[K];}constructor(_0x5be120){super(_0x5be120),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x427347){return this['sendRequest'](_0x427347)['catch'](_0x3e0a88=>{if(_0x3e0a88 instanceof R)return Promise['reject'](_0x3e0a88);if('AbortError'==_0x3e0a88['name'])return Promise['resolve']();throw console['error'](_0x3e0a88),new _0x567ba8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5efec6,_0x2cf71a){const _0x27c71b=this['editor']['locale'],_0x5d522f={'Content-Type':'application/json'};if('object'==typeof _0x5efec6)Object['assign'](_0x5d522f,_0x5efec6);else{if(_0x5efec6)try{const _0x4da353=await _0x5efec6(_0x2cf71a);Object['assign'](_0x5d522f,_0x4da353);}catch(_0x276549){return Promise['reject'](new R(i(_0x27c71b,'AI_ERROR_GET_HEADERS')));}}return _0x5d522f;}async['_prepareRequestParameters'](_0x3e302b,_0x1ce485){const _0x11b8b8=this['editor']['locale'];if('object'==typeof _0x3e302b)return _0x3e302b;try{return await _0x3e302b(_0x1ce485);}catch(_0x4d5b2e){return Promise['reject'](new R(i(_0x11b8b8,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x95566e){super(_0x95566e),_0x95566e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x95566e['config']['get']('ai.openAI.requestParameters')||_0x95566e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x95566e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x95566e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x95566e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x27f875,context:_0x3cfd05,onData:_0x59887a,actionId:_0x28f36c}){const _0x28b541=this['editor']['locale'],_0x3135f9=await this['prepareMessages'](_0x27f875,_0x3cfd05,_0x28f36c),_0x179f90=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x28f36c),_0x2e4060=await this['_prepareRequestParameters'](this['_requestParameters'],_0x28f36c),_0x556f8f={'messages':_0x3135f9,..._0x2e4060},_0x480210={'method':'POST','headers':_0x179f90,'body':JSON['stringify'](_0x556f8f),'signal':this['abortController']['signal']},_0x128a81=await fetch(this['_apiUrl'],_0x480210);if(_0x128a81['ok'])return _0x2e4060['stream']?await this['_readStreamableResponse'](_0x128a81,_0x59887a):await this['_readStaticResponse'](_0x128a81,_0x59887a),Promise['resolve']();{const _0x37a7db=await _0x128a81['text']();return _0x37a7db['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x28b541,'AI_ERROR_CONTEXT_LENGTH'))):_0x37a7db['includes']('Moderation')?Promise['reject'](new R(i(_0x28b541,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x37a7db));}}async['prepareMessages'](_0x2aeba4,_0x4cd8e1,_0x1c3e14){let _0x2fe640,_0x33c69f;return _0x4cd8e1?(_0x2fe640='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.',_0x33c69f='Instruction:\x0a'+_0x2aeba4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4cd8e1):(_0x2fe640='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.',_0x33c69f=_0x2aeba4),[{'role':'system','content':_0x2fe640},{'role':'user','content':_0x33c69f}];}async['_readStreamableResponse'](_0x23b83b,_0x1aee3d){const _0x2058f2=_0x23b83b['body']['getReader'](),_0x4bf0e0=new TextDecoder();let _0x4cd281='',_0x1520b2='',_0x43e5e5='',_0x2c7abc=!0x1;for(;!_0x2c7abc;){const {done:_0x18537c,value:_0x50ca0a}=await _0x2058f2['read'](),_0x1d8aa5=_0x4cd281+_0x4bf0e0['decode'](_0x50ca0a);let _0xadd615='';_0x2c7abc=_0x18537c;try{_0xadd615=this['_cleanUpData'](_0x1d8aa5),_0x4cd281='';}catch(_0x2dcd76){_0x4cd281=_0x1d8aa5;continue;}_0x1520b2+=_0xadd615,!_0x2c7abc&&this['_isBufferIncomplete'](_0x1520b2)||_0x1520b2&&(_0x43e5e5+=_0x1520b2,_0x1520b2='',_0x1aee3d(_0x43e5e5));}return Promise['resolve']();}async['_readStaticResponse'](_0x249190,_0x5489d6){return _0x5489d6((await _0x249190['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x366f49){const _0x3b02c7=_0x366f49['split']('<')['length']!==_0x366f49['split']('>')['length'],_0x11562f=_0x366f49['length']<0x1e;return _0x3b02c7&&_0x11562f;}['_cleanUpData'](_0x3bbc33){return _0x3bbc33['split'](/\n(?![^{]*\})/g)['map'](_0xf3f574=>_0xf3f574['replace']('data:\x20',''))['filter'](_0x453cd4=>_0x453cd4&&_0x453cd4['length']>0x0&&'[DONE]'!==_0x453cd4)['map'](_0x140379=>{const {choices:_0x46bd2d}=JSON['parse'](_0x140379);if(_0x46bd2d[0x0]&&_0x46bd2d[0x0]['delta']&&_0x46bd2d[0x0]['delta']['content'])return _0x46bd2d[0x0]['delta']['content'];})['filter'](_0x508caf=>_0x508caf)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x168829){super(_0x168829),_0x168829['config']['get']('ai.aws.requestParameters')||_0x168829['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']=_0x168829['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x168829['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x168829['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x168829['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4f8eb2,context:_0x441ffc,onData:_0x852819,actionId:_0x4b0322}){const {model:_0x392e45,stream:_0x1c9514,..._0x11005a}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4b0322),_0x1b7f1c={'prompt':await this['preparePrompt'](_0x4f8eb2,_0x441ffc,_0x392e45,_0x4b0322),..._0x11005a};this['_apiUrl']?await this['_processProxyRequest'](_0x1b7f1c,_0x392e45,_0x1c9514,_0x852819,_0x4b0322):await this['_processAWSRequest'](_0x1b7f1c,_0x392e45,_0x1c9514,_0x852819);}async['preparePrompt'](_0x4cf0a8,_0x478086,_0x41804e,_0x1003cf){let _0x3792a0,_0x4dc222;return _0x478086?(_0x3792a0='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.',_0x4dc222='Instruction:\x0a'+_0x4cf0a8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x478086):(_0x3792a0='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.',_0x4dc222=_0x4cf0a8),'meta.llama'==this['getModelFamily'](_0x41804e)?'<<SYS>>\x0a'+_0x3792a0+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4dc222+'\x0a[/INST]':'Human:\x0a'+_0x3792a0+'\x0a'+_0x4dc222+'\x0a\x0aAssistant:';}['getModelFamily'](_0x22ff9d){if(/^anthropic\.claude/['test'](_0x22ff9d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x22ff9d))return'ai21.j2';if(/^cohere\.command/['test'](_0x22ff9d))return'cohere.command';if(/^meta\.llama/['test'](_0x22ff9d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x22ff9d));}async['_processProxyRequest'](_0x27d60b,_0x485208,_0x1cff27,_0x4ad5bc,_0x3d3ab2){const _0x2e1635={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3d3ab2),'body':JSON['stringify']({..._0x27d60b,'model':_0x485208,'stream':_0x1cff27}),'signal':this['abortController']['signal']},_0x3660f5=await fetch(this['_apiUrl'],_0x2e1635);_0x1cff27?await this['_readStreamableResponse'](_0x3660f5,_0x485208,_0x4ad5bc):await this['_readStaticResponse'](_0x3660f5,_0x485208,_0x4ad5bc);}async['_processAWSRequest'](_0x508b28,_0x357b81,_0x18540e,_0x3f5c52){const _0x46e4f2=new _0x14af6e(this['_bedrockClientConfig']),_0x3fc1c8={'body':JSON['stringify'](_0x508b28),'contentType':'application/json','accept':'application/json','modelId':_0x357b81};let _0xfbf721;if(_0x18540e){const _0x434992=new _0x5b5899(_0x3fc1c8);_0xfbf721=await _0x46e4f2['send'](_0x434992,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xfbf721,_0x357b81,_0x3f5c52);}else{const _0xdffc2b=new _0x463689(_0x3fc1c8);_0xfbf721=await _0x46e4f2['send'](_0xdffc2b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xfbf721,_0x357b81,_0x3f5c52);}}async['_readAsyncIterableResponse'](_0x4d7b57,_0x5e08bd,_0x1c1a39){const _0x7fbf8e=_0x4d7b57['body'],_0x42264a=new TextDecoder('utf-8');let _0x3220ab='';for await(const _0x542e94 of _0x7fbf8e)if(_0x542e94['chunk']){const _0x2da327=_0x42264a['decode'](_0x542e94['chunk']['bytes']),_0x1f85ce=JSON['parse'](_0x2da327);_0x3220ab+=this['_getGeneratedText'](_0x1f85ce,_0x5e08bd),_0x1c1a39(_0x3220ab);}return Promise['resolve']();}async['_readStreamableResponse'](_0x48e00e,_0x255f65,_0xaa746){const _0xcdf618=_0x48e00e['body'],_0x683582=new TextDecoder('utf-8'),_0x296b04=_0xcdf618['getReader']();let _0x574509='',_0x1046a5='',_0x1ff245=!0x1;for(;!_0x1ff245;){const {done:_0x1956eb,value:_0x190b5f}=await _0x296b04['read']();if(_0x1ff245=_0x1956eb,_0x1ff245)break;const _0x1cf56c=(_0x574509+_0x683582['decode'](_0x190b5f))['split']('\x0a')['map'](_0x42cd5b=>{try{return _0x574509='',JSON['parse'](_0x42cd5b);}catch(_0x2d1c10){return _0x574509=_0x42cd5b,null;}})['filter'](_0x240bc1=>null!==_0x240bc1);_0x1cf56c['length']&&(_0x1046a5+=_0x1cf56c['map'](_0x2c78e8=>this['_getGeneratedText'](_0x2c78e8,_0x255f65))['join'](''),_0xaa746(_0x1046a5));}return Promise['resolve']();}async['_readStaticResponse'](_0x2db993,_0x2dfce1,_0x560c4a){let _0x13bbcd;return _0x13bbcd=_0x2db993 instanceof Response?await _0x2db993['json']():JSON['parse'](Buffer['from'](_0x2db993['body'])['toString']('utf8')),(_0x560c4a(this['_getGeneratedText'](_0x13bbcd,_0x2dfce1)),Promise['resolve']());}['_getGeneratedText'](_0x85e1b9,_0x267a86){switch(this['getModelFamily'](_0x267a86)){case'anthropic.claude':return _0x85e1b9['completion'];case'ai21.j2':return _0x85e1b9['completions'][0x0]['data']['text'];case'cohere.command':return _0x85e1b9['generations'][0x0]['text'];case'meta.llama':return _0x85e1b9['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x4a0f9d=>0x1!=_0x4a0f9d}};
23
+ export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x51a70f=>0x1!=_0x51a70f}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x32d478=>{const {af:{dictionary:_0x2f2d64,getPluralForm:_0x413e0c}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x108f95=>0x1!=_0x108f95}};_0x32d478['af']||={'dictionary':{},'getPluralForm':null},_0x32d478['af']['dictionary']=Object['assign'](_0x32d478['af']['dictionary'],_0x2f2d64),_0x32d478['af']['getPluralForm']=_0x413e0c;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x186256=>{const {af:{dictionary:_0x7e3176,getPluralForm:_0x26e46e}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0xdf87a9=>0x1!=_0xdf87a9}};_0x186256['af']||={'dictionary':{},'getPluralForm':null},_0x186256['af']['dictionary']=Object['assign'](_0x186256['af']['dictionary'],_0x7e3176),_0x186256['af']['getPluralForm']=_0x26e46e;})(window['CKEDITOR_TRANSLATIONS']||={});
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x292a56=>0x0==_0x292a56?0x0:0x1==_0x292a56?0x1:0x2==_0x292a56?0x2:_0x292a56%0x64>=0x3&&_0x292a56%0x64<=0xa?0x3:_0x292a56%0x64>=0xb?0x4:0x5}};
23
+ export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x310012=>0x0==_0x310012?0x0:0x1==_0x310012?0x1:0x2==_0x310012?0x2:_0x310012%0x64>=0x3&&_0x310012%0x64<=0xa?0x3:_0x310012%0x64>=0xb?0x4:0x5}};