(()=>{"use strict";var n;(n=jQuery)("#dokan-spmv-products-admin-assign-vendors").selectWoo({minimumInputLength:3,closeOnSelect:!1,ajax:{url:dokan_admin.ajaxurl,dataType:"json",delay:250,data:function(n){return{action:"dokan_spmv_products_admin_search_vendors",_wpnonce:dokan_admin.nonce,s:n.term,product_id:dokan_admin.dokanSPMVAdmin.product_id}},processResults:function(n,o){return o.page=o.page||1,{results:n.data.vendors,pagination:{more:!1}}},cache:!0},language:{errorLoading:function(){return dokan_admin.dokanSPMVAdmin.i18n.error_loading},searching:function(){return dokan_admin.dokanSPMVAdmin.i18n.searching+"..."},inputTooShort:function(){return dokan_admin.dokanSPMVAdmin.i18n.input_too_short+"..."}},escapeMarkup:function(n){return n},templateResult:function(n){return n.loading?n.text:"<div class='dokan-spmv-vendor-dropdown-results clearfix'><div class='dokan-spmv-vendor-dropdown-results__avatar'><img src='"+n.avatar+"' /></div><div class='dokan-spmv-vendor-dropdown-results__title'>"+n.name+"</div></div>"},templateSelection:function(n){return n.name}}),n("#dokan-spmv-products-admin-assign-vendors-btn").on("click",(function(o){o.preventDefault();var a=n(this),d=n("#dokan-spmv-products-admin-assign-vendors"),e=d.selectWoo("val");e&&e.length&&(a.prop("disabled",!0),d.prop("disabled",!0),n.ajax({url:dokan_admin.ajaxurl,method:"post",dataType:"json",data:{action:"dokan_spmv_products_admin_assign_vendors",_wpnonce:dokan_admin.nonce,product_id:dokan_admin.dokanSPMVAdmin.product_id,vendors:e}}).done((function(n){window.location.href=window.location.href})).always((function(){a.prop("disabled",!0),d.prop("disabled",!0)})))})),n("#dokan-spmv-products-admin .delete-product").on("click",(function(o){if(o.preventDefault(),confirm(dokan_admin.dokanSPMVAdmin.i18n.confirm_delete)){var a=n(this).data("product-id");n.ajax({url:dokan_admin.ajaxurl,method:"post",dataType:"json",data:{action:"dokan_spmv_products_admin_delete_clone_product",_wpnonce:dokan_admin.nonce,product_id:a}}).done((function(n){window.location.href=window.location.href}))}}))})();