jQuery(document).ready(function(o){let e;o(document).on("click","#modal_opt_out_button",function(c){c.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_facebook_opt_out_of_sync",nonce:facebook_for_woocommerce_plugin_update.opt_out_of_sync},function(c){data="string"==typeof c?JSON.parse(c):c,data.success&&(o("#opt_out_banner").hide(),o("#opted_our_successfullly_banner").show(),e.remove())}).fail(function(o){e.remove()})}),o(document).on("click","#opt_out_banner .notice-dismiss, #opted_our_successfullly_banner .notice-dismiss",function(c){c.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_banner_close_action",nonce:facebook_for_woocommerce_plugin_update.banner_close},function(o){data="string"==typeof o?JSON.parse(o):o,data.success}).fail(function(o){e.remove()})}),o(document).on("click",".plugin_updated_successfully .notice-dismiss",function(c){c.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_banner_post_update_close_action",nonce:facebook_for_woocommerce_plugin_update.banner_close},function(o){data="string"==typeof o?JSON.parse(o):o,data.success}).fail(function(o){e.remove()})}),o(document).on("click","#plugin_updated_successfully_but_master_sync_off .notice-dismiss",function(c){c.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_banner_post_update__master_sync_off_close_action",nonce:facebook_for_woocommerce_plugin_update.banner_close},function(o){data="string"==typeof o?JSON.parse(o):o,data.success}).fail(function(o){e.remove()})}),o(document).on("click",".plugin_updated_successfully .notice-dismiss",function(c){c.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_banner_post_update_close_action",nonce:facebook_for_woocommerce_plugin_update.banner_close},function(o){data="string"==typeof o?JSON.parse(o):o,data.success}).fail(function(o){e.remove()})}),o(document).on("click","#plugin_updated_successfully_but_master_sync_off .notice-dismiss",function(c){c.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_banner_post_update__master_sync_off_close_action",nonce:facebook_for_woocommerce_plugin_update.banner_close},function(o){data="string"==typeof o?JSON.parse(o):o,data.success}).fail(function(o){e.remove()})}),o(".opt_out_of_sync_button").on("click",function(c){c.preventDefault(),e=new o.WCBackboneModal.View({target:"facebook-for-woocommerce-modal",string:{message:facebook_for_woocommerce_plugin_update.opt_out_confirmation_message,buttons:facebook_for_woocommerce_plugin_update.opt_out_confirmation_buttons}})}),o("#sync_all_products").on("click",function(e){e.preventDefault(),o(this),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_facebook_sync_all_products",nonce:facebook_for_woocommerce_plugin_update.sync_back_in},function(e){data="string"==typeof e?JSON.parse(e):e,data.success&&(o("#plugin_updated_successfully_but_master_sync_off").hide(),o("#plugin_updated_successfully_after_user_opts_in").show())}).fail(function(o){})}),o("#sync_all_products").on("click",function(e){e.preventDefault(),o(this),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_facebook_sync_all_products",nonce:facebook_for_woocommerce_plugin_update.sync_back_in},function(e){data="string"==typeof e?JSON.parse(e):e,data.success&&(o("#plugin_updated_successfully_but_master_sync_off").hide(),o("#plugin_updated_successfully_after_user_opts_in").show())}).fail(function(o){})}),o(".fb-product-set-banner").on("click",".notice-dismiss",function(e){e.preventDefault(),o.post(facebook_for_woocommerce_plugin_update.ajax_url,{action:"wc_facebook_product_set_banner_closed",nonce:facebook_for_woocommerce_plugin_update.product_set_banner_closed_nonce},function(o){data="string"==typeof o?JSON.parse(o):o,data.success}).fail(function(o){})})});