@ckeditor/ckeditor5-ai 44.0.0-alpha.1 → 44.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +8 -8
  148. package/src/adapters/aiadapter.js +1 -1
  149. package/src/adapters/aitextadapter.js +1 -1
  150. package/src/adapters/awstextadapter.js +1 -1
  151. package/src/adapters/openaitextadapter.js +1 -1
  152. package/src/aiassistant.js +1 -1
  153. package/src/aiassistantediting.js +1 -1
  154. package/src/aiassistantui.js +1 -1
  155. package/src/index.js +1 -1
  156. package/src/legacyerrors.js +1 -1
  157. package/src/ui/aiassistantcontroller.js +2 -2
  158. package/src/ui/form/aiformcontentarea.js +1 -1
  159. package/src/ui/form/aiformerrorview.js +1 -1
  160. package/src/ui/form/aiformpromptview.js +1 -1
  161. package/src/ui/form/aiformtoolbarview.js +1 -1
  162. package/src/ui/form/aiformview.js +1 -1
  163. package/src/ui/form/aihistorylistitemview.js +1 -1
  164. package/src/ui/form/aihistorylistview.js +1 -1
  165. package/src/ui/form/prompthistory.js +1 -1
  166. package/src/ui/showaiassistantcommand.js +1 -1
  167. package/src/utils/common-translations.js +1 -1
  168. package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x1589f7,Command as _0x24eb69,icons as _0x57f809}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x291c2c,CKEditorError as _0x202889,ObservableMixin as _0x1b194d,global as _0x5a217f,isVisible as it,Rect as st,Collection as _0x47e0b3,FocusTracker as _0x4dee7f,KeystrokeHandler as ts,first as _0x37aee8}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x680237,View as _0x386174,SpinnerView as _0x5bba5b,IconView as _0x13dca1,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0xd7cd21,ButtonLabelView as te,FocusCycler as _0x57dd9a,createLabeledTextarea as _0x2db5eb,Dialog as _0x485adb,createDropdown as _0x360436,addMenuToDropdown as _0x2a4bd6,MenuBarMenuView as _0x1f9b8f,MenuBarMenuListItemButtonView as _0x4e1c06,DialogViewPosition as _0x2e9f74,MenuBarMenuListView as _0x4c367d,MenuBarMenuListItemView as _0x531165}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x6c2573,Matcher as _0x52ce6c,DataTransfer as _0x4dc07d,DomEventData as _0x37f926}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3e7c5a,escape as _0xf1175d}from'lodash-es';import{ClipboardMarkersUtils as _0x3fe6fd}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x1f7bf8,InvokeModelWithResponseStreamCommand as _0xe406ba,InvokeModelCommand as _0x5aa466}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x1a5df1,_0x53121d){const _0x5281b1=(0x0,_0x53121d['t'])('Other');return _0x1a5df1['length']?'groupId'in _0x1a5df1[0x0]?_0x1a5df1:[{'groupId':I,'groupLabel':_0x5281b1,'order':0x1/0x0,'commands':_0x1a5df1}]:[{'groupId':I,'groupLabel':_0x5281b1,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x1589f7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2e82c3}=this,_0x412252=['ck-fake-ai-selection'];_0x2e82c3['config']['get']('ai.useTheme')&&_0x412252['push']('ck-ai-assistant-ui_theme'),_0x2e82c3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x412252,'priority':0xc}}),_0x2e82c3['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x426dd9,{writer:_0x79e095})=>{if(!_0x426dd9['markerRange']['isCollapsed'])return null;const _0x5b7e88=_0x79e095['createUIElement']('span');return _0x79e095['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5b7e88),_0x5b7e88;}});}['afterInit'](){!async function(_0x1d14de){const _0x192422=_0x683c6e([0x54,0x77,0x63,0x53,0x50,0x78,0x5a,0x4f,0x74,0x4c,0x75,0x4d,0x51,0x4e,0x35,0x4a,0x66,0x31,0x41,0x73,0x64,0x62,0x45,0x71,0x38,0x49,0x34,0x69,0x57,0x58,0x46,0x55,0x32,0x6a,0x43,0x48,0x7a,0x61,0x6f,0x6e,0x65,0x70,0x36,0x79,0x4b,0x47,0x39,0x37,0x56,0x72,0x76,0x42,0x30,0x6d,0x6c,0x44,0x67,0x52,0x59,0x68,0x33,0x6b]),_0x5387ba=0x7b369391,_0x1f6847=0x7b31c411^_0x5387ba,_0x454b4b=window[_0x683c6e([0x44,0x61,0x74,0x65])][_0x683c6e([0x6e,0x6f,0x77])](),_0x5d863c=_0x1d14de[_0x683c6e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x500896=new window[(_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xc371cb=>{_0x5d863c[_0x683c6e([0x6f,0x6e,0x63,0x65])](_0x683c6e([0x72,0x65,0x61,0x64,0x79]),_0xc371cb);}),_0x30acc9={[_0x683c6e([0x6b,0x74,0x79])]:_0x683c6e([0x45,0x43]),[_0x683c6e([0x75,0x73,0x65])]:_0x683c6e([0x73,0x69,0x67]),[_0x683c6e([0x63,0x72,0x76])]:_0x683c6e([0x50,0x2d,0x32,0x35,0x36]),[_0x683c6e([0x78])]:_0x683c6e([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]),[_0x683c6e([0x79])]:_0x683c6e([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]),[_0x683c6e([0x61,0x6c,0x67])]:_0x683c6e([0x45,0x53,0x32,0x35,0x36])},_0x404d2f=_0x5d863c[_0x683c6e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x683c6e([0x67,0x65,0x74])](_0x683c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x52856b(){let _0x35b49c,_0x15d627=null,_0x324838=null;try{if(_0x404d2f==_0x683c6e([0x47,0x50,0x4c]))return _0x683c6e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x35b49c=_0x260262(),!_0x35b49c)return _0x683c6e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x35b49c[_0x683c6e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x324838=_0x4eadd2(_0x35b49c[_0x683c6e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x35b49c[_0x683c6e([0x6a,0x74,0x69])])),await _0x4a3ec3()?_0x1a488e()?_0x169e35()?_0x683c6e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x8639ba()?(_0x35b49c[_0x683c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x683c6e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x15d627=_0x359043(_0x683c6e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x35b49c[_0x683c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x683c6e([0x74,0x72,0x69,0x61,0x6c])&&(_0x15d627=_0x359043(_0x683c6e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x35b49c[_0x683c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x683c6e([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x15d627=_0x359043(_0x683c6e([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x287fe9()):_0x683c6e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x683c6e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x683c6e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x39e71d){return _0x683c6e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x169e35(){const _0x1e8b9f=[_0x683c6e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x683c6e([0x74,0x72,0x69,0x61,0x6c])][_0x683c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35b49c[_0x683c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x454b4b/0x3e8:0xe10*_0x1f6847;return _0x35b49c[_0x683c6e([0x65,0x78,0x70])]<_0x1e8b9f;}function _0x1a488e(){const _0x45055e=_0x35b49c[_0x683c6e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x45055e&&(!!_0x45055e[_0x683c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x683c6e([0x2a]))||!!_0x45055e[_0x683c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x683c6e([0x41,0x49])));}function _0x8639ba(){const _0x8abf=_0x35b49c[_0x683c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x8abf||0x0==_0x8abf[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4e7431}=new URL(window[_0x683c6e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x8abf[_0x683c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4e7431))return!0x0;const _0x2ee05d=_0x4e7431[_0x683c6e([0x73,0x70,0x6c,0x69,0x74])](_0x683c6e([0x2e]));return _0x8abf[_0x683c6e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x365911=>_0x365911[_0x683c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x683c6e([0x2a])))[_0x683c6e([0x6d,0x61,0x70])](_0x510285=>_0x510285[_0x683c6e([0x73,0x70,0x6c,0x69,0x74])](_0x683c6e([0x2e])))[_0x683c6e([0x73,0x6f,0x6d,0x65])](_0x174bc3=>_0x2ee05d[_0x683c6e([0x65,0x76,0x65,0x72,0x79])]((_0x1adda2,_0x3c90ad)=>_0x174bc3[_0x3c90ad]===_0x1adda2||_0x174bc3[_0x3c90ad]===_0x683c6e([0x2a])));}function _0x287fe9(){return _0x15d627&&_0x324838?new window[(_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3a7a17,_0x766d58)=>{_0x15d627[_0x683c6e([0x74,0x68,0x65,0x6e])](_0x3a7a17,_0x766d58),_0x324838[_0x683c6e([0x74,0x68,0x65,0x6e])](_0x339bea=>{_0x339bea!=_0x683c6e([0x56,0x61,0x6c,0x69,0x64])&&_0x3a7a17(_0x339bea);},_0x766d58);}):_0x15d627||_0x324838||_0x683c6e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4eadd2(_0x14668c,_0x470826){return new window[(_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b0572=>{if(_0x1421d8())return _0x3b0572(_0x683c6e([0x56,0x61,0x6c,0x69,0x64]));_0x327256(),_0x5d863c[_0x683c6e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x683c6e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5149ad=!0x1;const _0x302e09=_0x291c2c();function _0x3a1112(_0x409b9c){return!!_0x409b9c&&(typeof _0x409b9c===_0x683c6e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x409b9c===_0x683c6e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x409b9c[_0x683c6e([0x74,0x68,0x65,0x6e])]===_0x683c6e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x409b9c[_0x683c6e([0x63,0x61,0x74,0x63,0x68])]===_0x683c6e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0xd72484(_0x47a54a){_0x2c59fd(_0x47a54a)[_0x683c6e([0x74,0x68,0x65,0x6e])](_0x550d67=>{if(!_0x550d67||_0x550d67[_0x683c6e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x683c6e([0x6f,0x6b]))return _0x683c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1e9b38(_0x4ab52d(_0x302e09+_0x470826))!=_0x550d67[_0x683c6e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x683c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x683c6e([0x56,0x61,0x6c,0x69,0x64]);})[_0x683c6e([0x74,0x68,0x65,0x6e])](_0x5a4985=>(_0x27ce28(),_0x5a4985),()=>{const _0x86ffbb=_0x1dfcf6();return null==_0x86ffbb?(_0x27ce28(),_0x683c6e([0x56,0x61,0x6c,0x69,0x64])):_0x683c6e(_0x454b4b-_0x86ffbb>(0x5f3a1791^_0x5387ba)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x683c6e([0x74,0x68,0x65,0x6e])](_0x3b0572)[_0x683c6e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3b0572(_0x683c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x20f713=0x7b007d11^_0x5387ba;function _0x27ce28(){const _0x5685f1=_0x683c6e([0x6c,0x6c,0x63,0x74,0x2d])+_0x1e9b38(_0x4ab52d(_0x14668c)),_0x1b5b14=_0x2c3e9a(_0x1e9b38(window[_0x683c6e([0x4d,0x61,0x74,0x68])][_0x683c6e([0x63,0x65,0x69,0x6c])](_0x454b4b/_0x20f713)));window[_0x683c6e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x683c6e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5685f1,_0x1b5b14);}function _0x1dfcf6(){const _0x3d5352=_0x683c6e([0x6c,0x6c,0x63,0x74,0x2d])+_0x1e9b38(_0x4ab52d(_0x14668c)),_0x54bdc0=window[_0x683c6e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x683c6e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3d5352);return _0x54bdc0?window[_0x683c6e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c3e9a(_0x54bdc0),0x10)*_0x20f713:null;}function _0x2c59fd(_0x62b6e6){return new window[(_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4762a7,_0x36ca0c)=>{_0x62b6e6[_0x683c6e([0x74,0x68,0x65,0x6e])](_0x4762a7,_0x36ca0c),window[_0x683c6e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x36ca0c,0x7b374751^_0x5387ba);});}}_0x5d863c[_0x683c6e([0x6f,0x6e])](_0x683c6e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x50d6cf,_0xad001c)=>{if(_0xad001c[0x0]!=_0x14668c)return _0x3b0572(_0x683c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xad001c[0x1]={..._0xad001c[0x1],[_0x683c6e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x302e09};},{[_0x683c6e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x683c6e([0x68,0x69,0x67,0x68])}),_0x5d863c[_0x683c6e([0x6f,0x6e])](_0x683c6e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3f5409=>{_0x3a1112(_0x3f5409[_0x683c6e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5149ad=!0x0,_0xd72484(_0x3f5409[_0x683c6e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x683c6e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x683c6e([0x6c,0x6f,0x77])}),_0x500896[_0x683c6e([0x74,0x68,0x65,0x6e])](()=>{_0x5149ad||_0x3b0572(_0x683c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1421d8(){return _0x5d863c[_0x683c6e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x683c6e([0x76,0x69,0x65,0x77])][_0x683c6e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x683c6e([0x61,0x75,0x74,0x6f]);}function _0x327256(){_0x5d863c[_0x683c6e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x683c6e([0x76,0x69,0x65,0x77])][_0x683c6e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x683c6e([0x61,0x75,0x74,0x6f]);}}function _0x359043(_0x518365){const _0x526bc2=[new window[(_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b5bc7=>setTimeout(_0x2b5bc7,0x7b3fad5d^_0x5387ba)),_0x500896[_0x683c6e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x41f785=>{let _0x42f83b=0x0;_0x5d863c[_0x683c6e([0x6d,0x6f,0x64,0x65,0x6c])][_0x683c6e([0x6f,0x6e])](_0x683c6e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x29673f,_0x35b833)=>{_0x35b833[0x0][_0x683c6e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x42f83b++,_0x42f83b==(0x7b369269^_0x5387ba)&&(_0x41f785(),_0x29673f[_0x683c6e([0x6f,0x66,0x66])]());});}))];return window[_0x683c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x683c6e([0x72,0x61,0x63,0x65])](_0x526bc2)[_0x683c6e([0x74,0x68,0x65,0x6e])](()=>_0x518365);}async function _0x5ccf56(){await _0x500896,_0x5d863c[_0x683c6e([0x6d,0x6f,0x64,0x65,0x6c])][_0x683c6e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x45d1b5,_0x5d863c[_0x683c6e([0x6d,0x6f,0x64,0x65,0x6c])][_0x683c6e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x45d1b5,_0x5d863c[_0x683c6e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x683c6e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x24c9cf(_0x3ad8f7){const _0x1790cb=_0x237419();_0x5d863c[_0x1790cb]=_0x683c6e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3ad8f7,_0x3ad8f7!=_0x683c6e([0x56,0x61,0x6c,0x69,0x64])&&_0x5ccf56();}function _0x237419(){const _0x3a6575=window[_0x683c6e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x683c6e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x683c6e([0x6e,0x6f,0x77])]())[_0x683c6e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x683c6e([0x2e]),'');let _0x4152e5=_0x683c6e([0x54]);for(let _0xf7f661=0x0;_0xf7f661<_0x3a6575[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xf7f661+=0x2){let _0x6888ae=window[_0x683c6e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3a6575[_0x683c6e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xf7f661,_0xf7f661+0x2));_0x6888ae>=_0x192422[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x6888ae-=_0x192422[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4152e5+=_0x192422[_0x6888ae];}return _0x4152e5;}function _0x260262(){const _0x4ba474=_0x404d2f[_0x683c6e([0x73,0x70,0x6c,0x69,0x74])](_0x683c6e([0x2e]));if(0x3!=_0x4ba474[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x398127(_0x4ba474[0x1]);function _0x398127(_0xe1a5d8){const _0x3550c9=_0x3fb49d(_0xe1a5d8);return _0x3550c9&&_0x557f6f()?_0x3550c9:null;function _0x557f6f(){const _0x130d41=_0x3550c9[_0x683c6e([0x6a,0x74,0x69])],_0x4b2b54=window[_0x683c6e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x130d41[_0x683c6e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x130d41[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x50734b={..._0x3550c9,[_0x683c6e([0x6a,0x74,0x69])]:_0x130d41[_0x683c6e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x130d41[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x50734b[_0x683c6e([0x76,0x63])],_0x4ab52d(_0x50734b)==_0x4b2b54;}}}async function _0x4a3ec3(){let _0x236d6b=!0x0;try{const _0x5c62d9=_0x404d2f[_0x683c6e([0x73,0x70,0x6c,0x69,0x74])](_0x683c6e([0x2e])),[_0x2ba925,_0x4ca780,_0xa8c642]=_0x5c62d9;return _0x535946(_0x2ba925),await _0x4a284b(_0x2ba925,_0x4ca780,_0xa8c642),_0x236d6b;}catch(_0x3eb1c3){return!0x1;}function _0x535946(_0x5ca150){const _0x388afd=_0x3fb49d(_0x5ca150);_0x388afd&&_0x388afd[_0x683c6e([0x61,0x6c,0x67])]==_0x683c6e([0x45,0x53,0x32,0x35,0x36])||(_0x236d6b=!0x1);}async function _0x4a284b(_0x4ceed1,_0x225fb5,_0x4abff6){const _0x41f2bc=window[_0x683c6e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x683c6e([0x66,0x72,0x6f,0x6d])](_0x54dded(_0x4abff6),_0x111734=>_0x111734[_0x683c6e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x52f68e=new window[(_0x683c6e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x683c6e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4ceed1+_0x683c6e([0x2e])+_0x225fb5),_0x38a579=window[_0x683c6e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x683c6e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x38a579)return;const _0x4512f7=await _0x38a579[_0x683c6e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x683c6e([0x6a,0x77,0x6b]),_0x30acc9,{[_0x683c6e([0x6e,0x61,0x6d,0x65])]:_0x683c6e([0x45,0x43,0x44,0x53,0x41]),[_0x683c6e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x683c6e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x683c6e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x38a579[_0x683c6e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x683c6e([0x6e,0x61,0x6d,0x65])]:_0x683c6e([0x45,0x43,0x44,0x53,0x41]),[_0x683c6e([0x68,0x61,0x73,0x68])]:{[_0x683c6e([0x6e,0x61,0x6d,0x65])]:_0x683c6e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4512f7,_0x41f2bc,_0x52f68e)||(_0x236d6b=!0x1);}}function _0x3fb49d(_0x2eb85f){return _0x2eb85f[_0x683c6e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x683c6e([0x65,0x79]))?JSON[_0x683c6e([0x70,0x61,0x72,0x73,0x65])](_0x54dded(_0x2eb85f)):null;}function _0x54dded(_0xf890a4){return window[_0x683c6e([0x61,0x74,0x6f,0x62])](_0xf890a4[_0x683c6e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x683c6e([0x2b]))[_0x683c6e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x683c6e([0x2f])));}function _0x4ab52d(_0x31f605){let _0x5261fe=0x1505;function _0x4d6b7b(_0x4db49c){for(let _0x30578f=0x0;_0x30578f<_0x4db49c[_0x683c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x30578f++){const _0x1a9e63=_0x4db49c[_0x683c6e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x30578f);_0x5261fe=(_0x5261fe<<0x5)+_0x5261fe+_0x1a9e63,_0x5261fe&=_0x5261fe;}}function _0xebfc1b(_0x2fd066){Array[_0x683c6e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2fd066)?_0x2fd066[_0x683c6e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xebfc1b):_0x2fd066&&typeof _0x2fd066==_0x683c6e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x683c6e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2fd066)[_0x683c6e([0x73,0x6f,0x72,0x74])]()[_0x683c6e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3f0515,_0x293358])=>{_0x4d6b7b(_0x3f0515),_0xebfc1b(_0x293358);}):_0x4d6b7b(window[_0x683c6e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2fd066));}return _0xebfc1b(_0x31f605),_0x5261fe>>>0x0;}function _0x1e9b38(_0xe3c3ae){return _0xe3c3ae[_0x683c6e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x683c6e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x683c6e([0x30]));}function _0x2c3e9a(_0x406d65){return _0x406d65[_0x683c6e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x683c6e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x683c6e([0x6a,0x6f,0x69,0x6e])]('');}function _0x45d1b5(){}function _0x683c6e(_0x2f1d9d){return _0x2f1d9d['map'](_0x5a5298=>String['fromCharCode'](_0x5a5298))['join']('');}_0x24c9cf(await _0x52856b());}(this);}['showFakeVisualSelection'](){const _0x4a32b5=this['editor']['model'];_0x4a32b5['change'](_0x340ec2=>{const _0x5167c3=_0x4a32b5['document']['selection']['getFirstRange']();if(_0x4a32b5['markers']['has'](u))_0x340ec2['updateMarker'](u,{'range':_0x5167c3});else{if(_0x5167c3['start']['isAtEnd']){const _0x1ca35a=_0x5167c3['start']['getLastMatchingPosition'](({item:_0x378e3e})=>!_0x4a32b5['schema']['isContent'](_0x378e3e),{'boundaries':_0x5167c3});_0x340ec2['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x340ec2['createRange'](_0x1ca35a,_0x5167c3['end'])});}else _0x340ec2['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5167c3});}});}['hideFakeVisualSelection'](){const _0x8cf479=this['editor']['model'];_0x8cf479['markers']['has'](u)&&_0x8cf479['change'](_0x3496b7=>{_0x3496b7['removeMarker'](u);});}['insertContent'](_0x441ed9,_0x5760f4){const _0x24ce10=_0x5760f4||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x24ce10))return;const _0x326000=this['editor']['data']['processor']['toView'](_0x441ed9),_0x1448a7=this['editor']['data']['toModel'](_0x326000);this['editor']['model']['change'](_0x18a467=>{this['hideFakeVisualSelection']();const _0x26d3fb=this['editor']['model']['insertContent'](_0x1448a7,_0x24ce10);_0x26d3fb&&_0x18a467['setSelection'](_0x26d3fb);});}['insertContentBelow'](_0x42b436){const {model:_0x33450e}=this['editor'],_0x47860c=Array['from'](_0x33450e['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x1ec5f8=_0x47860c['length']?_0x33450e['createPositionAfter'](_0x47860c['pop']()):_0x33450e['document']['selection']['getLastPosition']();this['insertContent'](_0x42b436,_0x1ec5f8);}}class v extends _0x1589f7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x202889('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x28e837){super(_0x28e837),this['name']='AIRequestError';}}function i(_0x42ff68,_0x12b9fe,_0x35514c){const t=_0x42ff68['t'];switch(_0x12b9fe){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',_0x35514c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x35514c);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'},_0x35514c);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 _0x12b9fe;}}class y extends _0x24eb69{['_commandDefinitions'];constructor(_0x5721db,_0x31c67b){super(_0x5721db),this['_commandDefinitions']=_0x31c67b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5b3a82,_0x2b91fa,_0x92b5fe)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x92b5fe));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2917f7,_0x27d16b,_0x430dd0)=>{this['enabledCommandsIds']=_0x430dd0?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x56db58=this['editor']['model'];this['_hasContext']=function(_0x204561){const _0x49bc24=_0x204561['document']['selection'];return _0x49bc24['isCollapsed']?0x0!==[..._0x49bc24['getSelectedBlocks']()]['length']&&![..._0x49bc24['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x204561['hasContent'](_0x49bc24['getFirstRange']());}(_0x56db58);const _0x283d50=_0x56db58['document']['selection'],_0x539271=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0xbdf715 of _0x283d50['getRanges']())for(const _0x2bd5c5 of _0xbdf715['getItems']())if(_0x2bd5c5['is']('element')&&_0x539271['includes'](_0x2bd5c5['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x851310='',_0xb4d4aa='',_0x4a9b89='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x851310,_0xb4d4aa,_0x4a9b89);}}function G(_0x10c9fa,_0x2f372f){const _0x23f4f6=new Set();for(const _0xe5807c of _0x10c9fa['values']())(_0x2f372f||!0x1===_0xe5807c['requiresContent'])&&_0x23f4f6['add'](_0xe5807c['id']);return Array['from'](_0x23f4f6);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
24
- _0x1b194d(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4437e0,_0x5462e2,_0x5b8930){super(),this['editor']=_0x4437e0,this['textAdapter']=_0x5462e2,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5b8930,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x271b2e,_0x17c532,_0x428850)=>{this['view']['value']=this['_sanitizeHTML'](_0x428850);}),this['listenTo'](this['view'],'submitPrompt',(_0x48d7fd,_0x1b0198)=>{const _0x44f29a=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1b0198,_0x44f29a,'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:_0x2a6612,query:_0x523b6e,htmlContent:_0x23a289,label:_0x2163e8,mainActionLabel:_0x40ad4a}){this['view']['prompt']=_0x2163e8,this['view']['mainAction']=_0x40ad4a,this['initialContext']=_0x23a289,_0x523b6e&&(this['view']['isRendered']?this['_handleQuery'](_0x523b6e,_0x23a289,_0x2a6612,_0x2163e8):this['view']['once']('render',()=>{this['_handleQuery'](_0x523b6e,_0x23a289,_0x2a6612,_0x2163e8);}));}['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'](_0x15ab5b,_0x12595c,_0x55c7b1,_0xca61b0){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x12595c,this['previousQuery']=_0x15ab5b,this['previousLabel']=_0xca61b0||_0x15ab5b,this['previousActionId']=_0x55c7b1,new Promise(_0x263801=>{this['textAdapter']['makeRequest']({'query':_0x15ab5b,'context':_0x12595c,'onData':_0x5dbded=>{this['currentResponse']=_0x5dbded,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x55c7b1})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4482c3=>{_0x4482c3 instanceof R?this['view']['handleError'](_0x4482c3['message']):this['view']['handleError'](),_0x263801();})['finally'](()=>{this['stopProcessing'](),_0x263801();});});}['_parseAndNormalizeContent'](_0x3986be,_0x17d12f=!0x1){const _0x4ba04e=Z['exec'](_0x3986be);_0x3986be=_0x4ba04e?_0x3986be['substring'](_0x4ba04e[0x1]['length']):_0x3986be['length']<0x64&&!_0x17d12f?'':this['_stripMarkdownSyntax'](_0x3986be);const _0x5ef9da=this['_domParser']['parseFromString'](_0x3986be,'text/html');if(_0x4ba04e){const _0x3855e7=Array['from'](_0x5ef9da['body']['childNodes']);_0x3855e7['reverse']();for(const _0x257b48 of _0x3855e7){if(_0x257b48['nodeType']==Node['ELEMENT_NODE'])break;_0x257b48['remove']();}}const _0x41dcb0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5ef9da['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x41dcb0),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x41dcb0));}['_normalizeResponseHeadings'](_0x3fd51a){const _0x37a958=new _0x6c2573(this['editor']['editing']['view']['document']),_0x3a05aa=new _0x52ce6c({'name':/^h[1-5]$/}),_0x5d7d1f=[];let _0x4d5a02=!0x1;for(const _0x386c20 of _0x3fd51a)_0x386c20['is']('element')&&_0x3a05aa['match'](_0x386c20)&&(_0x5d7d1f['push'](_0x386c20),'h1'==_0x386c20['name']&&(_0x4d5a02=!0x0));if(_0x4d5a02){for(const _0x1a40e6 of _0x5d7d1f)_0x37a958['rename']('h'+(parseInt(_0x1a40e6['name'][0x1])+0x1),_0x1a40e6);}}['_isH1TagSupportEnabled'](){const {data:_0x278028,editing:_0x335a0d}=this['editor'],_0x2669a9=_0x278028['htmlProcessor']['toView']('<h1></h1>'),_0x24566f=_0x278028['toView'](_0x278028['toModel'](_0x2669a9));return!!_0x335a0d['view']['domConverter']['viewToDom'](_0x24566f)['querySelector']('h1');}['_sanitizeHTML'](_0x2fbaee){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2fbaee),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xc08995){const _0x3dd94c=_0xc08995['trim']();return _0x3dd94c['startsWith']('```html')?_0x3dd94c['endsWith']('```')?_0x3dd94c['substring'](0x7,_0x3dd94c['length']-0x3):_0x3dd94c['substring'](0x7):_0xc08995;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x19c166){super(_0x19c166),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x449475=>i(_0x19c166,'AI_'+_0x449475['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x19c166,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x19c166,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x19c166,'Stop'));const _0x16fec6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x16fec6['if']('isVisible','ck-hidden',_0x1549aa=>!_0x1549aa)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x35cd4f,_0x315141){const _0x5bb5c6=new _0x680237(this['locale']);return _0x5bb5c6['set']({'label':_0x35cd4f,'class':_0x315141||'','isVisible':!0x0,'withText':!0x0}),_0x5bb5c6;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x386174{['contentFieldView'];['copyButtonView'];constructor(_0x5ab30e,_0x434ba5=''){super(_0x5ab30e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1782e4=this['bindTemplate'];this['contentFieldView']=new ct(_0x5ab30e,_0x434ba5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1782e4['if']('isVisible','ck-hidden',_0x553b52=>!_0x553b52)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1782e4['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 _0x5a732e=!0x1;this['on']('change:value',(_0x51a766,_0x3ff748,_0x3aacd2)=>{const _0x52bdf9=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3aacd2),this['isProcessing']&&_0x52bdf9&&!_0x5a732e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3c8fbd,_0x4cf7fe,_0x4f2558)=>{_0x5a732e=!0x1,_0x4f2558?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5a732e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5a732e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x38a635=this['locale'],_0x5bbf1e=new _0x680237(this['locale']),_0x5d4168='ck-ai-form__copy-button';return _0x5bbf1e['set']({'label':i(_0x38a635,'Copy'),'icon':U,'class':_0x5d4168,'tooltip':!0x0}),_0x5bbf1e['bind']('isVisible')['to'](this,'value',_0x48019d=>!!_0x48019d),_0x5bbf1e['bind']('isEnabled')['to'](this,'isProcessing',_0x3b40b1=>!_0x3b40b1),_0x5bbf1e['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5bbf1e['icon']=_0x57f809['check'],_0x5bbf1e['class']=_0x5d4168+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5bbf1e['icon']=U,_0x5bbf1e['class']=_0x5d4168;},0x3e8);}),_0x5bbf1e;}['_copyHTMLToClipboard'](_0x4d8445){const {window:_0x204f22,document:_0x5cadd6}=_0x5a217f;if(_0x204f22['ClipboardItem']){const {Blob:_0xcc601,ClipboardItem:_0xc8438e}=_0x204f22,_0x531cad=[new _0xc8438e({'text/html':new _0xcc601([_0x4d8445['innerHTML']],{'type':'text/html'}),'text/plain':new _0xcc601([_0x4d8445['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x531cad);}else{const _0x25e667=_0x5cadd6['createElement']('div');_0x25e667['style']['position']='absolute',_0x25e667['style']['left']='-9999px',_0x25e667['innerHTML']='<span>[</span>'+_0x4d8445['innerHTML']+'<span>]</span>',_0x5cadd6['body']['appendChild'](_0x25e667);const _0x5ce2e9=_0x5cadd6['createRange']();_0x5ce2e9['setStartAfter'](_0x25e667['firstElementChild']),_0x5ce2e9['setEndBefore'](_0x25e667['lastElementChild']);const _0x193ab2=_0x204f22['getSelection']();_0x193ab2['removeAllRanges'](),_0x193ab2['addRange'](_0x5ce2e9),_0x5cadd6['execCommand']('copy'),_0x25e667['remove']();}}}class ct extends _0x386174{constructor(_0x4d6642,_0x280a3a=''){super(_0x4d6642),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x280a3a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2c29ba){this['element']['innerHTML']=_0x2c29ba;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x416237=new _0x386174(),_0xb9c505=this['locale'],_0x14bcd9=new _0x5bba5b();return _0x14bcd9['isVisible']=!0x0,_0x416237['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x14bcd9,{'text':i(_0xb9c505,'AI\x20is\x20writing...')}]}),_0x416237['render'](),_0x416237;}}class tt extends _0x386174{constructor(_0x375cf2,_0x3ce6a5=''){super(_0x375cf2);const _0x474678=new _0x13dca1(),_0x366b8d=this['bindTemplate'];this['set']('text',_0x3ce6a5),_0x474678['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x474678,{'text':_0x366b8d['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4fec85,_0x4fa9b8){super(_0x4fec85,_0x4fa9b8),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',(_0x42887d,_0x279075)=>{_0x42887d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x279075());});}['_createSubmitButton'](){const _0x22cb10=new _0x680237(this['locale']),_0x347940=this['locale'];return _0x22cb10['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x347940,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x22cb10['on']('execute',()=>{this['submit']();}),_0x22cb10['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x25c8f,_0x17bc1a)=>!_0x25c8f&&_0x17bc1a),_0x22cb10;}['_createShowHistoryButton'](){const _0x5b6072=new _0x680237(this['locale']),_0x574494=this['resultsView'],_0x237b6c=this['locale'];_0x5b6072['set']({'label':i(_0x237b6c,'History'),'withText':!0x1,'icon':_0x57f809['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5b6072['bind']('isOn')['to'](_0x574494,'isVisible'),_0x5b6072['bind']('isEnabled')['to'](this,'isEnabled'),_0x5b6072['on']('execute',()=>{_0x574494['isVisible']=!_0x574494['isVisible'],_0x574494['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3e9c8b=()=>{_0x5a217f['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x2b1c87=new st(this['queryView']['fieldView']['element']),_0x3dcd4b=_0x2b1c87['width'],_0xe94b11='rtl'===_0x237b6c['uiLanguageDirection']?'left':'right';_0x2b1c87['excludeScrollbarsAndBorders'](),_0x5b6072['element']['style'][_0xe94b11]=_0x3dcd4b-_0x2b1c87['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3e9c8b),this['on']('render',_0x3e9c8b),_0x5b6072;}['submit'](){const _0x6ac49c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x6ac49c);}['focus'](_0x16b315){-0x1===_0x16b315?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x24b0a7){super(_0x24b0a7),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x24b0a7,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x27154e=0x0;for(const _0x1ac9da of this['items'])_0x27154e+=_0x1ac9da['items']['length'];return{'resultsCount':_0x27154e,'totalItemsCount':_0x27154e};}['_createClearHistoryButton'](){const _0x325900=this['locale'],_0x5066c0=new _0x680237(this['locale']);return _0x5066c0['set']({'label':'('+i(_0x325900,'Clear')+')','withText':!0x0}),_0x5066c0['on']('execute',()=>this['fire']('clearHistory')),_0x5066c0;}}class hs extends _0xd7cd21{constructor(_0x3734bb){super();const _0xfe9846=new te(),_0x59b4f4=new _0x680237(this['locale'],_0xfe9846);this['children']['add'](_0x59b4f4),_0x59b4f4['set']({'label':_0x3734bb['prompt'],'withText':!0x0}),_0x59b4f4['on']('execute',()=>{this['fire']('execute',{'value':_0x3e7c5a(_0x3734bb['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x47e0b3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x54a759,_0x374858)=>{const _0x413bc6=Ss(_0x374858['prompt']);for(const _0x59dc31 of this)if(_0x59dc31!=_0x374858&&Ss(_0x59dc31['prompt'])===_0x413bc6){this['remove'](_0x59dc31);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4be8e0=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x4be8e0));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x62525b=>_0x62525b)));}}function Ss(_0x4a2ff1){return _0x4a2ff1['toLowerCase']()['trim']();}class K extends _0x386174{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5e2414,_0x1980f3,_0x758e5e=''){super(_0x5e2414),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x5e2414),this['contentArea']=new W(_0x5e2414,_0x758e5e),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 _0x4dee7f(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x57dd9a({'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 _0x13af3e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1980f3],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x13af3e['if']('isError','ck-hidden',_0x3158a5=>!_0x3158a5)]},'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'](_0x7459a4=0x1){-0x1===_0x7459a4?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 _0x3fb540=this['locale'],_0x33d26a=new ht(_0x3fb540,{'queryView':{'label':i(_0x3fb540,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2db5eb,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3fb540,'Empty\x20history'),'secondary':i(_0x3fb540,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x33d26a['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5d9142,_0x1d5d36)=>_0x5d9142&&!_0x1d5d36),this['listenTo'](_0x33d26a,'submit',(_0x4acf72,_0x5c7d61)=>{this['prompt']=_0x5c7d61;const _0x365200=_0xf1175d(_0x5c7d61);this['fire']('submitPrompt',_0x365200),_0x5c7d61['trim']()&&this['_promptHistory']['add']({'prompt':_0x365200},0x0);},{'priority':'high'}),_0x33d26a;}['_createHistoryView'](){const _0x231d55=new rs(this['locale']);return _0x231d55['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x231d55['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x231d55;}['_createToolbar'](){const _0x4acf22=new nt(this['locale']);return _0x4acf22['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3347a4,_0x4385ad,_0x24da8a)=>_0x3347a4&&!_0x4385ad&&!!_0x24da8a),_0x4acf22['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4acf22['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x375867,_0x5968a4,_0xaa65fa)=>_0x375867&&!_0x5968a4&&!!_0xaa65fa),_0x4acf22['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4acf22['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x300a67,_0x1514a5)=>_0x300a67&&!_0x1514a5),_0x4acf22['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4acf22['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4acf22['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4acf22;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x625cd7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x625cd7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5e0c66){const _0x57f21a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5e0c66||i(_0x57f21a,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x1589f7{['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[_0x3fe6fd,a,v,_0x485adb];}constructor(_0x2ca0a8){super(_0x2ca0a8),_0x2ca0a8['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2ca0a8['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2ca0a8['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2ca0a8['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x92527a}=this;this['_aiAdapter']=_0x92527a['plugins']['get'](v),this['_dialog']=_0x92527a['plugins']['get'](_0x485adb),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x32e06b=new y(_0x92527a,Array['from'](this['_commandDefinitions']['values']()));_0x92527a['commands']['add']('showAIAssistant',_0x32e06b),_0x92527a['ui']['componentFactory']['add']('aiCommands',_0x230ee2=>{const _0x166e0e=_0x360436(_0x230ee2);return _0x166e0e['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x166e0e['buttonView']['set']({'label':i(_0x230ee2,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x166e0e['on']('execute',_0x67ec5e=>this['_onExecute'](_0x67ec5e['source']['id'])),_0x2a4bd6(_0x166e0e,_0x92527a['ui']['view']['body'],function(_0x3256c9){const _0x2ef39b=o(_0x3256c9['config']['get']('ai.aiAssistant.commands'),_0x3256c9['locale']),_0x6b9b5b=B(_0x3256c9,_0x2ef39b)['filter'](_0x36b9d8=>_0x36b9d8['commands']['length']);if(0x1===_0x6b9b5b['length'])return B(_0x3256c9,_0x6b9b5b[0x0]['commands'])['map'](_0x4ac75b=>({'id':_0x4ac75b['id'],'label':_0x4ac75b['label']}));return _0x6b9b5b['map'](_0x22429e=>{const {groupId:_0x59f037,groupLabel:_0x498e28,commands:_0x92f82c}=_0x22429e,_0x4014fe=B(_0x3256c9,_0x92f82c)['map'](_0x199a87=>({'id':_0x199a87['id'],'label':_0x199a87['label']}));return{'id':_0x59f037,'menu':_0x498e28||_0x59f037,'children':_0x4014fe};});}(_0x92527a),{'ariaLabel':i(_0x230ee2,'AI\x20Commands')}),_0x166e0e['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x32e06b['on']('change:enabledCommandsIds',_0x221717),_0x166e0e['menuView']['once']('render',_0x221717),_0x166e0e;function _0x221717(){_0x166e0e['isEnabled']=_0x32e06b['enabledCommandsIds']['length']>0x0;for(const _0x28a3fe of _0x166e0e['menuView']['buttons'])_0x28a3fe['isEnabled']=_0x32e06b['enabledCommandsIds']['includes'](_0x28a3fe['id']);}}),_0x92527a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x49f0df=>{const _0x21f945=new _0x1f9b8f(_0x49f0df);_0x21f945['buttonView']['set']({'label':i(_0x49f0df,'AI\x20Commands'),'icon':E}),_0x21f945['bind']('isEnabled')['to'](_0x32e06b,'enabledCommandsIds',_0x190cba=>_0x190cba['length']>0x0);const _0x4ec82c=o(_0x92527a['config']['get']('ai.aiAssistant.commands'),_0x49f0df);return this['_populateMenuBarMenu'](_0x32e06b,_0x21f945,_0x4ec82c,_0x4661e7=>this['_onExecute'](_0x4661e7)),_0x21f945;}),_0x92527a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x404b77=this['_createAIAssistantUIButton'](_0x680237);return _0x404b77['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x404b77;}),_0x92527a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x87812b=this['_createAIAssistantUIButton'](_0x4e1c06);return _0x87812b['set']({'role':'menuitemcheckbox'}),_0x87812b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3b9000=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2008dd;for(const _0x4b6ea1 in _0x3b9000){const _0xbacee8=_0x4b6ea1,_0x51a176=_0x3b9000[_0xbacee8];if('aiLicenseKeyValid'==_0x51a176||'aiLicenseKeyInvalid'==_0x51a176||'aiLicenseKeyExpired'==_0x51a176||'aiLicenseKeyDomainLimit'==_0x51a176||'aiLicenseKeyNotAllowed'==_0x51a176||'aiLicenseKeyEvaluationLimit'==_0x51a176||'aiLicenseKeyTrialLimit'==_0x51a176||'aiLicenseKeyDevelopmentLimit'==_0x51a176||'aiLicenseKeyUsageLimit'==_0x51a176){delete _0x3b9000[_0xbacee8],_0x2008dd=_0x51a176,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2008dd&&_0x3b9000['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2008dd&&_0x3b9000['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2008dd&&_0x3b9000['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2008dd&&_0x3b9000['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2008dd&&_0x3b9000['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2008dd&&_0x3b9000['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x2008dd&&_0x3b9000['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x2008dd&&_0x3b9000['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x33d21c='',_0x96a21='',_0x3cad9e='custom'){const _0x1ebf49=this['editor'],_0x4263b0=_0x1ebf49['editing']['view'],_0x3a2d06=_0x1ebf49['plugins']['get'](a),_0x386c16=_0x1ebf49['plugins']['get'](_0x3fe6fd);_0x3a2d06['showFakeVisualSelection']();const _0x2f8d20=new j(),_0x420ceb=new ClipboardEvent('copy',{'clipboardData':_0x2f8d20}),_0x3e81ac=new _0x4dc07d(_0x2f8d20),_0x5a1a58=new _0x37f926(_0x4263b0,_0x420ceb,{'dataTransfer':_0x3e81ac});_0x386c16['_forceMarkersCopy']('comment',()=>{_0x4263b0['document']['fire']('copy',_0x5a1a58);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x1ebf49,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xceaf6c=_0x3e81ac['getData']('text/html');const _0x5b6502=_0x1ebf49['model']['document']['selection'],_0xf9b6c0=Array['from'](_0x5b6502['getRanges']());0x1===_0xf9b6c0['length']&&_0xf9b6c0[0x0]['isFlat']&&!_0x5b6502['getSelectedElement']()&&''!==_0xceaf6c['replace'](/&nbsp;/g,'')['trim']()&&(_0xceaf6c='<p>'+_0xceaf6c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3cad9e,'query':_0x33d21c,'htmlContent':_0xceaf6c,'label':_0x96a21,'mainActionLabel':x[_0x1ebf49['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2e9f74['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3a2d06['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xc2bfa7=new Map(),_0x3dd60d=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x19a450 of _0x3dd60d)for(const _0x515e45 of _0x19a450['commands'])_0xc2bfa7['set'](_0x515e45['id'],{..._0x515e45,'groupId':_0x19a450['groupId'],'groupLabel':_0x19a450['groupLabel']||_0x19a450['groupId']});return _0xc2bfa7;}['_createAIAssistantUIButton'](_0x1dc79b){const _0x4384c5=this['editor'],_0xa75748=_0x4384c5['commands']['get']('showAIAssistant'),_0x3f1b82=new _0x1dc79b(_0x4384c5['locale']);return _0x3f1b82['set']({'label':i(_0x4384c5['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x3f1b82['bind']('isEnabled')['to'](_0xa75748),_0x3f1b82['bind']('isOn')['to'](this['_dialog'],'id',_0x5790f1=>'aiAssistant'===_0x5790f1),this['listenTo'](_0x3f1b82,'execute',()=>{_0x3f1b82['isOn']?this['hideUI']():_0xa75748['execute']();}),_0x3f1b82;}['_initView'](){const _0x1fec8b=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',()=>{_0x1fec8b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1fec8b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2dd009,ui:{ariaLiveAnnouncer:_0x58d85f}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x14bfbf,_0x5d501e,_0x41d691)=>{const _0x55aae9=this['_aiAssistantController']['currentContext'];_0x41d691?_0x58d85f['announce'](i(_0x2dd009,'AI\x20is\x20writing')):_0x55aae9&&_0x58d85f['announce'](i(_0x2dd009,'Generated\x20content:\x20%0',_0x55aae9),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x45e07d,_0x5f4c72,_0x511396)=>{if(_0x511396){const _0x173934=this['_formView']['errorView']['text'];_0x58d85f['announce'](i(_0x2dd009,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x173934));}});}['_onExecute'](_0x34d464){const _0x4aac54=this['_commandDefinitions']['get'](_0x34d464),_0x195e74=this['editor'],_0x21f272=_0x195e74['model']['document']['selection'],_0x40ba3a=_0x195e74['commands']['get']('showAIAssistant'),_0x4d73d8=_0x195e74['plugins']['get'](a),_0x32fd74=''+(_0x4aac54['groupId']!==I?_0x4aac54['groupLabel']+':\x20':'')+_0x4aac54['label'];if(!0x1!==_0x4aac54['requiresContent']&&_0x21f272['isCollapsed']){const _0x76310=_0x37aee8(_0x21f272['getSelectedBlocks']())||_0x195e74['model']['schema']['getLimitElement'](_0x21f272);_0x195e74['model']['change'](_0x5ab400=>{_0x5ab400['setSelection'](_0x76310,'in');});}_0x4d73d8['showFakeVisualSelection'](),_0x40ba3a['execute'](_0x4aac54['prompt'],_0x32fd74,'command:'+_0x34d464);}['_populateMenuBarMenu'](_0x118e9f,_0xb39ad1,_0x433235,_0x25ea5d){const _0x4a32cb=this['editor'],_0x53265a=_0x4a32cb['locale'],_0x4695f9=new _0x4c367d(_0x53265a),_0x3cbfd8=B(_0x4a32cb,_0x433235)['filter'](_0x4d9a0e=>_0x4d9a0e['commands']['length']);0x1===_0x3cbfd8['length']?this['_getMenuBarGroupButtons']({'command':_0x118e9f,'commands':_0x3cbfd8[0x0]['commands'],'parentMenuView':_0xb39ad1,'onExecute':_0x25ea5d})['forEach'](_0x43727f=>_0x4695f9['items']['add'](_0x43727f)):_0x3cbfd8['forEach'](({groupId:_0x32690e,groupLabel:_0x3dc07f,commands:_0x4d4f3a})=>{const _0x12eeba=new _0x531165(_0x53265a,_0xb39ad1),_0x5e9ac7=new _0x1f9b8f(_0x53265a),_0x3b496a=new _0x4c367d(_0x53265a),_0x24c6f2=this['_getMenuBarGroupButtons']({'command':_0x118e9f,'commands':_0x4d4f3a,'parentMenuView':_0x5e9ac7,'onExecute':_0x25ea5d});_0x5e9ac7['buttonView']['set']({'label':_0x3dc07f||_0x32690e}),_0x5e9ac7['delegate']('execute')['to'](_0xb39ad1),_0x3b496a['items']['addMany'](_0x24c6f2),_0x5e9ac7['panelView']['children']['add'](_0x3b496a),_0x12eeba['children']['add'](_0x5e9ac7),_0x4695f9['items']['add'](_0x12eeba);}),_0xb39ad1['panelView']['children']['add'](_0x4695f9);}['_getMenuBarGroupButtons']({command:_0x2056dc,commands:_0x181507,parentMenuView:_0x2de84d,onExecute:_0x2bbc4d}){const _0x1364c5=this['editor'],_0x21364b=_0x1364c5['locale'];return B(_0x1364c5,_0x181507)['map'](_0x46ad0e=>{const _0xd4cbfd=new _0x531165(_0x21364b,_0x2de84d),_0x445b40=new _0x4e1c06(_0x21364b);return _0x445b40['set']({'label':_0x46ad0e['label']}),_0x445b40['delegate']('execute')['to'](_0x2de84d),_0x445b40['on']('execute',()=>_0x2bbc4d(_0x46ad0e['id'])),_0x445b40['bind']('isEnabled')['to'](_0x2056dc,'enabledCommandsIds',_0x1dc2d5=>_0x1dc2d5['includes'](_0x46ad0e['id'])),_0xd4cbfd['children']['add'](_0x445b40),_0xd4cbfd;});}}function _(_0x57944a,_0x5a7d1e){return void 0x0!==_0x57944a['order']&&void 0x0===_0x5a7d1e['order']?0x1:void 0x0===_0x57944a['order']&&void 0x0!==_0x5a7d1e['order']?-0x1:void 0x0!==_0x57944a['order']&&void 0x0!==_0x5a7d1e['order']?_0x57944a['order']-_0x5a7d1e['order']:0x0;}function B(_0x474216,_0x1cfaaf){_0x1cfaaf['sort'](_);const _0x191cfb={},_0x1791eb=[];for(const _0x46b62c of _0x1cfaaf)if(void 0x0!==_0x46b62c['order']){if(_0x46b62c['order']in _0x191cfb)throw new _0x202889('ai-commands-config-order-collision',_0x474216,{'conflictingDefinitions':[_0x46b62c,_0x191cfb[_0x46b62c['order']]]});_0x191cfb[_0x46b62c['order']]=_0x46b62c,_0x1791eb['splice'](_0x46b62c['order'],0x0,_0x46b62c);}else _0x1791eb['push'](_0x46b62c);return _0x1791eb;}class r extends _0x1589f7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2aa24c){super(_0x2aa24c);const _0x13a3d0=_0x2aa24c['config'],_0x428133=_0x2aa24c['locale'];_0x13a3d0['define']('ai.aiAssistant.commands',function(_0x4184aa){return[{'groupId':'editOrReview','groupLabel':i(_0x4184aa,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4184aa,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4184aa,'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(_0x4184aa,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4184aa,'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(_0x4184aa,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4184aa,'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(_0x4184aa,'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(_0x4184aa,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4184aa,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4184aa,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4184aa,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4184aa,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4184aa,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4184aa,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4184aa,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4184aa,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4184aa,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4184aa,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4184aa,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4184aa,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4184aa,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4184aa,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4184aa,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4184aa,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4184aa,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4184aa,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4184aa,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x428133)),_0x13a3d0['define']('ai.aiAssistant.extraCommandGroups',[]),_0x13a3d0['define']('ai.aiAssistant.removeCommands',[]);const _0x2e55f5=o(_0x13a3d0['get']('ai.aiAssistant.commands'),_0x428133),_0x838241=_0x13a3d0['get']('ai.aiAssistant.extraCommandGroups'),_0x2b5dad=_0x13a3d0['get']('ai.aiAssistant.removeCommands');_0x838241['forEach'](_0x178ab4=>{const _0x23e283=_0x2e55f5['find'](_0x1af65f=>_0x1af65f['groupId']===_0x178ab4['groupId']);_0x23e283?_0x23e283['commands']=_0x23e283['commands']['concat'](_0x178ab4['commands']):_0x2e55f5['push'](_0x178ab4);}),_0x2e55f5['forEach'](_0x1f5217=>{_0x1f5217['commands']=_0x1f5217['commands']['filter'](_0x62633b=>!_0x2b5dad['includes'](_0x62633b['id']));}),_0x13a3d0['set']('ai.aiAssistant.commands',_0x2e55f5);}}class P extends _0x1589f7{['abortController'];static get['requires'](){return[v];}constructor(_0x1a09c3){super(_0x1a09c3),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3a8794){return this['sendRequest'](_0x3a8794)['catch'](_0x1384f3=>{if(_0x1384f3 instanceof R)return Promise['reject'](_0x1384f3);if('AbortError'==_0x1384f3['name'])return Promise['resolve']();throw console['error'](_0x1384f3),new _0x202889('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x14b0e9,_0x14d374){const _0x40ad2d=this['editor']['locale'],_0x2c2572={'Content-Type':'application/json'};if('object'==typeof _0x14b0e9)Object['assign'](_0x2c2572,_0x14b0e9);else{if(_0x14b0e9)try{const _0xf09d7b=await _0x14b0e9(_0x14d374);Object['assign'](_0x2c2572,_0xf09d7b);}catch(_0x31057e){return Promise['reject'](new R(i(_0x40ad2d,'AI_ERROR_GET_HEADERS')));}}return _0x2c2572;}async['_prepareRequestParameters'](_0x490f8b,_0xa80526){const _0x4f7be6=this['editor']['locale'];if('object'==typeof _0x490f8b)return _0x490f8b;try{return await _0x490f8b(_0xa80526);}catch(_0x35e363){return Promise['reject'](new R(i(_0x4f7be6,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x225329){super(_0x225329),_0x225329['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x225329['config']['get']('ai.openAI.requestParameters')||_0x225329['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x225329['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x225329['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x225329['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x2d85f4,context:_0xdeb3d6,onData:_0x300bf6,actionId:_0x4aab39}){const _0x1b3f95=this['editor']['locale'],_0x1bcef3=await this['prepareMessages'](_0x2d85f4,_0xdeb3d6,_0x4aab39),_0xdf501c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4aab39),_0x462a54=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4aab39),_0x4e9829={'messages':_0x1bcef3,..._0x462a54},_0x106457={'method':'POST','headers':_0xdf501c,'body':JSON['stringify'](_0x4e9829),'signal':this['abortController']['signal']},_0x38b56a=await fetch(this['_apiUrl'],_0x106457);if(_0x38b56a['ok'])return _0x462a54['stream']?await this['_readStreamableResponse'](_0x38b56a,_0x300bf6):await this['_readStaticResponse'](_0x38b56a,_0x300bf6),Promise['resolve']();{const _0x731101=await _0x38b56a['text']();return _0x731101['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x1b3f95,'AI_ERROR_CONTEXT_LENGTH'))):_0x731101['includes']('Moderation')?Promise['reject'](new R(i(_0x1b3f95,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x731101));}}async['prepareMessages'](_0x408f42,_0x1af2d8,_0xb6d274){let _0x37cbe9,_0x245bfe;return _0x1af2d8?(_0x37cbe9='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.',_0x245bfe='Instruction:\x0a'+_0x408f42+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1af2d8):(_0x37cbe9='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.',_0x245bfe=_0x408f42),[{'role':'system','content':_0x37cbe9},{'role':'user','content':_0x245bfe}];}async['_readStreamableResponse'](_0x164cd7,_0x3ab6b0){const _0xa091e9=_0x164cd7['body']['getReader'](),_0x4b9c93=new TextDecoder();let _0x590f47='',_0x4ca946='',_0x184578='',_0x10350b=!0x1;for(;!_0x10350b;){const {done:_0x52664e,value:_0x197f46}=await _0xa091e9['read'](),_0x373cbe=_0x590f47+_0x4b9c93['decode'](_0x197f46);let _0x244f6e='';_0x10350b=_0x52664e;try{_0x244f6e=this['_cleanUpData'](_0x373cbe),_0x590f47='';}catch(_0xce4bf3){_0x590f47=_0x373cbe;continue;}_0x4ca946+=_0x244f6e,!_0x10350b&&this['_isBufferIncomplete'](_0x4ca946)||_0x4ca946&&(_0x184578+=_0x4ca946,_0x4ca946='',_0x3ab6b0(_0x184578));}return Promise['resolve']();}async['_readStaticResponse'](_0x35520e,_0x2fb194){return _0x2fb194((await _0x35520e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x521cec){const _0x543536=_0x521cec['split']('<')['length']!==_0x521cec['split']('>')['length'],_0x169193=_0x521cec['length']<0x1e;return _0x543536&&_0x169193;}['_cleanUpData'](_0x48234a){return _0x48234a['split'](/\n(?![^{]*\})/g)['map'](_0x1ff65a=>_0x1ff65a['replace']('data:\x20',''))['filter'](_0x520d1c=>_0x520d1c&&_0x520d1c['length']>0x0&&'[DONE]'!==_0x520d1c)['map'](_0x31f5ad=>{const {choices:_0x240659}=JSON['parse'](_0x31f5ad);if(_0x240659[0x0]&&_0x240659[0x0]['delta']&&_0x240659[0x0]['delta']['content'])return _0x240659[0x0]['delta']['content'];})['filter'](_0x26c9e3=>_0x26c9e3)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x37cdf3){super(_0x37cdf3),_0x37cdf3['config']['get']('ai.aws.requestParameters')||_0x37cdf3['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']=_0x37cdf3['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x37cdf3['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x37cdf3['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x37cdf3['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x562da5,context:_0x18c8b5,onData:_0x38b7bb,actionId:_0x1466bb}){const {model:_0x3f6fd3,stream:_0x33bd3c,..._0x422bbb}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1466bb),_0x15506a={'prompt':await this['preparePrompt'](_0x562da5,_0x18c8b5,_0x3f6fd3,_0x1466bb),..._0x422bbb};this['_apiUrl']?await this['_processProxyRequest'](_0x15506a,_0x3f6fd3,_0x33bd3c,_0x38b7bb,_0x1466bb):await this['_processAWSRequest'](_0x15506a,_0x3f6fd3,_0x33bd3c,_0x38b7bb);}async['preparePrompt'](_0x14fc8d,_0x5eb4af,_0x3d13e4,_0x615a54){let _0xb850e3,_0x14d756;return _0x5eb4af?(_0xb850e3='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.',_0x14d756='Instruction:\x0a'+_0x14fc8d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5eb4af):(_0xb850e3='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.',_0x14d756=_0x14fc8d),'meta.llama'==this['getModelFamily'](_0x3d13e4)?'<<SYS>>\x0a'+_0xb850e3+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x14d756+'\x0a[/INST]':'Human:\x0a'+_0xb850e3+'\x0a'+_0x14d756+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4dd00d){if(/^anthropic\.claude/['test'](_0x4dd00d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4dd00d))return'ai21.j2';if(/^cohere\.command/['test'](_0x4dd00d))return'cohere.command';if(/^meta\.llama/['test'](_0x4dd00d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4dd00d));}async['_processProxyRequest'](_0x1a67ed,_0x525930,_0x3a86e2,_0x403f9e,_0x432198){const _0x2bb970={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x432198),'body':JSON['stringify']({..._0x1a67ed,'model':_0x525930,'stream':_0x3a86e2}),'signal':this['abortController']['signal']},_0xddaca2=await fetch(this['_apiUrl'],_0x2bb970);_0x3a86e2?await this['_readStreamableResponse'](_0xddaca2,_0x525930,_0x403f9e):await this['_readStaticResponse'](_0xddaca2,_0x525930,_0x403f9e);}async['_processAWSRequest'](_0x489702,_0x908bc1,_0x5ab533,_0x590988){const _0x1646bc=new _0x1f7bf8(this['_bedrockClientConfig']),_0x17ec2c={'body':JSON['stringify'](_0x489702),'contentType':'application/json','accept':'application/json','modelId':_0x908bc1};let _0xb19952;if(_0x5ab533){const _0x420ac0=new _0xe406ba(_0x17ec2c);_0xb19952=await _0x1646bc['send'](_0x420ac0,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xb19952,_0x908bc1,_0x590988);}else{const _0x131c58=new _0x5aa466(_0x17ec2c);_0xb19952=await _0x1646bc['send'](_0x131c58,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xb19952,_0x908bc1,_0x590988);}}async['_readAsyncIterableResponse'](_0x1379c3,_0x547718,_0x1af1d8){const _0x159e04=_0x1379c3['body'],_0x2ee109=new TextDecoder('utf-8');let _0x2328e3='';for await(const _0x23b869 of _0x159e04)if(_0x23b869['chunk']){const _0x56ffc8=_0x2ee109['decode'](_0x23b869['chunk']['bytes']),_0x68223b=JSON['parse'](_0x56ffc8);_0x2328e3+=this['_getGeneratedText'](_0x68223b,_0x547718),_0x1af1d8(_0x2328e3);}return Promise['resolve']();}async['_readStreamableResponse'](_0x114434,_0xfda3df,_0x59b5e8){const _0x51175c=_0x114434['body'],_0x3f73dc=new TextDecoder('utf-8'),_0x545848=_0x51175c['getReader']();let _0x5acf99='',_0x44679e='',_0x4f0cab=!0x1;for(;!_0x4f0cab;){const {done:_0x53d604,value:_0x391ca5}=await _0x545848['read']();if(_0x4f0cab=_0x53d604,_0x4f0cab)break;const _0x117de9=(_0x5acf99+_0x3f73dc['decode'](_0x391ca5))['split']('\x0a')['map'](_0x4f6628=>{try{return _0x5acf99='',JSON['parse'](_0x4f6628);}catch(_0x572dfd){return _0x5acf99=_0x4f6628,null;}})['filter'](_0x53c169=>null!==_0x53c169);_0x117de9['length']&&(_0x44679e+=_0x117de9['map'](_0x2ecd91=>this['_getGeneratedText'](_0x2ecd91,_0xfda3df))['join'](''),_0x59b5e8(_0x44679e));}return Promise['resolve']();}async['_readStaticResponse'](_0x539b59,_0x333559,_0x4e3049){let _0x406903;return _0x406903=_0x539b59 instanceof Response?await _0x539b59['json']():JSON['parse'](Buffer['from'](_0x539b59['body'])['toString']('utf8')),(_0x4e3049(this['_getGeneratedText'](_0x406903,_0x333559)),Promise['resolve']());}['_getGeneratedText'](_0x322007,_0x207c5e){switch(this['getModelFamily'](_0x207c5e)){case'anthropic.claude':return _0x322007['completion'];case'ai21.j2':return _0x322007['completions'][0x0]['data']['text'];case'cohere.command':return _0x322007['generations'][0x0]['text'];case'meta.llama':return _0x322007['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
23
+ import{Plugin as _0x225aa9,Command as _0x1d320e,icons as _0x54d35b}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x2de5da,CKEditorError as _0x464cb3,ObservableMixin as _0x2c3b34,global as _0x55d9df,isVisible as it,Rect as st,Collection as _0x157b3b,FocusTracker as _0x1b00d8,KeystrokeHandler as ts,first as _0xe5cb12}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x28c5de,View as _0x1e6319,SpinnerView as _0x3d3513,IconView as _0x30a25b,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x2c6ae4,ButtonLabelView as te,FocusCycler as _0x518140,createLabeledTextarea as _0x23cd7d,Dialog as _0x32ad8e,createDropdown as _0x497cb3,addMenuToDropdown as _0x224eb3,MenuBarMenuView as _0xf928c0,MenuBarMenuListItemButtonView as _0x535300,DialogViewPosition as _0x2e01d2,MenuBarMenuListView as _0xd021e1,MenuBarMenuListItemView as _0x9f5693}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x8cd78c,Matcher as _0x5d9032,DataTransfer as _0x3ae11a,DomEventData as _0x1b12f5}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x33e8bf,escape as _0x2fc312}from'lodash-es';import{ClipboardMarkersUtils as _0x533a6b}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x493d07,InvokeModelWithResponseStreamCommand as _0x51418a,InvokeModelCommand as _0x3e1a00}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x1263cf,_0x4b7c6d){const _0x29c60c=(0x0,_0x4b7c6d['t'])('Other');return _0x1263cf['length']?'groupId'in _0x1263cf[0x0]?_0x1263cf:[{'groupId':I,'groupLabel':_0x29c60c,'order':0x1/0x0,'commands':_0x1263cf}]:[{'groupId':I,'groupLabel':_0x29c60c,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x225aa9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x50a101}=this,_0x263e4d=['ck-fake-ai-selection'];_0x50a101['config']['get']('ai.useTheme')&&_0x263e4d['push']('ck-ai-assistant-ui_theme'),_0x50a101['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x263e4d,'priority':0xc}}),_0x50a101['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x2e364f,{writer:_0x4d95dc})=>{if(!_0x2e364f['markerRange']['isCollapsed'])return null;const _0x57e67e=_0x4d95dc['createUIElement']('span');return _0x4d95dc['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x57e67e),_0x57e67e;}});}['afterInit'](){!async function(_0xfbc0c8){const _0x345659=_0x587529([0x6d,0x44,0x38,0x48,0x34,0x46,0x57,0x50,0x6e,0x37,0x74,0x4e,0x4a,0x33,0x4f,0x30,0x6a,0x73,0x52,0x6b,0x4b,0x58,0x36,0x75,0x55,0x67,0x69,0x68,0x76,0x64,0x77,0x4d,0x4c,0x45,0x62,0x32,0x53,0x79,0x35,0x41,0x47,0x6f,0x71,0x31,0x61,0x43,0x39,0x65,0x66,0x56,0x78,0x49,0x5a,0x70,0x59,0x51,0x7a,0x6c,0x72,0x54,0x63,0x42]),_0x108dc4=0x4705f2c5,_0xc55ee4=0x4702a575^_0x108dc4,_0x105d3e=window[_0x587529([0x44,0x61,0x74,0x65])][_0x587529([0x6e,0x6f,0x77])](),_0x4f706f=_0xfbc0c8[_0x587529([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x27a995=new window[(_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x259689=>{_0x4f706f[_0x587529([0x6f,0x6e,0x63,0x65])](_0x587529([0x72,0x65,0x61,0x64,0x79]),_0x259689);}),_0x192eed={[_0x587529([0x6b,0x74,0x79])]:_0x587529([0x45,0x43]),[_0x587529([0x75,0x73,0x65])]:_0x587529([0x73,0x69,0x67]),[_0x587529([0x63,0x72,0x76])]:_0x587529([0x50,0x2d,0x32,0x35,0x36]),[_0x587529([0x78])]:_0x587529([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]),[_0x587529([0x79])]:_0x587529([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]),[_0x587529([0x61,0x6c,0x67])]:_0x587529([0x45,0x53,0x32,0x35,0x36])},_0x5e31ff=_0x4f706f[_0x587529([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x587529([0x67,0x65,0x74])](_0x587529([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x30dbfd(){let _0x4e5006,_0x697a68=null,_0x1c21f6=null;try{if(_0x5e31ff==_0x587529([0x47,0x50,0x4c]))return _0x587529([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4e5006=_0x509e26(),!_0x4e5006)return _0x587529([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4e5006[_0x587529([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1c21f6=_0x37987f(_0x4e5006[_0x587529([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4e5006[_0x587529([0x6a,0x74,0x69])])),await _0x216caa()?_0x2e944f()?_0x276931()?_0x587529([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4092a9()?(_0x4e5006[_0x587529([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x587529([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x697a68=_0x28906e(_0x587529([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4e5006[_0x587529([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x587529([0x74,0x72,0x69,0x61,0x6c])&&(_0x697a68=_0x28906e(_0x587529([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x4e5006[_0x587529([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x587529([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x697a68=_0x28906e(_0x587529([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x582aa8()):_0x587529([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x587529([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x587529([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x1a8735){return _0x587529([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x276931(){const _0x471af1=[_0x587529([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x587529([0x74,0x72,0x69,0x61,0x6c])][_0x587529([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4e5006[_0x587529([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x105d3e/0x3e8:0xe10*_0xc55ee4;return _0x4e5006[_0x587529([0x65,0x78,0x70])]<_0x471af1;}function _0x2e944f(){const _0x31644b=_0x4e5006[_0x587529([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x31644b&&(!!_0x31644b[_0x587529([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x587529([0x2a]))||!!_0x31644b[_0x587529([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x587529([0x41,0x49])));}function _0x4092a9(){const _0x2be401=_0x4e5006[_0x587529([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2be401||0x0==_0x2be401[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x269abb}=new URL(window[_0x587529([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2be401[_0x587529([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x269abb))return!0x0;const _0x4354e1=_0x269abb[_0x587529([0x73,0x70,0x6c,0x69,0x74])](_0x587529([0x2e]));return _0x2be401[_0x587529([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3f4774=>_0x3f4774[_0x587529([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x587529([0x2a])))[_0x587529([0x6d,0x61,0x70])](_0x17d145=>_0x17d145[_0x587529([0x73,0x70,0x6c,0x69,0x74])](_0x587529([0x2e])))[_0x587529([0x73,0x6f,0x6d,0x65])](_0x440c55=>_0x4354e1[_0x587529([0x65,0x76,0x65,0x72,0x79])]((_0x31d4a8,_0x39f07b)=>_0x440c55[_0x39f07b]===_0x31d4a8||_0x440c55[_0x39f07b]===_0x587529([0x2a])));}function _0x582aa8(){return _0x697a68&&_0x1c21f6?new window[(_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3024e9,_0x5e0feb)=>{_0x697a68[_0x587529([0x74,0x68,0x65,0x6e])](_0x3024e9,_0x5e0feb),_0x1c21f6[_0x587529([0x74,0x68,0x65,0x6e])](_0x1c9e1a=>{_0x1c9e1a!=_0x587529([0x56,0x61,0x6c,0x69,0x64])&&_0x3024e9(_0x1c9e1a);},_0x5e0feb);}):_0x697a68||_0x1c21f6||_0x587529([0x56,0x61,0x6c,0x69,0x64]);}}function _0x37987f(_0x1cab37,_0x5c9d9d){return new window[(_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39e0c2=>{if(_0x77ab64())return _0x39e0c2(_0x587529([0x56,0x61,0x6c,0x69,0x64]));_0x3a8239(),_0x4f706f[_0x587529([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x587529([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1477a1=!0x1;const _0x23208c=_0x2de5da();function _0x1355cb(_0x2c599e){return!!_0x2c599e&&(typeof _0x2c599e===_0x587529([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2c599e===_0x587529([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2c599e[_0x587529([0x74,0x68,0x65,0x6e])]===_0x587529([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2c599e[_0x587529([0x63,0x61,0x74,0x63,0x68])]===_0x587529([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4a56a3(_0x1589c4){_0x5ce177(_0x1589c4)[_0x587529([0x74,0x68,0x65,0x6e])](_0x4f6723=>{if(!_0x4f6723||_0x4f6723[_0x587529([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x587529([0x6f,0x6b]))return _0x587529([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2553fa(_0x328340(_0x23208c+_0x5c9d9d))!=_0x4f6723[_0x587529([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x587529([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x587529([0x56,0x61,0x6c,0x69,0x64]);})[_0x587529([0x74,0x68,0x65,0x6e])](_0x1fa907=>(_0x3d74ac(),_0x1fa907),()=>{const _0x2af28c=_0x568a80();return null==_0x2af28c?(_0x3d74ac(),_0x587529([0x56,0x61,0x6c,0x69,0x64])):_0x587529(_0x105d3e-_0x2af28c>(0x630976c5^_0x108dc4)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x587529([0x74,0x68,0x65,0x6e])](_0x39e0c2)[_0x587529([0x63,0x61,0x74,0x63,0x68])](()=>{_0x39e0c2(_0x587529([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4b5a69=0x47331c45^_0x108dc4;function _0x3d74ac(){const _0x406844=_0x587529([0x6c,0x6c,0x63,0x74,0x2d])+_0x2553fa(_0x328340(_0x1cab37)),_0x453523=_0x1d4b03(_0x2553fa(window[_0x587529([0x4d,0x61,0x74,0x68])][_0x587529([0x63,0x65,0x69,0x6c])](_0x105d3e/_0x4b5a69)));window[_0x587529([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x587529([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x406844,_0x453523);}function _0x568a80(){const _0x6e2772=_0x587529([0x6c,0x6c,0x63,0x74,0x2d])+_0x2553fa(_0x328340(_0x1cab37)),_0x190a91=window[_0x587529([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x587529([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x6e2772);return _0x190a91?window[_0x587529([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d4b03(_0x190a91),0x10)*_0x4b5a69:null;}function _0x5ce177(_0x1b014d){return new window[(_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1f4f21,_0x398eb0)=>{_0x1b014d[_0x587529([0x74,0x68,0x65,0x6e])](_0x1f4f21,_0x398eb0),window[_0x587529([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x398eb0,0x47042605^_0x108dc4);});}}_0x4f706f[_0x587529([0x6f,0x6e])](_0x587529([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x32d586,_0x16f30e)=>{if(_0x16f30e[0x0]!=_0x1cab37)return _0x39e0c2(_0x587529([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x16f30e[0x1]={..._0x16f30e[0x1],[_0x587529([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x23208c};},{[_0x587529([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x587529([0x68,0x69,0x67,0x68])}),_0x4f706f[_0x587529([0x6f,0x6e])](_0x587529([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4c942e=>{_0x1355cb(_0x4c942e[_0x587529([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1477a1=!0x0,_0x4a56a3(_0x4c942e[_0x587529([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x587529([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x587529([0x6c,0x6f,0x77])}),_0x27a995[_0x587529([0x74,0x68,0x65,0x6e])](()=>{_0x1477a1||_0x39e0c2(_0x587529([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x77ab64(){return _0x4f706f[_0x587529([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x587529([0x76,0x69,0x65,0x77])][_0x587529([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x587529([0x61,0x75,0x74,0x6f]);}function _0x3a8239(){_0x4f706f[_0x587529([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x587529([0x76,0x69,0x65,0x77])][_0x587529([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x587529([0x61,0x75,0x74,0x6f]);}}function _0x28906e(_0xf24387){const _0x3a99c1=[new window[(_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x40f589=>setTimeout(_0x40f589,0x470ccc09^_0x108dc4)),_0x27a995[_0x587529([0x74,0x68,0x65,0x6e])](()=>new window[(_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1d5b2c=>{let _0x5dd6a3=0x0;_0x4f706f[_0x587529([0x6d,0x6f,0x64,0x65,0x6c])][_0x587529([0x6f,0x6e])](_0x587529([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4c4047,_0x218ebe)=>{_0x218ebe[0x0][_0x587529([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5dd6a3++,_0x5dd6a3==(0x4705f33d^_0x108dc4)&&(_0x1d5b2c(),_0x4c4047[_0x587529([0x6f,0x66,0x66])]());});}))];return window[_0x587529([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x587529([0x72,0x61,0x63,0x65])](_0x3a99c1)[_0x587529([0x74,0x68,0x65,0x6e])](()=>_0xf24387);}async function _0x5ae506(){await _0x27a995,_0x4f706f[_0x587529([0x6d,0x6f,0x64,0x65,0x6c])][_0x587529([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4771ec,_0x4f706f[_0x587529([0x6d,0x6f,0x64,0x65,0x6c])][_0x587529([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4771ec,_0x4f706f[_0x587529([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x587529([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x38ef16(_0x489896){const _0xbf72b7=_0x487768();_0x4f706f[_0xbf72b7]=_0x587529([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x489896,_0x489896!=_0x587529([0x56,0x61,0x6c,0x69,0x64])&&_0x5ae506();}function _0x487768(){const _0x21673c=window[_0x587529([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x587529([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x587529([0x6e,0x6f,0x77])]())[_0x587529([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x587529([0x2e]),'');let _0x3c9f04=_0x587529([0x6d]);for(let _0xf4b27e=0x0;_0xf4b27e<_0x21673c[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xf4b27e+=0x2){let _0x358170=window[_0x587529([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x21673c[_0x587529([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xf4b27e,_0xf4b27e+0x2));_0x358170>=_0x345659[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x358170-=_0x345659[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3c9f04+=_0x345659[_0x358170];}return _0x3c9f04;}function _0x509e26(){const _0x419ce4=_0x5e31ff[_0x587529([0x73,0x70,0x6c,0x69,0x74])](_0x587529([0x2e]));if(0x3!=_0x419ce4[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x229413(_0x419ce4[0x1]);function _0x229413(_0x515b2a){const _0xb6ed61=_0x2b134f(_0x515b2a);return _0xb6ed61&&_0x1152be()?_0xb6ed61:null;function _0x1152be(){const _0x549e93=_0xb6ed61[_0x587529([0x6a,0x74,0x69])],_0x29a8d4=window[_0x587529([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x549e93[_0x587529([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x549e93[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x29b790={..._0xb6ed61,[_0x587529([0x6a,0x74,0x69])]:_0x549e93[_0x587529([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x549e93[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x29b790[_0x587529([0x76,0x63])],_0x328340(_0x29b790)==_0x29a8d4;}}}async function _0x216caa(){let _0x1f4247=!0x0;try{const _0x2f7ce9=_0x5e31ff[_0x587529([0x73,0x70,0x6c,0x69,0x74])](_0x587529([0x2e])),[_0x5e21ca,_0x16f248,_0x4ea838]=_0x2f7ce9;return _0x214f00(_0x5e21ca),await _0x2636fd(_0x5e21ca,_0x16f248,_0x4ea838),_0x1f4247;}catch(_0x14a3a2){return!0x1;}function _0x214f00(_0x1aa3b4){const _0x19a908=_0x2b134f(_0x1aa3b4);_0x19a908&&_0x19a908[_0x587529([0x61,0x6c,0x67])]==_0x587529([0x45,0x53,0x32,0x35,0x36])||(_0x1f4247=!0x1);}async function _0x2636fd(_0x593fd9,_0x2bad78,_0xfc1643){const _0x40e13a=window[_0x587529([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x587529([0x66,0x72,0x6f,0x6d])](_0x42bc1b(_0xfc1643),_0x4e3221=>_0x4e3221[_0x587529([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4c9326=new window[(_0x587529([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x587529([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x593fd9+_0x587529([0x2e])+_0x2bad78),_0x368b83=window[_0x587529([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x587529([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x368b83)return;const _0x49bfff=await _0x368b83[_0x587529([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x587529([0x6a,0x77,0x6b]),_0x192eed,{[_0x587529([0x6e,0x61,0x6d,0x65])]:_0x587529([0x45,0x43,0x44,0x53,0x41]),[_0x587529([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x587529([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x587529([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x368b83[_0x587529([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x587529([0x6e,0x61,0x6d,0x65])]:_0x587529([0x45,0x43,0x44,0x53,0x41]),[_0x587529([0x68,0x61,0x73,0x68])]:{[_0x587529([0x6e,0x61,0x6d,0x65])]:_0x587529([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x49bfff,_0x40e13a,_0x4c9326)||(_0x1f4247=!0x1);}}function _0x2b134f(_0x205aab){return _0x205aab[_0x587529([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x587529([0x65,0x79]))?JSON[_0x587529([0x70,0x61,0x72,0x73,0x65])](_0x42bc1b(_0x205aab)):null;}function _0x42bc1b(_0x1af5b3){return window[_0x587529([0x61,0x74,0x6f,0x62])](_0x1af5b3[_0x587529([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x587529([0x2b]))[_0x587529([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x587529([0x2f])));}function _0x328340(_0x339d4d){let _0x2df4a0=0x1505;function _0x5a7cab(_0x4479d2){for(let _0x35e8f0=0x0;_0x35e8f0<_0x4479d2[_0x587529([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x35e8f0++){const _0x5b26a9=_0x4479d2[_0x587529([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x35e8f0);_0x2df4a0=(_0x2df4a0<<0x5)+_0x2df4a0+_0x5b26a9,_0x2df4a0&=_0x2df4a0;}}function _0x40bec1(_0x20cf68){Array[_0x587529([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x20cf68)?_0x20cf68[_0x587529([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x40bec1):_0x20cf68&&typeof _0x20cf68==_0x587529([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x587529([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x20cf68)[_0x587529([0x73,0x6f,0x72,0x74])]()[_0x587529([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5377bc,_0x19bf97])=>{_0x5a7cab(_0x5377bc),_0x40bec1(_0x19bf97);}):_0x5a7cab(window[_0x587529([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x20cf68));}return _0x40bec1(_0x339d4d),_0x2df4a0>>>0x0;}function _0x2553fa(_0x895137){return _0x895137[_0x587529([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x587529([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x587529([0x30]));}function _0x1d4b03(_0x3c6318){return _0x3c6318[_0x587529([0x73,0x70,0x6c,0x69,0x74])]('')[_0x587529([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x587529([0x6a,0x6f,0x69,0x6e])]('');}function _0x4771ec(){}function _0x587529(_0x7279f2){return _0x7279f2['map'](_0x27ae12=>String['fromCharCode'](_0x27ae12))['join']('');}_0x38ef16(await _0x30dbfd());}(this);}['showFakeVisualSelection'](){const _0x140739=this['editor']['model'];_0x140739['change'](_0x571a63=>{const _0x2ee3ac=_0x140739['document']['selection']['getFirstRange']();if(_0x140739['markers']['has'](u))_0x571a63['updateMarker'](u,{'range':_0x2ee3ac});else{if(_0x2ee3ac['start']['isAtEnd']){const _0x58f489=_0x2ee3ac['start']['getLastMatchingPosition'](({item:_0x5c7812})=>!_0x140739['schema']['isContent'](_0x5c7812),{'boundaries':_0x2ee3ac});_0x571a63['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x571a63['createRange'](_0x58f489,_0x2ee3ac['end'])});}else _0x571a63['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2ee3ac});}});}['hideFakeVisualSelection'](){const _0x3d3bb7=this['editor']['model'];_0x3d3bb7['markers']['has'](u)&&_0x3d3bb7['change'](_0x1e212b=>{_0x1e212b['removeMarker'](u);});}['insertContent'](_0x33dd87,_0x58a5f7){const _0x41d6a9=_0x58a5f7||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x41d6a9))return;const _0x344771=this['editor']['data']['processor']['toView'](_0x33dd87),_0xd86a8=this['editor']['data']['toModel'](_0x344771);this['editor']['model']['change'](_0x4b393a=>{this['hideFakeVisualSelection']();const _0x5d2b07=this['editor']['model']['insertContent'](_0xd86a8,_0x41d6a9);_0x5d2b07&&_0x4b393a['setSelection'](_0x5d2b07);});}['insertContentBelow'](_0x466349){const {model:_0x32ac25}=this['editor'],_0x1392c6=Array['from'](_0x32ac25['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0xb9c5bc=_0x1392c6['length']?_0x32ac25['createPositionAfter'](_0x1392c6['pop']()):_0x32ac25['document']['selection']['getLastPosition']();this['insertContent'](_0x466349,_0xb9c5bc);}}class v extends _0x225aa9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x464cb3('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x5820ad){super(_0x5820ad),this['name']='AIRequestError';}}function i(_0x1ae8e5,_0x440669,_0x4edced){const t=_0x1ae8e5['t'];switch(_0x440669){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',_0x4edced);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4edced);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'},_0x4edced);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 _0x440669;}}class y extends _0x1d320e{['_commandDefinitions'];constructor(_0x134829,_0x2b5727){super(_0x134829),this['_commandDefinitions']=_0x2b5727,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1122d0,_0xa19c0e,_0x40eb8e)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x40eb8e));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3249ea,_0x1ccd33,_0xfd97ac)=>{this['enabledCommandsIds']=_0xfd97ac?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2f84eb=this['editor']['model'];this['_hasContext']=function(_0x285957){const _0x3cfc66=_0x285957['document']['selection'];return _0x3cfc66['isCollapsed']?0x0!==[..._0x3cfc66['getSelectedBlocks']()]['length']&&![..._0x3cfc66['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x285957['hasContent'](_0x3cfc66['getFirstRange']());}(_0x2f84eb);const _0x384172=_0x2f84eb['document']['selection'],_0x1a2781=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3023b0 of _0x384172['getRanges']())for(const _0x4efcbf of _0x3023b0['getItems']())if(_0x4efcbf['is']('element')&&_0x1a2781['includes'](_0x4efcbf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x13c2a3='',_0x1d723f='',_0x7eb174='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x13c2a3,_0x1d723f,_0x7eb174);}}function G(_0x5da3e4,_0x142ce7){const _0x44f48e=new Set();for(const _0x2c7bf3 of _0x5da3e4['values']())(_0x142ce7||!0x1===_0x2c7bf3['requiresContent'])&&_0x44f48e['add'](_0x2c7bf3['id']);return Array['from'](_0x44f48e);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
24
+ _0x2c3b34(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x2948af,_0x34047f,_0x5a2ef8){super(),this['editor']=_0x2948af,this['textAdapter']=_0x34047f,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5a2ef8,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2864f4,_0x328d21,_0x5d6a15)=>{this['view']['value']=this['_sanitizeHTML'](_0x5d6a15);}),this['listenTo'](this['view'],'submitPrompt',(_0x46c8b9,_0x1bf40c)=>{const _0x11afef=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1bf40c,_0x11afef,'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:_0x4b0487,query:_0x555690,htmlContent:_0xcdc60,label:_0x338612,mainActionLabel:_0x26f389}){this['view']['prompt']=_0x338612,this['view']['mainAction']=_0x26f389,this['initialContext']=_0xcdc60,_0x555690&&(this['view']['isRendered']?this['_handleQuery'](_0x555690,_0xcdc60,_0x4b0487,_0x338612):this['view']['once']('render',()=>{this['_handleQuery'](_0x555690,_0xcdc60,_0x4b0487,_0x338612);}));}['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'](_0x3cda9c,_0x4c9b08,_0x27beec,_0x32c7f0){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4c9b08,this['previousQuery']=_0x3cda9c,this['previousLabel']=_0x32c7f0||_0x3cda9c,this['previousActionId']=_0x27beec,new Promise(_0xcc69a2=>{this['textAdapter']['makeRequest']({'query':_0x3cda9c,'context':_0x4c9b08,'onData':_0x5dd45f=>{this['currentResponse']=_0x5dd45f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x27beec})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x796f29=>{_0x796f29 instanceof R?this['view']['handleError'](_0x796f29['message']):this['view']['handleError'](),_0xcc69a2();})['finally'](()=>{this['stopProcessing'](),_0xcc69a2();});});}['_parseAndNormalizeContent'](_0x137c89,_0x2bc256=!0x1){const _0x7e0b59=Z['exec'](_0x137c89);_0x137c89=_0x7e0b59?_0x137c89['substring'](_0x7e0b59[0x1]['length']):_0x137c89['length']<0x64&&!_0x2bc256?'':this['_stripMarkdownSyntax'](_0x137c89);const _0x5d83f1=this['_domParser']['parseFromString'](_0x137c89,'text/html');if(_0x7e0b59){const _0x2af55f=Array['from'](_0x5d83f1['body']['childNodes']);_0x2af55f['reverse']();for(const _0x466f3e of _0x2af55f){if(_0x466f3e['nodeType']==Node['ELEMENT_NODE'])break;_0x466f3e['remove']();}}const _0x305413=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5d83f1['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x305413),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x305413));}['_normalizeResponseHeadings'](_0x133695){const _0x10a483=new _0x8cd78c(this['editor']['editing']['view']['document']),_0x58a14c=new _0x5d9032({'name':/^h[1-5]$/}),_0x5bbc35=[];let _0x56ff22=!0x1;for(const _0x1e8842 of _0x133695)_0x1e8842['is']('element')&&_0x58a14c['match'](_0x1e8842)&&(_0x5bbc35['push'](_0x1e8842),'h1'==_0x1e8842['name']&&(_0x56ff22=!0x0));if(_0x56ff22){for(const _0x35d9b0 of _0x5bbc35)_0x10a483['rename']('h'+(parseInt(_0x35d9b0['name'][0x1])+0x1),_0x35d9b0);}}['_isH1TagSupportEnabled'](){const {data:_0x57e625,editing:_0x237602}=this['editor'],_0x4139d4=_0x57e625['htmlProcessor']['toView']('<h1></h1>'),_0x492ef9=_0x57e625['toView'](_0x57e625['toModel'](_0x4139d4));return!!_0x237602['view']['domConverter']['viewToDom'](_0x492ef9)['querySelector']('h1');}['_sanitizeHTML'](_0x26e396){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x26e396),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x551f2e){const _0x1b1b61=_0x551f2e['trim']();return _0x1b1b61['startsWith']('```html')?_0x1b1b61['endsWith']('```')?_0x1b1b61['substring'](0x7,_0x1b1b61['length']-0x3):_0x1b1b61['substring'](0x7):_0x551f2e;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x1ed088){super(_0x1ed088),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xfc20a9=>i(_0x1ed088,'AI_'+_0xfc20a9['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1ed088,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1ed088,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1ed088,'Stop'));const _0x437595=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x437595['if']('isVisible','ck-hidden',_0x6a1fee=>!_0x6a1fee)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4526d7,_0x24d639){const _0xab81fb=new _0x28c5de(this['locale']);return _0xab81fb['set']({'label':_0x4526d7,'class':_0x24d639||'','isVisible':!0x0,'withText':!0x0}),_0xab81fb;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x1e6319{['contentFieldView'];['copyButtonView'];constructor(_0x564bca,_0x1f2c1d=''){super(_0x564bca),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x439da2=this['bindTemplate'];this['contentFieldView']=new ct(_0x564bca,_0x1f2c1d),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x439da2['if']('isVisible','ck-hidden',_0x434354=>!_0x434354)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x439da2['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 _0x28a448=!0x1;this['on']('change:value',(_0x555741,_0x80e18f,_0x41753e)=>{const _0x189e8c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x41753e),this['isProcessing']&&_0x189e8c&&!_0x28a448&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3d7e0f,_0x44890f,_0x2f1380)=>{_0x28a448=!0x1,_0x2f1380?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x28a448=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x28a448=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5bd849=this['locale'],_0x191ea1=new _0x28c5de(this['locale']),_0xe5422f='ck-ai-form__copy-button';return _0x191ea1['set']({'label':i(_0x5bd849,'Copy'),'icon':U,'class':_0xe5422f,'tooltip':!0x0}),_0x191ea1['bind']('isVisible')['to'](this,'value',_0x364ce1=>!!_0x364ce1),_0x191ea1['bind']('isEnabled')['to'](this,'isProcessing',_0x4c5948=>!_0x4c5948),_0x191ea1['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x191ea1['icon']=_0x54d35b['check'],_0x191ea1['class']=_0xe5422f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x191ea1['icon']=U,_0x191ea1['class']=_0xe5422f;},0x3e8);}),_0x191ea1;}['_copyHTMLToClipboard'](_0x18fe96){const {window:_0x12acdc,document:_0x4f6a15}=_0x55d9df;if(_0x12acdc['ClipboardItem']){const {Blob:_0x52c48c,ClipboardItem:_0x2c585c}=_0x12acdc,_0x3c37a4=[new _0x2c585c({'text/html':new _0x52c48c([_0x18fe96['innerHTML']],{'type':'text/html'}),'text/plain':new _0x52c48c([_0x18fe96['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3c37a4);}else{const _0x392593=_0x4f6a15['createElement']('div');_0x392593['style']['position']='absolute',_0x392593['style']['left']='-9999px',_0x392593['innerHTML']='<span>[</span>'+_0x18fe96['innerHTML']+'<span>]</span>',_0x4f6a15['body']['appendChild'](_0x392593);const _0x119605=_0x4f6a15['createRange']();_0x119605['setStartAfter'](_0x392593['firstElementChild']),_0x119605['setEndBefore'](_0x392593['lastElementChild']);const _0x234152=_0x12acdc['getSelection']();_0x234152['removeAllRanges'](),_0x234152['addRange'](_0x119605),_0x4f6a15['execCommand']('copy'),_0x392593['remove']();}}}class ct extends _0x1e6319{constructor(_0x53dd08,_0x627c1e=''){super(_0x53dd08),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x627c1e,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1e857e){this['element']['innerHTML']=_0x1e857e;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x141c8a=new _0x1e6319(),_0x3ce09c=this['locale'],_0x39f836=new _0x3d3513();return _0x39f836['isVisible']=!0x0,_0x141c8a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x39f836,{'text':i(_0x3ce09c,'AI\x20is\x20writing...')}]}),_0x141c8a['render'](),_0x141c8a;}}class tt extends _0x1e6319{constructor(_0x54a956,_0x232aeb=''){super(_0x54a956);const _0x58538f=new _0x30a25b(),_0x57dc57=this['bindTemplate'];this['set']('text',_0x232aeb),_0x58538f['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x58538f,{'text':_0x57dc57['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x396892,_0x2d8f04){super(_0x396892,_0x2d8f04),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',(_0x1b1fde,_0x1b904f)=>{_0x1b1fde['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1b904f());});}['_createSubmitButton'](){const _0x2f09af=new _0x28c5de(this['locale']),_0x1c2ac8=this['locale'];return _0x2f09af['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x1c2ac8,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2f09af['on']('execute',()=>{this['submit']();}),_0x2f09af['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2ae515,_0x4fca95)=>!_0x2ae515&&_0x4fca95),_0x2f09af;}['_createShowHistoryButton'](){const _0xcd9606=new _0x28c5de(this['locale']),_0x28b41b=this['resultsView'],_0x53f694=this['locale'];_0xcd9606['set']({'label':i(_0x53f694,'History'),'withText':!0x1,'icon':_0x54d35b['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xcd9606['bind']('isOn')['to'](_0x28b41b,'isVisible'),_0xcd9606['bind']('isEnabled')['to'](this,'isEnabled'),_0xcd9606['on']('execute',()=>{_0x28b41b['isVisible']=!_0x28b41b['isVisible'],_0x28b41b['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x53d359=()=>{_0x55d9df['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x179aed=new st(this['queryView']['fieldView']['element']),_0x2f3022=_0x179aed['width'],_0x5c3023='rtl'===_0x53f694['uiLanguageDirection']?'left':'right';_0x179aed['excludeScrollbarsAndBorders'](),_0xcd9606['element']['style'][_0x5c3023]=_0x2f3022-_0x179aed['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x53d359),this['on']('render',_0x53d359),_0xcd9606;}['submit'](){const _0x30fced=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x30fced);}['focus'](_0xc92e1b){-0x1===_0xc92e1b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4f2ef1){super(_0x4f2ef1),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4f2ef1,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x459fb7=0x0;for(const _0x4cfc55 of this['items'])_0x459fb7+=_0x4cfc55['items']['length'];return{'resultsCount':_0x459fb7,'totalItemsCount':_0x459fb7};}['_createClearHistoryButton'](){const _0x53a01f=this['locale'],_0x9318cb=new _0x28c5de(this['locale']);return _0x9318cb['set']({'label':'('+i(_0x53a01f,'Clear')+')','withText':!0x0}),_0x9318cb['on']('execute',()=>this['fire']('clearHistory')),_0x9318cb;}}class hs extends _0x2c6ae4{constructor(_0x648cf1){super();const _0x2a5920=new te(),_0x1096a6=new _0x28c5de(this['locale'],_0x2a5920);this['children']['add'](_0x1096a6),_0x1096a6['set']({'label':_0x648cf1['prompt'],'withText':!0x0}),_0x1096a6['on']('execute',()=>{this['fire']('execute',{'value':_0x33e8bf(_0x648cf1['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x157b3b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x588bf4,_0x58295e)=>{const _0x43db44=Ss(_0x58295e['prompt']);for(const _0x5a8175 of this)if(_0x5a8175!=_0x58295e&&Ss(_0x5a8175['prompt'])===_0x43db44){this['remove'](_0x5a8175);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x59d06f=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x59d06f));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x58fc95=>_0x58fc95)));}}function Ss(_0xca60f3){return _0xca60f3['toLowerCase']()['trim']();}class K extends _0x1e6319{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1eeadd,_0x5d0557,_0x408546=''){super(_0x1eeadd),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x1eeadd),this['contentArea']=new W(_0x1eeadd,_0x408546),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 _0x1b00d8(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x518140({'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 _0x16b9e2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5d0557],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x16b9e2['if']('isError','ck-hidden',_0x195263=>!_0x195263)]},'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'](_0x445fe2=0x1){-0x1===_0x445fe2?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 _0x73fd63=this['locale'],_0x1b27c4=new ht(_0x73fd63,{'queryView':{'label':i(_0x73fd63,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x23cd7d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x73fd63,'Empty\x20history'),'secondary':i(_0x73fd63,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1b27c4['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2aced4,_0xe0e175)=>_0x2aced4&&!_0xe0e175),this['listenTo'](_0x1b27c4,'submit',(_0x40aa68,_0x3463a8)=>{this['prompt']=_0x3463a8;const _0x5a4199=_0x2fc312(_0x3463a8);this['fire']('submitPrompt',_0x5a4199),_0x3463a8['trim']()&&this['_promptHistory']['add']({'prompt':_0x5a4199},0x0);},{'priority':'high'}),_0x1b27c4;}['_createHistoryView'](){const _0x33b878=new rs(this['locale']);return _0x33b878['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x33b878['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x33b878;}['_createToolbar'](){const _0x1e4ed0=new nt(this['locale']);return _0x1e4ed0['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x510bd4,_0x5adf9f,_0x2cff33)=>_0x510bd4&&!_0x5adf9f&&!!_0x2cff33),_0x1e4ed0['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1e4ed0['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3d82e7,_0x321855,_0x2d2604)=>_0x3d82e7&&!_0x321855&&!!_0x2d2604),_0x1e4ed0['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1e4ed0['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x166399,_0x3e56b7)=>_0x166399&&!_0x3e56b7),_0x1e4ed0['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1e4ed0['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1e4ed0['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1e4ed0;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x335767=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x335767,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x112048){const _0xf4db51=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x112048||i(_0xf4db51,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x225aa9{['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[_0x533a6b,a,v,_0x32ad8e];}constructor(_0xdfc7c2){super(_0xdfc7c2),_0xdfc7c2['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0xdfc7c2['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0xdfc7c2['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xdfc7c2['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x392211}=this;this['_aiAdapter']=_0x392211['plugins']['get'](v),this['_dialog']=_0x392211['plugins']['get'](_0x32ad8e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x68acb5=new y(_0x392211,Array['from'](this['_commandDefinitions']['values']()));_0x392211['commands']['add']('showAIAssistant',_0x68acb5),_0x392211['ui']['componentFactory']['add']('aiCommands',_0x5d2cf4=>{const _0x15c2fc=_0x497cb3(_0x5d2cf4);return _0x15c2fc['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x15c2fc['buttonView']['set']({'label':i(_0x5d2cf4,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x15c2fc['on']('execute',_0x4e778e=>this['_onExecute'](_0x4e778e['source']['id'])),_0x224eb3(_0x15c2fc,_0x392211['ui']['view']['body'],function(_0x87a40d){const _0x2d4ba5=o(_0x87a40d['config']['get']('ai.aiAssistant.commands'),_0x87a40d['locale']),_0xf47fc4=B(_0x87a40d,_0x2d4ba5)['filter'](_0x56d299=>_0x56d299['commands']['length']);if(0x1===_0xf47fc4['length'])return B(_0x87a40d,_0xf47fc4[0x0]['commands'])['map'](_0x4dc165=>({'id':_0x4dc165['id'],'label':_0x4dc165['label']}));return _0xf47fc4['map'](_0x44ae8c=>{const {groupId:_0x26c904,groupLabel:_0x4a60cb,commands:_0x105746}=_0x44ae8c,_0x28944d=B(_0x87a40d,_0x105746)['map'](_0x2bd880=>({'id':_0x2bd880['id'],'label':_0x2bd880['label']}));return{'id':_0x26c904,'menu':_0x4a60cb||_0x26c904,'children':_0x28944d};});}(_0x392211),{'ariaLabel':i(_0x5d2cf4,'AI\x20Commands')}),_0x15c2fc['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x68acb5['on']('change:enabledCommandsIds',_0x490c6c),_0x15c2fc['menuView']['once']('render',_0x490c6c),_0x15c2fc;function _0x490c6c(){_0x15c2fc['isEnabled']=_0x68acb5['enabledCommandsIds']['length']>0x0;for(const _0x56cdb5 of _0x15c2fc['menuView']['buttons'])_0x56cdb5['isEnabled']=_0x68acb5['enabledCommandsIds']['includes'](_0x56cdb5['id']);}}),_0x392211['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5ab5b9=>{const _0x50c116=new _0xf928c0(_0x5ab5b9);_0x50c116['buttonView']['set']({'label':i(_0x5ab5b9,'AI\x20Commands'),'icon':E}),_0x50c116['bind']('isEnabled')['to'](_0x68acb5,'enabledCommandsIds',_0x25e634=>_0x25e634['length']>0x0);const _0x45448b=o(_0x392211['config']['get']('ai.aiAssistant.commands'),_0x5ab5b9);return this['_populateMenuBarMenu'](_0x68acb5,_0x50c116,_0x45448b,_0x20990e=>this['_onExecute'](_0x20990e)),_0x50c116;}),_0x392211['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x31a77f=this['_createAIAssistantUIButton'](_0x28c5de);return _0x31a77f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x31a77f;}),_0x392211['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1dfc73=this['_createAIAssistantUIButton'](_0x535300);return _0x1dfc73['set']({'role':'menuitemcheckbox'}),_0x1dfc73;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x51231f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x40b52a;for(const _0x5d2bf3 in _0x51231f){const _0x2e57c9=_0x5d2bf3,_0x2a97a3=_0x51231f[_0x2e57c9];if('aiLicenseKeyValid'==_0x2a97a3||'aiLicenseKeyInvalid'==_0x2a97a3||'aiLicenseKeyExpired'==_0x2a97a3||'aiLicenseKeyDomainLimit'==_0x2a97a3||'aiLicenseKeyNotAllowed'==_0x2a97a3||'aiLicenseKeyEvaluationLimit'==_0x2a97a3||'aiLicenseKeyTrialLimit'==_0x2a97a3||'aiLicenseKeyDevelopmentLimit'==_0x2a97a3||'aiLicenseKeyUsageLimit'==_0x2a97a3){delete _0x51231f[_0x2e57c9],_0x40b52a=_0x2a97a3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x40b52a&&_0x51231f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x40b52a&&_0x51231f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x40b52a&&_0x51231f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x40b52a&&_0x51231f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x40b52a&&_0x51231f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x40b52a&&_0x51231f['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x40b52a&&_0x51231f['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x40b52a&&_0x51231f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4d637b='',_0x255d4a='',_0x16fcf5='custom'){const _0x46c04e=this['editor'],_0x16a0f1=_0x46c04e['editing']['view'],_0x4261ea=_0x46c04e['plugins']['get'](a),_0xb406d4=_0x46c04e['plugins']['get'](_0x533a6b);_0x4261ea['showFakeVisualSelection']();const _0x366aa8=new j(),_0x21e21f=new ClipboardEvent('copy',{'clipboardData':_0x366aa8}),_0x4af062=new _0x3ae11a(_0x366aa8),_0x19afed=new _0x1b12f5(_0x16a0f1,_0x21e21f,{'dataTransfer':_0x4af062});_0xb406d4['_forceMarkersCopy']('comment',()=>{_0x16a0f1['document']['fire']('copy',_0x19afed);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x46c04e,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3cfb6e=_0x4af062['getData']('text/html');const _0x5834bf=_0x46c04e['model']['document']['selection'],_0x4f7238=Array['from'](_0x5834bf['getRanges']());0x1===_0x4f7238['length']&&_0x4f7238[0x0]['isFlat']&&!_0x5834bf['getSelectedElement']()&&''!==_0x3cfb6e['replace'](/&nbsp;/g,'')['trim']()&&(_0x3cfb6e='<p>'+_0x3cfb6e+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x16fcf5,'query':_0x4d637b,'htmlContent':_0x3cfb6e,'label':_0x255d4a,'mainActionLabel':x[_0x46c04e['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2e01d2['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4261ea['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x22133c=new Map(),_0x5e3d91=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x689fde of _0x5e3d91)for(const _0x3f359a of _0x689fde['commands'])_0x22133c['set'](_0x3f359a['id'],{..._0x3f359a,'groupId':_0x689fde['groupId'],'groupLabel':_0x689fde['groupLabel']||_0x689fde['groupId']});return _0x22133c;}['_createAIAssistantUIButton'](_0x5a8d12){const _0x54312b=this['editor'],_0x525cc9=_0x54312b['commands']['get']('showAIAssistant'),_0x496ac9=new _0x5a8d12(_0x54312b['locale']);return _0x496ac9['set']({'label':i(_0x54312b['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x496ac9['bind']('isEnabled')['to'](_0x525cc9),_0x496ac9['bind']('isOn')['to'](this['_dialog'],'id',_0x338ccd=>'aiAssistant'===_0x338ccd),this['listenTo'](_0x496ac9,'execute',()=>{_0x496ac9['isOn']?this['hideUI']():_0x525cc9['execute']();}),_0x496ac9;}['_initView'](){const _0x2d2463=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',()=>{_0x2d2463['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2d2463['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x566be5,ui:{ariaLiveAnnouncer:_0x5b2d95}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1faa10,_0x1d2b34,_0x565956)=>{const _0x305492=this['_aiAssistantController']['currentContext'];_0x565956?_0x5b2d95['announce'](i(_0x566be5,'AI\x20is\x20writing')):_0x305492&&_0x5b2d95['announce'](i(_0x566be5,'Generated\x20content:\x20%0',_0x305492),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x18f373,_0x3d86d6,_0x1181ee)=>{if(_0x1181ee){const _0x526b13=this['_formView']['errorView']['text'];_0x5b2d95['announce'](i(_0x566be5,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x526b13));}});}['_onExecute'](_0x1455ff){const _0xe5ffe5=this['_commandDefinitions']['get'](_0x1455ff),_0x5ba118=this['editor'],_0x4949c2=_0x5ba118['model']['document']['selection'],_0xe4608=_0x5ba118['commands']['get']('showAIAssistant'),_0x1ce1e5=_0x5ba118['plugins']['get'](a),_0x1c321b=''+(_0xe5ffe5['groupId']!==I?_0xe5ffe5['groupLabel']+':\x20':'')+_0xe5ffe5['label'];if(!0x1!==_0xe5ffe5['requiresContent']&&_0x4949c2['isCollapsed']){const _0x476d10=_0xe5cb12(_0x4949c2['getSelectedBlocks']())||_0x5ba118['model']['schema']['getLimitElement'](_0x4949c2);_0x5ba118['model']['change'](_0x5dbf1c=>{_0x5dbf1c['setSelection'](_0x476d10,'in');});}_0x1ce1e5['showFakeVisualSelection'](),_0xe4608['execute'](_0xe5ffe5['prompt'],_0x1c321b,'command:'+_0x1455ff);}['_populateMenuBarMenu'](_0x28b1e7,_0x5672c8,_0x112bb9,_0x1cfde0){const _0xe5dc2c=this['editor'],_0x189e23=_0xe5dc2c['locale'],_0x3c5dd8=new _0xd021e1(_0x189e23),_0x3c704b=B(_0xe5dc2c,_0x112bb9)['filter'](_0x541024=>_0x541024['commands']['length']);0x1===_0x3c704b['length']?this['_getMenuBarGroupButtons']({'command':_0x28b1e7,'commands':_0x3c704b[0x0]['commands'],'parentMenuView':_0x5672c8,'onExecute':_0x1cfde0})['forEach'](_0x1eb53d=>_0x3c5dd8['items']['add'](_0x1eb53d)):_0x3c704b['forEach'](({groupId:_0x34cf44,groupLabel:_0x340263,commands:_0x5eeb43})=>{const _0x3433f=new _0x9f5693(_0x189e23,_0x5672c8),_0x4963cd=new _0xf928c0(_0x189e23),_0x282236=new _0xd021e1(_0x189e23),_0x50a290=this['_getMenuBarGroupButtons']({'command':_0x28b1e7,'commands':_0x5eeb43,'parentMenuView':_0x4963cd,'onExecute':_0x1cfde0});_0x4963cd['buttonView']['set']({'label':_0x340263||_0x34cf44}),_0x4963cd['delegate']('execute')['to'](_0x5672c8),_0x282236['items']['addMany'](_0x50a290),_0x4963cd['panelView']['children']['add'](_0x282236),_0x3433f['children']['add'](_0x4963cd),_0x3c5dd8['items']['add'](_0x3433f);}),_0x5672c8['panelView']['children']['add'](_0x3c5dd8);}['_getMenuBarGroupButtons']({command:_0x38144e,commands:_0x147ada,parentMenuView:_0x10c6f9,onExecute:_0x215b3d}){const _0x29282d=this['editor'],_0x581df1=_0x29282d['locale'];return B(_0x29282d,_0x147ada)['map'](_0x1e02cf=>{const _0x21a33f=new _0x9f5693(_0x581df1,_0x10c6f9),_0x3848a8=new _0x535300(_0x581df1);return _0x3848a8['set']({'label':_0x1e02cf['label']}),_0x3848a8['delegate']('execute')['to'](_0x10c6f9),_0x3848a8['on']('execute',()=>_0x215b3d(_0x1e02cf['id'])),_0x3848a8['bind']('isEnabled')['to'](_0x38144e,'enabledCommandsIds',_0x326ff2=>_0x326ff2['includes'](_0x1e02cf['id'])),_0x21a33f['children']['add'](_0x3848a8),_0x21a33f;});}}function _(_0x51a38e,_0x4f7171){return void 0x0!==_0x51a38e['order']&&void 0x0===_0x4f7171['order']?0x1:void 0x0===_0x51a38e['order']&&void 0x0!==_0x4f7171['order']?-0x1:void 0x0!==_0x51a38e['order']&&void 0x0!==_0x4f7171['order']?_0x51a38e['order']-_0x4f7171['order']:0x0;}function B(_0x2008f6,_0x13f6d4){_0x13f6d4['sort'](_);const _0x5b2134={},_0x3c75e6=[];for(const _0x4b4946 of _0x13f6d4)if(void 0x0!==_0x4b4946['order']){if(_0x4b4946['order']in _0x5b2134)throw new _0x464cb3('ai-commands-config-order-collision',_0x2008f6,{'conflictingDefinitions':[_0x4b4946,_0x5b2134[_0x4b4946['order']]]});_0x5b2134[_0x4b4946['order']]=_0x4b4946,_0x3c75e6['splice'](_0x4b4946['order'],0x0,_0x4b4946);}else _0x3c75e6['push'](_0x4b4946);return _0x3c75e6;}class r extends _0x225aa9{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x221f5f){super(_0x221f5f);const _0x3fd523=_0x221f5f['config'],_0x38dbb3=_0x221f5f['locale'];_0x3fd523['define']('ai.aiAssistant.commands',function(_0x2d1af4){return[{'groupId':'editOrReview','groupLabel':i(_0x2d1af4,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2d1af4,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2d1af4,'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(_0x2d1af4,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2d1af4,'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(_0x2d1af4,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2d1af4,'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(_0x2d1af4,'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(_0x2d1af4,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2d1af4,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2d1af4,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2d1af4,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2d1af4,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2d1af4,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2d1af4,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2d1af4,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2d1af4,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2d1af4,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2d1af4,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2d1af4,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2d1af4,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2d1af4,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2d1af4,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2d1af4,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2d1af4,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2d1af4,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2d1af4,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2d1af4,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x38dbb3)),_0x3fd523['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3fd523['define']('ai.aiAssistant.removeCommands',[]);const _0x483169=o(_0x3fd523['get']('ai.aiAssistant.commands'),_0x38dbb3),_0xf38539=_0x3fd523['get']('ai.aiAssistant.extraCommandGroups'),_0x2ebec4=_0x3fd523['get']('ai.aiAssistant.removeCommands');_0xf38539['forEach'](_0x49b822=>{const _0x18d53b=_0x483169['find'](_0x3b4610=>_0x3b4610['groupId']===_0x49b822['groupId']);_0x18d53b?_0x18d53b['commands']=_0x18d53b['commands']['concat'](_0x49b822['commands']):_0x483169['push'](_0x49b822);}),_0x483169['forEach'](_0x2396cb=>{_0x2396cb['commands']=_0x2396cb['commands']['filter'](_0x5d170c=>!_0x2ebec4['includes'](_0x5d170c['id']));}),_0x3fd523['set']('ai.aiAssistant.commands',_0x483169);}}class P extends _0x225aa9{['abortController'];static get['requires'](){return[v];}constructor(_0x532c01){super(_0x532c01),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2faffc){return this['sendRequest'](_0x2faffc)['catch'](_0x41cf8b=>{if(_0x41cf8b instanceof R)return Promise['reject'](_0x41cf8b);if('AbortError'==_0x41cf8b['name'])return Promise['resolve']();throw console['error'](_0x41cf8b),new _0x464cb3('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x30b9bb,_0x2ebe23){const _0x3a50e4=this['editor']['locale'],_0x11c2c0={'Content-Type':'application/json'};if('object'==typeof _0x30b9bb)Object['assign'](_0x11c2c0,_0x30b9bb);else{if(_0x30b9bb)try{const _0x56ae8f=await _0x30b9bb(_0x2ebe23);Object['assign'](_0x11c2c0,_0x56ae8f);}catch(_0x207de2){return Promise['reject'](new R(i(_0x3a50e4,'AI_ERROR_GET_HEADERS')));}}return _0x11c2c0;}async['_prepareRequestParameters'](_0xac82cf,_0x5ccffd){const _0x3eb66c=this['editor']['locale'];if('object'==typeof _0xac82cf)return _0xac82cf;try{return await _0xac82cf(_0x5ccffd);}catch(_0x2720dc){return Promise['reject'](new R(i(_0x3eb66c,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xee8ba7){super(_0xee8ba7),_0xee8ba7['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xee8ba7['config']['get']('ai.openAI.requestParameters')||_0xee8ba7['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xee8ba7['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0xee8ba7['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0xee8ba7['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x2c4ba4,context:_0x114643,onData:_0x1a47ff,actionId:_0x21b277}){const _0x20b862=this['editor']['locale'],_0x5e9ee6=await this['prepareMessages'](_0x2c4ba4,_0x114643,_0x21b277),_0x43934e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x21b277),_0x1abf4e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x21b277),_0x2de9c5={'messages':_0x5e9ee6,..._0x1abf4e},_0x55c6b4={'method':'POST','headers':_0x43934e,'body':JSON['stringify'](_0x2de9c5),'signal':this['abortController']['signal']},_0x20af07=await fetch(this['_apiUrl'],_0x55c6b4);if(_0x20af07['ok'])return _0x1abf4e['stream']?await this['_readStreamableResponse'](_0x20af07,_0x1a47ff):await this['_readStaticResponse'](_0x20af07,_0x1a47ff),Promise['resolve']();{const _0x18999d=await _0x20af07['text']();return _0x18999d['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x20b862,'AI_ERROR_CONTEXT_LENGTH'))):_0x18999d['includes']('Moderation')?Promise['reject'](new R(i(_0x20b862,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x18999d));}}async['prepareMessages'](_0x41cf3d,_0x1bdb60,_0x357452){let _0x57a685,_0x5bf559;return _0x1bdb60?(_0x57a685='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.',_0x5bf559='Instruction:\x0a'+_0x41cf3d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1bdb60):(_0x57a685='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.',_0x5bf559=_0x41cf3d),[{'role':'system','content':_0x57a685},{'role':'user','content':_0x5bf559}];}async['_readStreamableResponse'](_0x4a1555,_0xd731cc){const _0x2368f8=_0x4a1555['body']['getReader'](),_0xa7700e=new TextDecoder();let _0xf34fbb='',_0x294192='',_0xfb07a0='',_0x5162da=!0x1;for(;!_0x5162da;){const {done:_0x42f8c2,value:_0x3fc934}=await _0x2368f8['read'](),_0x3ff127=_0xf34fbb+_0xa7700e['decode'](_0x3fc934);let _0x1485da='';_0x5162da=_0x42f8c2;try{_0x1485da=this['_cleanUpData'](_0x3ff127),_0xf34fbb='';}catch(_0x3a4b6b){_0xf34fbb=_0x3ff127;continue;}_0x294192+=_0x1485da,!_0x5162da&&this['_isBufferIncomplete'](_0x294192)||_0x294192&&(_0xfb07a0+=_0x294192,_0x294192='',_0xd731cc(_0xfb07a0));}return Promise['resolve']();}async['_readStaticResponse'](_0x47734f,_0x4919c5){return _0x4919c5((await _0x47734f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x54a3dd){const _0x3c8d64=_0x54a3dd['split']('<')['length']!==_0x54a3dd['split']('>')['length'],_0x3681f3=_0x54a3dd['length']<0x1e;return _0x3c8d64&&_0x3681f3;}['_cleanUpData'](_0x3e59b6){return _0x3e59b6['split'](/\n(?![^{]*\})/g)['map'](_0x428a4b=>_0x428a4b['replace']('data:\x20',''))['filter'](_0x541c06=>_0x541c06&&_0x541c06['length']>0x0&&'[DONE]'!==_0x541c06)['map'](_0x1f180f=>{const {choices:_0x154c88}=JSON['parse'](_0x1f180f);if(_0x154c88[0x0]&&_0x154c88[0x0]['delta']&&_0x154c88[0x0]['delta']['content'])return _0x154c88[0x0]['delta']['content'];})['filter'](_0x434d83=>_0x434d83)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2b17ce){super(_0x2b17ce),_0x2b17ce['config']['get']('ai.aws.requestParameters')||_0x2b17ce['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']=_0x2b17ce['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2b17ce['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2b17ce['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2b17ce['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x34e656,context:_0x4984dd,onData:_0x34a687,actionId:_0x5f3570}){const {model:_0x48567a,stream:_0x1f2b11,..._0x1c57c0}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5f3570),_0x434fec={'prompt':await this['preparePrompt'](_0x34e656,_0x4984dd,_0x48567a,_0x5f3570),..._0x1c57c0};this['_apiUrl']?await this['_processProxyRequest'](_0x434fec,_0x48567a,_0x1f2b11,_0x34a687,_0x5f3570):await this['_processAWSRequest'](_0x434fec,_0x48567a,_0x1f2b11,_0x34a687);}async['preparePrompt'](_0x3656b8,_0x4d9faa,_0x1492d7,_0x13458e){let _0x467a86,_0x2dd69d;return _0x4d9faa?(_0x467a86='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.',_0x2dd69d='Instruction:\x0a'+_0x3656b8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4d9faa):(_0x467a86='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.',_0x2dd69d=_0x3656b8),'meta.llama'==this['getModelFamily'](_0x1492d7)?'<<SYS>>\x0a'+_0x467a86+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2dd69d+'\x0a[/INST]':'Human:\x0a'+_0x467a86+'\x0a'+_0x2dd69d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2c96ca){if(/^anthropic\.claude/['test'](_0x2c96ca))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2c96ca))return'ai21.j2';if(/^cohere\.command/['test'](_0x2c96ca))return'cohere.command';if(/^meta\.llama/['test'](_0x2c96ca))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2c96ca));}async['_processProxyRequest'](_0x2315f7,_0x31c639,_0x519ae1,_0x27344d,_0x29c62e){const _0x309b7b={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x29c62e),'body':JSON['stringify']({..._0x2315f7,'model':_0x31c639,'stream':_0x519ae1}),'signal':this['abortController']['signal']},_0x402cc9=await fetch(this['_apiUrl'],_0x309b7b);_0x519ae1?await this['_readStreamableResponse'](_0x402cc9,_0x31c639,_0x27344d):await this['_readStaticResponse'](_0x402cc9,_0x31c639,_0x27344d);}async['_processAWSRequest'](_0x231594,_0x42fabe,_0x4a4b39,_0x1bc2c7){const _0x4d8b49=new _0x493d07(this['_bedrockClientConfig']),_0x5289f1={'body':JSON['stringify'](_0x231594),'contentType':'application/json','accept':'application/json','modelId':_0x42fabe};let _0x2e6029;if(_0x4a4b39){const _0x2c1aca=new _0x51418a(_0x5289f1);_0x2e6029=await _0x4d8b49['send'](_0x2c1aca,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2e6029,_0x42fabe,_0x1bc2c7);}else{const _0x3e0830=new _0x3e1a00(_0x5289f1);_0x2e6029=await _0x4d8b49['send'](_0x3e0830,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2e6029,_0x42fabe,_0x1bc2c7);}}async['_readAsyncIterableResponse'](_0x30a8ff,_0x531fa5,_0x4b0192){const _0x57165e=_0x30a8ff['body'],_0x3d0313=new TextDecoder('utf-8');let _0x5b714f='';for await(const _0x3d8200 of _0x57165e)if(_0x3d8200['chunk']){const _0x1ec4b7=_0x3d0313['decode'](_0x3d8200['chunk']['bytes']),_0x19d43b=JSON['parse'](_0x1ec4b7);_0x5b714f+=this['_getGeneratedText'](_0x19d43b,_0x531fa5),_0x4b0192(_0x5b714f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5178db,_0x4a482d,_0x180257){const _0x24c581=_0x5178db['body'],_0x3ce32c=new TextDecoder('utf-8'),_0x34fb1b=_0x24c581['getReader']();let _0x2c01ea='',_0x32e31a='',_0x177414=!0x1;for(;!_0x177414;){const {done:_0x230dc0,value:_0x546ff0}=await _0x34fb1b['read']();if(_0x177414=_0x230dc0,_0x177414)break;const _0x1f7365=(_0x2c01ea+_0x3ce32c['decode'](_0x546ff0))['split']('\x0a')['map'](_0x326c7b=>{try{return _0x2c01ea='',JSON['parse'](_0x326c7b);}catch(_0x32fcad){return _0x2c01ea=_0x326c7b,null;}})['filter'](_0xaebba=>null!==_0xaebba);_0x1f7365['length']&&(_0x32e31a+=_0x1f7365['map'](_0xf9f932=>this['_getGeneratedText'](_0xf9f932,_0x4a482d))['join'](''),_0x180257(_0x32e31a));}return Promise['resolve']();}async['_readStaticResponse'](_0x1f745,_0x453e0e,_0x5d3987){let _0x245b61;return _0x245b61=_0x1f745 instanceof Response?await _0x1f745['json']():JSON['parse'](Buffer['from'](_0x1f745['body'])['toString']('utf8')),(_0x5d3987(this['_getGeneratedText'](_0x245b61,_0x453e0e)),Promise['resolve']());}['_getGeneratedText'](_0x2af26a,_0x40bd18){switch(this['getModelFamily'](_0x40bd18)){case'anthropic.claude':return _0x2af26a['completion'];case'ai21.j2':return _0x2af26a['completions'][0x0]['data']['text'];case'cohere.command':return _0x2af26a['generations'][0x0]['text'];case'meta.llama':return _0x2af26a['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x4d0b54=>0x1!=_0x4d0b54}};
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':_0x38db3c=>0x1!=_0x38db3c}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x87bbda=>{const {af:{dictionary:_0x412870,getPluralForm:_0x4f4e55}}={'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':_0x268662=>0x1!=_0x268662}};_0x87bbda['af']||={'dictionary':{},'getPluralForm':null},_0x87bbda['af']['dictionary']=Object['assign'](_0x87bbda['af']['dictionary'],_0x412870),_0x87bbda['af']['getPluralForm']=_0x4f4e55;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0xef5069=>{const {af:{dictionary:_0x4069a4,getPluralForm:_0x497924}}={'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':_0x291e0c=>0x1!=_0x291e0c}};_0xef5069['af']||={'dictionary':{},'getPluralForm':null},_0xef5069['af']['dictionary']=Object['assign'](_0xef5069['af']['dictionary'],_0x4069a4),_0xef5069['af']['getPluralForm']=_0x497924;})(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':_0x2b7c59=>0x0==_0x2b7c59?0x0:0x1==_0x2b7c59?0x1:0x2==_0x2b7c59?0x2:_0x2b7c59%0x64>=0x3&&_0x2b7c59%0x64<=0xa?0x3:_0x2b7c59%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':_0x276ea3=>0x0==_0x276ea3?0x0:0x1==_0x276ea3?0x1:0x2==_0x276ea3?0x2:_0x276ea3%0x64>=0x3&&_0x276ea3%0x64<=0xa?0x3:_0x276ea3%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x1fdaea=>{const {ar:{dictionary:_0x577e69,getPluralForm:_0x3e81a2}}={'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':_0x3a97b3=>0x0==_0x3a97b3?0x0:0x1==_0x3a97b3?0x1:0x2==_0x3a97b3?0x2:_0x3a97b3%0x64>=0x3&&_0x3a97b3%0x64<=0xa?0x3:_0x3a97b3%0x64>=0xb?0x4:0x5}};_0x1fdaea['ar']||={'dictionary':{},'getPluralForm':null},_0x1fdaea['ar']['dictionary']=Object['assign'](_0x1fdaea['ar']['dictionary'],_0x577e69),_0x1fdaea['ar']['getPluralForm']=_0x3e81a2;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x1820f4=>{const {ar:{dictionary:_0x4ff98e,getPluralForm:_0x249aea}}={'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':_0x123ef5=>0x0==_0x123ef5?0x0:0x1==_0x123ef5?0x1:0x2==_0x123ef5?0x2:_0x123ef5%0x64>=0x3&&_0x123ef5%0x64<=0xa?0x3:_0x123ef5%0x64>=0xb?0x4:0x5}};_0x1820f4['ar']||={'dictionary':{},'getPluralForm':null},_0x1820f4['ar']['dictionary']=Object['assign'](_0x1820f4['ar']['dictionary'],_0x4ff98e),_0x1820f4['ar']['getPluralForm']=_0x249aea;})(window['CKEDITOR_TRANSLATIONS']||={});