@ckeditor/ckeditor5-uploadcare 47.6.1-alpha.1 → 47.6.1
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/build/uploadcare.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +9 -9
- package/src/ui/uploadcarecontroller.js +2 -2
- package/src/ui/uploadcareformview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditcontroller.js +2 -2
- package/src/uploadcareimageedit/ui/uploadcareimageeditformeditingview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditformerrorview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditformloadingview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditformview.js +1 -1
- package/src/uploadcareimageedit/uploadcareimageeditcommand.js +1 -1
- package/src/uploadcareimageedit/uploadcareimageeditediting.js +1 -1
- package/src/uploadcareimageedit/uploadcareimageeditui.js +1 -1
- package/src/utils/dialogfocusmanagerview.js +1 -1
- package/src/utils/editingutils.js +1 -1
- package/src/utils/isancestor.js +1 -1
- package/src/utils/uploadutils.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x4f1a6a,Command as _0x1cb1a2}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x57a3ad,IconGooglePhotos as _0x4fa165,IconGoogleDrive as _0x5c3837,IconFacebook as _0x240bae,IconDropbox as _0xfa4f6b,IconUploadcareLink as _0x2295ec,IconUploadcareImageUpload as _0x36cb66,IconError as _0x336bb5,IconUploadcareImageEdit as _0x3c0aa3}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0xf03747,MenuBarMenuListItemButtonView as _0x21ca07,View as _0x3913b3,FocusCycler as _0xc0c7ff,Dialog as _0xa7f385,DialogViewPosition as _0x3b0daf,SpinnerView as _0x4ff9e7,IconView as _0x379f97,Notification as _0x2d171e}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x21ef37,DomEmitterMixin as _0x1e7440,global as _0x36efa3,getAncestors as _0x40e4e9,ObservableMixin as _0x3fa845,uid as _0x1c21c3,createElement as _0x390ae4}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x1dfed0}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x2a9603,info as _0x3cdd70}from'@uploadcare/upload-client';import*as _0x1cd729 from'@uploadcare/file-uploader';var i=function(_0x331bc4){return _0x331bc4['Local']='local',_0x331bc4['URL']='url',_0x331bc4['Dropbox']='dropbox',_0x331bc4['GDrive']='gdrive',_0x331bc4['Facebook']='facebook',_0x331bc4['GPhotos']='gphotos',_0x331bc4['OneDrive']='onedrive',_0x331bc4;}({});function _(_0x5d7afb,_0x5bd9ac,_0x4398da){const t=_0x5d7afb['t'],_0xab34ac=_0x5d7afb['t'];switch(_0x5bd9ac){case i['Local']:return{'text':_0xab34ac('Insert'===_0x4398da?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0xab34ac('From\x20computer')};case i['URL']:return{'text':'Insert'===_0x4398da?_0xab34ac('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0xab34ac('Via\x20URL')};case i['Dropbox']:return{'text':t('Insert'===_0x4398da?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case i['Facebook']:return{'text':t('Insert'===_0x4398da?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case i['GDrive']:return{'text':t('Insert'===_0x4398da?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case i['GPhotos']:return{'text':t('Insert'===_0x4398da?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case i['OneDrive']:return{'text':t('Insert'===_0x4398da?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x5bd9ac;}}class e extends _0x4f1a6a{['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 _0x382d5e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3ca831;for(const _0x1d5085 in _0x382d5e){const _0x32dcf9=_0x1d5085,_0x449f74=_0x382d5e[_0x32dcf9];if('uploadcareLicenseKeyValid'==_0x449f74||'uploadcareLicenseKeyInvalid'==_0x449f74||'uploadcareLicenseKeyExpired'==_0x449f74||'uploadcareLicenseKeyDomainLimit'==_0x449f74||'uploadcareLicenseKeyNotAllowed'==_0x449f74||'uploadcareLicenseKeyEvaluationLimit'==_0x449f74||'uploadcareLicenseKeyUsageLimit'==_0x449f74){delete _0x382d5e[_0x32dcf9],_0x3ca831=_0x449f74,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x3ca831&&_0x382d5e['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x3ca831&&_0x382d5e['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x3ca831&&_0x382d5e['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x3ca831&&_0x382d5e['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x3ca831&&_0x382d5e['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x3ca831&&_0x382d5e['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x4a46b1}=this,_0xd0ab9a=_0x4a46b1['commands']['get']('uploadcare');if(!_0xd0ab9a)return;const _0x1f4ffa=this['_normalizeConfigSourceList'](_0x4a46b1['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x2c311a,_0x434896)=>{const _0x180822=this['_getIntegrationKey'](_0x434896['type']);return _0x2c311a[_0x180822]||(_0x2c311a[_0x180822]=[]),_0x2c311a[_0x180822]['push'](_0x434896),_0x2c311a;},{});_0x4a46b1['plugins']['has']('ImageInsertUI')&&_0x4a46b1['commands']['get']('uploadcare')&&Object['entries'](_0x1f4ffa)['forEach'](([_0x39fe43,_0x5a1745])=>{_0x4a46b1['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x39fe43,'observable':()=>_0xd0ab9a,'buttonViewCreator':()=>this['_createToolbarButton'](_0x5a1745),'formViewCreator':()=>this['_createDropdownButtons'](_0x5a1745),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x5a1745),'override':'assetManager'!==_0x39fe43});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x49af99){const {locale:_0x568fb9}=this['editor'];return _0x49af99['map'](_0x1b1726=>{const _0x3c7b7f=_(_0x568fb9,_0x1b1726,'Insert');switch(_0x1b1726){case i['Local']:return{'icon':_0x36cb66,'type':i['Local'],..._0x3c7b7f};case i['URL']:return{'icon':_0x2295ec,'type':i['URL'],..._0x3c7b7f};case i['Dropbox']:return{'icon':_0xfa4f6b,'type':i['Dropbox'],..._0x3c7b7f};case i['Facebook']:return{'icon':_0x240bae,'type':i['Facebook'],..._0x3c7b7f};case i['GDrive']:return{'icon':_0x5c3837,'type':i['GDrive'],..._0x3c7b7f};case i['GPhotos']:return{'icon':_0x4fa165,'type':i['GPhotos'],..._0x3c7b7f};case i['OneDrive']:return{'icon':_0x57a3ad,'type':i['OneDrive'],..._0x3c7b7f};}});}['_getIntegrationKey'](_0x4af945){switch(_0x4af945){case i['Local']:return'upload';case i['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x4cb7de,_0x4f6c5c){const _0x3d0699=this['editor'],_0x28390e=new _0x4cb7de(_0x3d0699['locale']),_0x1a4b35=_0x3d0699['commands']['get']('uploadcare');return _0x28390e['bind']('isEnabled')['to'](_0x1a4b35),_0x28390e['on']('execute',()=>{_0x1a4b35['execute'](_0x4f6c5c);}),_0x28390e;}['_createToolbarButton'](_0x2a76d2){const {locale:_0x44ac60}=this['editor'],_0x3f04a0=this['editor']['plugins']['get']('ImageInsertUI'),_0x2ab29e=_0x2a76d2[0x0],_0x4ed9c0=this['_createButton'](_0xf03747,_0x2ab29e['type']);return _0x4ed9c0['icon']=_0x2ab29e['icon'],_0x4ed9c0['bind']('label')['to'](_0x3f04a0,'isImageSelected',_0x339e11=>_(_0x44ac60,_0x2ab29e['type'],_0x339e11?'Replace':'Insert')['text']),_0x4ed9c0['tooltip']=!0x0,_0x4ed9c0;}['_createDropdownButtons'](_0x11fd8f){const {locale:_0x85b446}=this['editor'],_0x1f2a5f=this['editor']['plugins']['get']('ImageInsertUI');return _0x11fd8f['map'](_0x421a61=>{const _0x1bde73=this['_createButton'](_0xf03747,_0x421a61['type']);return _0x1bde73['withText']=!0x0,_0x1bde73['icon']=_0x421a61['icon'],_0x1bde73['bind']('label')['to'](_0x1f2a5f,'isImageSelected',_0x1ecfc2=>_(_0x85b446,_0x421a61['type'],_0x1ecfc2?'Replace':'Insert')['text']),_0x1bde73;});}['_createMenuBarButtons'](_0xb10d89){return _0xb10d89['map'](_0x405794=>{const _0x349e37=this['_createButton'](_0x21ca07,_0x405794['type']);return _0x349e37['icon']=_0x405794['icon'],_0x349e37['label']=_0x405794['shortText'],_0x349e37;});}}class V extends _0x3913b3{['focusTracker'];['focusCycler'];constructor(_0x5e6eed){super(_0x5e6eed),this['focusTracker']=new _0x21ef37(),this['focusCycler']=new _0xc0c7ff({'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 S extends V{constructor(_0x5e69b4,_0x7ed64d){super(_0x5e69b4),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-'+_0x7ed64d}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function C(_0x14e156,_0x301b36){const _0x26cf41=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x26c6e8=>_0x26c6e8<=_0x301b36)['map'](_0x5191bf=>_0x14e156['replace'](/\/$/,'')+'/-/resize/'+_0x5191bf+'x/\x20'+_0x5191bf+'w');return{'imageFallbackUrl':_0x14e156,'imageSources':[{'srcset':_0x26cf41['join'](',\x20'),'sizes':'(max-width:\x20'+_0x301b36+'px)\x20100vw,\x20'+_0x301b36+'px','type':'image/webp'}]};}function F(_0x2b70f3,_0x59ca71,_0x526199){const _0x419207=_0x2b70f3['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x419207?parseInt(_0x419207[0x1],0xa):_0x59ca71,'height':_0x419207?parseInt(_0x419207[0x2],0xa):_0x526199};}function p(_0x5ea2e0,_0x36ee3d){const _0x48156b=new(_0x1e7440())(),_0x11627e=_0x5ea2e0['plugins']['get']('ImageUtils'),_0x17e9fe=_0x5ea2e0['editing']['mapper']['toViewElement'](_0x36ee3d),_0x24ea1c=_0x11627e['findViewImgElement'](_0x17e9fe),_0x4bf356=_0x5ea2e0['editing']['view']['domConverter']['viewToDom'](_0x24ea1c),_0x13a08d=_0x36ee3d['getAttribute']('width'),_0x235aa3=_0x36ee3d['getAttribute']('height'),_0x50851e='image-processing';_0x5ea2e0['editing']['view']['change'](_0x45e710=>{_0x45e710['addClass'](_0x50851e,_0x17e9fe),_0x45e710['setStyle']('aspect-ratio',_0x13a08d+'/'+_0x235aa3,_0x24ea1c);}),_0x48156b['listenTo'](_0x4bf356,'load',()=>{_0x48156b['stopListening'](_0x4bf356,'load'),_0x5ea2e0['editing']['view']['change'](_0x5aabb1=>{_0x5aabb1['removeClass'](_0x50851e,_0x17e9fe),_0x5aabb1['removeStyle']('aspect-ratio',_0x24ea1c);});});}function R(_0x412517){if(Array['isArray'](_0x412517)){const _0x1e5906=_0x412517['map'](R);return _0x32e12f=>_0x1e5906['some'](_0x5ccfe5=>_0x5ccfe5(_0x32e12f));}if('origin'==_0x412517){const _0x52764a=_0x36efa3['window']['location']['origin'];return _0x32a787=>new URL(_0x32a787,_0x36efa3['document']['baseURI'])['origin']==_0x52764a;}return'function'==typeof _0x412517?_0x412517:_0x412517 instanceof RegExp?_0x1cd381=>!(!_0x1cd381['match'](_0x412517)&&!_0x1cd381['replace'](/^https?:\/\//,'')['match'](_0x412517)):()=>!0x1;}function M(_0x122ae6,_0x50efc4){return _0x40e4e9(_0x122ae6['target'])['includes'](_0x50efc4);}class n extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x3fa845(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x509114,_0x3f7228,_0x5b5d91){super(),this['_editor']=_0x509114,this['_editing']=_0x3f7228,this['_dialog']=_0x509114['plugins']['get'](_0xa7f385),this['_api']=_0x3f7228['ctxElement']['getAPI'](),this['_type']=_0x5b5d91,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:_0x971811,model:_0x352735}=this['_editor'],_0x25f3a8=_0x352735['document']['selection']['getSelectedElement'](),_0x5c792a=_0x25f3a8&&(_0x25f3a8['is']('element','imageBlock')||_0x25f3a8['is']('element','imageInline'));this['_formView']=new S(_0x971811,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x36cb66,'title':_(_0x971811,this['_type'],_0x5c792a?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x3b0daf['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x5a83bc=>!M(_0x5a83bc,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x4fdffd}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x4b9cca=>{const _0x4d12d9=_0x4fdffd['length'];for(const _0x9b7a27 of _0x4fdffd){const _0x53ce3b=_0x9b7a27===_0x4fdffd[_0x4d12d9-0x1],{cdnUrl:_0x4f8610,fileInfo:_0x57169e}=_0x9b7a27;if(!_0x4f8610||!_0x57169e)continue;const {width:_0x2dcaa5,height:_0x717892}=_0x57169e['imageInfo'],_0x1c1072=F(_0x4f8610,_0x2dcaa5,_0x717892),_0x20ad77=C(_0x4f8610,_0x1c1072['width']),_0x39e7b1={'id':_0x57169e['uuid'],'type':'image','attributes':{'imageDimension':_0x1c1072,..._0x20ad77}};this['_insertAsset'](_0x39e7b1,_0x53ce3b,_0x4b9cca);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x493313=>{'idle'===_0x493313['detail']['status']&&!_0x493313['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===i['Local']?this['_api']['setCurrentActivity'](i['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x491202,_0x1df88b,_0x181638){const _0x54dbd8=this['_editor']['model']['document']['selection'],_0x2aa9e7=_0x54dbd8['getSelectedElement'](),_0x14f817=!(!_0x2aa9e7||!_0x2aa9e7['is']('element','imageInline'));_0x181638['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x491202,_0x14f817),_0x1df88b||_0x181638['setSelection'](_0x54dbd8['getLastPosition']());}['_insertImage'](_0x4f3724,_0x1dfb36){const _0x14de27=this['_editor'],{imageDimension:_0x138a43,imageFallbackUrl:_0x14d740,imageSources:_0xbaaac}=_0x4f3724['attributes'];_0x14de27['execute']('insertImage',{'imageType':_0x1dfb36?'imageInline':null,'source':{'uploadcareImageId':_0x4f3724['id'],'src':_0x14d740,'sources':_0xbaaac,..._0x138a43}});}}class w extends _0x1cb1a2{['_editing'];['_controller']=null;static get['requires'](){return[_0xa7f385,o];}constructor(_0x32d400){super(_0x32d400),this['_editing']=_0x32d400['plugins']['get'](o);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x4c6bf0){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new n(this['editor'],this['_editing'],_0x4c6bf0);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class j{static['upload']({file:_0x21aa95,..._0x476404}){return _0x2a9603(_0x21aa95,_0x476404);}static['getInfo'](_0x15a0d8,_0x394489){return _0x3cdd70(_0x15a0d8,_0x394489);}}class f extends _0x4f1a6a{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x1dfed0,o];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x11f5d3=this['editor'];if(!!!_0x11f5d3['config']['get']('uploadcare'))return;_0x11f5d3['plugins']['get'](_0x1dfed0)['createUploadAdapter']=_0x6dab7c=>new k(_0x6dab7c,_0x11f5d3),_0x11f5d3['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x5916b9,{imageElement:_0x2f41a4,data:_0x5e0627})=>{_0x11f5d3['model']['change'](_0x99999=>{_0x99999['setAttribute']('uploadcareImageId',_0x5e0627['uploadcareImageId'],_0x2f41a4);});});}}class k{['loader'];['editor'];['controller'];constructor(_0x7be448,_0x3d56a1){this['loader']=_0x7be448,this['editor']=_0x3d56a1,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x3bbf79=await this['loader']['file'];return j['upload']({'file':_0x3bbf79,'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':_0x5b4045=>{_0x5b4045&&_0x5b4045['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x5b4045['value']);}})['then'](async _0x437f76=>{const {imageFallbackUrl:_0x34e7f6,imageSources:_0x448f81}=C(_0x437f76['cdnUrl'],_0x437f76['imageInfo']['width']);return{'uploadcareImageId':_0x437f76['uuid'],'default':_0x34e7f6,'sources':_0x448f81};})['catch'](()=>{const _0x5c8dfc=t('Cannot\x20upload\x20file:')+('\x20'+_0x3bbf79['name']+'.');return Promise['reject'](_0x5c8dfc);});}['abort'](){this['controller']['abort']();}}class o extends _0x4f1a6a{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',f,_0xa7f385];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x3fb253){super(_0x3fb253),this['ucContextId']=_0x1c21c3();}['init'](){const _0x227f87=this['editor'];_0x227f87['commands']['add']('uploadcare',new w(_0x227f87));}['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 _0x399b62=_0x36efa3['document']['querySelector']('input[uploadcare-file-input]');_0x399b62&&_0x399b62['remove']();}),async function(_0x49c0ba){const _0x524747=_0x3c7649([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]),_0x315c41=0x535f8c3a,_0x2127bc=0x53580832^_0x315c41,_0x5e6256=window[_0x3c7649([0x44,0x61,0x74,0x65])][_0x3c7649([0x6e,0x6f,0x77])](),_0x2eb20d=_0x49c0ba[_0x3c7649([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4bbda2=new window[(_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x21b576=>{_0x2eb20d[_0x3c7649([0x6f,0x6e,0x63,0x65])](_0x3c7649([0x72,0x65,0x61,0x64,0x79]),_0x21b576);}),_0x3ede2d={[_0x3c7649([0x6b,0x74,0x79])]:_0x3c7649([0x45,0x43]),[_0x3c7649([0x75,0x73,0x65])]:_0x3c7649([0x73,0x69,0x67]),[_0x3c7649([0x63,0x72,0x76])]:_0x3c7649([0x50,0x2d,0x32,0x35,0x36]),[_0x3c7649([0x78])]:_0x3c7649([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]),[_0x3c7649([0x79])]:_0x3c7649([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]),[_0x3c7649([0x61,0x6c,0x67])]:_0x3c7649([0x45,0x53,0x32,0x35,0x36])},_0x20bea5=_0x2eb20d[_0x3c7649([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c7649([0x67,0x65,0x74])](_0x3c7649([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2e56bc(){let _0x1c7126,_0x471a14=null,_0x142ec3=null;try{if(_0x20bea5==_0x3c7649([0x47,0x50,0x4c]))return _0x3c7649([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1c7126=_0x58de9d(),!_0x1c7126)return _0x3c7649([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1c7126[_0x3c7649([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x142ec3=_0x1bc5f3(_0x1c7126[_0x3c7649([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1c7126[_0x3c7649([0x6a,0x74,0x69])])),await _0x174030()?_0xb5b372()?_0x4f803d()?_0x3c7649([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x512f33()?(_0x1c7126[_0x3c7649([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c7649([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x471a14=_0x20671a(_0x3c7649([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x55950f()):_0x3c7649([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c7649([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c7649([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3c7649([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4f803d(){const _0x81ca44=[_0x3c7649([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c7649([0x74,0x72,0x69,0x61,0x6c])][_0x3c7649([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c7126[_0x3c7649([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5e6256/0x3e8:0xe10*_0x2127bc;return _0x1c7126[_0x3c7649([0x65,0x78,0x70])]<_0x81ca44;}function _0xb5b372(){const _0x547ed1=_0x1c7126[_0x3c7649([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x547ed1&&(!!_0x547ed1[_0x3c7649([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c7649([0x2a]))||!!_0x547ed1[_0x3c7649([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c7649([0x55,0x50,0x4c,0x43])));}function _0x512f33(){const _0x42dc1c=_0x1c7126[_0x3c7649([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x42dc1c||0x0==_0x42dc1c[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1b9f98}=new URL(window[_0x3c7649([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x42dc1c[_0x3c7649([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b9f98))return!0x0;const _0x26165a=_0x1b9f98[_0x3c7649([0x73,0x70,0x6c,0x69,0x74])](_0x3c7649([0x2e]));return _0x42dc1c[_0x3c7649([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x217016=>_0x217016[_0x3c7649([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c7649([0x2a])))[_0x3c7649([0x6d,0x61,0x70])](_0x12c3b4=>_0x12c3b4[_0x3c7649([0x73,0x70,0x6c,0x69,0x74])](_0x3c7649([0x2e])))[_0x3c7649([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5595af=>_0x5595af[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x26165a[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c7649([0x6d,0x61,0x70])](_0x2a7e0f=>Array(_0x26165a[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2a7e0f[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c7649([0x66,0x69,0x6c,0x6c])](_0x2a7e0f[0x0]===_0x3c7649([0x2a])?_0x3c7649([0x2a]):'')[_0x3c7649([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2a7e0f))[_0x3c7649([0x73,0x6f,0x6d,0x65])](_0x461664=>_0x26165a[_0x3c7649([0x65,0x76,0x65,0x72,0x79])]((_0x4cc9b6,_0x31d0b8)=>_0x461664[_0x31d0b8]===_0x4cc9b6||_0x461664[_0x31d0b8]===_0x3c7649([0x2a])));}function _0x55950f(){return _0x471a14&&_0x142ec3?new window[(_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x320415,_0x4c6499)=>{_0x471a14[_0x3c7649([0x74,0x68,0x65,0x6e])](_0x320415,_0x4c6499),_0x142ec3[_0x3c7649([0x74,0x68,0x65,0x6e])](_0x404e0f=>{_0x404e0f!=_0x3c7649([0x56,0x61,0x6c,0x69,0x64])&&_0x320415(_0x404e0f);},_0x4c6499);}):_0x471a14||_0x142ec3||_0x3c7649([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1bc5f3(_0x535f7f,_0x4e8105){return new window[(_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5e27ab=>{if(_0x3c63af())return _0x5e27ab(_0x3c7649([0x56,0x61,0x6c,0x69,0x64]));_0x15a1e5(),_0x2eb20d[_0x3c7649([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c7649([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x26d254=!0x1;const _0x1269da=_0x1c21c3();function _0x56adf0(_0x1859a2){return!!_0x1859a2&&(typeof _0x1859a2===_0x3c7649([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1859a2===_0x3c7649([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1859a2[_0x3c7649([0x74,0x68,0x65,0x6e])]===_0x3c7649([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1859a2[_0x3c7649([0x63,0x61,0x74,0x63,0x68])]===_0x3c7649([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2cc4a3(_0x302b6e){_0x5ba905(_0x302b6e)[_0x3c7649([0x74,0x68,0x65,0x6e])](_0x24d4b5=>{if(!_0x24d4b5||_0x24d4b5[_0x3c7649([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c7649([0x6f,0x6b]))return _0x3c7649([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x47ee2b(_0x1ee3cd(_0x1269da+_0x4e8105))!=_0x24d4b5[_0x3c7649([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c7649([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c7649([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c7649([0x74,0x68,0x65,0x6e])](_0x1461c6=>(_0x3c209f(),_0x1461c6),()=>{const _0x24b29d=_0xb3f7db();return null==_0x24b29d?(_0x3c209f(),_0x3c7649([0x56,0x61,0x6c,0x69,0x64])):_0x3c7649(_0x5e6256-_0x24b29d>(0x7753083a^_0x315c41)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c7649([0x74,0x68,0x65,0x6e])](_0x5e27ab)[_0x3c7649([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5e27ab(_0x3c7649([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3e6179=0x536962ba^_0x315c41;function _0x3c209f(){const _0x186be6=_0x3c7649([0x6c,0x6c,0x63,0x74,0x2d])+_0x47ee2b(_0x1ee3cd(_0x535f7f)),_0x1725bf=_0x20c9a7(_0x47ee2b(window[_0x3c7649([0x4d,0x61,0x74,0x68])][_0x3c7649([0x63,0x65,0x69,0x6c])](_0x5e6256/_0x3e6179)));window[_0x3c7649([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c7649([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x186be6,_0x1725bf);}function _0xb3f7db(){const _0x5248dc=_0x3c7649([0x6c,0x6c,0x63,0x74,0x2d])+_0x47ee2b(_0x1ee3cd(_0x535f7f)),_0x45d3a0=window[_0x3c7649([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c7649([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5248dc);return _0x45d3a0?window[_0x3c7649([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x20c9a7(_0x45d3a0),0x10)*_0x3e6179:null;}function _0x5ba905(_0x3630df){return new window[(_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x54a849,_0x4dfc8e)=>{_0x3630df[_0x3c7649([0x74,0x68,0x65,0x6e])](_0x54a849,_0x4dfc8e),window[_0x3c7649([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4dfc8e,0x535e58fa^_0x315c41);});}}_0x2eb20d[_0x3c7649([0x6f,0x6e])](_0x3c7649([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x59c58c,_0x312206)=>{if(_0x312206[0x0]!=_0x535f7f)return _0x5e27ab(_0x3c7649([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x312206[0x1]={..._0x312206[0x1],[_0x3c7649([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1269da};},{[_0x3c7649([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c7649([0x68,0x69,0x67,0x68])}),_0x2eb20d[_0x3c7649([0x6f,0x6e])](_0x3c7649([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4f524f=>{_0x56adf0(_0x4f524f[_0x3c7649([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x26d254=!0x0,_0x2cc4a3(_0x4f524f[_0x3c7649([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c7649([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c7649([0x6c,0x6f,0x77])}),_0x4bbda2[_0x3c7649([0x74,0x68,0x65,0x6e])](()=>{_0x26d254||_0x5e27ab(_0x3c7649([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3c63af(){return _0x2eb20d[_0x3c7649([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c7649([0x76,0x69,0x65,0x77])][_0x3c7649([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c7649([0x61,0x75,0x74,0x6f]);}function _0x15a1e5(){_0x2eb20d[_0x3c7649([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c7649([0x76,0x69,0x65,0x77])][_0x3c7649([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c7649([0x61,0x75,0x74,0x6f]);}}function _0x20671a(_0x3d7350){const _0x5b076d=[new window[(_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2d4e12=>setTimeout(_0x2d4e12,0x5356b2f6^_0x315c41)),_0x4bbda2[_0x3c7649([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5a043b=>{let _0x52a4e7=0x0;_0x2eb20d[_0x3c7649([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c7649([0x6f,0x6e])](_0x3c7649([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2d96da,_0x56a97a)=>{_0x56a97a[0x0][_0x3c7649([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x52a4e7++,_0x52a4e7==(0x535f89d2^_0x315c41)&&(_0x5a043b(),_0x2d96da[_0x3c7649([0x6f,0x66,0x66])]());});}))];return window[_0x3c7649([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c7649([0x72,0x61,0x63,0x65])](_0x5b076d)[_0x3c7649([0x74,0x68,0x65,0x6e])](()=>_0x3d7350);}async function _0x578214(){await _0x4bbda2,_0x2eb20d[_0x3c7649([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c7649([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x69eaad,_0x2eb20d[_0x3c7649([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c7649([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x69eaad,_0x2eb20d[_0x3c7649([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c7649([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x114d73(_0x344ebd){const _0x445aed=_0x5e9747();_0x2eb20d[_0x445aed]=_0x3c7649([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x344ebd,_0x344ebd!=_0x3c7649([0x56,0x61,0x6c,0x69,0x64])&&_0x578214();}function _0x5e9747(){const _0x469967=window[_0x3c7649([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c7649([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c7649([0x6e,0x6f,0x77])]())[_0x3c7649([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c7649([0x2e]),'');let _0x2ff5bb=_0x3c7649([0x68]);for(let _0x4d7176=0x0;_0x4d7176<_0x469967[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4d7176+=0x2){let _0x5a9c08=window[_0x3c7649([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x469967[_0x3c7649([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4d7176,_0x4d7176+0x2));_0x5a9c08>=_0x524747[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5a9c08-=_0x524747[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2ff5bb+=_0x524747[_0x5a9c08];}return _0x2ff5bb;}function _0x58de9d(){const _0x177b35=_0x20bea5[_0x3c7649([0x73,0x70,0x6c,0x69,0x74])](_0x3c7649([0x2e]));if(0x3!=_0x177b35[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x229bcc(_0x177b35[0x1]);function _0x229bcc(_0x361093){const _0x533805=_0x329cd1(_0x361093);return _0x533805&&_0x481520()?_0x533805:null;function _0x481520(){const _0x5e7a4a=_0x533805[_0x3c7649([0x6a,0x74,0x69])],_0x1f7ca6=window[_0x3c7649([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5e7a4a[_0x3c7649([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5e7a4a[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5bae4d={..._0x533805,[_0x3c7649([0x6a,0x74,0x69])]:_0x5e7a4a[_0x3c7649([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5e7a4a[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5bae4d[_0x3c7649([0x76,0x63])],_0x1ee3cd(_0x5bae4d)==_0x1f7ca6;}}}async function _0x174030(){let _0x15450a=!0x0;try{const _0x396f23=_0x20bea5[_0x3c7649([0x73,0x70,0x6c,0x69,0x74])](_0x3c7649([0x2e])),[_0xc27ce6,_0x3f371c,_0x6c170e]=_0x396f23;return _0x3f074a(_0xc27ce6),await _0x4a4d0e(_0xc27ce6,_0x3f371c,_0x6c170e),_0x15450a;}catch{return!0x1;}function _0x3f074a(_0xb6cd63){const _0x260d19=_0x329cd1(_0xb6cd63);_0x260d19&&_0x260d19[_0x3c7649([0x61,0x6c,0x67])]==_0x3c7649([0x45,0x53,0x32,0x35,0x36])||(_0x15450a=!0x1);}async function _0x4a4d0e(_0x5415b1,_0x1410d9,_0x4cc084){const _0x1ab533=window[_0x3c7649([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c7649([0x66,0x72,0x6f,0x6d])](_0x4f9b62(_0x4cc084),_0x2e873e=>_0x2e873e[_0x3c7649([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x269d4f=new window[(_0x3c7649([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c7649([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5415b1+_0x3c7649([0x2e])+_0x1410d9),_0x5524f1=window[_0x3c7649([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c7649([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5524f1)return;const _0x38408d=await _0x5524f1[_0x3c7649([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c7649([0x6a,0x77,0x6b]),_0x3ede2d,{[_0x3c7649([0x6e,0x61,0x6d,0x65])]:_0x3c7649([0x45,0x43,0x44,0x53,0x41]),[_0x3c7649([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c7649([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c7649([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5524f1[_0x3c7649([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c7649([0x6e,0x61,0x6d,0x65])]:_0x3c7649([0x45,0x43,0x44,0x53,0x41]),[_0x3c7649([0x68,0x61,0x73,0x68])]:{[_0x3c7649([0x6e,0x61,0x6d,0x65])]:_0x3c7649([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x38408d,_0x1ab533,_0x269d4f)||(_0x15450a=!0x1);}}function _0x329cd1(_0x116add){return _0x116add[_0x3c7649([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c7649([0x65,0x79]))?JSON[_0x3c7649([0x70,0x61,0x72,0x73,0x65])](_0x4f9b62(_0x116add)):null;}function _0x4f9b62(_0x3c3fc7){return window[_0x3c7649([0x61,0x74,0x6f,0x62])](_0x3c3fc7[_0x3c7649([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c7649([0x2b]))[_0x3c7649([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c7649([0x2f])));}function _0x1ee3cd(_0x38bad2){let _0x3282b0=0x1505;function _0x43eac1(_0x4bb09f){for(let _0x21fc75=0x0;_0x21fc75<_0x4bb09f[_0x3c7649([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x21fc75++){const _0x241f31=_0x4bb09f[_0x3c7649([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x21fc75);_0x3282b0=(_0x3282b0<<0x5)+_0x3282b0+_0x241f31,_0x3282b0&=_0x3282b0;}}function _0x369c33(_0x1a9f77){Array[_0x3c7649([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1a9f77)?_0x1a9f77[_0x3c7649([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x369c33):_0x1a9f77&&typeof _0x1a9f77==_0x3c7649([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c7649([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1a9f77)[_0x3c7649([0x73,0x6f,0x72,0x74])]()[_0x3c7649([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x259928,_0x39c8fa])=>{_0x43eac1(_0x259928),_0x369c33(_0x39c8fa);}):_0x43eac1(window[_0x3c7649([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1a9f77));}return _0x369c33(_0x38bad2),_0x3282b0>>>0x0;}function _0x47ee2b(_0x189b4d){return _0x189b4d[_0x3c7649([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c7649([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c7649([0x30]));}function _0x20c9a7(_0x366f02){return _0x366f02[_0x3c7649([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c7649([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c7649([0x6a,0x6f,0x69,0x6e])]('');}function _0x69eaad(){}function _0x3c7649(_0x47b8e3){return _0x47b8e3['map'](_0x13c028=>String['fromCharCode'](_0x13c028))['join']('');}_0x114d73(await _0x2e56bc());}(this);}['_initSchema'](){const _0x5222e5=this['editor']['model']['schema'];_0x5222e5['isRegistered']('imageBlock')&&_0x5222e5['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x5222e5['isRegistered']('imageInline')&&_0x5222e5['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x2c776c=this['editor'];_0x2c776c['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x2c776c['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x188482=>_0x188482['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x19c475=_0x2c776c['commands']['get']('replaceImageSource');_0x19c475&&this['listenTo'](_0x19c475,'cleanupImage',(_0x5d0e70,[_0xf3422a,_0x5361fc])=>{_0xf3422a['removeAttribute']('uploadcareImageId',_0x5361fc);});}['_initConfig'](){const _0x360e47=this['editor']['config']['get']('uploadcare.uploader')||{},_0xe30580=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x390ae4(_0x36efa3['document'],'uc-config',{..._0x360e47,'pubkey':_0xe30580,'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']=_0x16ab53=>{if('closeMax'==_0x16ab53)return'#uc-icon-arrow-down';},_0x36efa3['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x390ae4(_0x36efa3['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x36efa3['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x5b77dc=this['editor']['commands']['get']('insertImage');_0x5b77dc&&this['listenTo'](_0x5b77dc,'execute',()=>{const _0x49244b=this['editor']['model']['document']['selection']['getSelectedElement']();_0x49244b&&_0x49244b['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x49244b);});});const _0x113553=this['editor']['commands']['get']('uploadcareImageReplace');_0x113553&&this['listenTo'](_0x113553,'execute',()=>{const _0x48a281=this['editor']['model']['document']['selection']['getSelectedElement']();_0x48a281&&_0x48a281['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x48a281);});});}}class tt extends _0x4f1a6a{static get['requires'](){return[o,e];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x18af15){super(_0x18af15),_0x18af15['config']['define']('uploadcare.uploader.sourceList',[i['Local'],i['URL']]),_0x1cd729['defineComponents'](_0x1cd729),this['_defineLocale']();}['_defineLocale'](){const _0x43f843=this['editor']['config']['get']('uploadcare.locale'),_0x381fe8=this['editor']['locale']['contentLanguage'];_0x43f843&&_0x1cd729['defineLocale'](_0x381fe8,_0x43f843);}}class ii extends _0x3913b3{constructor(_0x4cd83b){super(_0x4cd83b);const t=_0x4cd83b['t'],_0x31d115=this['bindTemplate'],_0x4da88f=new _0x4ff9e7();_0x4da88f['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':[_0x4da88f,{'text':_0x31d115['to']('imageUploadProgress',_0xfb9bc9=>t('Loading\x20image...')+'\x20('+(_0xfb9bc9||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 ti extends _0x3913b3{constructor(_0x1ba4d9){super(_0x1ba4d9);const t=_0x1ba4d9['t'];this['set']('errorType',null);const _0x40f94a=new _0xf03747(_0x1ba4d9);_0x40f94a['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x40f94a['withText']=!0x0,_0x40f94a['class']='ck-button-action',_0x40f94a['on']('execute',()=>{this['fire']('retry');}),_0x40f94a['bind']('isVisible')['to'](this,'errorType',_0x3ab0b9=>'NotFound'!==_0x3ab0b9);const _0x15f3ee=new _0x379f97();_0x15f3ee['content']=_0x336bb5,_0x15f3ee['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x305d4d=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':[_0x15f3ee,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x305d4d['to']('errorType',_0x25dc1a=>t('NotFound'!==_0x25dc1a?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x40f94a]},{'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 ei extends _0x3913b3{constructor(_0x5ed20e,_0x39c9f0){super(_0x5ed20e);const _0x3860a8=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x39c9f0,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x3860a8['to']('imageSrc')}});}}class X extends V{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x3d3bc1,_0x901d6d,_0x1aa752){super(_0x3d3bc1),this['_items']=this['createCollection'](),this['_loadingView']=new ii(_0x3d3bc1),this['_errorView']=new ti(_0x3d3bc1),this['_editingView']=new ei(_0x3d3bc1,_0x1aa752),this['_focusableView']=new _0x3913b3(_0x3d3bc1),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x901d6d),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'],_0x820e09=>{this['_addUploadcareImageEditorListeners'](_0x820e09);});}),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'](_0x33d7bf,_0xec3d7b){const _0x1f5839='uc-cloud-image-editor',_0x464f3a=_0x33d7bf['querySelector'](_0x1f5839);if(_0x464f3a)return _0xec3d7b(_0x464f3a);const _0x2984c5=new MutationObserver(_0x547921=>{const _0x316a6c=_0x547921['filter'](_0xedadba=>_0xedadba['target']===_0x33d7bf&&_0xedadba['addedNodes']['length']>0x0&&_0xedadba['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x1f5839);_0x316a6c['length']&&(_0x2984c5['disconnect'](),_0xec3d7b(_0x316a6c[0x0]['addedNodes'][0x0]));});_0x2984c5['observe'](_0x33d7bf,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x220615){_0x220615['addEventListener']('apply',_0x3bd744=>{this['fire']('apply',{'imageSrc':_0x3bd744['detail']['cdnUrl']});}),_0x220615['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class E extends/* #__PURE__ -- @preserve */
|
|
25
|
-
_0x3fa845(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x58247a,_0x1f928c,_0x49b64b){super(),this['_editor']=_0x58247a,this['_dialog']=_0x1f928c,this['_imageElement']=_0x49b64b,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 _0x5c977c=this['_imageElement'],_0x7f316=_0x5c977c['getAttribute']('uploadcareImageId'),_0x2cbf21=_0x5c977c['getAttribute']('src');if(_0x7f316)await this['_loadImageInfo'](_0x7f316,_0x2cbf21);else{if(this['_imageCache']['has'](_0x2cbf21)){const _0x1c8df3=this['_imageCache']['get'](_0x2cbf21);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x1c8df3['url'],this['imageDimension']=_0x1c8df3['dimension'],this['imageId']=_0x1c8df3['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x445380}=this['_editor'],t=_0x445380['t'],_0xe9995a=new X(_0x445380,this['imageStatus'],this['_attributes']);_0xe9995a['bind']('status')['to'](this,'imageStatus'),_0xe9995a['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0xe9995a['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0xe9995a['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0xe9995a,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x3c0aa3,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0xe9995a,'position':_0x3b0daf['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0xe9995a['focus']();},'onHide':()=>{_0xe9995a['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x2e5b20=>!M(_0x2e5b20,_0xe9995a['element'])}});}['_loadImageInfo'](_0x23c347,_0x4c14a1){return j['getInfo'](_0x23c347,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x90e431=>{const {width:_0x1814cd,height:_0x939fa1}=_0x90e431['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x4c14a1,this['imageDimension']={'width':_0x1814cd,'height':_0x939fa1},this['imageId']=_0x23c347;})['catch'](_0x283882=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x283882['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x4c1457,_0xbc53f1){return this['_getImageAsFile'](_0x4c1457)['then'](_0x14b527=>j['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0xbc53f1['signal'],'file':_0x14b527,'onProgress':_0x44ab3e=>{_0x44ab3e&&_0x44ab3e['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x44ab3e['value']));}}))['then'](_0x4c9d96=>{const {width:_0x25eb90,height:_0xed662e}=_0x4c9d96['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x4c9d96['cdnUrl'],this['imageDimension']={'width':_0x25eb90,'height':_0xed662e},this['imageId']=_0x4c9d96['uuid'],this['imageUploadProgress']=null;const _0x31764c=_0x4c1457['getAttribute']('src');this['_imageCache']['set'](_0x31764c,{'id':_0x4c9d96['uuid'],'url':_0x4c9d96['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0xd98bf=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0xd98bf['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x109187,_0x2f49f3){_0x109187['on']('apply',(_0x3135fd,_0x5e17a0)=>{this['_replaceImage'](_0x2f49f3,_0x5e17a0['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x109187['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x109187['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x1f11d2,_0x5c4bf2,_0x3260dc){const _0x53fe5a=this['_editor'],{width:_0x112db6,height:_0x2c7a29}=F(_0x5c4bf2,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x2a5b17,imageSources:_0x124a2c}=C(_0x5c4bf2,_0x112db6);_0x53fe5a['model']['change'](_0x36f609=>{if('$graveyard'===_0x1f11d2['root']['rootName']){_0x53fe5a['execute']('insertImage',{'imageType':_0x1f11d2['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x1f11d2['getAttributes']()),'uploadcareImageId':_0x3260dc,'src':_0x2a5b17,'sources':_0x124a2c,'width':_0x112db6,'height':_0x2c7a29}});const _0x3e6a5a=_0x1f11d2['getChildren']();_0x1f11d2=_0x53fe5a['model']['document']['selection']['getSelectedElement']();for(const _0x3c4e30 of _0x3e6a5a)_0x36f609['append'](_0x36f609['cloneElement'](_0x3c4e30),_0x1f11d2);}else _0x36f609['setSelection'](_0x1f11d2,'on'),_0x53fe5a['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x1f11d2['getAttributes']()),'uploadcareImageId':_0x3260dc,'src':_0x2a5b17,'sources':_0x124a2c,'width':_0x112db6,'height':_0x2c7a29},_0x1f11d2);_0x36f609['setSelection'](_0x1f11d2,'on');});}async['_getImageAsFile'](_0x5a5a0a){const _0x5712fa=_0x36efa3['window'],_0x4f33c0=_0x36efa3['document']['location']['href'],_0x10579b=new _0x5712fa['URL'](_0x5a5a0a['getAttribute']('src'),_0x4f33c0);if('data:'===_0x10579b['protocol']){const _0xe754fc=_0x10579b['href']['split'](','),_0x35ee4f=_0xe754fc[0x0]['match'](/:(.*?);/)[0x1],_0x1232d7=_0x35ee4f['split']('/')[0x1],_0x42cc84=_0x5712fa['atob'](_0xe754fc[_0xe754fc['length']-0x1]);let _0xafd809=_0x42cc84['length'];const _0x58d2be=new _0x5712fa['Uint8Array'](_0xafd809);for(;_0xafd809--;)_0x58d2be[_0xafd809]=_0x42cc84['charCodeAt'](_0xafd809);return new _0x5712fa['File']([_0x58d2be],'image.'+_0x1232d7,{'type':_0x35ee4f});}const _0x2b0ae6=_0x10579b['href']['split']('/'),_0x985d45=_0x2b0ae6[_0x2b0ae6['length']-0x1],_0x5833f1=_0x985d45['split']('.')[0x1];return _0x5712fa['fetch'](_0x10579b['href'])['then'](_0x35e16b=>_0x35e16b['clone']()['blob']())['then'](_0x246e51=>new _0x5712fa['File']([_0x246e51],_0x985d45,{'type':'image/'+_0x5833f1}));}}class N extends _0x1cb1a2{['imageEditController'];static get['requires'](){return[_0xa7f385];}['_isEditable'];constructor(_0x241535){super(_0x241535),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x208da8){const _0x48d7a6=R(_0x208da8);return _0xb5c5a6=>!(!_0xb5c5a6||!_0xb5c5a6['is']('element','imageBlock')&&!_0xb5c5a6['is']('element','imageInline'))&&(!!_0xb5c5a6['hasAttribute']('uploadcareImageId')||!!_0xb5c5a6['hasAttribute']('src')&&_0x48d7a6(_0xb5c5a6['getAttribute']('src')));}(_0x241535['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x10a7cd=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x10a7cd);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x9cf9c7=this['editor']['model']['document']['selection']['getSelectedElement']();_0x9cf9c7&&(_0x9cf9c7['is']('element','imageBlock')||_0x9cf9c7['is']('element','imageInline'))&&(this['imageEditController']=new E(this['editor'],this['editor']['plugins']['get'](_0xa7f385),_0x9cf9c7),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class O extends _0x1cb1a2{['refresh'](){const _0x4b06c3=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x4b06c3&&(_0x4b06c3['is']('element','imageBlock')||_0x4b06c3['is']('element','imageInline')));}['execute'](_0x31cb83){const _0x1f741b=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x45ec32=>{_0x45ec32['setAttributes'](_0x31cb83,_0x1f741b),_0x45ec32['removeAttribute']('srcset',_0x1f741b),_0x45ec32['removeAttribute']('sizes',_0x1f741b);});}}class m extends _0x4f1a6a{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[o,_0x2d171e,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3e20d7}=this;_0x3e20d7['commands']['add']('uploadcareImageEdit',new N(_0x3e20d7)),_0x3e20d7['commands']['add']('uploadcareImageReplace',new O(_0x3e20d7));}}class g extends _0x4f1a6a{['_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 _0x2473ce=this['editor'];_0x2473ce['ui']['componentFactory']['add']('uploadcareImageEdit',_0x5197bc=>{const _0x40698c=_0x2473ce['commands']['get']('uploadcareImageEdit'),_0x102c78=new _0xf03747(_0x5197bc),t=_0x5197bc['t'];return _0x102c78['set']({'icon':_0x3c0aa3,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x102c78['bind']('isEnabled')['to'](_0x40698c),_0x102c78['bind']('isOn')['to'](_0x40698c,'isActive'),this['listenTo'](_0x102c78,'execute',()=>{_0x2473ce['execute']('uploadcareImageEdit'),_0x2473ce['editing']['view']['focus']();}),_0x102c78;}),this['_initConfig']();}['_initConfig'](){const _0xc83cfe=_0x390ae4(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0xc83cfe),this['listenTo'](this['editor'],'destroy',()=>{_0xc83cfe['remove']();});}}class et extends _0x4f1a6a{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[m,g];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{tt as Uploadcare,w as UploadcareCommand,o as UploadcareEditing,et as UploadcareImageEdit,N as UploadcareImageEditCommand,m as UploadcareImageEditEditing,g as UploadcareImageEditUI,e as UploadcareUI,f as UploadcareUploadAdapter};
|
|
23
|
+
import{Plugin as _0x3d1c8a,Command as _0x542a62}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x5149f1,IconGooglePhotos as _0x142071,IconGoogleDrive as _0x4e4552,IconFacebook as _0x2b9bce,IconDropbox as _0x2a5c50,IconUploadcareLink as _0x1f0e3f,IconUploadcareImageUpload as _0x41731,IconError as _0x4f4e09,IconUploadcareImageEdit as _0x3e0cb7}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x2e9538,MenuBarMenuListItemButtonView as _0x4cdf28,View as _0x362616,FocusCycler as _0x1ae114,Dialog as _0x467de3,DialogViewPosition as _0xff1e95,SpinnerView as _0x56dff4,IconView as _0x118962,Notification as _0x340bb1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0xc0efb7,DomEmitterMixin as _0x2ccfbf,global as _0x2ff8fc,getAncestors as _0x1d5d0d,ObservableMixin as _0x20062d,uid as _0x1c56fd,createElement as _0x34a144}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x3decf3}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x46c8ae,info as _0x3ceabc}from'@uploadcare/upload-client';import*as _0x5a44e1 from'@uploadcare/file-uploader';var i=function(_0x1c9469){return _0x1c9469['Local']='local',_0x1c9469['URL']='url',_0x1c9469['Dropbox']='dropbox',_0x1c9469['GDrive']='gdrive',_0x1c9469['Facebook']='facebook',_0x1c9469['GPhotos']='gphotos',_0x1c9469['OneDrive']='onedrive',_0x1c9469;}({});function _(_0xaad788,_0x4576d5,_0x57021f){const t=_0xaad788['t'],_0x432581=_0xaad788['t'];switch(_0x4576d5){case i['Local']:return{'text':_0x432581('Insert'===_0x57021f?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x432581('From\x20computer')};case i['URL']:return{'text':'Insert'===_0x57021f?_0x432581('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x432581('Via\x20URL')};case i['Dropbox']:return{'text':t('Insert'===_0x57021f?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case i['Facebook']:return{'text':t('Insert'===_0x57021f?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case i['GDrive']:return{'text':t('Insert'===_0x57021f?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case i['GPhotos']:return{'text':t('Insert'===_0x57021f?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case i['OneDrive']:return{'text':t('Insert'===_0x57021f?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x4576d5;}}class e extends _0x3d1c8a{['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 _0x5e4e74=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x58e2a6;for(const _0x17d75d in _0x5e4e74){const _0x5db0a2=_0x17d75d,_0x254499=_0x5e4e74[_0x5db0a2];if('uploadcareLicenseKeyValid'==_0x254499||'uploadcareLicenseKeyInvalid'==_0x254499||'uploadcareLicenseKeyExpired'==_0x254499||'uploadcareLicenseKeyDomainLimit'==_0x254499||'uploadcareLicenseKeyNotAllowed'==_0x254499||'uploadcareLicenseKeyEvaluationLimit'==_0x254499||'uploadcareLicenseKeyUsageLimit'==_0x254499){delete _0x5e4e74[_0x5db0a2],_0x58e2a6=_0x254499,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x58e2a6&&_0x5e4e74['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x58e2a6&&_0x5e4e74['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x58e2a6&&_0x5e4e74['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x58e2a6&&_0x5e4e74['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x58e2a6&&_0x5e4e74['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x58e2a6&&_0x5e4e74['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x3bdd05}=this,_0x15b48b=_0x3bdd05['commands']['get']('uploadcare');if(!_0x15b48b)return;const _0x299af2=this['_normalizeConfigSourceList'](_0x3bdd05['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x11b6fc,_0x3ac180)=>{const _0x24e845=this['_getIntegrationKey'](_0x3ac180['type']);return _0x11b6fc[_0x24e845]||(_0x11b6fc[_0x24e845]=[]),_0x11b6fc[_0x24e845]['push'](_0x3ac180),_0x11b6fc;},{});_0x3bdd05['plugins']['has']('ImageInsertUI')&&_0x3bdd05['commands']['get']('uploadcare')&&Object['entries'](_0x299af2)['forEach'](([_0x5c2775,_0x44ad3b])=>{_0x3bdd05['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x5c2775,'observable':()=>_0x15b48b,'buttonViewCreator':()=>this['_createToolbarButton'](_0x44ad3b),'formViewCreator':()=>this['_createDropdownButtons'](_0x44ad3b),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x44ad3b),'override':'assetManager'!==_0x5c2775});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0xcc9e5c){const {locale:_0x3bf817}=this['editor'];return _0xcc9e5c['map'](_0x1cc0cc=>{const _0x3e5882=_(_0x3bf817,_0x1cc0cc,'Insert');switch(_0x1cc0cc){case i['Local']:return{'icon':_0x41731,'type':i['Local'],..._0x3e5882};case i['URL']:return{'icon':_0x1f0e3f,'type':i['URL'],..._0x3e5882};case i['Dropbox']:return{'icon':_0x2a5c50,'type':i['Dropbox'],..._0x3e5882};case i['Facebook']:return{'icon':_0x2b9bce,'type':i['Facebook'],..._0x3e5882};case i['GDrive']:return{'icon':_0x4e4552,'type':i['GDrive'],..._0x3e5882};case i['GPhotos']:return{'icon':_0x142071,'type':i['GPhotos'],..._0x3e5882};case i['OneDrive']:return{'icon':_0x5149f1,'type':i['OneDrive'],..._0x3e5882};}});}['_getIntegrationKey'](_0xadd13b){switch(_0xadd13b){case i['Local']:return'upload';case i['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x5ada06,_0x4ec5d7){const _0x389bf7=this['editor'],_0x3cb884=new _0x5ada06(_0x389bf7['locale']),_0x41b1cc=_0x389bf7['commands']['get']('uploadcare');return _0x3cb884['bind']('isEnabled')['to'](_0x41b1cc),_0x3cb884['on']('execute',()=>{_0x41b1cc['execute'](_0x4ec5d7);}),_0x3cb884;}['_createToolbarButton'](_0x160e49){const {locale:_0xbb21f1}=this['editor'],_0x5e0ccf=this['editor']['plugins']['get']('ImageInsertUI'),_0x353c12=_0x160e49[0x0],_0x4ddc6f=this['_createButton'](_0x2e9538,_0x353c12['type']);return _0x4ddc6f['icon']=_0x353c12['icon'],_0x4ddc6f['bind']('label')['to'](_0x5e0ccf,'isImageSelected',_0x4638d3=>_(_0xbb21f1,_0x353c12['type'],_0x4638d3?'Replace':'Insert')['text']),_0x4ddc6f['tooltip']=!0x0,_0x4ddc6f;}['_createDropdownButtons'](_0x418d1c){const {locale:_0x1d6828}=this['editor'],_0x4f07e7=this['editor']['plugins']['get']('ImageInsertUI');return _0x418d1c['map'](_0x16efab=>{const _0x5f304e=this['_createButton'](_0x2e9538,_0x16efab['type']);return _0x5f304e['withText']=!0x0,_0x5f304e['icon']=_0x16efab['icon'],_0x5f304e['bind']('label')['to'](_0x4f07e7,'isImageSelected',_0x106ecb=>_(_0x1d6828,_0x16efab['type'],_0x106ecb?'Replace':'Insert')['text']),_0x5f304e;});}['_createMenuBarButtons'](_0x528130){return _0x528130['map'](_0x253aec=>{const _0x5a35bd=this['_createButton'](_0x4cdf28,_0x253aec['type']);return _0x5a35bd['icon']=_0x253aec['icon'],_0x5a35bd['label']=_0x253aec['shortText'],_0x5a35bd;});}}class F extends _0x362616{['focusTracker'];['focusCycler'];constructor(_0x1d23a4){super(_0x1d23a4),this['focusTracker']=new _0xc0efb7(),this['focusCycler']=new _0x1ae114({'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 x extends F{constructor(_0x480647,_0x1b2afc){super(_0x480647),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-'+_0x1b2afc}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function C(_0x55fe67,_0x211a94){const _0x3d36d5=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x90d69a=>_0x90d69a<=_0x211a94)['map'](_0x2e8cf6=>_0x55fe67['replace'](/\/$/,'')+'/-/resize/'+_0x2e8cf6+'x/\x20'+_0x2e8cf6+'w');return{'imageFallbackUrl':_0x55fe67,'imageSources':[{'srcset':_0x3d36d5['join'](',\x20'),'sizes':'(max-width:\x20'+_0x211a94+'px)\x20100vw,\x20'+_0x211a94+'px','type':'image/webp'}]};}function S(_0x375821,_0x41ea12,_0x2afe76){const _0x14716c=_0x375821['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x14716c?parseInt(_0x14716c[0x1],0xa):_0x41ea12,'height':_0x14716c?parseInt(_0x14716c[0x2],0xa):_0x2afe76};}function p(_0x1fa7ef,_0x5c59cb){const _0x1e4692=new(_0x2ccfbf())(),_0x1ed664=_0x1fa7ef['plugins']['get']('ImageUtils'),_0x47fd55=_0x1fa7ef['editing']['mapper']['toViewElement'](_0x5c59cb),_0xc35c8=_0x1ed664['findViewImgElement'](_0x47fd55),_0x10869d=_0x1fa7ef['editing']['view']['domConverter']['viewToDom'](_0xc35c8),_0x1e29f0=_0x5c59cb['getAttribute']('width'),_0x53971f=_0x5c59cb['getAttribute']('height'),_0xc6a7d7='image-processing';_0x1fa7ef['editing']['view']['change'](_0x554467=>{_0x554467['addClass'](_0xc6a7d7,_0x47fd55),_0x554467['setStyle']('aspect-ratio',_0x1e29f0+'/'+_0x53971f,_0xc35c8);}),_0x1e4692['listenTo'](_0x10869d,'load',()=>{_0x1e4692['stopListening'](_0x10869d,'load'),_0x1fa7ef['editing']['view']['change'](_0x28ca7b=>{_0x28ca7b['removeClass'](_0xc6a7d7,_0x47fd55),_0x28ca7b['removeStyle']('aspect-ratio',_0xc35c8);});});}function z(_0x37839a){if(Array['isArray'](_0x37839a)){const _0x55e7b1=_0x37839a['map'](z);return _0x492277=>_0x55e7b1['some'](_0xfcb83a=>_0xfcb83a(_0x492277));}if('origin'==_0x37839a){const _0x1e3e06=_0x2ff8fc['window']['location']['origin'];return _0x8bb966=>new URL(_0x8bb966,_0x2ff8fc['document']['baseURI'])['origin']==_0x1e3e06;}return'function'==typeof _0x37839a?_0x37839a:_0x37839a instanceof RegExp?_0x2e015e=>!(!_0x2e015e['match'](_0x37839a)&&!_0x2e015e['replace'](/^https?:\/\//,'')['match'](_0x37839a)):()=>!0x1;}function A(_0x1cb493,_0xe4e490){return _0x1d5d0d(_0x1cb493['target'])['includes'](_0xe4e490);}class n extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x20062d(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x15e747,_0x2957c2,_0x10b68e){super(),this['_editor']=_0x15e747,this['_editing']=_0x2957c2,this['_dialog']=_0x15e747['plugins']['get'](_0x467de3),this['_api']=_0x2957c2['ctxElement']['getAPI'](),this['_type']=_0x10b68e,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:_0x5779d9,model:_0x735b7}=this['_editor'],_0x1ef2f8=_0x735b7['document']['selection']['getSelectedElement'](),_0x402ec2=_0x1ef2f8&&(_0x1ef2f8['is']('element','imageBlock')||_0x1ef2f8['is']('element','imageInline'));this['_formView']=new x(_0x5779d9,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x41731,'title':_(_0x5779d9,this['_type'],_0x402ec2?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0xff1e95['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x10cb19=>!A(_0x10cb19,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x311bfd}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x46f842=>{const _0x3ec7c9=_0x311bfd['length'];for(const _0x555541 of _0x311bfd){const _0x2a0933=_0x555541===_0x311bfd[_0x3ec7c9-0x1],{cdnUrl:_0x173d65,fileInfo:_0x146bea}=_0x555541;if(!_0x173d65||!_0x146bea)continue;const {width:_0x11b64d,height:_0x40788c}=_0x146bea['imageInfo'],_0x36908b=S(_0x173d65,_0x11b64d,_0x40788c),_0x440089=C(_0x173d65,_0x36908b['width']),_0x105bdf={'id':_0x146bea['uuid'],'type':'image','attributes':{'imageDimension':_0x36908b,..._0x440089}};this['_insertAsset'](_0x105bdf,_0x2a0933,_0x46f842);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x485b9a=>{'idle'===_0x485b9a['detail']['status']&&!_0x485b9a['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===i['Local']?this['_api']['setCurrentActivity'](i['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x1a7bf6,_0x1ceab4,_0x3b3cc5){const _0x3d2b9c=this['_editor']['model']['document']['selection'],_0x54532c=_0x3d2b9c['getSelectedElement'](),_0x16c2b4=!(!_0x54532c||!_0x54532c['is']('element','imageInline'));_0x3b3cc5['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x1a7bf6,_0x16c2b4),_0x1ceab4||_0x3b3cc5['setSelection'](_0x3d2b9c['getLastPosition']());}['_insertImage'](_0x285c77,_0x397389){const _0x404809=this['_editor'],{imageDimension:_0x287c88,imageFallbackUrl:_0x12fff7,imageSources:_0x869eae}=_0x285c77['attributes'];_0x404809['execute']('insertImage',{'imageType':_0x397389?'imageInline':null,'source':{'uploadcareImageId':_0x285c77['id'],'src':_0x12fff7,'sources':_0x869eae,..._0x287c88}});}}class w extends _0x542a62{['_editing'];['_controller']=null;static get['requires'](){return[_0x467de3,o];}constructor(_0x2bd12b){super(_0x2bd12b),this['_editing']=_0x2bd12b['plugins']['get'](o);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x1d1681){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new n(this['editor'],this['_editing'],_0x1d1681);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class j{static['upload']({file:_0x2785da,..._0x296396}){return _0x46c8ae(_0x2785da,_0x296396);}static['getInfo'](_0x233b6c,_0x274b27){return _0x3ceabc(_0x233b6c,_0x274b27);}}class f extends _0x3d1c8a{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x3decf3,o];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x57b781=this['editor'];if(!!!_0x57b781['config']['get']('uploadcare'))return;_0x57b781['plugins']['get'](_0x3decf3)['createUploadAdapter']=_0x2c1589=>new k(_0x2c1589,_0x57b781),_0x57b781['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x317ad3,{imageElement:_0x2861c7,data:_0xa44e2e})=>{_0x57b781['model']['change'](_0x4e2c87=>{_0x4e2c87['setAttribute']('uploadcareImageId',_0xa44e2e['uploadcareImageId'],_0x2861c7);});});}}class k{['loader'];['editor'];['controller'];constructor(_0x15c515,_0x1928a0){this['loader']=_0x15c515,this['editor']=_0x1928a0,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x14a040=await this['loader']['file'];return j['upload']({'file':_0x14a040,'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':_0x3456c1=>{_0x3456c1&&_0x3456c1['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x3456c1['value']);}})['then'](async _0x5cd070=>{const {imageFallbackUrl:_0x2f1449,imageSources:_0x4cd2ef}=C(_0x5cd070['cdnUrl'],_0x5cd070['imageInfo']['width']);return{'uploadcareImageId':_0x5cd070['uuid'],'default':_0x2f1449,'sources':_0x4cd2ef};})['catch'](()=>{const _0x2ab32a=t('Cannot\x20upload\x20file:')+('\x20'+_0x14a040['name']+'.');return Promise['reject'](_0x2ab32a);});}['abort'](){this['controller']['abort']();}}class o extends _0x3d1c8a{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',f,_0x467de3];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x3fc691){super(_0x3fc691),this['ucContextId']=_0x1c56fd();}['init'](){const _0x173f9f=this['editor'];_0x173f9f['commands']['add']('uploadcare',new w(_0x173f9f));}['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 _0x94cf3=_0x2ff8fc['document']['querySelector']('input[uploadcare-file-input]');_0x94cf3&&_0x94cf3['remove']();}),async function(_0x1638af){const _0x4f46f5=_0x3f93d7([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]),_0x366d77=0x535f8c3a,_0x374fd8=0x53580832^_0x366d77,_0x3e271a=window[_0x3f93d7([0x44,0x61,0x74,0x65])][_0x3f93d7([0x6e,0x6f,0x77])](),_0x5b5633=_0x1638af[_0x3f93d7([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x29bca2=new window[(_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5d2a35=>{_0x5b5633[_0x3f93d7([0x6f,0x6e,0x63,0x65])](_0x3f93d7([0x72,0x65,0x61,0x64,0x79]),_0x5d2a35);}),_0x5a3432={[_0x3f93d7([0x6b,0x74,0x79])]:_0x3f93d7([0x45,0x43]),[_0x3f93d7([0x75,0x73,0x65])]:_0x3f93d7([0x73,0x69,0x67]),[_0x3f93d7([0x63,0x72,0x76])]:_0x3f93d7([0x50,0x2d,0x32,0x35,0x36]),[_0x3f93d7([0x78])]:_0x3f93d7([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]),[_0x3f93d7([0x79])]:_0x3f93d7([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]),[_0x3f93d7([0x61,0x6c,0x67])]:_0x3f93d7([0x45,0x53,0x32,0x35,0x36])},_0x5af38c=_0x5b5633[_0x3f93d7([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3f93d7([0x67,0x65,0x74])](_0x3f93d7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x39ee6c(){let _0xc7cbc8,_0x19359a=null,_0x263752=null;try{if(_0x5af38c==_0x3f93d7([0x47,0x50,0x4c]))return _0x3f93d7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xc7cbc8=_0x3c49f9(),!_0xc7cbc8)return _0x3f93d7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xc7cbc8[_0x3f93d7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x263752=_0x3d0115(_0xc7cbc8[_0x3f93d7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xc7cbc8[_0x3f93d7([0x6a,0x74,0x69])])),await _0x27be64()?_0x25c335()?_0x1b5be6()?_0x3f93d7([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x222cd9()?(_0xc7cbc8[_0x3f93d7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3f93d7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x19359a=_0x160395(_0x3f93d7([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3daabf()):_0x3f93d7([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3f93d7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3f93d7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3f93d7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1b5be6(){const _0x15c8bf=[_0x3f93d7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3f93d7([0x74,0x72,0x69,0x61,0x6c])][_0x3f93d7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xc7cbc8[_0x3f93d7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3e271a/0x3e8:0xe10*_0x374fd8;return _0xc7cbc8[_0x3f93d7([0x65,0x78,0x70])]<_0x15c8bf;}function _0x25c335(){const _0x509ad9=_0xc7cbc8[_0x3f93d7([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x509ad9&&(!!_0x509ad9[_0x3f93d7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3f93d7([0x2a]))||!!_0x509ad9[_0x3f93d7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3f93d7([0x55,0x50,0x4c,0x43])));}function _0x222cd9(){const _0xd6db2=_0xc7cbc8[_0x3f93d7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xd6db2||0x0==_0xd6db2[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4faa04}=new URL(window[_0x3f93d7([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xd6db2[_0x3f93d7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4faa04))return!0x0;const _0x1cada2=_0x4faa04[_0x3f93d7([0x73,0x70,0x6c,0x69,0x74])](_0x3f93d7([0x2e]));return _0xd6db2[_0x3f93d7([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x372160=>_0x372160[_0x3f93d7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3f93d7([0x2a])))[_0x3f93d7([0x6d,0x61,0x70])](_0x2af295=>_0x2af295[_0x3f93d7([0x73,0x70,0x6c,0x69,0x74])](_0x3f93d7([0x2e])))[_0x3f93d7([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xf1e82e=>_0xf1e82e[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1cada2[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3f93d7([0x6d,0x61,0x70])](_0x811609=>Array(_0x1cada2[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x811609[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3f93d7([0x66,0x69,0x6c,0x6c])](_0x811609[0x0]===_0x3f93d7([0x2a])?_0x3f93d7([0x2a]):'')[_0x3f93d7([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x811609))[_0x3f93d7([0x73,0x6f,0x6d,0x65])](_0x16364a=>_0x1cada2[_0x3f93d7([0x65,0x76,0x65,0x72,0x79])]((_0x86970,_0x59f1a6)=>_0x16364a[_0x59f1a6]===_0x86970||_0x16364a[_0x59f1a6]===_0x3f93d7([0x2a])));}function _0x3daabf(){return _0x19359a&&_0x263752?new window[(_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5c6c7a,_0xcffec3)=>{_0x19359a[_0x3f93d7([0x74,0x68,0x65,0x6e])](_0x5c6c7a,_0xcffec3),_0x263752[_0x3f93d7([0x74,0x68,0x65,0x6e])](_0x3276d4=>{_0x3276d4!=_0x3f93d7([0x56,0x61,0x6c,0x69,0x64])&&_0x5c6c7a(_0x3276d4);},_0xcffec3);}):_0x19359a||_0x263752||_0x3f93d7([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3d0115(_0x392864,_0xd561ce){return new window[(_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xa821f4=>{if(_0x212eaf())return _0xa821f4(_0x3f93d7([0x56,0x61,0x6c,0x69,0x64]));_0x40c6fb(),_0x5b5633[_0x3f93d7([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3f93d7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4a9c57=!0x1;const _0x4a8764=_0x1c56fd();function _0x31153f(_0x2d65d0){return!!_0x2d65d0&&(typeof _0x2d65d0===_0x3f93d7([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2d65d0===_0x3f93d7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2d65d0[_0x3f93d7([0x74,0x68,0x65,0x6e])]===_0x3f93d7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2d65d0[_0x3f93d7([0x63,0x61,0x74,0x63,0x68])]===_0x3f93d7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x321ced(_0x2d19ad){_0x491539(_0x2d19ad)[_0x3f93d7([0x74,0x68,0x65,0x6e])](_0xf5e66b=>{if(!_0xf5e66b||_0xf5e66b[_0x3f93d7([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3f93d7([0x6f,0x6b]))return _0x3f93d7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1013c5(_0x99e540(_0x4a8764+_0xd561ce))!=_0xf5e66b[_0x3f93d7([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3f93d7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3f93d7([0x56,0x61,0x6c,0x69,0x64]);})[_0x3f93d7([0x74,0x68,0x65,0x6e])](_0x4ca1f4=>(_0x43aef5(),_0x4ca1f4),()=>{const _0x13fcbd=_0x1ae7e0();return null==_0x13fcbd?(_0x43aef5(),_0x3f93d7([0x56,0x61,0x6c,0x69,0x64])):_0x3f93d7(_0x3e271a-_0x13fcbd>(0x7753083a^_0x366d77)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3f93d7([0x74,0x68,0x65,0x6e])](_0xa821f4)[_0x3f93d7([0x63,0x61,0x74,0x63,0x68])](()=>{_0xa821f4(_0x3f93d7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2bc425=0x536962ba^_0x366d77;function _0x43aef5(){const _0x1d6bd0=_0x3f93d7([0x6c,0x6c,0x63,0x74,0x2d])+_0x1013c5(_0x99e540(_0x392864)),_0x11954e=_0x5da7da(_0x1013c5(window[_0x3f93d7([0x4d,0x61,0x74,0x68])][_0x3f93d7([0x63,0x65,0x69,0x6c])](_0x3e271a/_0x2bc425)));window[_0x3f93d7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3f93d7([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1d6bd0,_0x11954e);}function _0x1ae7e0(){const _0x464a49=_0x3f93d7([0x6c,0x6c,0x63,0x74,0x2d])+_0x1013c5(_0x99e540(_0x392864)),_0x4acadc=window[_0x3f93d7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3f93d7([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x464a49);return _0x4acadc?window[_0x3f93d7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5da7da(_0x4acadc),0x10)*_0x2bc425:null;}function _0x491539(_0x17d219){return new window[(_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x10334f,_0x226796)=>{_0x17d219[_0x3f93d7([0x74,0x68,0x65,0x6e])](_0x10334f,_0x226796),window[_0x3f93d7([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x226796,0x535e58fa^_0x366d77);});}}_0x5b5633[_0x3f93d7([0x6f,0x6e])](_0x3f93d7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5a1def,_0x334a49)=>{if(_0x334a49[0x0]!=_0x392864)return _0xa821f4(_0x3f93d7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x334a49[0x1]={..._0x334a49[0x1],[_0x3f93d7([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4a8764};},{[_0x3f93d7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3f93d7([0x68,0x69,0x67,0x68])}),_0x5b5633[_0x3f93d7([0x6f,0x6e])](_0x3f93d7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5663d9=>{_0x31153f(_0x5663d9[_0x3f93d7([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4a9c57=!0x0,_0x321ced(_0x5663d9[_0x3f93d7([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3f93d7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3f93d7([0x6c,0x6f,0x77])}),_0x29bca2[_0x3f93d7([0x74,0x68,0x65,0x6e])](()=>{_0x4a9c57||_0xa821f4(_0x3f93d7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x212eaf(){return _0x5b5633[_0x3f93d7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3f93d7([0x76,0x69,0x65,0x77])][_0x3f93d7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3f93d7([0x61,0x75,0x74,0x6f]);}function _0x40c6fb(){_0x5b5633[_0x3f93d7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3f93d7([0x76,0x69,0x65,0x77])][_0x3f93d7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3f93d7([0x61,0x75,0x74,0x6f]);}}function _0x160395(_0x394f7a){const _0x146bb8=[new window[(_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x350c60=>setTimeout(_0x350c60,0x5356b2f6^_0x366d77)),_0x29bca2[_0x3f93d7([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2ab765=>{let _0x492455=0x0;_0x5b5633[_0x3f93d7([0x6d,0x6f,0x64,0x65,0x6c])][_0x3f93d7([0x6f,0x6e])](_0x3f93d7([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x87b828,_0x45a04d)=>{_0x45a04d[0x0][_0x3f93d7([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x492455++,_0x492455==(0x535f89d2^_0x366d77)&&(_0x2ab765(),_0x87b828[_0x3f93d7([0x6f,0x66,0x66])]());});}))];return window[_0x3f93d7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3f93d7([0x72,0x61,0x63,0x65])](_0x146bb8)[_0x3f93d7([0x74,0x68,0x65,0x6e])](()=>_0x394f7a);}async function _0x7036fe(){await _0x29bca2,_0x5b5633[_0x3f93d7([0x6d,0x6f,0x64,0x65,0x6c])][_0x3f93d7([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2a5c47,_0x5b5633[_0x3f93d7([0x6d,0x6f,0x64,0x65,0x6c])][_0x3f93d7([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2a5c47,_0x5b5633[_0x3f93d7([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3f93d7([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x51db71(_0x1d524a){const _0x4ffa8b=_0x4083c3();_0x5b5633[_0x4ffa8b]=_0x3f93d7([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1d524a,_0x1d524a!=_0x3f93d7([0x56,0x61,0x6c,0x69,0x64])&&_0x7036fe();}function _0x4083c3(){const _0x2a7e8e=window[_0x3f93d7([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3f93d7([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3f93d7([0x6e,0x6f,0x77])]())[_0x3f93d7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3f93d7([0x2e]),'');let _0x31b179=_0x3f93d7([0x68]);for(let _0xa0f998=0x0;_0xa0f998<_0x2a7e8e[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xa0f998+=0x2){let _0x41680b=window[_0x3f93d7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2a7e8e[_0x3f93d7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xa0f998,_0xa0f998+0x2));_0x41680b>=_0x4f46f5[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x41680b-=_0x4f46f5[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x31b179+=_0x4f46f5[_0x41680b];}return _0x31b179;}function _0x3c49f9(){const _0x2c932a=_0x5af38c[_0x3f93d7([0x73,0x70,0x6c,0x69,0x74])](_0x3f93d7([0x2e]));if(0x3!=_0x2c932a[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3665b1(_0x2c932a[0x1]);function _0x3665b1(_0x17a95b){const _0x5b1d2b=_0x2d7cc3(_0x17a95b);return _0x5b1d2b&&_0x2c09cc()?_0x5b1d2b:null;function _0x2c09cc(){const _0x450b9e=_0x5b1d2b[_0x3f93d7([0x6a,0x74,0x69])],_0x216f95=window[_0x3f93d7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x450b9e[_0x3f93d7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x450b9e[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x50b064={..._0x5b1d2b,[_0x3f93d7([0x6a,0x74,0x69])]:_0x450b9e[_0x3f93d7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x450b9e[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x50b064[_0x3f93d7([0x76,0x63])],_0x99e540(_0x50b064)==_0x216f95;}}}async function _0x27be64(){let _0x4998da=!0x0;try{const _0x220425=_0x5af38c[_0x3f93d7([0x73,0x70,0x6c,0x69,0x74])](_0x3f93d7([0x2e])),[_0x1f590a,_0x28c59e,_0x52ca14]=_0x220425;return _0x1ccbda(_0x1f590a),await _0x532bf0(_0x1f590a,_0x28c59e,_0x52ca14),_0x4998da;}catch{return!0x1;}function _0x1ccbda(_0x3c74e2){const _0x36d4a3=_0x2d7cc3(_0x3c74e2);_0x36d4a3&&_0x36d4a3[_0x3f93d7([0x61,0x6c,0x67])]==_0x3f93d7([0x45,0x53,0x32,0x35,0x36])||(_0x4998da=!0x1);}async function _0x532bf0(_0x3572b9,_0x50d7b9,_0x5710e9){const _0x49175d=window[_0x3f93d7([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3f93d7([0x66,0x72,0x6f,0x6d])](_0x390043(_0x5710e9),_0x42c39d=>_0x42c39d[_0x3f93d7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x16e849=new window[(_0x3f93d7([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3f93d7([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3572b9+_0x3f93d7([0x2e])+_0x50d7b9),_0x146e19=window[_0x3f93d7([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3f93d7([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x146e19)return;const _0x473836=await _0x146e19[_0x3f93d7([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3f93d7([0x6a,0x77,0x6b]),_0x5a3432,{[_0x3f93d7([0x6e,0x61,0x6d,0x65])]:_0x3f93d7([0x45,0x43,0x44,0x53,0x41]),[_0x3f93d7([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3f93d7([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3f93d7([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x146e19[_0x3f93d7([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3f93d7([0x6e,0x61,0x6d,0x65])]:_0x3f93d7([0x45,0x43,0x44,0x53,0x41]),[_0x3f93d7([0x68,0x61,0x73,0x68])]:{[_0x3f93d7([0x6e,0x61,0x6d,0x65])]:_0x3f93d7([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x473836,_0x49175d,_0x16e849)||(_0x4998da=!0x1);}}function _0x2d7cc3(_0x5542e5){return _0x5542e5[_0x3f93d7([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3f93d7([0x65,0x79]))?JSON[_0x3f93d7([0x70,0x61,0x72,0x73,0x65])](_0x390043(_0x5542e5)):null;}function _0x390043(_0x1e327f){return window[_0x3f93d7([0x61,0x74,0x6f,0x62])](_0x1e327f[_0x3f93d7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3f93d7([0x2b]))[_0x3f93d7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3f93d7([0x2f])));}function _0x99e540(_0x1a18fa){let _0x259679=0x1505;function _0x469aee(_0x3600d8){for(let _0x22a9da=0x0;_0x22a9da<_0x3600d8[_0x3f93d7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x22a9da++){const _0x2768c2=_0x3600d8[_0x3f93d7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x22a9da);_0x259679=(_0x259679<<0x5)+_0x259679+_0x2768c2,_0x259679&=_0x259679;}}function _0x20d859(_0x1b549a){Array[_0x3f93d7([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1b549a)?_0x1b549a[_0x3f93d7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x20d859):_0x1b549a&&typeof _0x1b549a==_0x3f93d7([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3f93d7([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1b549a)[_0x3f93d7([0x73,0x6f,0x72,0x74])]()[_0x3f93d7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x204d02,_0x290734])=>{_0x469aee(_0x204d02),_0x20d859(_0x290734);}):_0x469aee(window[_0x3f93d7([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1b549a));}return _0x20d859(_0x1a18fa),_0x259679>>>0x0;}function _0x1013c5(_0x4bf5a3){return _0x4bf5a3[_0x3f93d7([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3f93d7([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3f93d7([0x30]));}function _0x5da7da(_0x4b9f0f){return _0x4b9f0f[_0x3f93d7([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3f93d7([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3f93d7([0x6a,0x6f,0x69,0x6e])]('');}function _0x2a5c47(){}function _0x3f93d7(_0x199466){return _0x199466['map'](_0x247a60=>String['fromCharCode'](_0x247a60))['join']('');}_0x51db71(await _0x39ee6c());}(this);}['_initSchema'](){const _0x3813ff=this['editor']['model']['schema'];_0x3813ff['isRegistered']('imageBlock')&&_0x3813ff['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x3813ff['isRegistered']('imageInline')&&_0x3813ff['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x39f449=this['editor'];_0x39f449['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x39f449['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x2c5f71=>_0x2c5f71['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x30648a=_0x39f449['commands']['get']('replaceImageSource');_0x30648a&&this['listenTo'](_0x30648a,'cleanupImage',(_0x4d956c,[_0x3afc3a,_0x4ff499])=>{_0x3afc3a['removeAttribute']('uploadcareImageId',_0x4ff499);});}['_initConfig'](){const _0x147df2=this['editor']['config']['get']('uploadcare.uploader')||{},_0x2608ba=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x34a144(_0x2ff8fc['document'],'uc-config',{..._0x147df2,'pubkey':_0x2608ba,'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']=_0x522302=>{if('closeMax'==_0x522302)return'#uc-icon-arrow-down';},_0x2ff8fc['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x34a144(_0x2ff8fc['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x2ff8fc['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x44b37e=this['editor']['commands']['get']('insertImage');_0x44b37e&&this['listenTo'](_0x44b37e,'execute',()=>{const _0x132abf=this['editor']['model']['document']['selection']['getSelectedElement']();_0x132abf&&_0x132abf['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x132abf);});});const _0x38b760=this['editor']['commands']['get']('uploadcareImageReplace');_0x38b760&&this['listenTo'](_0x38b760,'execute',()=>{const _0x26300d=this['editor']['model']['document']['selection']['getSelectedElement']();_0x26300d&&_0x26300d['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x26300d);});});}}class tt extends _0x3d1c8a{static get['requires'](){return[o,e];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x20fbb8){super(_0x20fbb8),_0x20fbb8['config']['define']('uploadcare.uploader.sourceList',[i['Local'],i['URL']]),_0x5a44e1['defineComponents'](_0x5a44e1),this['_defineLocale']();}['_defineLocale'](){const _0x47325a=this['editor']['config']['get']('uploadcare.locale'),_0x27f3f7=this['editor']['locale']['contentLanguage'];_0x47325a&&_0x5a44e1['defineLocale'](_0x27f3f7,_0x47325a);}}class ii extends _0x362616{constructor(_0x219805){super(_0x219805);const t=_0x219805['t'],_0x8d6ea5=this['bindTemplate'],_0x483340=new _0x56dff4();_0x483340['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':[_0x483340,{'text':_0x8d6ea5['to']('imageUploadProgress',_0x1967f5=>t('Loading\x20image...')+'\x20('+(_0x1967f5||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 ti extends _0x362616{constructor(_0x2083a4){super(_0x2083a4);const t=_0x2083a4['t'];this['set']('errorType',null);const _0xd9a8a7=new _0x2e9538(_0x2083a4);_0xd9a8a7['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0xd9a8a7['withText']=!0x0,_0xd9a8a7['class']='ck-button-action',_0xd9a8a7['on']('execute',()=>{this['fire']('retry');}),_0xd9a8a7['bind']('isVisible')['to'](this,'errorType',_0x54ae66=>'NotFound'!==_0x54ae66);const _0x4b249e=new _0x118962();_0x4b249e['content']=_0x4f4e09,_0x4b249e['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x3331ed=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':[_0x4b249e,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x3331ed['to']('errorType',_0x45570c=>t('NotFound'!==_0x45570c?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0xd9a8a7]},{'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 ei extends _0x362616{constructor(_0x43e460,_0x2035de){super(_0x43e460);const _0x31c8a1=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x2035de,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x31c8a1['to']('imageSrc')}});}}class X extends F{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x2f6eff,_0x326a65,_0x3151f){super(_0x2f6eff),this['_items']=this['createCollection'](),this['_loadingView']=new ii(_0x2f6eff),this['_errorView']=new ti(_0x2f6eff),this['_editingView']=new ei(_0x2f6eff,_0x3151f),this['_focusableView']=new _0x362616(_0x2f6eff),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x326a65),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'],_0x271248=>{this['_addUploadcareImageEditorListeners'](_0x271248);});}),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'](_0x131a05,_0x3f07c5){const _0x582478='uc-cloud-image-editor',_0x10c06=_0x131a05['querySelector'](_0x582478);if(_0x10c06)return _0x3f07c5(_0x10c06);const _0x419533=new MutationObserver(_0x234b1b=>{const _0x4e9086=_0x234b1b['filter'](_0x12dd5c=>_0x12dd5c['target']===_0x131a05&&_0x12dd5c['addedNodes']['length']>0x0&&_0x12dd5c['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x582478);_0x4e9086['length']&&(_0x419533['disconnect'](),_0x3f07c5(_0x4e9086[0x0]['addedNodes'][0x0]));});_0x419533['observe'](_0x131a05,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x44268f){_0x44268f['addEventListener']('apply',_0x93855b=>{this['fire']('apply',{'imageSrc':_0x93855b['detail']['cdnUrl']});}),_0x44268f['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class N extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x20062d(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x5ac476,_0x548f3e,_0x8aaf2e){super(),this['_editor']=_0x5ac476,this['_dialog']=_0x548f3e,this['_imageElement']=_0x8aaf2e,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 _0x2ae439=this['_imageElement'],_0x2475a1=_0x2ae439['getAttribute']('uploadcareImageId'),_0x295585=_0x2ae439['getAttribute']('src');if(_0x2475a1)await this['_loadImageInfo'](_0x2475a1,_0x295585);else{if(this['_imageCache']['has'](_0x295585)){const _0x23d9c7=this['_imageCache']['get'](_0x295585);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x23d9c7['url'],this['imageDimension']=_0x23d9c7['dimension'],this['imageId']=_0x23d9c7['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x5c1cab}=this['_editor'],t=_0x5c1cab['t'],_0x10b653=new X(_0x5c1cab,this['imageStatus'],this['_attributes']);_0x10b653['bind']('status')['to'](this,'imageStatus'),_0x10b653['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x10b653['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x10b653['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x10b653,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x3e0cb7,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x10b653,'position':_0xff1e95['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x10b653['focus']();},'onHide':()=>{_0x10b653['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x46e6c2=>!A(_0x46e6c2,_0x10b653['element'])}});}['_loadImageInfo'](_0x4de183,_0x3ce0cc){return j['getInfo'](_0x4de183,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x52ae53=>{const {width:_0x42b889,height:_0x37a642}=_0x52ae53['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3ce0cc,this['imageDimension']={'width':_0x42b889,'height':_0x37a642},this['imageId']=_0x4de183;})['catch'](_0x4f1f4b=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x4f1f4b['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x4e219e,_0x258846){return this['_getImageAsFile'](_0x4e219e)['then'](_0x590239=>j['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0x258846['signal'],'file':_0x590239,'onProgress':_0x36f2b6=>{_0x36f2b6&&_0x36f2b6['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x36f2b6['value']));}}))['then'](_0x56d361=>{const {width:_0x2463b2,height:_0x4b6bc8}=_0x56d361['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x56d361['cdnUrl'],this['imageDimension']={'width':_0x2463b2,'height':_0x4b6bc8},this['imageId']=_0x56d361['uuid'],this['imageUploadProgress']=null;const _0x5ebd88=_0x4e219e['getAttribute']('src');this['_imageCache']['set'](_0x5ebd88,{'id':_0x56d361['uuid'],'url':_0x56d361['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x57631f=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x57631f['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x2f6818,_0x39ee5d){_0x2f6818['on']('apply',(_0x22db51,_0x249bd6)=>{this['_replaceImage'](_0x39ee5d,_0x249bd6['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x2f6818['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x2f6818['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x29e3c5,_0x12b887,_0x185eb9){const _0x4d9ca3=this['_editor'],{width:_0x53daf3,height:_0x184245}=S(_0x12b887,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x118386,imageSources:_0x123007}=C(_0x12b887,_0x53daf3);_0x4d9ca3['model']['change'](_0x345313=>{if('$graveyard'===_0x29e3c5['root']['rootName']){_0x4d9ca3['execute']('insertImage',{'imageType':_0x29e3c5['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x29e3c5['getAttributes']()),'uploadcareImageId':_0x185eb9,'src':_0x118386,'sources':_0x123007,'width':_0x53daf3,'height':_0x184245}});const _0x2675ab=_0x29e3c5['getChildren']();_0x29e3c5=_0x4d9ca3['model']['document']['selection']['getSelectedElement']();for(const _0x12bf1a of _0x2675ab)_0x345313['append'](_0x345313['cloneElement'](_0x12bf1a),_0x29e3c5);}else _0x345313['setSelection'](_0x29e3c5,'on'),_0x4d9ca3['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x29e3c5['getAttributes']()),'uploadcareImageId':_0x185eb9,'src':_0x118386,'sources':_0x123007,'width':_0x53daf3,'height':_0x184245},_0x29e3c5);_0x345313['setSelection'](_0x29e3c5,'on');});}async['_getImageAsFile'](_0x96e307){const _0x2e8141=_0x2ff8fc['window'],_0x59f7b3=_0x2ff8fc['document']['location']['href'],_0x2bdfe3=new _0x2e8141['URL'](_0x96e307['getAttribute']('src'),_0x59f7b3);if('data:'===_0x2bdfe3['protocol']){const _0x34a922=_0x2bdfe3['href']['split'](','),_0x2a3931=_0x34a922[0x0]['match'](/:(.*?);/)[0x1],_0x516106=_0x2a3931['split']('/')[0x1],_0x4dd1e9=_0x2e8141['atob'](_0x34a922[_0x34a922['length']-0x1]);let _0x31820b=_0x4dd1e9['length'];const _0x4f0d80=new _0x2e8141['Uint8Array'](_0x31820b);for(;_0x31820b--;)_0x4f0d80[_0x31820b]=_0x4dd1e9['charCodeAt'](_0x31820b);return new _0x2e8141['File']([_0x4f0d80],'image.'+_0x516106,{'type':_0x2a3931});}const _0x368240=_0x2bdfe3['href']['split']('/'),_0x5481cd=_0x368240[_0x368240['length']-0x1],_0x36af8a=_0x5481cd['split']('.')[0x1];return _0x2e8141['fetch'](_0x2bdfe3['href'])['then'](_0x317848=>_0x317848['clone']()['blob']())['then'](_0x443cc9=>new _0x2e8141['File']([_0x443cc9],_0x5481cd,{'type':'image/'+_0x36af8a}));}}class Q extends _0x542a62{['imageEditController'];static get['requires'](){return[_0x467de3];}['_isEditable'];constructor(_0x3e2790){super(_0x3e2790),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x26353a){const _0x26a2c2=z(_0x26353a);return _0x3e38c6=>!(!_0x3e38c6||!_0x3e38c6['is']('element','imageBlock')&&!_0x3e38c6['is']('element','imageInline'))&&(!!_0x3e38c6['hasAttribute']('uploadcareImageId')||!!_0x3e38c6['hasAttribute']('src')&&_0x26a2c2(_0x3e38c6['getAttribute']('src')));}(_0x3e2790['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0xf4e5d2=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0xf4e5d2);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x12df48=this['editor']['model']['document']['selection']['getSelectedElement']();_0x12df48&&(_0x12df48['is']('element','imageBlock')||_0x12df48['is']('element','imageInline'))&&(this['imageEditController']=new N(this['editor'],this['editor']['plugins']['get'](_0x467de3),_0x12df48),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class V extends _0x542a62{['refresh'](){const _0xbf05b3=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0xbf05b3&&(_0xbf05b3['is']('element','imageBlock')||_0xbf05b3['is']('element','imageInline')));}['execute'](_0xe2ddeb){const _0xd4a802=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x4c034f=>{_0x4c034f['setAttributes'](_0xe2ddeb,_0xd4a802),_0x4c034f['removeAttribute']('srcset',_0xd4a802),_0x4c034f['removeAttribute']('sizes',_0xd4a802);});}}class m extends _0x3d1c8a{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[o,_0x340bb1,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c8baa}=this;_0x2c8baa['commands']['add']('uploadcareImageEdit',new Q(_0x2c8baa)),_0x2c8baa['commands']['add']('uploadcareImageReplace',new V(_0x2c8baa));}}class g extends _0x3d1c8a{['_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 _0x3c390b=this['editor'];_0x3c390b['ui']['componentFactory']['add']('uploadcareImageEdit',_0x713b51=>{const _0x2832bd=_0x3c390b['commands']['get']('uploadcareImageEdit'),_0x22da7c=new _0x2e9538(_0x713b51),t=_0x713b51['t'];return _0x22da7c['set']({'icon':_0x3e0cb7,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x22da7c['bind']('isEnabled')['to'](_0x2832bd),_0x22da7c['bind']('isOn')['to'](_0x2832bd,'isActive'),this['listenTo'](_0x22da7c,'execute',()=>{_0x3c390b['execute']('uploadcareImageEdit'),_0x3c390b['editing']['view']['focus']();}),_0x22da7c;}),this['_initConfig']();}['_initConfig'](){const _0x4f998e=_0x34a144(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x4f998e),this['listenTo'](this['editor'],'destroy',()=>{_0x4f998e['remove']();});}}class et extends _0x3d1c8a{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[m,g];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{tt as Uploadcare,w as UploadcareCommand,o as UploadcareEditing,et as UploadcareImageEdit,Q as UploadcareImageEditCommand,m as UploadcareImageEditEditing,g as UploadcareImageEditUI,e as UploadcareUI,f as UploadcareUploadAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-uploadcare",
|
|
3
|
-
"version": "47.6.1
|
|
3
|
+
"version": "47.6.1",
|
|
4
4
|
"description": "Uploadcare feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"framework"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ckeditor/ckeditor5-core": "47.6.1
|
|
27
|
-
"@ckeditor/ckeditor5-icons": "47.6.1
|
|
28
|
-
"@ckeditor/ckeditor5-image": "47.6.1
|
|
29
|
-
"@ckeditor/ckeditor5-theme-lark": "47.6.1
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "47.6.1
|
|
31
|
-
"@ckeditor/ckeditor5-upload": "47.6.1
|
|
32
|
-
"@ckeditor/ckeditor5-utils": "47.6.1
|
|
33
|
-
"ckeditor5": "47.6.1
|
|
26
|
+
"@ckeditor/ckeditor5-core": "47.6.1",
|
|
27
|
+
"@ckeditor/ckeditor5-icons": "47.6.1",
|
|
28
|
+
"@ckeditor/ckeditor5-image": "47.6.1",
|
|
29
|
+
"@ckeditor/ckeditor5-theme-lark": "47.6.1",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "47.6.1",
|
|
31
|
+
"@ckeditor/ckeditor5-upload": "47.6.1",
|
|
32
|
+
"@ckeditor/ckeditor5-utils": "47.6.1",
|
|
33
|
+
"ckeditor5": "47.6.1",
|
|
34
34
|
"@uploadcare/file-uploader": "1.24.5",
|
|
35
35
|
"@uploadcare/upload-client": "6.14.3"
|
|
36
36
|
},
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const _0x1233b8=_0x256d;(function(_0x39728b,_0x514b26){const _0x38c825=_0x256d,_0x3b0570=_0x39728b();while(!![]){try{const _0x349734=parseInt(_0x38c825(0x175))/0x1*(parseInt(_0x38c825(0x15c))/0x2)+parseInt(_0x38c825(0x14b))/0x3*(parseInt(_0x38c825(0x186))/0x4)+parseInt(_0x38c825(0x180))/0x5+parseInt(_0x38c825(0x181))/0x6*(parseInt(_0x38c825(0x155))/0x7)+-parseInt(_0x38c825(0x150))/0x8*(parseInt(_0x38c825(0x14e))/0x9)+parseInt(_0x38c825(0x187))/0xa+parseInt(_0x38c825(0x15f))/0xb*(parseInt(_0x38c825(0x185))/0xc);if(_0x349734===_0x514b26)break;else _0x3b0570['push'](_0x3b0570['shift']());}catch(_0x370777){_0x3b0570['push'](_0x3b0570['shift']());}}}(_0x5060,0xb5a10));import{IconUploadcareImageUpload as _0x1dfdf5}from'ckeditor5/src/icons.js';import{ObservableMixin as _0x363b91}from'ckeditor5/src/utils.js';import{Dialog as _0x4d6831,DialogViewPosition as _0x39d6c9}from'ckeditor5/src/ui.js';import{UploadcareFormView as _0x58d4c4}from'./uploadcareformview.js';import{UploadcareSource as _0x3b2cf6}from'../uploadcareconfig.js';import{getTranslation as _0x33c8fe}from'../utils/common-translations.js';function _0x256d(_0x175689,_0x568c0d){const _0x5060cf=_0x5060();return _0x256d=function(_0x256dbe,_0x56bd88){_0x256dbe=_0x256dbe-0x14b;let _0x2e9dfe=_0x5060cf[_0x256dbe];return _0x2e9dfe;},_0x256d(_0x175689,_0x568c0d);}import{getImageUrls as _0x292965,getImageDimension as _0x2e266f}from'../utils/editingutils.js';function _0x5060(){const _0x32d789=['ucContextId','imageInline','2032455ubvkdr','6KQVFWM','_formView','idle','getAPI','12924TMkzQJ','350344GhVyCE','6158170Mdzxfd','linkHref','imageBlock','destroy','uploadCare','Local','text','_editor','insertImage','_insertAsset','attributes','detail','getSelectedElement','setSelection','editing','getOutputCollectionState','3GiPdev','_initDialog','source-list','455778zgoDWX','change','152duliKO','document','focus','stopListening','setAttribute','829115gFbfYt','EDITOR_TOP_CENTER','allEntries','imageInfo','selection','_editing','get','554978ZFtcSb','setCurrentActivity','initFlow','2046crSMIx','_insertImage','status','Insert','configElement','ctxElement','addEventListener','uuid','_api','removeSelectionAttribute','plugins','width','image','execute','Replace','doneFlow','getLastPosition','removeAllFiles','show','model','length','hide','1nOMQlU','stopDelegating','_initListeners','done-click','isOpen','view','element','_dialog','_type'];_0x5060=function(){return _0x32d789;};return _0x5060();}import{isAncestor as _0xf39a23}from'../utils/isancestor.js';export class UploadcareController extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x363b91(){[_0x1233b8(0x18e)];[_0x1233b8(0x17c)];[_0x1233b8(0x15a)];[_0x1233b8(0x167)];[_0x1233b8(0x17d)]=null;[_0x1233b8(0x182)]=null;constructor(_0x13f354,_0x50aa55,_0x3bc79a){const _0x1ff959=_0x1233b8;super(),this[_0x1ff959(0x18e)]=_0x13f354,this[_0x1ff959(0x15a)]=_0x50aa55,this[_0x1ff959(0x17c)]=_0x13f354[_0x1ff959(0x169)][_0x1ff959(0x15b)](_0x4d6831),this[_0x1ff959(0x167)]=_0x50aa55[_0x1ff959(0x164)][_0x1ff959(0x184)](),this[_0x1ff959(0x17d)]=_0x3bc79a,this[_0x1ff959(0x15a)][_0x1ff959(0x163)][_0x1ff959(0x154)](_0x1ff959(0x14d),this[_0x1ff959(0x17d)]),this[_0x1ff959(0x14c)](),this[_0x1ff959(0x177)](),this[_0x1ff959(0x167)][_0x1ff959(0x15e)]();}[_0x1233b8(0x18a)](){const _0xde329d=_0x1233b8;this[_0xde329d(0x182)]&&(this[_0xde329d(0x182)][_0xde329d(0x18a)](),this[_0xde329d(0x182)]=null),this[_0xde329d(0x167)]&&this[_0xde329d(0x167)][_0xde329d(0x16e)](),this[_0xde329d(0x153)](),this[_0xde329d(0x176)]();}[_0x1233b8(0x14c)](){const _0x488caf=_0x1233b8,{locale:_0x4f0c8f,model:_0x2774b2}=this[_0x488caf(0x18e)],_0x5543fc=_0x2774b2[_0x488caf(0x151)][_0x488caf(0x159)][_0x488caf(0x193)](),_0x2e7747=_0x5543fc&&(_0x5543fc['is'](_0x488caf(0x17b),_0x488caf(0x189))||_0x5543fc['is'](_0x488caf(0x17b),_0x488caf(0x17f)));this[_0x488caf(0x182)]=new _0x58d4c4(_0x4f0c8f,this[_0x488caf(0x15a)][_0x488caf(0x17e)]),this[_0x488caf(0x17c)][_0x488caf(0x171)]({'id':_0x488caf(0x18b),'icon':_0x1dfdf5,'title':_0x33c8fe(_0x4f0c8f,this[_0x488caf(0x17d)],_0x2e7747?_0x488caf(0x16d):_0x488caf(0x162))[_0x488caf(0x18d)],'content':this[_0x488caf(0x182)],'position':_0x39d6c9[_0x488caf(0x156)],'isModal':!0x0,'onShow':()=>{const _0x2dc7b0=_0x488caf;this[_0x2dc7b0(0x182)][_0x2dc7b0(0x152)]();},'onHide':()=>{const _0x6369e0=_0x488caf;this[_0x6369e0(0x167)][_0x6369e0(0x170)](),this[_0x6369e0(0x18e)][_0x6369e0(0x195)][_0x6369e0(0x17a)][_0x6369e0(0x152)](),this[_0x6369e0(0x18a)]();},'keystrokeHandlerOptions':{'filter':_0x450b51=>!_0xf39a23(_0x450b51,this[_0x488caf(0x182)][_0x488caf(0x17b)])}});}[_0x1233b8(0x177)](){const _0x16f3e5=_0x1233b8;this[_0x16f3e5(0x15a)][_0x16f3e5(0x164)][_0x16f3e5(0x165)](_0x16f3e5(0x178),()=>{const _0x30b1c8=_0x16f3e5,{allEntries:_0x1cb055}=this[_0x30b1c8(0x167)][_0x30b1c8(0x196)]();this[_0x30b1c8(0x18e)][_0x30b1c8(0x172)][_0x30b1c8(0x14f)](_0x3b2d93=>{const _0x134097=_0x30b1c8,_0x25cc84=_0x1cb055[_0x134097(0x173)];for(const _0x183c09 of _0x1cb055){const _0x20dd83=_0x183c09===_0x1cb055[_0x25cc84-0x1],{cdnUrl:_0x244823,fileInfo:_0x2ec46a}=_0x183c09;if(!_0x244823||!_0x2ec46a)continue;const {width:_0x31d736,height:_0x5144e1}=_0x2ec46a[_0x134097(0x158)],_0xdbe5ba=_0x2e266f(_0x244823,_0x31d736,_0x5144e1),_0x3ae788=_0x292965(_0x244823,_0xdbe5ba[_0x134097(0x16a)]),_0x1a8dc7={'id':_0x2ec46a[_0x134097(0x166)],'type':_0x134097(0x16b),'attributes':{'imageDimension':_0xdbe5ba,..._0x3ae788}};this[_0x134097(0x190)](_0x1a8dc7,_0x20dd83,_0x3b2d93);}}),this[_0x30b1c8(0x17c)][_0x30b1c8(0x174)]();}),this[_0x16f3e5(0x15a)][_0x16f3e5(0x164)][_0x16f3e5(0x165)](_0x16f3e5(0x14f),_0x1ca5db=>{const _0x49b017=_0x16f3e5;_0x49b017(0x183)===_0x1ca5db[_0x49b017(0x192)][_0x49b017(0x161)]&&!_0x1ca5db[_0x49b017(0x192)][_0x49b017(0x157)][_0x49b017(0x173)]&&this[_0x49b017(0x17c)][_0x49b017(0x179)]&&(this[_0x49b017(0x17d)]===_0x3b2cf6[_0x49b017(0x18c)]?this[_0x49b017(0x167)][_0x49b017(0x15d)](_0x3b2cf6[_0x49b017(0x18c)]):this[_0x49b017(0x167)][_0x49b017(0x15e)]());});}[_0x1233b8(0x190)](_0x2d3d45,_0x4e9f4f,_0x5ca85b){const _0x825111=_0x1233b8,_0x4c49c8=this[_0x825111(0x18e)][_0x825111(0x172)][_0x825111(0x151)][_0x825111(0x159)],_0x4a082c=_0x4c49c8[_0x825111(0x193)](),_0x34a6de=!(!_0x4a082c||!_0x4a082c['is'](_0x825111(0x17b),_0x825111(0x17f)));_0x5ca85b[_0x825111(0x168)](_0x825111(0x188)),this[_0x825111(0x160)](_0x2d3d45,_0x34a6de),_0x4e9f4f||_0x5ca85b[_0x825111(0x194)](_0x4c49c8[_0x825111(0x16f)]());}[_0x1233b8(0x160)](_0x4a045f,_0x527d90){const _0x59665f=_0x1233b8,_0x47259f=this[_0x59665f(0x18e)],{imageDimension:_0x23a70b,imageFallbackUrl:_0x195cf6,imageSources:_0x27a804}=_0x4a045f[_0x59665f(0x191)];_0x47259f[_0x59665f(0x16c)](_0x59665f(0x18f),{'imageType':_0x527d90?_0x59665f(0x17f):null,'source':{'uploadcareImageId':_0x4a045f['id'],'src':_0x195cf6,'sources':_0x27a804,..._0x23a70b}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
function _0x51b7(_0x26b052,_0x2ebbac){var _0x4b9907=_0x4b99();return _0x51b7=function(_0x51b73b,_0x3cd7e0){_0x51b73b=_0x51b73b-0x11f;var _0x3d1e90=_0x4b9907[_0x51b73b];return _0x3d1e90;},_0x51b7(_0x26b052,_0x2ebbac);}function _0x4b99(){var _0x1398a4=['ck-uploadcare-theme','1074896pDgvZi','uploader-','11OnvtJT','28792xgCOob','75HpbetD','div','uc-file-uploader-inline','1313rWOKZN','uc-light','428575MFZAMs','18MmJvyX','ck-uploadcare-form','10IyUjhy','setTemplate','ck-reset_all-excluded','556745rERcvE','60709kGPNFK','focus','getFocusableElement','element','84120JupInP','46696MZVLdj','6nuKEpY'];_0x4b99=function(){return _0x1398a4;};return _0x4b99();}var _0x33deef=_0x51b7;(function(_0x31da58,_0xbb830){var _0x1eca5b=_0x51b7,_0x413c33=_0x31da58();while(!![]){try{var _0x54ce06=parseInt(_0x1eca5b(0x136))/0x1*(parseInt(_0x1eca5b(0x11f))/0x2)+parseInt(_0x1eca5b(0x120))/0x3*(parseInt(_0x1eca5b(0x131))/0x4)+parseInt(_0x1eca5b(0x125))/0x5*(parseInt(_0x1eca5b(0x132))/0x6)+parseInt(_0x1eca5b(0x12b))/0x7+parseInt(_0x1eca5b(0x134))/0x8*(parseInt(_0x1eca5b(0x126))/0x9)+parseInt(_0x1eca5b(0x128))/0xa*(-parseInt(_0x1eca5b(0x12c))/0xb)+-parseInt(_0x1eca5b(0x130))/0xc*(parseInt(_0x1eca5b(0x123))/0xd);if(_0x54ce06===_0xbb830)break;else _0x413c33['push'](_0x413c33['shift']());}catch(_0x4a3a9d){_0x413c33['push'](_0x413c33['shift']());}}}(_0x4b99,0x29a9b));import{DialogFocusManagerView as _0x4488f8}from'../utils/dialogfocusmanagerview.js';import'../../theme/uploadcare-form.css';export class UploadcareFormView extends _0x4488f8{constructor(_0x3aa07e,_0x54acc5){var _0x3dc7e8=_0x51b7;super(_0x3aa07e),this[_0x3dc7e8(0x129)]({'tag':_0x3dc7e8(0x121),'attributes':{'class':['ck',_0x3dc7e8(0x12a),_0x3dc7e8(0x127)],'tabindex':'-1'},'children':[{'tag':_0x3dc7e8(0x122),'attributes':{'class':[_0x3dc7e8(0x124),_0x3dc7e8(0x133)],'ctx-name':_0x3dc7e8(0x135)+_0x54acc5}},this[_0x3dc7e8(0x12e)]()]});}[_0x33deef(0x12d)](){var _0x5e27f3=_0x33deef;this[_0x5e27f3(0x12f)][_0x5e27f3(0x12d)]();}}
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{global as
|
|
24
|
-
|
|
23
|
+
import{global as _0x3f6bda,ObservableMixin as _0x55e871}from'ckeditor5/src/utils.js';import{DialogViewPosition as _0x3a8a6b}from'ckeditor5/src/ui.js';import{IconUploadcareImageEdit as _0x1509d8}from'ckeditor5/src/icons.js';import{UploadcareImageEditFormView as _0x3beb4d}from'./uploadcareimageeditformview.js';import{UploadUtils as _0x5d195d}from'../../utils/uploadutils.js';import{getImageUrls as _0x5ca186,getImageDimension as _0x3cdb0c}from'../../utils/editingutils.js';import{isAncestor as _0x19d834}from'../../utils/isancestor.js';export class UploadcareImageEditController extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x55e871(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x2c7b9a,_0xc943f9,_0x210533){super(),this['_editor']=_0x2c7b9a,this['_dialog']=_0xc943f9,this['_imageElement']=_0x210533,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 _0x587c02=this['_imageElement'],_0x9b729e=_0x587c02['getAttribute']('uploadcareImageId'),_0x21c1ee=_0x587c02['getAttribute']('src');if(_0x9b729e)await this['_loadImageInfo'](_0x9b729e,_0x21c1ee);else{if(this['_imageCache']['has'](_0x21c1ee)){const _0x55c987=this['_imageCache']['get'](_0x21c1ee);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x55c987['url'],this['imageDimension']=_0x55c987['dimension'],this['imageId']=_0x55c987['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x152cdb}=this['_editor'],t=_0x152cdb['t'],_0x3056ca=new _0x3beb4d(_0x152cdb,this['imageStatus'],this['_attributes']);_0x3056ca['bind']('status')['to'](this,'imageStatus'),_0x3056ca['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x3056ca['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x3056ca['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x3056ca,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x1509d8,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x3056ca,'position':_0x3a8a6b['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x3056ca['focus']();},'onHide':()=>{_0x3056ca['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x3ee9c7=>!_0x19d834(_0x3ee9c7,_0x3056ca['element'])}});}['_loadImageInfo'](_0x9c3afa,_0x1bd058){return _0x5d195d['getInfo'](_0x9c3afa,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0xab6012=>{const {width:_0x222c71,height:_0x2ad3b9}=_0xab6012['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x1bd058,this['imageDimension']={'width':_0x222c71,'height':_0x2ad3b9},this['imageId']=_0x9c3afa;})['catch'](_0x28dad6=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x28dad6['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x432b8f,_0x327127){return this['_getImageAsFile'](_0x432b8f)['then'](_0x40726a=>_0x5d195d['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':_0x327127['signal'],'file':_0x40726a,'onProgress':_0x870a2b=>{_0x870a2b&&_0x870a2b['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x870a2b['value']));}}))['then'](_0x23c637=>{const {width:_0x58ad36,height:_0x152b4c}=_0x23c637['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x23c637['cdnUrl'],this['imageDimension']={'width':_0x58ad36,'height':_0x152b4c},this['imageId']=_0x23c637['uuid'],this['imageUploadProgress']=null;const _0x5ddaf6=_0x432b8f['getAttribute']('src');this['_imageCache']['set'](_0x5ddaf6,{'id':_0x23c637['uuid'],'url':_0x23c637['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x51411b=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x51411b['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x18576b,_0x49718e){_0x18576b['on']('apply',(_0x505596,_0x45b578)=>{this['_replaceImage'](_0x49718e,_0x45b578['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x18576b['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x18576b['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x3d65e2,_0x3718ac,_0x25633f){const _0x36ae80=this['_editor'],{width:_0x33af6a,height:_0x544c73}=_0x3cdb0c(_0x3718ac,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x3e1f75,imageSources:_0x4debb2}=_0x5ca186(_0x3718ac,_0x33af6a);_0x36ae80['model']['change'](_0x1c6e15=>{if('$graveyard'===_0x3d65e2['root']['rootName']){_0x36ae80['execute']('insertImage',{'imageType':_0x3d65e2['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x3d65e2['getAttributes']()),'uploadcareImageId':_0x25633f,'src':_0x3e1f75,'sources':_0x4debb2,'width':_0x33af6a,'height':_0x544c73}});const _0x227af7=_0x3d65e2['getChildren']();_0x3d65e2=_0x36ae80['model']['document']['selection']['getSelectedElement']();for(const _0xdf630 of _0x227af7)_0x1c6e15['append'](_0x1c6e15['cloneElement'](_0xdf630),_0x3d65e2);}else _0x1c6e15['setSelection'](_0x3d65e2,'on'),_0x36ae80['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x3d65e2['getAttributes']()),'uploadcareImageId':_0x25633f,'src':_0x3e1f75,'sources':_0x4debb2,'width':_0x33af6a,'height':_0x544c73},_0x3d65e2);_0x1c6e15['setSelection'](_0x3d65e2,'on');});}async['_getImageAsFile'](_0xb6d153){const _0x46e057=_0x3f6bda['window'],_0x51bd50=_0x3f6bda['document']['location']['href'],_0x145800=new _0x46e057['URL'](_0xb6d153['getAttribute']('src'),_0x51bd50);if('data:'===_0x145800['protocol']){const _0x46c04d=_0x145800['href']['split'](','),_0x21452d=_0x46c04d[0x0]['match'](/:(.*?);/)[0x1],_0x387fcb=_0x21452d['split']('/')[0x1],_0x3e2f13=_0x46e057['atob'](_0x46c04d[_0x46c04d['length']-0x1]);let _0x1b10fe=_0x3e2f13['length'];const _0x51a7ab=new _0x46e057['Uint8Array'](_0x1b10fe);for(;_0x1b10fe--;)_0x51a7ab[_0x1b10fe]=_0x3e2f13['charCodeAt'](_0x1b10fe);return new _0x46e057['File']([_0x51a7ab],'image.'+_0x387fcb,{'type':_0x21452d});}const _0x3c18c1=_0x145800['href']['split']('/'),_0x5c6c73=_0x3c18c1[_0x3c18c1['length']-0x1],_0x2b8243=_0x5c6c73['split']('.')[0x1];return _0x46e057['fetch'](_0x145800['href'])['then'](_0x165c5b=>_0x165c5b['clone']()['blob']())['then'](_0x44b6f6=>new _0x46e057['File']([_0x44b6f6],_0x5c6c73,{'type':'image/'+_0x2b8243}));}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
(function(_0x13c022,_0xb09df5){const _0x4aca55=_0x4b9a,_0x5ccedb=_0x13c022();while(!![]){try{const _0x3d40b0=parseInt(_0x4aca55(0x129))/0x1+-parseInt(_0x4aca55(0x12f))/0x2+-parseInt(_0x4aca55(0x131))/0x3*(parseInt(_0x4aca55(0x130))/0x4)+parseInt(_0x4aca55(0x123))/0x5+parseInt(_0x4aca55(0x125))/0x6+-parseInt(_0x4aca55(0x127))/0x7+parseInt(_0x4aca55(0x12b))/0x8*(-parseInt(_0x4aca55(0x12e))/0x9);if(_0x3d40b0===_0xb09df5)break;else _0x5ccedb['push'](_0x5ccedb['shift']());}catch(_0xcda1ce){_0x5ccedb['push'](_0x5ccedb['shift']());}}}(_0xa5a2,0xacbf6));import{View as _0x37edd6}from'ckeditor5/src/ui.js';function _0xa5a2(){const _0x4c3c0d=['1076974iYbMxu','48312gcUDsC','81SPNPri','bindTemplate','set','1811820vZgPnK','uc-light','2674962NrpzCR','imageSrc','611331aeujkd','setTemplate','1407073zfGEeg','ck-uploadcare-theme','23776VBzPHy','uc-cloud-image-editor','image-edit','1683VgxKRK'];_0xa5a2=function(){return _0x4c3c0d;};return _0xa5a2();}function _0x4b9a(_0x5a404f,_0x4abfbd){const _0xa5a226=_0xa5a2();return _0x4b9a=function(_0x4b9a05,_0x2079ac){_0x4b9a05=_0x4b9a05-0x123;let _0x506939=_0xa5a226[_0x4b9a05];return _0x506939;},_0x4b9a(_0x5a404f,_0x4abfbd);}export class UploadcareImageEditFormEditingView extends _0x37edd6{constructor(_0x1c4f17,_0x1079bb){const _0x1833e1=_0x4b9a;super(_0x1c4f17);const _0x31f197=this[_0x1833e1(0x132)];this[_0x1833e1(0x133)](_0x1833e1(0x126),''),this[_0x1833e1(0x128)]({'tag':_0x1833e1(0x12c),'attributes':{..._0x1079bb,'class':[_0x1833e1(0x124),_0x1833e1(0x12a)],'ctx-name':_0x1833e1(0x12d),'cdn-url':_0x31f197['to'](_0x1833e1(0x126))}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{IconError as
|
|
23
|
+
import{IconError as _0x1ffc60}from'ckeditor5/src/icons.js';import{ButtonView as _0x317303,IconView as _0x1b041a,View as _0x8aadc2}from'ckeditor5/src/ui.js';export class UploadcareImageEditFormErrorView extends _0x8aadc2{constructor(_0x354df8){super(_0x354df8);const t=_0x354df8['t'];this['set']('errorType',null);const _0x3252bb=new _0x317303(_0x354df8);_0x3252bb['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x3252bb['withText']=!0x0,_0x3252bb['class']='ck-button-action',_0x3252bb['on']('execute',()=>{this['fire']('retry');}),_0x3252bb['bind']('isVisible')['to'](this,'errorType',_0x3efd5f=>'NotFound'!==_0x3efd5f);const _0x33c5bd=new _0x1b041a();_0x33c5bd['content']=_0x1ffc60,_0x33c5bd['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x52192d=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':[_0x33c5bd,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x52192d['to']('errorType',_0x451033=>t('NotFound'!==_0x451033?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x3252bb]},{'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'}]}]}]});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{SpinnerView as
|
|
23
|
+
import{SpinnerView as _0x10f515,View as _0x1905e8}from'ckeditor5/src/ui.js';export class UploadcareImageEditFormLoadingView extends _0x1905e8{constructor(_0x4ba87f){super(_0x4ba87f);const t=_0x4ba87f['t'],_0x4dd74=this['bindTemplate'],_0x52f01d=new _0x10f515();_0x52f01d['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':[_0x52f01d,{'text':_0x4dd74['to']('imageUploadProgress',_0x1ee9c0=>t('Loading\x20image...')+'\x20('+(_0x1ee9c0||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'}]}]}]});}}
|