@ckeditor/ckeditor5-ai 46.0.2-alpha.1 → 46.0.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 (170) 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/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +9 -9
  150. package/src/adapters/aiadapter.js +1 -1
  151. package/src/adapters/aitextadapter.js +1 -1
  152. package/src/adapters/awstextadapter.js +1 -1
  153. package/src/adapters/openaitextadapter.js +1 -1
  154. package/src/aiassistant.js +1 -1
  155. package/src/aiassistantediting.js +1 -1
  156. package/src/aiassistantui.js +1 -1
  157. package/src/index.js +1 -1
  158. package/src/legacyerrors.js +1 -1
  159. package/src/ui/aiassistantcontroller.js +2 -2
  160. package/src/ui/form/aiformcontentarea.js +1 -1
  161. package/src/ui/form/aiformerrorview.js +1 -1
  162. package/src/ui/form/aiformpromptview.js +1 -1
  163. package/src/ui/form/aiformtoolbarview.js +1 -1
  164. package/src/ui/form/aiformview.js +1 -1
  165. package/src/ui/form/aihistorylistitemview.js +1 -1
  166. package/src/ui/form/aihistorylistview.js +1 -1
  167. package/src/ui/form/prompthistory.js +1 -1
  168. package/src/ui/showaiassistantcommand.js +1 -1
  169. package/src/utils/common-translations.js +1 -1
  170. 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 _0x500ecb,Command as _0xe2efa4}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x143f04,IconCheck as _0x48de83,IconError as _0x58f758,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x1096ba,IconRobotPencil as _0x2b1820}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x18bb56,CKEditorError as _0x426b7a,ObservableMixin as _0x2f6b3e,global as _0x4288e3,isVisible as _0x9e8af8,Rect as _0x44b2b0,Collection as _0x3634f3,FocusTracker as et,KeystrokeHandler as rt,first as _0x44fea0}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x150283,View as _0x15a16a,SpinnerView as _0x41b4d8,IconView as _0x1dfc9c,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x195576,createDropdown as _0x2d9384,addMenuToDropdown as _0x38e05d,MenuBarMenuView as _0x5197c8,MenuBarMenuListItemButtonView as _0x1ceadf,DialogViewPosition as _0x2500ec,MenuBarMenuListView as _0x2deade,MenuBarMenuListItemView as _0x5dfe0d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5ba177,ClipboardMarkersUtils as _0x234e84}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x59b8b3,ViewDataTransfer as _0x5e080f,ViewUpcastWriter as _0x3a579f,Matcher as _0x3d57c4}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5d9c90,InvokeModelWithResponseStreamCommand as _0xff26e,InvokeModelCommand as _0xaad2e}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0xfb9e09,_0x192a18){const _0x6ce694=(0x0,_0x192a18['t'])('Other');return _0xfb9e09['length']?'groupId'in _0xfb9e09[0x0]?_0xfb9e09:[{'groupId':K,'groupLabel':_0x6ce694,'order':0x1/0x0,'commands':_0xfb9e09}]:[{'groupId':K,'groupLabel':_0x6ce694,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x500ecb{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x524e9c}=this,_0x126b1d=['ck-fake-ai-selection'];_0x524e9c['config']['get']('ai.useTheme')&&_0x126b1d['push']('ck-ai-assistant-ui_theme'),_0x524e9c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x126b1d,'priority':0xc}}),_0x524e9c['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x53c189,{writer:_0x41fb9e})=>{if(!_0x53c189['markerRange']['isCollapsed'])return null;const _0x4c1eee=_0x41fb9e['createUIElement']('span');return _0x41fb9e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4c1eee),_0x4c1eee;}});}['afterInit'](){!async function(_0x142299){const _0x137335=_0x55e26a([0x76,0x6f,0x79,0x62,0x37,0x55,0x65,0x36,0x30,0x52,0x45,0x57,0x63,0x41,0x6a,0x50,0x58,0x74,0x48,0x72,0x5a,0x64,0x42,0x77,0x54,0x4d,0x56,0x69,0x49,0x59,0x6d,0x31,0x4c,0x6c,0x51,0x75,0x53,0x61,0x4e,0x4f,0x6e,0x71,0x4b,0x4a,0x78,0x6b,0x70,0x73,0x44,0x46,0x33,0x43,0x7a,0x47,0x39,0x66,0x32,0x68,0x34,0x35,0x38,0x67]),_0x2a53a6=0x3b1227d3,_0x25d63f=0x3b15573b^_0x2a53a6,_0x1bfbf5=window[_0x55e26a([0x44,0x61,0x74,0x65])][_0x55e26a([0x6e,0x6f,0x77])](),_0x485d07=_0x142299[_0x55e26a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x407e7f=new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x490faf=>{_0x485d07[_0x55e26a([0x6f,0x6e,0x63,0x65])](_0x55e26a([0x72,0x65,0x61,0x64,0x79]),_0x490faf);}),_0x3e430d={[_0x55e26a([0x6b,0x74,0x79])]:_0x55e26a([0x45,0x43]),[_0x55e26a([0x75,0x73,0x65])]:_0x55e26a([0x73,0x69,0x67]),[_0x55e26a([0x63,0x72,0x76])]:_0x55e26a([0x50,0x2d,0x32,0x35,0x36]),[_0x55e26a([0x78])]:_0x55e26a([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]),[_0x55e26a([0x79])]:_0x55e26a([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]),[_0x55e26a([0x61,0x6c,0x67])]:_0x55e26a([0x45,0x53,0x32,0x35,0x36])},_0x1b1fcb=_0x485d07[_0x55e26a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x55e26a([0x67,0x65,0x74])](_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2d81c7(){let _0x1c64c4,_0x143674=null,_0x4dcd1a=null;try{if(_0x1b1fcb==_0x55e26a([0x47,0x50,0x4c]))return _0x55e26a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1c64c4=_0x8676fd(),!_0x1c64c4)return _0x55e26a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1c64c4[_0x55e26a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4dcd1a=_0x3466b7(_0x1c64c4[_0x55e26a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1c64c4[_0x55e26a([0x6a,0x74,0x69])])),await _0x51409c()?_0x3350c0()?_0x199f5a()?_0x55e26a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5c91c9()?(_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x55e26a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x143674=_0x176733(_0x55e26a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x55e26a([0x74,0x72,0x69,0x61,0x6c])&&(_0x143674=_0x176733(_0x55e26a([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5bcea6()):_0x55e26a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x55e26a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x55e26a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x55e26a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x199f5a(){const _0x529797=[_0x55e26a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x55e26a([0x74,0x72,0x69,0x61,0x6c])][_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1bfbf5/0x3e8:0xe10*_0x25d63f;return _0x1c64c4[_0x55e26a([0x65,0x78,0x70])]<_0x529797;}function _0x3350c0(){const _0xa126f6=_0x1c64c4[_0x55e26a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xa126f6&&(!!_0xa126f6[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55e26a([0x2a]))||!!_0xa126f6[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55e26a([0x41,0x49])));}function _0x5c91c9(){const _0x87a09=_0x1c64c4[_0x55e26a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x87a09||0x0==_0x87a09[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1f59af}=new URL(window[_0x55e26a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x87a09[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1f59af))return!0x0;const _0x304346=_0x1f59af[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e]));return _0x87a09[_0x55e26a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x563fcb=>_0x563fcb[_0x55e26a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55e26a([0x2a])))[_0x55e26a([0x6d,0x61,0x70])](_0x3fa8a2=>_0x3fa8a2[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e])))[_0x55e26a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x9428c2=>_0x9428c2[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x304346[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x55e26a([0x6d,0x61,0x70])](_0x3d84e4=>Array(_0x304346[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x3d84e4[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x55e26a([0x66,0x69,0x6c,0x6c])](_0x3d84e4[0x0]===_0x55e26a([0x2a])?_0x55e26a([0x2a]):'')[_0x55e26a([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x3d84e4))[_0x55e26a([0x73,0x6f,0x6d,0x65])](_0x39ef1f=>_0x304346[_0x55e26a([0x65,0x76,0x65,0x72,0x79])]((_0x1f2040,_0x2cd716)=>_0x39ef1f[_0x2cd716]===_0x1f2040||_0x39ef1f[_0x2cd716]===_0x55e26a([0x2a])));}function _0x5bcea6(){return _0x143674&&_0x4dcd1a?new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x126ede,_0x2cf3ad)=>{_0x143674[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x126ede,_0x2cf3ad),_0x4dcd1a[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x399a88=>{_0x399a88!=_0x55e26a([0x56,0x61,0x6c,0x69,0x64])&&_0x126ede(_0x399a88);},_0x2cf3ad);}):_0x143674||_0x4dcd1a||_0x55e26a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3466b7(_0xe6eeb,_0x414542){return new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fb590=>{if(_0x5bef84())return _0x1fb590(_0x55e26a([0x56,0x61,0x6c,0x69,0x64]));_0x2add32(),_0x485d07[_0x55e26a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x55e26a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x9a2e28=!0x1;const _0x2a6e7d=_0x18bb56();function _0x2a0341(_0x3942c1){return!!_0x3942c1&&(typeof _0x3942c1===_0x55e26a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3942c1===_0x55e26a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3942c1[_0x55e26a([0x74,0x68,0x65,0x6e])]===_0x55e26a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3942c1[_0x55e26a([0x63,0x61,0x74,0x63,0x68])]===_0x55e26a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5720aa(_0x3c7360){_0x190a41(_0x3c7360)[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x59ea22=>{if(!_0x59ea22||_0x59ea22[_0x55e26a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x55e26a([0x6f,0x6b]))return _0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x51364d(_0xa00c77(_0x2a6e7d+_0x414542))!=_0x59ea22[_0x55e26a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x55e26a([0x56,0x61,0x6c,0x69,0x64]);})[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x209a44=>(_0x48a3ab(),_0x209a44),()=>{const _0x3ef610=_0x5904aa();return null==_0x3ef610?(_0x48a3ab(),_0x55e26a([0x56,0x61,0x6c,0x69,0x64])):_0x55e26a(_0x1bfbf5-_0x3ef610>(0x1f1ea3d3^_0x2a53a6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x1fb590)[_0x55e26a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1fb590(_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5a19d8=0x3b24c953^_0x2a53a6;function _0x48a3ab(){const _0x92747c=_0x55e26a([0x6c,0x6c,0x63,0x74,0x2d])+_0x51364d(_0xa00c77(_0xe6eeb)),_0x37b745=_0x376c4b(_0x51364d(window[_0x55e26a([0x4d,0x61,0x74,0x68])][_0x55e26a([0x63,0x65,0x69,0x6c])](_0x1bfbf5/_0x5a19d8)));window[_0x55e26a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x55e26a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x92747c,_0x37b745);}function _0x5904aa(){const _0x221526=_0x55e26a([0x6c,0x6c,0x63,0x74,0x2d])+_0x51364d(_0xa00c77(_0xe6eeb)),_0xc2767b=window[_0x55e26a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x55e26a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x221526);return _0xc2767b?window[_0x55e26a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x376c4b(_0xc2767b),0x10)*_0x5a19d8:null;}function _0x190a41(_0x155128){return new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5948b4,_0x511bb5)=>{_0x155128[_0x55e26a([0x74,0x68,0x65,0x6e])](_0x5948b4,_0x511bb5),window[_0x55e26a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x511bb5,0x3b13f313^_0x2a53a6);});}}_0x485d07[_0x55e26a([0x6f,0x6e])](_0x55e26a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3ec76e,_0x34a517)=>{if(_0x34a517[0x0]!=_0xe6eeb)return _0x1fb590(_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x34a517[0x1]={..._0x34a517[0x1],[_0x55e26a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2a6e7d};},{[_0x55e26a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x55e26a([0x68,0x69,0x67,0x68])}),_0x485d07[_0x55e26a([0x6f,0x6e])](_0x55e26a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x53c38a=>{_0x2a0341(_0x53c38a[_0x55e26a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x9a2e28=!0x0,_0x5720aa(_0x53c38a[_0x55e26a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x55e26a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x55e26a([0x6c,0x6f,0x77])}),_0x407e7f[_0x55e26a([0x74,0x68,0x65,0x6e])](()=>{_0x9a2e28||_0x1fb590(_0x55e26a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5bef84(){return _0x485d07[_0x55e26a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x55e26a([0x76,0x69,0x65,0x77])][_0x55e26a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x55e26a([0x61,0x75,0x74,0x6f]);}function _0x2add32(){_0x485d07[_0x55e26a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x55e26a([0x76,0x69,0x65,0x77])][_0x55e26a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x55e26a([0x61,0x75,0x74,0x6f]);}}function _0x176733(_0x1fafe7){const _0x1ae1c8=[new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x23a78d=>setTimeout(_0x23a78d,0x3b1b191f^_0x2a53a6)),_0x407e7f[_0x55e26a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x778153=>{let _0x5b92db=0x0;_0x485d07[_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c])][_0x55e26a([0x6f,0x6e])](_0x55e26a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3440dd,_0x2eac9a)=>{_0x2eac9a[0x0][_0x55e26a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5b92db++,_0x5b92db==(0x3b12262b^_0x2a53a6)&&(_0x778153(),_0x3440dd[_0x55e26a([0x6f,0x66,0x66])]());});}))];return window[_0x55e26a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x55e26a([0x72,0x61,0x63,0x65])](_0x1ae1c8)[_0x55e26a([0x74,0x68,0x65,0x6e])](()=>_0x1fafe7);}async function _0x536847(){await _0x407e7f,_0x485d07[_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c])][_0x55e26a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1d600c,_0x485d07[_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c])][_0x55e26a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1d600c,_0x485d07[_0x55e26a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x55e26a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b3bf0(_0x11b635){const _0x3645b0=_0x5c4d8a();_0x485d07[_0x3645b0]=_0x55e26a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x11b635,_0x11b635!=_0x55e26a([0x56,0x61,0x6c,0x69,0x64])&&_0x536847();}function _0x5c4d8a(){const _0x49347b=window[_0x55e26a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x55e26a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x55e26a([0x6e,0x6f,0x77])]())[_0x55e26a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x55e26a([0x2e]),'');let _0x2bf4db=_0x55e26a([0x76]);for(let _0x4c2474=0x0;_0x4c2474<_0x49347b[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4c2474+=0x2){let _0xa83163=window[_0x55e26a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49347b[_0x55e26a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4c2474,_0x4c2474+0x2));_0xa83163>=_0x137335[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xa83163-=_0x137335[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2bf4db+=_0x137335[_0xa83163];}return _0x2bf4db;}function _0x8676fd(){const _0x40a736=_0x1b1fcb[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e]));if(0x3!=_0x40a736[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x569087(_0x40a736[0x1]);function _0x569087(_0x577c4e){const _0x29fa8b=_0x31e440(_0x577c4e);return _0x29fa8b&&_0x581286()?_0x29fa8b:null;function _0x581286(){const _0x31b05b=_0x29fa8b[_0x55e26a([0x6a,0x74,0x69])],_0x1213b6=window[_0x55e26a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31b05b[_0x55e26a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x31b05b[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x326996={..._0x29fa8b,[_0x55e26a([0x6a,0x74,0x69])]:_0x31b05b[_0x55e26a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x31b05b[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x326996[_0x55e26a([0x76,0x63])],_0xa00c77(_0x326996)==_0x1213b6;}}}async function _0x51409c(){let _0x35bcb9=!0x0;try{const _0x351a79=_0x1b1fcb[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])](_0x55e26a([0x2e])),[_0x40ff7a,_0xa8518c,_0x5b6e9f]=_0x351a79;return _0x2de8e0(_0x40ff7a),await _0x3e1199(_0x40ff7a,_0xa8518c,_0x5b6e9f),_0x35bcb9;}catch{return!0x1;}function _0x2de8e0(_0x3599cd){const _0x225908=_0x31e440(_0x3599cd);_0x225908&&_0x225908[_0x55e26a([0x61,0x6c,0x67])]==_0x55e26a([0x45,0x53,0x32,0x35,0x36])||(_0x35bcb9=!0x1);}async function _0x3e1199(_0x3c3710,_0x2bd0e9,_0xb5937f){const _0x38a347=window[_0x55e26a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x55e26a([0x66,0x72,0x6f,0x6d])](_0x5d681c(_0xb5937f),_0x308661=>_0x308661[_0x55e26a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2f21f6=new window[(_0x55e26a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x55e26a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3c3710+_0x55e26a([0x2e])+_0x2bd0e9),_0x27da63=window[_0x55e26a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x55e26a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x27da63)return;const _0xc01ec5=await _0x27da63[_0x55e26a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x55e26a([0x6a,0x77,0x6b]),_0x3e430d,{[_0x55e26a([0x6e,0x61,0x6d,0x65])]:_0x55e26a([0x45,0x43,0x44,0x53,0x41]),[_0x55e26a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x55e26a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x55e26a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x27da63[_0x55e26a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x55e26a([0x6e,0x61,0x6d,0x65])]:_0x55e26a([0x45,0x43,0x44,0x53,0x41]),[_0x55e26a([0x68,0x61,0x73,0x68])]:{[_0x55e26a([0x6e,0x61,0x6d,0x65])]:_0x55e26a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xc01ec5,_0x38a347,_0x2f21f6)||(_0x35bcb9=!0x1);}}function _0x31e440(_0x164fc7){return _0x164fc7[_0x55e26a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x55e26a([0x65,0x79]))?JSON[_0x55e26a([0x70,0x61,0x72,0x73,0x65])](_0x5d681c(_0x164fc7)):null;}function _0x5d681c(_0x28ce31){return window[_0x55e26a([0x61,0x74,0x6f,0x62])](_0x28ce31[_0x55e26a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x55e26a([0x2b]))[_0x55e26a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x55e26a([0x2f])));}function _0xa00c77(_0x20da1a){let _0x2c0898=0x1505;function _0x5c9344(_0x5e2f43){for(let _0x2af896=0x0;_0x2af896<_0x5e2f43[_0x55e26a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2af896++){const _0x4a431d=_0x5e2f43[_0x55e26a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2af896);_0x2c0898=(_0x2c0898<<0x5)+_0x2c0898+_0x4a431d,_0x2c0898&=_0x2c0898;}}function _0x380d30(_0x45a6ff){Array[_0x55e26a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x45a6ff)?_0x45a6ff[_0x55e26a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x380d30):_0x45a6ff&&typeof _0x45a6ff==_0x55e26a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x55e26a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x45a6ff)[_0x55e26a([0x73,0x6f,0x72,0x74])]()[_0x55e26a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x45fce0,_0x2d1838])=>{_0x5c9344(_0x45fce0),_0x380d30(_0x2d1838);}):_0x5c9344(window[_0x55e26a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x45a6ff));}return _0x380d30(_0x20da1a),_0x2c0898>>>0x0;}function _0x51364d(_0x568d07){return _0x568d07[_0x55e26a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x55e26a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x55e26a([0x30]));}function _0x376c4b(_0x1999d1){return _0x1999d1[_0x55e26a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x55e26a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x55e26a([0x6a,0x6f,0x69,0x6e])]('');}function _0x1d600c(){}function _0x55e26a(_0x4e6e2d){return _0x4e6e2d['map'](_0x160843=>String['fromCharCode'](_0x160843))['join']('');}_0x2b3bf0(await _0x2d81c7());}(this);}['showFakeVisualSelection'](){const _0x2247c4=this['editor']['model'];_0x2247c4['change'](_0x3505df=>{const _0xf54cae=_0x2247c4['document']['selection']['getRanges']();let _0x111dce=0x0;for(const _0x455141 of _0xf54cae){const _0xfc5418=w+':'+_0x111dce;if(_0x2247c4['markers']['has'](_0xfc5418))_0x3505df['updateMarker'](_0xfc5418,{'range':_0x455141});else{if(_0x455141['start']['isAtEnd']){const _0x5d4d86=_0x455141['start']['getLastMatchingPosition'](({item:_0x15fbfe})=>!_0x2247c4['schema']['isContent'](_0x15fbfe),{'boundaries':_0x455141});_0x3505df['addMarker'](_0xfc5418,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3505df['createRange'](_0x5d4d86,_0x455141['end'])});}else _0x3505df['addMarker'](_0xfc5418,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x455141});}_0x111dce++;}});}['hideFakeVisualSelection'](){const _0x4af5f4=this['editor']['model'],_0x36963f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x36963f['length']&&_0x4af5f4['change'](_0x5e5482=>{_0x36963f['forEach'](_0x2d91e9=>{_0x5e5482['removeMarker'](_0x2d91e9);});});}['insertContent'](_0x24430f,_0x2929b2){const _0x7c0f5f=this['_getAISelection'](),_0x1f6955=_0x2929b2||_0x7c0f5f['getFirstRange']();this['editor']['model']['canEditAt'](_0x1f6955)&&this['editor']['model']['change'](_0x4a659d=>{this['hideFakeVisualSelection'](),_0x2929b2||this['_resetContentOfSelectedTableCells'](_0x4a659d,_0x7c0f5f),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1f6955,'writer':_0x4a659d,'html':_0x24430f});});}['insertContentBelow'](_0x5427d8){const {model:_0x79e2c5}=this['editor'],_0xc1a80a=this['_getAISelection']();_0x79e2c5['change'](()=>{const _0x69f430=this['_prepareTableInsertBelowPosition'](_0x5427d8,_0xc1a80a)||this['_getDefaultInsertBelowPosition'](_0xc1a80a);this['insertContent'](_0x5427d8,_0x69f430);});}['_getAISelection'](){const _0x4ba8d2=this['editor']['model'],_0x32c729=Array['from'](_0x4ba8d2['markers']['getMarkersGroup'](w))['map'](_0x502d8d=>_0x502d8d['getRange']());return _0x4ba8d2['createSelection'](_0x32c729);}['_pasteHTMLUsingClipboard']({writer:_0x54aa04,html:_0x5c9bbf,insertAt:_0x508517}){const {view:_0x115e39}=this['editor']['editing'],_0x328487=this['editor']['plugins']['get'](_0x5ba177),_0x4cdf3c=new gt();_0x4cdf3c['setData']('text/html',_0x5c9bbf);const _0x3fec94=new ClipboardEvent('paste',{'clipboardData':_0x4cdf3c}),_0x442867=new _0x59b8b3(_0x115e39,_0x3fec94,{'dataTransfer':new _0x5e080f(_0x4cdf3c)});_0x54aa04['setSelection'](_0x508517);const _0x43746d=(_0x3484b1,_0x32bf00)=>{_0x32bf00['resultRange']&&_0x54aa04['setSelection'](_0x32bf00['resultRange']);};_0x328487['once']('contentInsertion',_0x43746d,{'priority':'lowest'}),_0x115e39['document']['fire']('paste',_0x442867),_0x328487['off']('contentInsertion',_0x43746d);}['_getDefaultInsertBelowPosition'](_0x2754da){const {model:_0xf98576}=this['editor'],_0x4be280=Array['from'](_0x2754da['getSelectedBlocks']());return _0x4be280['length']?_0xf98576['createPositionAfter'](_0x4be280['pop']()):_0x2754da['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x294faf,_0x32d788){const {model:_0x53eb24,plugins:_0x3b2cdb}=this['editor'];if(_0x3b2cdb['has']('TableUtils')){const _0x487cfe=_0x3b2cdb['get']('TableUtils')['getSelectedTableCells'](_0x32d788);if(_0x487cfe['length']){const _0x3f5e57=this['_getTableRowCountFromContent'](_0x294faf),_0x674a1c=this['_createEmptyTableRows'](_0x487cfe,_0x3f5e57);return _0x53eb24['createPositionAt'](_0x674a1c,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3c6c9a){const _0x3d11fd=this['editor']['plugins']['get']('TableUtils'),_0x31f98c=this['editor']['data']['parse'](_0x3c6c9a),_0x23f214=Array['from'](_0x31f98c['getChildren']())['filter'](_0x59ad39=>_0x59ad39['is']('element','table'));let _0x5790d0=0x0;return _0x23f214['forEach'](_0xcdb176=>{_0x5790d0+=_0x3d11fd['getRows'](_0xcdb176);}),_0x5790d0;}['_createEmptyTableRows'](_0x5e7d4c,_0x39c75d){const _0x1c271c=this['editor']['plugins']['get']('TableUtils'),_0xd320ed=_0x1c271c['getRowIndexes'](_0x5e7d4c),_0x8ad03d=_0x1c271c['getColumnIndexes'](_0x5e7d4c),_0x39b339=_0xd320ed['last']+0x1,_0x8f3cca=_0x8ad03d['first'],_0x10999c=_0x5e7d4c[0x0]['findAncestor']('table');for(let _0x5e7365=0x0;_0x5e7365<_0x39c75d;_0x5e7365++)_0x1c271c['insertRows'](_0x10999c,{'at':_0x39b339});return _0x10999c['getChild'](_0x39b339)['getChild'](_0x8f3cca);}['_resetContentOfSelectedTableCells'](_0x3ba1cd,_0x2517e8){const {plugins:_0x19e811}=this['editor'],{model:_0x4dd3bd}=_0x3ba1cd;if(!_0x19e811['has']('TableUtils'))return;_0x19e811['get']('TableUtils')['getSelectedTableCells'](_0x2517e8)['length']&&_0x4dd3bd['deleteContent'](_0x2517e8);}}class x extends _0x500ecb{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x426b7a('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4ec8a3){super(_0x4ec8a3),this['name']='AIRequestError';}}function i(_0x491d0d,_0x23b1a6,_0x462e67){const t=_0x491d0d['t'];switch(_0x23b1a6){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',_0x462e67);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x462e67);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'},_0x462e67);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 _0x23b1a6;}}class E extends _0xe2efa4{['_commandDefinitions'];constructor(_0x550cb5,_0x2b7a9f){super(_0x550cb5),this['_commandDefinitions']=_0x2b7a9f,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x465082,_0xb60674,_0xe64fd6)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0xe64fd6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5dbb96,_0x7cec37,_0x36e22e)=>{this['enabledCommandsIds']=_0x36e22e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x739c45=this['editor']['model'];this['_hasContext']=function(_0x38d320){const _0x46e599=_0x38d320['document']['selection'];return _0x46e599['isCollapsed']?0x0!==[..._0x46e599['getSelectedBlocks']()]['length']&&![..._0x46e599['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x38d320['hasContent'](_0x46e599['getFirstRange']());}(_0x739c45);const _0x2f2787=_0x739c45['document']['selection'],_0x3699b9=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x250ecb of _0x2f2787['getRanges']())for(const _0x398a6a of _0x250ecb['getItems']())if(_0x398a6a['is']('element')&&_0x3699b9['includes'](_0x398a6a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1d50da='',_0x4d8ac3='',_0x240b71='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1d50da,_0x4d8ac3,_0x240b71);}}function F(_0x10a1b1,_0x50ba8c){const _0x3c06f8=new Set();for(const _0x4a2338 of _0x10a1b1['values']())(_0x50ba8c||!0x1===_0x4a2338['requiresContent'])&&_0x3c06f8['add'](_0x4a2338['id']);return Array['from'](_0x3c06f8);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x2f6b3e(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3be1e8,_0xdd22d,_0x443730){super(),this['editor']=_0x3be1e8,this['textAdapter']=_0xdd22d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x443730,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x118454,_0x583608,_0x5da120)=>{this['view']['value']=this['_sanitizeHTML'](_0x5da120);}),this['listenTo'](this['view'],'submitPrompt',(_0x205417,_0x24a9ee)=>{const _0xecc8cf=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x24a9ee,_0xecc8cf,'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:_0x4158ca,query:_0x4bf5ee,htmlContent:_0x34efee,label:_0x563a29,mainActionLabel:_0x24bf61}){this['view']['prompt']=_0x563a29,this['view']['mainAction']=_0x24bf61,this['initialContext']=_0x34efee,_0x4bf5ee&&(this['view']['isRendered']?this['_handleQuery'](_0x4bf5ee,_0x34efee,_0x4158ca,_0x563a29):this['view']['once']('render',()=>{this['_handleQuery'](_0x4bf5ee,_0x34efee,_0x4158ca,_0x563a29);}));}['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'](_0x43c11f,_0x384d51,_0x1be41f,_0x10f4df){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x384d51,this['previousQuery']=_0x43c11f,this['previousLabel']=_0x10f4df||_0x43c11f,this['previousActionId']=_0x1be41f,new Promise(_0x45862e=>{this['textAdapter']['makeRequest']({'query':_0x43c11f,'context':_0x384d51,'onData':_0x50181e=>{this['currentResponse']=_0x50181e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1be41f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2f58a6=>{_0x2f58a6 instanceof R?this['view']['handleError'](_0x2f58a6['message']):this['view']['handleError'](),_0x45862e();})['finally'](()=>{this['stopProcessing'](),_0x45862e();});});}['_parseAndNormalizeContent'](_0x11ad6e,_0x3910fa=!0x1){const _0x362fa2=Q['exec'](_0x11ad6e);_0x11ad6e=_0x362fa2?_0x11ad6e['substring'](_0x362fa2[0x1]['length']):_0x11ad6e['length']<0x64&&!_0x3910fa?'':this['_stripMarkdownSyntax'](_0x11ad6e);const _0x4960d3=this['_domParser']['parseFromString'](_0x11ad6e,'text/html');if(_0x362fa2){const _0x21af97=Array['from'](_0x4960d3['body']['childNodes']);_0x21af97['reverse']();for(const _0x22e2ae of _0x21af97){if(_0x22e2ae['nodeType']==Node['ELEMENT_NODE'])break;_0x22e2ae['remove']();}}const _0x12fad2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4960d3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12fad2);const _0x45f53b=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x44a083=this['editor']['data']['toModel'](_0x12fad2);return _0x45f53b||_0x44a083['markers']['clear'](),this['editor']['data']['stringify'](_0x44a083);}['_normalizeResponseHeadings'](_0x942935){const _0x1e5420=new _0x3a579f(this['editor']['editing']['view']['document']),_0x105aa7=new _0x3d57c4({'name':/^h[1-5]$/}),_0xfa5524=[];let _0x3a46cf=!0x1;for(const _0x3d41b8 of _0x942935)_0x3d41b8['is']('element')&&_0x105aa7['match'](_0x3d41b8)&&(_0xfa5524['push'](_0x3d41b8),'h1'==_0x3d41b8['name']&&(_0x3a46cf=!0x0));if(_0x3a46cf){for(const _0x54f6df of _0xfa5524)_0x1e5420['rename']('h'+(parseInt(_0x54f6df['name'][0x1])+0x1),_0x54f6df);}}['_isH1TagSupportEnabled'](){const {data:_0x2a51e1,editing:_0x45be87}=this['editor'],_0x46f94b=_0x2a51e1['htmlProcessor']['toView']('<h1></h1>'),_0x56d5ec=_0x2a51e1['toView'](_0x2a51e1['toModel'](_0x46f94b));return!!_0x45be87['view']['domConverter']['viewToDom'](_0x56d5ec)['querySelector']('h1');}['_sanitizeHTML'](_0x4a4c14){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4a4c14),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x43921b){const _0x12df4f=_0x43921b['trim']();return _0x12df4f['startsWith']('```html')?_0x12df4f['endsWith']('```')?_0x12df4f['substring'](0x7,_0x12df4f['length']-0x3):_0x12df4f['substring'](0x7):_0x43921b;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x5a83db){super(_0x5a83db),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x426cb7=>i(_0x5a83db,'AI_'+_0x426cb7['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5a83db,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5a83db,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5a83db,'Stop'));const _0x1b209d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1b209d['if']('isVisible','ck-hidden',_0x3be2db=>!_0x3be2db)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x488908,_0x53d8e6){const _0xcd3558=new _0x150283(this['locale']);return _0xcd3558['set']({'label':_0x488908,'class':_0x53d8e6||'','isVisible':!0x0,'withText':!0x0}),_0xcd3558;}}class ct extends _0x15a16a{['contentFieldView'];['copyButtonView'];constructor(_0x14637b,_0x5bfd61=''){super(_0x14637b),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x574496=this['bindTemplate'];this['contentFieldView']=new bt(_0x14637b,_0x5bfd61),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x574496['if']('isVisible','ck-hidden',_0x38b833=>!_0x38b833)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x574496['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 _0x2570c8=!0x1;this['on']('change:value',(_0x1215ff,_0x499f80,_0x49dec3)=>{const _0x5f1555=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x49dec3),this['isProcessing']&&_0x5f1555&&!_0x2570c8&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x53cb15,_0x2408b3,_0x3fe4c1)=>{_0x2570c8=!0x1,_0x3fe4c1?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2570c8=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2570c8=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x490a91=this['locale'],_0x55e001=new _0x150283(this['locale']),_0x2aa131='ck-ai-form__copy-button';return _0x55e001['set']({'label':i(_0x490a91,'Copy'),'icon':_0x143f04,'class':_0x2aa131,'tooltip':!0x0}),_0x55e001['bind']('isVisible')['to'](this,'value',_0x12d641=>!!_0x12d641),_0x55e001['bind']('isEnabled')['to'](this,'isProcessing',_0x44a30b=>!_0x44a30b),_0x55e001['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x55e001['icon']=_0x48de83,_0x55e001['class']=_0x2aa131+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x55e001['icon']=_0x143f04,_0x55e001['class']=_0x2aa131;},0x3e8);}),_0x55e001;}['_copyHTMLToClipboard'](_0x4b5a23){const {window:_0x40c09d,document:_0x3829f2}=_0x4288e3;if(_0x40c09d['ClipboardItem']){const {Blob:_0xc7b5b4,ClipboardItem:_0x2d8e9f}=_0x40c09d,_0x35100f=[new _0x2d8e9f({'text/html':new _0xc7b5b4([_0x4b5a23['innerHTML']],{'type':'text/html'}),'text/plain':new _0xc7b5b4([_0x4b5a23['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x35100f);}else{const _0x24397b=_0x3829f2['createElement']('div');_0x24397b['style']['position']='absolute',_0x24397b['style']['left']='-9999px',_0x24397b['innerHTML']='<span>[</span>'+_0x4b5a23['innerHTML']+'<span>]</span>',_0x3829f2['body']['appendChild'](_0x24397b);const _0x46ceee=_0x3829f2['createRange']();_0x46ceee['setStartAfter'](_0x24397b['firstElementChild']),_0x46ceee['setEndBefore'](_0x24397b['lastElementChild']);const _0x5abe71=_0x40c09d['getSelection']();_0x5abe71['removeAllRanges'](),_0x5abe71['addRange'](_0x46ceee),_0x3829f2['execCommand']('copy'),_0x24397b['remove']();}}}class bt extends _0x15a16a{constructor(_0x145a50,_0x308691=''){super(_0x145a50),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x308691,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2dcae1){this['element']['innerHTML']=_0x2dcae1;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x9dafb2=new _0x15a16a(),_0x470605=this['locale'],_0x1dc40f=new _0x41b4d8();return _0x1dc40f['isVisible']=!0x0,_0x9dafb2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1dc40f,{'text':i(_0x470605,'AI\x20is\x20writing...')}]}),_0x9dafb2['render'](),_0x9dafb2;}}class mt extends _0x15a16a{constructor(_0x521833,_0x66f33b=''){super(_0x521833);const _0x531b31=new _0x1dfc9c(),_0x2ed247=this['bindTemplate'];this['set']('text',_0x66f33b),_0x531b31['content']=_0x58f758,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x531b31,{'text':_0x2ed247['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4930ba,_0x2ce0ea){super(_0x4930ba,_0x2ce0ea),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',(_0x11c1db,_0x215c94)=>{_0x11c1db['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x215c94());});}['_createSubmitButton'](){const _0x36c1bf=new _0x150283(this['locale']),_0x2ac0d8=this['locale'];return _0x36c1bf['set']({'icon':it,'label':i(_0x2ac0d8,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x36c1bf['on']('execute',()=>{this['submit']();}),_0x36c1bf['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x8ab743,_0x327316)=>!_0x8ab743&&_0x327316),_0x36c1bf;}['_createShowHistoryButton'](){const _0xb60091=new _0x150283(this['locale']),_0x429658=this['resultsView'],_0x375ddf=this['locale'];_0xb60091['set']({'label':i(_0x375ddf,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xb60091['bind']('isOn')['to'](_0x429658,'isVisible'),_0xb60091['bind']('isEnabled')['to'](this,'isEnabled'),_0xb60091['on']('execute',()=>{_0x429658['isVisible']=!_0x429658['isVisible'],_0x429658['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5cfe68=()=>{_0x4288e3['window']['requestAnimationFrame'](()=>{if(_0x9e8af8(this['element'])){const _0x2aa0e1=new _0x44b2b0(this['queryView']['fieldView']['element']),_0x79bc08=_0x2aa0e1['width'],_0xb3c67e='rtl'===_0x375ddf['uiLanguageDirection']?'left':'right';_0x2aa0e1['excludeScrollbarsAndBorders'](),_0xb60091['element']['style'][_0xb3c67e]=_0x79bc08-_0x2aa0e1['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5cfe68),this['on']('render',_0x5cfe68),_0xb60091;}['submit'](){const _0x94a68d=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x94a68d);}['focus'](_0x3de16b){-0x1===_0x3de16b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x11c319){super(_0x11c319),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x11c319,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xda37ce=0x0;for(const _0x4fe8fe of this['items'])_0xda37ce+=_0x4fe8fe['items']['length'];return{'resultsCount':_0xda37ce,'totalItemsCount':_0xda37ce};}['_createClearHistoryButton'](){const _0x44380e=this['locale'],_0x368728=new _0x150283(this['locale']);return _0x368728['set']({'label':'('+i(_0x44380e,'Clear')+')','withText':!0x0}),_0x368728['on']('execute',()=>this['fire']('clearHistory')),_0x368728;}}class ut extends xt{constructor(_0x2799f6){super();const _0x2db931=new wt(),_0x7a7316=new _0x150283(this['locale'],_0x2db931);this['children']['add'](_0x7a7316),_0x7a7316['set']({'label':_0x2799f6['prompt'],'withText':!0x0}),_0x7a7316['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x2799f6['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3634f3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3da64c,_0x503264)=>{const _0x3c4243=os(_0x503264['prompt']);for(const _0x52fa62 of this)if(_0x52fa62!=_0x503264&&os(_0x52fa62['prompt'])===_0x3c4243){this['remove'](_0x52fa62);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x23167f=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x23167f));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x460913=>_0x460913)));}}function os(_0x5bdb69){return _0x5bdb69['toLowerCase']()['trim']();}class k extends _0x15a16a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xefc9a5,_0x152a75,_0x4e83d7=''){super(_0xefc9a5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0xefc9a5),this['contentArea']=new ct(_0xefc9a5,_0x4e83d7),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x39876e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x152a75],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x39876e['if']('isError','ck-hidden',_0xcd5e13=>!_0xcd5e13)]},'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'](_0x39c37f=0x1){-0x1===_0x39c37f?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 _0x100a6c=this['locale'],_0x14445a=new lt(_0x100a6c,{'queryView':{'label':i(_0x100a6c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x100a6c,'Empty\x20history'),'secondary':i(_0x100a6c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x14445a['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x292327,_0x357b83)=>_0x292327&&!_0x357b83),this['listenTo'](_0x14445a,'submit',(_0x23d9db,_0x2b02a9)=>{this['prompt']=_0x2b02a9;const _0x192830=ft(_0x2b02a9);this['fire']('submitPrompt',_0x192830),_0x2b02a9['trim']()&&this['_promptHistory']['add']({'prompt':_0x192830},0x0);},{'priority':'high'}),_0x14445a;}['_createHistoryView'](){const _0x308f1d=new pt(this['locale']);return _0x308f1d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x308f1d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x308f1d;}['_createToolbar'](){const _0x1ecff9=new at(this['locale']);return _0x1ecff9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xc31c02,_0x501919,_0x188349)=>_0xc31c02&&!_0x501919&&!!_0x188349),_0x1ecff9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1ecff9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5a387b,_0x31b60e,_0x2809f8)=>_0x5a387b&&!_0x31b60e&&!!_0x2809f8),_0x1ecff9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1ecff9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x16fdbd,_0x455af2)=>_0x16fdbd&&!_0x455af2),_0x1ecff9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1ecff9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1ecff9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1ecff9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3472af=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3472af,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xdd2e76){const _0x55a751=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xdd2e76||i(_0x55a751,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x500ecb{['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[_0x234e84,a,x,_0x195576];}constructor(_0x45ac76){super(_0x45ac76),_0x45ac76['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x45ac76['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x45ac76['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x45ac76['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2a3eca}=this;this['_aiAdapter']=_0x2a3eca['plugins']['get'](x),this['_dialog']=_0x2a3eca['plugins']['get'](_0x195576),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x41ee2c=new E(_0x2a3eca,Array['from'](this['_commandDefinitions']['values']()));_0x2a3eca['commands']['add']('showAIAssistant',_0x41ee2c),_0x2a3eca['ui']['componentFactory']['add']('aiCommands',_0x171d2a=>{const _0x9e426f=_0x2d9384(_0x171d2a);return _0x9e426f['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x9e426f['buttonView']['set']({'label':i(_0x171d2a,'AI\x20Commands'),'icon':_0x1096ba,'tooltip':!0x0}),_0x9e426f['on']('execute',_0x5e2ec5=>this['_onExecute'](_0x5e2ec5['source']['id'])),_0x38e05d(_0x9e426f,_0x2a3eca['ui']['view']['body'],function(_0x11eb90){const _0x55d199=o(_0x11eb90['config']['get']('ai.aiAssistant.commands'),_0x11eb90['locale']),_0x127f31=U(_0x11eb90,_0x55d199)['filter'](_0x50ef59=>_0x50ef59['commands']['length']);if(0x1===_0x127f31['length'])return U(_0x11eb90,_0x127f31[0x0]['commands'])['map'](_0x5c3f63=>({'id':_0x5c3f63['id'],'label':_0x5c3f63['label']}));return _0x127f31['map'](_0x54b2d0=>{const {groupId:_0x5f75b0,groupLabel:_0x144fec,commands:_0x2d6396}=_0x54b2d0,_0x4e9a9d=U(_0x11eb90,_0x2d6396)['map'](_0x1ffe4c=>({'id':_0x1ffe4c['id'],'label':_0x1ffe4c['label']}));return{'id':_0x5f75b0,'menu':_0x144fec||_0x5f75b0,'children':_0x4e9a9d};});}(_0x2a3eca),{'ariaLabel':i(_0x171d2a,'AI\x20Commands')}),_0x9e426f['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x41ee2c['on']('change:enabledCommandsIds',_0x4c95b8),_0x9e426f['menuView']['once']('render',_0x4c95b8),_0x9e426f;function _0x4c95b8(){_0x9e426f['isEnabled']=_0x41ee2c['enabledCommandsIds']['length']>0x0;for(const _0x49c492 of _0x9e426f['menuView']['buttons'])_0x49c492['isEnabled']=_0x41ee2c['enabledCommandsIds']['includes'](_0x49c492['id']);}}),_0x2a3eca['ui']['componentFactory']['add']('menuBar:aiCommands',_0x332c68=>{const _0x43a2d2=new _0x5197c8(_0x332c68);_0x43a2d2['buttonView']['set']({'label':i(_0x332c68,'AI\x20Commands'),'icon':_0x1096ba}),_0x43a2d2['bind']('isEnabled')['to'](_0x41ee2c,'enabledCommandsIds',_0x2902ed=>_0x2902ed['length']>0x0);const _0x46dc6e=o(_0x2a3eca['config']['get']('ai.aiAssistant.commands'),_0x332c68);return this['_populateMenuBarMenu'](_0x41ee2c,_0x43a2d2,_0x46dc6e,_0x4982fe=>this['_onExecute'](_0x4982fe)),_0x43a2d2;}),_0x2a3eca['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x11b7d8=this['_createAIAssistantUIButton'](_0x150283);return _0x11b7d8['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x11b7d8;}),_0x2a3eca['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x8437ef=this['_createAIAssistantUIButton'](_0x1ceadf);return _0x8437ef['set']({'role':'menuitemcheckbox'}),_0x8437ef;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x872c7f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x406cfd;for(const _0x313b3f in _0x872c7f){const _0x569769=_0x313b3f,_0x4de37e=_0x872c7f[_0x569769];if('aiLicenseKeyValid'==_0x4de37e||'aiLicenseKeyInvalid'==_0x4de37e||'aiLicenseKeyExpired'==_0x4de37e||'aiLicenseKeyDomainLimit'==_0x4de37e||'aiLicenseKeyNotAllowed'==_0x4de37e||'aiLicenseKeyEvaluationLimit'==_0x4de37e||'aiLicenseKeyTrialLimit'==_0x4de37e||'aiLicenseKeyUsageLimit'==_0x4de37e){delete _0x872c7f[_0x569769],_0x406cfd=_0x4de37e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x406cfd&&_0x872c7f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x406cfd&&_0x872c7f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x406cfd&&_0x872c7f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x406cfd&&_0x872c7f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x307fb6='',_0x508efb='',_0x34197e='custom'){const _0x529889=this['editor'],_0x530a77=_0x529889['editing']['view'],_0x5a900e=_0x529889['plugins']['get'](a),_0x55bc32=_0x529889['plugins']['get'](_0x234e84);_0x5a900e['showFakeVisualSelection']();const _0xb4cc7b=new l(),_0x58d854=new ClipboardEvent('copy',{'clipboardData':_0xb4cc7b}),_0x38f47f=new _0x5e080f(_0xb4cc7b),_0x1ed567=new _0x59b8b3(_0x530a77,_0x58d854,{'dataTransfer':_0x38f47f});_0x55bc32['_forceMarkersCopy']('comment',()=>{_0x530a77['document']['fire']('copy',_0x1ed567);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x529889,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x59195b=_0x38f47f['getData']('text/html');const _0x4f3403=_0x529889['model']['document']['selection'],_0x1b6ee4=Array['from'](_0x4f3403['getRanges']());0x1===_0x1b6ee4['length']&&_0x1b6ee4[0x0]['isFlat']&&!_0x4f3403['getSelectedElement']()&&''!==_0x59195b['replace'](/&nbsp;/g,'')['trim']()&&(_0x59195b='<p>'+_0x59195b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x34197e,'query':_0x307fb6,'htmlContent':_0x59195b,'label':_0x508efb,'mainActionLabel':_[_0x529889['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2b1820,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2500ec['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5a900e['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2a7334=new Map(),_0x4da985=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x21c136 of _0x4da985)for(const _0x5300b4 of _0x21c136['commands'])_0x2a7334['set'](_0x5300b4['id'],{..._0x5300b4,'groupId':_0x21c136['groupId'],'groupLabel':_0x21c136['groupLabel']||_0x21c136['groupId']});return _0x2a7334;}['_createAIAssistantUIButton'](_0x23fb6a){const _0x2f8b47=this['editor'],_0x56def0=_0x2f8b47['commands']['get']('showAIAssistant'),_0x295d45=new _0x23fb6a(_0x2f8b47['locale']);return _0x295d45['set']({'label':i(_0x2f8b47['locale'],'AI\x20Assistant'),'icon':_0x2b1820,'isToggleable':!0x0}),_0x295d45['bind']('isEnabled')['to'](_0x56def0),_0x295d45['bind']('isOn')['to'](this['_dialog'],'id',_0x3d882a=>'aiAssistant'===_0x3d882a),this['listenTo'](_0x295d45,'execute',()=>{_0x295d45['isOn']?this['hideUI']():_0x56def0['execute']();}),_0x295d45;}['_initView'](){const _0x376892=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',()=>{_0x376892['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x376892['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xa911df,ui:{ariaLiveAnnouncer:_0x54c326}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xb6b157,_0x5bfac5,_0x2cc5bf)=>{const _0x3f1504=this['_aiAssistantController']['currentContext'];_0x2cc5bf?_0x54c326['announce'](i(_0xa911df,'AI\x20is\x20writing')):_0x3f1504&&_0x54c326['announce'](i(_0xa911df,'Generated\x20content:\x20%0',_0x3f1504),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x431600,_0x2b1750,_0x171f85)=>{if(_0x171f85){const _0x451459=this['_formView']['errorView']['text'];_0x54c326['announce'](i(_0xa911df,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x451459));}});}['_onExecute'](_0x4aeced){const _0x1d7ce7=this['_commandDefinitions']['get'](_0x4aeced),_0x100524=this['editor'],_0x10c726=_0x100524['model']['document']['selection'],_0x498885=_0x100524['commands']['get']('showAIAssistant'),_0x444059=_0x100524['plugins']['get'](a),_0x5c667c=''+(_0x1d7ce7['groupId']!==K?_0x1d7ce7['groupLabel']+':\x20':'')+_0x1d7ce7['label'];if(!0x1!==_0x1d7ce7['requiresContent']&&_0x10c726['isCollapsed']){const _0x21099f=_0x44fea0(_0x10c726['getSelectedBlocks']())||_0x100524['model']['schema']['getLimitElement'](_0x10c726);_0x100524['model']['change'](_0xa42f1e=>{_0xa42f1e['setSelection'](_0x21099f,'in');});}_0x444059['showFakeVisualSelection'](),_0x498885['execute'](_0x1d7ce7['prompt'],_0x5c667c,'command:'+_0x4aeced);}['_populateMenuBarMenu'](_0x422bd0,_0xa4af9f,_0x240c92,_0x33f4fe){const _0x18843=this['editor'],_0x3782c7=_0x18843['locale'],_0x5462a5=new _0x2deade(_0x3782c7),_0x92ec87=U(_0x18843,_0x240c92)['filter'](_0x41ccec=>_0x41ccec['commands']['length']);0x1===_0x92ec87['length']?this['_getMenuBarGroupButtons']({'command':_0x422bd0,'commands':_0x92ec87[0x0]['commands'],'parentMenuView':_0xa4af9f,'onExecute':_0x33f4fe})['forEach'](_0x5eb705=>_0x5462a5['items']['add'](_0x5eb705)):_0x92ec87['forEach'](({groupId:_0x482cf3,groupLabel:_0x5884bf,commands:_0x38438e})=>{const _0x541872=new _0x5dfe0d(_0x3782c7,_0xa4af9f),_0x48c2af=new _0x5197c8(_0x3782c7),_0x210957=new _0x2deade(_0x3782c7),_0x31dac1=this['_getMenuBarGroupButtons']({'command':_0x422bd0,'commands':_0x38438e,'parentMenuView':_0x48c2af,'onExecute':_0x33f4fe});_0x48c2af['buttonView']['set']({'label':_0x5884bf||_0x482cf3}),_0x48c2af['delegate']('execute')['to'](_0xa4af9f),_0x210957['items']['addMany'](_0x31dac1),_0x48c2af['panelView']['children']['add'](_0x210957),_0x541872['children']['add'](_0x48c2af),_0x5462a5['items']['add'](_0x541872);}),_0xa4af9f['panelView']['children']['add'](_0x5462a5);}['_getMenuBarGroupButtons']({command:_0x3efd32,commands:_0x7bf2db,parentMenuView:_0x404802,onExecute:_0x503545}){const _0x296d32=this['editor'],_0x317d7b=_0x296d32['locale'];return U(_0x296d32,_0x7bf2db)['map'](_0x16554d=>{const _0x2d8955=new _0x5dfe0d(_0x317d7b,_0x404802),_0x6f117d=new _0x1ceadf(_0x317d7b);return _0x6f117d['set']({'label':_0x16554d['label']}),_0x6f117d['delegate']('execute')['to'](_0x404802),_0x6f117d['on']('execute',()=>_0x503545(_0x16554d['id'])),_0x6f117d['bind']('isEnabled')['to'](_0x3efd32,'enabledCommandsIds',_0x410bdc=>_0x410bdc['includes'](_0x16554d['id'])),_0x2d8955['children']['add'](_0x6f117d),_0x2d8955;});}}function T(_0xbf7384,_0x1ac520){return void 0x0!==_0xbf7384['order']&&void 0x0===_0x1ac520['order']?0x1:void 0x0===_0xbf7384['order']&&void 0x0!==_0x1ac520['order']?-0x1:void 0x0!==_0xbf7384['order']&&void 0x0!==_0x1ac520['order']?_0xbf7384['order']-_0x1ac520['order']:0x0;}function U(_0x520499,_0x2d052c){_0x2d052c['sort'](T);const _0x3c5fbc={},_0x256347=[];for(const _0x4e1c08 of _0x2d052c)if(void 0x0!==_0x4e1c08['order']){if(_0x4e1c08['order']in _0x3c5fbc)throw new _0x426b7a('ai-commands-config-order-collision',_0x520499,{'conflictingDefinitions':[_0x4e1c08,_0x3c5fbc[_0x4e1c08['order']]]});_0x3c5fbc[_0x4e1c08['order']]=_0x4e1c08,_0x256347['splice'](_0x4e1c08['order'],0x0,_0x4e1c08);}else _0x256347['push'](_0x4e1c08);return _0x256347;}class At extends _0x500ecb{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10a131){super(_0x10a131);const _0x74807a=_0x10a131['config'],_0x525c89=_0x10a131['locale'];_0x74807a['define']('ai.aiAssistant.preserveComments',!0x0),_0x74807a['define']('ai.aiAssistant.commands',_t(_0x525c89)),_0x74807a['define']('ai.aiAssistant.extraCommandGroups',[]),_0x74807a['define']('ai.aiAssistant.removeCommands',[]);let _0x15320c=o(_0x74807a['get']('ai.aiAssistant.commands'),_0x525c89);const _0x1de914=_0x74807a['get']('ai.aiAssistant.extraCommandGroups'),_0x10bd2f=_0x74807a['get']('ai.aiAssistant.removeCommands');_0x1de914['forEach'](_0x54b99c=>{const _0x2ca01b=_0x15320c['find'](_0xc3069e=>_0xc3069e['groupId']===_0x54b99c['groupId']);_0x2ca01b?_0x2ca01b['commands']=_0x2ca01b['commands']['concat'](_0x54b99c['commands']):_0x15320c['push'](_0x54b99c);}),_0x15320c=_0x15320c['filter'](_0x220ffe=>!_0x10bd2f['includes'](_0x220ffe['groupId'])),_0x15320c['forEach'](_0x21c308=>{_0x21c308['commands']=_0x21c308['commands']['filter'](_0x585904=>!_0x10bd2f['includes'](_0x585904['id']));}),_0x74807a['set']('ai.aiAssistant.commands',_0x15320c);}}function _t(_0x48bfeb){return[{'groupId':'editOrReview','groupLabel':i(_0x48bfeb,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x48bfeb,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x48bfeb,'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(_0x48bfeb,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x48bfeb,'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(_0x48bfeb,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x48bfeb,'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(_0x48bfeb,'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(_0x48bfeb,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x48bfeb,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x48bfeb,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x48bfeb,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x48bfeb,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x48bfeb,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x48bfeb,'Change\x20style'),'commands':[{'id':'business','label':i(_0x48bfeb,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x48bfeb,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x48bfeb,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x48bfeb,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x48bfeb,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x48bfeb,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x48bfeb,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x48bfeb,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x48bfeb,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x48bfeb,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x48bfeb,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x48bfeb,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x48bfeb,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x500ecb{['abortController'];static get['requires'](){return[x];}constructor(_0x16e4b9){super(_0x16e4b9),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1965f2){return this['sendRequest'](_0x1965f2)['catch'](_0x3644be=>{if(_0x3644be instanceof R)return Promise['reject'](_0x3644be);if('AbortError'==_0x3644be['name'])return Promise['resolve']();throw console['error'](_0x3644be),new _0x426b7a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4325b8,_0x4fb15e){const _0x3570de=this['editor']['locale'],_0x5b6eb2={'Content-Type':'application/json'};if('object'==typeof _0x4325b8)Object['assign'](_0x5b6eb2,_0x4325b8);else{if(_0x4325b8)try{const _0xb486ed=await _0x4325b8(_0x4fb15e);Object['assign'](_0x5b6eb2,_0xb486ed);}catch{return Promise['reject'](new R(i(_0x3570de,'AI_ERROR_GET_HEADERS')));}}return _0x5b6eb2;}async['_prepareRequestParameters'](_0x2d1cf5,_0x590f77){const _0x1ab59c=this['editor']['locale'];if('object'==typeof _0x2d1cf5)return _0x2d1cf5;try{return await _0x2d1cf5(_0x590f77);}catch{return Promise['reject'](new R(i(_0x1ab59c,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x35aa0d){super(_0x35aa0d),_0x35aa0d['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x35aa0d['config']['get']('ai.openAI.requestParameters')||_0x35aa0d['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x35aa0d['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x35aa0d['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x35aa0d['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x44fb01,context:_0x25960d,onData:_0x2db606,actionId:_0x4b47fd}){const _0x3ff1a3=this['editor']['locale'],_0x2df81e=await this['prepareMessages'](_0x44fb01,_0x25960d,_0x4b47fd),_0x28e80f=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4b47fd),_0x53a6a0=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4b47fd),_0x5b9343={'messages':_0x2df81e,..._0x53a6a0},_0x3313f6={'method':'POST','headers':_0x28e80f,'body':JSON['stringify'](_0x5b9343),'signal':this['abortController']['signal']},_0x2259d4=await fetch(this['_apiUrl'],_0x3313f6);if(_0x2259d4['ok'])return _0x53a6a0['stream']?await this['_readStreamableResponse'](_0x2259d4,_0x2db606):await this['_readStaticResponse'](_0x2259d4,_0x2db606),Promise['resolve']();{const _0x282d1f=await _0x2259d4['text']();return _0x282d1f['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3ff1a3,'AI_ERROR_CONTEXT_LENGTH'))):_0x282d1f['includes']('Moderation')?Promise['reject'](new R(i(_0x3ff1a3,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x282d1f));}}async['prepareMessages'](_0x223225,_0xe8967,_0x1dca02){let _0x409dae,_0x28281e;return _0xe8967?(_0x409dae='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.',_0x28281e='Instruction:\x0a'+_0x223225+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xe8967):(_0x409dae='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.',_0x28281e=_0x223225),[{'role':'system','content':_0x409dae},{'role':'user','content':_0x28281e}];}async['_readStreamableResponse'](_0x55ea55,_0x5d0173){const _0x474060=_0x55ea55['body']['getReader'](),_0x364830=new TextDecoder();let _0x401385='',_0x3ee3='',_0x4cae1d='',_0x36b5c8=!0x1;for(;!_0x36b5c8;){const {done:_0x5c8b6c,value:_0xb3e1aa}=await _0x474060['read'](),_0x1b4148=_0x401385+_0x364830['decode'](_0xb3e1aa);let _0xfe94d0='';_0x36b5c8=_0x5c8b6c;try{_0xfe94d0=this['_cleanUpData'](_0x1b4148),_0x401385='';}catch{_0x401385=_0x1b4148;continue;}_0x3ee3+=_0xfe94d0,!_0x36b5c8&&this['_isBufferIncomplete'](_0x3ee3)||_0x3ee3&&(_0x4cae1d+=_0x3ee3,_0x3ee3='',_0x5d0173(_0x4cae1d));}return Promise['resolve']();}async['_readStaticResponse'](_0x140a38,_0x4895e3){return _0x4895e3((await _0x140a38['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4f6b37){const _0x6823b8=_0x4f6b37['split']('<')['length']!==_0x4f6b37['split']('>')['length'],_0x2daaaf=_0x4f6b37['length']<0x1e;return _0x6823b8&&_0x2daaaf;}['_cleanUpData'](_0xe7097f){return _0xe7097f['split'](/\n(?![^{]*\})/g)['map'](_0x3c1609=>_0x3c1609['replace']('data:\x20',''))['filter'](_0x2b26dd=>_0x2b26dd&&_0x2b26dd['length']>0x0&&'[DONE]'!==_0x2b26dd)['map'](_0x444ec0=>{const {choices:_0xb4ad36}=JSON['parse'](_0x444ec0);if(_0xb4ad36[0x0]?.['delta']?.['content'])return _0xb4ad36[0x0]['delta']['content'];})['filter'](_0x30ea1a=>_0x30ea1a)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1c6bbb){super(_0x1c6bbb),_0x1c6bbb['config']['get']('ai.aws.requestParameters')||_0x1c6bbb['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']=_0x1c6bbb['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1c6bbb['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1c6bbb['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1c6bbb['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3e42a1,context:_0x5df2e2,onData:_0x1c120c,actionId:_0x1b3e67}){const {model:_0x283283,stream:_0x4232bd,..._0x49c10d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1b3e67),_0x115056={'prompt':await this['preparePrompt'](_0x3e42a1,_0x5df2e2,_0x283283,_0x1b3e67),..._0x49c10d};this['_apiUrl']?await this['_processProxyRequest'](_0x115056,_0x283283,_0x4232bd,_0x1c120c,_0x1b3e67):await this['_processAWSRequest'](_0x115056,_0x283283,_0x4232bd,_0x1c120c);}async['preparePrompt'](_0x3c7cf3,_0x45b7ce,_0x11f5f8,_0x35989b){let _0x308580,_0x455d14;return _0x45b7ce?(_0x308580='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.',_0x455d14='Instruction:\x0a'+_0x3c7cf3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x45b7ce):(_0x308580='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.',_0x455d14=_0x3c7cf3),'meta.llama'==this['getModelFamily'](_0x11f5f8)?'<<SYS>>\x0a'+_0x308580+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x455d14+'\x0a[/INST]':'Human:\x0a'+_0x308580+'\x0a'+_0x455d14+'\x0a\x0aAssistant:';}['getModelFamily'](_0x17e9e9){if(/^anthropic\.claude/['test'](_0x17e9e9))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x17e9e9))return'ai21.j2';if(/^cohere\.command/['test'](_0x17e9e9))return'cohere.command';if(/^meta\.llama/['test'](_0x17e9e9))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x17e9e9));}async['_processProxyRequest'](_0x3af74c,_0x4984e7,_0x30d265,_0x33ecd5,_0x5914c2){const _0x52900e={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5914c2),'body':JSON['stringify']({..._0x3af74c,'model':_0x4984e7,'stream':_0x30d265}),'signal':this['abortController']['signal']},_0x527e2e=await fetch(this['_apiUrl'],_0x52900e);_0x30d265?await this['_readStreamableResponse'](_0x527e2e,_0x4984e7,_0x33ecd5):await this['_readStaticResponse'](_0x527e2e,_0x4984e7,_0x33ecd5);}async['_processAWSRequest'](_0x5e4ad0,_0x5db2ed,_0x196ebd,_0xdc60b1){const _0x51128c=new _0x5d9c90(this['_bedrockClientConfig']),_0x5bd4cc={'body':JSON['stringify'](_0x5e4ad0),'contentType':'application/json','accept':'application/json','modelId':_0x5db2ed};let _0x2fb795;if(_0x196ebd){const _0x3c7b83=new _0xff26e(_0x5bd4cc);_0x2fb795=await _0x51128c['send'](_0x3c7b83,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2fb795,_0x5db2ed,_0xdc60b1);}else{const _0x49dea0=new _0xaad2e(_0x5bd4cc);_0x2fb795=await _0x51128c['send'](_0x49dea0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2fb795,_0x5db2ed,_0xdc60b1);}}async['_readAsyncIterableResponse'](_0x1eef41,_0x50bebe,_0x53ed4e){const _0x39068a=_0x1eef41['body'],_0x3313fa=new TextDecoder('utf-8');let _0x7783ac='';for await(const _0x4e9fcc of _0x39068a)if(_0x4e9fcc['chunk']){const _0x391078=_0x3313fa['decode'](_0x4e9fcc['chunk']['bytes']),_0x5ae8b8=JSON['parse'](_0x391078);_0x7783ac+=this['_getGeneratedText'](_0x5ae8b8,_0x50bebe),_0x53ed4e(_0x7783ac);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4d9555,_0x4d85b0,_0x5a95a5){const _0x408ce0=_0x4d9555['body'],_0x93cb1a=new TextDecoder('utf-8'),_0x52f855=_0x408ce0['getReader']();let _0x4b54da='',_0x48c664='',_0x519d5a=!0x1;for(;!_0x519d5a;){const {done:_0x1f9c4e,value:_0x5de4b1}=await _0x52f855['read']();if(_0x519d5a=_0x1f9c4e,_0x519d5a)break;const _0x56d509=(_0x4b54da+_0x93cb1a['decode'](_0x5de4b1))['split']('\x0a')['map'](_0x4f0e5c=>{try{return _0x4b54da='',JSON['parse'](_0x4f0e5c);}catch{return _0x4b54da=_0x4f0e5c,null;}})['filter'](_0x5a0e0d=>null!==_0x5a0e0d);_0x56d509['length']&&(_0x48c664+=_0x56d509['map'](_0x568163=>this['_getGeneratedText'](_0x568163,_0x4d85b0))['join'](''),_0x5a95a5(_0x48c664));}return Promise['resolve']();}async['_readStaticResponse'](_0x49543e,_0xf4ba5c,_0x4a6f77){let _0x4a41a5;return _0x4a41a5=_0x49543e instanceof Response?await _0x49543e['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x49543e['body'])),(_0x4a6f77(this['_getGeneratedText'](_0x4a41a5,_0xf4ba5c)),Promise['resolve']());}['_getGeneratedText'](_0x1847a5,_0x11dae2){switch(this['getModelFamily'](_0x11dae2)){case'anthropic.claude':return _0x1847a5['completion'];case'ai21.j2':return _0x1847a5['completions'][0x0]['data']['text'];case'cohere.command':return _0x1847a5['generations'][0x0]['text'];case'meta.llama':return _0x1847a5['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
23
+ import{Plugin as _0x2d1d32,Command as _0x232af3}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3deb9c,IconCheck as _0x3c90d9,IconError as _0x5e3cca,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x2380a6,IconRobotPencil as _0x2d8fe9}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5d18ab,CKEditorError as _0x5038d9,ObservableMixin as _0x8cf721,global as _0x10ddad,isVisible as _0x3d06cb,Rect as _0xf542e8,Collection as _0x50b992,FocusTracker as et,KeystrokeHandler as rt,first as _0x34c6dc}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x26e4f0,View as _0x4c348a,SpinnerView as _0x7b6e84,IconView as _0x520ab5,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x78ce67,createDropdown as _0x4943e6,addMenuToDropdown as _0x20359e,MenuBarMenuView as _0x2c51f0,MenuBarMenuListItemButtonView as _0x4b8772,DialogViewPosition as _0x52abdf,MenuBarMenuListView as _0x5255c6,MenuBarMenuListItemView as _0x20f208}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x16a737,ClipboardMarkersUtils as _0x324d39}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x565093,ViewDataTransfer as _0x2e0788,ViewUpcastWriter as _0x545b9b,Matcher as _0x21b667}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5f2ebf,InvokeModelWithResponseStreamCommand as _0x46d9e4,InvokeModelCommand as _0xcfc9f2}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x5dfda9,_0x511f6a){const _0x49b2c9=(0x0,_0x511f6a['t'])('Other');return _0x5dfda9['length']?'groupId'in _0x5dfda9[0x0]?_0x5dfda9:[{'groupId':K,'groupLabel':_0x49b2c9,'order':0x1/0x0,'commands':_0x5dfda9}]:[{'groupId':K,'groupLabel':_0x49b2c9,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x2d1d32{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xcbe6c3}=this,_0x576e3f=['ck-fake-ai-selection'];_0xcbe6c3['config']['get']('ai.useTheme')&&_0x576e3f['push']('ck-ai-assistant-ui_theme'),_0xcbe6c3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x576e3f,'priority':0xc}}),_0xcbe6c3['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x1401db,{writer:_0x46246b})=>{if(!_0x1401db['markerRange']['isCollapsed'])return null;const _0x516662=_0x46246b['createUIElement']('span');return _0x46246b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x516662),_0x516662;}});}['afterInit'](){!async function(_0x333dfe){const _0x1f5533=_0x2f2679([0x58,0x7a,0x32,0x61,0x55,0x52,0x65,0x4d,0x6c,0x4f,0x63,0x38,0x57,0x6e,0x75,0x6a,0x45,0x67,0x62,0x41,0x49,0x6f,0x47,0x5a,0x33,0x71,0x59,0x48,0x34,0x46,0x76,0x77,0x72,0x31,0x78,0x56,0x39,0x66,0x44,0x4b,0x6b,0x35,0x36,0x37,0x69,0x73,0x53,0x42,0x6d,0x68,0x64,0x43,0x30,0x70,0x74,0x54,0x79,0x51,0x4c,0x4e,0x4a,0x50]),_0x46e3f8=0x63d77ec7,_0x3ac00e=0x63d00c97^_0x46e3f8,_0x2be294=window[_0x2f2679([0x44,0x61,0x74,0x65])][_0x2f2679([0x6e,0x6f,0x77])](),_0x19a014=_0x333dfe[_0x2f2679([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4a6e23=new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4722a3=>{_0x19a014[_0x2f2679([0x6f,0x6e,0x63,0x65])](_0x2f2679([0x72,0x65,0x61,0x64,0x79]),_0x4722a3);}),_0x42ccc7={[_0x2f2679([0x6b,0x74,0x79])]:_0x2f2679([0x45,0x43]),[_0x2f2679([0x75,0x73,0x65])]:_0x2f2679([0x73,0x69,0x67]),[_0x2f2679([0x63,0x72,0x76])]:_0x2f2679([0x50,0x2d,0x32,0x35,0x36]),[_0x2f2679([0x78])]:_0x2f2679([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]),[_0x2f2679([0x79])]:_0x2f2679([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]),[_0x2f2679([0x61,0x6c,0x67])]:_0x2f2679([0x45,0x53,0x32,0x35,0x36])},_0x269ec5=_0x19a014[_0x2f2679([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2f2679([0x67,0x65,0x74])](_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ab2c0(){let _0x564948,_0x356dbf=null,_0x2a3899=null;try{if(_0x269ec5==_0x2f2679([0x47,0x50,0x4c]))return _0x2f2679([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x564948=_0x3ba6a3(),!_0x564948)return _0x2f2679([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x564948[_0x2f2679([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2a3899=_0x2a1074(_0x564948[_0x2f2679([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x564948[_0x2f2679([0x6a,0x74,0x69])])),await _0x3f9d9e()?_0x4a00e2()?_0x3f8b13()?_0x2f2679([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x75fc62()?(_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2f2679([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x356dbf=_0x676625(_0x2f2679([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2f2679([0x74,0x72,0x69,0x61,0x6c])&&(_0x356dbf=_0x676625(_0x2f2679([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2a2a31()):_0x2f2679([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2f2679([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2f2679([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2f2679([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3f8b13(){const _0x25aa48=[_0x2f2679([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2f2679([0x74,0x72,0x69,0x61,0x6c])][_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2be294/0x3e8:0xe10*_0x3ac00e;return _0x564948[_0x2f2679([0x65,0x78,0x70])]<_0x25aa48;}function _0x4a00e2(){const _0x4f6ef9=_0x564948[_0x2f2679([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4f6ef9&&(!!_0x4f6ef9[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f2679([0x2a]))||!!_0x4f6ef9[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f2679([0x41,0x49])));}function _0x75fc62(){const _0x52b5d9=_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x52b5d9||0x0==_0x52b5d9[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2d48d2}=new URL(window[_0x2f2679([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x52b5d9[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d48d2))return!0x0;const _0x207f77=_0x2d48d2[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e]));return _0x52b5d9[_0x2f2679([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4d4318=>_0x4d4318[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f2679([0x2a])))[_0x2f2679([0x6d,0x61,0x70])](_0x39fb14=>_0x39fb14[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e])))[_0x2f2679([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4ef16d=>_0x4ef16d[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x207f77[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2f2679([0x6d,0x61,0x70])](_0x7c2ec1=>Array(_0x207f77[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x7c2ec1[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2f2679([0x66,0x69,0x6c,0x6c])](_0x7c2ec1[0x0]===_0x2f2679([0x2a])?_0x2f2679([0x2a]):'')[_0x2f2679([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x7c2ec1))[_0x2f2679([0x73,0x6f,0x6d,0x65])](_0x2217ca=>_0x207f77[_0x2f2679([0x65,0x76,0x65,0x72,0x79])]((_0x4beb45,_0x5db224)=>_0x2217ca[_0x5db224]===_0x4beb45||_0x2217ca[_0x5db224]===_0x2f2679([0x2a])));}function _0x2a2a31(){return _0x356dbf&&_0x2a3899?new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x394493,_0x423ed9)=>{_0x356dbf[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x394493,_0x423ed9),_0x2a3899[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x272ea0=>{_0x272ea0!=_0x2f2679([0x56,0x61,0x6c,0x69,0x64])&&_0x394493(_0x272ea0);},_0x423ed9);}):_0x356dbf||_0x2a3899||_0x2f2679([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2a1074(_0x3bfbe9,_0x4428ab){return new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ec275=>{if(_0x5bbb9b())return _0x3ec275(_0x2f2679([0x56,0x61,0x6c,0x69,0x64]));_0x2b6d1f(),_0x19a014[_0x2f2679([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2f2679([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x46316b=!0x1;const _0x1d6eac=_0x5d18ab();function _0x3d96bc(_0x460232){return!!_0x460232&&(typeof _0x460232===_0x2f2679([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x460232===_0x2f2679([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x460232[_0x2f2679([0x74,0x68,0x65,0x6e])]===_0x2f2679([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x460232[_0x2f2679([0x63,0x61,0x74,0x63,0x68])]===_0x2f2679([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2a0ad0(_0x375f29){_0x24d5eb(_0x375f29)[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x221b62=>{if(!_0x221b62||_0x221b62[_0x2f2679([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2f2679([0x6f,0x6b]))return _0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x33ca4f(_0x55cb30(_0x1d6eac+_0x4428ab))!=_0x221b62[_0x2f2679([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2f2679([0x56,0x61,0x6c,0x69,0x64]);})[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x371d67=>(_0x3879b4(),_0x371d67),()=>{const _0x4d7da4=_0x642579();return null==_0x4d7da4?(_0x3879b4(),_0x2f2679([0x56,0x61,0x6c,0x69,0x64])):_0x2f2679(_0x2be294-_0x4d7da4>(0x47dbfac7^_0x46e3f8)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x3ec275)[_0x2f2679([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3ec275(_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x52310e=0x63e19047^_0x46e3f8;function _0x3879b4(){const _0x3d9929=_0x2f2679([0x6c,0x6c,0x63,0x74,0x2d])+_0x33ca4f(_0x55cb30(_0x3bfbe9)),_0x3c67e3=_0x11264d(_0x33ca4f(window[_0x2f2679([0x4d,0x61,0x74,0x68])][_0x2f2679([0x63,0x65,0x69,0x6c])](_0x2be294/_0x52310e)));window[_0x2f2679([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2f2679([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3d9929,_0x3c67e3);}function _0x642579(){const _0x170a75=_0x2f2679([0x6c,0x6c,0x63,0x74,0x2d])+_0x33ca4f(_0x55cb30(_0x3bfbe9)),_0x1c97ea=window[_0x2f2679([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2f2679([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x170a75);return _0x1c97ea?window[_0x2f2679([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x11264d(_0x1c97ea),0x10)*_0x52310e:null;}function _0x24d5eb(_0x3b20f2){return new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x461b06,_0x4ff657)=>{_0x3b20f2[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x461b06,_0x4ff657),window[_0x2f2679([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4ff657,0x63d6aa07^_0x46e3f8);});}}_0x19a014[_0x2f2679([0x6f,0x6e])](_0x2f2679([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x19c899,_0x15fc9a)=>{if(_0x15fc9a[0x0]!=_0x3bfbe9)return _0x3ec275(_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x15fc9a[0x1]={..._0x15fc9a[0x1],[_0x2f2679([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1d6eac};},{[_0x2f2679([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2f2679([0x68,0x69,0x67,0x68])}),_0x19a014[_0x2f2679([0x6f,0x6e])](_0x2f2679([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x521d7e=>{_0x3d96bc(_0x521d7e[_0x2f2679([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x46316b=!0x0,_0x2a0ad0(_0x521d7e[_0x2f2679([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2f2679([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2f2679([0x6c,0x6f,0x77])}),_0x4a6e23[_0x2f2679([0x74,0x68,0x65,0x6e])](()=>{_0x46316b||_0x3ec275(_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5bbb9b(){return _0x19a014[_0x2f2679([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2f2679([0x76,0x69,0x65,0x77])][_0x2f2679([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2f2679([0x61,0x75,0x74,0x6f]);}function _0x2b6d1f(){_0x19a014[_0x2f2679([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2f2679([0x76,0x69,0x65,0x77])][_0x2f2679([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2f2679([0x61,0x75,0x74,0x6f]);}}function _0x676625(_0x50529b){const _0x4d01db=[new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xaaf6ab=>setTimeout(_0xaaf6ab,0x63de400b^_0x46e3f8)),_0x4a6e23[_0x2f2679([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xd7ed05=>{let _0x2bb1f8=0x0;_0x19a014[_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f2679([0x6f,0x6e])](_0x2f2679([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x24f4ca,_0x3b5706)=>{_0x3b5706[0x0][_0x2f2679([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2bb1f8++,_0x2bb1f8==(0x63d77f3f^_0x46e3f8)&&(_0xd7ed05(),_0x24f4ca[_0x2f2679([0x6f,0x66,0x66])]());});}))];return window[_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2f2679([0x72,0x61,0x63,0x65])](_0x4d01db)[_0x2f2679([0x74,0x68,0x65,0x6e])](()=>_0x50529b);}async function _0x2224b4(){await _0x4a6e23,_0x19a014[_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f2679([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5b00b1,_0x19a014[_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f2679([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5b00b1,_0x19a014[_0x2f2679([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5827f1(_0x5a196f){const _0xde98ee=_0x2f0886();_0x19a014[_0xde98ee]=_0x2f2679([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5a196f,_0x5a196f!=_0x2f2679([0x56,0x61,0x6c,0x69,0x64])&&_0x2224b4();}function _0x2f0886(){const _0x2ce37f=window[_0x2f2679([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2f2679([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2f2679([0x6e,0x6f,0x77])]())[_0x2f2679([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2f2679([0x2e]),'');let _0x220a05=_0x2f2679([0x58]);for(let _0x363f8c=0x0;_0x363f8c<_0x2ce37f[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x363f8c+=0x2){let _0x4216dc=window[_0x2f2679([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ce37f[_0x2f2679([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x363f8c,_0x363f8c+0x2));_0x4216dc>=_0x1f5533[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4216dc-=_0x1f5533[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x220a05+=_0x1f5533[_0x4216dc];}return _0x220a05;}function _0x3ba6a3(){const _0x509546=_0x269ec5[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e]));if(0x3!=_0x509546[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x46fee0(_0x509546[0x1]);function _0x46fee0(_0x7f053c){const _0x10dca4=_0x450790(_0x7f053c);return _0x10dca4&&_0x3200d3()?_0x10dca4:null;function _0x3200d3(){const _0x3b2bf9=_0x10dca4[_0x2f2679([0x6a,0x74,0x69])],_0xd31e60=window[_0x2f2679([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3b2bf9[_0x2f2679([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3b2bf9[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4a8f32={..._0x10dca4,[_0x2f2679([0x6a,0x74,0x69])]:_0x3b2bf9[_0x2f2679([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3b2bf9[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4a8f32[_0x2f2679([0x76,0x63])],_0x55cb30(_0x4a8f32)==_0xd31e60;}}}async function _0x3f9d9e(){let _0x46417b=!0x0;try{const _0x128a86=_0x269ec5[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e])),[_0x4cae80,_0x6c7c32,_0x3ab113]=_0x128a86;return _0x5ce64b(_0x4cae80),await _0x3275e8(_0x4cae80,_0x6c7c32,_0x3ab113),_0x46417b;}catch{return!0x1;}function _0x5ce64b(_0x3d30dc){const _0x51c12c=_0x450790(_0x3d30dc);_0x51c12c&&_0x51c12c[_0x2f2679([0x61,0x6c,0x67])]==_0x2f2679([0x45,0x53,0x32,0x35,0x36])||(_0x46417b=!0x1);}async function _0x3275e8(_0x312542,_0x484dab,_0x49b677){const _0x168a72=window[_0x2f2679([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2f2679([0x66,0x72,0x6f,0x6d])](_0xd0a8(_0x49b677),_0x181446=>_0x181446[_0x2f2679([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x489380=new window[(_0x2f2679([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2f2679([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x312542+_0x2f2679([0x2e])+_0x484dab),_0x47a7f3=window[_0x2f2679([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2f2679([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x47a7f3)return;const _0x2a5764=await _0x47a7f3[_0x2f2679([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2f2679([0x6a,0x77,0x6b]),_0x42ccc7,{[_0x2f2679([0x6e,0x61,0x6d,0x65])]:_0x2f2679([0x45,0x43,0x44,0x53,0x41]),[_0x2f2679([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2f2679([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2f2679([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x47a7f3[_0x2f2679([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2f2679([0x6e,0x61,0x6d,0x65])]:_0x2f2679([0x45,0x43,0x44,0x53,0x41]),[_0x2f2679([0x68,0x61,0x73,0x68])]:{[_0x2f2679([0x6e,0x61,0x6d,0x65])]:_0x2f2679([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2a5764,_0x168a72,_0x489380)||(_0x46417b=!0x1);}}function _0x450790(_0x41f0a1){return _0x41f0a1[_0x2f2679([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2f2679([0x65,0x79]))?JSON[_0x2f2679([0x70,0x61,0x72,0x73,0x65])](_0xd0a8(_0x41f0a1)):null;}function _0xd0a8(_0x2c4f88){return window[_0x2f2679([0x61,0x74,0x6f,0x62])](_0x2c4f88[_0x2f2679([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2f2679([0x2b]))[_0x2f2679([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2f2679([0x2f])));}function _0x55cb30(_0x492f99){let _0x2c72a1=0x1505;function _0x5a65b5(_0x8bff1c){for(let _0x184e33=0x0;_0x184e33<_0x8bff1c[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x184e33++){const _0x3330ca=_0x8bff1c[_0x2f2679([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x184e33);_0x2c72a1=(_0x2c72a1<<0x5)+_0x2c72a1+_0x3330ca,_0x2c72a1&=_0x2c72a1;}}function _0x47ad0b(_0x1ee14b){Array[_0x2f2679([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1ee14b)?_0x1ee14b[_0x2f2679([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x47ad0b):_0x1ee14b&&typeof _0x1ee14b==_0x2f2679([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2f2679([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1ee14b)[_0x2f2679([0x73,0x6f,0x72,0x74])]()[_0x2f2679([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x409c9a,_0x4a997c])=>{_0x5a65b5(_0x409c9a),_0x47ad0b(_0x4a997c);}):_0x5a65b5(window[_0x2f2679([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1ee14b));}return _0x47ad0b(_0x492f99),_0x2c72a1>>>0x0;}function _0x33ca4f(_0x34e1ee){return _0x34e1ee[_0x2f2679([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2f2679([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2f2679([0x30]));}function _0x11264d(_0x961f8d){return _0x961f8d[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2f2679([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2f2679([0x6a,0x6f,0x69,0x6e])]('');}function _0x5b00b1(){}function _0x2f2679(_0x4899a2){return _0x4899a2['map'](_0x31bd55=>String['fromCharCode'](_0x31bd55))['join']('');}_0x5827f1(await _0x5ab2c0());}(this);}['showFakeVisualSelection'](){const _0x399d92=this['editor']['model'];_0x399d92['change'](_0x3c0334=>{const _0x2bb164=_0x399d92['document']['selection']['getRanges']();let _0x3a40a7=0x0;for(const _0xa11d2b of _0x2bb164){const _0x3e4a32=w+':'+_0x3a40a7;if(_0x399d92['markers']['has'](_0x3e4a32))_0x3c0334['updateMarker'](_0x3e4a32,{'range':_0xa11d2b});else{if(_0xa11d2b['start']['isAtEnd']){const _0x5e25cb=_0xa11d2b['start']['getLastMatchingPosition'](({item:_0x4d6373})=>!_0x399d92['schema']['isContent'](_0x4d6373),{'boundaries':_0xa11d2b});_0x3c0334['addMarker'](_0x3e4a32,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3c0334['createRange'](_0x5e25cb,_0xa11d2b['end'])});}else _0x3c0334['addMarker'](_0x3e4a32,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xa11d2b});}_0x3a40a7++;}});}['hideFakeVisualSelection'](){const _0x4d6e4c=this['editor']['model'],_0x5a98cb=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x5a98cb['length']&&_0x4d6e4c['change'](_0x29bc67=>{_0x5a98cb['forEach'](_0xeb1cf8=>{_0x29bc67['removeMarker'](_0xeb1cf8);});});}['insertContent'](_0x26eadf,_0x1976a7){const _0xa15539=this['_getAISelection'](),_0x5d21ba=_0x1976a7||_0xa15539['getFirstRange']();this['editor']['model']['canEditAt'](_0x5d21ba)&&this['editor']['model']['change'](_0x210997=>{this['hideFakeVisualSelection'](),_0x1976a7||this['_resetContentOfSelectedTableCells'](_0x210997,_0xa15539),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5d21ba,'writer':_0x210997,'html':_0x26eadf});});}['insertContentBelow'](_0x3c8d7a){const {model:_0x3ce2f2}=this['editor'],_0x3031b1=this['_getAISelection']();_0x3ce2f2['change'](()=>{const _0x4ebd47=this['_prepareTableInsertBelowPosition'](_0x3c8d7a,_0x3031b1)||this['_getDefaultInsertBelowPosition'](_0x3031b1);this['insertContent'](_0x3c8d7a,_0x4ebd47);});}['_getAISelection'](){const _0x41a8a3=this['editor']['model'],_0x368cd9=Array['from'](_0x41a8a3['markers']['getMarkersGroup'](w))['map'](_0x2ee88c=>_0x2ee88c['getRange']());return _0x41a8a3['createSelection'](_0x368cd9);}['_pasteHTMLUsingClipboard']({writer:_0x120ff8,html:_0x58b394,insertAt:_0x162ee1}){const {view:_0x264c16}=this['editor']['editing'],_0x11069e=this['editor']['plugins']['get'](_0x16a737),_0x2c42d0=new gt();_0x2c42d0['setData']('text/html',_0x58b394);const _0x24d2d1=new ClipboardEvent('paste',{'clipboardData':_0x2c42d0}),_0x2a3f9e=new _0x565093(_0x264c16,_0x24d2d1,{'dataTransfer':new _0x2e0788(_0x2c42d0)});_0x120ff8['setSelection'](_0x162ee1);const _0x76830f=(_0x1e0790,_0x14353e)=>{_0x14353e['resultRange']&&_0x120ff8['setSelection'](_0x14353e['resultRange']);};_0x11069e['once']('contentInsertion',_0x76830f,{'priority':'lowest'}),_0x264c16['document']['fire']('paste',_0x2a3f9e),_0x11069e['off']('contentInsertion',_0x76830f);}['_getDefaultInsertBelowPosition'](_0x2b830c){const {model:_0x98db23}=this['editor'],_0x30b2d2=Array['from'](_0x2b830c['getSelectedBlocks']());return _0x30b2d2['length']?_0x98db23['createPositionAfter'](_0x30b2d2['pop']()):_0x2b830c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2f963a,_0x22f387){const {model:_0x39f2d3,plugins:_0x4e8f05}=this['editor'];if(_0x4e8f05['has']('TableUtils')){const _0x40d105=_0x4e8f05['get']('TableUtils')['getSelectedTableCells'](_0x22f387);if(_0x40d105['length']){const _0x4dd917=this['_getTableRowCountFromContent'](_0x2f963a),_0x6bd350=this['_createEmptyTableRows'](_0x40d105,_0x4dd917);return _0x39f2d3['createPositionAt'](_0x6bd350,0x0);}}return null;}['_getTableRowCountFromContent'](_0x486356){const _0x23d6e2=this['editor']['plugins']['get']('TableUtils'),_0x230fd3=this['editor']['data']['parse'](_0x486356),_0x485302=Array['from'](_0x230fd3['getChildren']())['filter'](_0x200fd1=>_0x200fd1['is']('element','table'));let _0x1319e7=0x0;return _0x485302['forEach'](_0x2eb7f3=>{_0x1319e7+=_0x23d6e2['getRows'](_0x2eb7f3);}),_0x1319e7;}['_createEmptyTableRows'](_0x235889,_0x28d4b6){const _0x169171=this['editor']['plugins']['get']('TableUtils'),_0x4b0634=_0x169171['getRowIndexes'](_0x235889),_0x20497d=_0x169171['getColumnIndexes'](_0x235889),_0x4c541c=_0x4b0634['last']+0x1,_0x2cb2a1=_0x20497d['first'],_0x16d0ae=_0x235889[0x0]['findAncestor']('table');for(let _0x2c2a09=0x0;_0x2c2a09<_0x28d4b6;_0x2c2a09++)_0x169171['insertRows'](_0x16d0ae,{'at':_0x4c541c});return _0x16d0ae['getChild'](_0x4c541c)['getChild'](_0x2cb2a1);}['_resetContentOfSelectedTableCells'](_0x2f1240,_0x19eedb){const {plugins:_0x4408e3}=this['editor'],{model:_0x23647f}=_0x2f1240;if(!_0x4408e3['has']('TableUtils'))return;_0x4408e3['get']('TableUtils')['getSelectedTableCells'](_0x19eedb)['length']&&_0x23647f['deleteContent'](_0x19eedb);}}class x extends _0x2d1d32{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5038d9('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x29c0df){super(_0x29c0df),this['name']='AIRequestError';}}function i(_0x444b47,_0x494140,_0x2744ca){const t=_0x444b47['t'];switch(_0x494140){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',_0x2744ca);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2744ca);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'},_0x2744ca);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 _0x494140;}}class E extends _0x232af3{['_commandDefinitions'];constructor(_0x1e632c,_0x2ce60b){super(_0x1e632c),this['_commandDefinitions']=_0x2ce60b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3c3578,_0x565f56,_0x113ddf)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x113ddf));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x11c362,_0x1acba7,_0x291ddd)=>{this['enabledCommandsIds']=_0x291ddd?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x54e5d2=this['editor']['model'];this['_hasContext']=function(_0x4f5f9e){const _0x3ccb77=_0x4f5f9e['document']['selection'];return _0x3ccb77['isCollapsed']?0x0!==[..._0x3ccb77['getSelectedBlocks']()]['length']&&![..._0x3ccb77['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4f5f9e['hasContent'](_0x3ccb77['getFirstRange']());}(_0x54e5d2);const _0x11422b=_0x54e5d2['document']['selection'],_0x37aa92=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1d5bc4 of _0x11422b['getRanges']())for(const _0x5392fd of _0x1d5bc4['getItems']())if(_0x5392fd['is']('element')&&_0x37aa92['includes'](_0x5392fd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x25d0d6='',_0x9225e7='',_0x244351='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x25d0d6,_0x9225e7,_0x244351);}}function F(_0x240b0d,_0x5d66b0){const _0x4d1d01=new Set();for(const _0x478fe9 of _0x240b0d['values']())(_0x5d66b0||!0x1===_0x478fe9['requiresContent'])&&_0x4d1d01['add'](_0x478fe9['id']);return Array['from'](_0x4d1d01);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x8cf721(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4f89f5,_0x42359e,_0x3ad26a){super(),this['editor']=_0x4f89f5,this['textAdapter']=_0x42359e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3ad26a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x315aa2,_0x10e2db,_0x196f2d)=>{this['view']['value']=this['_sanitizeHTML'](_0x196f2d);}),this['listenTo'](this['view'],'submitPrompt',(_0x596534,_0x51cca9)=>{const _0x5d481c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x51cca9,_0x5d481c,'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:_0x3f2191,query:_0x14312a,htmlContent:_0x3caa69,label:_0x50acc0,mainActionLabel:_0x385585}){this['view']['prompt']=_0x50acc0,this['view']['mainAction']=_0x385585,this['initialContext']=_0x3caa69,_0x14312a&&(this['view']['isRendered']?this['_handleQuery'](_0x14312a,_0x3caa69,_0x3f2191,_0x50acc0):this['view']['once']('render',()=>{this['_handleQuery'](_0x14312a,_0x3caa69,_0x3f2191,_0x50acc0);}));}['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'](_0x2515c3,_0x1a6cc4,_0x5bc3f4,_0x2ce31b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1a6cc4,this['previousQuery']=_0x2515c3,this['previousLabel']=_0x2ce31b||_0x2515c3,this['previousActionId']=_0x5bc3f4,new Promise(_0x1418e2=>{this['textAdapter']['makeRequest']({'query':_0x2515c3,'context':_0x1a6cc4,'onData':_0xc4bc2f=>{this['currentResponse']=_0xc4bc2f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5bc3f4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x242585=>{_0x242585 instanceof R?this['view']['handleError'](_0x242585['message']):this['view']['handleError'](),_0x1418e2();})['finally'](()=>{this['stopProcessing'](),_0x1418e2();});});}['_parseAndNormalizeContent'](_0x1622f0,_0x39d6c7=!0x1){const _0x49b65a=Q['exec'](_0x1622f0);_0x1622f0=_0x49b65a?_0x1622f0['substring'](_0x49b65a[0x1]['length']):_0x1622f0['length']<0x64&&!_0x39d6c7?'':this['_stripMarkdownSyntax'](_0x1622f0);const _0x56d0e3=this['_domParser']['parseFromString'](_0x1622f0,'text/html');if(_0x49b65a){const _0xbc1bf5=Array['from'](_0x56d0e3['body']['childNodes']);_0xbc1bf5['reverse']();for(const _0x2ad54a of _0xbc1bf5){if(_0x2ad54a['nodeType']==Node['ELEMENT_NODE'])break;_0x2ad54a['remove']();}}const _0x4f1cd1=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x56d0e3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4f1cd1);const _0x338886=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x42d194=this['editor']['data']['toModel'](_0x4f1cd1);return _0x338886||_0x42d194['markers']['clear'](),this['editor']['data']['stringify'](_0x42d194);}['_normalizeResponseHeadings'](_0x2aacca){const _0xa4baef=new _0x545b9b(this['editor']['editing']['view']['document']),_0x4dc590=new _0x21b667({'name':/^h[1-5]$/}),_0x329642=[];let _0x4a671f=!0x1;for(const _0x4545da of _0x2aacca)_0x4545da['is']('element')&&_0x4dc590['match'](_0x4545da)&&(_0x329642['push'](_0x4545da),'h1'==_0x4545da['name']&&(_0x4a671f=!0x0));if(_0x4a671f){for(const _0x217018 of _0x329642)_0xa4baef['rename']('h'+(parseInt(_0x217018['name'][0x1])+0x1),_0x217018);}}['_isH1TagSupportEnabled'](){const {data:_0x23984e,editing:_0x2e32fc}=this['editor'],_0x43ace4=_0x23984e['htmlProcessor']['toView']('<h1></h1>'),_0x1df1e8=_0x23984e['toView'](_0x23984e['toModel'](_0x43ace4));return!!_0x2e32fc['view']['domConverter']['viewToDom'](_0x1df1e8)['querySelector']('h1');}['_sanitizeHTML'](_0x541f01){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x541f01),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xffdccb){const _0x33ff39=_0xffdccb['trim']();return _0x33ff39['startsWith']('```html')?_0x33ff39['endsWith']('```')?_0x33ff39['substring'](0x7,_0x33ff39['length']-0x3):_0x33ff39['substring'](0x7):_0xffdccb;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x195e77){super(_0x195e77),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xfe7fae=>i(_0x195e77,'AI_'+_0xfe7fae['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x195e77,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x195e77,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x195e77,'Stop'));const _0x133b52=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x133b52['if']('isVisible','ck-hidden',_0x1349b9=>!_0x1349b9)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x489795,_0x18f18c){const _0x4ea4d7=new _0x26e4f0(this['locale']);return _0x4ea4d7['set']({'label':_0x489795,'class':_0x18f18c||'','isVisible':!0x0,'withText':!0x0}),_0x4ea4d7;}}class ct extends _0x4c348a{['contentFieldView'];['copyButtonView'];constructor(_0x46b285,_0x139984=''){super(_0x46b285),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1eea58=this['bindTemplate'];this['contentFieldView']=new bt(_0x46b285,_0x139984),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1eea58['if']('isVisible','ck-hidden',_0xf785d8=>!_0xf785d8)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1eea58['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 _0x112214=!0x1;this['on']('change:value',(_0x473520,_0x113229,_0x8ce73f)=>{const _0x2604e0=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x8ce73f),this['isProcessing']&&_0x2604e0&&!_0x112214&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1060bb,_0xa6146a,_0x3a4b88)=>{_0x112214=!0x1,_0x3a4b88?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x112214=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x112214=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x40651b=this['locale'],_0x1c991d=new _0x26e4f0(this['locale']),_0x8a85ef='ck-ai-form__copy-button';return _0x1c991d['set']({'label':i(_0x40651b,'Copy'),'icon':_0x3deb9c,'class':_0x8a85ef,'tooltip':!0x0}),_0x1c991d['bind']('isVisible')['to'](this,'value',_0x56ec8e=>!!_0x56ec8e),_0x1c991d['bind']('isEnabled')['to'](this,'isProcessing',_0x192a04=>!_0x192a04),_0x1c991d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1c991d['icon']=_0x3c90d9,_0x1c991d['class']=_0x8a85ef+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1c991d['icon']=_0x3deb9c,_0x1c991d['class']=_0x8a85ef;},0x3e8);}),_0x1c991d;}['_copyHTMLToClipboard'](_0x5221a8){const {window:_0x4567c7,document:_0x4afd7c}=_0x10ddad;if(_0x4567c7['ClipboardItem']){const {Blob:_0x116332,ClipboardItem:_0x5199ee}=_0x4567c7,_0x118888=[new _0x5199ee({'text/html':new _0x116332([_0x5221a8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x116332([_0x5221a8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x118888);}else{const _0x57ef89=_0x4afd7c['createElement']('div');_0x57ef89['style']['position']='absolute',_0x57ef89['style']['left']='-9999px',_0x57ef89['innerHTML']='<span>[</span>'+_0x5221a8['innerHTML']+'<span>]</span>',_0x4afd7c['body']['appendChild'](_0x57ef89);const _0x3ccc6e=_0x4afd7c['createRange']();_0x3ccc6e['setStartAfter'](_0x57ef89['firstElementChild']),_0x3ccc6e['setEndBefore'](_0x57ef89['lastElementChild']);const _0x299226=_0x4567c7['getSelection']();_0x299226['removeAllRanges'](),_0x299226['addRange'](_0x3ccc6e),_0x4afd7c['execCommand']('copy'),_0x57ef89['remove']();}}}class bt extends _0x4c348a{constructor(_0x5c493e,_0x174d0f=''){super(_0x5c493e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x174d0f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4992f9){this['element']['innerHTML']=_0x4992f9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4602e3=new _0x4c348a(),_0x1d0ba6=this['locale'],_0x3b5813=new _0x7b6e84();return _0x3b5813['isVisible']=!0x0,_0x4602e3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3b5813,{'text':i(_0x1d0ba6,'AI\x20is\x20writing...')}]}),_0x4602e3['render'](),_0x4602e3;}}class mt extends _0x4c348a{constructor(_0x2448a0,_0x23ef23=''){super(_0x2448a0);const _0x4cb31c=new _0x520ab5(),_0x110973=this['bindTemplate'];this['set']('text',_0x23ef23),_0x4cb31c['content']=_0x5e3cca,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4cb31c,{'text':_0x110973['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2fd757,_0x4e4b96){super(_0x2fd757,_0x4e4b96),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',(_0x40f3e6,_0x2466f7)=>{_0x40f3e6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2466f7());});}['_createSubmitButton'](){const _0x4aec8e=new _0x26e4f0(this['locale']),_0x3b71c8=this['locale'];return _0x4aec8e['set']({'icon':it,'label':i(_0x3b71c8,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4aec8e['on']('execute',()=>{this['submit']();}),_0x4aec8e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4d489c,_0x942c02)=>!_0x4d489c&&_0x942c02),_0x4aec8e;}['_createShowHistoryButton'](){const _0x362bc4=new _0x26e4f0(this['locale']),_0x11f740=this['resultsView'],_0x5952b2=this['locale'];_0x362bc4['set']({'label':i(_0x5952b2,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x362bc4['bind']('isOn')['to'](_0x11f740,'isVisible'),_0x362bc4['bind']('isEnabled')['to'](this,'isEnabled'),_0x362bc4['on']('execute',()=>{_0x11f740['isVisible']=!_0x11f740['isVisible'],_0x11f740['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x33efe5=()=>{_0x10ddad['window']['requestAnimationFrame'](()=>{if(_0x3d06cb(this['element'])){const _0x311a29=new _0xf542e8(this['queryView']['fieldView']['element']),_0x59d2d2=_0x311a29['width'],_0x2d51fe='rtl'===_0x5952b2['uiLanguageDirection']?'left':'right';_0x311a29['excludeScrollbarsAndBorders'](),_0x362bc4['element']['style'][_0x2d51fe]=_0x59d2d2-_0x311a29['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x33efe5),this['on']('render',_0x33efe5),_0x362bc4;}['submit'](){const _0x581ede=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x581ede);}['focus'](_0x467bf0){-0x1===_0x467bf0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x39ca3a){super(_0x39ca3a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x39ca3a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b8e58=0x0;for(const _0x59b1a2 of this['items'])_0x2b8e58+=_0x59b1a2['items']['length'];return{'resultsCount':_0x2b8e58,'totalItemsCount':_0x2b8e58};}['_createClearHistoryButton'](){const _0x1b3396=this['locale'],_0x471883=new _0x26e4f0(this['locale']);return _0x471883['set']({'label':'('+i(_0x1b3396,'Clear')+')','withText':!0x0}),_0x471883['on']('execute',()=>this['fire']('clearHistory')),_0x471883;}}class ut extends xt{constructor(_0x3fdcc8){super();const _0x422f1a=new wt(),_0x18f0f0=new _0x26e4f0(this['locale'],_0x422f1a);this['children']['add'](_0x18f0f0),_0x18f0f0['set']({'label':_0x3fdcc8['prompt'],'withText':!0x0}),_0x18f0f0['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3fdcc8['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x50b992{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x46920c,_0xdfe2bd)=>{const _0x46cb42=os(_0xdfe2bd['prompt']);for(const _0x3f072e of this)if(_0x3f072e!=_0xdfe2bd&&os(_0x3f072e['prompt'])===_0x46cb42){this['remove'](_0x3f072e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5ec535=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x5ec535));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x25ac87=>_0x25ac87)));}}function os(_0x56cf9f){return _0x56cf9f['toLowerCase']()['trim']();}class k extends _0x4c348a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2adf17,_0x4affc5,_0x132200=''){super(_0x2adf17),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2adf17),this['contentArea']=new ct(_0x2adf17,_0x132200),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x21122c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4affc5],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x21122c['if']('isError','ck-hidden',_0x44a1ba=>!_0x44a1ba)]},'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'](_0x1a5bb8=0x1){-0x1===_0x1a5bb8?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 _0x5e4bf4=this['locale'],_0x52c0be=new lt(_0x5e4bf4,{'queryView':{'label':i(_0x5e4bf4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5e4bf4,'Empty\x20history'),'secondary':i(_0x5e4bf4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x52c0be['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x432720,_0x599fec)=>_0x432720&&!_0x599fec),this['listenTo'](_0x52c0be,'submit',(_0x1874cd,_0x35dad0)=>{this['prompt']=_0x35dad0;const _0x58efec=ft(_0x35dad0);this['fire']('submitPrompt',_0x58efec),_0x35dad0['trim']()&&this['_promptHistory']['add']({'prompt':_0x58efec},0x0);},{'priority':'high'}),_0x52c0be;}['_createHistoryView'](){const _0x430d49=new pt(this['locale']);return _0x430d49['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x430d49['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x430d49;}['_createToolbar'](){const _0x2026f1=new at(this['locale']);return _0x2026f1['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x20fdc7,_0x80d35f,_0x29a049)=>_0x20fdc7&&!_0x80d35f&&!!_0x29a049),_0x2026f1['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2026f1['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4f3810,_0x290ea2,_0x1ed44b)=>_0x4f3810&&!_0x290ea2&&!!_0x1ed44b),_0x2026f1['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2026f1['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x409112,_0x487526)=>_0x409112&&!_0x487526),_0x2026f1['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2026f1['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2026f1['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2026f1;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5ca913=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5ca913,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x41d54){const _0x3137dd=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x41d54||i(_0x3137dd,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x2d1d32{['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[_0x324d39,a,x,_0x78ce67];}constructor(_0x14f5c1){super(_0x14f5c1),_0x14f5c1['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x14f5c1['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x14f5c1['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x14f5c1['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x466386}=this;this['_aiAdapter']=_0x466386['plugins']['get'](x),this['_dialog']=_0x466386['plugins']['get'](_0x78ce67),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x14cd0b=new E(_0x466386,Array['from'](this['_commandDefinitions']['values']()));_0x466386['commands']['add']('showAIAssistant',_0x14cd0b),_0x466386['ui']['componentFactory']['add']('aiCommands',_0x29f878=>{const _0x3fcc67=_0x4943e6(_0x29f878);return _0x3fcc67['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3fcc67['buttonView']['set']({'label':i(_0x29f878,'AI\x20Commands'),'icon':_0x2380a6,'tooltip':!0x0}),_0x3fcc67['on']('execute',_0x47ea61=>this['_onExecute'](_0x47ea61['source']['id'])),_0x20359e(_0x3fcc67,_0x466386['ui']['view']['body'],function(_0x3c13c6){const _0x1050ba=o(_0x3c13c6['config']['get']('ai.aiAssistant.commands'),_0x3c13c6['locale']),_0x5d1c81=U(_0x3c13c6,_0x1050ba)['filter'](_0x49a7f6=>_0x49a7f6['commands']['length']);if(0x1===_0x5d1c81['length'])return U(_0x3c13c6,_0x5d1c81[0x0]['commands'])['map'](_0x5e6385=>({'id':_0x5e6385['id'],'label':_0x5e6385['label']}));return _0x5d1c81['map'](_0x372e13=>{const {groupId:_0x5d2ec8,groupLabel:_0xb84e63,commands:_0x4c7356}=_0x372e13,_0x35dd61=U(_0x3c13c6,_0x4c7356)['map'](_0x15c518=>({'id':_0x15c518['id'],'label':_0x15c518['label']}));return{'id':_0x5d2ec8,'menu':_0xb84e63||_0x5d2ec8,'children':_0x35dd61};});}(_0x466386),{'ariaLabel':i(_0x29f878,'AI\x20Commands')}),_0x3fcc67['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x14cd0b['on']('change:enabledCommandsIds',_0x53b476),_0x3fcc67['menuView']['once']('render',_0x53b476),_0x3fcc67;function _0x53b476(){_0x3fcc67['isEnabled']=_0x14cd0b['enabledCommandsIds']['length']>0x0;for(const _0x22b999 of _0x3fcc67['menuView']['buttons'])_0x22b999['isEnabled']=_0x14cd0b['enabledCommandsIds']['includes'](_0x22b999['id']);}}),_0x466386['ui']['componentFactory']['add']('menuBar:aiCommands',_0x50fb94=>{const _0xa6c704=new _0x2c51f0(_0x50fb94);_0xa6c704['buttonView']['set']({'label':i(_0x50fb94,'AI\x20Commands'),'icon':_0x2380a6}),_0xa6c704['bind']('isEnabled')['to'](_0x14cd0b,'enabledCommandsIds',_0x575e6=>_0x575e6['length']>0x0);const _0x5e3183=o(_0x466386['config']['get']('ai.aiAssistant.commands'),_0x50fb94);return this['_populateMenuBarMenu'](_0x14cd0b,_0xa6c704,_0x5e3183,_0x11bf23=>this['_onExecute'](_0x11bf23)),_0xa6c704;}),_0x466386['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4d70a0=this['_createAIAssistantUIButton'](_0x26e4f0);return _0x4d70a0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4d70a0;}),_0x466386['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x38be26=this['_createAIAssistantUIButton'](_0x4b8772);return _0x38be26['set']({'role':'menuitemcheckbox'}),_0x38be26;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x203cb2=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x43467f;for(const _0x128f10 in _0x203cb2){const _0x463d6a=_0x128f10,_0x3cc568=_0x203cb2[_0x463d6a];if('aiLicenseKeyValid'==_0x3cc568||'aiLicenseKeyInvalid'==_0x3cc568||'aiLicenseKeyExpired'==_0x3cc568||'aiLicenseKeyDomainLimit'==_0x3cc568||'aiLicenseKeyNotAllowed'==_0x3cc568||'aiLicenseKeyEvaluationLimit'==_0x3cc568||'aiLicenseKeyTrialLimit'==_0x3cc568||'aiLicenseKeyUsageLimit'==_0x3cc568){delete _0x203cb2[_0x463d6a],_0x43467f=_0x3cc568,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x43467f&&_0x203cb2['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x43467f&&_0x203cb2['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x43467f&&_0x203cb2['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x70dc1f='',_0x269f61='',_0x442fad='custom'){const _0x53c1b6=this['editor'],_0x3b4d93=_0x53c1b6['editing']['view'],_0x4ef457=_0x53c1b6['plugins']['get'](a),_0x16352f=_0x53c1b6['plugins']['get'](_0x324d39);_0x4ef457['showFakeVisualSelection']();const _0x44d642=new l(),_0x549797=new ClipboardEvent('copy',{'clipboardData':_0x44d642}),_0x27ba92=new _0x2e0788(_0x44d642),_0x38fb5b=new _0x565093(_0x3b4d93,_0x549797,{'dataTransfer':_0x27ba92});_0x16352f['_forceMarkersCopy']('comment',()=>{_0x3b4d93['document']['fire']('copy',_0x38fb5b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x53c1b6,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x245da0=_0x27ba92['getData']('text/html');const _0x14e1d0=_0x53c1b6['model']['document']['selection'],_0x17f268=Array['from'](_0x14e1d0['getRanges']());0x1===_0x17f268['length']&&_0x17f268[0x0]['isFlat']&&!_0x14e1d0['getSelectedElement']()&&''!==_0x245da0['replace'](/&nbsp;/g,'')['trim']()&&(_0x245da0='<p>'+_0x245da0+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x442fad,'query':_0x70dc1f,'htmlContent':_0x245da0,'label':_0x269f61,'mainActionLabel':_[_0x53c1b6['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2d8fe9,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x52abdf['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4ef457['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x11648d=new Map(),_0x1cc9da=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3d004b of _0x1cc9da)for(const _0x2f2650 of _0x3d004b['commands'])_0x11648d['set'](_0x2f2650['id'],{..._0x2f2650,'groupId':_0x3d004b['groupId'],'groupLabel':_0x3d004b['groupLabel']||_0x3d004b['groupId']});return _0x11648d;}['_createAIAssistantUIButton'](_0x546be5){const _0xbd3e9e=this['editor'],_0xb6443c=_0xbd3e9e['commands']['get']('showAIAssistant'),_0x1dd4f3=new _0x546be5(_0xbd3e9e['locale']);return _0x1dd4f3['set']({'label':i(_0xbd3e9e['locale'],'AI\x20Assistant'),'icon':_0x2d8fe9,'isToggleable':!0x0}),_0x1dd4f3['bind']('isEnabled')['to'](_0xb6443c),_0x1dd4f3['bind']('isOn')['to'](this['_dialog'],'id',_0x33efa6=>'aiAssistant'===_0x33efa6),this['listenTo'](_0x1dd4f3,'execute',()=>{_0x1dd4f3['isOn']?this['hideUI']():_0xb6443c['execute']();}),_0x1dd4f3;}['_initView'](){const _0x2a29f9=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',()=>{_0x2a29f9['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2a29f9['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5bfec7,ui:{ariaLiveAnnouncer:_0x574245}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x57cb18,_0x1370f9,_0x391775)=>{const _0x3ac406=this['_aiAssistantController']['currentContext'];_0x391775?_0x574245['announce'](i(_0x5bfec7,'AI\x20is\x20writing')):_0x3ac406&&_0x574245['announce'](i(_0x5bfec7,'Generated\x20content:\x20%0',_0x3ac406),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5a59d7,_0x385244,_0x2a2bd1)=>{if(_0x2a2bd1){const _0x564abd=this['_formView']['errorView']['text'];_0x574245['announce'](i(_0x5bfec7,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x564abd));}});}['_onExecute'](_0x2c3847){const _0x5b4cef=this['_commandDefinitions']['get'](_0x2c3847),_0x119bc4=this['editor'],_0x2fd200=_0x119bc4['model']['document']['selection'],_0x53b646=_0x119bc4['commands']['get']('showAIAssistant'),_0x5a2bca=_0x119bc4['plugins']['get'](a),_0x384599=''+(_0x5b4cef['groupId']!==K?_0x5b4cef['groupLabel']+':\x20':'')+_0x5b4cef['label'];if(!0x1!==_0x5b4cef['requiresContent']&&_0x2fd200['isCollapsed']){const _0x1999fb=_0x34c6dc(_0x2fd200['getSelectedBlocks']())||_0x119bc4['model']['schema']['getLimitElement'](_0x2fd200);_0x119bc4['model']['change'](_0x5ea379=>{_0x5ea379['setSelection'](_0x1999fb,'in');});}_0x5a2bca['showFakeVisualSelection'](),_0x53b646['execute'](_0x5b4cef['prompt'],_0x384599,'command:'+_0x2c3847);}['_populateMenuBarMenu'](_0x684b59,_0x39954a,_0xae1328,_0x21177f){const _0x2125da=this['editor'],_0x2d9067=_0x2125da['locale'],_0x2e826b=new _0x5255c6(_0x2d9067),_0x3fd722=U(_0x2125da,_0xae1328)['filter'](_0x2fa57a=>_0x2fa57a['commands']['length']);0x1===_0x3fd722['length']?this['_getMenuBarGroupButtons']({'command':_0x684b59,'commands':_0x3fd722[0x0]['commands'],'parentMenuView':_0x39954a,'onExecute':_0x21177f})['forEach'](_0x427571=>_0x2e826b['items']['add'](_0x427571)):_0x3fd722['forEach'](({groupId:_0xd96408,groupLabel:_0x6c3412,commands:_0x4c62c8})=>{const _0x16f138=new _0x20f208(_0x2d9067,_0x39954a),_0x2fd5a0=new _0x2c51f0(_0x2d9067),_0xcd7c6b=new _0x5255c6(_0x2d9067),_0x1fde1c=this['_getMenuBarGroupButtons']({'command':_0x684b59,'commands':_0x4c62c8,'parentMenuView':_0x2fd5a0,'onExecute':_0x21177f});_0x2fd5a0['buttonView']['set']({'label':_0x6c3412||_0xd96408}),_0x2fd5a0['delegate']('execute')['to'](_0x39954a),_0xcd7c6b['items']['addMany'](_0x1fde1c),_0x2fd5a0['panelView']['children']['add'](_0xcd7c6b),_0x16f138['children']['add'](_0x2fd5a0),_0x2e826b['items']['add'](_0x16f138);}),_0x39954a['panelView']['children']['add'](_0x2e826b);}['_getMenuBarGroupButtons']({command:_0x52fc28,commands:_0x52650d,parentMenuView:_0x417b04,onExecute:_0x91eb79}){const _0x422833=this['editor'],_0x55087c=_0x422833['locale'];return U(_0x422833,_0x52650d)['map'](_0x320a17=>{const _0x450467=new _0x20f208(_0x55087c,_0x417b04),_0x23bc1a=new _0x4b8772(_0x55087c);return _0x23bc1a['set']({'label':_0x320a17['label']}),_0x23bc1a['delegate']('execute')['to'](_0x417b04),_0x23bc1a['on']('execute',()=>_0x91eb79(_0x320a17['id'])),_0x23bc1a['bind']('isEnabled')['to'](_0x52fc28,'enabledCommandsIds',_0x25ce52=>_0x25ce52['includes'](_0x320a17['id'])),_0x450467['children']['add'](_0x23bc1a),_0x450467;});}}function T(_0x5eff33,_0x3e979b){return void 0x0!==_0x5eff33['order']&&void 0x0===_0x3e979b['order']?0x1:void 0x0===_0x5eff33['order']&&void 0x0!==_0x3e979b['order']?-0x1:void 0x0!==_0x5eff33['order']&&void 0x0!==_0x3e979b['order']?_0x5eff33['order']-_0x3e979b['order']:0x0;}function U(_0x6cee38,_0x3c2b23){_0x3c2b23['sort'](T);const _0xc30e9a={},_0x241717=[];for(const _0x4be3d9 of _0x3c2b23)if(void 0x0!==_0x4be3d9['order']){if(_0x4be3d9['order']in _0xc30e9a)throw new _0x5038d9('ai-commands-config-order-collision',_0x6cee38,{'conflictingDefinitions':[_0x4be3d9,_0xc30e9a[_0x4be3d9['order']]]});_0xc30e9a[_0x4be3d9['order']]=_0x4be3d9,_0x241717['splice'](_0x4be3d9['order'],0x0,_0x4be3d9);}else _0x241717['push'](_0x4be3d9);return _0x241717;}class At extends _0x2d1d32{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x237821){super(_0x237821);const _0x274b38=_0x237821['config'],_0x2f6e04=_0x237821['locale'];_0x274b38['define']('ai.aiAssistant.preserveComments',!0x0),_0x274b38['define']('ai.aiAssistant.commands',_t(_0x2f6e04)),_0x274b38['define']('ai.aiAssistant.extraCommandGroups',[]),_0x274b38['define']('ai.aiAssistant.removeCommands',[]);let _0x50270d=o(_0x274b38['get']('ai.aiAssistant.commands'),_0x2f6e04);const _0x35288d=_0x274b38['get']('ai.aiAssistant.extraCommandGroups'),_0x47f419=_0x274b38['get']('ai.aiAssistant.removeCommands');_0x35288d['forEach'](_0x13a45b=>{const _0x4c3b7e=_0x50270d['find'](_0x5f2756=>_0x5f2756['groupId']===_0x13a45b['groupId']);_0x4c3b7e?_0x4c3b7e['commands']=_0x4c3b7e['commands']['concat'](_0x13a45b['commands']):_0x50270d['push'](_0x13a45b);}),_0x50270d=_0x50270d['filter'](_0xaa837e=>!_0x47f419['includes'](_0xaa837e['groupId'])),_0x50270d['forEach'](_0x2d4898=>{_0x2d4898['commands']=_0x2d4898['commands']['filter'](_0x14769c=>!_0x47f419['includes'](_0x14769c['id']));}),_0x274b38['set']('ai.aiAssistant.commands',_0x50270d);}}function _t(_0x18d4f7){return[{'groupId':'editOrReview','groupLabel':i(_0x18d4f7,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x18d4f7,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x18d4f7,'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(_0x18d4f7,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x18d4f7,'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(_0x18d4f7,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x18d4f7,'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(_0x18d4f7,'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(_0x18d4f7,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x18d4f7,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x18d4f7,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x18d4f7,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x18d4f7,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x18d4f7,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x18d4f7,'Change\x20style'),'commands':[{'id':'business','label':i(_0x18d4f7,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x18d4f7,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x18d4f7,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x18d4f7,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x18d4f7,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x18d4f7,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x18d4f7,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x18d4f7,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x18d4f7,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x18d4f7,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x18d4f7,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x18d4f7,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x18d4f7,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x2d1d32{['abortController'];static get['requires'](){return[x];}constructor(_0xcc9321){super(_0xcc9321),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1c6185){return this['sendRequest'](_0x1c6185)['catch'](_0x4c3927=>{if(_0x4c3927 instanceof R)return Promise['reject'](_0x4c3927);if('AbortError'==_0x4c3927['name'])return Promise['resolve']();throw console['error'](_0x4c3927),new _0x5038d9('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1c248d,_0x239056){const _0x39d172=this['editor']['locale'],_0x510dad={'Content-Type':'application/json'};if('object'==typeof _0x1c248d)Object['assign'](_0x510dad,_0x1c248d);else{if(_0x1c248d)try{const _0xa1db3d=await _0x1c248d(_0x239056);Object['assign'](_0x510dad,_0xa1db3d);}catch{return Promise['reject'](new R(i(_0x39d172,'AI_ERROR_GET_HEADERS')));}}return _0x510dad;}async['_prepareRequestParameters'](_0x45e471,_0x24be91){const _0x44ad12=this['editor']['locale'];if('object'==typeof _0x45e471)return _0x45e471;try{return await _0x45e471(_0x24be91);}catch{return Promise['reject'](new R(i(_0x44ad12,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x45bab7){super(_0x45bab7),_0x45bab7['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x45bab7['config']['get']('ai.openAI.requestParameters')||_0x45bab7['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x45bab7['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x45bab7['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x45bab7['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x2bdf14,context:_0x2d9d8d,onData:_0x2fca13,actionId:_0xf4e260}){const _0x468b9d=this['editor']['locale'],_0x478a9a=await this['prepareMessages'](_0x2bdf14,_0x2d9d8d,_0xf4e260),_0x4da1c7=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xf4e260),_0x486837=await this['_prepareRequestParameters'](this['_requestParameters'],_0xf4e260),_0x286e53={'messages':_0x478a9a,..._0x486837},_0x54c989={'method':'POST','headers':_0x4da1c7,'body':JSON['stringify'](_0x286e53),'signal':this['abortController']['signal']},_0x10a1db=await fetch(this['_apiUrl'],_0x54c989);if(_0x10a1db['ok'])return _0x486837['stream']?await this['_readStreamableResponse'](_0x10a1db,_0x2fca13):await this['_readStaticResponse'](_0x10a1db,_0x2fca13),Promise['resolve']();{const _0x69fe2b=await _0x10a1db['text']();return _0x69fe2b['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x468b9d,'AI_ERROR_CONTEXT_LENGTH'))):_0x69fe2b['includes']('Moderation')?Promise['reject'](new R(i(_0x468b9d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x69fe2b));}}async['prepareMessages'](_0xf7c261,_0x3514b2,_0x1ec362){let _0x5c8e08,_0x26e6c1;return _0x3514b2?(_0x5c8e08='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.',_0x26e6c1='Instruction:\x0a'+_0xf7c261+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3514b2):(_0x5c8e08='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.',_0x26e6c1=_0xf7c261),[{'role':'system','content':_0x5c8e08},{'role':'user','content':_0x26e6c1}];}async['_readStreamableResponse'](_0x1faf2e,_0x54e60b){const _0x82a8c2=_0x1faf2e['body']['getReader'](),_0x68e0f3=new TextDecoder();let _0x57c63e='',_0x5e65a='',_0xffaa6a='',_0x4f53fd=!0x1;for(;!_0x4f53fd;){const {done:_0x40f10e,value:_0x30b109}=await _0x82a8c2['read'](),_0x538183=_0x57c63e+_0x68e0f3['decode'](_0x30b109);let _0x3c3a55='';_0x4f53fd=_0x40f10e;try{_0x3c3a55=this['_cleanUpData'](_0x538183),_0x57c63e='';}catch{_0x57c63e=_0x538183;continue;}_0x5e65a+=_0x3c3a55,!_0x4f53fd&&this['_isBufferIncomplete'](_0x5e65a)||_0x5e65a&&(_0xffaa6a+=_0x5e65a,_0x5e65a='',_0x54e60b(_0xffaa6a));}return Promise['resolve']();}async['_readStaticResponse'](_0x280c0e,_0x5c744e){return _0x5c744e((await _0x280c0e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x248566){const _0x335c8f=_0x248566['split']('<')['length']!==_0x248566['split']('>')['length'],_0xa89b07=_0x248566['length']<0x1e;return _0x335c8f&&_0xa89b07;}['_cleanUpData'](_0xcd962c){return _0xcd962c['split'](/\n(?![^{]*\})/g)['map'](_0x27d1e8=>_0x27d1e8['replace']('data:\x20',''))['filter'](_0x1fdf23=>_0x1fdf23&&_0x1fdf23['length']>0x0&&'[DONE]'!==_0x1fdf23)['map'](_0xb0580e=>{const {choices:_0x27b8e0}=JSON['parse'](_0xb0580e);if(_0x27b8e0[0x0]?.['delta']?.['content'])return _0x27b8e0[0x0]['delta']['content'];})['filter'](_0x39dc82=>_0x39dc82)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1fd5df){super(_0x1fd5df),_0x1fd5df['config']['get']('ai.aws.requestParameters')||_0x1fd5df['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']=_0x1fd5df['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1fd5df['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1fd5df['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1fd5df['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2bbe49,context:_0x5e79f5,onData:_0x26b728,actionId:_0x55cf55}){const {model:_0x435ff8,stream:_0x1f8bc4,..._0x16e803}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x55cf55),_0x603392={'prompt':await this['preparePrompt'](_0x2bbe49,_0x5e79f5,_0x435ff8,_0x55cf55),..._0x16e803};this['_apiUrl']?await this['_processProxyRequest'](_0x603392,_0x435ff8,_0x1f8bc4,_0x26b728,_0x55cf55):await this['_processAWSRequest'](_0x603392,_0x435ff8,_0x1f8bc4,_0x26b728);}async['preparePrompt'](_0x385fd8,_0x462924,_0x501c65,_0x291fde){let _0x3eded1,_0x46c7a2;return _0x462924?(_0x3eded1='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.',_0x46c7a2='Instruction:\x0a'+_0x385fd8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x462924):(_0x3eded1='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.',_0x46c7a2=_0x385fd8),'meta.llama'==this['getModelFamily'](_0x501c65)?'<<SYS>>\x0a'+_0x3eded1+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x46c7a2+'\x0a[/INST]':'Human:\x0a'+_0x3eded1+'\x0a'+_0x46c7a2+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3474f1){if(/^anthropic\.claude/['test'](_0x3474f1))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3474f1))return'ai21.j2';if(/^cohere\.command/['test'](_0x3474f1))return'cohere.command';if(/^meta\.llama/['test'](_0x3474f1))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3474f1));}async['_processProxyRequest'](_0x50d8e0,_0x39c056,_0x559b99,_0x2ddf76,_0x5ee426){const _0x4a2e7c={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5ee426),'body':JSON['stringify']({..._0x50d8e0,'model':_0x39c056,'stream':_0x559b99}),'signal':this['abortController']['signal']},_0x837dc7=await fetch(this['_apiUrl'],_0x4a2e7c);_0x559b99?await this['_readStreamableResponse'](_0x837dc7,_0x39c056,_0x2ddf76):await this['_readStaticResponse'](_0x837dc7,_0x39c056,_0x2ddf76);}async['_processAWSRequest'](_0x2b28dc,_0x15f7a6,_0x57a9d1,_0x24fdb9){const _0x501dc7=new _0x5f2ebf(this['_bedrockClientConfig']),_0x58de46={'body':JSON['stringify'](_0x2b28dc),'contentType':'application/json','accept':'application/json','modelId':_0x15f7a6};let _0x305dbf;if(_0x57a9d1){const _0x57961a=new _0x46d9e4(_0x58de46);_0x305dbf=await _0x501dc7['send'](_0x57961a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x305dbf,_0x15f7a6,_0x24fdb9);}else{const _0x485420=new _0xcfc9f2(_0x58de46);_0x305dbf=await _0x501dc7['send'](_0x485420,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x305dbf,_0x15f7a6,_0x24fdb9);}}async['_readAsyncIterableResponse'](_0x4bc629,_0x3e678c,_0xf358a4){const _0x2c7a74=_0x4bc629['body'],_0x28f2e4=new TextDecoder('utf-8');let _0x499352='';for await(const _0xfad7fa of _0x2c7a74)if(_0xfad7fa['chunk']){const _0x7efff9=_0x28f2e4['decode'](_0xfad7fa['chunk']['bytes']),_0x167d20=JSON['parse'](_0x7efff9);_0x499352+=this['_getGeneratedText'](_0x167d20,_0x3e678c),_0xf358a4(_0x499352);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2cafc2,_0xb9d0e7,_0x284fd3){const _0x4768d2=_0x2cafc2['body'],_0x7338c2=new TextDecoder('utf-8'),_0x4b987b=_0x4768d2['getReader']();let _0x24dd7c='',_0x4092d4='',_0xf44aa2=!0x1;for(;!_0xf44aa2;){const {done:_0x222c22,value:_0x493419}=await _0x4b987b['read']();if(_0xf44aa2=_0x222c22,_0xf44aa2)break;const _0x31200c=(_0x24dd7c+_0x7338c2['decode'](_0x493419))['split']('\x0a')['map'](_0x39c474=>{try{return _0x24dd7c='',JSON['parse'](_0x39c474);}catch{return _0x24dd7c=_0x39c474,null;}})['filter'](_0x3dfcdc=>null!==_0x3dfcdc);_0x31200c['length']&&(_0x4092d4+=_0x31200c['map'](_0x43bb60=>this['_getGeneratedText'](_0x43bb60,_0xb9d0e7))['join'](''),_0x284fd3(_0x4092d4));}return Promise['resolve']();}async['_readStaticResponse'](_0x70a69d,_0x48aace,_0x42506d){let _0x45a464;return _0x45a464=_0x70a69d instanceof Response?await _0x70a69d['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x70a69d['body'])),(_0x42506d(this['_getGeneratedText'](_0x45a464,_0x48aace)),Promise['resolve']());}['_getGeneratedText'](_0x34e22d,_0x1972b0){switch(this['getModelFamily'](_0x1972b0)){case'anthropic.claude':return _0x34e22d['completion'];case'ai21.j2':return _0x34e22d['completions'][0x0]['data']['text'];case'cohere.command':return _0x34e22d['generations'][0x0]['text'];case'meta.llama':return _0x34e22d['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
@@ -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':_0x475087=>0x1!=_0x475087}};
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':_0x13db76=>0x1!=_0x13db76}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x23e797=>{const {af:{dictionary:_0x42e63d,getPluralForm:_0x31ec0c}}={'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':_0x384741=>0x1!=_0x384741}};_0x23e797['af']||={'dictionary':{},'getPluralForm':null},_0x23e797['af']['dictionary']=Object['assign'](_0x23e797['af']['dictionary'],_0x42e63d),_0x23e797['af']['getPluralForm']=_0x31ec0c;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0xf87ddc=>{const {af:{dictionary:_0x493cb7,getPluralForm:_0x334d8d}}={'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':_0x292dec=>0x1!=_0x292dec}};_0xf87ddc['af']||={'dictionary':{},'getPluralForm':null},_0xf87ddc['af']['dictionary']=Object['assign'](_0xf87ddc['af']['dictionary'],_0x493cb7),_0xf87ddc['af']['getPluralForm']=_0x334d8d;})(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':_0x275374=>0x0==_0x275374?0x0:0x1==_0x275374?0x1:0x2==_0x275374?0x2:_0x275374%0x64>=0x3&&_0x275374%0x64<=0xa?0x3:_0x275374%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':_0x540940=>0x0==_0x540940?0x0:0x1==_0x540940?0x1:0x2==_0x540940?0x2:_0x540940%0x64>=0x3&&_0x540940%0x64<=0xa?0x3:_0x540940%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x25e6e7=>{const {ar:{dictionary:_0x2e506a,getPluralForm:_0x404820}}={'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':_0xf161da=>0x0==_0xf161da?0x0:0x1==_0xf161da?0x1:0x2==_0xf161da?0x2:_0xf161da%0x64>=0x3&&_0xf161da%0x64<=0xa?0x3:_0xf161da%0x64>=0xb?0x4:0x5}};_0x25e6e7['ar']||={'dictionary':{},'getPluralForm':null},_0x25e6e7['ar']['dictionary']=Object['assign'](_0x25e6e7['ar']['dictionary'],_0x2e506a),_0x25e6e7['ar']['getPluralForm']=_0x404820;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x39d815=>{const {ar:{dictionary:_0x464dbe,getPluralForm:_0x1cb6dd}}={'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':_0x289fc3=>0x0==_0x289fc3?0x0:0x1==_0x289fc3?0x1:0x2==_0x289fc3?0x2:_0x289fc3%0x64>=0x3&&_0x289fc3%0x64<=0xa?0x3:_0x289fc3%0x64>=0xb?0x4:0x5}};_0x39d815['ar']||={'dictionary':{},'getPluralForm':null},_0x39d815['ar']['dictionary']=Object['assign'](_0x39d815['ar']['dictionary'],_0x464dbe),_0x39d815['ar']['getPluralForm']=_0x1cb6dd;})(window['CKEDITOR_TRANSLATIONS']||={});