@ckeditor/ckeditor5-uploadcare 48.1.0-alpha.3 → 48.1.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 _0x34f2ef,Command as _0x5b3dac}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x530f27,IconGooglePhotos as _0xa64d57,IconGoogleDrive as _0xd0de24,IconFacebook as _0x4aeb3e,IconDropbox as _0xb4d70,IconUploadcareLink as _0x371c35,IconUploadcareImageUpload as _0x2fec17,IconError as _0x293ec5,IconUploadcareImageEdit as _0x11a213}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x5a0aae,MenuBarMenuListItemButtonView as _0x1b39ea,View as _0x21e0b4,FocusCycler as _0x30ae78,Dialog as _0x55811d,DialogViewPosition as _0x13b148,SpinnerView as _0x5d6317,IconView as _0x410319,Notification as _0x200558}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x591645,DomEmitterMixin as _0x55fa9c,global as _0x52c449,getAncestors as _0x2173cf,ObservableMixin as _0x5daa99,uid as _0x387713,createElement as _0x18d46e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ImageUploadEditing as _0x4aec99,ImageUploadProgress as _0x1a079d,PictureEditing as _0x31f4af,ImageUtils as _0x2a0bd4,ImageEditing as _0x1d283e}from'@ckeditor/ckeditor5-image/dist/index.js';import{FileRepository as _0x54b1e9}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x5b6640,info as _0x26fb8a}from'@uploadcare/upload-client';import*as _0x18bd02 from'@uploadcare/file-uploader/web/file-uploader.min.js';function D(_0x2fd5f1,_0x4d1379,_0x22262e){const t=_0x2fd5f1['t'],_0x110dd2=_0x2fd5f1['t'];switch(_0x4d1379){case'local':return{'text':_0x110dd2('Insert'===_0x22262e?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x110dd2('From\x20computer')};case'url':return{'text':'Insert'===_0x22262e?_0x110dd2('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x110dd2('Via\x20URL')};case'dropbox':return{'text':t('Insert'===_0x22262e?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case'facebook':return{'text':t('Insert'===_0x22262e?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case'gdrive':return{'text':t('Insert'===_0x22262e?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case'gphotos':return{'text':t('Insert'===_0x22262e?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case'onedrive':return{'text':t('Insert'===_0x22262e?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x4d1379;}}class F extends _0x34f2ef{['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 _0x13b35f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1d0eb7;for(const _0x14c481 in _0x13b35f){const _0x5b3de8=_0x14c481,_0x38d1f0=_0x13b35f[_0x5b3de8];if('uploadcareLicenseKeyValid'==_0x38d1f0||'uploadcareLicenseKeyInvalid'==_0x38d1f0||'uploadcareLicenseKeyExpired'==_0x38d1f0||'uploadcareLicenseKeyDomainLimit'==_0x38d1f0||'uploadcareLicenseKeyNotAllowed'==_0x38d1f0||'uploadcareLicenseKeyEvaluationLimit'==_0x38d1f0||'uploadcareLicenseKeyUsageLimit'==_0x38d1f0){delete _0x13b35f[_0x5b3de8],_0x1d0eb7=_0x38d1f0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x1d0eb7&&_0x13b35f['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x1d0eb7&&_0x13b35f['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x1d0eb7&&_0x13b35f['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x1d0eb7&&_0x13b35f['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x1d0eb7&&_0x13b35f['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x1d0eb7&&_0x13b35f['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x3492eb}=this,_0x456a84=_0x3492eb['commands']['get']('uploadcare');if(!_0x456a84)return;const _0x19e110=this['_normalizeConfigSourceList'](_0x3492eb['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x300fbb,_0x41edd8)=>{const _0x98d688=this['_getIntegrationKey'](_0x41edd8['type']);return _0x300fbb[_0x98d688]||(_0x300fbb[_0x98d688]=[]),_0x300fbb[_0x98d688]['push'](_0x41edd8),_0x300fbb;},{});_0x3492eb['plugins']['has']('ImageInsertUI')&&_0x3492eb['commands']['get']('uploadcare')&&Object['entries'](_0x19e110)['forEach'](([_0xa9ec06,_0x4043d8])=>{_0x3492eb['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0xa9ec06,'observable':()=>_0x456a84,'buttonViewCreator':()=>this['_createToolbarButton'](_0x4043d8),'formViewCreator':()=>this['_createDropdownButtons'](_0x4043d8),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x4043d8),'override':'assetManager'!==_0xa9ec06});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x4cb9f6){const {locale:_0x44dcbd}=this['editor'];return _0x4cb9f6['map'](_0x5ae18c=>{const _0x109c86=D(_0x44dcbd,_0x5ae18c,'Insert');switch(_0x5ae18c){case'local':return{'icon':_0x2fec17,'type':'local',..._0x109c86};case'url':return{'icon':_0x371c35,'type':'url',..._0x109c86};case'dropbox':return{'icon':_0xb4d70,'type':'dropbox',..._0x109c86};case'facebook':return{'icon':_0x4aeb3e,'type':'facebook',..._0x109c86};case'gdrive':return{'icon':_0xd0de24,'type':'gdrive',..._0x109c86};case'gphotos':return{'icon':_0xa64d57,'type':'gphotos',..._0x109c86};case'onedrive':return{'icon':_0x530f27,'type':'onedrive',..._0x109c86};}});}['_getIntegrationKey'](_0x53a7fc){switch(_0x53a7fc){case'local':return'upload';case'url':return'url';default:return'assetManager';}}['_createButton'](_0x5e379f,_0x402f80){const _0x23fa0d=this['editor'],_0x1dbf65=new _0x5e379f(_0x23fa0d['locale']),_0x403211=_0x23fa0d['commands']['get']('uploadcare');return _0x1dbf65['bind']('isEnabled')['to'](_0x403211),_0x1dbf65['on']('execute',()=>{_0x403211['execute'](_0x402f80);}),_0x1dbf65;}['_createToolbarButton'](_0x57cdab){const {locale:_0x1b9dec}=this['editor'],_0x1adc11=this['editor']['plugins']['get']('ImageInsertUI'),_0xc1d076=_0x57cdab[0x0],_0x324a9f=this['_createButton'](_0x5a0aae,_0xc1d076['type']);return _0x324a9f['icon']=_0xc1d076['icon'],_0x324a9f['bind']('label')['to'](_0x1adc11,'isImageSelected',_0x58bff4=>D(_0x1b9dec,_0xc1d076['type'],_0x58bff4?'Replace':'Insert')['text']),_0x324a9f['tooltip']=!0x0,_0x324a9f;}['_createDropdownButtons'](_0x432503){const {locale:_0x5ba5ed}=this['editor'],_0x19b764=this['editor']['plugins']['get']('ImageInsertUI');return _0x432503['map'](_0xb0b506=>{const _0x4a2241=this['_createButton'](_0x5a0aae,_0xb0b506['type']);return _0x4a2241['withText']=!0x0,_0x4a2241['icon']=_0xb0b506['icon'],_0x4a2241['bind']('label')['to'](_0x19b764,'isImageSelected',_0xe5f4b5=>D(_0x5ba5ed,_0xb0b506['type'],_0xe5f4b5?'Replace':'Insert')['text']),_0x4a2241;});}['_createMenuBarButtons'](_0x46809f){return _0x46809f['map'](_0x564ceb=>{const _0x2eb975=this['_createButton'](_0x1b39ea,_0x564ceb['type']);return _0x2eb975['icon']=_0x564ceb['icon'],_0x2eb975['label']=_0x564ceb['shortText'],_0x2eb975;});}}class $ extends _0x21e0b4{['focusTracker'];['focusCycler'];constructor(_0x78034e){super(_0x78034e),this['focusTracker']=new _0x591645(),this['focusCycler']=new _0x30ae78({'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 B extends ${constructor(_0x2b7833,_0x37100f){super(_0x2b7833),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-'+_0x37100f}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function V(_0x22c777,_0x5346a9){const _0x22d2e1=_0x22c777['replace'](/\/$/,'');return{'imageFallbackUrl':_0x22c777,'imageSources':[{'srcset':[...[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x4f4c07=>_0x4f4c07<_0x5346a9)['map'](_0x442043=>_0x22d2e1+'/-/resize/'+_0x442043+'x/\x20'+_0x442043+'w'),_0x22c777+'\x20'+_0x5346a9+'w']['join'](',\x20'),'sizes':'(max-width:\x20'+_0x5346a9+'px)\x20100vw,\x20'+_0x5346a9+'px','type':'image/webp'}]};}function j(_0x5e4052,_0x192eb9,_0x1bc18c){const _0xf170fe=_0x5e4052['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0xf170fe?parseInt(_0xf170fe[0x1],0xa):_0x192eb9,'height':_0xf170fe?parseInt(_0xf170fe[0x2],0xa):_0x1bc18c};}function M(_0x3b2933,_0xeb1c12){const _0x2b177e=new(_0x55fa9c())(),_0x2c552f=_0x3b2933['plugins']['get']('ImageUtils'),_0x5ed5ae=_0x3b2933['editing']['mapper']['toViewElement'](_0xeb1c12),_0x3902e1=_0x2c552f['findViewImgElement'](_0x5ed5ae),_0x24af0a=_0x3b2933['editing']['view']['domConverter']['viewToDom'](_0x3902e1),_0x499a65=_0xeb1c12['getAttribute']('width'),_0x5eca23=_0xeb1c12['getAttribute']('height'),_0x59187a='image-processing';_0x3b2933['editing']['view']['change'](_0x53bf47=>{_0x53bf47['addClass'](_0x59187a,_0x5ed5ae),_0x53bf47['setStyle']('aspect-ratio',_0x499a65+'/'+_0x5eca23,_0x3902e1);}),_0x2b177e['listenTo'](_0x24af0a,'load',()=>{_0x2b177e['stopListening'](_0x24af0a,'load'),_0x3b2933['editing']['view']['change'](_0xbca20=>{_0xbca20['removeClass'](_0x59187a,_0x5ed5ae),_0xbca20['removeStyle']('aspect-ratio',_0x3902e1);});});}function q(_0x51e4b4){if(Array['isArray'](_0x51e4b4)){const _0x5ec0b1=_0x51e4b4['map'](q);return _0x26258d=>_0x5ec0b1['some'](_0x58b3fb=>_0x58b3fb(_0x26258d));}if('origin'==_0x51e4b4){const _0x40af73=_0x52c449['window']['location']['origin'];return _0x40adef=>new URL(_0x40adef,_0x52c449['document']['baseURI'])['origin']==_0x40af73;}return'function'==typeof _0x51e4b4?_0x51e4b4:_0x51e4b4 instanceof RegExp?_0x51e74f=>!(!_0x51e74f['match'](_0x51e4b4)&&!_0x51e74f['replace'](/^https?:\/\//,'')['match'](_0x51e4b4)):()=>!0x1;}function W(_0x5427c5,_0x310129){return _0x2173cf(_0x5427c5['target'])['includes'](_0x310129);}class G extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x5daa99(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x19f2c3,_0xc3090b,_0x327764){super(),this['_editor']=_0x19f2c3,this['_editing']=_0xc3090b,this['_dialog']=_0x19f2c3['plugins']['get'](_0x55811d),this['_api']=_0xc3090b['ctxElement']['getAPI'](),this['_type']=_0x327764,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:_0x3b7149,model:_0x35c424}=this['_editor'],_0x2aea63=_0x35c424['document']['selection']['getSelectedElement'](),_0x26f119=_0x2aea63&&(_0x2aea63['is']('element','imageBlock')||_0x2aea63['is']('element','imageInline'));this['_formView']=new B(_0x3b7149,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x2fec17,'title':D(_0x3b7149,this['_type'],_0x26f119?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x13b148['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x3674d2=>!W(_0x3674d2,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x3d87c2}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x3dd1ef=>{const _0x2826ca=_0x3d87c2['length'];for(const _0x14253a of _0x3d87c2){const _0x1b3dbb=_0x14253a===_0x3d87c2[_0x2826ca-0x1],{cdnUrl:_0x52e438,fileInfo:_0x1e0d5e}=_0x14253a;if(!_0x52e438||!_0x1e0d5e)continue;const {width:_0x181c4b,height:_0x4c9a86}=_0x1e0d5e['imageInfo'],_0x3adbd4=j(_0x52e438,_0x181c4b,_0x4c9a86),_0x5d5a19=V(_0x52e438,_0x3adbd4['width']),_0x12fb27={'id':_0x1e0d5e['uuid'],'type':'image','attributes':{'imageDimension':_0x3adbd4,..._0x5d5a19}};this['_insertAsset'](_0x12fb27,_0x1b3dbb,_0x3dd1ef);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x2fc3a6=>{'idle'===_0x2fc3a6['detail']['status']&&!_0x2fc3a6['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&('local'===this['_type']?this['_api']['setCurrentActivity']('start-from'):this['_api']['initFlow']());});}['_insertAsset'](_0x330063,_0x498b74,_0x337c54){const _0x142191=this['_editor']['model']['document']['selection'],_0x3a6e45=_0x142191['getSelectedElement'](),_0x374e07=!(!_0x3a6e45||!_0x3a6e45['is']('element','imageInline'));_0x337c54['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x330063,_0x374e07),_0x498b74||_0x337c54['setSelection'](_0x142191['getLastPosition']());}['_insertImage'](_0x4dcf8c,_0x3c15bb){const _0xc5c938=this['_editor'],{imageDimension:_0x341308,imageFallbackUrl:_0x51ef00,imageSources:_0x56a306}=_0x4dcf8c['attributes'];_0xc5c938['execute']('insertImage',{'imageType':_0x3c15bb?'imageInline':null,'source':{'uploadcareImageId':_0x4dcf8c['id'],'src':_0x51ef00,'sources':_0x56a306,..._0x341308}});}}class z extends _0x5b3dac{['_editing'];['_controller']=null;static get['requires'](){return[_0x55811d,Q];}constructor(_0x16e65e){super(_0x16e65e),this['_editing']=_0x16e65e['plugins']['get'](Q);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x1a99ad){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new G(this['editor'],this['_editing'],_0x1a99ad);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class H{static['upload']({file:_0x48a130,..._0x2c48e4}){return _0x5b6640(_0x48a130,_0x2c48e4);}static['getInfo'](_0x13b5b4,_0x34bac8){return _0x26fb8a(_0x13b5b4,_0x34bac8);}}class J extends _0x34f2ef{static get['requires'](){return[_0x4aec99,_0x1a079d,_0x54b1e9,Q];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x566e2a=this['editor'];if(!!!_0x566e2a['config']['get']('uploadcare'))return;_0x566e2a['plugins']['get'](_0x54b1e9)['createUploadAdapter']=_0x2f6986=>new Z(_0x2f6986,_0x566e2a),_0x566e2a['plugins']['get'](_0x4aec99)['on']('uploadComplete',(_0x4c6091,{imageElement:_0xf0ff7e,data:_0x1ad605})=>{_0x566e2a['model']['change'](_0x22ffb3=>{_0x22ffb3['setAttribute']('uploadcareImageId',_0x1ad605['uploadcareImageId'],_0xf0ff7e);});});}}class Z{['loader'];['editor'];['controller'];constructor(_0x369201,_0x7f4dc){this['loader']=_0x369201,this['editor']=_0x7f4dc,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x15910a=await this['loader']['file'];return H['upload']({'file':_0x15910a,'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':_0x17d003=>{_0x17d003&&_0x17d003['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x17d003['value']);}})['then'](async _0x4e218c=>{const {imageFallbackUrl:_0x52b153,imageSources:_0x2f456f}=V(_0x4e218c['cdnUrl'],_0x4e218c['imageInfo']['width']);return{'uploadcareImageId':_0x4e218c['uuid'],'default':_0x52b153,'sources':_0x2f456f};})['catch'](()=>{const _0x4dc0c5=t('Cannot\x20upload\x20file:')+('\x20'+_0x15910a['name']+'.');return Promise['reject'](_0x4dc0c5);});}['abort'](){this['controller']['abort']();}}class Q extends _0x34f2ef{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return[_0x31f4af,J,_0x55811d];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x545940){super(_0x545940),this['ucContextId']=_0x387713();}['init'](){const _0x9e8b65=this['editor'];_0x9e8b65['commands']['add']('uploadcare',new z(_0x9e8b65));}['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 _0x871f35=_0x52c449['document']['querySelector']('input[uploadcare-file-input]');_0x871f35&&_0x871f35['remove']();}),async function(_0x25b351){const _0x4702cd=_0x55576b([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]),_0x1836b9=0x535f8c3a,_0x1824b7=0x535805aa^_0x1836b9,_0x2435b0=window[_0x55576b([0x44,0x61,0x74,0x65])][_0x55576b([0x6e,0x6f,0x77])](),_0x412407=_0x25b351[_0x55576b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x8d1f8c=new window[(_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5dd24c=>{_0x412407[_0x55576b([0x6f,0x6e,0x63,0x65])](_0x55576b([0x72,0x65,0x61,0x64,0x79]),_0x5dd24c);}),_0x4b66b1={[_0x55576b([0x6b,0x74,0x79])]:_0x55576b([0x45,0x43]),[_0x55576b([0x75,0x73,0x65])]:_0x55576b([0x73,0x69,0x67]),[_0x55576b([0x63,0x72,0x76])]:_0x55576b([0x50,0x2d,0x32,0x35,0x36]),[_0x55576b([0x78])]:_0x55576b([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]),[_0x55576b([0x79])]:_0x55576b([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]),[_0x55576b([0x61,0x6c,0x67])]:_0x55576b([0x45,0x53,0x32,0x35,0x36])},_0x29c401=_0x412407[_0x55576b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x55576b([0x67,0x65,0x74])](_0x55576b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x15041a(){let _0x5f4918,_0xa1d9c8=null,_0x242d73=null;try{if(_0x29c401==_0x55576b([0x47,0x50,0x4c]))return _0x55576b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5f4918=_0x4f390d(),!_0x5f4918)return _0x55576b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5f4918[_0x55576b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x242d73=_0x170f6d(_0x5f4918[_0x55576b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5f4918[_0x55576b([0x6a,0x74,0x69])])),await _0x1bfd46()?_0x12317e()?_0x5ae614()?_0x55576b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x556b23()?(_0x5f4918[_0x55576b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x55576b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xa1d9c8=_0x3eba17(_0x55576b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5bcbe0()):_0x55576b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x55576b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x55576b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x55576b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5ae614(){const _0x20ae70=[_0x55576b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x55576b([0x74,0x72,0x69,0x61,0x6c])][_0x55576b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5f4918[_0x55576b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2435b0/0x3e8:0xe10*_0x1824b7;return _0x5f4918[_0x55576b([0x65,0x78,0x70])]<_0x20ae70;}function _0x12317e(){const _0x2f862d=_0x5f4918[_0x55576b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2f862d&&(!!_0x2f862d[_0x55576b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55576b([0x2a]))||!!_0x2f862d[_0x55576b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55576b([0x55,0x50,0x4c,0x43])));}function _0x556b23(){const _0x4b7082=_0x5f4918[_0x55576b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4b7082||0x0==_0x4b7082[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x369ae5}=new URL(window[_0x55576b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4b7082[_0x55576b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x369ae5))return!0x0;const _0x2f793b=_0x369ae5[_0x55576b([0x73,0x70,0x6c,0x69,0x74])](_0x55576b([0x2e]));return _0x4b7082[_0x55576b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x511bfc=>_0x511bfc[_0x55576b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55576b([0x2a])))[_0x55576b([0x6d,0x61,0x70])](_0x9c192b=>_0x9c192b[_0x55576b([0x73,0x70,0x6c,0x69,0x74])](_0x55576b([0x2e])))[_0x55576b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x57050c=>_0x57050c[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2f793b[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x55576b([0x6d,0x61,0x70])](_0x3b95bd=>Array(_0x2f793b[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x3b95bd[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x55576b([0x66,0x69,0x6c,0x6c])](_0x3b95bd[0x0]===_0x55576b([0x2a])?_0x55576b([0x2a]):'')[_0x55576b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x3b95bd))[_0x55576b([0x73,0x6f,0x6d,0x65])](_0x5a8ef5=>_0x2f793b[_0x55576b([0x65,0x76,0x65,0x72,0x79])]((_0x11dc80,_0x5c3c7f)=>_0x5a8ef5[_0x5c3c7f]===_0x11dc80||_0x5a8ef5[_0x5c3c7f]===_0x55576b([0x2a])));}function _0x5bcbe0(){return _0xa1d9c8&&_0x242d73?new window[(_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xbd294c,_0x440e5e)=>{_0xa1d9c8[_0x55576b([0x74,0x68,0x65,0x6e])](_0xbd294c,_0x440e5e),_0x242d73[_0x55576b([0x74,0x68,0x65,0x6e])](_0x3c0857=>{_0x3c0857!=_0x55576b([0x56,0x61,0x6c,0x69,0x64])&&_0xbd294c(_0x3c0857);},_0x440e5e);}):_0xa1d9c8||_0x242d73||_0x55576b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x170f6d(_0x5af8f3,_0x467a05){return new window[(_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x82e430=>{if(_0x334e1a())return _0x82e430(_0x55576b([0x56,0x61,0x6c,0x69,0x64]));_0x115e0e(),_0x412407[_0x55576b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x55576b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x354115=!0x1;const _0x267405=_0x387713();function _0x428db6(_0x5ad319){return!!_0x5ad319&&(typeof _0x5ad319===_0x55576b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5ad319===_0x55576b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5ad319[_0x55576b([0x74,0x68,0x65,0x6e])]===_0x55576b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5ad319[_0x55576b([0x63,0x61,0x74,0x63,0x68])]===_0x55576b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x7d6cb5(_0x26faf3){_0x19d7c1(_0x26faf3)[_0x55576b([0x74,0x68,0x65,0x6e])](_0x38faeb=>{if(!_0x38faeb||_0x38faeb[_0x55576b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x55576b([0x6f,0x6b]))return _0x55576b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x173a07(_0x2ef7aa(_0x267405+_0x467a05))!=_0x38faeb[_0x55576b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x55576b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x55576b([0x56,0x61,0x6c,0x69,0x64]);})[_0x55576b([0x74,0x68,0x65,0x6e])](_0x14c47a=>(_0x1b306b(),_0x14c47a),()=>{const _0x10a390=_0x5b9308();return null==_0x10a390?(_0x1b306b(),_0x55576b([0x56,0x61,0x6c,0x69,0x64])):_0x55576b(_0x2435b0-_0x10a390>(0x7753083a^_0x1836b9)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x55576b([0x74,0x68,0x65,0x6e])](_0x82e430)[_0x55576b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x82e430(_0x55576b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x22e9b9=0x536962ba^_0x1836b9;function _0x1b306b(){const _0x492dcc=_0x55576b([0x6c,0x6c,0x63,0x74,0x2d])+_0x173a07(_0x2ef7aa(_0x5af8f3)),_0x34608e=_0x2de434(_0x173a07(window[_0x55576b([0x4d,0x61,0x74,0x68])][_0x55576b([0x63,0x65,0x69,0x6c])](_0x2435b0/_0x22e9b9)));window[_0x55576b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x55576b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x492dcc,_0x34608e);}function _0x5b9308(){const _0x219c24=_0x55576b([0x6c,0x6c,0x63,0x74,0x2d])+_0x173a07(_0x2ef7aa(_0x5af8f3)),_0x4ebf1c=window[_0x55576b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x55576b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x219c24);return _0x4ebf1c?window[_0x55576b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2de434(_0x4ebf1c),0x10)*_0x22e9b9:null;}function _0x19d7c1(_0x475489){return new window[(_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4c9dd3,_0x2d2f9a)=>{_0x475489[_0x55576b([0x74,0x68,0x65,0x6e])](_0x4c9dd3,_0x2d2f9a),window[_0x55576b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2d2f9a,0x535e58fa^_0x1836b9);});}}_0x412407[_0x55576b([0x6f,0x6e])](_0x55576b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x158009,_0x34af46)=>{if(_0x34af46[0x0]!=_0x5af8f3)return _0x82e430(_0x55576b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x34af46[0x1]={..._0x34af46[0x1],[_0x55576b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x267405};},{[_0x55576b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x55576b([0x68,0x69,0x67,0x68])}),_0x412407[_0x55576b([0x6f,0x6e])](_0x55576b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x36d374=>{_0x428db6(_0x36d374[_0x55576b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x354115=!0x0,_0x7d6cb5(_0x36d374[_0x55576b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x55576b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x55576b([0x6c,0x6f,0x77])}),_0x8d1f8c[_0x55576b([0x74,0x68,0x65,0x6e])](()=>{_0x354115||_0x82e430(_0x55576b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x334e1a(){return _0x412407[_0x55576b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x55576b([0x76,0x69,0x65,0x77])][_0x55576b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x55576b([0x61,0x75,0x74,0x6f]);}function _0x115e0e(){_0x412407[_0x55576b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x55576b([0x76,0x69,0x65,0x77])][_0x55576b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x55576b([0x61,0x75,0x74,0x6f]);}}function _0x3eba17(_0x4fefda){const _0xd9b313=[new window[(_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5ed164=>setTimeout(_0x5ed164,0x5356b2f6^_0x1836b9)),_0x8d1f8c[_0x55576b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d676a=>{let _0x350995=0x0;_0x412407[_0x55576b([0x6d,0x6f,0x64,0x65,0x6c])][_0x55576b([0x6f,0x6e])](_0x55576b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x19b35c,_0x2cefc3)=>{_0x2cefc3[0x0][_0x55576b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x350995++,_0x350995==(0x535f89d2^_0x1836b9)&&(_0x4d676a(),_0x19b35c[_0x55576b([0x6f,0x66,0x66])]());});}))];return window[_0x55576b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x55576b([0x72,0x61,0x63,0x65])](_0xd9b313)[_0x55576b([0x74,0x68,0x65,0x6e])](()=>_0x4fefda);}async function _0x1b6eb(){await _0x8d1f8c,_0x412407[_0x55576b([0x6d,0x6f,0x64,0x65,0x6c])][_0x55576b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x47100c,_0x412407[_0x55576b([0x6d,0x6f,0x64,0x65,0x6c])][_0x55576b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x47100c,_0x412407[_0x55576b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x55576b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1e9f16(_0x3f5e53){const _0x41e8fe=_0x3c62ce();_0x412407[_0x41e8fe]=_0x55576b([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3f5e53,_0x3f5e53!=_0x55576b([0x56,0x61,0x6c,0x69,0x64])&&_0x1b6eb();}function _0x3c62ce(){const _0x179535=window[_0x55576b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x55576b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x55576b([0x6e,0x6f,0x77])]())[_0x55576b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x55576b([0x2e]),'');let _0x5f56fd=_0x55576b([0x68]);for(let _0x316380=0x0;_0x316380<_0x179535[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x316380+=0x2){let _0x3a0a37=window[_0x55576b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x179535[_0x55576b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x316380,_0x316380+0x2));_0x3a0a37>=_0x4702cd[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3a0a37-=_0x4702cd[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5f56fd+=_0x4702cd[_0x3a0a37];}return _0x5f56fd;}function _0x4f390d(){const _0x1e27b0=_0x29c401[_0x55576b([0x73,0x70,0x6c,0x69,0x74])](_0x55576b([0x2e]));if(0x3!=_0x1e27b0[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5590f0(_0x1e27b0[0x1]);function _0x5590f0(_0x52f1c1){const _0x20de6c=_0x171143(_0x52f1c1);return _0x20de6c&&_0x29aaab()?_0x20de6c:null;function _0x29aaab(){const _0x200286=_0x20de6c[_0x55576b([0x6a,0x74,0x69])],_0x44da1d=window[_0x55576b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x200286[_0x55576b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x200286[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5c4fe2={..._0x20de6c,[_0x55576b([0x6a,0x74,0x69])]:_0x200286[_0x55576b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x200286[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5c4fe2[_0x55576b([0x76,0x63])],_0x2ef7aa(_0x5c4fe2)==_0x44da1d;}}}async function _0x1bfd46(){let _0x3b8e6b=!0x0;try{const _0x4120aa=_0x29c401[_0x55576b([0x73,0x70,0x6c,0x69,0x74])](_0x55576b([0x2e])),[_0x37b27c,_0x414b2e,_0x5d1603]=_0x4120aa;return _0x3ae961(_0x37b27c),await _0x2b12db(_0x37b27c,_0x414b2e,_0x5d1603),_0x3b8e6b;}catch{return!0x1;}function _0x3ae961(_0x5b9813){const _0x3cbed5=_0x171143(_0x5b9813);_0x3cbed5&&_0x3cbed5[_0x55576b([0x61,0x6c,0x67])]==_0x55576b([0x45,0x53,0x32,0x35,0x36])||(_0x3b8e6b=!0x1);}async function _0x2b12db(_0x594e18,_0xf613fd,_0xce356d){const _0x278ef0=window[_0x55576b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x55576b([0x66,0x72,0x6f,0x6d])](_0x400503(_0xce356d),_0x32b8d5=>_0x32b8d5[_0x55576b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5b9b4d=new window[(_0x55576b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x55576b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x594e18+_0x55576b([0x2e])+_0xf613fd),_0x1cdd58=window[_0x55576b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x55576b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1cdd58)return;const _0x5e787d=await _0x1cdd58[_0x55576b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x55576b([0x6a,0x77,0x6b]),_0x4b66b1,{[_0x55576b([0x6e,0x61,0x6d,0x65])]:_0x55576b([0x45,0x43,0x44,0x53,0x41]),[_0x55576b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x55576b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x55576b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1cdd58[_0x55576b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x55576b([0x6e,0x61,0x6d,0x65])]:_0x55576b([0x45,0x43,0x44,0x53,0x41]),[_0x55576b([0x68,0x61,0x73,0x68])]:{[_0x55576b([0x6e,0x61,0x6d,0x65])]:_0x55576b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5e787d,_0x278ef0,_0x5b9b4d)||(_0x3b8e6b=!0x1);}}function _0x171143(_0x4e632e){return _0x4e632e[_0x55576b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x55576b([0x65,0x79]))?JSON[_0x55576b([0x70,0x61,0x72,0x73,0x65])](_0x400503(_0x4e632e)):null;}function _0x400503(_0x347458){return window[_0x55576b([0x61,0x74,0x6f,0x62])](_0x347458[_0x55576b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x55576b([0x2b]))[_0x55576b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x55576b([0x2f])));}function _0x2ef7aa(_0x57eb60){let _0x5e52c2=0x1505;function _0x36ab7b(_0x5d953e){for(let _0xe608e=0x0;_0xe608e<_0x5d953e[_0x55576b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xe608e++){const _0x5aee4d=_0x5d953e[_0x55576b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xe608e);_0x5e52c2=(_0x5e52c2<<0x5)+_0x5e52c2+_0x5aee4d,_0x5e52c2&=_0x5e52c2;}}function _0x3ce1bf(_0x5d18c8){Array[_0x55576b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5d18c8)?_0x5d18c8[_0x55576b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3ce1bf):_0x5d18c8&&typeof _0x5d18c8==_0x55576b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x55576b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5d18c8)[_0x55576b([0x73,0x6f,0x72,0x74])]()[_0x55576b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x25490a,_0x61929a])=>{_0x36ab7b(_0x25490a),_0x3ce1bf(_0x61929a);}):_0x36ab7b(window[_0x55576b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5d18c8));}return _0x3ce1bf(_0x57eb60),_0x5e52c2>>>0x0;}function _0x173a07(_0x2cc157){return _0x2cc157[_0x55576b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x55576b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x55576b([0x30]));}function _0x2de434(_0x1aa5e2){return _0x1aa5e2[_0x55576b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x55576b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x55576b([0x6a,0x6f,0x69,0x6e])]('');}function _0x47100c(){}function _0x55576b(_0x5a604b){return _0x5a604b['map'](_0x470e74=>String['fromCharCode'](_0x470e74))['join']('');}_0x1e9f16(await _0x15041a());}(this);}['_initSchema'](){const _0x5ad938=this['editor']['model']['schema'];_0x5ad938['isRegistered']('imageBlock')&&_0x5ad938['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x5ad938['isRegistered']('imageInline')&&_0x5ad938['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x5cab3e=this['editor'];_0x5cab3e['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x5cab3e['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x3b22ce=>_0x3b22ce['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x240a38=_0x5cab3e['commands']['get']('replaceImageSource');_0x240a38&&this['listenTo'](_0x240a38,'cleanupImage',(_0x51cca9,[_0x2094cb,_0x4cfc50])=>{_0x2094cb['removeAttribute']('uploadcareImageId',_0x4cfc50);});}['_initConfig'](){const _0x282f4c=this['editor']['config']['get']('uploadcare.uploader')||{},_0x335d67=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x18d46e(_0x52c449['document'],'uc-config',{..._0x282f4c,'pubkey':_0x335d67,'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']=_0x3b0754=>{if('closeMax'==_0x3b0754)return'#uc-icon-arrow-down';},_0x52c449['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x18d46e(_0x52c449['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x52c449['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x5f0227=this['editor']['commands']['get']('insertImage');_0x5f0227&&this['listenTo'](_0x5f0227,'execute',()=>{const _0x1d20b0=this['editor']['model']['document']['selection']['getSelectedElement']();_0x1d20b0&&_0x1d20b0['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{M(this['editor'],_0x1d20b0);});});const _0x1cf90a=this['editor']['commands']['get']('uploadcareImageReplace');_0x1cf90a&&this['listenTo'](_0x1cf90a,'execute',()=>{const _0x12cd01=this['editor']['model']['document']['selection']['getSelectedElement']();_0x12cd01&&_0x12cd01['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{M(this['editor'],_0x12cd01);});});}}class X extends _0x34f2ef{static get['requires'](){return[Q,F];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e466f){super(_0x1e466f),_0x1e466f['config']['define']('uploadcare.uploader.sourceList',['local','url']),_0x18bd02['defineComponents'](_0x18bd02),this['_defineLocale']();}['_defineLocale'](){const _0x448ef7=this['editor']['config']['get']('uploadcare.locale'),_0x37d958=this['editor']['locale']['contentLanguage'];_0x448ef7&&_0x18bd02['defineLocale'](_0x37d958,_0x448ef7);}}class Y extends _0x21e0b4{constructor(_0x415385){super(_0x415385);const t=_0x415385['t'],_0x313ec6=this['bindTemplate'],_0x9be9d6=new _0x5d6317();_0x9be9d6['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':[_0x9be9d6,{'text':_0x313ec6['to']('imageUploadProgress',_0xe952f6=>t('Loading\x20image...')+'\x20('+(_0xe952f6||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 tt extends _0x21e0b4{constructor(_0x2d19b4){super(_0x2d19b4);const t=_0x2d19b4['t'];this['set']('errorType',null);const _0x202c2c=new _0x5a0aae(_0x2d19b4);_0x202c2c['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x202c2c['withText']=!0x0,_0x202c2c['class']='ck-button-action',_0x202c2c['on']('execute',()=>{this['fire']('retry');}),_0x202c2c['bind']('isVisible')['to'](this,'errorType',_0x32a6ea=>'NotFound'!==_0x32a6ea);const _0x6be6a3=new _0x410319();_0x6be6a3['content']=_0x293ec5,_0x6be6a3['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x3879c3=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':[_0x6be6a3,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x3879c3['to']('errorType',_0x5113dd=>t('NotFound'!==_0x5113dd?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x202c2c]},{'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 _0x21e0b4{constructor(_0x3be362,_0x5c949c){super(_0x3be362);const _0x1ccc66=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x5c949c,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x1ccc66['to']('imageSrc')}});}}class it extends ${['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x4655fe,_0x1f0692,_0x4b0082){super(_0x4655fe),this['_items']=this['createCollection'](),this['_loadingView']=new Y(_0x4655fe),this['_errorView']=new tt(_0x4655fe),this['_editingView']=new et(_0x4655fe,_0x4b0082),this['_focusableView']=new _0x21e0b4(_0x4655fe),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x1f0692),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'],_0x3375ac=>{this['_addUploadcareImageEditorListeners'](_0x3375ac);});}),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'](_0x1884a2,_0x35a65d){const _0xdbdbb5='uc-cloud-image-editor',_0x45af2f=_0x1884a2['querySelector'](_0xdbdbb5);if(_0x45af2f)return _0x35a65d(_0x45af2f);const _0xb13b72=new MutationObserver(_0x2b1cc3=>{const _0xa675d2=_0x2b1cc3['filter'](_0x259a8e=>_0x259a8e['target']===_0x1884a2&&_0x259a8e['addedNodes']['length']>0x0&&_0x259a8e['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0xdbdbb5);_0xa675d2['length']&&(_0xb13b72['disconnect'](),_0x35a65d(_0xa675d2[0x0]['addedNodes'][0x0]));});_0xb13b72['observe'](_0x1884a2,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x355122){_0x355122['addEventListener']('apply',_0x1476b7=>{this['fire']('apply',{'imageSrc':_0x1476b7['detail']['cdnUrl']});}),_0x355122['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class st extends/* #__PURE__ -- @preserve */
|
|
25
|
-
_0x5daa99(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x12a0d7,_0x422960,_0x4c07d8){super(),this['_editor']=_0x12a0d7,this['_dialog']=_0x422960,this['_imageElement']=_0x4c07d8,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 _0x1ef063=this['_imageElement'],_0x6fcc44=_0x1ef063['getAttribute']('uploadcareImageId'),_0x363a21=_0x1ef063['getAttribute']('src');if(_0x6fcc44)await this['_loadImageInfo'](_0x6fcc44,_0x363a21);else{if(this['_imageCache']['has'](_0x363a21)){const _0x2487ea=this['_imageCache']['get'](_0x363a21);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x2487ea['url'],this['imageDimension']=_0x2487ea['dimension'],this['imageId']=_0x2487ea['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x197176}=this['_editor'],t=_0x197176['t'],_0x45e161=new it(_0x197176,this['imageStatus'],this['_attributes']);_0x45e161['bind']('status')['to'](this,'imageStatus'),_0x45e161['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x45e161['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x45e161['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x45e161,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x11a213,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x45e161,'position':_0x13b148['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x45e161['focus']();},'onHide':()=>{_0x45e161['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x4cf902=>!W(_0x4cf902,_0x45e161['element'])}});}['_loadImageInfo'](_0x3bf1d5,_0x130a02){return H['getInfo'](_0x3bf1d5,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x1ff638=>{const {width:_0x219b78,height:_0xd206ee}=_0x1ff638['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x130a02,this['imageDimension']={'width':_0x219b78,'height':_0xd206ee},this['imageId']=_0x3bf1d5;})['catch'](_0x111298=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x111298['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x251e12,_0x5c6ae6){return this['_getImageAsFile'](_0x251e12)['then'](_0x40c785=>H['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':_0x5c6ae6['signal'],'file':_0x40c785,'onProgress':_0x5cba29=>{_0x5cba29&&_0x5cba29['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x5cba29['value']));}}))['then'](_0x3532b5=>{const {width:_0x28c0af,height:_0x3b5e0c}=_0x3532b5['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3532b5['cdnUrl'],this['imageDimension']={'width':_0x28c0af,'height':_0x3b5e0c},this['imageId']=_0x3532b5['uuid'],this['imageUploadProgress']=null;const _0x4a538b=_0x251e12['getAttribute']('src');this['_imageCache']['set'](_0x4a538b,{'id':_0x3532b5['uuid'],'url':_0x3532b5['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x1df1b1=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x1df1b1['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x17a065,_0x983238){_0x17a065['on']('apply',(_0x561b12,_0x2116ae)=>{this['_replaceImage'](_0x983238,_0x2116ae['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x17a065['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x17a065['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x55d6f1,_0x31f0d1,_0x1d238e){const _0x1487b7=this['_editor'],{width:_0x40a56c,height:_0x211a54}=j(_0x31f0d1,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x492589,imageSources:_0x1f4eb2}=V(_0x31f0d1,_0x40a56c);_0x1487b7['model']['change'](_0x3e0e69=>{if('$graveyard'===_0x55d6f1['root']['rootName']){_0x1487b7['execute']('insertImage',{'imageType':_0x55d6f1['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x55d6f1['getAttributes']()),'uploadcareImageId':_0x1d238e,'src':_0x492589,'sources':_0x1f4eb2,'width':_0x40a56c,'height':_0x211a54}});const _0x2bdf07=_0x55d6f1['getChildren']();_0x55d6f1=_0x1487b7['model']['document']['selection']['getSelectedElement']();for(const _0x51cf41 of _0x2bdf07)_0x3e0e69['append'](_0x3e0e69['cloneElement'](_0x51cf41),_0x55d6f1);}else _0x3e0e69['setSelection'](_0x55d6f1,'on'),_0x1487b7['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x55d6f1['getAttributes']()),'uploadcareImageId':_0x1d238e,'src':_0x492589,'sources':_0x1f4eb2,'width':_0x40a56c,'height':_0x211a54},_0x55d6f1);_0x3e0e69['setSelection'](_0x55d6f1,'on');});}async['_getImageAsFile'](_0x28ccf7){const _0x3ec4cf=_0x52c449['window'],_0x40ada6=_0x52c449['document']['location']['href'],_0x26a2a8=new _0x3ec4cf['URL'](_0x28ccf7['getAttribute']('src'),_0x40ada6);if('data:'===_0x26a2a8['protocol']){const _0x5abff1=_0x26a2a8['href']['split'](','),_0x2194fe=_0x5abff1[0x0]['match'](/:(.*?);/)[0x1],_0x11bff4=_0x2194fe['split']('/')[0x1],_0x3201b2=_0x3ec4cf['atob'](_0x5abff1[_0x5abff1['length']-0x1]);let _0x734714=_0x3201b2['length'];const _0x6b7485=new _0x3ec4cf['Uint8Array'](_0x734714);for(;_0x734714--;)_0x6b7485[_0x734714]=_0x3201b2['charCodeAt'](_0x734714);return new _0x3ec4cf['File']([_0x6b7485],'image.'+_0x11bff4,{'type':_0x2194fe});}const _0x298d13=_0x26a2a8['href']['split']('/'),_0x169b56=_0x298d13[_0x298d13['length']-0x1],_0x1fe651=_0x169b56['split']('.')[0x1];return _0x3ec4cf['fetch'](_0x26a2a8['href'])['then'](_0x4fea53=>_0x4fea53['clone']()['blob']())['then'](_0x4ceb1c=>new _0x3ec4cf['File']([_0x4ceb1c],_0x169b56,{'type':'image/'+_0x1fe651}));}}class rt extends _0x5b3dac{['imageEditController'];static get['requires'](){return[_0x55811d];}['_isEditable'];constructor(_0x4bde07){super(_0x4bde07),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x43483d){const _0xd6da1=q(_0x43483d);return _0x5e0103=>!(!_0x5e0103||!_0x5e0103['is']('element','imageBlock')&&!_0x5e0103['is']('element','imageInline'))&&(!!_0x5e0103['hasAttribute']('uploadcareImageId')||!!_0x5e0103['hasAttribute']('src')&&_0xd6da1(_0x5e0103['getAttribute']('src')));}(_0x4bde07['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x3fbe84=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x3fbe84);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x428549=this['editor']['model']['document']['selection']['getSelectedElement']();_0x428549&&(_0x428549['is']('element','imageBlock')||_0x428549['is']('element','imageInline'))&&(this['imageEditController']=new st(this['editor'],this['editor']['plugins']['get'](_0x55811d),_0x428549),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class nt extends _0x5b3dac{['refresh'](){const _0x4a6375=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x4a6375&&(_0x4a6375['is']('element','imageBlock')||_0x4a6375['is']('element','imageInline')));}['execute'](_0x253014){const _0x4a5d73=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x35a8dd=>{_0x35a8dd['setAttributes'](_0x253014,_0x4a5d73),_0x35a8dd['removeAttribute']('srcset',_0x4a5d73),_0x35a8dd['removeAttribute']('sizes',_0x4a5d73);});}}class at extends _0x34f2ef{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[Q,_0x200558,_0x2a0bd4,_0x1d283e];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1a3b2c}=this;_0x1a3b2c['commands']['add']('uploadcareImageEdit',new rt(_0x1a3b2c)),_0x1a3b2c['commands']['add']('uploadcareImageReplace',new nt(_0x1a3b2c));}}class ot extends _0x34f2ef{['_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 _0x44b5ff=this['editor'];_0x44b5ff['ui']['componentFactory']['add']('uploadcareImageEdit',_0x4a02d0=>{const _0x1523b0=_0x44b5ff['commands']['get']('uploadcareImageEdit'),_0x4a0ef1=new _0x5a0aae(_0x4a02d0),t=_0x4a02d0['t'];return _0x4a0ef1['set']({'icon':_0x11a213,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x4a0ef1['bind']('isEnabled')['to'](_0x1523b0),_0x4a0ef1['bind']('isOn')['to'](_0x1523b0,'isActive'),this['listenTo'](_0x4a0ef1,'execute',()=>{_0x44b5ff['execute']('uploadcareImageEdit'),_0x44b5ff['editing']['view']['focus']();}),_0x4a0ef1;}),this['_initConfig']();}['_initConfig'](){const _0x328e08=_0x18d46e(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x328e08),this['listenTo'](this['editor'],'destroy',()=>{_0x328e08['remove']();});}}class ct extends _0x34f2ef{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[at,ot];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{X as Uploadcare,z as UploadcareCommand,Q as UploadcareEditing,ct as UploadcareImageEdit,rt as UploadcareImageEditCommand,at as UploadcareImageEditEditing,ot as UploadcareImageEditUI,F as UploadcareUI,J as UploadcareUploadAdapter};
|
|
23
|
+
import{Plugin as _0x5db856,Command as _0x27a22e}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0xd957c8,IconGooglePhotos as _0x203575,IconGoogleDrive as _0x55912c,IconFacebook as _0x3bea6d,IconDropbox as _0x513260,IconUploadcareLink as _0x433a6a,IconUploadcareImageUpload as _0x458947,IconError as _0x15487a,IconUploadcareImageEdit as _0x188d0c}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x3a38e6,MenuBarMenuListItemButtonView as _0x108b49,View as _0x363444,FocusCycler as _0x58b069,Dialog as _0x256b25,DialogViewPosition as _0x1e609f,SpinnerView as _0x15e6c7,IconView as _0x1e9b2b,Notification as _0xfdff1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x5b9367,DomEmitterMixin as _0x3c2c7c,global as _0x254773,getAncestors as _0x433a80,ObservableMixin as _0x4fa4a3,uid as _0x209e0a,createElement as _0x1f8181}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ImageUploadEditing as _0x2031eb,ImageUploadProgress as _0x9ea975,PictureEditing as _0x11e016,ImageUtils as _0x1b3eda,ImageEditing as _0xdd1c66}from'@ckeditor/ckeditor5-image/dist/index.js';import{FileRepository as _0x1cf5d6}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x13d532,info as _0x371e2f}from'@uploadcare/upload-client';import*as _0xe4bf04 from'@uploadcare/file-uploader/web/file-uploader.min.js';function D(_0x1d5789,_0x1c935d,_0x55d39d){const t=_0x1d5789['t'],_0x1eb495=_0x1d5789['t'];switch(_0x1c935d){case'local':return{'text':_0x1eb495('Insert'===_0x55d39d?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x1eb495('From\x20computer')};case'url':return{'text':'Insert'===_0x55d39d?_0x1eb495('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x1eb495('Via\x20URL')};case'dropbox':return{'text':t('Insert'===_0x55d39d?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case'facebook':return{'text':t('Insert'===_0x55d39d?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case'gdrive':return{'text':t('Insert'===_0x55d39d?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case'gphotos':return{'text':t('Insert'===_0x55d39d?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case'onedrive':return{'text':t('Insert'===_0x55d39d?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x1c935d;}}class F extends _0x5db856{['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 _0x5e8059=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3c300e;for(const _0x44dcfc in _0x5e8059){const _0x5d4e26=_0x44dcfc,_0xde221d=_0x5e8059[_0x5d4e26];if('uploadcareLicenseKeyValid'==_0xde221d||'uploadcareLicenseKeyInvalid'==_0xde221d||'uploadcareLicenseKeyExpired'==_0xde221d||'uploadcareLicenseKeyDomainLimit'==_0xde221d||'uploadcareLicenseKeyNotAllowed'==_0xde221d||'uploadcareLicenseKeyEvaluationLimit'==_0xde221d||'uploadcareLicenseKeyUsageLimit'==_0xde221d){delete _0x5e8059[_0x5d4e26],_0x3c300e=_0xde221d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x3c300e&&_0x5e8059['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x3c300e&&_0x5e8059['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x3c300e&&_0x5e8059['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x3c300e&&_0x5e8059['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x3c300e&&_0x5e8059['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x3c300e&&_0x5e8059['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x49b5b3}=this,_0x58f9db=_0x49b5b3['commands']['get']('uploadcare');if(!_0x58f9db)return;const _0x268f4c=this['_normalizeConfigSourceList'](_0x49b5b3['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0xcb53a9,_0x370da2)=>{const _0x5baf88=this['_getIntegrationKey'](_0x370da2['type']);return _0xcb53a9[_0x5baf88]||(_0xcb53a9[_0x5baf88]=[]),_0xcb53a9[_0x5baf88]['push'](_0x370da2),_0xcb53a9;},{});_0x49b5b3['plugins']['has']('ImageInsertUI')&&_0x49b5b3['commands']['get']('uploadcare')&&Object['entries'](_0x268f4c)['forEach'](([_0xeab415,_0x151c1c])=>{_0x49b5b3['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0xeab415,'observable':()=>_0x58f9db,'buttonViewCreator':()=>this['_createToolbarButton'](_0x151c1c),'formViewCreator':()=>this['_createDropdownButtons'](_0x151c1c),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x151c1c),'override':'assetManager'!==_0xeab415});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x28212a){const {locale:_0x2a7f28}=this['editor'];return _0x28212a['map'](_0x4406be=>{const _0x53ef04=D(_0x2a7f28,_0x4406be,'Insert');switch(_0x4406be){case'local':return{'icon':_0x458947,'type':'local',..._0x53ef04};case'url':return{'icon':_0x433a6a,'type':'url',..._0x53ef04};case'dropbox':return{'icon':_0x513260,'type':'dropbox',..._0x53ef04};case'facebook':return{'icon':_0x3bea6d,'type':'facebook',..._0x53ef04};case'gdrive':return{'icon':_0x55912c,'type':'gdrive',..._0x53ef04};case'gphotos':return{'icon':_0x203575,'type':'gphotos',..._0x53ef04};case'onedrive':return{'icon':_0xd957c8,'type':'onedrive',..._0x53ef04};}});}['_getIntegrationKey'](_0x4ab2e0){switch(_0x4ab2e0){case'local':return'upload';case'url':return'url';default:return'assetManager';}}['_createButton'](_0x38cc84,_0x13e6a8){const _0x7c10cc=this['editor'],_0x1213cf=new _0x38cc84(_0x7c10cc['locale']),_0x3cd367=_0x7c10cc['commands']['get']('uploadcare');return _0x1213cf['bind']('isEnabled')['to'](_0x3cd367),_0x1213cf['on']('execute',()=>{_0x3cd367['execute'](_0x13e6a8);}),_0x1213cf;}['_createToolbarButton'](_0x114938){const {locale:_0xfb2428}=this['editor'],_0x533604=this['editor']['plugins']['get']('ImageInsertUI'),_0x39cde5=_0x114938[0x0],_0x209ce3=this['_createButton'](_0x3a38e6,_0x39cde5['type']);return _0x209ce3['icon']=_0x39cde5['icon'],_0x209ce3['bind']('label')['to'](_0x533604,'isImageSelected',_0x30a142=>D(_0xfb2428,_0x39cde5['type'],_0x30a142?'Replace':'Insert')['text']),_0x209ce3['tooltip']=!0x0,_0x209ce3;}['_createDropdownButtons'](_0x4381c1){const {locale:_0x174280}=this['editor'],_0x2af95d=this['editor']['plugins']['get']('ImageInsertUI');return _0x4381c1['map'](_0x5555d4=>{const _0x1ce917=this['_createButton'](_0x3a38e6,_0x5555d4['type']);return _0x1ce917['withText']=!0x0,_0x1ce917['icon']=_0x5555d4['icon'],_0x1ce917['bind']('label')['to'](_0x2af95d,'isImageSelected',_0x12cf35=>D(_0x174280,_0x5555d4['type'],_0x12cf35?'Replace':'Insert')['text']),_0x1ce917;});}['_createMenuBarButtons'](_0x52a76f){return _0x52a76f['map'](_0x5c0641=>{const _0x5542cd=this['_createButton'](_0x108b49,_0x5c0641['type']);return _0x5542cd['icon']=_0x5c0641['icon'],_0x5542cd['label']=_0x5c0641['shortText'],_0x5542cd;});}}class $ extends _0x363444{['focusTracker'];['focusCycler'];constructor(_0x45ef3f){super(_0x45ef3f),this['focusTracker']=new _0x5b9367(),this['focusCycler']=new _0x58b069({'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 B extends ${constructor(_0x240588,_0x1e0fc5){super(_0x240588),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-'+_0x1e0fc5}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function V(_0x33d5db,_0x300493){const _0xe898f4=_0x33d5db['replace'](/\/$/,'');return{'imageFallbackUrl':_0x33d5db,'imageSources':[{'srcset':[...[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x3938c6=>_0x3938c6<_0x300493)['map'](_0x408bd9=>_0xe898f4+'/-/resize/'+_0x408bd9+'x/\x20'+_0x408bd9+'w'),_0x33d5db+'\x20'+_0x300493+'w']['join'](',\x20'),'sizes':'(max-width:\x20'+_0x300493+'px)\x20100vw,\x20'+_0x300493+'px','type':'image/webp'}]};}function j(_0x4d5aab,_0x50bbf3,_0x1e993d){const _0x37658a=_0x4d5aab['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x37658a?parseInt(_0x37658a[0x1],0xa):_0x50bbf3,'height':_0x37658a?parseInt(_0x37658a[0x2],0xa):_0x1e993d};}function M(_0x13ec9a,_0x5f114d){const _0x25ddde=new(_0x3c2c7c())(),_0x490f95=_0x13ec9a['plugins']['get']('ImageUtils'),_0x1736a8=_0x13ec9a['editing']['mapper']['toViewElement'](_0x5f114d),_0x3bcc52=_0x490f95['findViewImgElement'](_0x1736a8),_0x20e161=_0x13ec9a['editing']['view']['domConverter']['viewToDom'](_0x3bcc52),_0x2b9e54=_0x5f114d['getAttribute']('width'),_0x44a42d=_0x5f114d['getAttribute']('height'),_0x248786='image-processing';_0x13ec9a['editing']['view']['change'](_0x400ae0=>{_0x400ae0['addClass'](_0x248786,_0x1736a8),_0x400ae0['setStyle']('aspect-ratio',_0x2b9e54+'/'+_0x44a42d,_0x3bcc52);}),_0x25ddde['listenTo'](_0x20e161,'load',()=>{_0x25ddde['stopListening'](_0x20e161,'load'),_0x13ec9a['editing']['view']['change'](_0x152725=>{_0x152725['removeClass'](_0x248786,_0x1736a8),_0x152725['removeStyle']('aspect-ratio',_0x3bcc52);});});}function q(_0x445729){if(Array['isArray'](_0x445729)){const _0x22150b=_0x445729['map'](q);return _0x13d46d=>_0x22150b['some'](_0x793347=>_0x793347(_0x13d46d));}if('origin'==_0x445729){const _0x317a4b=_0x254773['window']['location']['origin'];return _0x89a78c=>new URL(_0x89a78c,_0x254773['document']['baseURI'])['origin']==_0x317a4b;}return'function'==typeof _0x445729?_0x445729:_0x445729 instanceof RegExp?_0x2b70f7=>!(!_0x2b70f7['match'](_0x445729)&&!_0x2b70f7['replace'](/^https?:\/\//,'')['match'](_0x445729)):()=>!0x1;}function W(_0x1ea41e,_0x489f70){return _0x433a80(_0x1ea41e['target'])['includes'](_0x489f70);}class G extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x4fa4a3(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x5598db,_0x568c5c,_0x570eb1){super(),this['_editor']=_0x5598db,this['_editing']=_0x568c5c,this['_dialog']=_0x5598db['plugins']['get'](_0x256b25),this['_api']=_0x568c5c['ctxElement']['getAPI'](),this['_type']=_0x570eb1,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:_0x955fb9,model:_0x55ef46}=this['_editor'],_0x3b5cdf=_0x55ef46['document']['selection']['getSelectedElement'](),_0x3a9861=_0x3b5cdf&&(_0x3b5cdf['is']('element','imageBlock')||_0x3b5cdf['is']('element','imageInline'));this['_formView']=new B(_0x955fb9,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x458947,'title':D(_0x955fb9,this['_type'],_0x3a9861?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x1e609f['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0xb04a6f=>!W(_0xb04a6f,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x27eb69}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x3638de=>{const _0x22ce7f=_0x27eb69['length'];for(const _0x43e206 of _0x27eb69){const _0x3d9823=_0x43e206===_0x27eb69[_0x22ce7f-0x1],{cdnUrl:_0x17d6cc,fileInfo:_0x242601}=_0x43e206;if(!_0x17d6cc||!_0x242601)continue;const {width:_0x1b9ba5,height:_0x332aa2}=_0x242601['imageInfo'],_0x1bd3f4=j(_0x17d6cc,_0x1b9ba5,_0x332aa2),_0x49bb66=V(_0x17d6cc,_0x1bd3f4['width']),_0x32791a={'id':_0x242601['uuid'],'type':'image','attributes':{'imageDimension':_0x1bd3f4,..._0x49bb66}};this['_insertAsset'](_0x32791a,_0x3d9823,_0x3638de);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x5f9894=>{'idle'===_0x5f9894['detail']['status']&&!_0x5f9894['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&('local'===this['_type']?this['_api']['setCurrentActivity']('start-from'):this['_api']['initFlow']());});}['_insertAsset'](_0x40e93f,_0x41d89a,_0x4df66d){const _0x57c39f=this['_editor']['model']['document']['selection'],_0x45697f=_0x57c39f['getSelectedElement'](),_0x1e1db4=!(!_0x45697f||!_0x45697f['is']('element','imageInline'));_0x4df66d['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x40e93f,_0x1e1db4),_0x41d89a||_0x4df66d['setSelection'](_0x57c39f['getLastPosition']());}['_insertImage'](_0x3eb49d,_0x438b77){const _0x271452=this['_editor'],{imageDimension:_0x20276a,imageFallbackUrl:_0x2d22a3,imageSources:_0x5be24c}=_0x3eb49d['attributes'];_0x271452['execute']('insertImage',{'imageType':_0x438b77?'imageInline':null,'source':{'uploadcareImageId':_0x3eb49d['id'],'src':_0x2d22a3,'sources':_0x5be24c,..._0x20276a}});}}class z extends _0x27a22e{['_editing'];['_controller']=null;static get['requires'](){return[_0x256b25,Q];}constructor(_0x5bea69){super(_0x5bea69),this['_editing']=_0x5bea69['plugins']['get'](Q);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x53c0f4){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new G(this['editor'],this['_editing'],_0x53c0f4);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class H{static['upload']({file:_0xf9ba88,..._0x440125}){return _0x13d532(_0xf9ba88,_0x440125);}static['getInfo'](_0x4d01b7,_0x3e4cae){return _0x371e2f(_0x4d01b7,_0x3e4cae);}}class J extends _0x5db856{static get['requires'](){return[_0x2031eb,_0x9ea975,_0x1cf5d6,Q];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x27a5f1=this['editor'];if(!!!_0x27a5f1['config']['get']('uploadcare'))return;_0x27a5f1['plugins']['get'](_0x1cf5d6)['createUploadAdapter']=_0x1f176a=>new Z(_0x1f176a,_0x27a5f1),_0x27a5f1['plugins']['get'](_0x2031eb)['on']('uploadComplete',(_0x5c23c0,{imageElement:_0xb3644e,data:_0x2b5034})=>{_0x27a5f1['model']['change'](_0x52481c=>{_0x52481c['setAttribute']('uploadcareImageId',_0x2b5034['uploadcareImageId'],_0xb3644e);});});}}class Z{['loader'];['editor'];['controller'];constructor(_0x1d680f,_0x1d0d62){this['loader']=_0x1d680f,this['editor']=_0x1d0d62,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x3f110c=await this['loader']['file'];return H['upload']({'file':_0x3f110c,'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':_0x51ce42=>{_0x51ce42&&_0x51ce42['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x51ce42['value']);}})['then'](async _0x232998=>{const {imageFallbackUrl:_0x2d6074,imageSources:_0x5de6e}=V(_0x232998['cdnUrl'],_0x232998['imageInfo']['width']);return{'uploadcareImageId':_0x232998['uuid'],'default':_0x2d6074,'sources':_0x5de6e};})['catch'](()=>{const _0x1ba492=t('Cannot\x20upload\x20file:')+('\x20'+_0x3f110c['name']+'.');return Promise['reject'](_0x1ba492);});}['abort'](){this['controller']['abort']();}}class Q extends _0x5db856{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return[_0x11e016,J,_0x256b25];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0xab13d){super(_0xab13d),this['ucContextId']=_0x209e0a();}['init'](){const _0x501f01=this['editor'];_0x501f01['commands']['add']('uploadcare',new z(_0x501f01));}['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 _0x4dc73f=_0x254773['document']['querySelector']('input[uploadcare-file-input]');_0x4dc73f&&_0x4dc73f['remove']();}),async function(_0x505e43){const _0x1d870a=_0x1b11ab([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]),_0x277d26=0x535f8c3a,_0x21c900=0x53580592^_0x277d26,_0x5b41dd=window[_0x1b11ab([0x44,0x61,0x74,0x65])][_0x1b11ab([0x6e,0x6f,0x77])](),_0x178f21=_0x505e43[_0x1b11ab([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4e6108=new window[(_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x181036=>{_0x178f21[_0x1b11ab([0x6f,0x6e,0x63,0x65])](_0x1b11ab([0x72,0x65,0x61,0x64,0x79]),_0x181036);}),_0x512c4d={[_0x1b11ab([0x6b,0x74,0x79])]:_0x1b11ab([0x45,0x43]),[_0x1b11ab([0x75,0x73,0x65])]:_0x1b11ab([0x73,0x69,0x67]),[_0x1b11ab([0x63,0x72,0x76])]:_0x1b11ab([0x50,0x2d,0x32,0x35,0x36]),[_0x1b11ab([0x78])]:_0x1b11ab([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]),[_0x1b11ab([0x79])]:_0x1b11ab([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]),[_0x1b11ab([0x61,0x6c,0x67])]:_0x1b11ab([0x45,0x53,0x32,0x35,0x36])},_0xa2b0e6=_0x178f21[_0x1b11ab([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1b11ab([0x67,0x65,0x74])](_0x1b11ab([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x131646(){let _0x341512,_0x2653c3=null,_0x110a5b=null;try{if(_0xa2b0e6==_0x1b11ab([0x47,0x50,0x4c]))return _0x1b11ab([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x341512=_0xa65df5(),!_0x341512)return _0x1b11ab([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x341512[_0x1b11ab([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x110a5b=_0x38ce51(_0x341512[_0x1b11ab([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x341512[_0x1b11ab([0x6a,0x74,0x69])])),await _0x464d96()?_0x54d378()?_0xd8b3dd()?_0x1b11ab([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xeff889()?(_0x341512[_0x1b11ab([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1b11ab([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2653c3=_0x2dd907(_0x1b11ab([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2ee523()):_0x1b11ab([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1b11ab([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1b11ab([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1b11ab([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xd8b3dd(){const _0x4d8636=[_0x1b11ab([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1b11ab([0x74,0x72,0x69,0x61,0x6c])][_0x1b11ab([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x341512[_0x1b11ab([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5b41dd/0x3e8:0xe10*_0x21c900;return _0x341512[_0x1b11ab([0x65,0x78,0x70])]<_0x4d8636;}function _0x54d378(){const _0x1edd88=_0x341512[_0x1b11ab([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1edd88&&(!!_0x1edd88[_0x1b11ab([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b11ab([0x2a]))||!!_0x1edd88[_0x1b11ab([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b11ab([0x55,0x50,0x4c,0x43])));}function _0xeff889(){const _0x1f6dd8=_0x341512[_0x1b11ab([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1f6dd8||0x0==_0x1f6dd8[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x18fdff}=new URL(window[_0x1b11ab([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1f6dd8[_0x1b11ab([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18fdff))return!0x0;const _0x43e452=_0x18fdff[_0x1b11ab([0x73,0x70,0x6c,0x69,0x74])](_0x1b11ab([0x2e]));return _0x1f6dd8[_0x1b11ab([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4b0c0d=>_0x4b0c0d[_0x1b11ab([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b11ab([0x2a])))[_0x1b11ab([0x6d,0x61,0x70])](_0x55f57e=>_0x55f57e[_0x1b11ab([0x73,0x70,0x6c,0x69,0x74])](_0x1b11ab([0x2e])))[_0x1b11ab([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x30e206=>_0x30e206[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x43e452[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b11ab([0x6d,0x61,0x70])](_0x4f828c=>Array(_0x43e452[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4f828c[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1b11ab([0x66,0x69,0x6c,0x6c])](_0x4f828c[0x0]===_0x1b11ab([0x2a])?_0x1b11ab([0x2a]):'')[_0x1b11ab([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4f828c))[_0x1b11ab([0x73,0x6f,0x6d,0x65])](_0x355902=>_0x43e452[_0x1b11ab([0x65,0x76,0x65,0x72,0x79])]((_0x1f2c48,_0x4a2c46)=>_0x355902[_0x4a2c46]===_0x1f2c48||_0x355902[_0x4a2c46]===_0x1b11ab([0x2a])));}function _0x2ee523(){return _0x2653c3&&_0x110a5b?new window[(_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1e9107,_0x3a4a09)=>{_0x2653c3[_0x1b11ab([0x74,0x68,0x65,0x6e])](_0x1e9107,_0x3a4a09),_0x110a5b[_0x1b11ab([0x74,0x68,0x65,0x6e])](_0x32a1e3=>{_0x32a1e3!=_0x1b11ab([0x56,0x61,0x6c,0x69,0x64])&&_0x1e9107(_0x32a1e3);},_0x3a4a09);}):_0x2653c3||_0x110a5b||_0x1b11ab([0x56,0x61,0x6c,0x69,0x64]);}}function _0x38ce51(_0x169831,_0x4b025c){return new window[(_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c2d37=>{if(_0xf092bc())return _0x4c2d37(_0x1b11ab([0x56,0x61,0x6c,0x69,0x64]));_0x5133f0(),_0x178f21[_0x1b11ab([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1b11ab([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1eea23=!0x1;const _0x2ba0f0=_0x209e0a();function _0x5ba75a(_0x8b3ee0){return!!_0x8b3ee0&&(typeof _0x8b3ee0===_0x1b11ab([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x8b3ee0===_0x1b11ab([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x8b3ee0[_0x1b11ab([0x74,0x68,0x65,0x6e])]===_0x1b11ab([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x8b3ee0[_0x1b11ab([0x63,0x61,0x74,0x63,0x68])]===_0x1b11ab([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3ae2a2(_0x4433f8){_0x15ae9c(_0x4433f8)[_0x1b11ab([0x74,0x68,0x65,0x6e])](_0xc8b85=>{if(!_0xc8b85||_0xc8b85[_0x1b11ab([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1b11ab([0x6f,0x6b]))return _0x1b11ab([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5deae4(_0x12ed40(_0x2ba0f0+_0x4b025c))!=_0xc8b85[_0x1b11ab([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1b11ab([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1b11ab([0x56,0x61,0x6c,0x69,0x64]);})[_0x1b11ab([0x74,0x68,0x65,0x6e])](_0x24194a=>(_0x5aaf56(),_0x24194a),()=>{const _0x114c3c=_0x31a1af();return null==_0x114c3c?(_0x5aaf56(),_0x1b11ab([0x56,0x61,0x6c,0x69,0x64])):_0x1b11ab(_0x5b41dd-_0x114c3c>(0x7753083a^_0x277d26)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1b11ab([0x74,0x68,0x65,0x6e])](_0x4c2d37)[_0x1b11ab([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4c2d37(_0x1b11ab([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xec3939=0x536962ba^_0x277d26;function _0x5aaf56(){const _0x14cb67=_0x1b11ab([0x6c,0x6c,0x63,0x74,0x2d])+_0x5deae4(_0x12ed40(_0x169831)),_0x44cbb5=_0x5177a3(_0x5deae4(window[_0x1b11ab([0x4d,0x61,0x74,0x68])][_0x1b11ab([0x63,0x65,0x69,0x6c])](_0x5b41dd/_0xec3939)));window[_0x1b11ab([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b11ab([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x14cb67,_0x44cbb5);}function _0x31a1af(){const _0x55fa09=_0x1b11ab([0x6c,0x6c,0x63,0x74,0x2d])+_0x5deae4(_0x12ed40(_0x169831)),_0xbaa167=window[_0x1b11ab([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1b11ab([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x55fa09);return _0xbaa167?window[_0x1b11ab([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5177a3(_0xbaa167),0x10)*_0xec3939:null;}function _0x15ae9c(_0x3b41db){return new window[(_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x45434b,_0x176fc3)=>{_0x3b41db[_0x1b11ab([0x74,0x68,0x65,0x6e])](_0x45434b,_0x176fc3),window[_0x1b11ab([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x176fc3,0x535e58fa^_0x277d26);});}}_0x178f21[_0x1b11ab([0x6f,0x6e])](_0x1b11ab([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3cee5a,_0x28d893)=>{if(_0x28d893[0x0]!=_0x169831)return _0x4c2d37(_0x1b11ab([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x28d893[0x1]={..._0x28d893[0x1],[_0x1b11ab([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2ba0f0};},{[_0x1b11ab([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b11ab([0x68,0x69,0x67,0x68])}),_0x178f21[_0x1b11ab([0x6f,0x6e])](_0x1b11ab([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x47d708=>{_0x5ba75a(_0x47d708[_0x1b11ab([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1eea23=!0x0,_0x3ae2a2(_0x47d708[_0x1b11ab([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1b11ab([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1b11ab([0x6c,0x6f,0x77])}),_0x4e6108[_0x1b11ab([0x74,0x68,0x65,0x6e])](()=>{_0x1eea23||_0x4c2d37(_0x1b11ab([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xf092bc(){return _0x178f21[_0x1b11ab([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b11ab([0x76,0x69,0x65,0x77])][_0x1b11ab([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1b11ab([0x61,0x75,0x74,0x6f]);}function _0x5133f0(){_0x178f21[_0x1b11ab([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1b11ab([0x76,0x69,0x65,0x77])][_0x1b11ab([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1b11ab([0x61,0x75,0x74,0x6f]);}}function _0x2dd907(_0x1d71c4){const _0x1e0326=[new window[(_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4b90c8=>setTimeout(_0x4b90c8,0x5356b2f6^_0x277d26)),_0x4e6108[_0x1b11ab([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4fee6e=>{let _0x4cb71e=0x0;_0x178f21[_0x1b11ab([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b11ab([0x6f,0x6e])](_0x1b11ab([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfb95f6,_0x56010d)=>{_0x56010d[0x0][_0x1b11ab([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4cb71e++,_0x4cb71e==(0x535f89d2^_0x277d26)&&(_0x4fee6e(),_0xfb95f6[_0x1b11ab([0x6f,0x66,0x66])]());});}))];return window[_0x1b11ab([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1b11ab([0x72,0x61,0x63,0x65])](_0x1e0326)[_0x1b11ab([0x74,0x68,0x65,0x6e])](()=>_0x1d71c4);}async function _0x40489d(){await _0x4e6108,_0x178f21[_0x1b11ab([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b11ab([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2387f5,_0x178f21[_0x1b11ab([0x6d,0x6f,0x64,0x65,0x6c])][_0x1b11ab([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2387f5,_0x178f21[_0x1b11ab([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1b11ab([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x567250(_0x41ba50){const _0x1a11db=_0x394339();_0x178f21[_0x1a11db]=_0x1b11ab([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x41ba50,_0x41ba50!=_0x1b11ab([0x56,0x61,0x6c,0x69,0x64])&&_0x40489d();}function _0x394339(){const _0x15f5b4=window[_0x1b11ab([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1b11ab([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1b11ab([0x6e,0x6f,0x77])]())[_0x1b11ab([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1b11ab([0x2e]),'');let _0x42e4ff=_0x1b11ab([0x68]);for(let _0x13b459=0x0;_0x13b459<_0x15f5b4[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x13b459+=0x2){let _0x1e46ae=window[_0x1b11ab([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x15f5b4[_0x1b11ab([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x13b459,_0x13b459+0x2));_0x1e46ae>=_0x1d870a[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1e46ae-=_0x1d870a[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x42e4ff+=_0x1d870a[_0x1e46ae];}return _0x42e4ff;}function _0xa65df5(){const _0x24b6d9=_0xa2b0e6[_0x1b11ab([0x73,0x70,0x6c,0x69,0x74])](_0x1b11ab([0x2e]));if(0x3!=_0x24b6d9[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1a289e(_0x24b6d9[0x1]);function _0x1a289e(_0x17eb54){const _0xcff600=_0x547924(_0x17eb54);return _0xcff600&&_0x48faf9()?_0xcff600:null;function _0x48faf9(){const _0x24aa03=_0xcff600[_0x1b11ab([0x6a,0x74,0x69])],_0x3206ad=window[_0x1b11ab([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x24aa03[_0x1b11ab([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x24aa03[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x231ed7={..._0xcff600,[_0x1b11ab([0x6a,0x74,0x69])]:_0x24aa03[_0x1b11ab([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x24aa03[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x231ed7[_0x1b11ab([0x76,0x63])],_0x12ed40(_0x231ed7)==_0x3206ad;}}}async function _0x464d96(){let _0x36ce7d=!0x0;try{const _0x839a67=_0xa2b0e6[_0x1b11ab([0x73,0x70,0x6c,0x69,0x74])](_0x1b11ab([0x2e])),[_0x2f7e24,_0x55e498,_0x1773a6]=_0x839a67;return _0x2d750e(_0x2f7e24),await _0x3529d4(_0x2f7e24,_0x55e498,_0x1773a6),_0x36ce7d;}catch{return!0x1;}function _0x2d750e(_0x300d71){const _0x2cf635=_0x547924(_0x300d71);_0x2cf635&&_0x2cf635[_0x1b11ab([0x61,0x6c,0x67])]==_0x1b11ab([0x45,0x53,0x32,0x35,0x36])||(_0x36ce7d=!0x1);}async function _0x3529d4(_0x3dfe02,_0x44c943,_0x11ce1a){const _0x3b52f2=window[_0x1b11ab([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1b11ab([0x66,0x72,0x6f,0x6d])](_0x7e2602(_0x11ce1a),_0x21972d=>_0x21972d[_0x1b11ab([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x174872=new window[(_0x1b11ab([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1b11ab([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3dfe02+_0x1b11ab([0x2e])+_0x44c943),_0x367c02=window[_0x1b11ab([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1b11ab([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x367c02)return;const _0x9298b6=await _0x367c02[_0x1b11ab([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1b11ab([0x6a,0x77,0x6b]),_0x512c4d,{[_0x1b11ab([0x6e,0x61,0x6d,0x65])]:_0x1b11ab([0x45,0x43,0x44,0x53,0x41]),[_0x1b11ab([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1b11ab([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1b11ab([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x367c02[_0x1b11ab([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1b11ab([0x6e,0x61,0x6d,0x65])]:_0x1b11ab([0x45,0x43,0x44,0x53,0x41]),[_0x1b11ab([0x68,0x61,0x73,0x68])]:{[_0x1b11ab([0x6e,0x61,0x6d,0x65])]:_0x1b11ab([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x9298b6,_0x3b52f2,_0x174872)||(_0x36ce7d=!0x1);}}function _0x547924(_0x421a2e){return _0x421a2e[_0x1b11ab([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1b11ab([0x65,0x79]))?JSON[_0x1b11ab([0x70,0x61,0x72,0x73,0x65])](_0x7e2602(_0x421a2e)):null;}function _0x7e2602(_0x147715){return window[_0x1b11ab([0x61,0x74,0x6f,0x62])](_0x147715[_0x1b11ab([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1b11ab([0x2b]))[_0x1b11ab([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1b11ab([0x2f])));}function _0x12ed40(_0x4bb103){let _0x721093=0x1505;function _0x2018e3(_0x1ffcd5){for(let _0xc011a1=0x0;_0xc011a1<_0x1ffcd5[_0x1b11ab([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xc011a1++){const _0x4bcbd3=_0x1ffcd5[_0x1b11ab([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xc011a1);_0x721093=(_0x721093<<0x5)+_0x721093+_0x4bcbd3,_0x721093&=_0x721093;}}function _0x46167f(_0x23bef7){Array[_0x1b11ab([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x23bef7)?_0x23bef7[_0x1b11ab([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x46167f):_0x23bef7&&typeof _0x23bef7==_0x1b11ab([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1b11ab([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x23bef7)[_0x1b11ab([0x73,0x6f,0x72,0x74])]()[_0x1b11ab([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x10e2ae,_0x59755f])=>{_0x2018e3(_0x10e2ae),_0x46167f(_0x59755f);}):_0x2018e3(window[_0x1b11ab([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x23bef7));}return _0x46167f(_0x4bb103),_0x721093>>>0x0;}function _0x5deae4(_0x5ebcf3){return _0x5ebcf3[_0x1b11ab([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1b11ab([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1b11ab([0x30]));}function _0x5177a3(_0x2ad09c){return _0x2ad09c[_0x1b11ab([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1b11ab([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1b11ab([0x6a,0x6f,0x69,0x6e])]('');}function _0x2387f5(){}function _0x1b11ab(_0x4f945a){return _0x4f945a['map'](_0x51df81=>String['fromCharCode'](_0x51df81))['join']('');}_0x567250(await _0x131646());}(this);}['_initSchema'](){const _0x18913a=this['editor']['model']['schema'];_0x18913a['isRegistered']('imageBlock')&&_0x18913a['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x18913a['isRegistered']('imageInline')&&_0x18913a['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x5bc2c3=this['editor'];_0x5bc2c3['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x5bc2c3['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x494e3f=>_0x494e3f['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x10480=_0x5bc2c3['commands']['get']('replaceImageSource');_0x10480&&this['listenTo'](_0x10480,'cleanupImage',(_0x30b10f,[_0x3fea1e,_0x3fe871])=>{_0x3fea1e['removeAttribute']('uploadcareImageId',_0x3fe871);});}['_initConfig'](){const _0x22ee8e=this['editor']['config']['get']('uploadcare.uploader')||{},_0x290ecd=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x1f8181(_0x254773['document'],'uc-config',{..._0x22ee8e,'pubkey':_0x290ecd,'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']=_0x59e8e7=>{if('closeMax'==_0x59e8e7)return'#uc-icon-arrow-down';},_0x254773['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x1f8181(_0x254773['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x254773['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x189a2e=this['editor']['commands']['get']('insertImage');_0x189a2e&&this['listenTo'](_0x189a2e,'execute',()=>{const _0x4c2857=this['editor']['model']['document']['selection']['getSelectedElement']();_0x4c2857&&_0x4c2857['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{M(this['editor'],_0x4c2857);});});const _0x5b0139=this['editor']['commands']['get']('uploadcareImageReplace');_0x5b0139&&this['listenTo'](_0x5b0139,'execute',()=>{const _0x32ba5a=this['editor']['model']['document']['selection']['getSelectedElement']();_0x32ba5a&&_0x32ba5a['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{M(this['editor'],_0x32ba5a);});});}}class X extends _0x5db856{static get['requires'](){return[Q,F];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x47444a){super(_0x47444a),_0x47444a['config']['define']('uploadcare.uploader.sourceList',['local','url']),_0xe4bf04['defineComponents'](_0xe4bf04),this['_defineLocale']();}['_defineLocale'](){const _0x1429e4=this['editor']['config']['get']('uploadcare.locale'),_0x6205d0=this['editor']['locale']['contentLanguage'];_0x1429e4&&_0xe4bf04['defineLocale'](_0x6205d0,_0x1429e4);}}class Y extends _0x363444{constructor(_0x2a2ea1){super(_0x2a2ea1);const t=_0x2a2ea1['t'],_0x5dd01a=this['bindTemplate'],_0x3a4c6d=new _0x15e6c7();_0x3a4c6d['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':[_0x3a4c6d,{'text':_0x5dd01a['to']('imageUploadProgress',_0x1af8af=>t('Loading\x20image...')+'\x20('+(_0x1af8af||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 tt extends _0x363444{constructor(_0x2d07d3){super(_0x2d07d3);const t=_0x2d07d3['t'];this['set']('errorType',null);const _0x2b9b22=new _0x3a38e6(_0x2d07d3);_0x2b9b22['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x2b9b22['withText']=!0x0,_0x2b9b22['class']='ck-button-action',_0x2b9b22['on']('execute',()=>{this['fire']('retry');}),_0x2b9b22['bind']('isVisible')['to'](this,'errorType',_0x2c847b=>'NotFound'!==_0x2c847b);const _0x2d3854=new _0x1e9b2b();_0x2d3854['content']=_0x15487a,_0x2d3854['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x573fad=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':[_0x2d3854,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x573fad['to']('errorType',_0x25fcee=>t('NotFound'!==_0x25fcee?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x2b9b22]},{'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 _0x363444{constructor(_0xf20ca0,_0x24645f){super(_0xf20ca0);const _0x5bdbf4=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x24645f,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x5bdbf4['to']('imageSrc')}});}}class it extends ${['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x32c8d6,_0x3c8531,_0xefe334){super(_0x32c8d6),this['_items']=this['createCollection'](),this['_loadingView']=new Y(_0x32c8d6),this['_errorView']=new tt(_0x32c8d6),this['_editingView']=new et(_0x32c8d6,_0xefe334),this['_focusableView']=new _0x363444(_0x32c8d6),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x3c8531),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'],_0x25d5af=>{this['_addUploadcareImageEditorListeners'](_0x25d5af);});}),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'](_0x54f7bf,_0x2a1dd3){const _0x153d01='uc-cloud-image-editor',_0x1e9d5a=_0x54f7bf['querySelector'](_0x153d01);if(_0x1e9d5a)return _0x2a1dd3(_0x1e9d5a);const _0x45262f=new MutationObserver(_0x475aaf=>{const _0x378dab=_0x475aaf['filter'](_0x4cfbbf=>_0x4cfbbf['target']===_0x54f7bf&&_0x4cfbbf['addedNodes']['length']>0x0&&_0x4cfbbf['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x153d01);_0x378dab['length']&&(_0x45262f['disconnect'](),_0x2a1dd3(_0x378dab[0x0]['addedNodes'][0x0]));});_0x45262f['observe'](_0x54f7bf,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x5a6057){_0x5a6057['addEventListener']('apply',_0x5530fc=>{this['fire']('apply',{'imageSrc':_0x5530fc['detail']['cdnUrl']});}),_0x5a6057['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class st extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x4fa4a3(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x2a7a7e,_0x21e73d,_0x3d3eb6){super(),this['_editor']=_0x2a7a7e,this['_dialog']=_0x21e73d,this['_imageElement']=_0x3d3eb6,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 _0x62465b=this['_imageElement'],_0x99bf8a=_0x62465b['getAttribute']('uploadcareImageId'),_0x48436e=_0x62465b['getAttribute']('src');if(_0x99bf8a)await this['_loadImageInfo'](_0x99bf8a,_0x48436e);else{if(this['_imageCache']['has'](_0x48436e)){const _0x3bcb53=this['_imageCache']['get'](_0x48436e);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3bcb53['url'],this['imageDimension']=_0x3bcb53['dimension'],this['imageId']=_0x3bcb53['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x2140ea}=this['_editor'],t=_0x2140ea['t'],_0x1d3f7d=new it(_0x2140ea,this['imageStatus'],this['_attributes']);_0x1d3f7d['bind']('status')['to'](this,'imageStatus'),_0x1d3f7d['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x1d3f7d['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x1d3f7d['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x1d3f7d,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x188d0c,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x1d3f7d,'position':_0x1e609f['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x1d3f7d['focus']();},'onHide':()=>{_0x1d3f7d['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x37ca7f=>!W(_0x37ca7f,_0x1d3f7d['element'])}});}['_loadImageInfo'](_0x38e926,_0x2ccfc9){return H['getInfo'](_0x38e926,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x289485=>{const {width:_0x586dc3,height:_0x28b834}=_0x289485['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x2ccfc9,this['imageDimension']={'width':_0x586dc3,'height':_0x28b834},this['imageId']=_0x38e926;})['catch'](_0xd8fcba=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0xd8fcba['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x113376,_0x2819f6){return this['_getImageAsFile'](_0x113376)['then'](_0xed0c95=>H['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':_0x2819f6['signal'],'file':_0xed0c95,'onProgress':_0x520f0b=>{_0x520f0b&&_0x520f0b['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x520f0b['value']));}}))['then'](_0x314a11=>{const {width:_0x37e8a5,height:_0x50be09}=_0x314a11['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x314a11['cdnUrl'],this['imageDimension']={'width':_0x37e8a5,'height':_0x50be09},this['imageId']=_0x314a11['uuid'],this['imageUploadProgress']=null;const _0x5ebfc2=_0x113376['getAttribute']('src');this['_imageCache']['set'](_0x5ebfc2,{'id':_0x314a11['uuid'],'url':_0x314a11['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x3c92b1=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x3c92b1['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x1a0818,_0x47c190){_0x1a0818['on']('apply',(_0x1c2759,_0x2acbe5)=>{this['_replaceImage'](_0x47c190,_0x2acbe5['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x1a0818['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x1a0818['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x19a990,_0x31d7a,_0x2e5323){const _0x1d3430=this['_editor'],{width:_0x590b1c,height:_0x516021}=j(_0x31d7a,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x3de03a,imageSources:_0x3ccc4e}=V(_0x31d7a,_0x590b1c);_0x1d3430['model']['change'](_0x411f3e=>{if('$graveyard'===_0x19a990['root']['rootName']){_0x1d3430['execute']('insertImage',{'imageType':_0x19a990['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x19a990['getAttributes']()),'uploadcareImageId':_0x2e5323,'src':_0x3de03a,'sources':_0x3ccc4e,'width':_0x590b1c,'height':_0x516021}});const _0x3a12d7=_0x19a990['getChildren']();_0x19a990=_0x1d3430['model']['document']['selection']['getSelectedElement']();for(const _0x5a8c52 of _0x3a12d7)_0x411f3e['append'](_0x411f3e['cloneElement'](_0x5a8c52),_0x19a990);}else _0x411f3e['setSelection'](_0x19a990,'on'),_0x1d3430['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x19a990['getAttributes']()),'uploadcareImageId':_0x2e5323,'src':_0x3de03a,'sources':_0x3ccc4e,'width':_0x590b1c,'height':_0x516021},_0x19a990);_0x411f3e['setSelection'](_0x19a990,'on');});}async['_getImageAsFile'](_0x1f336a){const _0xc3d5e=_0x254773['window'],_0x4addec=_0x254773['document']['location']['href'],_0x4134b8=new _0xc3d5e['URL'](_0x1f336a['getAttribute']('src'),_0x4addec);if('data:'===_0x4134b8['protocol']){const _0x1b6c3a=_0x4134b8['href']['split'](','),_0x2932cc=_0x1b6c3a[0x0]['match'](/:(.*?);/)[0x1],_0x1d221a=_0x2932cc['split']('/')[0x1],_0xfa9b01=_0xc3d5e['atob'](_0x1b6c3a[_0x1b6c3a['length']-0x1]);let _0x40c397=_0xfa9b01['length'];const _0x2c8216=new _0xc3d5e['Uint8Array'](_0x40c397);for(;_0x40c397--;)_0x2c8216[_0x40c397]=_0xfa9b01['charCodeAt'](_0x40c397);return new _0xc3d5e['File']([_0x2c8216],'image.'+_0x1d221a,{'type':_0x2932cc});}const _0x68b790=_0x4134b8['href']['split']('/'),_0x25f712=_0x68b790[_0x68b790['length']-0x1],_0xfcc06f=_0x25f712['split']('.')[0x1];return _0xc3d5e['fetch'](_0x4134b8['href'])['then'](_0x5a2af9=>_0x5a2af9['clone']()['blob']())['then'](_0x10f93c=>new _0xc3d5e['File']([_0x10f93c],_0x25f712,{'type':'image/'+_0xfcc06f}));}}class rt extends _0x27a22e{['imageEditController'];static get['requires'](){return[_0x256b25];}['_isEditable'];constructor(_0x35d20d){super(_0x35d20d),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x2ded1a){const _0x1fff56=q(_0x2ded1a);return _0x4a0957=>!(!_0x4a0957||!_0x4a0957['is']('element','imageBlock')&&!_0x4a0957['is']('element','imageInline'))&&(!!_0x4a0957['hasAttribute']('uploadcareImageId')||!!_0x4a0957['hasAttribute']('src')&&_0x1fff56(_0x4a0957['getAttribute']('src')));}(_0x35d20d['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x1f2499=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x1f2499);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x597f8a=this['editor']['model']['document']['selection']['getSelectedElement']();_0x597f8a&&(_0x597f8a['is']('element','imageBlock')||_0x597f8a['is']('element','imageInline'))&&(this['imageEditController']=new st(this['editor'],this['editor']['plugins']['get'](_0x256b25),_0x597f8a),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class nt extends _0x27a22e{['refresh'](){const _0x3ad9db=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x3ad9db&&(_0x3ad9db['is']('element','imageBlock')||_0x3ad9db['is']('element','imageInline')));}['execute'](_0x5503ba){const _0x14d0eb=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0xfebc0=>{_0xfebc0['setAttributes'](_0x5503ba,_0x14d0eb),_0xfebc0['removeAttribute']('srcset',_0x14d0eb),_0xfebc0['removeAttribute']('sizes',_0x14d0eb);});}}class at extends _0x5db856{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[Q,_0xfdff1,_0x1b3eda,_0xdd1c66];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5b7a11}=this;_0x5b7a11['commands']['add']('uploadcareImageEdit',new rt(_0x5b7a11)),_0x5b7a11['commands']['add']('uploadcareImageReplace',new nt(_0x5b7a11));}}class ot extends _0x5db856{['_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 _0x5797ff=this['editor'];_0x5797ff['ui']['componentFactory']['add']('uploadcareImageEdit',_0x52a522=>{const _0x44c775=_0x5797ff['commands']['get']('uploadcareImageEdit'),_0x9e94b5=new _0x3a38e6(_0x52a522),t=_0x52a522['t'];return _0x9e94b5['set']({'icon':_0x188d0c,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x9e94b5['bind']('isEnabled')['to'](_0x44c775),_0x9e94b5['bind']('isOn')['to'](_0x44c775,'isActive'),this['listenTo'](_0x9e94b5,'execute',()=>{_0x5797ff['execute']('uploadcareImageEdit'),_0x5797ff['editing']['view']['focus']();}),_0x9e94b5;}),this['_initConfig']();}['_initConfig'](){const _0xf9708c=_0x1f8181(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0xf9708c),this['listenTo'](this['editor'],'destroy',()=>{_0xf9708c['remove']();});}}class ct extends _0x5db856{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[at,ot];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{X as Uploadcare,z as UploadcareCommand,Q as UploadcareEditing,ct as UploadcareImageEdit,rt as UploadcareImageEditCommand,at as UploadcareImageEditEditing,ot as UploadcareImageEditUI,F as UploadcareUI,J as UploadcareUploadAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-uploadcare",
|
|
3
|
-
"version": "48.1.0-alpha.
|
|
3
|
+
"version": "48.1.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.1.0-alpha.
|
|
41
|
-
"@ckeditor/ckeditor5-engine": "48.1.0-alpha.
|
|
42
|
-
"@ckeditor/ckeditor5-icons": "48.1.0-alpha.
|
|
43
|
-
"@ckeditor/ckeditor5-image": "48.1.0-alpha.
|
|
44
|
-
"@ckeditor/ckeditor5-ui": "48.1.0-alpha.
|
|
45
|
-
"@ckeditor/ckeditor5-upload": "48.1.0-alpha.
|
|
46
|
-
"@ckeditor/ckeditor5-utils": "48.1.0-alpha.
|
|
40
|
+
"@ckeditor/ckeditor5-core": "48.1.0-alpha.4",
|
|
41
|
+
"@ckeditor/ckeditor5-engine": "48.1.0-alpha.4",
|
|
42
|
+
"@ckeditor/ckeditor5-icons": "48.1.0-alpha.4",
|
|
43
|
+
"@ckeditor/ckeditor5-image": "48.1.0-alpha.4",
|
|
44
|
+
"@ckeditor/ckeditor5-ui": "48.1.0-alpha.4",
|
|
45
|
+
"@ckeditor/ckeditor5-upload": "48.1.0-alpha.4",
|
|
46
|
+
"@ckeditor/ckeditor5-utils": "48.1.0-alpha.4",
|
|
47
47
|
"@uploadcare/file-uploader": "1.29.0",
|
|
48
48
|
"@uploadcare/upload-client": "6.14.3"
|
|
49
49
|
},
|