ckeditor5-premium-features
Version:
Premium features for CKEditor 5.
25 lines • 4.64 MB
JavaScript
/*
* Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
!function(_0x20e6c4,_0x41b6bd){'object'==typeof exports&&'undefined'!=typeof module?_0x41b6bd(exports,require('ckeditor5')):'function'==typeof define&&define['amd']?define(['exports','ckeditor5'],_0x41b6bd):_0x41b6bd((_0x20e6c4='undefined'!=typeof globalThis?globalThis:_0x20e6c4||self)['CKEDITOR_PREMIUM_FEATURES']={},_0x20e6c4['CKEDITOR']);}(this,function(_0xc090fa,_0x491313){Object['defineProperty'](_0xc090fa,Symbol['toStringTag'],{'value':'Module'});var _0x329208=Object['create'],_0x5a053c=Object['defineProperty'],_0x453fde=Object['getOwnPropertyDescriptor'],_0x4a1be7=Object['getOwnPropertyNames'],_0x296ae2=Object['getPrototypeOf'],_0x52694f=Object['prototype']['hasOwnProperty'],_0x947326=(_0x9fcaf2,_0x299c9b)=>()=>(_0x299c9b||(_0x9fcaf2((_0x299c9b={'exports':{}})['exports'],_0x299c9b),_0x9fcaf2=null),_0x299c9b['exports']),_0x142dc2=(_0x8add8e,_0xcf6999)=>{let _0x57c931={};for(var _0x57fa68 in _0x8add8e)_0x5a053c(_0x57c931,_0x57fa68,{'get':_0x8add8e[_0x57fa68],'enumerable':!0x0});return _0xcf6999||_0x5a053c(_0x57c931,Symbol['toStringTag'],{'value':'Module'}),_0x57c931;},_0x5e0457=(_0x35f945,_0xe72647,_0x52fa94)=>(_0x52fa94=null!=_0x35f945?_0x329208(_0x296ae2(_0x35f945)):{},((_0x1b058d,_0x3a8045,_0x200b4c,_0x5983b3)=>{if(_0x3a8045&&'object'==typeof _0x3a8045||'function'==typeof _0x3a8045){for(var _0x42ca8f,_0x24458e=_0x4a1be7(_0x3a8045),_0x39bbc3=0x0,_0x3e3b1b=_0x24458e['length'];_0x39bbc3<_0x3e3b1b;_0x39bbc3++)_0x42ca8f=_0x24458e[_0x39bbc3],_0x52694f['call'](_0x1b058d,_0x42ca8f)||_0x42ca8f===_0x200b4c||_0x5a053c(_0x1b058d,_0x42ca8f,{'get':(_0x4ac91b=>_0x3a8045[_0x4ac91b])['bind'](null,_0x42ca8f),'enumerable':!(_0x5983b3=_0x453fde(_0x3a8045,_0x42ca8f))||_0x5983b3['enumerable']});}return _0x1b058d;})(!_0xe72647&&_0x35f945&&_0x35f945['__esModule']?_0x52fa94:_0x5a053c(_0x52fa94,'default',{'value':_0x35f945,'enumerable':!0x0}),_0x35f945));const _0x232fb9='_ungrouppedCommands';function _0x522a2a(_0x21d827,_0x35cd97){const _0x3fe051=(0x0,_0x35cd97['t'])('Other');return _0x21d827['length']?'groupId'in _0x21d827[0x0]?_0x21d827:[{'groupId':_0x232fb9,'groupLabel':_0x3fe051,'order':0x1/0x0,'commands':_0x21d827}]:[{'groupId':_0x232fb9,'groupLabel':_0x3fe051,'order':0x1/0x0,'commands':[]}];}const _0x13787e=globalThis['DataTransfer'],_0x4d8b93='ai-ui';var _0xb2f162=class extends _0x491313['Plugin']{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {editor:_0x46a89f}=this,_0x1314ff=['ck-fake-ai-selection'];_0x46a89f['config']['get']('ai.assistant.useTheme')&&_0x1314ff['push']('ck-ai-assistant-ui_theme'),_0x46a89f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':_0x4d8b93,'view':{'classes':_0x1314ff,'priority':0xc}}),_0x46a89f['conversion']['for']('editingDowncast')['markerToElement']({'model':_0x4d8b93,'view':(_0x240744,{writer:_0x12f7e7})=>{if(!_0x240744['markerRange']['isCollapsed'])return null;const _0x2a3ceb=_0x12f7e7['createUIElement']('span');return _0x12f7e7['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2a3ceb),_0x2a3ceb;}});}afterInit(){this['_blockIfRemovedByLicenseKey'](),async function(_0x2c822b){const _0x209d92='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0x21b1ba=0x791d0,_0x57c363=window['Date']['now'](),_0x880ad8=_0x2c822b['editor'],_0x43b892=new window['Promise'](_0x5f5b37=>{_0x880ad8['once']('ready',_0x5f5b37);}),_0x1ed341={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x1c81db=_0x880ad8['config']['get']('licenseKey');async function _0x28148c(){let _0x131b13,_0x348c91=null,_0x3c58a5=null;try{return'GPL'==_0x1c81db?'NotAllowed':(_0x131b13=_0x4b8982(),_0x131b13?(_0x131b13['usageEndpoint']&&(_0x3c58a5=_0x524ecd(_0x131b13['usageEndpoint'],_0x131b13['jti'])),await _0x13a0e1()?_0xc1b0a()?_0x2f54e6()?'Expired':_0x1bf673()?('evaluation'==_0x131b13['licenseType']&&(_0x348c91=_0x1e8a80('EvaluationLimit')),await _0x49e9d6()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2f54e6(){const _0x58a2e7=['evaluation','trial']['includes'](_0x131b13['licenseType'])?_0x57c363/0x3e8:0xe10*_0x21b1ba;return _0x131b13['exp']<_0x58a2e7;}function _0xc1b0a(){const _0x4d3b14=_0x131b13['features'];return!!_0x4d3b14&&(!!_0x4d3b14['includes']('*')||!!_0x4d3b14['includes']('AI'));}function _0x1bf673(){const _0x575940=_0x131b13['licensedHosts'];if(!_0x575940||0x0==_0x575940['length'])return!0x0;const {hostname:_0x2e2062}=new URL(window['location']['href']);if(_0x575940['includes'](_0x2e2062))return!0x0;const _0x3ef1aa=_0x2e2062['split']('.');return _0x575940['filter'](_0x4fd108=>_0x4fd108['includes']('*'))['map'](_0x28131b=>_0x28131b['split']('.'))['filter'](_0x17a6c6=>_0x17a6c6['length']<=_0x3ef1aa['length'])['map'](_0x1d2007=>Array(_0x3ef1aa['length']-_0x1d2007['length'])['fill']('*'===_0x1d2007[0x0]?'*':'')['concat'](_0x1d2007))['some'](_0x5680fb=>_0x3ef1aa['every']((_0x191d8f,_0x375526)=>_0x5680fb[_0x375526]===_0x191d8f||'*'===_0x5680fb[_0x375526]));}function _0x49e9d6(){return _0x348c91&&_0x3c58a5?new window['Promise']((_0x524779,_0x117f46)=>{_0x348c91['then'](_0x524779,_0x117f46),_0x3c58a5['then'](_0x4f60e2=>{'Valid'!=_0x4f60e2&&_0x524779(_0x4f60e2);},_0x117f46);}):_0x348c91||_0x3c58a5||'Valid';}}function _0x524ecd(_0x2e4d47,_0x1914c9){return new window['Promise'](_0x35e13d=>{if(_0x1b8048())return _0x35e13d('Valid');_0x33a8cf(),_0x880ad8['decorate']('_sendUsageRequest');let _0xbff762=!0x1;const _0x2324af=(0x0,_0x491313['uid'])();function _0x82df32(_0x287fc7){return!!_0x287fc7&&('object'==typeof _0x287fc7||'function'==typeof _0x287fc7)&&'function'==typeof _0x287fc7['then']&&'function'==typeof _0x287fc7['catch'];}function _0x8d35b9(_0x4124d4){_0x2ce23a(_0x4124d4)['then'](_0x219218=>_0x219218&&'ok'==_0x219218['status']?_0x2b9e68(_0x2963b7(_0x2324af+_0x1914c9))!=_0x219218['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x45f26b=>(_0x489d3a(),_0x45f26b),()=>{const _0x2ad55d=_0x53ef9f();return null==_0x2ad55d?(_0x489d3a(),'Valid'):_0x57c363-_0x2ad55d>0x240c8400?'UsageLimit':'Valid';})['then'](_0x35e13d)['catch'](()=>{_0x35e13d('UsageLimit');});const _0x463562=0x36ee80;function _0x489d3a(){const _0x122e4c='llct-'+_0x2b9e68(_0x2963b7(_0x2e4d47)),_0x5d9d7d=_0x1fb244(_0x2b9e68(window['Math']['ceil'](_0x57c363/_0x463562)));window['localStorage']['setItem'](_0x122e4c,_0x5d9d7d);}function _0x53ef9f(){const _0x37bfd7='llct-'+_0x2b9e68(_0x2963b7(_0x2e4d47)),_0x436d4e=window['localStorage']['getItem'](_0x37bfd7);return _0x436d4e?window['parseInt'](_0x1fb244(_0x436d4e),0x10)*_0x463562:null;}function _0x2ce23a(_0x351d78){return new window['Promise']((_0x422bd3,_0x280a0a)=>{_0x351d78['then'](_0x422bd3,_0x280a0a),window['setTimeout'](_0x280a0a,0x1d4c0);});}}_0x880ad8['on']('_sendUsageRequest',(_0x4387e7,_0x2202e4)=>{if(_0x2202e4[0x0]!=_0x2e4d47)return _0x35e13d('UsageLimit');_0x2202e4[0x1]={..._0x2202e4[0x1],'requestId':_0x2324af};},{'priority':'high'}),_0x880ad8['on']('_sendUsageRequest',_0x44b7e6=>{_0x82df32(_0x44b7e6['return'])&&(_0xbff762=!0x0,_0x8d35b9(_0x44b7e6['return']));},{'priority':'low'}),_0x43b892['then'](()=>{_0xbff762||_0x35e13d('UsageLimit');});});function _0x1b8048(){return'auto'==_0x880ad8['editing']['view']['_overlayModeHint'];}function _0x33a8cf(){_0x880ad8['editing']['view']['_overlayModeHint']='auto';}}function _0x1e8a80(_0xdb0580){const _0x43ab43=[new window['Promise'](_0x4fbf33=>setTimeout(_0x4fbf33,0x93ecc)),_0x43b892['then'](()=>new window['Promise'](_0x103092=>{let _0x22aeaf=0x0;_0x880ad8['model']['on']('applyOperation',(_0x2db673,_0x4a1170)=>{_0x4a1170[0x0]['isDocumentOperation']&&_0x22aeaf++,0x5e8==_0x22aeaf&&(_0x103092(),_0x2db673['off']());});}))];return window['Promise']['race'](_0x43ab43)['then'](()=>_0xdb0580);}async function _0x46336a(){await _0x43b892,_0x880ad8['model']['change']=_0x59ddd3,_0x880ad8['model']['enqueueChange']=_0x59ddd3,_0x880ad8['enableReadOnlyMode']('model');}function _0x54baa8(_0x218f1a){const _0x260f45=_0x532739();_0x880ad8[_0x260f45]='aiLicenseKey'+_0x218f1a,'Valid'!=_0x218f1a&&_0x46336a();}function _0x532739(){const _0x1f3b31=window['String'](window['performance']['now']())['replace']('.','');let _0x28e8ad='n';for(let _0xa70c1a=0x0;_0xa70c1a<_0x1f3b31['length'];_0xa70c1a+=0x2){let _0x15d496=window['parseInt'](_0x1f3b31['substring'](_0xa70c1a,_0xa70c1a+0x2));_0x15d496>=0x3e&&(_0x15d496-=0x3e),_0x28e8ad+=_0x209d92[_0x15d496];}return _0x28e8ad;}function _0x4b8982(){const _0x2fa798=_0x1c81db['split']('.');if(0x3!=_0x2fa798['length'])return null;return _0x4ddd15(_0x2fa798[0x1]);function _0x4ddd15(_0x386052){const _0x288e16=_0x384d4a(_0x386052);return _0x288e16&&_0x2f35b8()?_0x288e16:null;function _0x2f35b8(){const _0x7b48ba=_0x288e16['jti'],_0x4be3a7=window['parseInt'](_0x7b48ba['substring'](_0x7b48ba['length']-0x8),0x10),_0x3f2361={..._0x288e16,'jti':_0x7b48ba['substring'](0x0,_0x7b48ba['length']-0x8)};return delete _0x3f2361['vc'],_0x2963b7(_0x3f2361)==_0x4be3a7;}}}async function _0x13a0e1(){let _0x889900=!0x0;try{const [_0x2816d6,_0x55f35a,_0x7185a0]=_0x1c81db['split']('.');return _0x76ba39(_0x2816d6),await _0x1f9dde(_0x2816d6,_0x55f35a,_0x7185a0),_0x889900;}catch{return!0x1;}function _0x76ba39(_0x5a416f){const _0x37ddf8=_0x384d4a(_0x5a416f);_0x37ddf8&&'ES256'==_0x37ddf8['alg']||(_0x889900=!0x1);}async function _0x1f9dde(_0x1ccdfd,_0x4cac2e,_0x677a39){const _0x88c754=window['Uint8Array']['from'](_0x350d32(_0x677a39),_0x5db976=>_0x5db976['charCodeAt'](0x0)),_0x318285=new window['TextEncoder']()['encode'](_0x1ccdfd+'.'+_0x4cac2e),_0x616608=window['crypto']['subtle'];if(!_0x616608)return;const _0x3a6d6d=await _0x616608['importKey']('jwk',_0x1ed341,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x616608['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3a6d6d,_0x88c754,_0x318285)||(_0x889900=!0x1);}}function _0x384d4a(_0x47dd42){return _0x47dd42['startsWith']('ey')?JSON['parse'](_0x350d32(_0x47dd42)):null;}function _0x350d32(_0x2aba03){return window['atob'](_0x2aba03['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2963b7(_0x58423d){let _0x5ab34f=0x1505;function _0x3bd561(_0x181a17){for(let _0x1cf243=0x0;_0x1cf243<_0x181a17['length'];_0x1cf243++){const _0x2c7e39=_0x181a17['charCodeAt'](_0x1cf243);_0x5ab34f=(_0x5ab34f<<0x5)+_0x5ab34f+_0x2c7e39,_0x5ab34f&=_0x5ab34f;}}function _0x49ccf9(_0x24cf9c){Array['isArray'](_0x24cf9c)?_0x24cf9c['forEach'](_0x49ccf9):_0x24cf9c&&'object'==typeof _0x24cf9c?Object['entries'](_0x24cf9c)['sort']()['forEach'](([_0x390b36,_0xcbbd21])=>{_0x3bd561(_0x390b36),_0x49ccf9(_0xcbbd21);}):_0x3bd561(window['String'](_0x24cf9c));}return _0x49ccf9(_0x58423d),_0x5ab34f>>>0x0;}function _0x2b9e68(_0x55706b){return _0x55706b['toString'](0x10)['padStart'](0x8,'0');}function _0x1fb244(_0x370152){return _0x370152['split']('')['reverse']()['join']('');}function _0x59ddd3(){}_0x54baa8(await _0x28148c());}(this);}['_blockIfRemovedByLicenseKey'](){const _0x2f4cf5=this['editor'],_0xc97ebf=(0x0,_0x491313['decodeLicenseKey'])(_0x2f4cf5['config']['get']('licenseKey'));_0xc97ebf&&(0x0,_0x491313['isFeatureBlockedByLicenseKey'])(_0xc97ebf,'AI')&&(_0x2f4cf5['enableReadOnlyMode'](Symbol('invalidLicense')),_0x2f4cf5['_showLicenseError']('featureNotAllowed','AIAssistant'));}showFakeVisualSelection(){const _0x487de9=this['editor']['model'];_0x487de9['change'](_0x19ad75=>{const _0x5c3c81=_0x487de9['document']['selection']['getRanges']();let _0x2efba9=0x0;for(const _0x1a26ad of _0x5c3c81){const _0x1232c7=_0x4d8b93+':'+_0x2efba9;if(_0x487de9['markers']['has'](_0x1232c7))_0x19ad75['updateMarker'](_0x1232c7,{'range':_0x1a26ad});else{if(_0x1a26ad['start']['isAtEnd']){const _0x48c10c=_0x1a26ad['start']['getLastMatchingPosition'](({item:_0xd5a794})=>!_0x487de9['schema']['isContent'](_0xd5a794),{'boundaries':_0x1a26ad});_0x19ad75['addMarker'](_0x1232c7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x19ad75['createRange'](_0x48c10c,_0x1a26ad['end'])});}else _0x19ad75['addMarker'](_0x1232c7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1a26ad});}_0x2efba9++;}});}hideFakeVisualSelection(){const _0x88cbe6=this['editor']['model'],_0x308c61=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](_0x4d8b93));_0x308c61['length']&&_0x88cbe6['change'](_0x3105a6=>{_0x308c61['forEach'](_0x154019=>{_0x3105a6['removeMarker'](_0x154019);});});}insertContent(_0x1e77e0,_0x2f6341){const _0x3e74f0=this['_getAISelection'](),_0x36d0d5=_0x2f6341||_0x3e74f0['getFirstRange']();this['editor']['model']['canEditAt'](_0x36d0d5)&&this['editor']['model']['change'](_0x14b0b1=>{this['hideFakeVisualSelection'](),_0x2f6341||this['_resetContentOfSelectedTableCells'](_0x14b0b1,_0x3e74f0),this['_pasteHTMLUsingClipboard']({'insertAt':_0x36d0d5,'writer':_0x14b0b1,'html':_0x1e77e0});});}insertContentBelow(_0x841b2b){const {model:_0x4d127b}=this['editor'],_0x4d68dc=this['_getAISelection']();_0x4d127b['change'](()=>{const _0x1a3661=this['_prepareTableInsertBelowPosition'](_0x841b2b,_0x4d68dc)||this['_getDefaultInsertBelowPosition'](_0x4d68dc);this['insertContent'](_0x841b2b,_0x1a3661);});}_getAISelection(){const _0x2ea696=this['editor']['model'],_0x40ba5d=Array['from'](_0x2ea696['markers']['getMarkersGroup'](_0x4d8b93))['map'](_0x285ccd=>_0x285ccd['getRange']());return _0x2ea696['createSelection'](_0x40ba5d);}_pasteHTMLUsingClipboard({writer:_0x1d4edc,html:_0x10ccea,insertAt:_0x2f9ff2}){const {view:_0x9ce05a}=this['editor']['editing'],_0x504778=this['editor']['plugins']['get'](_0x491313['ClipboardPipeline']),_0x4e1af4=new _0x13787e();_0x4e1af4['setData']('text/html',_0x10ccea);const _0x2a0c59=new _0x491313['ViewDocumentDomEventData'](_0x9ce05a,new ClipboardEvent('paste',{'clipboardData':_0x4e1af4}),{'dataTransfer':new _0x491313['ViewDataTransfer'](_0x4e1af4)});_0x1d4edc['setSelection'](_0x2f9ff2);const _0x4b3afd=(_0x28a7d2,_0x3bbd3d)=>{_0x3bbd3d['resultRange']&&_0x1d4edc['setSelection'](_0x3bbd3d['resultRange']);};_0x504778['once']('contentInsertion',_0x4b3afd,{'priority':'lowest'}),_0x9ce05a['document']['fire']('paste',_0x2a0c59),_0x504778['off']('contentInsertion',_0x4b3afd);}_getDefaultInsertBelowPosition(_0x52d775){const {model:_0x296832}=this['editor'],_0x2617c4=Array['from'](_0x52d775['getSelectedBlocks']());return _0x2617c4['length']?_0x296832['createPositionAfter'](_0x2617c4['pop']()):_0x52d775['getLastPosition']();}_prepareTableInsertBelowPosition(_0x4c81bb,_0x178cad){const {model:_0x375256,plugins:_0x4c06b2}=this['editor'];if(_0x4c06b2['has']('TableUtils')){const _0x1ba634=_0x4c06b2['get']('TableUtils')['getSelectedTableCells'](_0x178cad);if(_0x1ba634['length']){const _0x5e9707=this['_getTableRowCountFromContent'](_0x4c81bb),_0x20ab51=this['_createEmptyTableRows'](_0x1ba634,_0x5e9707);return _0x375256['createPositionAt'](_0x20ab51,0x0);}}return null;}_getTableRowCountFromContent(_0x155e19){const _0x280cb1=this['editor']['plugins']['get']('TableUtils'),_0x233d20=this['editor']['data']['parse'](_0x155e19,'$documentFragment'),_0x554196=Array['from'](_0x233d20['getChildren']())['filter'](_0x224a00=>_0x224a00['is']('element','table'));let _0x229914=0x0;return _0x554196['forEach'](_0x3216b3=>{_0x229914+=_0x280cb1['getRows'](_0x3216b3);}),_0x229914;}_createEmptyTableRows(_0x21289b,_0x36c4fc){const _0x4a7c24=this['editor']['plugins']['get']('TableUtils'),_0x21a201=_0x4a7c24['getRowIndexes'](_0x21289b),_0x1b73c8=_0x4a7c24['getColumnIndexes'](_0x21289b),_0xc526c3=_0x21a201['last']+0x1,_0x5832a5=_0x1b73c8['first'],_0x14c4c2=_0x21289b[0x0]['findAncestor']('table');for(let _0x2312dc=0x0;_0x2312dc<_0x36c4fc;_0x2312dc++)_0x4a7c24['insertRows'](_0x14c4c2,{'at':_0xc526c3});return _0x14c4c2['getChild'](_0xc526c3)['getChild'](_0x5832a5);}_resetContentOfSelectedTableCells(_0x1ab375,_0x16fdf0){const {plugins:_0x54812c}=this['editor'],{model:_0x3dde57}=_0x1ab375;_0x54812c['has']('TableUtils')&&_0x54812c['get']('TableUtils')['getSelectedTableCells'](_0x16fdf0)['length']&&_0x3dde57['deleteContent'](_0x16fdf0);}},_0x25dd35=class extends _0x491313['Plugin']{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){if(!this['textAdapter'])throw new _0x491313['CKEditorError']('aiadapter-text-adapter-not-set',null);}},_0xd88647=class extends Error{constructor(_0x21ea23){super(_0x21ea23),this['name']='AIRequestError';}};function _0x4d4eec(_0x12cb6d,_0x3c1e87,_0x3a36f0){const t=_0x12cb6d['t'];switch(_0x3c1e87){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',_0x3a36f0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3a36f0);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'},_0x3a36f0);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_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3c1e87;}}var _0x4b25ad=class extends _0x491313['Command']{_commandDefinitions;constructor(_0x21260f,_0x45794d){super(_0x21260f),this['_commandDefinitions']=_0x45794d,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x325550,_0x517937,_0x50b733)=>{this['isEnabled']&&(this['enabledCommandsIds']=_0x5836a7(this['_commandDefinitions'],_0x50b733));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x14db0f,_0x160318,_0x5ac1ef)=>{this['enabledCommandsIds']=_0x5ac1ef?_0x5836a7(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1f0d5b=this['editor']['model'];this['_hasContext']=function(_0x486657){const _0x60b54a=_0x486657['document']['selection'];return _0x60b54a['isCollapsed']?0x0!==[..._0x60b54a['getSelectedBlocks']()]['length']&&![..._0x60b54a['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x486657['hasContent'](_0x60b54a['getFirstRange']());}(_0x1f0d5b);const _0x5c99c8=_0x1f0d5b['document']['selection'],_0x2f97e7=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x376f8e of _0x5c99c8['getRanges']())for(const _0x4a88cc of _0x376f8e['getItems']())if(_0x4a88cc['is']('element')&&_0x2f97e7['includes'](_0x4a88cc['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}execute(_0x43af56='',_0x1c4d10='',_0x130315='custom'){this['editor']['plugins']['get'](_0x226b45)['showUI'](_0x43af56,_0x1c4d10,_0x130315);}};function _0x5836a7(_0x140899,_0x317f57){const _0x406ab7=new Set();for(const _0x4c7431 of _0x140899['values']())(_0x317f57||!0x1===_0x4c7431['requiresContent'])&&_0x406ab7['add'](_0x4c7431['id']);return Array['from'](_0x406ab7);}const _0x10c11b=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),_0x512c61=/* #__PURE__ -- @preserve */
/* #__PURE__ -- @preserve */
(0x0,_0x491313['ObservableMixin'])();var _0x196aa1=class extends _0x512c61{editor;textAdapter;['view'];_sanitizationContainer;['_domParser'];['_xmlSerializer'];constructor(_0x1e19ec,_0x13d5a3,_0xab7ea2){super(),this['editor']=_0x1e19ec,this['textAdapter']=_0x13d5a3,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xab7ea2,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x46b16f,_0xa345b1,_0x5287f6)=>{this['view']['value']=this['_sanitizeHTML'](_0x5287f6);}),this['listenTo'](this['view'],'submitPrompt',(_0x26838a,_0x3e31f7)=>{const _0x20edf5=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3e31f7,_0x20edf5,'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:_0x2e0f1c,query:_0x4cb140,htmlContent:_0x513f67,label:_0x4b326b,mainActionLabel:_0x54c8e7}){this['view']['prompt']=_0x4b326b,this['view']['mainAction']=_0x54c8e7,this['initialContext']=_0x513f67,_0x4cb140&&(this['view']['isRendered']?this['_handleQuery'](_0x4cb140,_0x513f67,_0x2e0f1c,_0x4b326b):this['view']['once']('render',()=>{this['_handleQuery'](_0x4cb140,_0x513f67,_0x2e0f1c,_0x4b326b);}));}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'](_0x54140a,_0xd8d60b,_0x59d96d,_0x31df97){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xd8d60b,this['previousQuery']=_0x54140a,this['previousLabel']=_0x31df97||_0x54140a,this['previousActionId']=_0x59d96d,new Promise(_0x2d1c37=>{this['textAdapter']['makeRequest']({'query':_0x54140a,'context':_0xd8d60b,'onData':_0x35e730=>{this['currentResponse']=_0x35e730,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x59d96d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x305fb7=>{_0x305fb7 instanceof _0xd88647?this['view']['handleError'](_0x305fb7['message']):this['view']['handleError'](),_0x2d1c37();})['finally'](()=>{this['stopProcessing'](),_0x2d1c37();});});}_parseAndNormalizeContent(_0x39a174,_0x198a2f=!0x1){const _0x3b595c=_0x10c11b['exec'](_0x39a174);_0x39a174=_0x3b595c?_0x39a174['substring'](_0x3b595c[0x1]['length']):_0x39a174['length']<0x64&&!_0x198a2f?'':this['_stripMarkdownSyntax'](_0x39a174);const _0x3c599a=this['_domParser']['parseFromString'](_0x39a174,'text/html');if(_0x3b595c){const _0x47c22e=Array['from'](_0x3c599a['body']['childNodes']);_0x47c22e['reverse']();for(const _0xf8b5a1 of _0x47c22e){if(_0xf8b5a1['nodeType']==Node['ELEMENT_NODE'])break;_0xf8b5a1['remove']();}}const _0x259c27=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3c599a['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x259c27);const _0x2d31c2=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4d6503=this['editor']['data']['toModel'](_0x259c27);return _0x2d31c2||_0x4d6503['markers']['clear'](),this['editor']['data']['stringify'](_0x4d6503);}['_normalizeResponseHeadings'](_0x36d27e){const _0x3e6f42=new _0x491313['ViewUpcastWriter'](this['editor']['editing']['view']['document']),_0xa5506a=new _0x491313['Matcher']({'name':/^h[1-5]$/}),_0x34a4a5=[];let _0xeb1e3d=!0x1;for(const _0x12e784 of _0x36d27e)_0x12e784['is']('element')&&_0xa5506a['match'](_0x12e784)&&(_0x34a4a5['push'](_0x12e784),'h1'==_0x12e784['name']&&(_0xeb1e3d=!0x0));if(_0xeb1e3d){for(const _0x5afd75 of _0x34a4a5)_0x3e6f42['rename']('h'+(parseInt(_0x5afd75['name'][0x1])+0x1),_0x5afd75);}}_isH1TagSupportEnabled(){const {data:_0x25a76b,editing:_0x178286}=this['editor'],_0x2d49a8=_0x25a76b['htmlProcessor']['toView']('<h1></h1>'),_0x116ecd=_0x25a76b['toView'](_0x25a76b['toModel'](_0x2d49a8));return!!_0x178286['view']['domConverter']['viewToDom'](_0x116ecd)['querySelector']('h1');}_sanitizeHTML(_0x1c692e){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1c692e),this['_sanitizationContainer']['innerHTML'];}_stripMarkdownSyntax(_0x4e6773){const _0x29d9e2=_0x4e6773['trim']();return _0x29d9e2['startsWith']('```html')?_0x29d9e2['endsWith']('```')?_0x29d9e2['substring'](0x7,_0x29d9e2['length']-0x3):_0x29d9e2['substring'](0x7):_0x4e6773;}};const _0x2d8a7f={'REPLACE':'replace','INSERT':'insert'};var _0x226f9e=class extends _0x491313['ToolbarView']{constructor(_0x5cd06e){super(_0x5cd06e),this['set']('isVisible',!0x1),this['set']('mainAction',_0x2d8a7f['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4eef79=>_0x4d4eec(_0x5cd06e,'AI_'+_0x4eef79['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](_0x4d4eec(_0x5cd06e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](_0x4d4eec(_0x5cd06e,'Try\x20again')),this['stopButton']=this['_createButton'](_0x4d4eec(_0x5cd06e,'Stop'));const _0x1f6322=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1f6322['if']('isVisible','ck-hidden',_0x312952=>!_0x312952)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}_createButton(_0x4c2c26,_0x33021d){const _0x49e27f=new _0x491313['ButtonView'](this['locale']);return _0x49e27f['set']({'label':_0x4c2c26,'class':_0x33021d||'','isVisible':!0x0,'withText':!0x0}),_0x49e27f;}},_0x5c2c2b=class extends _0x491313['View']{contentFieldView;copyButtonView;constructor(_0x9ec5e7,_0x59322b=''){super(_0x9ec5e7),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4cf265=this['bindTemplate'];this['contentFieldView']=new _0x4b242c(_0x9ec5e7,_0x59322b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4cf265['if']('isVisible','ck-hidden',_0x2d99ce=>!_0x2d99ce)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4cf265['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 _0x3d2039=!0x1;this['on']('change:value',(_0x12e9fe,_0x5d16b5,_0x426313)=>{const _0x40c4e6=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x426313),this['isProcessing']&&_0x40c4e6&&!_0x3d2039&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5eb16b,_0x14894f,_0x22d2f5)=>{_0x3d2039=!0x1,_0x22d2f5?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3d2039=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3d2039=!0x0;});}['focus'](){this['element']['focus']();}_createCopyButton(){const _0x56cce9=this['locale'],_0x27f5bf=new _0x491313['ButtonView'](this['locale']),_0x77d948='ck-ai-form__copy-button';return _0x27f5bf['set']({'label':_0x4d4eec(_0x56cce9,'Copy'),'icon':_0x491313['IconCopy'],'class':_0x77d948,'tooltip':!0x0}),_0x27f5bf['bind']('isVisible')['to'](this,'value',_0x5a4256=>!!_0x5a4256),_0x27f5bf['bind']('isEnabled')['to'](this,'isProcessing',_0x4f6060=>!_0x4f6060),_0x27f5bf['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x27f5bf['icon']=_0x491313['IconCheck'],_0x27f5bf['class']=_0x77d948+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x27f5bf['icon']=_0x491313['IconCopy'],_0x27f5bf['class']=_0x77d948;},0x3e8);}),_0x27f5bf;}['_copyHTMLToClipboard'](_0x34c9b9){const {window:_0x146a49,document:_0x490a93}=_0x491313['global'];if(_0x146a49['ClipboardItem']){const {Blob:_0x53c7f0,ClipboardItem:_0xbd09b}=_0x146a49,_0x3ca88a=[new _0xbd09b({'text/html':new _0x53c7f0([_0x34c9b9['innerHTML']],{'type':'text/html'}),'text/plain':new _0x53c7f0([_0x34c9b9['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3ca88a);}else{const _0x1ee5ea=_0x490a93['createElement']('div');_0x1ee5ea['style']['position']='absolute',_0x1ee5ea['style']['left']='-9999px',_0x1ee5ea['innerHTML']='<span>[</span>'+_0x34c9b9['innerHTML']+'<span>]</span>',_0x490a93['body']['appendChild'](_0x1ee5ea);const _0x235e09=_0x490a93['createRange']();_0x235e09['setStartAfter'](_0x1ee5ea['firstElementChild']),_0x235e09['setEndBefore'](_0x1ee5ea['lastElementChild']);const _0x3b6f14=_0x146a49['getSelection']();_0x3b6f14['removeAllRanges'](),_0x3b6f14['addRange'](_0x235e09),_0x490a93['execCommand']('copy'),_0x1ee5ea['remove']();}}},_0x4b242c=class extends _0x491313['View']{constructor(_0x54e50c,_0x57bfd4=''){super(_0x54e50c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x57bfd4,'ck-reset_all-excluded','ck-ai-form__content-field']}});}setContent(_0x5053e){this['element']['innerHTML']=_0x5053e;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}_createLoader(){const _0x5f074e=new _0x491313['View'](),_0x394fa9=this['locale'],_0x160f01=new _0x491313['SpinnerView']();return _0x160f01['isVisible']=!0x0,_0x5f074e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x160f01,{'text':_0x4d4eec(_0x394fa9,'AI\x20is\x20writing...')}]}),_0x5f074e['render'](),_0x5f074e;}},_0x585a53=class extends _0x491313['View']{constructor(_0x36cd36,_0xe45ac7=''){super(_0x36cd36);const _0x562abc=new _0x491313['IconView'](),_0x537e38=this['bindTemplate'];this['set']('text',_0xe45ac7),_0x562abc['content']=_0x491313['IconError'],this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x562abc,{'text':_0x537e38['to']('text')}]});}},_0x9a22d6=class extends _0x491313['AutocompleteView']{submitButtonView;showHistoryButtonView;constructor(_0x2c2c60,_0x165e8b){super(_0x2c2c60,_0x165e8b),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',(_0x465dd6,_0x319487)=>{_0x465dd6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x319487());});}_createSubmitButton(){const _0x18e3b4=new _0x491313['ButtonView'](this['locale']),_0xf2317f=this['locale'];return _0x18e3b4['set']({'icon':_0x491313['IconSubmit'],'label':_0x4d4eec(_0xf2317f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x18e3b4['on']('execute',()=>{this['submit']();}),_0x18e3b4['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2b22e5,_0x24c198)=>!_0x2b22e5&&_0x24c198),_0x18e3b4;}_createShowHistoryButton(){const _0x5a070b=new _0x491313['ButtonView'](this['locale']),_0x2a7f66=this['resultsView'],_0x1b6742=this['locale'];_0x5a070b['set']({'label':_0x4d4eec(_0x1b6742,'History'),'withText':!0x1,'icon':_0x491313['IconAIHistory'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5a070b['bind']('isOn')['to'](_0x2a7f66,'isVisible'),_0x5a070b['bind']('isEnabled')['to'](this,'isEnabled'),_0x5a070b['on']('execute',()=>{_0x2a7f66['isVisible']=!_0x2a7f66['isVisible'],_0x2a7f66['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x54f9b3=()=>{_0x491313['global']['window']['requestAnimationFrame'](()=>{if((0x0,_0x491313['isVisible'])(this['element'])){const _0x18be03=new _0x491313['Rect'](this['queryView']['fieldView']['element']),_0x2c74c5=_0x18be03['width'],_0x4d95be='rtl'===_0x1b6742['uiLanguageDirection']?'left':'right';_0x18be03['excludeScrollbarsAndBorders'](),_0x5a070b['element']['style'][_0x4d95be]=_0x2c74c5-_0x18be03['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x54f9b3),this['on']('render',_0x54f9b3),_0x5a070b;}submit(){const _0xf2a9e8=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xf2a9e8);}['focus'](_0x39f1ea){-0x1===_0x39f1ea?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},_0x18ed46=class extends _0x491313['ListView']{historyGroupView;clearHistoryButton;constructor(_0x14c66c){super(_0x14c66c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x491313['ListItemGroupView'](),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=_0x4d4eec(_0x14c66c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}filter(){let _0x1b907f=0x0;for(const _0x48daaf of this['items'])_0x1b907f+=_0x48daaf['items']['length'];return{'resultsCount':_0x1b907f,'totalItemsCount':_0x1b907f};}_createClearHistoryButton(){const _0x3b3b7c=this['locale'],_0x41a6a1=new _0x491313['ButtonView'](this['locale']);return _0x41a6a1['set']({'label':'('+_0x4d4eec(_0x3b3b7c,'Clear')+')','withText':!0x0}),_0x41a6a1['on']('execute',()=>this['fire']('clearHistory')),_0x41a6a1;}};function _0x522720(_0x3c1bed,_0x1c9c74,{signal:_0x3c6c4f,edges:_0x53229f}={}){let _0x15ef2c,_0x56dcde=null;const _0x2ef9c7=null!=_0x53229f&&_0x53229f['includes']('leading'),_0x3b7c37=null==_0x53229f||_0x53229f['includes']('trailing'),_0x56688b=()=>{null!==_0x56dcde&&(_0x3c1bed['apply'](_0x15ef2c,_0x56dcde),_0x15ef2c=void 0x0,_0x56dcde=null);};let _0x2c47cb=null;const _0x39a6b8=()=>{null!=_0x2c47cb&&clearTimeout(_0x2c47cb),_0x2c47cb=setTimeout(()=>{_0x2c47cb=null,_0x3b7c37&&_0x56688b(),_0x4554ad();},_0x1c9c74);},_0x4554ad=()=>{null!==_0x2c47cb&&(clearTimeout(_0x2c47cb),_0x2c47cb=null),_0x15ef2c=void 0x0,_0x56dcde=null;},_0x4ddf04=function(..._0x102285){if(_0x3c6c4f?.['aborted'])return;_0x15ef2c=this,_0x56dcde=_0x102285;const _0x13ad72=null==_0x2c47cb;_0x39a6b8(),_0x2ef9c7&&_0x13ad72&&_0x56688b();};return _0x4ddf04['schedule']=_0x39a6b8,_0x4ddf04['cancel']=_0x4554ad,_0x4ddf04['flush']=()=>{_0x56688b();},_0x3c6c4f?.['addEventListener']('abort',_0x4554ad,{'once':!0x0}),_0x4ddf04;}function _0xa307bf(_0x1ce065,_0x42c092=0x0,_0x305f66={}){'object'!=typeof _0x305f66&&(_0x305f66={});const {leading:_0x42e614=!0x1,trailing:_0x4a37bc=!0x0,maxWait:_0xf1235e}=_0x305f66,_0x33a763=Array(0x2);let _0x4b2611;_0x42e614&&(_0x33a763[0x0]='leading'),_0x4a37bc&&(_0x33a763[0x1]='trailing');let _0x17b69e=null;const _0x7d3490=_0x522720(function(..._0x553616){_0x4b2611=_0x1ce065['apply'](this,_0x553616),_0x17b69e=null;},_0x42c092,{'edges':_0x33a763}),_0x3cd7be=function(..._0x2ad63b){return null!=_0xf1235e&&(null===_0x17b69e&&(_0x17b69e=Date['now']()),Date['now']()-_0x17b69e>=_0xf1235e)?(_0x4b2611=_0x1ce065['apply'](this,_0x2ad63b),_0x17b69e=Date['now'](),_0x7d3490['cancel'](),_0x7d3490['schedule'](),_0x4b2611):(_0x7d3490['apply'](this,_0x2ad63b),_0x4b2611);};return _0x3cd7be['cancel']=_0x7d3490['cancel'],_0x3cd7be['flush']=()=>(_0x7d3490['flush'](),_0x4b2611),_0x3cd7be;}function _0x1eb39b(_0x33d782,_0x55f292=0x0,_0x2046c7={}){const {leading:_0x46ef1d=!0x0,trailing:_0x5915ad=!0x0}=_0x2046c7;return _0xa307bf(_0x33d782,_0x55f292,{'leading':_0x46ef1d,'maxWait':_0x55f292,'trailing':_0x5915ad});}function _0x5d3349(_0x14ba4c){if(!_0x14ba4c||'object'!=typeof _0x14ba4c)return!0x1;const _0x64f452=Object['getPrototypeOf'](_0x14ba4c);return(null===_0x64f452||_0x64f452===Object['prototype']||null===Object['getPrototypeOf'](_0x64f452))&&'[object\x20Object]'===Object['prototype']['toString']['call'](_0x14ba4c);}function _0x21ffdc(_0x482b7e){return Object['getOwnPropertySymbols'](_0x482b7e)['filter'](_0x367add=>Object['prototype']['propertyIsEnumerable']['call'](_0x482b7e,_0x367add));}function _0x353c3b(_0x2d33d){return null==_0x2d33d?void 0x0===_0x2d33d?'[object\x20Undefined]':'[object\x20Null]':Object['prototype']['toString']['call'](_0x2d33d);}const _0x244c1b='[object\x20RegExp]',_0x10f42b='[object\x20String]',_0x2b93d2='[object\x20Number]',_0x5dc7a8='[object\x20Boolean]',_0x2421d0='[object\x20Arguments]',_0x15bd5b='[object\x20Symbol]',_0x3d46f8='[object\x20Date]',_0xbf853='[object\x20Map]',_0x5113bc='[object\x20Set]',_0x6e9b78='[object\x20Array]',_0x2f9bd2='[object\x20ArrayBuffer]',_0x12c33a='[object\x20Object]',_0x3304dd='[object\x20DataView]',tt='[object\x20Uint8Array]',et='[object\x20Uint8ClampedArray]',it='[object\x20Uint16Array]',st='[object\x20Uint32Array]',nt='[object\x20Int8Array]',rt='[object\x20Int16Array]',ot='[object\x20Int32Array]',at='[object\x20Float32Array]',ct='[object\x20Float64Array]';function lt(_0x524fd9,_0x325879){return _0x524fd9===_0x325879||Number['isNaN'](_0x524fd9)&&Number['isNaN'](_0x325879);}function ht(_0x1453cf,_0x471da9,_0x49422d,_0x12bbd4,_0x5b290e,_0x540aad,_0x5df5ee){const _0xf2ead0=_0x5df5ee(_0x1453cf,_0x471da9,_0x49422d,_0x12bbd4,_0x5b290e,_0x540aad);if(void 0x0!==_0xf2ead0)return _0xf2ead0;if(typeof _0x1453cf==typeof _0x471da9)switch(typeof _0x1453cf){case'bigint':case'string':case'boolean':case'symbol':case'undefined':case'function':return _0x1453cf===_0x471da9;case'number':return _0x1453cf===_0x471da9||Object['is'](_0x1453cf,_0x471da9);case'object':return ut(_0x1453cf,_0x471da9,_0x540aad,_0x5df5ee);}return ut(_0x1453cf,_0x471da9,_0x540aad,_0x5df5ee);}function ut(_0x3b2f65,_0x2f2aac,_0x466eea,_0x202122){if(Object['is'](_0x3b2f65,_0x2f2aac))return!0x0;let _0x3b06b2=_0x353c3b(_0x3b2f65),_0x1b51a1=_0x353c3b(_0x2f2aac);if('[object\x20Arguments]'===_0x3b06b2&&(_0x3b06b2=_0x12c33a),'[object\x20Arguments]'===_0x1b51a1&&(_0x1b51a1=_0x12c33a),_0x3b06b2!==_0x1b51a1)return!0x1;switch(_0x3b06b2){case _0x10f42b:return _0x3b2f65['toString']()===_0x2f2aac['toString']();case _0x2b93d2:return lt(_0x3b2f65['valueOf'](),_0x2f2aac['valueOf']());case _0x5dc7a8:case _0x3d46f8:case _0x15bd5b:return Object['is'](_0x3b2f65['valueOf'](),_0x2f2aac['valueOf']());case _0x244c1b:return _0x3b2f65['source']===_0x2f2aac['source']&&_0x3b2f65['flags']===_0x2f2aac['flags'];case'[object\x20Function]':return _0x3b2f65===_0x2f2aac;}const _0x54d171=(_0x466eea=_0x466eea??new Map())['get'](_0x3b2f65),_0x3eadb4=_0x466eea['get'](_0x2f2aac);if(null!=_0x54d171&&null!=_0x3eadb4)return _0x54d171===_0x2f2aac;_0x466eea['set'](_0x3b2f65,_0x2f2aac),_0x466eea['set'](_0x2f2aac,_0x3b2f65);try{switch(_0x3b06b2){case _0xbf853:if(_0x3b2f65['size']!==_0x2f2aac['size'])return!0x1;for(const [_0x53e868,_0x588569]of _0x3b2f65['entries']())if(!_0x2f2aac['has'](_0x53e868)||!ht(_0x588569,_0x2f2aac['get'](_0x53e868),_0x53e868,_0x3b2f65,_0x2f2aac,_0x466eea,_0x202122))return!0x1;return!0x0;case _0x5113bc:{if(_0x3b2f65['size']!==_0x2f2aac['size'])return!0x1;const _0x54ef31=Array['from'](_0x3b2f65['values']()),_0x50faf0=Array['from'](_0x2f2aac['values']());for(let _0x544d46=0x0;_0x544d46<_0x54ef31['length'];_0x544d46++){const _0x489c92=_0x54ef31[_0x544d46],_0x40fd3a=_0x50faf0['findIndex'](_0x4b7435=>ht(_0x489c92,_0x4b7435,void 0x0,_0x3b2f65,_0x2f2aac,_0x466eea,_0x202122));if(-0x1===_0x40fd3a)return!0x1;_0x50faf0['splice'](_0x40fd3a,0x1);}return!0x0;}case _0x6e9b78:case tt:case et:case it:case st:case'[object\x20BigUint64Array]':case nt:case rt:case ot:case'[object\x20BigInt64Array]':case at:case ct:if('undefined'!=typeof Buffer&&Buffer['isBuffer'](_0x3b2f65)!==Buffer['isBuffer'](_0x2f2aac))return!0x1;if(_0x3b2f65['length']!==_0x2f2aac['length'])return!0x1;for(let _0xcbc623=0x0;_0xcbc623<_0x3b2f65['length'];_0xcbc623++)if(!ht(_0x3b2f65[_0xcbc623],_0x2f2aac[_0xcbc623],_0xcbc623,_0x3b2f65,_0x2f2aac,_0x466eea,_0x202122))return!0x1;return!0x0;case _0x2f9bd2:return _0x3b2f65['byteLength']===_0x2f2aac['byteLength']&&ut(new Uint8Array(_0x3b2f65),new Uint8Array(_0x2f2aac),_0x466eea,_0x202122);case _0x3304dd:return _0x3b2f65['byteLength']===_0x2f2aac['byteLength']&&_0x3b2f65['byteOffset']===_0x2f2aac['byteOffset']&&ut(new Uint8Array(_0x3b2f65),new Uint8Array(_0x2f2aac),_0x466eea,_0x202122);case'[object\x20Error]':return _0x3b2f65['name']===_0x2f2aac['name']&&_0x3b2f65['message']===_0x2f2aac['message'];case _0x12c33a:{if(!(ut(_0x3b2f65['constructor'],_0x2f2aac['constructor'],_0x466eea,_0x202122)||_0x5d3349(_0x3b2f65)&&_0x5d3349(_0x2f2aac)))return!0x1;const _0x2bb866=[...Object['keys'](_0x3b2f65),..._0x21ffdc(_0x3b2f65)],_0x22320d=[...Object['keys'](_0x2f2aac),..._0x21ffdc(_0x2f2aac)];if(_0x2bb866['length']!==_0x22320d['length'])return!0x1;for(let _0x549d05=0x0;_0x549d05<_0x2bb866['length'];_0x549d05++){const _0x522e3e=_0x2bb866[_0x549d05],_0x3df2b4=_0x3b2f65[_0x522e3e];if(!Object['hasOwn'](_0x2f2aac,_0x522e3e))return!0x1;if(!ht(_0x3df2b4,_0x2f2aac[_0x522e3e],_0x522e3e,_0x3b2f65,_0x2f2aac,_0x466eea,_0x202122))return!0x1;}return!0x0;}default:return!0x1;}}finally{_0x466eea['delete'](_0x3b2f65),_0x466eea['delete'](_0x2f2aac);}}function dt(){}function ft(_0x1c8497,_0x2d88c5){return function(_0x393cee,_0x388489,_0x16cfdd){return ht(_0x393cee,_0x388489,void 0x0,void 0x0,void 0x0,void 0x0,_0x16cfdd);}(_0x1c8497,_0x2d88c5,dt);}function mt(_0x43b38f){return ArrayBuffer['isView'](_0x43b38f)&&!(_0x43b38f instanceof DataView);}function pt(_0x502533,_0x13c1d2,_0x5b53e7,_0x2a60e7=new Map(),_0x22c03a=void 0x0){const _0x55f022=_0x22c03a?.(_0x502533,_0x13c1d2,_0x5b53e7,_0x2a60e7);if(void 0x0!==_0x55f022)return _0x55f022;if(function(_0x4226a7){return null==_0x4226a7||'object'!=typeof _0x4226a7&&'function'!=typeof _0x4226a7;}(_0x502533))return _0x502533;if(_0x2a60e7['has'](_0x502533))return _0x2a60e7['get'](_0x502533);if(Array['isArray'](_0x502533)){const _0x5ceaf9=new Array(_0x502533['length']);_0x2a60e7['set'](_0x502533,_0x5ceaf9);for(let _0x1a71d2=0x0;_0x1a71d2<_0x502533['length'];_0x1a71d2++)_0x5ceaf9[_0x1a71d2]=pt(_0x502533[_0x1a71d2],_0x1a71d2,_0x5b53e7,_0x2a60e7,_0x22c03a);return Object['hasOwn'](_0x502533,'index')&&(_0x5ceaf9['index']=_0x502533['index']),Object['hasOwn'](_0x502533,'input')&&(_0x5ceaf9['input']=_0x502533['input']),_0x5ceaf9;}if(_0x502533 instanceof Date)return new Date(_0x502533['getTime']());if(_0x502533 instanceof RegExp){const _0x155cb5=new RegExp(_0x502533['source'],_0x502533['flags']);return _0x155cb5['lastIndex']=_0x502533['lastIndex'],_0x155cb5;}if(_0x502533 instanceof Map){const _0x27de3e=new Map();_0x2a60e7['set'](_0x502533,_0x27de3e);for(const [_0x44a47a,_0x5ae50e]of _0x502533)_0x27de3e['set'](_0x44a47a,pt(_0x5ae50e,_0x44a47a,_0x5b53e7,_0x2a60e7,_0x22c03a));return _0x27de3e;}if(_0x502533 instanceof Set){const _0x1114cb=new Set();_0x2a60e7['set'](_0x502533,_0x1114cb);for(const _0x324ef4 of _0x502533)_0x1114cb['add'](pt(_0x324ef4,void 0x0,_0x5b53e7,_0x2a60e7,_0x22c03a));return _0x1114cb;}if('undefined'!=typeof Buffer&&Buffer['isBuffer'](_0x502533))return _0x502533['subarray']();if(mt(_0x502533)){const _0x19339f=new(Object['getPrototypeOf'](_0x502533))['constructor'](_0x502533['length']);_0x2a60e7['set'](_0x502533,_0x19339f);for(let _0x5d4edf=0x0;_0x5d4edf<_0x502533['length'];_0x5d4edf++)_0x19339f[_0x5d4edf]=pt(_0x502533[_0x5d4edf],_0x5d4edf,_0x5b53e7,_0x2a60e7,_0x22c03a);return _0x19339f;}if(_0x502533 instanceof ArrayBuffer||'undefined'!=typeof SharedArrayBuffer&&_0x502533 instanceof SharedArrayBuffer)return _0x502533['slice'](0x0);if(_0x502533 instanceof DataView){const _0x4f4cab=new DataView(_0x502533['buffer']['slice'](0x0),_0x502533['byteOffset'],_0x502533['byteLength']);return _0x2a60e7['set'](_0x502533,_0x4f4cab),gt(_0x4f4cab,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x4f4cab;}if('undefined'!=typeof File&&_0x502533 instanceof File){const _0x58fcd3=new File([_0x502533],_0x502533['name'],{'type':_0x502533['type']});return _0x2a60e7['set'](_0x502533,_0x58fcd3),gt(_0x58fcd3,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x58fcd3;}if('undefined'!=typeof Blob&&_0x502533 instanceof Blob){const _0x23aa61=new Blob([_0x502533],{'type':_0x502533['type']});return _0x2a60e7['set'](_0x502533,_0x23aa61),gt(_0x23aa61,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x23aa61;}if(_0x502533 instanceof Error){const _0x5585ac=structuredClone(_0x502533);return _0x2a60e7['set'](_0x502533,_0x5585ac),_0x5585ac['message']=_0x502533['message'],_0x5585ac['name']=_0x502533['name'],_0x5585ac['stack']=_0x502533['stack'],_0x5585ac['cause']=_0x502533['cause'],_0x5585ac['constructor']=_0x502533['constructor'],gt(_0x5585ac,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x5585ac;}if(_0x502533 instanceof Boolean){const _0x208b1d=new Boolean(_0x502533['valueOf']());return _0x2a60e7['set'](_0x502533,_0x208b1d),gt(_0x208b1d,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x208b1d;}if(_0x502533 instanceof Number){const _0x4c0422=new Number(_0x502533['valueOf']());return _0x2a60e7['set'](_0x502533,_0x4c0422),gt(_0x4c0422,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x4c0422;}if(_0x502533 instanceof String){const _0x23e794=new String(_0x502533['valueOf']());return _0x2a60e7['set'](_0x502533,_0x23e794),gt(_0x23e794,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x23e794;}if('object'==typeof _0x502533&&function(_0x2054f5){switch(_0x353c3b(_0x2054f5)){case _0x2421d0:case _0x6e9b78:case _0x2f9bd2:case _0x3304dd:case _0x5dc7a8:case _0x3d46f8:case at:case ct:case nt:case rt:case ot:case _0xbf853:case _0x2b93d2:case _0x12c33a:case _0x244c1b:case _0x5113bc:case _0x10f42b:case _0x15bd5b:case tt:case et:case it:case st:return!0x0;default:return!0x1;}}(_0x502533)){const _0x36a250=Object['create'](Object['getPrototypeOf'](_0x502533));return _0x2a60e7['set'](_0x502533,_0x36a250),gt(_0x36a250,_0x502533,_0x5b53e7,_0x2a60e7,_0x22c03a),_0x36a250;}return _0x502533;}function gt(_0x550ace,_0x402de5,_0x20c9ba=_0x550ace,_0x155106,_0x179223){const _0x471a14=[...Object['keys'](_0x402de5),..._0x21ffdc(_0x402de5)];for(let _0x514938=0x0;_0x514938<_0