/* empty css                   */function b(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(d,g,a){const{__:s}=d.wp.i18n;a(function(){let m=!1;y(),a(".adt-export-import-button").on("click",function(n){var x;const i=a(this),o=a(this).data("action");if(o==="import_feeds"&&!d.adtObj.isEliteActive){n.preventDefault();return}if(m){alert(s("Please wait for the current operation to complete.","woo-product-feed-pro"));return}if(o==="export_selected_feeds"){const e=a("#export_file").val();if(!e||e.length===0){alert(s("Please select at least one feed to export.","woo-product-feed-pro"));return}}if(o==="import_feeds"){const e=i.closest("td").find('input[type="file"]')[0],r=(x=e==null?void 0:e.files)==null?void 0:x[0];if(!r){alert(s("Please select a file to import.","woo-product-feed-pro"));return}if(!r.name.toLowerCase().endsWith(".json")){alert(s("Please select a valid JSON file.","woo-product-feed-pro"));return}const t=10*1024*1024;if(r.size>t){alert(s("File too large. Maximum file size is 10MB.","woo-product-feed-pro"));return}}m=!0;const l=a(this).next(".adt-loader");i.prop("disabled",!0),l.show();let _,p={url:d.ajaxurl,type:"POST"};if(o==="import_feeds"){const e=i.closest("td").find('input[type="file"]')[0],r=i.closest("td").find('input[name="overwrite_existing_feeds"]')[0],t=new FormData;t.append("action","adt_export_import_tools"),t.append("action_type",o),t.append("nonce",d.adtObj.exportImportNonce),t.append("import_file",e.files[0]),t.append("overwrite_existing_feeds",r.checked?"1":"0"),p.data=t,p.processData=!1,p.contentType=!1}else{if(_={action:"adt_export_import_tools",action_type:o,nonce:d.adtObj.exportImportNonce},o==="export_selected_feeds"){const e=a("#export_file").val();_.feed_ids=e}p.data=_}a.ajax({...p,success:function(e){var r,t,c;if(e.success&&((r=e.data)==null?void 0:r.action)==="download"){const f=new Blob([e.data.data],{type:"application/json"}),w=window.URL.createObjectURL(f),u=document.createElement("a");u.href=w,u.download=e.data.filename,document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(w),toastr.success(e.data.message||s("Feeds exported successfully.","woo-product-feed-pro"))}else if(e.success){const f=((t=e.data)==null?void 0:t.message)||s("Operation completed successfully.","woo-product-feed-pro");toastr.success(f),o==="import_feeds"&&i.closest("td").find('input[type="file"]').val("")}else{const f=((c=e.data)==null?void 0:c.message)||s("Operation failed.","woo-product-feed-pro");toastr.error(f)}},error:function(e,r,t){let c=s("Operation failed.","woo-product-feed-pro");e.responseJSON&&e.responseJSON.data&&e.responseJSON.data.message?c=e.responseJSON.data.message:e.responseJSON&&e.responseJSON.data&&typeof e.responseJSON.data=="string"?c=e.responseJSON.data:t&&(c=t),toastr.error(c)},complete:function(){m=!1,i.prop("disabled",!1),l.hide()}})});function O(){const n=a("#export_file");n.length&&typeof n.select2=="function"&&n.select2({placeholder:s("Select Feeds","woo-product-feed-pro"),allowClear:!0,width:"100%"})}function y(){a.ajax({url:d.ajaxurl,type:"POST",data:{action:"adt_export_import_tools",action_type:"get_feeds_for_dropdown",nonce:d.adtObj.exportImportNonce},success:function(n){var i;if(n.success&&((i=n.data)!=null&&i.feeds)){const o=a("#export_file");o.empty(),n.data.feeds.forEach(function(l){o.append('<option value="'+l.id+'">'+l.title+" (#"+l.id+")</option>")}),O()}},error:function(n,i,o){console.warn("Failed to load feeds for dropdown:",o)}})}})})(window,document,jQuery);export{b as __vite_legacy_guard};
