!function(e){var t={};function p(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,p),o.l=!0,o.exports}p.m=e,p.c=t,p.d=function(e,t,r){p.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.t=function(e,t){if(1&t&&(e=p(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(p.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)p.d(r,o,function(t){return e[t]}.bind(null,o));return r},p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,"a",t),t},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.p="",p(p.s=8)}({8:function(e,t,p){"use strict";p.r(t);p(9);!function(e){function t(t,p){e.ajax({url:ppw_category_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){p(e,null)},error:function(e){p(null,e)}})}e(function(){e("#ppwp_protected_categories_selected").select2({width:"95%"}),e("#ppwp_is_protect_category").change(function(){e(this).prop("checked")?(e(".form__input-wrapper").show(),e("#ppwp_categories_password").trigger("change")):(e(".form__input-wrapper").hide(),e("#ppwp_error_categories_password").hide(),e("#ppwp_error_protected_categories_selected").hide())}),e("#ppwp_is_protect_category").trigger("change"),e("#ppwp_protected_tags_selected").select2({width:"95%"}),e("#ppwp_is_protect_tag").change(function(){e(this).prop("checked")?(e(".form__input-wrapper").show(),e("#ppwp_tags_password").trigger("change")):(e(".form__input-wrapper").hide(),e("#ppwp_error_tags_password").hide(),e("#ppwp_error_protected_tags_selected").hide())}),e("#ppwp_is_protect_tag").trigger("change"),e("#ppwp_protect_category_form").submit(function(p){p.preventDefault();var r=e("#ppwp_categories_password").val(),o=e("#ppwp_protected_categories_selected").val(),s=e("#ppwp_is_protect_category").prop("checked");s&&""===r?e(this).find("#ppwp_error_categories_password").show():e(this).find("#ppwp_error_categories_password").hide(),s&&0===o.length?e(this).find("#ppwp_error_protected_categories_selected").show():e(this).find("#ppwp_error_protected_categories_selected").hide();var _={ppwp_is_protect_category:e("#ppwp_is_protect_category").prop("checked"),ppwp_categories_password:e("#ppwp_categories_password").val(),ppwp_protected_categories_selected:e("#ppwp_protected_categories_selected").val()};_.ppwp_categories_password=_.ppwp_categories_password.trim(),(!s||""!==r&&0!==o.length)&&(e("#ppwp-submit").prop("disabled",!0),function(p,r){t({action:"ppw_free_update_category_settings",settings:p,security_check:e("#ppw_category_form_nonce").val()},r)}(_,function(t,p){t&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),setTimeout(function(){window.location.reload()},700)),p&&(400===p.status?toastr.error(p.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite")),e("#ppwp-submit").prop("disabled",!1)}))}),e("#ppwp_protect_tag_form").submit(function(p){p.preventDefault();var r=e("#ppwp_tags_password").val(),o=e("#ppwp_protected_tags_selected").val(),s=e("#ppwp_is_protect_tag").prop("checked");s&&""===r?e(this).find("#ppwp_error_tags_password").show():e(this).find("#ppwp_error_tags_password").hide(),s&&0===o.length?e(this).find("#ppwp_error_protected_tags_selected").show():e(this).find("#ppwp_error_protected_tags_selected").hide();var _={ppwp_is_protect_tag:e("#ppwp_is_protect_tag").prop("checked"),ppwp_tags_password:e("#ppwp_tags_password").val(),ppwp_protected_tags_selected:e("#ppwp_protected_tags_selected").val()};_.ppwp_tags_password=_.ppwp_tags_password.trim(),(!s||""!==r&&0!==o.length)&&(e("#ppwp-submit").prop("disabled",!0),function(p,r){var o={action:"ppw_free_update_tag_settings",settings:p,security_check:e("#ppw_tag_form_nonce").val()};console.log(o,"DATA2"),t(o,r)}(_,function(t,p){t&&toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),p&&(400===p.status?toastr.error(p.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite")),e("#ppwp-submit").prop("disabled",!1)}))})})}(jQuery)},9:function(e,t,p){}});