@ckeditor/ckeditor5-uploadcare 0.0.0-nightly-next-20260111.0 → 0.0.0-nightly-next-20260112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x35bcf2,Command as _0x344b9c}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0xacb543,IconGooglePhotos as _0x3dfb9f,IconGoogleDrive as _0x2bdc4f,IconFacebook as _0x1d2898,IconDropbox as _0x13e0f2,IconUploadcareLink as _0x4e99a4,IconUploadcareImageUpload as _0x4f4a2f,IconError as _0x3cac49,IconUploadcareImageEdit as _0x4882dd}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0xeb5fa0,MenuBarMenuListItemButtonView as _0x319f8b,View as _0x1ae180,FocusCycler as _0x246209,Dialog as _0x1dac6c,DialogViewPosition as _0x2857d0,SpinnerView as _0x166f58,IconView as _0x5c05eb,Notification as _0x111ea3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x532b36,DomEmitterMixin as _0x461074,global as _0x5c3320,getAncestors as _0x147f80,ObservableMixin as _0x4079d,uid as _0x30a2d4,createElement as _0x443707}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x597ee9}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x151677,info as _0x2cc042}from'@uploadcare/upload-client';import*as _0x438bcd from'@uploadcare/file-uploader';var S=function(_0x21ffd8){return _0x21ffd8['Local']='local',_0x21ffd8['URL']='url',_0x21ffd8['Dropbox']='dropbox',_0x21ffd8['GDrive']='gdrive',_0x21ffd8['Facebook']='facebook',_0x21ffd8['GPhotos']='gphotos',_0x21ffd8['OneDrive']='onedrive',_0x21ffd8;}({});function T(_0xe353d0,_0x580993,_0x2a77f4){const t=_0xe353d0['t'],_0x4b40de=_0xe353d0['t'];switch(_0x580993){case S['Local']:return{'text':_0x4b40de('Insert'===_0x2a77f4?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x4b40de('From\x20computer')};case S['URL']:return{'text':'Insert'===_0x2a77f4?_0x4b40de('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x4b40de('Via\x20URL')};case S['Dropbox']:return{'text':t('Insert'===_0x2a77f4?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case S['Facebook']:return{'text':t('Insert'===_0x2a77f4?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case S['GDrive']:return{'text':t('Insert'===_0x2a77f4?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case S['GPhotos']:return{'text':t('Insert'===_0x2a77f4?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case S['OneDrive']:return{'text':t('Insert'===_0x2a77f4?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x580993;}}class A extends _0x35bcf2{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'UploadcareUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x21f095=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2c2504;for(const _0x44b196 in _0x21f095){const _0x45493f=_0x44b196,_0x35d81c=_0x21f095[_0x45493f];if('uploadcareLicenseKeyValid'==_0x35d81c||'uploadcareLicenseKeyInvalid'==_0x35d81c||'uploadcareLicenseKeyExpired'==_0x35d81c||'uploadcareLicenseKeyDomainLimit'==_0x35d81c||'uploadcareLicenseKeyNotAllowed'==_0x35d81c||'uploadcareLicenseKeyEvaluationLimit'==_0x35d81c||'uploadcareLicenseKeyUsageLimit'==_0x35d81c){delete _0x21f095[_0x45493f],_0x2c2504=_0x35d81c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x2c2504&&_0x21f095['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x2c2504&&_0x21f095['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x2c2504&&_0x21f095['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x2c2504&&_0x21f095['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x2c2504&&_0x21f095['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x2c2504&&_0x21f095['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x43c226}=this,_0x31325d=_0x43c226['commands']['get']('uploadcare');if(!_0x31325d)return;const _0x4d5ff4=this['_normalizeConfigSourceList'](_0x43c226['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x233eb6,_0x496561)=>{const _0x516a97=this['_getIntegrationKey'](_0x496561['type']);return _0x233eb6[_0x516a97]||(_0x233eb6[_0x516a97]=[]),_0x233eb6[_0x516a97]['push'](_0x496561),_0x233eb6;},{});_0x43c226['plugins']['has']('ImageInsertUI')&&_0x43c226['commands']['get']('uploadcare')&&Object['entries'](_0x4d5ff4)['forEach'](([_0x238c90,_0x3a9555])=>{_0x43c226['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x238c90,'observable':()=>_0x31325d,'buttonViewCreator':()=>this['_createToolbarButton'](_0x3a9555),'formViewCreator':()=>this['_createDropdownButtons'](_0x3a9555),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x3a9555),'override':'assetManager'!==_0x238c90});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x30710b){const {locale:_0x30ae1f}=this['editor'];return _0x30710b['map'](_0x38a486=>{const _0x57c999=T(_0x30ae1f,_0x38a486,'Insert');switch(_0x38a486){case S['Local']:return{'icon':_0x4f4a2f,'type':S['Local'],..._0x57c999};case S['URL']:return{'icon':_0x4e99a4,'type':S['URL'],..._0x57c999};case S['Dropbox']:return{'icon':_0x13e0f2,'type':S['Dropbox'],..._0x57c999};case S['Facebook']:return{'icon':_0x1d2898,'type':S['Facebook'],..._0x57c999};case S['GDrive']:return{'icon':_0x2bdc4f,'type':S['GDrive'],..._0x57c999};case S['GPhotos']:return{'icon':_0x3dfb9f,'type':S['GPhotos'],..._0x57c999};case S['OneDrive']:return{'icon':_0xacb543,'type':S['OneDrive'],..._0x57c999};}});}['_getIntegrationKey'](_0x1b1f02){switch(_0x1b1f02){case S['Local']:return'upload';case S['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x307cca,_0x554983){const _0x3e9b1f=this['editor'],_0xc40494=new _0x307cca(_0x3e9b1f['locale']),_0x180e38=_0x3e9b1f['commands']['get']('uploadcare');return _0xc40494['bind']('isEnabled')['to'](_0x180e38),_0xc40494['on']('execute',()=>{_0x180e38['execute'](_0x554983);}),_0xc40494;}['_createToolbarButton'](_0x57f7ad){const {locale:_0x320e1d}=this['editor'],_0x530da4=this['editor']['plugins']['get']('ImageInsertUI'),_0x22c0f6=_0x57f7ad[0x0],_0x2794f5=this['_createButton'](_0xeb5fa0,_0x22c0f6['type']);return _0x2794f5['icon']=_0x22c0f6['icon'],_0x2794f5['bind']('label')['to'](_0x530da4,'isImageSelected',_0x2fb07e=>T(_0x320e1d,_0x22c0f6['type'],_0x2fb07e?'Replace':'Insert')['text']),_0x2794f5['tooltip']=!0x0,_0x2794f5;}['_createDropdownButtons'](_0x4a67bc){const {locale:_0x4ea834}=this['editor'],_0x5a2ce3=this['editor']['plugins']['get']('ImageInsertUI');return _0x4a67bc['map'](_0x301771=>{const _0xf3851e=this['_createButton'](_0xeb5fa0,_0x301771['type']);return _0xf3851e['withText']=!0x0,_0xf3851e['icon']=_0x301771['icon'],_0xf3851e['bind']('label')['to'](_0x5a2ce3,'isImageSelected',_0xf8f702=>T(_0x4ea834,_0x301771['type'],_0xf8f702?'Replace':'Insert')['text']),_0xf3851e;});}['_createMenuBarButtons'](_0xa59fd6){return _0xa59fd6['map'](_0x2ff073=>{const _0x49412f=this['_createButton'](_0x319f8b,_0x2ff073['type']);return _0x49412f['icon']=_0x2ff073['icon'],_0x49412f['label']=_0x2ff073['shortText'],_0x49412f;});}}class K extends _0x1ae180{['focusTracker'];['focusCycler'];constructor(_0x258638){super(_0x258638),this['focusTracker']=new _0x532b36(),this['focusCycler']=new _0x246209({'focusables':this['createCollection'](),'focusTracker':this['focusTracker']});}['getFocusableElement'](){return{'tag':'div','attributes':{'aria-hidden':'true','tabindex':'0'},'on':{'focus':this['bindTemplate']['to'](()=>{this['focusCycler']['fire']('forwardCycle');})}};}}class O extends K{constructor(_0x2d9c12,_0x41c86b){super(_0x2d9c12),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':[{'tag':'uc-file-uploader-inline','attributes':{'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'uploader-'+_0x41c86b}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function D(_0x4e6c0b,_0x3f7588){const _0xc3bcf=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x5bfbeb=>_0x5bfbeb<=_0x3f7588)['map'](_0x5a5916=>_0x4e6c0b['replace'](/\/$/,'')+'/-/resize/'+_0x5a5916+'x/\x20'+_0x5a5916+'w');return{'imageFallbackUrl':_0x4e6c0b,'imageSources':[{'srcset':_0xc3bcf['join'](',\x20'),'sizes':'(max-width:\x20'+_0x3f7588+'px)\x20100vw,\x20'+_0x3f7588+'px','type':'image/webp'}]};}function F(_0x484748,_0x1c7b3b,_0x3753f5){const _0x434652=_0x484748['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x434652?parseInt(_0x434652[0x1],0xa):_0x1c7b3b,'height':_0x434652?parseInt(_0x434652[0x2],0xa):_0x3753f5};}function $(_0x1644da,_0x55caf2){const _0x1a7e30=new(_0x461074())(),_0x1f7a94=_0x1644da['plugins']['get']('ImageUtils'),_0x71de18=_0x1644da['editing']['mapper']['toViewElement'](_0x55caf2),_0x38d31=_0x1f7a94['findViewImgElement'](_0x71de18),_0x1dafe1=_0x1644da['editing']['view']['domConverter']['viewToDom'](_0x38d31),_0x3beae1=_0x55caf2['getAttribute']('width'),_0x3e8a88=_0x55caf2['getAttribute']('height'),_0x524ba3='image-processing';_0x1644da['editing']['view']['change'](_0x3ac322=>{_0x3ac322['addClass'](_0x524ba3,_0x71de18),_0x3ac322['setStyle']('aspect-ratio',_0x3beae1+'/'+_0x3e8a88,_0x38d31);}),_0x1a7e30['listenTo'](_0x1dafe1,'load',()=>{_0x1a7e30['stopListening'](_0x1dafe1,'load'),_0x1644da['editing']['view']['change'](_0x2c745c=>{_0x2c745c['removeClass'](_0x524ba3,_0x71de18),_0x2c745c['removeStyle']('aspect-ratio',_0x38d31);});});}function B(_0x40f2c2){if(Array['isArray'](_0x40f2c2)){const _0xbed8be=_0x40f2c2['map'](B);return _0x28ea47=>_0xbed8be['some'](_0x464067=>_0x464067(_0x28ea47));}if('origin'==_0x40f2c2){const _0x3abc06=_0x5c3320['window']['location']['origin'];return _0x3d2cb7=>new URL(_0x3d2cb7,_0x5c3320['document']['baseURI'])['origin']==_0x3abc06;}return'function'==typeof _0x40f2c2?_0x40f2c2:_0x40f2c2 instanceof RegExp?_0x51cfdb=>!(!_0x51cfdb['match'](_0x40f2c2)&&!_0x51cfdb['replace'](/^https?:\/\//,'')['match'](_0x40f2c2)):()=>!0x1;}function V(_0x22d92c,_0x242fb7){return _0x147f80(_0x22d92c['target'])['includes'](_0x242fb7);}class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x4079d(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x8cdf3d,_0x1a1939,_0x573b06){super(),this['_editor']=_0x8cdf3d,this['_editing']=_0x1a1939,this['_dialog']=_0x8cdf3d['plugins']['get'](_0x1dac6c),this['_api']=_0x1a1939['ctxElement']['getAPI'](),this['_type']=_0x573b06,this['_editing']['configElement']['setAttribute']('source-list',this['_type']),this['_initDialog'](),this['_initListeners'](),this['_api']['initFlow']();}['destroy'](){this['_formView']&&(this['_formView']['destroy'](),this['_formView']=null),this['_api']&&this['_api']['doneFlow'](),this['stopListening'](),this['stopDelegating']();}['_initDialog'](){const {locale:_0x905710,model:_0x2a2972}=this['_editor'],_0x2997b2=_0x2a2972['document']['selection']['getSelectedElement'](),_0x3abc46=_0x2997b2&&(_0x2997b2['is']('element','imageBlock')||_0x2997b2['is']('element','imageInline'));this['_formView']=new O(_0x905710,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x4f4a2f,'title':T(_0x905710,this['_type'],_0x3abc46?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x2857d0['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x4d8a56=>!V(_0x4d8a56,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x408a40}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x5b9699=>{const _0x40e16a=_0x408a40['length'];for(const _0x3cb17a of _0x408a40){const _0x1ac341=_0x3cb17a===_0x408a40[_0x40e16a-0x1],{cdnUrl:_0x584667,fileInfo:_0x3567b2}=_0x3cb17a;if(!_0x584667||!_0x3567b2)continue;const {width:_0x1e649,height:_0x38f442}=_0x3567b2['imageInfo'],_0x5965ab=F(_0x584667,_0x1e649,_0x38f442),_0x152b55=D(_0x584667,_0x5965ab['width']),_0x4d1060={'id':_0x3567b2['uuid'],'type':'image','attributes':{'imageDimension':_0x5965ab,..._0x152b55}};this['_insertAsset'](_0x4d1060,_0x1ac341,_0x5b9699);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x3df8a6=>{'idle'===_0x3df8a6['detail']['status']&&!_0x3df8a6['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===S['Local']?this['_api']['setCurrentActivity'](S['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x31ac8c,_0x502a7d,_0x1ca7e7){const _0x1060a8=this['_editor']['model']['document']['selection'],_0x257673=_0x1060a8['getSelectedElement'](),_0x2fff99=!(!_0x257673||!_0x257673['is']('element','imageInline'));_0x1ca7e7['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x31ac8c,_0x2fff99),_0x502a7d||_0x1ca7e7['setSelection'](_0x1060a8['getLastPosition']());}['_insertImage'](_0xfa55fb,_0x141cd0){const _0x56a815=this['_editor'],{imageDimension:_0x265d4c,imageFallbackUrl:_0x4e4695,imageSources:_0x3c96f8}=_0xfa55fb['attributes'];_0x56a815['execute']('insertImage',{'imageType':_0x141cd0?'imageInline':null,'source':{'uploadcareImageId':_0xfa55fb['id'],'src':_0x4e4695,'sources':_0x3c96f8,..._0x265d4c}});}}class M extends _0x344b9c{['_editing'];['_controller']=null;static get['requires'](){return[_0x1dac6c,z];}constructor(_0x35d3d3){super(_0x35d3d3),this['_editing']=_0x35d3d3['plugins']['get'](z);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x2de98d){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new j(this['editor'],this['_editing'],_0x2de98d);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class q{static['upload']({file:_0x3e2c5b,..._0x2992ff}){return _0x151677(_0x3e2c5b,_0x2992ff);}static['getInfo'](_0x985361,_0x516e4e){return _0x2cc042(_0x985361,_0x516e4e);}}class W extends _0x35bcf2{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x597ee9,z];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x57897a=this['editor'];if(!!!_0x57897a['config']['get']('uploadcare'))return;_0x57897a['plugins']['get'](_0x597ee9)['createUploadAdapter']=_0x49ba6d=>new G(_0x49ba6d,_0x57897a),_0x57897a['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x5c927b,{imageElement:_0x3468d9,data:_0x4d74bc})=>{_0x57897a['model']['change'](_0x6619c5=>{_0x6619c5['setAttribute']('uploadcareImageId',_0x4d74bc['uploadcareImageId'],_0x3468d9);});});}}class G{['loader'];['editor'];['controller'];constructor(_0x5c7669,_0x560152){this['loader']=_0x5c7669,this['editor']=_0x560152,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x59e7c4=await this['loader']['file'];return q['upload']({'file':_0x59e7c4,'publicKey':this['editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':this['controller']['signal'],'onProgress':_0x3a88e7=>{_0x3a88e7&&_0x3a88e7['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x3a88e7['value']);}})['then'](async _0x3b7da9=>{const {imageFallbackUrl:_0x25b3d3,imageSources:_0x25e15a}=D(_0x3b7da9['cdnUrl'],_0x3b7da9['imageInfo']['width']);return{'uploadcareImageId':_0x3b7da9['uuid'],'default':_0x25b3d3,'sources':_0x25e15a};})['catch'](()=>{const _0x54bc56=t('Cannot\x20upload\x20file:')+('\x20'+_0x59e7c4['name']+'.');return Promise['reject'](_0x54bc56);});}['abort'](){this['controller']['abort']();}}class z extends _0x35bcf2{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',W,_0x1dac6c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x275326){super(_0x275326),this['ucContextId']=_0x30a2d4();}['init'](){const _0x51a7fc=this['editor'];_0x51a7fc['commands']['add']('uploadcare',new M(_0x51a7fc));}['afterInit'](){this['_initSchema'](),this['_initConversion'](),this['_initConfig'](),this['_initCtx'](),this['_initImageProcessingIndicator'](),this['listenTo'](this['editor'],'destroy',()=>{this['_configElement']&&(this['_configElement']['remove'](),this['_configElement']=null),this['_ctxElement']&&(this['_ctxElement']['remove'](),this['_ctxElement']=null);const _0x21018c=_0x5c3320['document']['querySelector']('input[uploadcare-file-input]');_0x21018c&&_0x21018c['remove']();}),async function(_0x579853){const _0x40bf1c=_0x59efaf([0x68,0x67,0x50,0x36,0x38,0x70,0x71,0x63,0x37,0x4f,0x42,0x4a,0x78,0x39,0x75,0x33,0x7a,0x72,0x48,0x61,0x74,0x59,0x55,0x58,0x66,0x30,0x34,0x54,0x64,0x56,0x6b,0x4d,0x46,0x6d,0x77,0x43,0x73,0x35,0x53,0x44,0x41,0x76,0x6a,0x32,0x31,0x69,0x57,0x51,0x47,0x65,0x5a,0x4b,0x4c,0x79,0x52,0x6c,0x45,0x4e,0x6e,0x6f,0x49,0x62]),_0xc28fe7=0x535f8c3a,_0x4bb96d=0x5358f2ba^_0xc28fe7,_0x53469d=window[_0x59efaf([0x44,0x61,0x74,0x65])][_0x59efaf([0x6e,0x6f,0x77])](),_0x545d05=_0x579853[_0x59efaf([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x180952=new window[(_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x87b810=>{_0x545d05[_0x59efaf([0x6f,0x6e,0x63,0x65])](_0x59efaf([0x72,0x65,0x61,0x64,0x79]),_0x87b810);}),_0x13c5d4={[_0x59efaf([0x6b,0x74,0x79])]:_0x59efaf([0x45,0x43]),[_0x59efaf([0x75,0x73,0x65])]:_0x59efaf([0x73,0x69,0x67]),[_0x59efaf([0x63,0x72,0x76])]:_0x59efaf([0x50,0x2d,0x32,0x35,0x36]),[_0x59efaf([0x78])]:_0x59efaf([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]),[_0x59efaf([0x79])]:_0x59efaf([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]),[_0x59efaf([0x61,0x6c,0x67])]:_0x59efaf([0x45,0x53,0x32,0x35,0x36])},_0x23f3f2=_0x545d05[_0x59efaf([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x59efaf([0x67,0x65,0x74])](_0x59efaf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5f3a16(){let _0x307833,_0x2f4582=null,_0x3a2b9a=null;try{if(_0x23f3f2==_0x59efaf([0x47,0x50,0x4c]))return _0x59efaf([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x307833=_0x431b19(),!_0x307833)return _0x59efaf([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x307833[_0x59efaf([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3a2b9a=_0x2136d6(_0x307833[_0x59efaf([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x307833[_0x59efaf([0x6a,0x74,0x69])])),await _0x2821af()?_0x1ce0d8()?_0x15f6de()?_0x59efaf([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x441324()?(_0x307833[_0x59efaf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x59efaf([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2f4582=_0x78802b(_0x59efaf([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2f8cb2()):_0x59efaf([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x59efaf([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x59efaf([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x59efaf([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x15f6de(){const _0x15381e=[_0x59efaf([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x59efaf([0x74,0x72,0x69,0x61,0x6c])][_0x59efaf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x307833[_0x59efaf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x53469d/0x3e8:0xe10*_0x4bb96d;return _0x307833[_0x59efaf([0x65,0x78,0x70])]<_0x15381e;}function _0x1ce0d8(){const _0x526261=_0x307833[_0x59efaf([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x526261&&(!!_0x526261[_0x59efaf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x59efaf([0x2a]))||!!_0x526261[_0x59efaf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x59efaf([0x55,0x50,0x4c,0x43])));}function _0x441324(){const _0x2ca425=_0x307833[_0x59efaf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2ca425||0x0==_0x2ca425[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x467f3a}=new URL(window[_0x59efaf([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2ca425[_0x59efaf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x467f3a))return!0x0;const _0x4a1ef0=_0x467f3a[_0x59efaf([0x73,0x70,0x6c,0x69,0x74])](_0x59efaf([0x2e]));return _0x2ca425[_0x59efaf([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5932ed=>_0x5932ed[_0x59efaf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x59efaf([0x2a])))[_0x59efaf([0x6d,0x61,0x70])](_0x47c613=>_0x47c613[_0x59efaf([0x73,0x70,0x6c,0x69,0x74])](_0x59efaf([0x2e])))[_0x59efaf([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x178a80=>_0x178a80[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4a1ef0[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x59efaf([0x6d,0x61,0x70])](_0x50c70e=>Array(_0x4a1ef0[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x50c70e[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x59efaf([0x66,0x69,0x6c,0x6c])](_0x50c70e[0x0]===_0x59efaf([0x2a])?_0x59efaf([0x2a]):'')[_0x59efaf([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x50c70e))[_0x59efaf([0x73,0x6f,0x6d,0x65])](_0xf3f7a5=>_0x4a1ef0[_0x59efaf([0x65,0x76,0x65,0x72,0x79])]((_0x23925f,_0x1805e0)=>_0xf3f7a5[_0x1805e0]===_0x23925f||_0xf3f7a5[_0x1805e0]===_0x59efaf([0x2a])));}function _0x2f8cb2(){return _0x2f4582&&_0x3a2b9a?new window[(_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x73a215,_0x1cb1de)=>{_0x2f4582[_0x59efaf([0x74,0x68,0x65,0x6e])](_0x73a215,_0x1cb1de),_0x3a2b9a[_0x59efaf([0x74,0x68,0x65,0x6e])](_0x583d65=>{_0x583d65!=_0x59efaf([0x56,0x61,0x6c,0x69,0x64])&&_0x73a215(_0x583d65);},_0x1cb1de);}):_0x2f4582||_0x3a2b9a||_0x59efaf([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2136d6(_0x578310,_0x290b1f){return new window[(_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45b8b4=>{if(_0x38fe2e())return _0x45b8b4(_0x59efaf([0x56,0x61,0x6c,0x69,0x64]));_0x18444f(),_0x545d05[_0x59efaf([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x59efaf([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x39bf2d=!0x1;const _0x4c2941=_0x30a2d4();function _0x3edcbc(_0x668067){return!!_0x668067&&(typeof _0x668067===_0x59efaf([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x668067===_0x59efaf([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x668067[_0x59efaf([0x74,0x68,0x65,0x6e])]===_0x59efaf([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x668067[_0x59efaf([0x63,0x61,0x74,0x63,0x68])]===_0x59efaf([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5e624b(_0x204857){_0x4ab492(_0x204857)[_0x59efaf([0x74,0x68,0x65,0x6e])](_0x289409=>{if(!_0x289409||_0x289409[_0x59efaf([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x59efaf([0x6f,0x6b]))return _0x59efaf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x478f70(_0x4f0264(_0x4c2941+_0x290b1f))!=_0x289409[_0x59efaf([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x59efaf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x59efaf([0x56,0x61,0x6c,0x69,0x64]);})[_0x59efaf([0x74,0x68,0x65,0x6e])](_0x1206d1=>(_0x596337(),_0x1206d1),()=>{const _0x94b914=_0x495991();return null==_0x94b914?(_0x596337(),_0x59efaf([0x56,0x61,0x6c,0x69,0x64])):_0x59efaf(_0x53469d-_0x94b914>(0x7753083a^_0xc28fe7)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x59efaf([0x74,0x68,0x65,0x6e])](_0x45b8b4)[_0x59efaf([0x63,0x61,0x74,0x63,0x68])](()=>{_0x45b8b4(_0x59efaf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xdd64b2=0x536962ba^_0xc28fe7;function _0x596337(){const _0x5d77d1=_0x59efaf([0x6c,0x6c,0x63,0x74,0x2d])+_0x478f70(_0x4f0264(_0x578310)),_0x4d3e6a=_0x3f7fbe(_0x478f70(window[_0x59efaf([0x4d,0x61,0x74,0x68])][_0x59efaf([0x63,0x65,0x69,0x6c])](_0x53469d/_0xdd64b2)));window[_0x59efaf([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x59efaf([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5d77d1,_0x4d3e6a);}function _0x495991(){const _0x51b8c4=_0x59efaf([0x6c,0x6c,0x63,0x74,0x2d])+_0x478f70(_0x4f0264(_0x578310)),_0x25e767=window[_0x59efaf([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x59efaf([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x51b8c4);return _0x25e767?window[_0x59efaf([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f7fbe(_0x25e767),0x10)*_0xdd64b2:null;}function _0x4ab492(_0x1c8c3b){return new window[(_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1ffae4,_0x4b82b8)=>{_0x1c8c3b[_0x59efaf([0x74,0x68,0x65,0x6e])](_0x1ffae4,_0x4b82b8),window[_0x59efaf([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4b82b8,0x535e58fa^_0xc28fe7);});}}_0x545d05[_0x59efaf([0x6f,0x6e])](_0x59efaf([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x289c4b,_0x4b6923)=>{if(_0x4b6923[0x0]!=_0x578310)return _0x45b8b4(_0x59efaf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4b6923[0x1]={..._0x4b6923[0x1],[_0x59efaf([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4c2941};},{[_0x59efaf([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x59efaf([0x68,0x69,0x67,0x68])}),_0x545d05[_0x59efaf([0x6f,0x6e])](_0x59efaf([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xb5a61c=>{_0x3edcbc(_0xb5a61c[_0x59efaf([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x39bf2d=!0x0,_0x5e624b(_0xb5a61c[_0x59efaf([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x59efaf([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x59efaf([0x6c,0x6f,0x77])}),_0x180952[_0x59efaf([0x74,0x68,0x65,0x6e])](()=>{_0x39bf2d||_0x45b8b4(_0x59efaf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x38fe2e(){return _0x545d05[_0x59efaf([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x59efaf([0x76,0x69,0x65,0x77])][_0x59efaf([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x59efaf([0x61,0x75,0x74,0x6f]);}function _0x18444f(){_0x545d05[_0x59efaf([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x59efaf([0x76,0x69,0x65,0x77])][_0x59efaf([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x59efaf([0x61,0x75,0x74,0x6f]);}}function _0x78802b(_0x304d85){const _0x4a7ebf=[new window[(_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x354e6e=>setTimeout(_0x354e6e,0x5356b2f6^_0xc28fe7)),_0x180952[_0x59efaf([0x74,0x68,0x65,0x6e])](()=>new window[(_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x9a599b=>{let _0x14b394=0x0;_0x545d05[_0x59efaf([0x6d,0x6f,0x64,0x65,0x6c])][_0x59efaf([0x6f,0x6e])](_0x59efaf([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x34ebb8,_0x94f79b)=>{_0x94f79b[0x0][_0x59efaf([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x14b394++,_0x14b394==(0x535f89d2^_0xc28fe7)&&(_0x9a599b(),_0x34ebb8[_0x59efaf([0x6f,0x66,0x66])]());});}))];return window[_0x59efaf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x59efaf([0x72,0x61,0x63,0x65])](_0x4a7ebf)[_0x59efaf([0x74,0x68,0x65,0x6e])](()=>_0x304d85);}async function _0x1c4d8b(){await _0x180952,_0x545d05[_0x59efaf([0x6d,0x6f,0x64,0x65,0x6c])][_0x59efaf([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x25624a,_0x545d05[_0x59efaf([0x6d,0x6f,0x64,0x65,0x6c])][_0x59efaf([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x25624a,_0x545d05[_0x59efaf([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x59efaf([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x46899b(_0x1e022c){const _0x55828d=_0x38bf81();_0x545d05[_0x55828d]=_0x59efaf([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1e022c,_0x1e022c!=_0x59efaf([0x56,0x61,0x6c,0x69,0x64])&&_0x1c4d8b();}function _0x38bf81(){const _0x53821c=window[_0x59efaf([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x59efaf([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x59efaf([0x6e,0x6f,0x77])]())[_0x59efaf([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x59efaf([0x2e]),'');let _0x2c2bc5=_0x59efaf([0x68]);for(let _0x1bdfa9=0x0;_0x1bdfa9<_0x53821c[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1bdfa9+=0x2){let _0x39eb38=window[_0x59efaf([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x53821c[_0x59efaf([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1bdfa9,_0x1bdfa9+0x2));_0x39eb38>=_0x40bf1c[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x39eb38-=_0x40bf1c[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2c2bc5+=_0x40bf1c[_0x39eb38];}return _0x2c2bc5;}function _0x431b19(){const _0x1296fb=_0x23f3f2[_0x59efaf([0x73,0x70,0x6c,0x69,0x74])](_0x59efaf([0x2e]));if(0x3!=_0x1296fb[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4843ab(_0x1296fb[0x1]);function _0x4843ab(_0x5c03e5){const _0x58a09c=_0xfe7242(_0x5c03e5);return _0x58a09c&&_0x491581()?_0x58a09c:null;function _0x491581(){const _0x33ebb0=_0x58a09c[_0x59efaf([0x6a,0x74,0x69])],_0x2cd7a0=window[_0x59efaf([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x33ebb0[_0x59efaf([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x33ebb0[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4f6ca4={..._0x58a09c,[_0x59efaf([0x6a,0x74,0x69])]:_0x33ebb0[_0x59efaf([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x33ebb0[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4f6ca4[_0x59efaf([0x76,0x63])],_0x4f0264(_0x4f6ca4)==_0x2cd7a0;}}}async function _0x2821af(){let _0x117e2e=!0x0;try{const _0x517aa9=_0x23f3f2[_0x59efaf([0x73,0x70,0x6c,0x69,0x74])](_0x59efaf([0x2e])),[_0x368fb1,_0x4fb63c,_0x1d63cc]=_0x517aa9;return _0x39d90a(_0x368fb1),await _0x555ecf(_0x368fb1,_0x4fb63c,_0x1d63cc),_0x117e2e;}catch{return!0x1;}function _0x39d90a(_0x1bc368){const _0x25610a=_0xfe7242(_0x1bc368);_0x25610a&&_0x25610a[_0x59efaf([0x61,0x6c,0x67])]==_0x59efaf([0x45,0x53,0x32,0x35,0x36])||(_0x117e2e=!0x1);}async function _0x555ecf(_0x57b018,_0x1ebeb0,_0x56e6c7){const _0xc9f8f6=window[_0x59efaf([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x59efaf([0x66,0x72,0x6f,0x6d])](_0xcd48a4(_0x56e6c7),_0x3c0f1c=>_0x3c0f1c[_0x59efaf([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2b37b7=new window[(_0x59efaf([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x59efaf([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x57b018+_0x59efaf([0x2e])+_0x1ebeb0),_0x54f70f=window[_0x59efaf([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x59efaf([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x54f70f)return;const _0x53a8d5=await _0x54f70f[_0x59efaf([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x59efaf([0x6a,0x77,0x6b]),_0x13c5d4,{[_0x59efaf([0x6e,0x61,0x6d,0x65])]:_0x59efaf([0x45,0x43,0x44,0x53,0x41]),[_0x59efaf([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x59efaf([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x59efaf([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x54f70f[_0x59efaf([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x59efaf([0x6e,0x61,0x6d,0x65])]:_0x59efaf([0x45,0x43,0x44,0x53,0x41]),[_0x59efaf([0x68,0x61,0x73,0x68])]:{[_0x59efaf([0x6e,0x61,0x6d,0x65])]:_0x59efaf([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x53a8d5,_0xc9f8f6,_0x2b37b7)||(_0x117e2e=!0x1);}}function _0xfe7242(_0x135ac4){return _0x135ac4[_0x59efaf([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x59efaf([0x65,0x79]))?JSON[_0x59efaf([0x70,0x61,0x72,0x73,0x65])](_0xcd48a4(_0x135ac4)):null;}function _0xcd48a4(_0x59502b){return window[_0x59efaf([0x61,0x74,0x6f,0x62])](_0x59502b[_0x59efaf([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x59efaf([0x2b]))[_0x59efaf([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x59efaf([0x2f])));}function _0x4f0264(_0x587153){let _0x4ce078=0x1505;function _0x57b5dd(_0x35abff){for(let _0x919d16=0x0;_0x919d16<_0x35abff[_0x59efaf([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x919d16++){const _0x140554=_0x35abff[_0x59efaf([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x919d16);_0x4ce078=(_0x4ce078<<0x5)+_0x4ce078+_0x140554,_0x4ce078&=_0x4ce078;}}function _0xf76b7f(_0x56d9d9){Array[_0x59efaf([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x56d9d9)?_0x56d9d9[_0x59efaf([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xf76b7f):_0x56d9d9&&typeof _0x56d9d9==_0x59efaf([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x59efaf([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x56d9d9)[_0x59efaf([0x73,0x6f,0x72,0x74])]()[_0x59efaf([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x68b8fc,_0x46d89e])=>{_0x57b5dd(_0x68b8fc),_0xf76b7f(_0x46d89e);}):_0x57b5dd(window[_0x59efaf([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x56d9d9));}return _0xf76b7f(_0x587153),_0x4ce078>>>0x0;}function _0x478f70(_0x2b9bda){return _0x2b9bda[_0x59efaf([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x59efaf([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x59efaf([0x30]));}function _0x3f7fbe(_0x5572c6){return _0x5572c6[_0x59efaf([0x73,0x70,0x6c,0x69,0x74])]('')[_0x59efaf([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x59efaf([0x6a,0x6f,0x69,0x6e])]('');}function _0x25624a(){}function _0x59efaf(_0x504c93){return _0x504c93['map'](_0x312372=>String['fromCharCode'](_0x312372))['join']('');}_0x46899b(await _0x5f3a16());}(this);}['_initSchema'](){const _0x19c89=this['editor']['model']['schema'];_0x19c89['isRegistered']('imageBlock')&&_0x19c89['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x19c89['isRegistered']('imageInline')&&_0x19c89['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x14cc6d=this['editor'];_0x14cc6d['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x14cc6d['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x6ae563=>_0x6ae563['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x5d4226=_0x14cc6d['commands']['get']('replaceImageSource');_0x5d4226&&this['listenTo'](_0x5d4226,'cleanupImage',(_0x4b88cc,[_0x358af5,_0x3fb3a1])=>{_0x358af5['removeAttribute']('uploadcareImageId',_0x3fb3a1);});}['_initConfig'](){const _0x47b822=this['editor']['config']['get']('uploadcare.uploader')||{},_0x31afbb=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x443707(_0x5c3320['document'],'uc-config',{..._0x47b822,'pubkey':_0x31afbb,'ctx-name':'uploader-'+this['ucContextId'],'sourceList':'','imgOnly':'true','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage'],'externalSourcesEmbedCss':'\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup\x20{\x20padding:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-menu\x20{\x20gap:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-footer\x20{\x20padding-top:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__separator\x20{\x20margin:\x200;\x20}\x0a\x09\x09\x09'}),this['_configElement']['iconHrefResolver']=_0x127600=>{if('closeMax'==_0x127600)return'#uc-icon-arrow-down';},_0x5c3320['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x443707(_0x5c3320['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x5c3320['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0xccb42f=this['editor']['commands']['get']('insertImage');_0xccb42f&&this['listenTo'](_0xccb42f,'execute',()=>{const _0x5d4ade=this['editor']['model']['document']['selection']['getSelectedElement']();_0x5d4ade&&_0x5d4ade['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x5d4ade);});});const _0x588d92=this['editor']['commands']['get']('uploadcareImageReplace');_0x588d92&&this['listenTo'](_0x588d92,'execute',()=>{const _0x389a9d=this['editor']['model']['document']['selection']['getSelectedElement']();_0x389a9d&&_0x389a9d['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x389a9d);});});}}class H extends _0x35bcf2{static get['requires'](){return[z,A];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2abd4e){super(_0x2abd4e),_0x2abd4e['config']['define']('uploadcare.uploader.sourceList',[S['Local'],S['URL']]),_0x438bcd['defineComponents'](_0x438bcd),this['_defineLocale']();}['_defineLocale'](){const _0x3d492c=this['editor']['config']['get']('uploadcare.locale'),_0x3449ad=this['editor']['locale']['contentLanguage'];_0x3d492c&&_0x438bcd['defineLocale'](_0x3449ad,_0x3d492c);}}class J extends _0x1ae180{constructor(_0x4b83ba){super(_0x4b83ba);const t=_0x4b83ba['t'],_0x2fa480=this['bindTemplate'],_0x457925=new _0x166f58();_0x457925['isVisible']=!0x0,this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__loading'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__loading-spinner']},'children':[_0x457925,{'text':_0x2fa480['to']('imageUploadProgress',_0x1b095d=>t('Loading\x20image...')+'\x20('+(_0x1b095d||0x0)+'%)')}]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class Z extends _0x1ae180{constructor(_0x419d01){super(_0x419d01);const t=_0x419d01['t'];this['set']('errorType',null);const _0x2585b5=new _0xeb5fa0(_0x419d01);_0x2585b5['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x2585b5['withText']=!0x0,_0x2585b5['class']='ck-button-action',_0x2585b5['on']('execute',()=>{this['fire']('retry');}),_0x2585b5['bind']('isVisible')['to'](this,'errorType',_0x1abd56=>'NotFound'!==_0x1abd56);const _0x5a24b9=new _0x5c05eb();_0x5a24b9['content']=_0x3cac49,_0x5a24b9['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x222385=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__error'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__error-contents']},'children':[_0x5a24b9,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x222385['to']('errorType',_0x3494e4=>t('NotFound'!==_0x3494e4?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x2585b5]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class Q extends _0x1ae180{constructor(_0x2ad56d,_0x1da095){super(_0x2ad56d);const _0x535631=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x1da095,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x535631['to']('imageSrc')}});}}class X extends K{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x19bc5c,_0x582de7,_0x458a0e){super(_0x19bc5c),this['_items']=this['createCollection'](),this['_loadingView']=new J(_0x19bc5c),this['_errorView']=new Z(_0x19bc5c),this['_editingView']=new Q(_0x19bc5c,_0x458a0e),this['_focusableView']=new _0x1ae180(_0x19bc5c),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x582de7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':this['_items']}),this['_setView'](),this['once']('render',()=>{this['_waitForImageEditorComponent'](this['element'],_0x24e09e=>{this['_addUploadcareImageEditorListeners'](_0x24e09e);});}),this['on']('change:status',()=>{this['_setView']();}),this['_addErrorViewListeners']();}['focus'](){this['element']['focus']();}['_setView'](){switch(this['_items']['clear'](),this['status']){case'uploading':this['_items']['add'](this['_loadingView']);break;case'error':this['_items']['add'](this['_errorView']);break;case'ready':this['_items']['addMany']([this['_editingView'],this['_focusableView']]);}}['_waitForImageEditorComponent'](_0x2bfb89,_0x3aab2a){const _0x199633='uc-cloud-image-editor',_0x5d689a=_0x2bfb89['querySelector'](_0x199633);if(_0x5d689a)return _0x3aab2a(_0x5d689a);const _0x774826=new MutationObserver(_0x1a40ff=>{const _0x2f84f8=_0x1a40ff['filter'](_0x111a8e=>_0x111a8e['target']===_0x2bfb89&&_0x111a8e['addedNodes']['length']>0x0&&_0x111a8e['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x199633);_0x2f84f8['length']&&(_0x774826['disconnect'](),_0x3aab2a(_0x2f84f8[0x0]['addedNodes'][0x0]));});_0x774826['observe'](_0x2bfb89,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x1974de){_0x1974de['addEventListener']('apply',_0x4fd429=>{this['fire']('apply',{'imageSrc':_0x4fd429['detail']['cdnUrl']});}),_0x1974de['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class Y extends/* #__PURE__ -- @preserve */
|
|
25
|
-
_0x4079d(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x13f7f2,_0x4c8dfb,_0x465814){super(),this['_editor']=_0x13f7f2,this['_dialog']=_0x4c8dfb,this['_imageElement']=_0x465814,this['_imageCache']=this['_editor']['plugins']['get']('UploadcareImageEditUI')['imageCache'],this['_attributes']=this['_editor']['config']['get']('uploadcare.editor')||{},this['set']({'isActive':!0x0,'imageStatus':'ready','imageErrorType':null,'imageId':null,'imageSrc':null,'imageDimension':null,'imageUploadProgress':null}),this['_prepareImage'](),this['_showDialog']();}['destroy'](){this['isActive']=!0x1,this['stopListening'](),this['stopDelegating'](),'uploading'===this['imageStatus']&&this['_controller']&&this['_controller']['abort']();}async['_prepareImage'](){const _0x7c363c=this['_imageElement'],_0x302df4=_0x7c363c['getAttribute']('uploadcareImageId'),_0x263de4=_0x7c363c['getAttribute']('src');if(_0x302df4)await this['_loadImageInfo'](_0x302df4,_0x263de4);else{if(this['_imageCache']['has'](_0x263de4)){const _0x57fb9e=this['_imageCache']['get'](_0x263de4);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x57fb9e['url'],this['imageDimension']=_0x57fb9e['dimension'],this['imageId']=_0x57fb9e['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x106c6e}=this['_editor'],t=_0x106c6e['t'],_0x642ab5=new X(_0x106c6e,this['imageStatus'],this['_attributes']);_0x642ab5['bind']('status')['to'](this,'imageStatus'),_0x642ab5['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x642ab5['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x642ab5['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x642ab5,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x4882dd,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x642ab5,'position':_0x2857d0['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x642ab5['focus']();},'onHide':()=>{_0x642ab5['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x208de3=>!V(_0x208de3,_0x642ab5['element'])}});}['_loadImageInfo'](_0x2b8466,_0x22137f){return q['getInfo'](_0x2b8466,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x1ea608=>{const {width:_0x43966d,height:_0x2cbf4f}=_0x1ea608['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x22137f,this['imageDimension']={'width':_0x43966d,'height':_0x2cbf4f},this['imageId']=_0x2b8466;})['catch'](_0x42de69=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x42de69['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x480161,_0x1cce1b){return this['_getImageAsFile'](_0x480161)['then'](_0x21df59=>q['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0x1cce1b['signal'],'file':_0x21df59,'onProgress':_0xa100c2=>{_0xa100c2&&_0xa100c2['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0xa100c2['value']));}}))['then'](_0x29c5a9=>{const {width:_0x40bb5b,height:_0x23aa31}=_0x29c5a9['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x29c5a9['cdnUrl'],this['imageDimension']={'width':_0x40bb5b,'height':_0x23aa31},this['imageId']=_0x29c5a9['uuid'],this['imageUploadProgress']=null;const _0x2d7258=_0x480161['getAttribute']('src');this['_imageCache']['set'](_0x2d7258,{'id':_0x29c5a9['uuid'],'url':_0x29c5a9['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x4cea81=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x4cea81['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x162e02,_0x509adc){_0x162e02['on']('apply',(_0x1efcbb,_0x27ee70)=>{this['_replaceImage'](_0x509adc,_0x27ee70['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x162e02['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x162e02['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x47081a,_0x390f4d,_0x27598e){const _0x38da0d=this['_editor'],{width:_0xae5ca8,height:_0x130543}=F(_0x390f4d,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0xb61faa,imageSources:_0x4e9052}=D(_0x390f4d,_0xae5ca8);_0x38da0d['model']['change'](_0x20af97=>{if('$graveyard'===_0x47081a['root']['rootName']){_0x38da0d['execute']('insertImage',{'imageType':_0x47081a['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x47081a['getAttributes']()),'uploadcareImageId':_0x27598e,'src':_0xb61faa,'sources':_0x4e9052,'width':_0xae5ca8,'height':_0x130543}});const _0x5a9af6=_0x47081a['getChildren']();_0x47081a=_0x38da0d['model']['document']['selection']['getSelectedElement']();for(const _0x5d1cc8 of _0x5a9af6)_0x20af97['append'](_0x20af97['cloneElement'](_0x5d1cc8),_0x47081a);}else _0x20af97['setSelection'](_0x47081a,'on'),_0x38da0d['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x47081a['getAttributes']()),'uploadcareImageId':_0x27598e,'src':_0xb61faa,'sources':_0x4e9052,'width':_0xae5ca8,'height':_0x130543},_0x47081a);_0x20af97['setSelection'](_0x47081a,'on');});}async['_getImageAsFile'](_0x519401){const _0x1d8cd5=_0x5c3320['window'],_0x5c366e=_0x5c3320['document']['location']['href'],_0x25b2fb=new _0x1d8cd5['URL'](_0x519401['getAttribute']('src'),_0x5c366e);if('data:'===_0x25b2fb['protocol']){const _0x3c2d44=_0x25b2fb['href']['split'](','),_0x122c29=_0x3c2d44[0x0]['match'](/:(.*?);/)[0x1],_0x4b7422=_0x122c29['split']('/')[0x1],_0x17aa7e=_0x1d8cd5['atob'](_0x3c2d44[_0x3c2d44['length']-0x1]);let _0x40935c=_0x17aa7e['length'];const _0x33f3ca=new _0x1d8cd5['Uint8Array'](_0x40935c);for(;_0x40935c--;)_0x33f3ca[_0x40935c]=_0x17aa7e['charCodeAt'](_0x40935c);return new _0x1d8cd5['File']([_0x33f3ca],'image.'+_0x4b7422,{'type':_0x122c29});}const _0x6a3019=_0x25b2fb['href']['split']('/'),_0x398dfc=_0x6a3019[_0x6a3019['length']-0x1],_0x3560ae=_0x398dfc['split']('.')[0x1];return _0x1d8cd5['fetch'](_0x25b2fb['href'])['then'](_0x3df7a0=>_0x3df7a0['clone']()['blob']())['then'](_0x23e82f=>new _0x1d8cd5['File']([_0x23e82f],_0x398dfc,{'type':'image/'+_0x3560ae}));}}class tt extends _0x344b9c{['imageEditController'];static get['requires'](){return[_0x1dac6c];}['_isEditable'];constructor(_0x180708){super(_0x180708),this['imageEditController']=void 0x0,this['_isEditable']=function(_0xfddb15){const _0xfe66ef=B(_0xfddb15);return _0x19e8fc=>!(!_0x19e8fc||!_0x19e8fc['is']('element','imageBlock')&&!_0x19e8fc['is']('element','imageInline'))&&(!!_0x19e8fc['hasAttribute']('uploadcareImageId')||!!_0x19e8fc['hasAttribute']('src')&&_0xfe66ef(_0x19e8fc['getAttribute']('src')));}(_0x180708['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x1dc3ff=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x1dc3ff);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x453e4d=this['editor']['model']['document']['selection']['getSelectedElement']();_0x453e4d&&(_0x453e4d['is']('element','imageBlock')||_0x453e4d['is']('element','imageInline'))&&(this['imageEditController']=new Y(this['editor'],this['editor']['plugins']['get'](_0x1dac6c),_0x453e4d),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class et extends _0x344b9c{['refresh'](){const _0x2c933f=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x2c933f&&(_0x2c933f['is']('element','imageBlock')||_0x2c933f['is']('element','imageInline')));}['execute'](_0x1a5e1c){const _0x13ebcf=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x1fde4a=>{_0x1fde4a['setAttributes'](_0x1a5e1c,_0x13ebcf),_0x1fde4a['removeAttribute']('srcset',_0x13ebcf),_0x1fde4a['removeAttribute']('sizes',_0x13ebcf);});}}class it extends _0x35bcf2{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[z,_0x111ea3,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x16089e}=this;_0x16089e['commands']['add']('uploadcareImageEdit',new tt(_0x16089e)),_0x16089e['commands']['add']('uploadcareImageReplace',new et(_0x16089e));}}class st extends _0x35bcf2{['_imageCache']=new Map();static get['pluginName'](){return'UploadcareImageEditUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['imageCache'](){return this['_imageCache'];}['init'](){const _0x736604=this['editor'];_0x736604['ui']['componentFactory']['add']('uploadcareImageEdit',_0x413f66=>{const _0x2f5556=_0x736604['commands']['get']('uploadcareImageEdit'),_0x8d86fe=new _0xeb5fa0(_0x413f66),t=_0x413f66['t'];return _0x8d86fe['set']({'icon':_0x4882dd,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x8d86fe['bind']('isEnabled')['to'](_0x2f5556),_0x8d86fe['bind']('isOn')['to'](_0x2f5556,'isActive'),this['listenTo'](_0x8d86fe,'execute',()=>{_0x736604['execute']('uploadcareImageEdit'),_0x736604['editing']['view']['focus']();}),_0x8d86fe;}),this['_initConfig']();}['_initConfig'](){const _0x1e5215=_0x443707(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x1e5215),this['listenTo'](this['editor'],'destroy',()=>{_0x1e5215['remove']();});}}class nt extends _0x35bcf2{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[it,st];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{H as Uploadcare,M as UploadcareCommand,z as UploadcareEditing,nt as UploadcareImageEdit,tt as UploadcareImageEditCommand,it as UploadcareImageEditEditing,st as UploadcareImageEditUI,A as UploadcareUI,W as UploadcareUploadAdapter};
|
|
23
|
+
import{Plugin as _0xcfa041,Command as _0x553c37}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x5d03c4,IconGooglePhotos as _0xc2d6e7,IconGoogleDrive as _0x444b18,IconFacebook as _0x133773,IconDropbox as _0x343088,IconUploadcareLink as _0x78a5ee,IconUploadcareImageUpload as _0x10b853,IconError as _0x99cac7,IconUploadcareImageEdit as _0x1b93bf}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x34268c,MenuBarMenuListItemButtonView as _0x3e08b3,View as _0x55537e,FocusCycler as _0x351852,Dialog as _0x35fdff,DialogViewPosition as _0x53221e,SpinnerView as _0x2754dc,IconView as _0x47b58a,Notification as _0x3d5365}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x52e80b,DomEmitterMixin as _0x27456c,global as _0x2393ce,getAncestors as _0x14781e,ObservableMixin as _0xf6508e,uid as _0x1ecda0,createElement as _0x4012d2}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x67a54b}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0xc445a3,info as _0x4d81a0}from'@uploadcare/upload-client';import*as _0xc819d8 from'@uploadcare/file-uploader';var S=function(_0x239ff3){return _0x239ff3['Local']='local',_0x239ff3['URL']='url',_0x239ff3['Dropbox']='dropbox',_0x239ff3['GDrive']='gdrive',_0x239ff3['Facebook']='facebook',_0x239ff3['GPhotos']='gphotos',_0x239ff3['OneDrive']='onedrive',_0x239ff3;}({});function T(_0x3f5a87,_0x529326,_0x5d4515){const t=_0x3f5a87['t'],_0x3cc882=_0x3f5a87['t'];switch(_0x529326){case S['Local']:return{'text':_0x3cc882('Insert'===_0x5d4515?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x3cc882('From\x20computer')};case S['URL']:return{'text':'Insert'===_0x5d4515?_0x3cc882('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x3cc882('Via\x20URL')};case S['Dropbox']:return{'text':t('Insert'===_0x5d4515?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case S['Facebook']:return{'text':t('Insert'===_0x5d4515?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case S['GDrive']:return{'text':t('Insert'===_0x5d4515?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case S['GPhotos']:return{'text':t('Insert'===_0x5d4515?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case S['OneDrive']:return{'text':t('Insert'===_0x5d4515?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x529326;}}class A extends _0xcfa041{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'UploadcareUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4c72b4=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1383c1;for(const _0x94bcee in _0x4c72b4){const _0x19bd2c=_0x94bcee,_0x39220a=_0x4c72b4[_0x19bd2c];if('uploadcareLicenseKeyValid'==_0x39220a||'uploadcareLicenseKeyInvalid'==_0x39220a||'uploadcareLicenseKeyExpired'==_0x39220a||'uploadcareLicenseKeyDomainLimit'==_0x39220a||'uploadcareLicenseKeyNotAllowed'==_0x39220a||'uploadcareLicenseKeyEvaluationLimit'==_0x39220a||'uploadcareLicenseKeyUsageLimit'==_0x39220a){delete _0x4c72b4[_0x19bd2c],_0x1383c1=_0x39220a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x1383c1&&_0x4c72b4['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x1383c1&&_0x4c72b4['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x1383c1&&_0x4c72b4['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x1383c1&&_0x4c72b4['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x1383c1&&_0x4c72b4['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x1383c1&&_0x4c72b4['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x4c992d}=this,_0x1954f3=_0x4c992d['commands']['get']('uploadcare');if(!_0x1954f3)return;const _0x5e8325=this['_normalizeConfigSourceList'](_0x4c992d['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x64347a,_0x1eb96f)=>{const _0x2d8ba0=this['_getIntegrationKey'](_0x1eb96f['type']);return _0x64347a[_0x2d8ba0]||(_0x64347a[_0x2d8ba0]=[]),_0x64347a[_0x2d8ba0]['push'](_0x1eb96f),_0x64347a;},{});_0x4c992d['plugins']['has']('ImageInsertUI')&&_0x4c992d['commands']['get']('uploadcare')&&Object['entries'](_0x5e8325)['forEach'](([_0x5bf3d3,_0x15d7a8])=>{_0x4c992d['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x5bf3d3,'observable':()=>_0x1954f3,'buttonViewCreator':()=>this['_createToolbarButton'](_0x15d7a8),'formViewCreator':()=>this['_createDropdownButtons'](_0x15d7a8),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x15d7a8),'override':'assetManager'!==_0x5bf3d3});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x2ed2f1){const {locale:_0xdbfa2b}=this['editor'];return _0x2ed2f1['map'](_0x2c48c3=>{const _0x54a616=T(_0xdbfa2b,_0x2c48c3,'Insert');switch(_0x2c48c3){case S['Local']:return{'icon':_0x10b853,'type':S['Local'],..._0x54a616};case S['URL']:return{'icon':_0x78a5ee,'type':S['URL'],..._0x54a616};case S['Dropbox']:return{'icon':_0x343088,'type':S['Dropbox'],..._0x54a616};case S['Facebook']:return{'icon':_0x133773,'type':S['Facebook'],..._0x54a616};case S['GDrive']:return{'icon':_0x444b18,'type':S['GDrive'],..._0x54a616};case S['GPhotos']:return{'icon':_0xc2d6e7,'type':S['GPhotos'],..._0x54a616};case S['OneDrive']:return{'icon':_0x5d03c4,'type':S['OneDrive'],..._0x54a616};}});}['_getIntegrationKey'](_0x53ba95){switch(_0x53ba95){case S['Local']:return'upload';case S['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x33ddc9,_0x496826){const _0x118a20=this['editor'],_0x408a08=new _0x33ddc9(_0x118a20['locale']),_0x1ba820=_0x118a20['commands']['get']('uploadcare');return _0x408a08['bind']('isEnabled')['to'](_0x1ba820),_0x408a08['on']('execute',()=>{_0x1ba820['execute'](_0x496826);}),_0x408a08;}['_createToolbarButton'](_0x5b7e6c){const {locale:_0x7a04d9}=this['editor'],_0x5bf3b2=this['editor']['plugins']['get']('ImageInsertUI'),_0x54fbaa=_0x5b7e6c[0x0],_0x5bb597=this['_createButton'](_0x34268c,_0x54fbaa['type']);return _0x5bb597['icon']=_0x54fbaa['icon'],_0x5bb597['bind']('label')['to'](_0x5bf3b2,'isImageSelected',_0x4f671d=>T(_0x7a04d9,_0x54fbaa['type'],_0x4f671d?'Replace':'Insert')['text']),_0x5bb597['tooltip']=!0x0,_0x5bb597;}['_createDropdownButtons'](_0x49f9dd){const {locale:_0x575034}=this['editor'],_0x28a424=this['editor']['plugins']['get']('ImageInsertUI');return _0x49f9dd['map'](_0x3aad86=>{const _0x4623d7=this['_createButton'](_0x34268c,_0x3aad86['type']);return _0x4623d7['withText']=!0x0,_0x4623d7['icon']=_0x3aad86['icon'],_0x4623d7['bind']('label')['to'](_0x28a424,'isImageSelected',_0x3fd620=>T(_0x575034,_0x3aad86['type'],_0x3fd620?'Replace':'Insert')['text']),_0x4623d7;});}['_createMenuBarButtons'](_0x4fdcab){return _0x4fdcab['map'](_0x54dfd6=>{const _0x3a1a4a=this['_createButton'](_0x3e08b3,_0x54dfd6['type']);return _0x3a1a4a['icon']=_0x54dfd6['icon'],_0x3a1a4a['label']=_0x54dfd6['shortText'],_0x3a1a4a;});}}class K extends _0x55537e{['focusTracker'];['focusCycler'];constructor(_0x55e967){super(_0x55e967),this['focusTracker']=new _0x52e80b(),this['focusCycler']=new _0x351852({'focusables':this['createCollection'](),'focusTracker':this['focusTracker']});}['getFocusableElement'](){return{'tag':'div','attributes':{'aria-hidden':'true','tabindex':'0'},'on':{'focus':this['bindTemplate']['to'](()=>{this['focusCycler']['fire']('forwardCycle');})}};}}class O extends K{constructor(_0x124f23,_0x44603d){super(_0x124f23),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':[{'tag':'uc-file-uploader-inline','attributes':{'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'uploader-'+_0x44603d}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function D(_0x5ee2e6,_0x3278b3){const _0x28cb1a=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x4cffdd=>_0x4cffdd<=_0x3278b3)['map'](_0x3537b4=>_0x5ee2e6['replace'](/\/$/,'')+'/-/resize/'+_0x3537b4+'x/\x20'+_0x3537b4+'w');return{'imageFallbackUrl':_0x5ee2e6,'imageSources':[{'srcset':_0x28cb1a['join'](',\x20'),'sizes':'(max-width:\x20'+_0x3278b3+'px)\x20100vw,\x20'+_0x3278b3+'px','type':'image/webp'}]};}function F(_0x90029e,_0x167465,_0x282e7e){const _0x122953=_0x90029e['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x122953?parseInt(_0x122953[0x1],0xa):_0x167465,'height':_0x122953?parseInt(_0x122953[0x2],0xa):_0x282e7e};}function $(_0x22eab5,_0x94bef1){const _0x4f45f2=new(_0x27456c())(),_0x15e1cc=_0x22eab5['plugins']['get']('ImageUtils'),_0x1fef07=_0x22eab5['editing']['mapper']['toViewElement'](_0x94bef1),_0x5d7773=_0x15e1cc['findViewImgElement'](_0x1fef07),_0x33f320=_0x22eab5['editing']['view']['domConverter']['viewToDom'](_0x5d7773),_0x216624=_0x94bef1['getAttribute']('width'),_0x249245=_0x94bef1['getAttribute']('height'),_0x145695='image-processing';_0x22eab5['editing']['view']['change'](_0x3ca9f2=>{_0x3ca9f2['addClass'](_0x145695,_0x1fef07),_0x3ca9f2['setStyle']('aspect-ratio',_0x216624+'/'+_0x249245,_0x5d7773);}),_0x4f45f2['listenTo'](_0x33f320,'load',()=>{_0x4f45f2['stopListening'](_0x33f320,'load'),_0x22eab5['editing']['view']['change'](_0x16a4ee=>{_0x16a4ee['removeClass'](_0x145695,_0x1fef07),_0x16a4ee['removeStyle']('aspect-ratio',_0x5d7773);});});}function B(_0x4fddf8){if(Array['isArray'](_0x4fddf8)){const _0x36cd9c=_0x4fddf8['map'](B);return _0x1a9cd5=>_0x36cd9c['some'](_0x6e9ca5=>_0x6e9ca5(_0x1a9cd5));}if('origin'==_0x4fddf8){const _0x39dfc7=_0x2393ce['window']['location']['origin'];return _0x3d6ac4=>new URL(_0x3d6ac4,_0x2393ce['document']['baseURI'])['origin']==_0x39dfc7;}return'function'==typeof _0x4fddf8?_0x4fddf8:_0x4fddf8 instanceof RegExp?_0x568bfe=>!(!_0x568bfe['match'](_0x4fddf8)&&!_0x568bfe['replace'](/^https?:\/\//,'')['match'](_0x4fddf8)):()=>!0x1;}function V(_0x143712,_0x235958){return _0x14781e(_0x143712['target'])['includes'](_0x235958);}class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0xf6508e(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x5a91bb,_0x577b50,_0x24094d){super(),this['_editor']=_0x5a91bb,this['_editing']=_0x577b50,this['_dialog']=_0x5a91bb['plugins']['get'](_0x35fdff),this['_api']=_0x577b50['ctxElement']['getAPI'](),this['_type']=_0x24094d,this['_editing']['configElement']['setAttribute']('source-list',this['_type']),this['_initDialog'](),this['_initListeners'](),this['_api']['initFlow']();}['destroy'](){this['_formView']&&(this['_formView']['destroy'](),this['_formView']=null),this['_api']&&this['_api']['doneFlow'](),this['stopListening'](),this['stopDelegating']();}['_initDialog'](){const {locale:_0x4a61ca,model:_0x1204a0}=this['_editor'],_0x1dbc4a=_0x1204a0['document']['selection']['getSelectedElement'](),_0x29f499=_0x1dbc4a&&(_0x1dbc4a['is']('element','imageBlock')||_0x1dbc4a['is']('element','imageInline'));this['_formView']=new O(_0x4a61ca,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x10b853,'title':T(_0x4a61ca,this['_type'],_0x29f499?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x53221e['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x3746ac=>!V(_0x3746ac,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x39185d}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x572453=>{const _0x42eb4a=_0x39185d['length'];for(const _0x5c5b06 of _0x39185d){const _0x4b5e6b=_0x5c5b06===_0x39185d[_0x42eb4a-0x1],{cdnUrl:_0x39241a,fileInfo:_0x165f7d}=_0x5c5b06;if(!_0x39241a||!_0x165f7d)continue;const {width:_0x18ee39,height:_0x42005a}=_0x165f7d['imageInfo'],_0x4284d1=F(_0x39241a,_0x18ee39,_0x42005a),_0x5c3d04=D(_0x39241a,_0x4284d1['width']),_0x32f87d={'id':_0x165f7d['uuid'],'type':'image','attributes':{'imageDimension':_0x4284d1,..._0x5c3d04}};this['_insertAsset'](_0x32f87d,_0x4b5e6b,_0x572453);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x5da7f0=>{'idle'===_0x5da7f0['detail']['status']&&!_0x5da7f0['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===S['Local']?this['_api']['setCurrentActivity'](S['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x369c23,_0x4934c1,_0x551305){const _0x142534=this['_editor']['model']['document']['selection'],_0x30c6a0=_0x142534['getSelectedElement'](),_0xb0b64=!(!_0x30c6a0||!_0x30c6a0['is']('element','imageInline'));_0x551305['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x369c23,_0xb0b64),_0x4934c1||_0x551305['setSelection'](_0x142534['getLastPosition']());}['_insertImage'](_0x3f1831,_0x2f4961){const _0x1713f2=this['_editor'],{imageDimension:_0x36442f,imageFallbackUrl:_0x507385,imageSources:_0x5ae03b}=_0x3f1831['attributes'];_0x1713f2['execute']('insertImage',{'imageType':_0x2f4961?'imageInline':null,'source':{'uploadcareImageId':_0x3f1831['id'],'src':_0x507385,'sources':_0x5ae03b,..._0x36442f}});}}class M extends _0x553c37{['_editing'];['_controller']=null;static get['requires'](){return[_0x35fdff,z];}constructor(_0x136a85){super(_0x136a85),this['_editing']=_0x136a85['plugins']['get'](z);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x1fbce6){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new j(this['editor'],this['_editing'],_0x1fbce6);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class q{static['upload']({file:_0x4ccd77,..._0x544b81}){return _0xc445a3(_0x4ccd77,_0x544b81);}static['getInfo'](_0x5499a5,_0x502369){return _0x4d81a0(_0x5499a5,_0x502369);}}class W extends _0xcfa041{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x67a54b,z];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x2472c0=this['editor'];if(!!!_0x2472c0['config']['get']('uploadcare'))return;_0x2472c0['plugins']['get'](_0x67a54b)['createUploadAdapter']=_0x351d2f=>new G(_0x351d2f,_0x2472c0),_0x2472c0['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0xa5db21,{imageElement:_0x18c883,data:_0x3e783e})=>{_0x2472c0['model']['change'](_0xb16bb0=>{_0xb16bb0['setAttribute']('uploadcareImageId',_0x3e783e['uploadcareImageId'],_0x18c883);});});}}class G{['loader'];['editor'];['controller'];constructor(_0xc83868,_0x520e2f){this['loader']=_0xc83868,this['editor']=_0x520e2f,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x8e0658=await this['loader']['file'];return q['upload']({'file':_0x8e0658,'publicKey':this['editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':this['controller']['signal'],'onProgress':_0xa6e76e=>{_0xa6e76e&&_0xa6e76e['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0xa6e76e['value']);}})['then'](async _0x4ea857=>{const {imageFallbackUrl:_0x183bf,imageSources:_0x2ba5ae}=D(_0x4ea857['cdnUrl'],_0x4ea857['imageInfo']['width']);return{'uploadcareImageId':_0x4ea857['uuid'],'default':_0x183bf,'sources':_0x2ba5ae};})['catch'](()=>{const _0x464d0b=t('Cannot\x20upload\x20file:')+('\x20'+_0x8e0658['name']+'.');return Promise['reject'](_0x464d0b);});}['abort'](){this['controller']['abort']();}}class z extends _0xcfa041{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',W,_0x35fdff];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0xb11f7){super(_0xb11f7),this['ucContextId']=_0x1ecda0();}['init'](){const _0x4fa603=this['editor'];_0x4fa603['commands']['add']('uploadcare',new M(_0x4fa603));}['afterInit'](){this['_initSchema'](),this['_initConversion'](),this['_initConfig'](),this['_initCtx'](),this['_initImageProcessingIndicator'](),this['listenTo'](this['editor'],'destroy',()=>{this['_configElement']&&(this['_configElement']['remove'](),this['_configElement']=null),this['_ctxElement']&&(this['_ctxElement']['remove'](),this['_ctxElement']=null);const _0x3b0dd0=_0x2393ce['document']['querySelector']('input[uploadcare-file-input]');_0x3b0dd0&&_0x3b0dd0['remove']();}),async function(_0x1d1610){const _0x5c8e19=_0x4931fb([0x68,0x67,0x50,0x36,0x38,0x70,0x71,0x63,0x37,0x4f,0x42,0x4a,0x78,0x39,0x75,0x33,0x7a,0x72,0x48,0x61,0x74,0x59,0x55,0x58,0x66,0x30,0x34,0x54,0x64,0x56,0x6b,0x4d,0x46,0x6d,0x77,0x43,0x73,0x35,0x53,0x44,0x41,0x76,0x6a,0x32,0x31,0x69,0x57,0x51,0x47,0x65,0x5a,0x4b,0x4c,0x79,0x52,0x6c,0x45,0x4e,0x6e,0x6f,0x49,0x62]),_0x43dfdb=0x535f8c3a,_0x536758=0x5358f2a2^_0x43dfdb,_0x9df267=window[_0x4931fb([0x44,0x61,0x74,0x65])][_0x4931fb([0x6e,0x6f,0x77])](),_0xd0573=_0x1d1610[_0x4931fb([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4e4091=new window[(_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3d88b8=>{_0xd0573[_0x4931fb([0x6f,0x6e,0x63,0x65])](_0x4931fb([0x72,0x65,0x61,0x64,0x79]),_0x3d88b8);}),_0x426b5a={[_0x4931fb([0x6b,0x74,0x79])]:_0x4931fb([0x45,0x43]),[_0x4931fb([0x75,0x73,0x65])]:_0x4931fb([0x73,0x69,0x67]),[_0x4931fb([0x63,0x72,0x76])]:_0x4931fb([0x50,0x2d,0x32,0x35,0x36]),[_0x4931fb([0x78])]:_0x4931fb([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]),[_0x4931fb([0x79])]:_0x4931fb([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]),[_0x4931fb([0x61,0x6c,0x67])]:_0x4931fb([0x45,0x53,0x32,0x35,0x36])},_0x208225=_0xd0573[_0x4931fb([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4931fb([0x67,0x65,0x74])](_0x4931fb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x40492b(){let _0x1d5701,_0x15f33d=null,_0x28c8ce=null;try{if(_0x208225==_0x4931fb([0x47,0x50,0x4c]))return _0x4931fb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1d5701=_0x2ee789(),!_0x1d5701)return _0x4931fb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1d5701[_0x4931fb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x28c8ce=_0x560b86(_0x1d5701[_0x4931fb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1d5701[_0x4931fb([0x6a,0x74,0x69])])),await _0x1c9e40()?_0x56827c()?_0x74d3d6()?_0x4931fb([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3ad634()?(_0x1d5701[_0x4931fb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4931fb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x15f33d=_0x13a76a(_0x4931fb([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x14c740()):_0x4931fb([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4931fb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4931fb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4931fb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x74d3d6(){const _0x37d582=[_0x4931fb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4931fb([0x74,0x72,0x69,0x61,0x6c])][_0x4931fb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d5701[_0x4931fb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x9df267/0x3e8:0xe10*_0x536758;return _0x1d5701[_0x4931fb([0x65,0x78,0x70])]<_0x37d582;}function _0x56827c(){const _0x28fae5=_0x1d5701[_0x4931fb([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x28fae5&&(!!_0x28fae5[_0x4931fb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4931fb([0x2a]))||!!_0x28fae5[_0x4931fb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4931fb([0x55,0x50,0x4c,0x43])));}function _0x3ad634(){const _0xac4fc6=_0x1d5701[_0x4931fb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xac4fc6||0x0==_0xac4fc6[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4272a6}=new URL(window[_0x4931fb([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xac4fc6[_0x4931fb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4272a6))return!0x0;const _0x24b8a8=_0x4272a6[_0x4931fb([0x73,0x70,0x6c,0x69,0x74])](_0x4931fb([0x2e]));return _0xac4fc6[_0x4931fb([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x54521b=>_0x54521b[_0x4931fb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4931fb([0x2a])))[_0x4931fb([0x6d,0x61,0x70])](_0x163d22=>_0x163d22[_0x4931fb([0x73,0x70,0x6c,0x69,0x74])](_0x4931fb([0x2e])))[_0x4931fb([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x53459f=>_0x53459f[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x24b8a8[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4931fb([0x6d,0x61,0x70])](_0x1743e0=>Array(_0x24b8a8[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1743e0[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4931fb([0x66,0x69,0x6c,0x6c])](_0x1743e0[0x0]===_0x4931fb([0x2a])?_0x4931fb([0x2a]):'')[_0x4931fb([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1743e0))[_0x4931fb([0x73,0x6f,0x6d,0x65])](_0x295830=>_0x24b8a8[_0x4931fb([0x65,0x76,0x65,0x72,0x79])]((_0x59115e,_0x2d4ac8)=>_0x295830[_0x2d4ac8]===_0x59115e||_0x295830[_0x2d4ac8]===_0x4931fb([0x2a])));}function _0x14c740(){return _0x15f33d&&_0x28c8ce?new window[(_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x43d21b,_0xc009f2)=>{_0x15f33d[_0x4931fb([0x74,0x68,0x65,0x6e])](_0x43d21b,_0xc009f2),_0x28c8ce[_0x4931fb([0x74,0x68,0x65,0x6e])](_0x510c12=>{_0x510c12!=_0x4931fb([0x56,0x61,0x6c,0x69,0x64])&&_0x43d21b(_0x510c12);},_0xc009f2);}):_0x15f33d||_0x28c8ce||_0x4931fb([0x56,0x61,0x6c,0x69,0x64]);}}function _0x560b86(_0x546e7a,_0x4cc8fb){return new window[(_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x7a63ae=>{if(_0x3dadb9())return _0x7a63ae(_0x4931fb([0x56,0x61,0x6c,0x69,0x64]));_0x394c2d(),_0xd0573[_0x4931fb([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4931fb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5d5015=!0x1;const _0x59e317=_0x1ecda0();function _0x14d379(_0x296ff0){return!!_0x296ff0&&(typeof _0x296ff0===_0x4931fb([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x296ff0===_0x4931fb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x296ff0[_0x4931fb([0x74,0x68,0x65,0x6e])]===_0x4931fb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x296ff0[_0x4931fb([0x63,0x61,0x74,0x63,0x68])]===_0x4931fb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x236e9c(_0x187fe9){_0x20abce(_0x187fe9)[_0x4931fb([0x74,0x68,0x65,0x6e])](_0x2f7c9b=>{if(!_0x2f7c9b||_0x2f7c9b[_0x4931fb([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4931fb([0x6f,0x6b]))return _0x4931fb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2b9279(_0x44f721(_0x59e317+_0x4cc8fb))!=_0x2f7c9b[_0x4931fb([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4931fb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4931fb([0x56,0x61,0x6c,0x69,0x64]);})[_0x4931fb([0x74,0x68,0x65,0x6e])](_0x5a13ad=>(_0x489bbd(),_0x5a13ad),()=>{const _0x3bce5c=_0x4ea0c1();return null==_0x3bce5c?(_0x489bbd(),_0x4931fb([0x56,0x61,0x6c,0x69,0x64])):_0x4931fb(_0x9df267-_0x3bce5c>(0x7753083a^_0x43dfdb)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4931fb([0x74,0x68,0x65,0x6e])](_0x7a63ae)[_0x4931fb([0x63,0x61,0x74,0x63,0x68])](()=>{_0x7a63ae(_0x4931fb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x12da0a=0x536962ba^_0x43dfdb;function _0x489bbd(){const _0x93ae77=_0x4931fb([0x6c,0x6c,0x63,0x74,0x2d])+_0x2b9279(_0x44f721(_0x546e7a)),_0x3b8518=_0x251e96(_0x2b9279(window[_0x4931fb([0x4d,0x61,0x74,0x68])][_0x4931fb([0x63,0x65,0x69,0x6c])](_0x9df267/_0x12da0a)));window[_0x4931fb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4931fb([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x93ae77,_0x3b8518);}function _0x4ea0c1(){const _0x1e2361=_0x4931fb([0x6c,0x6c,0x63,0x74,0x2d])+_0x2b9279(_0x44f721(_0x546e7a)),_0x2a1404=window[_0x4931fb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4931fb([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1e2361);return _0x2a1404?window[_0x4931fb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x251e96(_0x2a1404),0x10)*_0x12da0a:null;}function _0x20abce(_0x51343b){return new window[(_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x562bb1,_0x595070)=>{_0x51343b[_0x4931fb([0x74,0x68,0x65,0x6e])](_0x562bb1,_0x595070),window[_0x4931fb([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x595070,0x535e58fa^_0x43dfdb);});}}_0xd0573[_0x4931fb([0x6f,0x6e])](_0x4931fb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4e3e83,_0x4592f6)=>{if(_0x4592f6[0x0]!=_0x546e7a)return _0x7a63ae(_0x4931fb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4592f6[0x1]={..._0x4592f6[0x1],[_0x4931fb([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x59e317};},{[_0x4931fb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4931fb([0x68,0x69,0x67,0x68])}),_0xd0573[_0x4931fb([0x6f,0x6e])](_0x4931fb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2070dd=>{_0x14d379(_0x2070dd[_0x4931fb([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5d5015=!0x0,_0x236e9c(_0x2070dd[_0x4931fb([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4931fb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4931fb([0x6c,0x6f,0x77])}),_0x4e4091[_0x4931fb([0x74,0x68,0x65,0x6e])](()=>{_0x5d5015||_0x7a63ae(_0x4931fb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3dadb9(){return _0xd0573[_0x4931fb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4931fb([0x76,0x69,0x65,0x77])][_0x4931fb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4931fb([0x61,0x75,0x74,0x6f]);}function _0x394c2d(){_0xd0573[_0x4931fb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4931fb([0x76,0x69,0x65,0x77])][_0x4931fb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4931fb([0x61,0x75,0x74,0x6f]);}}function _0x13a76a(_0x5071b2){const _0x9a1783=[new window[(_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x118114=>setTimeout(_0x118114,0x5356b2f6^_0x43dfdb)),_0x4e4091[_0x4931fb([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x131a89=>{let _0x33b392=0x0;_0xd0573[_0x4931fb([0x6d,0x6f,0x64,0x65,0x6c])][_0x4931fb([0x6f,0x6e])](_0x4931fb([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5dab44,_0x49c127)=>{_0x49c127[0x0][_0x4931fb([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x33b392++,_0x33b392==(0x535f89d2^_0x43dfdb)&&(_0x131a89(),_0x5dab44[_0x4931fb([0x6f,0x66,0x66])]());});}))];return window[_0x4931fb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4931fb([0x72,0x61,0x63,0x65])](_0x9a1783)[_0x4931fb([0x74,0x68,0x65,0x6e])](()=>_0x5071b2);}async function _0xa0e707(){await _0x4e4091,_0xd0573[_0x4931fb([0x6d,0x6f,0x64,0x65,0x6c])][_0x4931fb([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x401732,_0xd0573[_0x4931fb([0x6d,0x6f,0x64,0x65,0x6c])][_0x4931fb([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x401732,_0xd0573[_0x4931fb([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4931fb([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4a726c(_0x3a046a){const _0x5cf5f1=_0x16fd6e();_0xd0573[_0x5cf5f1]=_0x4931fb([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3a046a,_0x3a046a!=_0x4931fb([0x56,0x61,0x6c,0x69,0x64])&&_0xa0e707();}function _0x16fd6e(){const _0x26e40e=window[_0x4931fb([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4931fb([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4931fb([0x6e,0x6f,0x77])]())[_0x4931fb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4931fb([0x2e]),'');let _0x1d5233=_0x4931fb([0x68]);for(let _0x4fa0dc=0x0;_0x4fa0dc<_0x26e40e[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4fa0dc+=0x2){let _0x4c0ddf=window[_0x4931fb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x26e40e[_0x4931fb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4fa0dc,_0x4fa0dc+0x2));_0x4c0ddf>=_0x5c8e19[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4c0ddf-=_0x5c8e19[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1d5233+=_0x5c8e19[_0x4c0ddf];}return _0x1d5233;}function _0x2ee789(){const _0x41fb64=_0x208225[_0x4931fb([0x73,0x70,0x6c,0x69,0x74])](_0x4931fb([0x2e]));if(0x3!=_0x41fb64[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2b13a0(_0x41fb64[0x1]);function _0x2b13a0(_0x227830){const _0x39b0e4=_0x9a8dc(_0x227830);return _0x39b0e4&&_0x2808c3()?_0x39b0e4:null;function _0x2808c3(){const _0xf27fd4=_0x39b0e4[_0x4931fb([0x6a,0x74,0x69])],_0x5cfd2f=window[_0x4931fb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf27fd4[_0x4931fb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xf27fd4[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x299c25={..._0x39b0e4,[_0x4931fb([0x6a,0x74,0x69])]:_0xf27fd4[_0x4931fb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xf27fd4[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x299c25[_0x4931fb([0x76,0x63])],_0x44f721(_0x299c25)==_0x5cfd2f;}}}async function _0x1c9e40(){let _0xc033a3=!0x0;try{const _0x394522=_0x208225[_0x4931fb([0x73,0x70,0x6c,0x69,0x74])](_0x4931fb([0x2e])),[_0xb18bef,_0x443c60,_0x3c1b73]=_0x394522;return _0x1cab92(_0xb18bef),await _0x4d232c(_0xb18bef,_0x443c60,_0x3c1b73),_0xc033a3;}catch{return!0x1;}function _0x1cab92(_0x2e66a2){const _0x2d1c89=_0x9a8dc(_0x2e66a2);_0x2d1c89&&_0x2d1c89[_0x4931fb([0x61,0x6c,0x67])]==_0x4931fb([0x45,0x53,0x32,0x35,0x36])||(_0xc033a3=!0x1);}async function _0x4d232c(_0x27f254,_0x457887,_0x3ca031){const _0x4b06b4=window[_0x4931fb([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4931fb([0x66,0x72,0x6f,0x6d])](_0x33360e(_0x3ca031),_0x51cd89=>_0x51cd89[_0x4931fb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x282557=new window[(_0x4931fb([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4931fb([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x27f254+_0x4931fb([0x2e])+_0x457887),_0x201529=window[_0x4931fb([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4931fb([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x201529)return;const _0x5db3fb=await _0x201529[_0x4931fb([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4931fb([0x6a,0x77,0x6b]),_0x426b5a,{[_0x4931fb([0x6e,0x61,0x6d,0x65])]:_0x4931fb([0x45,0x43,0x44,0x53,0x41]),[_0x4931fb([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4931fb([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4931fb([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x201529[_0x4931fb([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4931fb([0x6e,0x61,0x6d,0x65])]:_0x4931fb([0x45,0x43,0x44,0x53,0x41]),[_0x4931fb([0x68,0x61,0x73,0x68])]:{[_0x4931fb([0x6e,0x61,0x6d,0x65])]:_0x4931fb([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5db3fb,_0x4b06b4,_0x282557)||(_0xc033a3=!0x1);}}function _0x9a8dc(_0x4341c3){return _0x4341c3[_0x4931fb([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4931fb([0x65,0x79]))?JSON[_0x4931fb([0x70,0x61,0x72,0x73,0x65])](_0x33360e(_0x4341c3)):null;}function _0x33360e(_0x2a394a){return window[_0x4931fb([0x61,0x74,0x6f,0x62])](_0x2a394a[_0x4931fb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4931fb([0x2b]))[_0x4931fb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4931fb([0x2f])));}function _0x44f721(_0x141872){let _0x52e720=0x1505;function _0x4dae14(_0x1a8a4b){for(let _0x136c80=0x0;_0x136c80<_0x1a8a4b[_0x4931fb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x136c80++){const _0x474e3c=_0x1a8a4b[_0x4931fb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x136c80);_0x52e720=(_0x52e720<<0x5)+_0x52e720+_0x474e3c,_0x52e720&=_0x52e720;}}function _0x82523c(_0x1dee67){Array[_0x4931fb([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1dee67)?_0x1dee67[_0x4931fb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x82523c):_0x1dee67&&typeof _0x1dee67==_0x4931fb([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4931fb([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1dee67)[_0x4931fb([0x73,0x6f,0x72,0x74])]()[_0x4931fb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4fb6a9,_0x629a60])=>{_0x4dae14(_0x4fb6a9),_0x82523c(_0x629a60);}):_0x4dae14(window[_0x4931fb([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1dee67));}return _0x82523c(_0x141872),_0x52e720>>>0x0;}function _0x2b9279(_0x33b5c2){return _0x33b5c2[_0x4931fb([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4931fb([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4931fb([0x30]));}function _0x251e96(_0x527ed7){return _0x527ed7[_0x4931fb([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4931fb([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4931fb([0x6a,0x6f,0x69,0x6e])]('');}function _0x401732(){}function _0x4931fb(_0x26f633){return _0x26f633['map'](_0x2900b7=>String['fromCharCode'](_0x2900b7))['join']('');}_0x4a726c(await _0x40492b());}(this);}['_initSchema'](){const _0x4b6215=this['editor']['model']['schema'];_0x4b6215['isRegistered']('imageBlock')&&_0x4b6215['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x4b6215['isRegistered']('imageInline')&&_0x4b6215['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x46634e=this['editor'];_0x46634e['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x46634e['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x320052=>_0x320052['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x348c74=_0x46634e['commands']['get']('replaceImageSource');_0x348c74&&this['listenTo'](_0x348c74,'cleanupImage',(_0x289227,[_0x1cda50,_0x1bf88d])=>{_0x1cda50['removeAttribute']('uploadcareImageId',_0x1bf88d);});}['_initConfig'](){const _0x2a9961=this['editor']['config']['get']('uploadcare.uploader')||{},_0x477f34=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x4012d2(_0x2393ce['document'],'uc-config',{..._0x2a9961,'pubkey':_0x477f34,'ctx-name':'uploader-'+this['ucContextId'],'sourceList':'','imgOnly':'true','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage'],'externalSourcesEmbedCss':'\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup\x20{\x20padding:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-menu\x20{\x20gap:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-footer\x20{\x20padding-top:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__separator\x20{\x20margin:\x200;\x20}\x0a\x09\x09\x09'}),this['_configElement']['iconHrefResolver']=_0x4d110d=>{if('closeMax'==_0x4d110d)return'#uc-icon-arrow-down';},_0x2393ce['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x4012d2(_0x2393ce['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x2393ce['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x1d6287=this['editor']['commands']['get']('insertImage');_0x1d6287&&this['listenTo'](_0x1d6287,'execute',()=>{const _0xc606cb=this['editor']['model']['document']['selection']['getSelectedElement']();_0xc606cb&&_0xc606cb['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0xc606cb);});});const _0x11a39a=this['editor']['commands']['get']('uploadcareImageReplace');_0x11a39a&&this['listenTo'](_0x11a39a,'execute',()=>{const _0x1088b1=this['editor']['model']['document']['selection']['getSelectedElement']();_0x1088b1&&_0x1088b1['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x1088b1);});});}}class H extends _0xcfa041{static get['requires'](){return[z,A];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x6eebc6){super(_0x6eebc6),_0x6eebc6['config']['define']('uploadcare.uploader.sourceList',[S['Local'],S['URL']]),_0xc819d8['defineComponents'](_0xc819d8),this['_defineLocale']();}['_defineLocale'](){const _0x81e40c=this['editor']['config']['get']('uploadcare.locale'),_0x531d7d=this['editor']['locale']['contentLanguage'];_0x81e40c&&_0xc819d8['defineLocale'](_0x531d7d,_0x81e40c);}}class J extends _0x55537e{constructor(_0x4c6f11){super(_0x4c6f11);const t=_0x4c6f11['t'],_0x5a30f0=this['bindTemplate'],_0x226d06=new _0x2754dc();_0x226d06['isVisible']=!0x0,this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__loading'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__loading-spinner']},'children':[_0x226d06,{'text':_0x5a30f0['to']('imageUploadProgress',_0x1aea1f=>t('Loading\x20image...')+'\x20('+(_0x1aea1f||0x0)+'%)')}]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class Z extends _0x55537e{constructor(_0x4470c8){super(_0x4470c8);const t=_0x4470c8['t'];this['set']('errorType',null);const _0x3223c7=new _0x34268c(_0x4470c8);_0x3223c7['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x3223c7['withText']=!0x0,_0x3223c7['class']='ck-button-action',_0x3223c7['on']('execute',()=>{this['fire']('retry');}),_0x3223c7['bind']('isVisible')['to'](this,'errorType',_0x1a7fa7=>'NotFound'!==_0x1a7fa7);const _0x4bad07=new _0x47b58a();_0x4bad07['content']=_0x99cac7,_0x4bad07['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x4fffb5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__error'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__error-contents']},'children':[_0x4bad07,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x4fffb5['to']('errorType',_0x2d4c13=>t('NotFound'!==_0x2d4c13?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x3223c7]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class Q extends _0x55537e{constructor(_0x5c9cfb,_0x5831e1){super(_0x5c9cfb);const _0x3f8f47=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x5831e1,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x3f8f47['to']('imageSrc')}});}}class X extends K{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x3fa56b,_0x402c58,_0xbdf728){super(_0x3fa56b),this['_items']=this['createCollection'](),this['_loadingView']=new J(_0x3fa56b),this['_errorView']=new Z(_0x3fa56b),this['_editingView']=new Q(_0x3fa56b,_0xbdf728),this['_focusableView']=new _0x55537e(_0x3fa56b),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x402c58),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':this['_items']}),this['_setView'](),this['once']('render',()=>{this['_waitForImageEditorComponent'](this['element'],_0x2725b4=>{this['_addUploadcareImageEditorListeners'](_0x2725b4);});}),this['on']('change:status',()=>{this['_setView']();}),this['_addErrorViewListeners']();}['focus'](){this['element']['focus']();}['_setView'](){switch(this['_items']['clear'](),this['status']){case'uploading':this['_items']['add'](this['_loadingView']);break;case'error':this['_items']['add'](this['_errorView']);break;case'ready':this['_items']['addMany']([this['_editingView'],this['_focusableView']]);}}['_waitForImageEditorComponent'](_0x2203ce,_0x56a9c1){const _0x1b2211='uc-cloud-image-editor',_0x43e4db=_0x2203ce['querySelector'](_0x1b2211);if(_0x43e4db)return _0x56a9c1(_0x43e4db);const _0x1f1f8f=new MutationObserver(_0x72c317=>{const _0x46ba7f=_0x72c317['filter'](_0x5529a7=>_0x5529a7['target']===_0x2203ce&&_0x5529a7['addedNodes']['length']>0x0&&_0x5529a7['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x1b2211);_0x46ba7f['length']&&(_0x1f1f8f['disconnect'](),_0x56a9c1(_0x46ba7f[0x0]['addedNodes'][0x0]));});_0x1f1f8f['observe'](_0x2203ce,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x3b764f){_0x3b764f['addEventListener']('apply',_0x3cef98=>{this['fire']('apply',{'imageSrc':_0x3cef98['detail']['cdnUrl']});}),_0x3b764f['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class Y extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0xf6508e(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x505a54,_0x2b7323,_0x4c76b3){super(),this['_editor']=_0x505a54,this['_dialog']=_0x2b7323,this['_imageElement']=_0x4c76b3,this['_imageCache']=this['_editor']['plugins']['get']('UploadcareImageEditUI')['imageCache'],this['_attributes']=this['_editor']['config']['get']('uploadcare.editor')||{},this['set']({'isActive':!0x0,'imageStatus':'ready','imageErrorType':null,'imageId':null,'imageSrc':null,'imageDimension':null,'imageUploadProgress':null}),this['_prepareImage'](),this['_showDialog']();}['destroy'](){this['isActive']=!0x1,this['stopListening'](),this['stopDelegating'](),'uploading'===this['imageStatus']&&this['_controller']&&this['_controller']['abort']();}async['_prepareImage'](){const _0xee0326=this['_imageElement'],_0x13b259=_0xee0326['getAttribute']('uploadcareImageId'),_0x12a699=_0xee0326['getAttribute']('src');if(_0x13b259)await this['_loadImageInfo'](_0x13b259,_0x12a699);else{if(this['_imageCache']['has'](_0x12a699)){const _0x1fbc30=this['_imageCache']['get'](_0x12a699);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x1fbc30['url'],this['imageDimension']=_0x1fbc30['dimension'],this['imageId']=_0x1fbc30['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x25520b}=this['_editor'],t=_0x25520b['t'],_0x4602d5=new X(_0x25520b,this['imageStatus'],this['_attributes']);_0x4602d5['bind']('status')['to'](this,'imageStatus'),_0x4602d5['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x4602d5['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x4602d5['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x4602d5,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x1b93bf,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x4602d5,'position':_0x53221e['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x4602d5['focus']();},'onHide':()=>{_0x4602d5['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x1da9e8=>!V(_0x1da9e8,_0x4602d5['element'])}});}['_loadImageInfo'](_0x16f1ad,_0x3389c5){return q['getInfo'](_0x16f1ad,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x405269=>{const {width:_0x1e2d63,height:_0x474adf}=_0x405269['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3389c5,this['imageDimension']={'width':_0x1e2d63,'height':_0x474adf},this['imageId']=_0x16f1ad;})['catch'](_0x2a0e84=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x2a0e84['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x1503f3,_0x1a2c95){return this['_getImageAsFile'](_0x1503f3)['then'](_0x1a6d6c=>q['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0x1a2c95['signal'],'file':_0x1a6d6c,'onProgress':_0x1b91d5=>{_0x1b91d5&&_0x1b91d5['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x1b91d5['value']));}}))['then'](_0x28d3f8=>{const {width:_0x405809,height:_0x1796a6}=_0x28d3f8['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x28d3f8['cdnUrl'],this['imageDimension']={'width':_0x405809,'height':_0x1796a6},this['imageId']=_0x28d3f8['uuid'],this['imageUploadProgress']=null;const _0x9f5e9a=_0x1503f3['getAttribute']('src');this['_imageCache']['set'](_0x9f5e9a,{'id':_0x28d3f8['uuid'],'url':_0x28d3f8['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x5b08aa=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x5b08aa['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x221aa6,_0x3c4e9b){_0x221aa6['on']('apply',(_0x36facf,_0x2939b2)=>{this['_replaceImage'](_0x3c4e9b,_0x2939b2['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x221aa6['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x221aa6['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x15ad91,_0xf9161f,_0x4d1dca){const _0x4973aa=this['_editor'],{width:_0x25a168,height:_0xd97cd}=F(_0xf9161f,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x5cb80a,imageSources:_0x27bd1d}=D(_0xf9161f,_0x25a168);_0x4973aa['model']['change'](_0x332220=>{if('$graveyard'===_0x15ad91['root']['rootName']){_0x4973aa['execute']('insertImage',{'imageType':_0x15ad91['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x15ad91['getAttributes']()),'uploadcareImageId':_0x4d1dca,'src':_0x5cb80a,'sources':_0x27bd1d,'width':_0x25a168,'height':_0xd97cd}});const _0x4f5104=_0x15ad91['getChildren']();_0x15ad91=_0x4973aa['model']['document']['selection']['getSelectedElement']();for(const _0x5a6ff7 of _0x4f5104)_0x332220['append'](_0x332220['cloneElement'](_0x5a6ff7),_0x15ad91);}else _0x332220['setSelection'](_0x15ad91,'on'),_0x4973aa['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x15ad91['getAttributes']()),'uploadcareImageId':_0x4d1dca,'src':_0x5cb80a,'sources':_0x27bd1d,'width':_0x25a168,'height':_0xd97cd},_0x15ad91);_0x332220['setSelection'](_0x15ad91,'on');});}async['_getImageAsFile'](_0x42fe5b){const _0x3123f6=_0x2393ce['window'],_0x34fdc9=_0x2393ce['document']['location']['href'],_0x47f598=new _0x3123f6['URL'](_0x42fe5b['getAttribute']('src'),_0x34fdc9);if('data:'===_0x47f598['protocol']){const _0x143560=_0x47f598['href']['split'](','),_0x4051e6=_0x143560[0x0]['match'](/:(.*?);/)[0x1],_0x408858=_0x4051e6['split']('/')[0x1],_0x52bf22=_0x3123f6['atob'](_0x143560[_0x143560['length']-0x1]);let _0x3df3d1=_0x52bf22['length'];const _0x2cfd79=new _0x3123f6['Uint8Array'](_0x3df3d1);for(;_0x3df3d1--;)_0x2cfd79[_0x3df3d1]=_0x52bf22['charCodeAt'](_0x3df3d1);return new _0x3123f6['File']([_0x2cfd79],'image.'+_0x408858,{'type':_0x4051e6});}const _0x623250=_0x47f598['href']['split']('/'),_0x375a36=_0x623250[_0x623250['length']-0x1],_0x16dfee=_0x375a36['split']('.')[0x1];return _0x3123f6['fetch'](_0x47f598['href'])['then'](_0x189533=>_0x189533['clone']()['blob']())['then'](_0x2d4e67=>new _0x3123f6['File']([_0x2d4e67],_0x375a36,{'type':'image/'+_0x16dfee}));}}class tt extends _0x553c37{['imageEditController'];static get['requires'](){return[_0x35fdff];}['_isEditable'];constructor(_0x1f0c14){super(_0x1f0c14),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x17da9c){const _0x2afeff=B(_0x17da9c);return _0x4c38cc=>!(!_0x4c38cc||!_0x4c38cc['is']('element','imageBlock')&&!_0x4c38cc['is']('element','imageInline'))&&(!!_0x4c38cc['hasAttribute']('uploadcareImageId')||!!_0x4c38cc['hasAttribute']('src')&&_0x2afeff(_0x4c38cc['getAttribute']('src')));}(_0x1f0c14['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x4d955d=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x4d955d);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0xf5f913=this['editor']['model']['document']['selection']['getSelectedElement']();_0xf5f913&&(_0xf5f913['is']('element','imageBlock')||_0xf5f913['is']('element','imageInline'))&&(this['imageEditController']=new Y(this['editor'],this['editor']['plugins']['get'](_0x35fdff),_0xf5f913),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class et extends _0x553c37{['refresh'](){const _0x46a571=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x46a571&&(_0x46a571['is']('element','imageBlock')||_0x46a571['is']('element','imageInline')));}['execute'](_0x79002a){const _0x3ed214=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x313bbe=>{_0x313bbe['setAttributes'](_0x79002a,_0x3ed214),_0x313bbe['removeAttribute']('srcset',_0x3ed214),_0x313bbe['removeAttribute']('sizes',_0x3ed214);});}}class it extends _0xcfa041{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[z,_0x3d5365,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x36d351}=this;_0x36d351['commands']['add']('uploadcareImageEdit',new tt(_0x36d351)),_0x36d351['commands']['add']('uploadcareImageReplace',new et(_0x36d351));}}class st extends _0xcfa041{['_imageCache']=new Map();static get['pluginName'](){return'UploadcareImageEditUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['imageCache'](){return this['_imageCache'];}['init'](){const _0x26c361=this['editor'];_0x26c361['ui']['componentFactory']['add']('uploadcareImageEdit',_0xedd39a=>{const _0x385ba5=_0x26c361['commands']['get']('uploadcareImageEdit'),_0x46dc53=new _0x34268c(_0xedd39a),t=_0xedd39a['t'];return _0x46dc53['set']({'icon':_0x1b93bf,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x46dc53['bind']('isEnabled')['to'](_0x385ba5),_0x46dc53['bind']('isOn')['to'](_0x385ba5,'isActive'),this['listenTo'](_0x46dc53,'execute',()=>{_0x26c361['execute']('uploadcareImageEdit'),_0x26c361['editing']['view']['focus']();}),_0x46dc53;}),this['_initConfig']();}['_initConfig'](){const _0x28d42e=_0x4012d2(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x28d42e),this['listenTo'](this['editor'],'destroy',()=>{_0x28d42e['remove']();});}}class nt extends _0xcfa041{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[it,st];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{H as Uploadcare,M as UploadcareCommand,z as UploadcareEditing,nt as UploadcareImageEdit,tt as UploadcareImageEditCommand,it as UploadcareImageEditEditing,st as UploadcareImageEditUI,A as UploadcareUI,W as UploadcareUploadAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-uploadcare",
|
|
3
|
-
"version": "0.0.0-nightly-next-
|
|
3
|
+
"version": "0.0.0-nightly-next-20260112.0",
|
|
4
4
|
"description": "Uploadcare feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dist/translations/*.umd.js"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ckeditor/ckeditor5-core": "0.0.0-nightly-next-
|
|
36
|
-
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-
|
|
37
|
-
"@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-
|
|
38
|
-
"@ckeditor/ckeditor5-image": "0.0.0-nightly-next-
|
|
39
|
-
"@ckeditor/ckeditor5-theme-lark": "0.0.0-nightly-next-
|
|
40
|
-
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-
|
|
41
|
-
"@ckeditor/ckeditor5-upload": "0.0.0-nightly-next-
|
|
42
|
-
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-
|
|
35
|
+
"@ckeditor/ckeditor5-core": "0.0.0-nightly-next-20260112.0",
|
|
36
|
+
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-20260112.0",
|
|
37
|
+
"@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-20260112.0",
|
|
38
|
+
"@ckeditor/ckeditor5-image": "0.0.0-nightly-next-20260112.0",
|
|
39
|
+
"@ckeditor/ckeditor5-theme-lark": "0.0.0-nightly-next-20260112.0",
|
|
40
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-20260112.0",
|
|
41
|
+
"@ckeditor/ckeditor5-upload": "0.0.0-nightly-next-20260112.0",
|
|
42
|
+
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-20260112.0",
|
|
43
43
|
"@uploadcare/file-uploader": "1.24.5",
|
|
44
44
|
"@uploadcare/upload-client": "6.14.3"
|
|
45
45
|
},
|