"use strict";function wpieUploadOnedriveFile(e){wpieSetProcessLoader({wpieDownloadFileText:wpiePluginSettings.wpieLocalizeText.wpieDownloadFileText});var i=e.value[0],r=i["@microsoft.graph.downloadUrl"],n=i.name;jQuery.ajax({url:wpiePluginSettings.wpieAjaxURL,type:"POST",data:"action=wpie_import_upload_file_from_onedrive&wpie_import_id="+wpiePluginSettings.wpieImportId+"&file_url="+r+"&fileName="+n,dataType:"json",async:!0,success:function(e){if(wpieUpdateProcessLoader("wpieDownloadFileText"),"error"==e.status)return wpieSetErrorMsg(e.message),!1;wpieSetFileData(e)},error:function(e,i){wpieHandleAjaxError(e,i)}})}jQuery(document).on("click",".wpie_onedrive_upload_btn",function(){var e=jQuery(".wpie_onedrive_client_id").val();if(""!=e){var i={clientId:e,action:"download",multiSelect:!1,advanced:{redirectUri:jQuery(".wpie_onedrive_redirect_uri").val()},openInNewWindow:!0,success:function(e){wpieUploadOnedriveFile(e)},cancel:function(){},error:function(e){}};OneDrive.open(i)}});