@ckeditor/ckeditor5-uploadcare 48.0.0-alpha.2 → 48.0.0-alpha.4
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 +8 -8
package/dist/index.js
CHANGED
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x2b498e,Command as _0x27989f}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x2bee1e,IconGooglePhotos as _0x2f0d24,IconGoogleDrive as _0x1b3073,IconFacebook as _0x3e8b19,IconDropbox as _0x580824,IconUploadcareLink as _0x226f38,IconUploadcareImageUpload as _0x17ef19,IconError as _0x27f1a7,IconUploadcareImageEdit as _0x3c7e92}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x818bcb,MenuBarMenuListItemButtonView as _0xc4abfa,View as _0x59df62,FocusCycler as _0x165883,Dialog as _0xd4409f,DialogViewPosition as _0x474297,SpinnerView as _0x3c19ec,IconView as _0x5ca6ba,Notification as _0x22f7fb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x11cb3b,DomEmitterMixin as _0x1e0b76,global as _0xe88406,getAncestors as _0x3e0c43,ObservableMixin as _0x4c7b3d,uid as _0x18b926,createElement as _0x1cb64c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ImageUploadEditing as _0x2b9972,ImageUploadProgress as _0x2039ee,PictureEditing as _0x2f8c59,ImageUtils as _0x57e4e6,ImageEditing as _0x14f923}from'@ckeditor/ckeditor5-image/dist/index.js';import{FileRepository as _0x5ad755}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x15129c,info as _0x3d3837}from'@uploadcare/upload-client';import*as _0x57e39d from'@uploadcare/file-uploader';var D=function(_0x7536d3){return _0x7536d3['Local']='local',_0x7536d3['URL']='url',_0x7536d3['Dropbox']='dropbox',_0x7536d3['GDrive']='gdrive',_0x7536d3['Facebook']='facebook',_0x7536d3['GPhotos']='gphotos',_0x7536d3['OneDrive']='onedrive',_0x7536d3;}({});function F(_0x1c5085,_0x21d1d8,_0x32e6bc){const t=_0x1c5085['t'],_0x3ac2bd=_0x1c5085['t'];switch(_0x21d1d8){case D['Local']:return{'text':_0x3ac2bd('Insert'===_0x32e6bc?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x3ac2bd('From\x20computer')};case D['URL']:return{'text':'Insert'===_0x32e6bc?_0x3ac2bd('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x3ac2bd('Via\x20URL')};case D['Dropbox']:return{'text':t('Insert'===_0x32e6bc?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case D['Facebook']:return{'text':t('Insert'===_0x32e6bc?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case D['GDrive']:return{'text':t('Insert'===_0x32e6bc?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case D['GPhotos']:return{'text':t('Insert'===_0x32e6bc?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case D['OneDrive']:return{'text':t('Insert'===_0x32e6bc?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x21d1d8;}}class $ extends _0x2b498e{['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 _0x19a44a=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x37fd50;for(const _0x2148f9 in _0x19a44a){const _0x368ef5=_0x2148f9,_0x10bfb4=_0x19a44a[_0x368ef5];if('uploadcareLicenseKeyValid'==_0x10bfb4||'uploadcareLicenseKeyInvalid'==_0x10bfb4||'uploadcareLicenseKeyExpired'==_0x10bfb4||'uploadcareLicenseKeyDomainLimit'==_0x10bfb4||'uploadcareLicenseKeyNotAllowed'==_0x10bfb4||'uploadcareLicenseKeyEvaluationLimit'==_0x10bfb4||'uploadcareLicenseKeyUsageLimit'==_0x10bfb4){delete _0x19a44a[_0x368ef5],_0x37fd50=_0x10bfb4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x37fd50&&_0x19a44a['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x37fd50&&_0x19a44a['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x37fd50&&_0x19a44a['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x37fd50&&_0x19a44a['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x37fd50&&_0x19a44a['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x37fd50&&_0x19a44a['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x487ee0}=this,_0xf64faf=_0x487ee0['commands']['get']('uploadcare');if(!_0xf64faf)return;const _0x4e800d=this['_normalizeConfigSourceList'](_0x487ee0['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x4626c1,_0x21e5ad)=>{const _0x53a3c0=this['_getIntegrationKey'](_0x21e5ad['type']);return _0x4626c1[_0x53a3c0]||(_0x4626c1[_0x53a3c0]=[]),_0x4626c1[_0x53a3c0]['push'](_0x21e5ad),_0x4626c1;},{});_0x487ee0['plugins']['has']('ImageInsertUI')&&_0x487ee0['commands']['get']('uploadcare')&&Object['entries'](_0x4e800d)['forEach'](([_0xeb4bd1,_0x49f737])=>{_0x487ee0['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0xeb4bd1,'observable':()=>_0xf64faf,'buttonViewCreator':()=>this['_createToolbarButton'](_0x49f737),'formViewCreator':()=>this['_createDropdownButtons'](_0x49f737),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x49f737),'override':'assetManager'!==_0xeb4bd1});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x2b1fad){const {locale:_0xaae43e}=this['editor'];return _0x2b1fad['map'](_0x4f348b=>{const _0x4b74e0=F(_0xaae43e,_0x4f348b,'Insert');switch(_0x4f348b){case D['Local']:return{'icon':_0x17ef19,'type':D['Local'],..._0x4b74e0};case D['URL']:return{'icon':_0x226f38,'type':D['URL'],..._0x4b74e0};case D['Dropbox']:return{'icon':_0x580824,'type':D['Dropbox'],..._0x4b74e0};case D['Facebook']:return{'icon':_0x3e8b19,'type':D['Facebook'],..._0x4b74e0};case D['GDrive']:return{'icon':_0x1b3073,'type':D['GDrive'],..._0x4b74e0};case D['GPhotos']:return{'icon':_0x2f0d24,'type':D['GPhotos'],..._0x4b74e0};case D['OneDrive']:return{'icon':_0x2bee1e,'type':D['OneDrive'],..._0x4b74e0};}});}['_getIntegrationKey'](_0x499b6b){switch(_0x499b6b){case D['Local']:return'upload';case D['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x1d90fd,_0x1f88fc){const _0xa75308=this['editor'],_0x330365=new _0x1d90fd(_0xa75308['locale']),_0x333a58=_0xa75308['commands']['get']('uploadcare');return _0x330365['bind']('isEnabled')['to'](_0x333a58),_0x330365['on']('execute',()=>{_0x333a58['execute'](_0x1f88fc);}),_0x330365;}['_createToolbarButton'](_0x2e565f){const {locale:_0x2bc123}=this['editor'],_0x1974ba=this['editor']['plugins']['get']('ImageInsertUI'),_0x149eeb=_0x2e565f[0x0],_0x4f03fd=this['_createButton'](_0x818bcb,_0x149eeb['type']);return _0x4f03fd['icon']=_0x149eeb['icon'],_0x4f03fd['bind']('label')['to'](_0x1974ba,'isImageSelected',_0x24b2d8=>F(_0x2bc123,_0x149eeb['type'],_0x24b2d8?'Replace':'Insert')['text']),_0x4f03fd['tooltip']=!0x0,_0x4f03fd;}['_createDropdownButtons'](_0x5a1325){const {locale:_0x55eab6}=this['editor'],_0x5e0dfa=this['editor']['plugins']['get']('ImageInsertUI');return _0x5a1325['map'](_0x56169d=>{const _0x269c32=this['_createButton'](_0x818bcb,_0x56169d['type']);return _0x269c32['withText']=!0x0,_0x269c32['icon']=_0x56169d['icon'],_0x269c32['bind']('label')['to'](_0x5e0dfa,'isImageSelected',_0xeb8cf9=>F(_0x55eab6,_0x56169d['type'],_0xeb8cf9?'Replace':'Insert')['text']),_0x269c32;});}['_createMenuBarButtons'](_0x461347){return _0x461347['map'](_0xb0e7af=>{const _0x5e0b82=this['_createButton'](_0xc4abfa,_0xb0e7af['type']);return _0x5e0b82['icon']=_0xb0e7af['icon'],_0x5e0b82['label']=_0xb0e7af['shortText'],_0x5e0b82;});}}class B extends _0x59df62{['focusTracker'];['focusCycler'];constructor(_0x4c0e28){super(_0x4c0e28),this['focusTracker']=new _0x11cb3b(),this['focusCycler']=new _0x165883({'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 V extends B{constructor(_0x5e58cd,_0x1d33d4){super(_0x5e58cd),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-'+_0x1d33d4}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function j(_0x14b354,_0x2598d1){const _0x7248aa=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x464ada=>_0x464ada<=_0x2598d1)['map'](_0xaf6e4e=>_0x14b354['replace'](/\/$/,'')+'/-/resize/'+_0xaf6e4e+'x/\x20'+_0xaf6e4e+'w');return{'imageFallbackUrl':_0x14b354,'imageSources':[{'srcset':_0x7248aa['join'](',\x20'),'sizes':'(max-width:\x20'+_0x2598d1+'px)\x20100vw,\x20'+_0x2598d1+'px','type':'image/webp'}]};}function M(_0x49736a,_0x115693,_0x885f32){const _0x1f7f43=_0x49736a['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x1f7f43?parseInt(_0x1f7f43[0x1],0xa):_0x115693,'height':_0x1f7f43?parseInt(_0x1f7f43[0x2],0xa):_0x885f32};}function q(_0x26a0b4,_0x3665d1){const _0x395421=new(_0x1e0b76())(),_0x51215e=_0x26a0b4['plugins']['get']('ImageUtils'),_0x109115=_0x26a0b4['editing']['mapper']['toViewElement'](_0x3665d1),_0x34831f=_0x51215e['findViewImgElement'](_0x109115),_0x3ef1d2=_0x26a0b4['editing']['view']['domConverter']['viewToDom'](_0x34831f),_0x3d0899=_0x3665d1['getAttribute']('width'),_0x3afddc=_0x3665d1['getAttribute']('height'),_0x175b13='image-processing';_0x26a0b4['editing']['view']['change'](_0x444f29=>{_0x444f29['addClass'](_0x175b13,_0x109115),_0x444f29['setStyle']('aspect-ratio',_0x3d0899+'/'+_0x3afddc,_0x34831f);}),_0x395421['listenTo'](_0x3ef1d2,'load',()=>{_0x395421['stopListening'](_0x3ef1d2,'load'),_0x26a0b4['editing']['view']['change'](_0x5e0f67=>{_0x5e0f67['removeClass'](_0x175b13,_0x109115),_0x5e0f67['removeStyle']('aspect-ratio',_0x34831f);});});}function W(_0x36383f){if(Array['isArray'](_0x36383f)){const _0x2bca73=_0x36383f['map'](W);return _0x29cd2f=>_0x2bca73['some'](_0x235eaa=>_0x235eaa(_0x29cd2f));}if('origin'==_0x36383f){const _0x421561=_0xe88406['window']['location']['origin'];return _0x74a42=>new URL(_0x74a42,_0xe88406['document']['baseURI'])['origin']==_0x421561;}return'function'==typeof _0x36383f?_0x36383f:_0x36383f instanceof RegExp?_0x58f44e=>!(!_0x58f44e['match'](_0x36383f)&&!_0x58f44e['replace'](/^https?:\/\//,'')['match'](_0x36383f)):()=>!0x1;}function G(_0x3e8ff3,_0x5b8639){return _0x3e0c43(_0x3e8ff3['target'])['includes'](_0x5b8639);}class z extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x4c7b3d(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0xc06d4e,_0xcbfe19,_0x5a6f2b){super(),this['_editor']=_0xc06d4e,this['_editing']=_0xcbfe19,this['_dialog']=_0xc06d4e['plugins']['get'](_0xd4409f),this['_api']=_0xcbfe19['ctxElement']['getAPI'](),this['_type']=_0x5a6f2b,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:_0x46faf0,model:_0x453bab}=this['_editor'],_0x338685=_0x453bab['document']['selection']['getSelectedElement'](),_0x56f05d=_0x338685&&(_0x338685['is']('element','imageBlock')||_0x338685['is']('element','imageInline'));this['_formView']=new V(_0x46faf0,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x17ef19,'title':F(_0x46faf0,this['_type'],_0x56f05d?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x474297['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x1b5431=>!G(_0x1b5431,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x2f2a17}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x4f1dd4=>{const _0x1562eb=_0x2f2a17['length'];for(const _0x293c7e of _0x2f2a17){const _0x524a68=_0x293c7e===_0x2f2a17[_0x1562eb-0x1],{cdnUrl:_0x349e44,fileInfo:_0x20694c}=_0x293c7e;if(!_0x349e44||!_0x20694c)continue;const {width:_0x56adc8,height:_0x3c73c4}=_0x20694c['imageInfo'],_0x5c4726=M(_0x349e44,_0x56adc8,_0x3c73c4),_0x3b01d9=j(_0x349e44,_0x5c4726['width']),_0x51252e={'id':_0x20694c['uuid'],'type':'image','attributes':{'imageDimension':_0x5c4726,..._0x3b01d9}};this['_insertAsset'](_0x51252e,_0x524a68,_0x4f1dd4);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x440e8f=>{'idle'===_0x440e8f['detail']['status']&&!_0x440e8f['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===D['Local']?this['_api']['setCurrentActivity'](D['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x3362f6,_0x3225b5,_0x36b753){const _0x1032fd=this['_editor']['model']['document']['selection'],_0x2e0148=_0x1032fd['getSelectedElement'](),_0x96d2b0=!(!_0x2e0148||!_0x2e0148['is']('element','imageInline'));_0x36b753['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x3362f6,_0x96d2b0),_0x3225b5||_0x36b753['setSelection'](_0x1032fd['getLastPosition']());}['_insertImage'](_0x209a69,_0x14a413){const _0x50825f=this['_editor'],{imageDimension:_0x16fc94,imageFallbackUrl:_0x295c5b,imageSources:_0x12604a}=_0x209a69['attributes'];_0x50825f['execute']('insertImage',{'imageType':_0x14a413?'imageInline':null,'source':{'uploadcareImageId':_0x209a69['id'],'src':_0x295c5b,'sources':_0x12604a,..._0x16fc94}});}}class H extends _0x27989f{['_editing'];['_controller']=null;static get['requires'](){return[_0xd4409f,X];}constructor(_0x51527f){super(_0x51527f),this['_editing']=_0x51527f['plugins']['get'](X);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x4173a2){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new z(this['editor'],this['_editing'],_0x4173a2);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class J{static['upload']({file:_0x5ba504,..._0x3acb48}){return _0x15129c(_0x5ba504,_0x3acb48);}static['getInfo'](_0x26ed1c,_0x27868c){return _0x3d3837(_0x26ed1c,_0x27868c);}}class Z extends _0x2b498e{static get['requires'](){return[_0x2b9972,_0x2039ee,_0x5ad755,X];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x11b453=this['editor'];if(!!!_0x11b453['config']['get']('uploadcare'))return;_0x11b453['plugins']['get'](_0x5ad755)['createUploadAdapter']=_0x5680cc=>new Q(_0x5680cc,_0x11b453),_0x11b453['plugins']['get'](_0x2b9972)['on']('uploadComplete',(_0x477be3,{imageElement:_0x3105d8,data:_0x2d5bfc})=>{_0x11b453['model']['change'](_0x1e2ed2=>{_0x1e2ed2['setAttribute']('uploadcareImageId',_0x2d5bfc['uploadcareImageId'],_0x3105d8);});});}}class Q{['loader'];['editor'];['controller'];constructor(_0x293450,_0x117cbf){this['loader']=_0x293450,this['editor']=_0x117cbf,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x6e74aa=await this['loader']['file'];return J['upload']({'file':_0x6e74aa,'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':_0x10750a=>{_0x10750a&&_0x10750a['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x10750a['value']);}})['then'](async _0x1f8585=>{const {imageFallbackUrl:_0x43587f,imageSources:_0x13b212}=j(_0x1f8585['cdnUrl'],_0x1f8585['imageInfo']['width']);return{'uploadcareImageId':_0x1f8585['uuid'],'default':_0x43587f,'sources':_0x13b212};})['catch'](()=>{const _0x2bf466=t('Cannot\x20upload\x20file:')+('\x20'+_0x6e74aa['name']+'.');return Promise['reject'](_0x2bf466);});}['abort'](){this['controller']['abort']();}}class X extends _0x2b498e{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return[_0x2f8c59,Z,_0xd4409f];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x571eb1){super(_0x571eb1),this['ucContextId']=_0x18b926();}['init'](){const _0x319073=this['editor'];_0x319073['commands']['add']('uploadcare',new H(_0x319073));}['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 _0x52174f=_0xe88406['document']['querySelector']('input[uploadcare-file-input]');_0x52174f&&_0x52174f['remove']();}),async function(_0x5f086e){const _0xece1af=_0x154713([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]),_0x5524c4=0x535f8c3a,_0x1efa8c=0x535808c2^_0x5524c4,_0x3e6f50=window[_0x154713([0x44,0x61,0x74,0x65])][_0x154713([0x6e,0x6f,0x77])](),_0x47b9ad=_0x5f086e[_0x154713([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2f9516=new window[(_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x22355e=>{_0x47b9ad[_0x154713([0x6f,0x6e,0x63,0x65])](_0x154713([0x72,0x65,0x61,0x64,0x79]),_0x22355e);}),_0x2a60e8={[_0x154713([0x6b,0x74,0x79])]:_0x154713([0x45,0x43]),[_0x154713([0x75,0x73,0x65])]:_0x154713([0x73,0x69,0x67]),[_0x154713([0x63,0x72,0x76])]:_0x154713([0x50,0x2d,0x32,0x35,0x36]),[_0x154713([0x78])]:_0x154713([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]),[_0x154713([0x79])]:_0x154713([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]),[_0x154713([0x61,0x6c,0x67])]:_0x154713([0x45,0x53,0x32,0x35,0x36])},_0x4714e0=_0x47b9ad[_0x154713([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x154713([0x67,0x65,0x74])](_0x154713([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x243d6b(){let _0x144676,_0x5a66a8=null,_0x5d1276=null;try{if(_0x4714e0==_0x154713([0x47,0x50,0x4c]))return _0x154713([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x144676=_0x24ac37(),!_0x144676)return _0x154713([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x144676[_0x154713([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5d1276=_0xf26d28(_0x144676[_0x154713([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x144676[_0x154713([0x6a,0x74,0x69])])),await _0x572daa()?_0x2ba277()?_0x2647bf()?_0x154713([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3effb9()?(_0x144676[_0x154713([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x154713([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5a66a8=_0x3d433d(_0x154713([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5c8aec()):_0x154713([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x154713([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x154713([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x154713([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2647bf(){const _0x7e75c3=[_0x154713([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x154713([0x74,0x72,0x69,0x61,0x6c])][_0x154713([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x144676[_0x154713([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3e6f50/0x3e8:0xe10*_0x1efa8c;return _0x144676[_0x154713([0x65,0x78,0x70])]<_0x7e75c3;}function _0x2ba277(){const _0x4d5217=_0x144676[_0x154713([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4d5217&&(!!_0x4d5217[_0x154713([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x154713([0x2a]))||!!_0x4d5217[_0x154713([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x154713([0x55,0x50,0x4c,0x43])));}function _0x3effb9(){const _0x1a0630=_0x144676[_0x154713([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1a0630||0x0==_0x1a0630[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1a885}=new URL(window[_0x154713([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1a0630[_0x154713([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1a885))return!0x0;const _0x239bb9=_0x1a885[_0x154713([0x73,0x70,0x6c,0x69,0x74])](_0x154713([0x2e]));return _0x1a0630[_0x154713([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1f5139=>_0x1f5139[_0x154713([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x154713([0x2a])))[_0x154713([0x6d,0x61,0x70])](_0x382ad6=>_0x382ad6[_0x154713([0x73,0x70,0x6c,0x69,0x74])](_0x154713([0x2e])))[_0x154713([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x403432=>_0x403432[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x239bb9[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x154713([0x6d,0x61,0x70])](_0x8f5716=>Array(_0x239bb9[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x8f5716[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x154713([0x66,0x69,0x6c,0x6c])](_0x8f5716[0x0]===_0x154713([0x2a])?_0x154713([0x2a]):'')[_0x154713([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x8f5716))[_0x154713([0x73,0x6f,0x6d,0x65])](_0x3157b0=>_0x239bb9[_0x154713([0x65,0x76,0x65,0x72,0x79])]((_0x2462cf,_0x4fc66a)=>_0x3157b0[_0x4fc66a]===_0x2462cf||_0x3157b0[_0x4fc66a]===_0x154713([0x2a])));}function _0x5c8aec(){return _0x5a66a8&&_0x5d1276?new window[(_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x10dc9e,_0x3ba403)=>{_0x5a66a8[_0x154713([0x74,0x68,0x65,0x6e])](_0x10dc9e,_0x3ba403),_0x5d1276[_0x154713([0x74,0x68,0x65,0x6e])](_0x161d9b=>{_0x161d9b!=_0x154713([0x56,0x61,0x6c,0x69,0x64])&&_0x10dc9e(_0x161d9b);},_0x3ba403);}):_0x5a66a8||_0x5d1276||_0x154713([0x56,0x61,0x6c,0x69,0x64]);}}function _0xf26d28(_0x3d4dde,_0x227a40){return new window[(_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x481ba5=>{if(_0x213edf())return _0x481ba5(_0x154713([0x56,0x61,0x6c,0x69,0x64]));_0x33b152(),_0x47b9ad[_0x154713([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x154713([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3d719a=!0x1;const _0x547c88=_0x18b926();function _0x4246c3(_0x3ccb66){return!!_0x3ccb66&&(typeof _0x3ccb66===_0x154713([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3ccb66===_0x154713([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3ccb66[_0x154713([0x74,0x68,0x65,0x6e])]===_0x154713([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3ccb66[_0x154713([0x63,0x61,0x74,0x63,0x68])]===_0x154713([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x509e84(_0x67eda9){_0x160acf(_0x67eda9)[_0x154713([0x74,0x68,0x65,0x6e])](_0x553527=>{if(!_0x553527||_0x553527[_0x154713([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x154713([0x6f,0x6b]))return _0x154713([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x453d5a(_0x1cf1e7(_0x547c88+_0x227a40))!=_0x553527[_0x154713([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x154713([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x154713([0x56,0x61,0x6c,0x69,0x64]);})[_0x154713([0x74,0x68,0x65,0x6e])](_0x1190f2=>(_0x46c261(),_0x1190f2),()=>{const _0x5be969=_0x246257();return null==_0x5be969?(_0x46c261(),_0x154713([0x56,0x61,0x6c,0x69,0x64])):_0x154713(_0x3e6f50-_0x5be969>(0x7753083a^_0x5524c4)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x154713([0x74,0x68,0x65,0x6e])](_0x481ba5)[_0x154713([0x63,0x61,0x74,0x63,0x68])](()=>{_0x481ba5(_0x154713([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1bac33=0x536962ba^_0x5524c4;function _0x46c261(){const _0x5de973=_0x154713([0x6c,0x6c,0x63,0x74,0x2d])+_0x453d5a(_0x1cf1e7(_0x3d4dde)),_0x265b73=_0x322997(_0x453d5a(window[_0x154713([0x4d,0x61,0x74,0x68])][_0x154713([0x63,0x65,0x69,0x6c])](_0x3e6f50/_0x1bac33)));window[_0x154713([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x154713([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5de973,_0x265b73);}function _0x246257(){const _0x10b0a6=_0x154713([0x6c,0x6c,0x63,0x74,0x2d])+_0x453d5a(_0x1cf1e7(_0x3d4dde)),_0x58fae4=window[_0x154713([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x154713([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x10b0a6);return _0x58fae4?window[_0x154713([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x322997(_0x58fae4),0x10)*_0x1bac33:null;}function _0x160acf(_0x1f7a82){return new window[(_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x514350,_0x4db5d8)=>{_0x1f7a82[_0x154713([0x74,0x68,0x65,0x6e])](_0x514350,_0x4db5d8),window[_0x154713([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4db5d8,0x535e58fa^_0x5524c4);});}}_0x47b9ad[_0x154713([0x6f,0x6e])](_0x154713([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2805e5,_0x3d07b4)=>{if(_0x3d07b4[0x0]!=_0x3d4dde)return _0x481ba5(_0x154713([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3d07b4[0x1]={..._0x3d07b4[0x1],[_0x154713([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x547c88};},{[_0x154713([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x154713([0x68,0x69,0x67,0x68])}),_0x47b9ad[_0x154713([0x6f,0x6e])](_0x154713([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x20573c=>{_0x4246c3(_0x20573c[_0x154713([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3d719a=!0x0,_0x509e84(_0x20573c[_0x154713([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x154713([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x154713([0x6c,0x6f,0x77])}),_0x2f9516[_0x154713([0x74,0x68,0x65,0x6e])](()=>{_0x3d719a||_0x481ba5(_0x154713([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x213edf(){return _0x47b9ad[_0x154713([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x154713([0x76,0x69,0x65,0x77])][_0x154713([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x154713([0x61,0x75,0x74,0x6f]);}function _0x33b152(){_0x47b9ad[_0x154713([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x154713([0x76,0x69,0x65,0x77])][_0x154713([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x154713([0x61,0x75,0x74,0x6f]);}}function _0x3d433d(_0x4a63de){const _0x86e913=[new window[(_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1e2efd=>setTimeout(_0x1e2efd,0x5356b2f6^_0x5524c4)),_0x2f9516[_0x154713([0x74,0x68,0x65,0x6e])](()=>new window[(_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3bd877=>{let _0x1462b5=0x0;_0x47b9ad[_0x154713([0x6d,0x6f,0x64,0x65,0x6c])][_0x154713([0x6f,0x6e])](_0x154713([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5cc00b,_0x331b95)=>{_0x331b95[0x0][_0x154713([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1462b5++,_0x1462b5==(0x535f89d2^_0x5524c4)&&(_0x3bd877(),_0x5cc00b[_0x154713([0x6f,0x66,0x66])]());});}))];return window[_0x154713([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x154713([0x72,0x61,0x63,0x65])](_0x86e913)[_0x154713([0x74,0x68,0x65,0x6e])](()=>_0x4a63de);}async function _0x5465f6(){await _0x2f9516,_0x47b9ad[_0x154713([0x6d,0x6f,0x64,0x65,0x6c])][_0x154713([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x58c722,_0x47b9ad[_0x154713([0x6d,0x6f,0x64,0x65,0x6c])][_0x154713([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x58c722,_0x47b9ad[_0x154713([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x154713([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x18cfa2(_0x33fc8c){const _0x1fae09=_0x3f29ab();_0x47b9ad[_0x1fae09]=_0x154713([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x33fc8c,_0x33fc8c!=_0x154713([0x56,0x61,0x6c,0x69,0x64])&&_0x5465f6();}function _0x3f29ab(){const _0x10eb17=window[_0x154713([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x154713([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x154713([0x6e,0x6f,0x77])]())[_0x154713([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x154713([0x2e]),'');let _0x14bddf=_0x154713([0x68]);for(let _0x709224=0x0;_0x709224<_0x10eb17[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x709224+=0x2){let _0x4cc795=window[_0x154713([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x10eb17[_0x154713([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x709224,_0x709224+0x2));_0x4cc795>=_0xece1af[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4cc795-=_0xece1af[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x14bddf+=_0xece1af[_0x4cc795];}return _0x14bddf;}function _0x24ac37(){const _0x4c3ffa=_0x4714e0[_0x154713([0x73,0x70,0x6c,0x69,0x74])](_0x154713([0x2e]));if(0x3!=_0x4c3ffa[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3e4ed1(_0x4c3ffa[0x1]);function _0x3e4ed1(_0x1aba58){const _0x2d12fa=_0x3756a2(_0x1aba58);return _0x2d12fa&&_0x22ad1c()?_0x2d12fa:null;function _0x22ad1c(){const _0x215727=_0x2d12fa[_0x154713([0x6a,0x74,0x69])],_0x3b9ee8=window[_0x154713([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x215727[_0x154713([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x215727[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2ec881={..._0x2d12fa,[_0x154713([0x6a,0x74,0x69])]:_0x215727[_0x154713([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x215727[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2ec881[_0x154713([0x76,0x63])],_0x1cf1e7(_0x2ec881)==_0x3b9ee8;}}}async function _0x572daa(){let _0x7af4ef=!0x0;try{const _0x25e70f=_0x4714e0[_0x154713([0x73,0x70,0x6c,0x69,0x74])](_0x154713([0x2e])),[_0x28e60d,_0x19da07,_0x6cd878]=_0x25e70f;return _0x8e8c7c(_0x28e60d),await _0x4b8534(_0x28e60d,_0x19da07,_0x6cd878),_0x7af4ef;}catch{return!0x1;}function _0x8e8c7c(_0x1cb311){const _0x55f09a=_0x3756a2(_0x1cb311);_0x55f09a&&_0x55f09a[_0x154713([0x61,0x6c,0x67])]==_0x154713([0x45,0x53,0x32,0x35,0x36])||(_0x7af4ef=!0x1);}async function _0x4b8534(_0x1ff1c1,_0x528207,_0x436ffb){const _0x2f3350=window[_0x154713([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x154713([0x66,0x72,0x6f,0x6d])](_0x539054(_0x436ffb),_0x34b28c=>_0x34b28c[_0x154713([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x44b44e=new window[(_0x154713([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x154713([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1ff1c1+_0x154713([0x2e])+_0x528207),_0x5498fc=window[_0x154713([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x154713([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5498fc)return;const _0x1f9fb2=await _0x5498fc[_0x154713([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x154713([0x6a,0x77,0x6b]),_0x2a60e8,{[_0x154713([0x6e,0x61,0x6d,0x65])]:_0x154713([0x45,0x43,0x44,0x53,0x41]),[_0x154713([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x154713([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x154713([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5498fc[_0x154713([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x154713([0x6e,0x61,0x6d,0x65])]:_0x154713([0x45,0x43,0x44,0x53,0x41]),[_0x154713([0x68,0x61,0x73,0x68])]:{[_0x154713([0x6e,0x61,0x6d,0x65])]:_0x154713([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1f9fb2,_0x2f3350,_0x44b44e)||(_0x7af4ef=!0x1);}}function _0x3756a2(_0x570c12){return _0x570c12[_0x154713([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x154713([0x65,0x79]))?JSON[_0x154713([0x70,0x61,0x72,0x73,0x65])](_0x539054(_0x570c12)):null;}function _0x539054(_0x451340){return window[_0x154713([0x61,0x74,0x6f,0x62])](_0x451340[_0x154713([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x154713([0x2b]))[_0x154713([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x154713([0x2f])));}function _0x1cf1e7(_0xf4de4){let _0x678d61=0x1505;function _0x6a1c3c(_0x204db5){for(let _0x37e60b=0x0;_0x37e60b<_0x204db5[_0x154713([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x37e60b++){const _0x3f86ad=_0x204db5[_0x154713([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x37e60b);_0x678d61=(_0x678d61<<0x5)+_0x678d61+_0x3f86ad,_0x678d61&=_0x678d61;}}function _0x231eb4(_0x2daa83){Array[_0x154713([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2daa83)?_0x2daa83[_0x154713([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x231eb4):_0x2daa83&&typeof _0x2daa83==_0x154713([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x154713([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2daa83)[_0x154713([0x73,0x6f,0x72,0x74])]()[_0x154713([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x21dfe4,_0x4519d7])=>{_0x6a1c3c(_0x21dfe4),_0x231eb4(_0x4519d7);}):_0x6a1c3c(window[_0x154713([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2daa83));}return _0x231eb4(_0xf4de4),_0x678d61>>>0x0;}function _0x453d5a(_0x56fc8f){return _0x56fc8f[_0x154713([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x154713([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x154713([0x30]));}function _0x322997(_0x262fc2){return _0x262fc2[_0x154713([0x73,0x70,0x6c,0x69,0x74])]('')[_0x154713([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x154713([0x6a,0x6f,0x69,0x6e])]('');}function _0x58c722(){}function _0x154713(_0x4ecadb){return _0x4ecadb['map'](_0x356227=>String['fromCharCode'](_0x356227))['join']('');}_0x18cfa2(await _0x243d6b());}(this);}['_initSchema'](){const _0x447a48=this['editor']['model']['schema'];_0x447a48['isRegistered']('imageBlock')&&_0x447a48['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x447a48['isRegistered']('imageInline')&&_0x447a48['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x3f7cc0=this['editor'];_0x3f7cc0['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x3f7cc0['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x102642=>_0x102642['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x5d8b64=_0x3f7cc0['commands']['get']('replaceImageSource');_0x5d8b64&&this['listenTo'](_0x5d8b64,'cleanupImage',(_0x4398bd,[_0x2292a7,_0x3c5833])=>{_0x2292a7['removeAttribute']('uploadcareImageId',_0x3c5833);});}['_initConfig'](){const _0x1c6d8e=this['editor']['config']['get']('uploadcare.uploader')||{},_0x5b7409=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x1cb64c(_0xe88406['document'],'uc-config',{..._0x1c6d8e,'pubkey':_0x5b7409,'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']=_0x5e7d97=>{if('closeMax'==_0x5e7d97)return'#uc-icon-arrow-down';},_0xe88406['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x1cb64c(_0xe88406['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0xe88406['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x599549=this['editor']['commands']['get']('insertImage');_0x599549&&this['listenTo'](_0x599549,'execute',()=>{const _0x34ffaf=this['editor']['model']['document']['selection']['getSelectedElement']();_0x34ffaf&&_0x34ffaf['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{q(this['editor'],_0x34ffaf);});});const _0x93156e=this['editor']['commands']['get']('uploadcareImageReplace');_0x93156e&&this['listenTo'](_0x93156e,'execute',()=>{const _0x47e49b=this['editor']['model']['document']['selection']['getSelectedElement']();_0x47e49b&&_0x47e49b['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{q(this['editor'],_0x47e49b);});});}}class Y extends _0x2b498e{static get['requires'](){return[X,$];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d395f){super(_0x3d395f),_0x3d395f['config']['define']('uploadcare.uploader.sourceList',[D['Local'],D['URL']]),_0x57e39d['defineComponents'](_0x57e39d),this['_defineLocale']();}['_defineLocale'](){const _0x5dc5b1=this['editor']['config']['get']('uploadcare.locale'),_0x4973ac=this['editor']['locale']['contentLanguage'];_0x5dc5b1&&_0x57e39d['defineLocale'](_0x4973ac,_0x5dc5b1);}}class tt extends _0x59df62{constructor(_0x9156cd){super(_0x9156cd);const t=_0x9156cd['t'],_0x9c9c1c=this['bindTemplate'],_0x1a7129=new _0x3c19ec();_0x1a7129['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':[_0x1a7129,{'text':_0x9c9c1c['to']('imageUploadProgress',_0x250871=>t('Loading\x20image...')+'\x20('+(_0x250871||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 et extends _0x59df62{constructor(_0x4b2865){super(_0x4b2865);const t=_0x4b2865['t'];this['set']('errorType',null);const _0x25e94c=new _0x818bcb(_0x4b2865);_0x25e94c['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x25e94c['withText']=!0x0,_0x25e94c['class']='ck-button-action',_0x25e94c['on']('execute',()=>{this['fire']('retry');}),_0x25e94c['bind']('isVisible')['to'](this,'errorType',_0x1b4e21=>'NotFound'!==_0x1b4e21);const _0x5d7800=new _0x5ca6ba();_0x5d7800['content']=_0x27f1a7,_0x5d7800['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x38af17=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':[_0x5d7800,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x38af17['to']('errorType',_0x3b3ec7=>t('NotFound'!==_0x3b3ec7?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x25e94c]},{'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 it extends _0x59df62{constructor(_0x1b12f6,_0x905913){super(_0x1b12f6);const _0x2341a2=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x905913,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x2341a2['to']('imageSrc')}});}}class st extends B{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x1c7f6d,_0x147fe7,_0x420e0c){super(_0x1c7f6d),this['_items']=this['createCollection'](),this['_loadingView']=new tt(_0x1c7f6d),this['_errorView']=new et(_0x1c7f6d),this['_editingView']=new it(_0x1c7f6d,_0x420e0c),this['_focusableView']=new _0x59df62(_0x1c7f6d),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x147fe7),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'],_0x2209c8=>{this['_addUploadcareImageEditorListeners'](_0x2209c8);});}),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'](_0x1ca1f0,_0x182a1a){const _0x382ae3='uc-cloud-image-editor',_0x4088c0=_0x1ca1f0['querySelector'](_0x382ae3);if(_0x4088c0)return _0x182a1a(_0x4088c0);const _0x4c111e=new MutationObserver(_0x367cac=>{const _0x237d78=_0x367cac['filter'](_0x3c245b=>_0x3c245b['target']===_0x1ca1f0&&_0x3c245b['addedNodes']['length']>0x0&&_0x3c245b['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x382ae3);_0x237d78['length']&&(_0x4c111e['disconnect'](),_0x182a1a(_0x237d78[0x0]['addedNodes'][0x0]));});_0x4c111e['observe'](_0x1ca1f0,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x14aeb9){_0x14aeb9['addEventListener']('apply',_0x337347=>{this['fire']('apply',{'imageSrc':_0x337347['detail']['cdnUrl']});}),_0x14aeb9['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class nt extends/* #__PURE__ -- @preserve */
|
|
25
|
-
_0x4c7b3d(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x2a4bb4,_0x26f742,_0x3f44e4){super(),this['_editor']=_0x2a4bb4,this['_dialog']=_0x26f742,this['_imageElement']=_0x3f44e4,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 _0x31cacb=this['_imageElement'],_0x33978b=_0x31cacb['getAttribute']('uploadcareImageId'),_0x3efe73=_0x31cacb['getAttribute']('src');if(_0x33978b)await this['_loadImageInfo'](_0x33978b,_0x3efe73);else{if(this['_imageCache']['has'](_0x3efe73)){const _0x951897=this['_imageCache']['get'](_0x3efe73);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x951897['url'],this['imageDimension']=_0x951897['dimension'],this['imageId']=_0x951897['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x2aedab}=this['_editor'],t=_0x2aedab['t'],_0x3dd5d6=new st(_0x2aedab,this['imageStatus'],this['_attributes']);_0x3dd5d6['bind']('status')['to'](this,'imageStatus'),_0x3dd5d6['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x3dd5d6['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x3dd5d6['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x3dd5d6,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x3c7e92,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x3dd5d6,'position':_0x474297['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x3dd5d6['focus']();},'onHide':()=>{_0x3dd5d6['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x4f3622=>!G(_0x4f3622,_0x3dd5d6['element'])}});}['_loadImageInfo'](_0x24ab77,_0x5e3083){return J['getInfo'](_0x24ab77,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x1871c2=>{const {width:_0x4ed8e2,height:_0x30c331}=_0x1871c2['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x5e3083,this['imageDimension']={'width':_0x4ed8e2,'height':_0x30c331},this['imageId']=_0x24ab77;})['catch'](_0x36b962=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x36b962['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x18f2bb,_0x13c8cd){return this['_getImageAsFile'](_0x18f2bb)['then'](_0x251986=>J['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':_0x13c8cd['signal'],'file':_0x251986,'onProgress':_0xff75bd=>{_0xff75bd&&_0xff75bd['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0xff75bd['value']));}}))['then'](_0x2e9db9=>{const {width:_0x441eb2,height:_0x12d67b}=_0x2e9db9['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x2e9db9['cdnUrl'],this['imageDimension']={'width':_0x441eb2,'height':_0x12d67b},this['imageId']=_0x2e9db9['uuid'],this['imageUploadProgress']=null;const _0x3631dc=_0x18f2bb['getAttribute']('src');this['_imageCache']['set'](_0x3631dc,{'id':_0x2e9db9['uuid'],'url':_0x2e9db9['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x387a7c=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x387a7c['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x6e6de7,_0x3105c5){_0x6e6de7['on']('apply',(_0x40f321,_0x499d3e)=>{this['_replaceImage'](_0x3105c5,_0x499d3e['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x6e6de7['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x6e6de7['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x2ee1ae,_0x46cdcf,_0x5c0fc9){const _0x63e094=this['_editor'],{width:_0x3f8cc2,height:_0x3572b6}=M(_0x46cdcf,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x42052c,imageSources:_0x1db6bd}=j(_0x46cdcf,_0x3f8cc2);_0x63e094['model']['change'](_0x1a6a33=>{if('$graveyard'===_0x2ee1ae['root']['rootName']){_0x63e094['execute']('insertImage',{'imageType':_0x2ee1ae['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x2ee1ae['getAttributes']()),'uploadcareImageId':_0x5c0fc9,'src':_0x42052c,'sources':_0x1db6bd,'width':_0x3f8cc2,'height':_0x3572b6}});const _0x21dab5=_0x2ee1ae['getChildren']();_0x2ee1ae=_0x63e094['model']['document']['selection']['getSelectedElement']();for(const _0x25124f of _0x21dab5)_0x1a6a33['append'](_0x1a6a33['cloneElement'](_0x25124f),_0x2ee1ae);}else _0x1a6a33['setSelection'](_0x2ee1ae,'on'),_0x63e094['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x2ee1ae['getAttributes']()),'uploadcareImageId':_0x5c0fc9,'src':_0x42052c,'sources':_0x1db6bd,'width':_0x3f8cc2,'height':_0x3572b6},_0x2ee1ae);_0x1a6a33['setSelection'](_0x2ee1ae,'on');});}async['_getImageAsFile'](_0x3d53db){const _0x5d6391=_0xe88406['window'],_0x3db86f=_0xe88406['document']['location']['href'],_0x1fa061=new _0x5d6391['URL'](_0x3d53db['getAttribute']('src'),_0x3db86f);if('data:'===_0x1fa061['protocol']){const _0x5bdd6b=_0x1fa061['href']['split'](','),_0x231359=_0x5bdd6b[0x0]['match'](/:(.*?);/)[0x1],_0x1d0d5f=_0x231359['split']('/')[0x1],_0x4d63a7=_0x5d6391['atob'](_0x5bdd6b[_0x5bdd6b['length']-0x1]);let _0x3e677d=_0x4d63a7['length'];const _0x21d011=new _0x5d6391['Uint8Array'](_0x3e677d);for(;_0x3e677d--;)_0x21d011[_0x3e677d]=_0x4d63a7['charCodeAt'](_0x3e677d);return new _0x5d6391['File']([_0x21d011],'image.'+_0x1d0d5f,{'type':_0x231359});}const _0x528ee7=_0x1fa061['href']['split']('/'),_0x29a03a=_0x528ee7[_0x528ee7['length']-0x1],_0x4acc82=_0x29a03a['split']('.')[0x1];return _0x5d6391['fetch'](_0x1fa061['href'])['then'](_0x53f12d=>_0x53f12d['clone']()['blob']())['then'](_0x5cef3b=>new _0x5d6391['File']([_0x5cef3b],_0x29a03a,{'type':'image/'+_0x4acc82}));}}class rt extends _0x27989f{['imageEditController'];static get['requires'](){return[_0xd4409f];}['_isEditable'];constructor(_0x56b694){super(_0x56b694),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x4a9e2b){const _0x44c1cc=W(_0x4a9e2b);return _0x1e2c25=>!(!_0x1e2c25||!_0x1e2c25['is']('element','imageBlock')&&!_0x1e2c25['is']('element','imageInline'))&&(!!_0x1e2c25['hasAttribute']('uploadcareImageId')||!!_0x1e2c25['hasAttribute']('src')&&_0x44c1cc(_0x1e2c25['getAttribute']('src')));}(_0x56b694['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x32ede1=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x32ede1);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x22b6bc=this['editor']['model']['document']['selection']['getSelectedElement']();_0x22b6bc&&(_0x22b6bc['is']('element','imageBlock')||_0x22b6bc['is']('element','imageInline'))&&(this['imageEditController']=new nt(this['editor'],this['editor']['plugins']['get'](_0xd4409f),_0x22b6bc),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class at extends _0x27989f{['refresh'](){const _0x1ce28c=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x1ce28c&&(_0x1ce28c['is']('element','imageBlock')||_0x1ce28c['is']('element','imageInline')));}['execute'](_0xf5e6ff){const _0x1762a9=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0xc4e8e8=>{_0xc4e8e8['setAttributes'](_0xf5e6ff,_0x1762a9),_0xc4e8e8['removeAttribute']('srcset',_0x1762a9),_0xc4e8e8['removeAttribute']('sizes',_0x1762a9);});}}class ot extends _0x2b498e{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[X,_0x22f7fb,_0x57e4e6,_0x14f923];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2d6935}=this;_0x2d6935['commands']['add']('uploadcareImageEdit',new rt(_0x2d6935)),_0x2d6935['commands']['add']('uploadcareImageReplace',new at(_0x2d6935));}}class ct extends _0x2b498e{['_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 _0x545b79=this['editor'];_0x545b79['ui']['componentFactory']['add']('uploadcareImageEdit',_0x25d539=>{const _0x15753f=_0x545b79['commands']['get']('uploadcareImageEdit'),_0x16e7f1=new _0x818bcb(_0x25d539),t=_0x25d539['t'];return _0x16e7f1['set']({'icon':_0x3c7e92,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x16e7f1['bind']('isEnabled')['to'](_0x15753f),_0x16e7f1['bind']('isOn')['to'](_0x15753f,'isActive'),this['listenTo'](_0x16e7f1,'execute',()=>{_0x545b79['execute']('uploadcareImageEdit'),_0x545b79['editing']['view']['focus']();}),_0x16e7f1;}),this['_initConfig']();}['_initConfig'](){const _0x1f9d1c=_0x1cb64c(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x1f9d1c),this['listenTo'](this['editor'],'destroy',()=>{_0x1f9d1c['remove']();});}}class lt extends _0x2b498e{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[ot,ct];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Y as Uploadcare,H as UploadcareCommand,X as UploadcareEditing,lt as UploadcareImageEdit,rt as UploadcareImageEditCommand,ot as UploadcareImageEditEditing,ct as UploadcareImageEditUI,$ as UploadcareUI,Z as UploadcareUploadAdapter};
|
|
23
|
+
import{Plugin as _0x20cce4,Command as _0x39f285}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x12852f,IconGooglePhotos as _0x4451cf,IconGoogleDrive as _0x29d5e3,IconFacebook as _0x3d9ec4,IconDropbox as _0x2ef066,IconUploadcareLink as _0x2c5f10,IconUploadcareImageUpload as _0x547b7c,IconError as _0x3376b8,IconUploadcareImageEdit as _0x35592e}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x121de2,MenuBarMenuListItemButtonView as _0x2d1277,View as _0x295101,FocusCycler as _0x293a7a,Dialog as _0x4b0eef,DialogViewPosition as _0x1384b6,SpinnerView as _0x40ab07,IconView as _0x36209b,Notification as _0x4d4cbd}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x51ee28,DomEmitterMixin as _0x2d50dd,global as _0x268822,getAncestors as _0x569d09,ObservableMixin as _0x492ba4,uid as _0x3b9c2f,createElement as _0x2d1cfc}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ImageUploadEditing as _0x529657,ImageUploadProgress as _0xf1fff3,PictureEditing as _0x18cca6,ImageUtils as _0x308f32,ImageEditing as _0x555ed6}from'@ckeditor/ckeditor5-image/dist/index.js';import{FileRepository as _0x473012}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x14d5b0,info as _0x5c614d}from'@uploadcare/upload-client';import*as _0x46c3a1 from'@uploadcare/file-uploader';var D=function(_0x3bd3d7){return _0x3bd3d7['Local']='local',_0x3bd3d7['URL']='url',_0x3bd3d7['Dropbox']='dropbox',_0x3bd3d7['GDrive']='gdrive',_0x3bd3d7['Facebook']='facebook',_0x3bd3d7['GPhotos']='gphotos',_0x3bd3d7['OneDrive']='onedrive',_0x3bd3d7;}({});function F(_0x3e0e86,_0x18f4da,_0x3fa5d1){const t=_0x3e0e86['t'],_0x2d6c9d=_0x3e0e86['t'];switch(_0x18f4da){case D['Local']:return{'text':_0x2d6c9d('Insert'===_0x3fa5d1?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x2d6c9d('From\x20computer')};case D['URL']:return{'text':'Insert'===_0x3fa5d1?_0x2d6c9d('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x2d6c9d('Via\x20URL')};case D['Dropbox']:return{'text':t('Insert'===_0x3fa5d1?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case D['Facebook']:return{'text':t('Insert'===_0x3fa5d1?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case D['GDrive']:return{'text':t('Insert'===_0x3fa5d1?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case D['GPhotos']:return{'text':t('Insert'===_0x3fa5d1?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case D['OneDrive']:return{'text':t('Insert'===_0x3fa5d1?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x18f4da;}}class $ extends _0x20cce4{['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 _0x53b460=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x214648;for(const _0x2c6b82 in _0x53b460){const _0x5c402b=_0x2c6b82,_0x49567b=_0x53b460[_0x5c402b];if('uploadcareLicenseKeyValid'==_0x49567b||'uploadcareLicenseKeyInvalid'==_0x49567b||'uploadcareLicenseKeyExpired'==_0x49567b||'uploadcareLicenseKeyDomainLimit'==_0x49567b||'uploadcareLicenseKeyNotAllowed'==_0x49567b||'uploadcareLicenseKeyEvaluationLimit'==_0x49567b||'uploadcareLicenseKeyUsageLimit'==_0x49567b){delete _0x53b460[_0x5c402b],_0x214648=_0x49567b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x214648&&_0x53b460['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x214648&&_0x53b460['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x214648&&_0x53b460['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x214648&&_0x53b460['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x214648&&_0x53b460['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x214648&&_0x53b460['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x474f14}=this,_0x26fa18=_0x474f14['commands']['get']('uploadcare');if(!_0x26fa18)return;const _0x14b007=this['_normalizeConfigSourceList'](_0x474f14['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x3cf2a3,_0x4db306)=>{const _0x289e8c=this['_getIntegrationKey'](_0x4db306['type']);return _0x3cf2a3[_0x289e8c]||(_0x3cf2a3[_0x289e8c]=[]),_0x3cf2a3[_0x289e8c]['push'](_0x4db306),_0x3cf2a3;},{});_0x474f14['plugins']['has']('ImageInsertUI')&&_0x474f14['commands']['get']('uploadcare')&&Object['entries'](_0x14b007)['forEach'](([_0x156c75,_0x12cad1])=>{_0x474f14['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x156c75,'observable':()=>_0x26fa18,'buttonViewCreator':()=>this['_createToolbarButton'](_0x12cad1),'formViewCreator':()=>this['_createDropdownButtons'](_0x12cad1),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x12cad1),'override':'assetManager'!==_0x156c75});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x50e2c8){const {locale:_0x3dda0c}=this['editor'];return _0x50e2c8['map'](_0x106951=>{const _0xedbfc9=F(_0x3dda0c,_0x106951,'Insert');switch(_0x106951){case D['Local']:return{'icon':_0x547b7c,'type':D['Local'],..._0xedbfc9};case D['URL']:return{'icon':_0x2c5f10,'type':D['URL'],..._0xedbfc9};case D['Dropbox']:return{'icon':_0x2ef066,'type':D['Dropbox'],..._0xedbfc9};case D['Facebook']:return{'icon':_0x3d9ec4,'type':D['Facebook'],..._0xedbfc9};case D['GDrive']:return{'icon':_0x29d5e3,'type':D['GDrive'],..._0xedbfc9};case D['GPhotos']:return{'icon':_0x4451cf,'type':D['GPhotos'],..._0xedbfc9};case D['OneDrive']:return{'icon':_0x12852f,'type':D['OneDrive'],..._0xedbfc9};}});}['_getIntegrationKey'](_0x1a2d46){switch(_0x1a2d46){case D['Local']:return'upload';case D['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x4c6233,_0x47c671){const _0x1126da=this['editor'],_0x3a6eb3=new _0x4c6233(_0x1126da['locale']),_0xa5b847=_0x1126da['commands']['get']('uploadcare');return _0x3a6eb3['bind']('isEnabled')['to'](_0xa5b847),_0x3a6eb3['on']('execute',()=>{_0xa5b847['execute'](_0x47c671);}),_0x3a6eb3;}['_createToolbarButton'](_0x82dceb){const {locale:_0x55153e}=this['editor'],_0xecc07c=this['editor']['plugins']['get']('ImageInsertUI'),_0x4216b6=_0x82dceb[0x0],_0x2bfe3b=this['_createButton'](_0x121de2,_0x4216b6['type']);return _0x2bfe3b['icon']=_0x4216b6['icon'],_0x2bfe3b['bind']('label')['to'](_0xecc07c,'isImageSelected',_0xa1bcba=>F(_0x55153e,_0x4216b6['type'],_0xa1bcba?'Replace':'Insert')['text']),_0x2bfe3b['tooltip']=!0x0,_0x2bfe3b;}['_createDropdownButtons'](_0x3638b2){const {locale:_0x10fbf5}=this['editor'],_0x2ae752=this['editor']['plugins']['get']('ImageInsertUI');return _0x3638b2['map'](_0x225adb=>{const _0x51d33b=this['_createButton'](_0x121de2,_0x225adb['type']);return _0x51d33b['withText']=!0x0,_0x51d33b['icon']=_0x225adb['icon'],_0x51d33b['bind']('label')['to'](_0x2ae752,'isImageSelected',_0x194848=>F(_0x10fbf5,_0x225adb['type'],_0x194848?'Replace':'Insert')['text']),_0x51d33b;});}['_createMenuBarButtons'](_0x5d91db){return _0x5d91db['map'](_0x29c7bb=>{const _0x12afa1=this['_createButton'](_0x2d1277,_0x29c7bb['type']);return _0x12afa1['icon']=_0x29c7bb['icon'],_0x12afa1['label']=_0x29c7bb['shortText'],_0x12afa1;});}}class B extends _0x295101{['focusTracker'];['focusCycler'];constructor(_0xa1656e){super(_0xa1656e),this['focusTracker']=new _0x51ee28(),this['focusCycler']=new _0x293a7a({'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 V extends B{constructor(_0x4df9b4,_0x4f8a00){super(_0x4df9b4),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-'+_0x4f8a00}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function j(_0x38261d,_0x433d73){const _0x55e0d7=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x4a19a5=>_0x4a19a5<=_0x433d73)['map'](_0x21002a=>_0x38261d['replace'](/\/$/,'')+'/-/resize/'+_0x21002a+'x/\x20'+_0x21002a+'w');return{'imageFallbackUrl':_0x38261d,'imageSources':[{'srcset':_0x55e0d7['join'](',\x20'),'sizes':'(max-width:\x20'+_0x433d73+'px)\x20100vw,\x20'+_0x433d73+'px','type':'image/webp'}]};}function M(_0x28a9cd,_0x13f584,_0x16a71c){const _0x5cd9d7=_0x28a9cd['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x5cd9d7?parseInt(_0x5cd9d7[0x1],0xa):_0x13f584,'height':_0x5cd9d7?parseInt(_0x5cd9d7[0x2],0xa):_0x16a71c};}function q(_0x3bbada,_0x196960){const _0x32b58a=new(_0x2d50dd())(),_0x366e84=_0x3bbada['plugins']['get']('ImageUtils'),_0x556e56=_0x3bbada['editing']['mapper']['toViewElement'](_0x196960),_0x13be05=_0x366e84['findViewImgElement'](_0x556e56),_0x951480=_0x3bbada['editing']['view']['domConverter']['viewToDom'](_0x13be05),_0xa059a=_0x196960['getAttribute']('width'),_0x277bec=_0x196960['getAttribute']('height'),_0x5a58f4='image-processing';_0x3bbada['editing']['view']['change'](_0x30ad9a=>{_0x30ad9a['addClass'](_0x5a58f4,_0x556e56),_0x30ad9a['setStyle']('aspect-ratio',_0xa059a+'/'+_0x277bec,_0x13be05);}),_0x32b58a['listenTo'](_0x951480,'load',()=>{_0x32b58a['stopListening'](_0x951480,'load'),_0x3bbada['editing']['view']['change'](_0x8bf070=>{_0x8bf070['removeClass'](_0x5a58f4,_0x556e56),_0x8bf070['removeStyle']('aspect-ratio',_0x13be05);});});}function W(_0x55f24a){if(Array['isArray'](_0x55f24a)){const _0xa7f90f=_0x55f24a['map'](W);return _0x82159e=>_0xa7f90f['some'](_0x2b4ca6=>_0x2b4ca6(_0x82159e));}if('origin'==_0x55f24a){const _0x53e613=_0x268822['window']['location']['origin'];return _0x2d3ec1=>new URL(_0x2d3ec1,_0x268822['document']['baseURI'])['origin']==_0x53e613;}return'function'==typeof _0x55f24a?_0x55f24a:_0x55f24a instanceof RegExp?_0x4308be=>!(!_0x4308be['match'](_0x55f24a)&&!_0x4308be['replace'](/^https?:\/\//,'')['match'](_0x55f24a)):()=>!0x1;}function G(_0x30d9ed,_0x312ee2){return _0x569d09(_0x30d9ed['target'])['includes'](_0x312ee2);}class z extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x492ba4(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x19e9fc,_0x484dd5,_0x77f264){super(),this['_editor']=_0x19e9fc,this['_editing']=_0x484dd5,this['_dialog']=_0x19e9fc['plugins']['get'](_0x4b0eef),this['_api']=_0x484dd5['ctxElement']['getAPI'](),this['_type']=_0x77f264,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:_0x529273,model:_0x3bc444}=this['_editor'],_0x658d31=_0x3bc444['document']['selection']['getSelectedElement'](),_0x19d82e=_0x658d31&&(_0x658d31['is']('element','imageBlock')||_0x658d31['is']('element','imageInline'));this['_formView']=new V(_0x529273,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x547b7c,'title':F(_0x529273,this['_type'],_0x19d82e?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x1384b6['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x2e80bf=>!G(_0x2e80bf,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0xb7936a}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x1d7427=>{const _0x9d1514=_0xb7936a['length'];for(const _0x50279d of _0xb7936a){const _0x319266=_0x50279d===_0xb7936a[_0x9d1514-0x1],{cdnUrl:_0x2200a5,fileInfo:_0x21ffbc}=_0x50279d;if(!_0x2200a5||!_0x21ffbc)continue;const {width:_0x3ad484,height:_0x19d383}=_0x21ffbc['imageInfo'],_0x38a18e=M(_0x2200a5,_0x3ad484,_0x19d383),_0x50cba5=j(_0x2200a5,_0x38a18e['width']),_0x4abaf5={'id':_0x21ffbc['uuid'],'type':'image','attributes':{'imageDimension':_0x38a18e,..._0x50cba5}};this['_insertAsset'](_0x4abaf5,_0x319266,_0x1d7427);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x2617ff=>{'idle'===_0x2617ff['detail']['status']&&!_0x2617ff['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===D['Local']?this['_api']['setCurrentActivity'](D['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x2d6962,_0xa743a3,_0x1040a8){const _0x40f741=this['_editor']['model']['document']['selection'],_0x461352=_0x40f741['getSelectedElement'](),_0x3c6fe6=!(!_0x461352||!_0x461352['is']('element','imageInline'));_0x1040a8['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x2d6962,_0x3c6fe6),_0xa743a3||_0x1040a8['setSelection'](_0x40f741['getLastPosition']());}['_insertImage'](_0x515a4a,_0x1a95b2){const _0x10304d=this['_editor'],{imageDimension:_0xccbf0b,imageFallbackUrl:_0x59bc98,imageSources:_0x31bf9d}=_0x515a4a['attributes'];_0x10304d['execute']('insertImage',{'imageType':_0x1a95b2?'imageInline':null,'source':{'uploadcareImageId':_0x515a4a['id'],'src':_0x59bc98,'sources':_0x31bf9d,..._0xccbf0b}});}}class H extends _0x39f285{['_editing'];['_controller']=null;static get['requires'](){return[_0x4b0eef,X];}constructor(_0x864465){super(_0x864465),this['_editing']=_0x864465['plugins']['get'](X);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x56c76c){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new z(this['editor'],this['_editing'],_0x56c76c);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class J{static['upload']({file:_0x416caf,..._0x20998f}){return _0x14d5b0(_0x416caf,_0x20998f);}static['getInfo'](_0x4e3b48,_0x11ed02){return _0x5c614d(_0x4e3b48,_0x11ed02);}}class Z extends _0x20cce4{static get['requires'](){return[_0x529657,_0xf1fff3,_0x473012,X];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x3906d6=this['editor'];if(!!!_0x3906d6['config']['get']('uploadcare'))return;_0x3906d6['plugins']['get'](_0x473012)['createUploadAdapter']=_0x26b3d3=>new Q(_0x26b3d3,_0x3906d6),_0x3906d6['plugins']['get'](_0x529657)['on']('uploadComplete',(_0x5c3471,{imageElement:_0x152790,data:_0x4806b0})=>{_0x3906d6['model']['change'](_0x3ef694=>{_0x3ef694['setAttribute']('uploadcareImageId',_0x4806b0['uploadcareImageId'],_0x152790);});});}}class Q{['loader'];['editor'];['controller'];constructor(_0x35e24b,_0x3445a5){this['loader']=_0x35e24b,this['editor']=_0x3445a5,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x20978a=await this['loader']['file'];return J['upload']({'file':_0x20978a,'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':_0x390b6f=>{_0x390b6f&&_0x390b6f['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x390b6f['value']);}})['then'](async _0x28728e=>{const {imageFallbackUrl:_0x760213,imageSources:_0x5f511f}=j(_0x28728e['cdnUrl'],_0x28728e['imageInfo']['width']);return{'uploadcareImageId':_0x28728e['uuid'],'default':_0x760213,'sources':_0x5f511f};})['catch'](()=>{const _0x2a78f6=t('Cannot\x20upload\x20file:')+('\x20'+_0x20978a['name']+'.');return Promise['reject'](_0x2a78f6);});}['abort'](){this['controller']['abort']();}}class X extends _0x20cce4{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return[_0x18cca6,Z,_0x4b0eef];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x5a689d){super(_0x5a689d),this['ucContextId']=_0x3b9c2f();}['init'](){const _0x4bc736=this['editor'];_0x4bc736['commands']['add']('uploadcare',new H(_0x4bc736));}['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 _0x4b8cb3=_0x268822['document']['querySelector']('input[uploadcare-file-input]');_0x4b8cb3&&_0x4b8cb3['remove']();}),async function(_0x5efaeb){const _0x4fa1a2=_0x32953f([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]),_0x5ae5aa=0x535f8c3a,_0x3116ea=0x53580912^_0x5ae5aa,_0x3e90f4=window[_0x32953f([0x44,0x61,0x74,0x65])][_0x32953f([0x6e,0x6f,0x77])](),_0x4b6ae2=_0x5efaeb[_0x32953f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5a129c=new window[(_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x34abf2=>{_0x4b6ae2[_0x32953f([0x6f,0x6e,0x63,0x65])](_0x32953f([0x72,0x65,0x61,0x64,0x79]),_0x34abf2);}),_0x3bda50={[_0x32953f([0x6b,0x74,0x79])]:_0x32953f([0x45,0x43]),[_0x32953f([0x75,0x73,0x65])]:_0x32953f([0x73,0x69,0x67]),[_0x32953f([0x63,0x72,0x76])]:_0x32953f([0x50,0x2d,0x32,0x35,0x36]),[_0x32953f([0x78])]:_0x32953f([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]),[_0x32953f([0x79])]:_0x32953f([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]),[_0x32953f([0x61,0x6c,0x67])]:_0x32953f([0x45,0x53,0x32,0x35,0x36])},_0x3a962f=_0x4b6ae2[_0x32953f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x32953f([0x67,0x65,0x74])](_0x32953f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4b7bff(){let _0x10031a,_0x392210=null,_0x59ef8a=null;try{if(_0x3a962f==_0x32953f([0x47,0x50,0x4c]))return _0x32953f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x10031a=_0x6e40cf(),!_0x10031a)return _0x32953f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x10031a[_0x32953f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x59ef8a=_0xd21740(_0x10031a[_0x32953f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x10031a[_0x32953f([0x6a,0x74,0x69])])),await _0x3d2b6a()?_0x9e48c2()?_0x34dec2()?_0x32953f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1580ea()?(_0x10031a[_0x32953f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x32953f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x392210=_0x1711e8(_0x32953f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x43bda0()):_0x32953f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x32953f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x32953f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x32953f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x34dec2(){const _0x17afee=[_0x32953f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x32953f([0x74,0x72,0x69,0x61,0x6c])][_0x32953f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x10031a[_0x32953f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3e90f4/0x3e8:0xe10*_0x3116ea;return _0x10031a[_0x32953f([0x65,0x78,0x70])]<_0x17afee;}function _0x9e48c2(){const _0x302554=_0x10031a[_0x32953f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x302554&&(!!_0x302554[_0x32953f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x32953f([0x2a]))||!!_0x302554[_0x32953f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x32953f([0x55,0x50,0x4c,0x43])));}function _0x1580ea(){const _0x37f0ce=_0x10031a[_0x32953f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x37f0ce||0x0==_0x37f0ce[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3ed277}=new URL(window[_0x32953f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x37f0ce[_0x32953f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3ed277))return!0x0;const _0x4aa3f3=_0x3ed277[_0x32953f([0x73,0x70,0x6c,0x69,0x74])](_0x32953f([0x2e]));return _0x37f0ce[_0x32953f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4c0770=>_0x4c0770[_0x32953f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x32953f([0x2a])))[_0x32953f([0x6d,0x61,0x70])](_0x40ea50=>_0x40ea50[_0x32953f([0x73,0x70,0x6c,0x69,0x74])](_0x32953f([0x2e])))[_0x32953f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x425226=>_0x425226[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4aa3f3[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x32953f([0x6d,0x61,0x70])](_0x1aef42=>Array(_0x4aa3f3[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1aef42[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x32953f([0x66,0x69,0x6c,0x6c])](_0x1aef42[0x0]===_0x32953f([0x2a])?_0x32953f([0x2a]):'')[_0x32953f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1aef42))[_0x32953f([0x73,0x6f,0x6d,0x65])](_0x5af099=>_0x4aa3f3[_0x32953f([0x65,0x76,0x65,0x72,0x79])]((_0x4fa826,_0x4857cb)=>_0x5af099[_0x4857cb]===_0x4fa826||_0x5af099[_0x4857cb]===_0x32953f([0x2a])));}function _0x43bda0(){return _0x392210&&_0x59ef8a?new window[(_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1c7d7c,_0x58f327)=>{_0x392210[_0x32953f([0x74,0x68,0x65,0x6e])](_0x1c7d7c,_0x58f327),_0x59ef8a[_0x32953f([0x74,0x68,0x65,0x6e])](_0x41c787=>{_0x41c787!=_0x32953f([0x56,0x61,0x6c,0x69,0x64])&&_0x1c7d7c(_0x41c787);},_0x58f327);}):_0x392210||_0x59ef8a||_0x32953f([0x56,0x61,0x6c,0x69,0x64]);}}function _0xd21740(_0x2b39ac,_0x4f021c){return new window[(_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d7969=>{if(_0x3bd8b9())return _0x4d7969(_0x32953f([0x56,0x61,0x6c,0x69,0x64]));_0x32b797(),_0x4b6ae2[_0x32953f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x32953f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2ed5a5=!0x1;const _0x560f68=_0x3b9c2f();function _0x1b37ad(_0x45f11c){return!!_0x45f11c&&(typeof _0x45f11c===_0x32953f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x45f11c===_0x32953f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x45f11c[_0x32953f([0x74,0x68,0x65,0x6e])]===_0x32953f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x45f11c[_0x32953f([0x63,0x61,0x74,0x63,0x68])]===_0x32953f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x116dcb(_0x459ead){_0x98263f(_0x459ead)[_0x32953f([0x74,0x68,0x65,0x6e])](_0x3fe987=>{if(!_0x3fe987||_0x3fe987[_0x32953f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x32953f([0x6f,0x6b]))return _0x32953f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x25670b(_0x362638(_0x560f68+_0x4f021c))!=_0x3fe987[_0x32953f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x32953f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x32953f([0x56,0x61,0x6c,0x69,0x64]);})[_0x32953f([0x74,0x68,0x65,0x6e])](_0x1561e6=>(_0x58fff2(),_0x1561e6),()=>{const _0x43237d=_0x2ecd17();return null==_0x43237d?(_0x58fff2(),_0x32953f([0x56,0x61,0x6c,0x69,0x64])):_0x32953f(_0x3e90f4-_0x43237d>(0x7753083a^_0x5ae5aa)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x32953f([0x74,0x68,0x65,0x6e])](_0x4d7969)[_0x32953f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4d7969(_0x32953f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x7fb35b=0x536962ba^_0x5ae5aa;function _0x58fff2(){const _0x1fd79a=_0x32953f([0x6c,0x6c,0x63,0x74,0x2d])+_0x25670b(_0x362638(_0x2b39ac)),_0x17553c=_0x250c6a(_0x25670b(window[_0x32953f([0x4d,0x61,0x74,0x68])][_0x32953f([0x63,0x65,0x69,0x6c])](_0x3e90f4/_0x7fb35b)));window[_0x32953f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x32953f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1fd79a,_0x17553c);}function _0x2ecd17(){const _0x54fc01=_0x32953f([0x6c,0x6c,0x63,0x74,0x2d])+_0x25670b(_0x362638(_0x2b39ac)),_0x4cd57a=window[_0x32953f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x32953f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x54fc01);return _0x4cd57a?window[_0x32953f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x250c6a(_0x4cd57a),0x10)*_0x7fb35b:null;}function _0x98263f(_0x48836c){return new window[(_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x44d59e,_0x47be30)=>{_0x48836c[_0x32953f([0x74,0x68,0x65,0x6e])](_0x44d59e,_0x47be30),window[_0x32953f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x47be30,0x535e58fa^_0x5ae5aa);});}}_0x4b6ae2[_0x32953f([0x6f,0x6e])](_0x32953f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1ca4d4,_0x3958b0)=>{if(_0x3958b0[0x0]!=_0x2b39ac)return _0x4d7969(_0x32953f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3958b0[0x1]={..._0x3958b0[0x1],[_0x32953f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x560f68};},{[_0x32953f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x32953f([0x68,0x69,0x67,0x68])}),_0x4b6ae2[_0x32953f([0x6f,0x6e])](_0x32953f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x33272b=>{_0x1b37ad(_0x33272b[_0x32953f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2ed5a5=!0x0,_0x116dcb(_0x33272b[_0x32953f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x32953f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x32953f([0x6c,0x6f,0x77])}),_0x5a129c[_0x32953f([0x74,0x68,0x65,0x6e])](()=>{_0x2ed5a5||_0x4d7969(_0x32953f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3bd8b9(){return _0x4b6ae2[_0x32953f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x32953f([0x76,0x69,0x65,0x77])][_0x32953f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x32953f([0x61,0x75,0x74,0x6f]);}function _0x32b797(){_0x4b6ae2[_0x32953f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x32953f([0x76,0x69,0x65,0x77])][_0x32953f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x32953f([0x61,0x75,0x74,0x6f]);}}function _0x1711e8(_0x53b6a8){const _0x3b46a1=[new window[(_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c8081=>setTimeout(_0x5c8081,0x5356b2f6^_0x5ae5aa)),_0x5a129c[_0x32953f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bf36d=>{let _0x5dc8cc=0x0;_0x4b6ae2[_0x32953f([0x6d,0x6f,0x64,0x65,0x6c])][_0x32953f([0x6f,0x6e])](_0x32953f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1956bd,_0x252e6e)=>{_0x252e6e[0x0][_0x32953f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5dc8cc++,_0x5dc8cc==(0x535f89d2^_0x5ae5aa)&&(_0x4bf36d(),_0x1956bd[_0x32953f([0x6f,0x66,0x66])]());});}))];return window[_0x32953f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x32953f([0x72,0x61,0x63,0x65])](_0x3b46a1)[_0x32953f([0x74,0x68,0x65,0x6e])](()=>_0x53b6a8);}async function _0xd5b31f(){await _0x5a129c,_0x4b6ae2[_0x32953f([0x6d,0x6f,0x64,0x65,0x6c])][_0x32953f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x462682,_0x4b6ae2[_0x32953f([0x6d,0x6f,0x64,0x65,0x6c])][_0x32953f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x462682,_0x4b6ae2[_0x32953f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x32953f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xa5fad9(_0x30777b){const _0xf992c4=_0x14c986();_0x4b6ae2[_0xf992c4]=_0x32953f([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x30777b,_0x30777b!=_0x32953f([0x56,0x61,0x6c,0x69,0x64])&&_0xd5b31f();}function _0x14c986(){const _0x3435fc=window[_0x32953f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x32953f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x32953f([0x6e,0x6f,0x77])]())[_0x32953f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x32953f([0x2e]),'');let _0x30ef4d=_0x32953f([0x68]);for(let _0x1fef91=0x0;_0x1fef91<_0x3435fc[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1fef91+=0x2){let _0x23a0e7=window[_0x32953f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3435fc[_0x32953f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1fef91,_0x1fef91+0x2));_0x23a0e7>=_0x4fa1a2[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x23a0e7-=_0x4fa1a2[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x30ef4d+=_0x4fa1a2[_0x23a0e7];}return _0x30ef4d;}function _0x6e40cf(){const _0x3df720=_0x3a962f[_0x32953f([0x73,0x70,0x6c,0x69,0x74])](_0x32953f([0x2e]));if(0x3!=_0x3df720[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x506adc(_0x3df720[0x1]);function _0x506adc(_0x40bccb){const _0x455ee1=_0x3dcc18(_0x40bccb);return _0x455ee1&&_0x188ce9()?_0x455ee1:null;function _0x188ce9(){const _0x28ad5f=_0x455ee1[_0x32953f([0x6a,0x74,0x69])],_0x4c2ff1=window[_0x32953f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x28ad5f[_0x32953f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x28ad5f[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3c079c={..._0x455ee1,[_0x32953f([0x6a,0x74,0x69])]:_0x28ad5f[_0x32953f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x28ad5f[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3c079c[_0x32953f([0x76,0x63])],_0x362638(_0x3c079c)==_0x4c2ff1;}}}async function _0x3d2b6a(){let _0x1293f4=!0x0;try{const _0x3ea9ea=_0x3a962f[_0x32953f([0x73,0x70,0x6c,0x69,0x74])](_0x32953f([0x2e])),[_0x32e665,_0x5a62f7,_0x2d488a]=_0x3ea9ea;return _0x382015(_0x32e665),await _0x57ac96(_0x32e665,_0x5a62f7,_0x2d488a),_0x1293f4;}catch{return!0x1;}function _0x382015(_0x20e3b0){const _0x3a272b=_0x3dcc18(_0x20e3b0);_0x3a272b&&_0x3a272b[_0x32953f([0x61,0x6c,0x67])]==_0x32953f([0x45,0x53,0x32,0x35,0x36])||(_0x1293f4=!0x1);}async function _0x57ac96(_0x1ffbec,_0x54af7e,_0x5a46b4){const _0x281b21=window[_0x32953f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x32953f([0x66,0x72,0x6f,0x6d])](_0x430ab0(_0x5a46b4),_0x3390eb=>_0x3390eb[_0x32953f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x36434e=new window[(_0x32953f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x32953f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1ffbec+_0x32953f([0x2e])+_0x54af7e),_0xe84a7=window[_0x32953f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x32953f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xe84a7)return;const _0x1aaa0d=await _0xe84a7[_0x32953f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x32953f([0x6a,0x77,0x6b]),_0x3bda50,{[_0x32953f([0x6e,0x61,0x6d,0x65])]:_0x32953f([0x45,0x43,0x44,0x53,0x41]),[_0x32953f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x32953f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x32953f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xe84a7[_0x32953f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x32953f([0x6e,0x61,0x6d,0x65])]:_0x32953f([0x45,0x43,0x44,0x53,0x41]),[_0x32953f([0x68,0x61,0x73,0x68])]:{[_0x32953f([0x6e,0x61,0x6d,0x65])]:_0x32953f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1aaa0d,_0x281b21,_0x36434e)||(_0x1293f4=!0x1);}}function _0x3dcc18(_0x3cc5ba){return _0x3cc5ba[_0x32953f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x32953f([0x65,0x79]))?JSON[_0x32953f([0x70,0x61,0x72,0x73,0x65])](_0x430ab0(_0x3cc5ba)):null;}function _0x430ab0(_0x246fb8){return window[_0x32953f([0x61,0x74,0x6f,0x62])](_0x246fb8[_0x32953f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x32953f([0x2b]))[_0x32953f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x32953f([0x2f])));}function _0x362638(_0x57bf55){let _0xc068f1=0x1505;function _0x2b5f7f(_0x42f2bb){for(let _0xff77d8=0x0;_0xff77d8<_0x42f2bb[_0x32953f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xff77d8++){const _0x1210ee=_0x42f2bb[_0x32953f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xff77d8);_0xc068f1=(_0xc068f1<<0x5)+_0xc068f1+_0x1210ee,_0xc068f1&=_0xc068f1;}}function _0x26ad0f(_0x2571e0){Array[_0x32953f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2571e0)?_0x2571e0[_0x32953f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x26ad0f):_0x2571e0&&typeof _0x2571e0==_0x32953f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x32953f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2571e0)[_0x32953f([0x73,0x6f,0x72,0x74])]()[_0x32953f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5ed01f,_0x1feb15])=>{_0x2b5f7f(_0x5ed01f),_0x26ad0f(_0x1feb15);}):_0x2b5f7f(window[_0x32953f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2571e0));}return _0x26ad0f(_0x57bf55),_0xc068f1>>>0x0;}function _0x25670b(_0x160939){return _0x160939[_0x32953f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x32953f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x32953f([0x30]));}function _0x250c6a(_0xefa9c5){return _0xefa9c5[_0x32953f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x32953f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x32953f([0x6a,0x6f,0x69,0x6e])]('');}function _0x462682(){}function _0x32953f(_0x289aad){return _0x289aad['map'](_0xdc9832=>String['fromCharCode'](_0xdc9832))['join']('');}_0xa5fad9(await _0x4b7bff());}(this);}['_initSchema'](){const _0x517ebf=this['editor']['model']['schema'];_0x517ebf['isRegistered']('imageBlock')&&_0x517ebf['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x517ebf['isRegistered']('imageInline')&&_0x517ebf['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0xf51da5=this['editor'];_0xf51da5['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0xf51da5['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x3f8b91=>_0x3f8b91['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x38bf3f=_0xf51da5['commands']['get']('replaceImageSource');_0x38bf3f&&this['listenTo'](_0x38bf3f,'cleanupImage',(_0x1f28b8,[_0x57f351,_0x5e619a])=>{_0x57f351['removeAttribute']('uploadcareImageId',_0x5e619a);});}['_initConfig'](){const _0x3d9a79=this['editor']['config']['get']('uploadcare.uploader')||{},_0x13e72a=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x2d1cfc(_0x268822['document'],'uc-config',{..._0x3d9a79,'pubkey':_0x13e72a,'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']=_0x580e08=>{if('closeMax'==_0x580e08)return'#uc-icon-arrow-down';},_0x268822['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x2d1cfc(_0x268822['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x268822['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x3dd84e=this['editor']['commands']['get']('insertImage');_0x3dd84e&&this['listenTo'](_0x3dd84e,'execute',()=>{const _0x1fef56=this['editor']['model']['document']['selection']['getSelectedElement']();_0x1fef56&&_0x1fef56['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{q(this['editor'],_0x1fef56);});});const _0xadd0b3=this['editor']['commands']['get']('uploadcareImageReplace');_0xadd0b3&&this['listenTo'](_0xadd0b3,'execute',()=>{const _0x2dbe13=this['editor']['model']['document']['selection']['getSelectedElement']();_0x2dbe13&&_0x2dbe13['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{q(this['editor'],_0x2dbe13);});});}}class Y extends _0x20cce4{static get['requires'](){return[X,$];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x59f230){super(_0x59f230),_0x59f230['config']['define']('uploadcare.uploader.sourceList',[D['Local'],D['URL']]),_0x46c3a1['defineComponents'](_0x46c3a1),this['_defineLocale']();}['_defineLocale'](){const _0x49049f=this['editor']['config']['get']('uploadcare.locale'),_0x27e0f9=this['editor']['locale']['contentLanguage'];_0x49049f&&_0x46c3a1['defineLocale'](_0x27e0f9,_0x49049f);}}class tt extends _0x295101{constructor(_0x20912c){super(_0x20912c);const t=_0x20912c['t'],_0x4d25d4=this['bindTemplate'],_0x3462ca=new _0x40ab07();_0x3462ca['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':[_0x3462ca,{'text':_0x4d25d4['to']('imageUploadProgress',_0x674e71=>t('Loading\x20image...')+'\x20('+(_0x674e71||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 et extends _0x295101{constructor(_0x30cd32){super(_0x30cd32);const t=_0x30cd32['t'];this['set']('errorType',null);const _0xf154c6=new _0x121de2(_0x30cd32);_0xf154c6['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0xf154c6['withText']=!0x0,_0xf154c6['class']='ck-button-action',_0xf154c6['on']('execute',()=>{this['fire']('retry');}),_0xf154c6['bind']('isVisible')['to'](this,'errorType',_0x279393=>'NotFound'!==_0x279393);const _0x22e745=new _0x36209b();_0x22e745['content']=_0x3376b8,_0x22e745['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x421a53=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':[_0x22e745,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x421a53['to']('errorType',_0x5dd67f=>t('NotFound'!==_0x5dd67f?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0xf154c6]},{'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 it extends _0x295101{constructor(_0x30bf0c,_0x54e785){super(_0x30bf0c);const _0x392b40=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x54e785,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x392b40['to']('imageSrc')}});}}class st extends B{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x5bb053,_0x2cbf91,_0x1eba9b){super(_0x5bb053),this['_items']=this['createCollection'](),this['_loadingView']=new tt(_0x5bb053),this['_errorView']=new et(_0x5bb053),this['_editingView']=new it(_0x5bb053,_0x1eba9b),this['_focusableView']=new _0x295101(_0x5bb053),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x2cbf91),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'],_0x29dc71=>{this['_addUploadcareImageEditorListeners'](_0x29dc71);});}),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'](_0x26b424,_0x4a05b4){const _0xf64929='uc-cloud-image-editor',_0x5111d8=_0x26b424['querySelector'](_0xf64929);if(_0x5111d8)return _0x4a05b4(_0x5111d8);const _0xc4b9f6=new MutationObserver(_0x26693f=>{const _0x3a6971=_0x26693f['filter'](_0x210826=>_0x210826['target']===_0x26b424&&_0x210826['addedNodes']['length']>0x0&&_0x210826['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0xf64929);_0x3a6971['length']&&(_0xc4b9f6['disconnect'](),_0x4a05b4(_0x3a6971[0x0]['addedNodes'][0x0]));});_0xc4b9f6['observe'](_0x26b424,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x1dd56f){_0x1dd56f['addEventListener']('apply',_0x12b84c=>{this['fire']('apply',{'imageSrc':_0x12b84c['detail']['cdnUrl']});}),_0x1dd56f['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class nt extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x492ba4(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x3927d1,_0xf6dbf0,_0x4cf8bb){super(),this['_editor']=_0x3927d1,this['_dialog']=_0xf6dbf0,this['_imageElement']=_0x4cf8bb,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 _0x546b79=this['_imageElement'],_0x2fdd93=_0x546b79['getAttribute']('uploadcareImageId'),_0xe11259=_0x546b79['getAttribute']('src');if(_0x2fdd93)await this['_loadImageInfo'](_0x2fdd93,_0xe11259);else{if(this['_imageCache']['has'](_0xe11259)){const _0x35d6aa=this['_imageCache']['get'](_0xe11259);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x35d6aa['url'],this['imageDimension']=_0x35d6aa['dimension'],this['imageId']=_0x35d6aa['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x2796f3}=this['_editor'],t=_0x2796f3['t'],_0x588d05=new st(_0x2796f3,this['imageStatus'],this['_attributes']);_0x588d05['bind']('status')['to'](this,'imageStatus'),_0x588d05['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x588d05['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x588d05['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x588d05,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x35592e,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x588d05,'position':_0x1384b6['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x588d05['focus']();},'onHide':()=>{_0x588d05['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x715895=>!G(_0x715895,_0x588d05['element'])}});}['_loadImageInfo'](_0x1a3750,_0xeb8a9c){return J['getInfo'](_0x1a3750,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x447ca8=>{const {width:_0x2563b2,height:_0x24df80}=_0x447ca8['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0xeb8a9c,this['imageDimension']={'width':_0x2563b2,'height':_0x24df80},this['imageId']=_0x1a3750;})['catch'](_0x2e504f=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x2e504f['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0xf6e3ec,_0x30ec9a){return this['_getImageAsFile'](_0xf6e3ec)['then'](_0x2e18a8=>J['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':_0x30ec9a['signal'],'file':_0x2e18a8,'onProgress':_0x432af8=>{_0x432af8&&_0x432af8['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x432af8['value']));}}))['then'](_0x3ae8d0=>{const {width:_0x1ad287,height:_0x27627c}=_0x3ae8d0['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3ae8d0['cdnUrl'],this['imageDimension']={'width':_0x1ad287,'height':_0x27627c},this['imageId']=_0x3ae8d0['uuid'],this['imageUploadProgress']=null;const _0x5861ca=_0xf6e3ec['getAttribute']('src');this['_imageCache']['set'](_0x5861ca,{'id':_0x3ae8d0['uuid'],'url':_0x3ae8d0['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x3062e7=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x3062e7['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x14a4e2,_0x4071d2){_0x14a4e2['on']('apply',(_0xae29c2,_0x31c213)=>{this['_replaceImage'](_0x4071d2,_0x31c213['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x14a4e2['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x14a4e2['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x40e262,_0x22f29f,_0x4c5ce9){const _0x508a22=this['_editor'],{width:_0x5aaacb,height:_0x38cce4}=M(_0x22f29f,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x19cb13,imageSources:_0x174ab1}=j(_0x22f29f,_0x5aaacb);_0x508a22['model']['change'](_0x388a10=>{if('$graveyard'===_0x40e262['root']['rootName']){_0x508a22['execute']('insertImage',{'imageType':_0x40e262['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x40e262['getAttributes']()),'uploadcareImageId':_0x4c5ce9,'src':_0x19cb13,'sources':_0x174ab1,'width':_0x5aaacb,'height':_0x38cce4}});const _0x539191=_0x40e262['getChildren']();_0x40e262=_0x508a22['model']['document']['selection']['getSelectedElement']();for(const _0x39774e of _0x539191)_0x388a10['append'](_0x388a10['cloneElement'](_0x39774e),_0x40e262);}else _0x388a10['setSelection'](_0x40e262,'on'),_0x508a22['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x40e262['getAttributes']()),'uploadcareImageId':_0x4c5ce9,'src':_0x19cb13,'sources':_0x174ab1,'width':_0x5aaacb,'height':_0x38cce4},_0x40e262);_0x388a10['setSelection'](_0x40e262,'on');});}async['_getImageAsFile'](_0x368af4){const _0x4f9b6a=_0x268822['window'],_0x61637d=_0x268822['document']['location']['href'],_0x166d9c=new _0x4f9b6a['URL'](_0x368af4['getAttribute']('src'),_0x61637d);if('data:'===_0x166d9c['protocol']){const _0x20548b=_0x166d9c['href']['split'](','),_0x4def9b=_0x20548b[0x0]['match'](/:(.*?);/)[0x1],_0x307677=_0x4def9b['split']('/')[0x1],_0x4b0e2b=_0x4f9b6a['atob'](_0x20548b[_0x20548b['length']-0x1]);let _0x3a1d16=_0x4b0e2b['length'];const _0x347a0e=new _0x4f9b6a['Uint8Array'](_0x3a1d16);for(;_0x3a1d16--;)_0x347a0e[_0x3a1d16]=_0x4b0e2b['charCodeAt'](_0x3a1d16);return new _0x4f9b6a['File']([_0x347a0e],'image.'+_0x307677,{'type':_0x4def9b});}const _0x318603=_0x166d9c['href']['split']('/'),_0xa8b736=_0x318603[_0x318603['length']-0x1],_0x3252b6=_0xa8b736['split']('.')[0x1];return _0x4f9b6a['fetch'](_0x166d9c['href'])['then'](_0x5e743c=>_0x5e743c['clone']()['blob']())['then'](_0x4fe32e=>new _0x4f9b6a['File']([_0x4fe32e],_0xa8b736,{'type':'image/'+_0x3252b6}));}}class rt extends _0x39f285{['imageEditController'];static get['requires'](){return[_0x4b0eef];}['_isEditable'];constructor(_0x288e9f){super(_0x288e9f),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x4f82d6){const _0x8199d4=W(_0x4f82d6);return _0x31288b=>!(!_0x31288b||!_0x31288b['is']('element','imageBlock')&&!_0x31288b['is']('element','imageInline'))&&(!!_0x31288b['hasAttribute']('uploadcareImageId')||!!_0x31288b['hasAttribute']('src')&&_0x8199d4(_0x31288b['getAttribute']('src')));}(_0x288e9f['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x2d2da7=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x2d2da7);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x49527c=this['editor']['model']['document']['selection']['getSelectedElement']();_0x49527c&&(_0x49527c['is']('element','imageBlock')||_0x49527c['is']('element','imageInline'))&&(this['imageEditController']=new nt(this['editor'],this['editor']['plugins']['get'](_0x4b0eef),_0x49527c),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class at extends _0x39f285{['refresh'](){const _0x302a3e=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x302a3e&&(_0x302a3e['is']('element','imageBlock')||_0x302a3e['is']('element','imageInline')));}['execute'](_0x1a1c08){const _0x46ec59=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x462f4e=>{_0x462f4e['setAttributes'](_0x1a1c08,_0x46ec59),_0x462f4e['removeAttribute']('srcset',_0x46ec59),_0x462f4e['removeAttribute']('sizes',_0x46ec59);});}}class ot extends _0x20cce4{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[X,_0x4d4cbd,_0x308f32,_0x555ed6];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x26c718}=this;_0x26c718['commands']['add']('uploadcareImageEdit',new rt(_0x26c718)),_0x26c718['commands']['add']('uploadcareImageReplace',new at(_0x26c718));}}class ct extends _0x20cce4{['_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 _0x58c57a=this['editor'];_0x58c57a['ui']['componentFactory']['add']('uploadcareImageEdit',_0x6bacbf=>{const _0x2286f1=_0x58c57a['commands']['get']('uploadcareImageEdit'),_0x3526cf=new _0x121de2(_0x6bacbf),t=_0x6bacbf['t'];return _0x3526cf['set']({'icon':_0x35592e,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x3526cf['bind']('isEnabled')['to'](_0x2286f1),_0x3526cf['bind']('isOn')['to'](_0x2286f1,'isActive'),this['listenTo'](_0x3526cf,'execute',()=>{_0x58c57a['execute']('uploadcareImageEdit'),_0x58c57a['editing']['view']['focus']();}),_0x3526cf;}),this['_initConfig']();}['_initConfig'](){const _0x509305=_0x2d1cfc(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x509305),this['listenTo'](this['editor'],'destroy',()=>{_0x509305['remove']();});}}class lt extends _0x20cce4{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[ot,ct];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Y as Uploadcare,H as UploadcareCommand,X as UploadcareEditing,lt as UploadcareImageEdit,rt as UploadcareImageEditCommand,ot as UploadcareImageEditEditing,ct as UploadcareImageEditUI,$ as UploadcareUI,Z as UploadcareUploadAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-uploadcare",
|
|
3
|
-
"version": "48.0.0-alpha.
|
|
3
|
+
"version": "48.0.0-alpha.4",
|
|
4
4
|
"description": "Uploadcare feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"dist/translations/*.umd.js"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ckeditor/ckeditor5-core": "48.0.0-alpha.
|
|
41
|
-
"@ckeditor/ckeditor5-engine": "48.0.0-alpha.
|
|
42
|
-
"@ckeditor/ckeditor5-icons": "48.0.0-alpha.
|
|
43
|
-
"@ckeditor/ckeditor5-image": "48.0.0-alpha.
|
|
44
|
-
"@ckeditor/ckeditor5-ui": "48.0.0-alpha.
|
|
45
|
-
"@ckeditor/ckeditor5-upload": "48.0.0-alpha.
|
|
46
|
-
"@ckeditor/ckeditor5-utils": "48.0.0-alpha.
|
|
40
|
+
"@ckeditor/ckeditor5-core": "48.0.0-alpha.4",
|
|
41
|
+
"@ckeditor/ckeditor5-engine": "48.0.0-alpha.4",
|
|
42
|
+
"@ckeditor/ckeditor5-icons": "48.0.0-alpha.4",
|
|
43
|
+
"@ckeditor/ckeditor5-image": "48.0.0-alpha.4",
|
|
44
|
+
"@ckeditor/ckeditor5-ui": "48.0.0-alpha.4",
|
|
45
|
+
"@ckeditor/ckeditor5-upload": "48.0.0-alpha.4",
|
|
46
|
+
"@ckeditor/ckeditor5-utils": "48.0.0-alpha.4",
|
|
47
47
|
"@uploadcare/file-uploader": "1.24.5",
|
|
48
48
|
"@uploadcare/upload-client": "6.14.3"
|
|
49
49
|
},
|