JezK
Edit File: migrate_script.build.js
!function(e){var t={};function r(p){if(t[p])return t[p].exports;var a=t[p]={i:p,l:!1,exports:{}};return e[p].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,p){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:p})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(p,a,function(t){return e[t]}.bind(null,a));return p},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=30)}({30:function(e,t){jQuery(document).ready((function(e){"use strict";var t={init:function(){function r(t){e(".templatespare-initial-msg").fadeOut(),t.find(".templatespare-import-kit-popup-wrap").fadeOut(),t.find(".progress-bar").fadeOut(),t.find(".importing").fadeOut()}function p(t){e("#templatespare-error").html(`<div class="error"><p>${t}</p></div>`)}e(".templastespare_sitebackup").on("click",(function(r){e(this).addClass("installing"),t.sitebackup()})),e("body").on("click",".templatespare_import_zip",(function(a){a.preventDefault();const o=e(this).parents(".wrap"),i=e('input[name="templatespare_import_file"]')[0];if(!i.files.length)return p("Please select a file to upload."),void r(o);var n=templatespareImport.fileuploadsize;const s=(n/1048576).toFixed(2);if(i.files[0].size>n)return p(`The file "${i.files[0].name}" is too large. The maximum allowed file size is ${s} MB. Please choose a smaller file and try again.`),void r(o);!function(t){e(".templatespare-initial-msg").fadeIn(),t.find(".templatespare-import-kit-popup-wrap").fadeIn(),t.find(".progress-bar").fadeIn(),t.find(".importing").fadeIn()}(o);const l=i.files[0];t.importProgressBar("unzip"),t.unzippingFolder(l,(function(e,p){e?(t.importProgressBar("copying"),t.importDemo(p)):r(o)}))})),t.fileSize()},sitebackup:function(){"undefined"!=typeof templatespareBackup?e.ajax({url:templatespareBackup.ajax_url,type:"POST",data:{action:"templatespare_exportFiles",nonce:templatespareBackup.nonce},success:function(t){t.success?location.reload():e("#response_message").html("<p>Backup failed!</p>")},error:function(){e("#response_message").html("<p>An error occurred.</p>")}}):console.error("templatespareBackup object is missing.")},fileSize:function(){e(".load-folder-size").each((function(){var t=e(this).data("folder"),r=e(this);e.ajax({url:templatespareBackup.ajax_url,type:"POST",data:{action:"get_folder_details",folder:t,nonce:templatespareBackup.nonce},success:function(e){e.success?r.text(e.data.size):r.text("Failed to load size.")},error:function(){e("#response_message").html("<p>An error occurred.</p>")}})}))},unzipfolder:function(r,p){e(".templatespare-initial-msg").fadeIn(),t.importProgressBar("copying"),t.importDemo(p)},unzippingFolder:function(t,r){const p=new FormData;p.append("action","templatespare_import_zip_Files"),p.append("nonce",templatespareImport.nonce),p.append("templatespare_import_file",t),e("#templatespare-upload-file").hide(),e.ajax({url:templatespareImport.ajax_url,type:"POST",data:p,processData:!1,contentType:!1,success:function(t){t.success?"function"==typeof r&&r(!0,t.data.folderName):("function"==typeof r&&r(!1,"failed"),e("#templatespare-config").html(),e("#templatespare-error").html(t.data.msg),e("#templatespare-upload-file").show())},error:function(t,p,a){e("#templatespare-error").html(`\n <div class="error"><p>${a||"An unknown error occurred."}</p></div>\n `),"function"==typeof r&&r(!1,a||"An unknown error occurred.")}})},importDemo:function(r){r&&(!function r(p){e.ajax({type:"POST",url:ajaxurl,data:{action:"AFTMLS_import_demo_data",impotype:"manual",security:afobDash.ajax_nonce,foldername:p,allcontent:!0,homepageType:"static"},success:function(p){void 0!==p.status&&"newAJAX"===p.status?(t.importProgressBar("importing-"+p.ajaxCall),r(p)):void 0!==p.message?(t.importProgressBar("finish"),e("#templatespare-error").html(p.message)):console.error("Unexpected response:",p)},error:function(e,t,r){}})}(r),e(".importing").show())},importProgressBar:function(t){if("unzip"===t)e(".templatespare-import-kit-popup .progress-wrap strong").html(" <span>Unzipping Folder</span>").animate({width:"55%"},500);else if("copying"===t)e(".templatespare-import-kit-popup .progress-bar").animate({width:"75%"},500),e(".templatespare-import-kit-popup .progress-wrap strong").html(" <span>Copying demo files</span>");else if("importing-2"===t)e(".templatespare-import-kit-popup .progress-wrap strong").html(" <span>Setting up your theme... Please wait.</span>");else if("importing-3"===t)e(".templatespare-import-kit-popup .progress-bar").animate({width:"85%"},500),e(".templatespare-import-kit-popup .progress-wrap strong").html(" <span>Importing Widgets</span>");else if("importing-4"===t)e(".templatespare-import-kit-popup .progress-bar").animate({width:"90%"},500),e(".templatespare-import-kit-popup .progress-wrap strong").html(" <span>Importing Frontpage Settings</span>");else if("importing-5"===t)e(".templatespare-import-kit-popup .progress-bar").animate({width:"99%"},500),e(".templatespare-import-kit-popup .progress-wrap strong").html(" <span>Importing Customizer Settings</span>");else if("finish"===t){var r=window.location.href,p=r.indexOf("/wp-admin"),a=r.substring(0,p);e("#templatespare_importBtn").remove(),e(".templatespare-initial-msg").fadeOut(),e(".templatespare-import-kit-popup .progress-bar").animate({width:"100%"},500),e(".templatespare-loader-img").fadeOut(),e(".templatespare-success-img").fadeIn(),e(".progress-bar-container").fadeOut(),e("#templatespare-upload-file").fadeOut(),e(".templatespare-import-kit-popup .progress-wrap strong").html('Setup complete! Enjoy your new design. <a href="'+a+'" target="_blank">Visit Site.</a> Back to import <a href="'+r+'"target="_self">Dashboard</a>'),e(".templatespare-import-kit-popup .progress-wrap strong").css("width","100%")}}};t.init()}))}});