jQuery(document).ready(function($){function updateTeaserNoticePreview(){var $activeContainer=$('.pp-teaser-settings-container.active');if(!$activeContainer.length){$activeContainer=$('.pp-teaser-settings-container:visible').first()}if(!$activeContainer.length){return}var $preview=$activeContainer.find('.pp-teaser-notice-preview');if(!$preview.length){return}var bgColor=$activeContainer.find('[name*="teaser_notice_bg_color"]').val()||'#f0f6fc';var textColor=$activeContainer.find('[name*="teaser_notice_text_color"]').val()||'#1d2327';var borderColor=$activeContainer.find('[name*="teaser_notice_border_color"]').val()||'#0073aa';var borderWidth=$activeContainer.find('[name*="teaser_notice_border_width"]').val()||'4';var borderPosition=$activeContainer.find('[name*="teaser_notice_border_position"]').val()||'left';var padding=$activeContainer.find('[name*="teaser_notice_padding"]').val()||'15';var borderRadius=$activeContainer.find('[name*="teaser_notice_border_radius"]').val()||'0';var fontSize=$activeContainer.find('[name*="teaser_notice_font_size"]').val()||'14';$preview.css({padding:padding+'px',background:bgColor,color:textColor,margin:'15px 0','font-size':fontSize+'px','line-height':'1.6','border-radius':borderRadius+'px',transition:'all 0.3s ease'});if(borderPosition==='all'){$preview.css('border-left','');$preview.css('border-right','');$preview.css('border-top','');$preview.css('border-bottom','');$preview.css('border',borderWidth+'px solid '+borderColor)}else{$preview.css('border','');$preview.css('border-left','');$preview.css('border-right','');$preview.css('border-top','');$preview.css('border-bottom','');$preview.css('border-'+borderPosition,borderWidth+'px solid '+borderColor)}}setTimeout(function(){if(typeof $.fn.wpColorPicker!=='undefined'){$('.pp-color-picker').each(function(){$(this).wpColorPicker({change:function(event,ui){updateTeaserNoticePreview()},clear:function(){setTimeout(updateTeaserNoticePreview,100)}})})}},200);$(document).on('input change','.pp-style-input',function(){updateTeaserNoticePreview()});$(document).on('input change','.pp-color-picker',function(){updateTeaserNoticePreview()});$(document).on('change','#pp_current_post_type',function(){setTimeout(updateTeaserNoticePreview,100)});setTimeout(function(){updateTeaserNoticePreview()},300)});