jQuery(function($){function applyForCurrentPage(){var isOn=$('#platform_enabled').is(':checked');var isServerSide=$('#serverside_global_enabled').is(':checked');var $wrap=$('#platform-fields');var $ssWrap=$('#serverside-fields');if($wrap.length){$wrap.css('opacity',isOn?'':0.5);}
if($ssWrap.length){$ssWrap.css('opacity',isServerSide?'':0.5);}
$('#pixel_id').prop('required',isOn);$('#access_token').prop('required',isOn&&isServerSide);var $gtmRow=$('#gtm_container_id_row');var hasRadios=$('input[name="pixel_setting"]').length>0;if($gtmRow.length){var isGtm=hasRadios&&($('input[name="pixel_setting"]:checked').val()==='gtm');if(hasRadios)$gtmRow.toggleClass('d-none',!isGtm);$('#additional_id').prop('required',isOn&&isGtm);}}
applyForCurrentPage();$(document).on('change','#platform_enabled, #serverside_global_enabled, input[name="pixel_setting"]',applyForCurrentPage);});