// source --> https://hcp-menarini.ie/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=9.5.4 
function focus_populate_live_region(){var e=["woocommerce-message","woocommerce-error","wc-block-components-notice-banner"].map(function(e){return"."+e+'[role="alert"]'}).join(", "),o=document.querySelectorAll(e);if(0!==o.length){var t=o[0];t.setAttribute("tabindex","-1");var n=setTimeout(function(){t.focus(),clearTimeout(n)},500)}}function refresh_sorted_by_live_region(){var e=document.querySelector('.woocommerce-result-count[data-is-sorted-by="true"]');if(e)var o=e.innerHTML,t=setTimeout(function(){e.innerHTML="",e.innerHTML=o,clearTimeout(t)},1e3)}function on_document_ready(){focus_populate_live_region(),refresh_sorted_by_live_region()}jQuery(function(e){e(".woocommerce-ordering").on("change","select.orderby",function(){e(this).closest("form").trigger("submit")}),e("input.qty:not(.product-quantity input.qty)").each(function(){var o=parseFloat(e(this).attr("min"));o>=0&&parseFloat(e(this).val())<o&&e(this).val(o)});var o="store_notice"+(e(".woocommerce-store-notice").data("noticeId")||"");"hidden"===Cookies.get(o)?e(".woocommerce-store-notice").hide():e(".woocommerce-store-notice").show(),e(".woocommerce-store-notice__dismiss-link").on("click",function(t){Cookies.set(o,"hidden",{path:"/"}),e(".woocommerce-store-notice").hide(),t.preventDefault()}),e(".woocommerce-input-wrapper span.description").length&&e(document.body).on("click",function(){e(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),e(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),e(".woocommerce-input-wrapper :input").on("keydown",function(o){var t=e(this).parent().find("span.description");if(27===o.which&&t.length&&t.is(":visible"))return t.prop("aria-hidden",!0).slideUp(250),o.preventDefault(),!1}).on("click focus",function(){var o=e(this).parent(),t=o.find("span.description");o.addClass("currentTarget"),e(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),t.length&&t.is(":hidden")&&t.prop("aria-hidden",!1).slideDown(250),o.removeClass("currentTarget")}),e.scroll_to_notices=function(o){o.length&&e("html, body").animate({scrollTop:o.offset().top-100},1e3)},e('.woocommerce form .woocommerce-Input[type="password"]').wrap('<span class="password-input"></span>'),e(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),e(".password-input").append('<span class="show-password-input"></span>'),e(".show-password-input").on("click",function(){e(this).hasClass("display-password")?e(this).removeClass("display-password"):e(this).addClass("display-password"),e(this).hasClass("display-password")?e(this).siblings(['input[type="password"]']).prop("type","text"):e(this).siblings('input[type="text"]').prop("type","password")}),e("a.coming-soon-footer-banner-dismiss").on("click",function(o){var t=e(o.target);e.ajax({type:"post",url:t.data("rest-url"),data:{woocommerce_meta:{coming_soon_banner_dismissed:"yes"}},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.data("rest-nonce"))},complete:function(){e("#coming-soon-footer-banner").hide()}})})}),document.addEventListener("DOMContentLoaded",on_document_ready);
// source --> https://hcp-menarini.ie/wp-content/plugins/poll-maker/public/js/poll-maker-ays-public.js?ver=5.5.8 
(function($) {
    window.FontAwesomeConfig = {
        autoReplaceSvg: false
    }

    $(document).ready(function() {
        var active = false;
        var emailValivatePattern = /^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.\w{2,}$/;
        $(document).on('mouseleave', '.rating-poll .apm-answers', function() {
            if ($(this).find('label:not(.emoji)').length > 0) {
                var allRateLabels = $(this).find('label');
                if (active) {
                    var index = -1;
                    allRateLabels.each(function() {
                        if ($(this).hasClass('active-answer')) {
                            index = allRateLabels.index(this);
                        }
                    })
                    for (var i = 0; i < allRateLabels.length; i++) {
                        if (i > index) {
                            allRateLabels.eq(i).find('i').removeClass('fas').addClass('far');
                        } else {
                            allRateLabels.eq(i).find('i').removeClass('far').addClass('fas');
                        }
                    }
                } else {
                    allRateLabels.each(function() {
                        $(this).find('i').removeClass('fas').addClass('far');
                    })
                }
            }
        })

        $(document).on('click', '.rating-poll label:not(.emoji)', function(){
            $(this).parent().parent().find('label').each(function() {
                $(this).removeClass('active-answer');
            })
            $(this).addClass('active-answer');
            active = true;
        });

        $(document).on('mouseover', '.rating-poll label:not(.emoji)', function(){
            var allRateLabels = $(this).parent().parent().find('label');
            var index = allRateLabels.index(this);
            allRateLabels.each(function() {
                $(this).find('i').removeClass('fas').addClass('far');
            });
            for (var i = 0; i <= index; i++) {
                allRateLabels.eq(i).find('i').removeClass('far').addClass('fas');
            }
        });

        $(document).on('mouseleave', '.rating-poll .apm-answers', function() {
            if ($(this).find('label.emoji').length > 0) {
                var $this = $(this);
                if (active) {
                    var index = -1;
                    $this.find('label.emoji').each(function() {
                        if ($(this).hasClass('active-answer')) {
                            index = $this.find('label.emoji').index(this);
                        }
                    });
                    for (var i = 0; i < $this.find('label.emoji').length; i++) {
                        if (i != index) {
                            $this.find('label.emoji').eq(i).find('i').removeClass('fas').addClass('far');
                        } else {
                            $this.find('label.emoji').eq(i).find('i').removeClass('far').addClass('fas');
                        }
                    }
                } else {
                    $this.find('label.emoji').each(function() {
                        $(this).find('i').removeClass('fas').addClass('far');
                    });
                }
            }
        });

        $(document).on('mouseover', '.rating-poll label.emoji', function() {
            var $this = $(this);
            var thisLabels = $this.parent().parent().find('label.emoji');
            var index = thisLabels.index(this);

            thisLabels.each(function() {
                $(this).find('i').removeClass('fas').addClass('far');
            });
            thisLabels.eq(index).find('i').removeClass('far').addClass('fas');
        });

        $(document).on('click', '.rating-poll label.emoji', function() {
            var thisLabels = $(this).parent().parent().find('label.emoji');
            thisLabels.each(function() {
                $(this).removeClass('active-answer');
            })
            $(this).addClass('active-answer');
            active = true;
        });

        $(document).on('mouseleave', '.voting-poll .apm-answers', function() {
            var index = -1;
            var labels = $(this).find('label');
            if (active) {
                labels.each(function() {
                    if ($(this).hasClass('active-answer')) {
                        index = labels.index(this);
                    }
                });
                for (var i = 0; i < labels.length; i++) {
                    if (i != index) {
                        labels.eq(i).find('i').removeClass('fas').addClass('far');
                    } else {
                        labels.eq(i).find('i').removeClass('far').addClass('fas');
                    }
                }
            } else {
                labels.each(function() {
                    $(this).find('i').removeClass('fas').addClass('far');
                });
            }
        });

        $(document).on('mouseover', '.voting-poll label', function() {
            var $this = $(this);
            var index = $this.parent().parent().find('label').index(this);
            $this.parent().parent().find('label').each(function() {
                $(this).find('i').removeClass('fas').addClass('far');
            });
            $this.parent().parent().find('label').eq(index).find('i').removeClass('far').addClass('fas');
        });

        $(document).on('click', '.voting-poll label', function() {
            var $this = $(this);
            $this.parent().parent().find('label').each(function() {
                $(this).removeClass('active-answer');
            });
            $(this).addClass('active-answer');
            active = true;
        });

        $('.redirect-after-vote-url').on('click', function(e) {
            var x = $(this).attr('data-answers-url');
            var multivoteActivated = $(document).find('#ays_poll_multivote_min_count').length;
            var finalUrl = "";

            if (multivoteActivated > 0) {
                var checkedBoxes =  $(this).parents(".apm-answers").find("input:checkbox:checked");

                for(var i = 0; i <= checkedBoxes.length; i ++) {
                    var answersUrl = checkedBoxes.eq(i).next().attr('data-answers-url');

                    if(typeof answersUrl !== 'undefined' && answersUrl !== false) {
                        finalUrl = answersUrl;
                        break;
                    }
                    else {
                        finalUrl = $(this).attr('data-answers-url');
                    }
                }
                var url = $(this).parents(".box-apm").attr('data-url-href', finalUrl);
            }
            else if(multivoteActivated == 0) {
                var url = $(this).parents(".box-apm").attr('data-url-href', x);
            }
        });

        $('.poll_answers_sound').on('click', function(e) {
            var answers_sound = $(this).parents('.ays-poll-main').find('.ays_poll_ans_sound').get(0);            
            if(answers_sound){
                resetPlaying(answers_sound);
                setTimeout(function(){
                    answers_sound.play();
                }, 10);
            }
        });

        $(document).on('click','.ays-poll-view-more-button', function(e) {
            var $this = $(this);
            var parent = $this.parents('.ays-poll-main ');
            var pollAnswers = parent.find('.apm-answers .apm-choosing');

            pollAnswers.each(function(e) {
                if ($(this).hasClass('ays_poll_display_none')) {
                    $(this).removeClass('ays_poll_display_none');
                }
            });

            $this.parents('.ays-poll-view-more-button-box').addClass('ays_poll_display_none');
        });

        $(document).on('mouseover', '.ays-poll-logo-image-url-link', function () {
            if($(this).attr("href") == "javascript:void(0)") {
                $(this).css('cursor', 'auto');
            }
        })
            
        //Users limitations 
        if ($('.apm-redirection').length > 0) {
            $('.apm-redirection').each(function(e) {
                var url = $(this).find('p').attr('data-href');
                var delay = +$(this).find('p').attr('data-delay');
                var formId = $(this).find('p').attr('data-id');
                setTimeout(function() {
                    var interval = setInterval(function() {
                        if (delay > 0) {
                            delay--;
                            $(this).find('p b').text(secsToText(delay));
                        } else {
                            clearInterval(interval);
                            location.href = url;
                        }
                    }, 1000);
                }, 1500);
            })
        }

        function secsToText(sec) {
            /*** get the hours ***/
            var hours = ((sec / 3600) % 24).toFixed(0);
            if (hours > 0) hours = hours < 10 ? '0'+hours : hours;
            else hours = '00';
            /*** get the minutes ***/
            var minutes = ((sec / 60) % 60).toFixed(0);
            if (minutes > 0) minutes = minutes < 10 ? '0'+minutes : minutes;
            else minutes = '00';
            /*** get the seconds ***/
            var seconds = (sec % 60).toFixed(0);
            if (seconds > 0) seconds = seconds < 10 ? '0'+seconds : seconds;
            else seconds = '00';

            return hours+':'+minutes+':'+seconds;
        }

        $(document).on('input', '.ays_animated_xms', function(){
            $(document).find('.apm-info-form input[name]').each(function () {
                $(this).removeClass('ays_poll_shake');
            });
            $(this).removeClass('ays_red_border');
            $(this).removeClass('ays_green_border');
            if ($(this).attr('type') !== 'hidden' && $(this).attr('name') != 'apm_email') {
                if($(this).val() == '' && $(this).data('required')){
                    $(this).addClass('ays_red_border');
                }else{
                    $(this).addClass('ays_green_border');
                }                
            }else if($(this).attr('type') !== 'hidden'){
                if($(this).val() != ''){
                    if (!(emailValivatePattern.test($(this).val()))) {
                        $(this).addClass('ays_red_border');
                    }else{
                        $(this).addClass('ays_green_border');
                    }
                }
            }
        });

        $(document).on('input', '.amp-info-form-input-box input[name="apm_phone"]', function(){
            if ($(this).attr('type') !== 'hidden') {
                $(this).removeClass('ays_red_border');
                $(this).removeClass('ays_green_border');
                if($(this).val() != ''){
                    if (!(/^[+ 0-9-]+$/.test($(this).val()))) {
                        $(this).addClass('ays_red_border');
                    }else{
                        $(this).addClass('ays_green_border');
                    }
                }
            }
        });

        function resetPlaying(audelems) {
                audelems.pause();
                audelems.currentTime = 0;
        }
        //AV Countdown date
        var poll_id =  $(document).find('.box-apm').data('id');

        $(document).find('.show_timer_countdown').each(function(e){
            // Countdown date
            var countDownEndDate = $(this).data('timer_countdown');
            var this_poll_id = $(this).parents(".ays-poll-main").attr("id");
            var refreshButton = "<input type='button' id='ays_refresh_btn_"+this_poll_id+"' class='btn ays-poll-btn btn-restart' style='text-align:center;' value='Refresh'>";
            if (countDownEndDate != '' && countDownEndDate != undefined) {
                ays_countdown_datetime(countDownEndDate, this_poll_id);
            }
        });

        function ays_countdown_datetime(sec, poll_id) {
            var distance = sec*1000;
            var x_int;

            // Update the count down every 1 second
            x_int = setInterval(function() {
                // Time calculations for days, hours, minutes and seconds
                var days = Math.floor(distance / (1000 * 60 * 60 * 24));
                var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
                var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
                var seconds = Math.floor((distance % (1000 * 60)) / 1000);

                // Output the result in an element with id="demo"
                var text = "";

                if(days > 0){
                    text += days + " ";
                    if(days == 1){
                        text += poll_maker_ajax_public.day + " ";
                    }else{
                        text += poll_maker_ajax_public.days + " ";
                    }
                }

                if(hours > 0){
                    text += hours + " ";
                    if(hours == 1){
                        text += poll_maker_ajax_public.hour + " ";
                    }else{
                        text += poll_maker_ajax_public.hours + " ";
                    }
                }

                if(minutes > 0){
                    text += minutes + " ";
                    if(minutes == 1){
                        text += poll_maker_ajax_public.minute + " ";
                    }else{
                        text += poll_maker_ajax_public.minutes + " ";
                    }
                }

                text += seconds + " " + poll_maker_ajax_public.seconds;

                jQuery(document).find( "#"+ poll_id +" .show_timer_countdown" ).html(text);

                // If the count down is over, write some text
                if (distance > 0) {
                    distance -= 1000;
                }
                if (distance <= 0) {
                    clearInterval(x_int);
                    jQuery(document).find( "#"+ poll_id +" .show_timer_countdown" ).html('');
                }
                if(distance == 0){
                    location.reload();
                }
            }, 1000);
        }

        $(document).on('click', '#ays_refresh_btn_'+poll_id, function(){
            location.reload();
        });

        // Answer Sound Muter
        $(document).on('click', '.ays_music_sound', function() {
            var $this = $(this);
            var pollCoutainer = $this.parents('.ays-poll-main');
            var audioEl = pollCoutainer.find('.ays_poll_ans_sound').get(0);
            if($this.hasClass('ays_sound_active')){
                audioEl.volume = 0;
                $this.find('.ays_poll_far').addClass('ays_poll_fa-volume_off').removeClass('ays_poll_fa-volume_up');
                $this.removeClass('ays_sound_active');
            } else {
                audioEl.volume = 1;
                $this.find('.ays_poll_far').addClass('ays_poll_fa-volume_up').removeClass('ays_poll_fa-volume_off');
                $this.addClass('ays_sound_active');
            }
        });

        // Allow Multivote
        $(document).on('change', '.apm-choosing' , function(){
            var numberOfChecked = $(this).parent().find("input:checkbox:checked").length;
            var multivote_answer_count = $(this).parent().find("#multivot_answer_count").val();
            var pollMultivoteMinCount = $(this).parent().find("#ays_poll_multivote_min_count").val();
            var numberNotChecked = $(this).parent().find('input:checkbox:not(":checked")');
            var numberAllAnswers = $(this).parents("form").find('input:checkbox').length;
            var voteButton = $(this).parents("form").find("input[name='ays_finish_poll']");
            var otherAnswer = $(this).parent().find('input.ays-poll-new-answer-apply-text');
            otherAnswer.attr("data-votes" , numberOfChecked);
            if(otherAnswer.length > 0){
                var otherAnswerVotes = otherAnswer.data("votes");
                var otherAnswerVal = otherAnswer.val();
                if(otherAnswerVal != ""){
                    otherAnswer.attr("data-votes" , numberOfChecked+1);
                    otherAnswerVotes = numberOfChecked+1;
                }
                if (numberOfChecked >= multivote_answer_count && otherAnswerVal == ""){
                    otherAnswer.attr("data-votes" , numberOfChecked);
                    numberNotChecked.prop( "disabled", true );
                    otherAnswer.prop( "disabled", true );
                    otherAnswer.css( "opacity", "0.5" );
                } else if (otherAnswerVotes >= multivote_answer_count) {
                    numberNotChecked.prop( "disabled", true );
                } else{
                    numberNotChecked.prop( "disabled", false );
                    otherAnswer.prop( "disabled", false );
                    otherAnswer.css( "opacity", "1" );
                }

                if (numberAllAnswers < pollMultivoteMinCount) {
                    pollMultivoteMinCount = numberAllAnswers;
                }
                
                if (otherAnswerVal == "") {
                    if(pollMultivoteMinCount > numberOfChecked){
                        voteButton.css("opacity" , "0.5");
                    } else {
                        voteButton.css("opacity" , "1");
                    }
                } else {
                    if (pollMultivoteMinCount > otherAnswerVotes) {
                        voteButton.css("opacity" , "0.5");
                    } else {
                        voteButton.css("opacity" , "1");
                    }
                }
            }
            else{
                if(numberOfChecked >= multivote_answer_count){
                    numberNotChecked.prop( "disabled", true );
                } else {
                    numberNotChecked.prop( "disabled", false );
                }

                if (numberAllAnswers < pollMultivoteMinCount){
                    pollMultivoteMinCount = numberAllAnswers;
                }
                
                if (pollMultivoteMinCount > numberOfChecked){
                    voteButton.css("opacity" , "0.5");
                } else {
                    voteButton.css("opacity" , "1");
                }
            }
        });

        $(document).find(".ays-poll-new-answer-apply-text").on("input" , function(){
            var _this = $(this);
            var voteButton = _this.parents("form").find("input[name='ays_finish_poll']");
            var allowMultivoteCheck = _this.parents("form").find('input#ays_poll_multivote_min_count').data("allow");
            var pollMultivoteMinCount = _this.parents(".apm-answers").find("#ays_poll_multivote_min_count").val();
            var CheckedBoxes = _this.parents(".apm-answers").find("input:checkbox:checked");
            var numberOfChecked = CheckedBoxes.length;
            if(_this.val() != ""){
                numberOfChecked++;
            }
            var noteBox = _this.parents(".apm-add-answer").next();
            if(noteBox.hasClass('ays-poll-add-answer-note-enable')){
                noteBox.slideDown(200);
                noteBox.removeClass("ays-poll-add-answer-note-enable");
            }
            else if(_this.val() == ''){
                noteBox.addClass("ays-poll-add-answer-note-enable");
                noteBox.slideUp(200);
            }
            if(allowMultivoteCheck){
                if(pollMultivoteMinCount > numberOfChecked){
                    voteButton.css("opacity" , "0.5");
                }
                else{
                    voteButton.css("opacity" , "1");
                }
            }
        });

        var questionTypeText = $(document).find('textarea.ays-poll-text-types-inputs-only-textarea');
        autosize(questionTypeText);

        $(document).find('textarea.ays_poll_question_limit_length, input.ays_poll_question_limit_length').on('keyup keypress', function(e) {
            var $this = $(this);
            var limitType = $this.data("limitType");
            var limitMaxLength = $this.data("maxLength");
            var limitTextMessage = $this.parents(".ays-poll-maker-text-answer-main").find('.ays_poll_question_text_message_span');

            var remainder = '';
            if(limitMaxLength != '' && limitMaxLength != 0){
                switch ( limitType ) {
                    case 'characters':
                        var tval = $this.val();
                        var tlength = tval.length;
                        var set = limitMaxLength;
                        var remain = parseInt(set - tlength);
                        if (remain <= 0 && e.which !== 0 && e.charCode !== 0) {
                            $this.val((tval).substring(0, tlength - 1));
                        }
                        if (e.type=="keyup") {
                            var tval = $this.val().trim();
                            if(tval.length > 0 && tval != null){
                                var wordsLength = this.value.split('').length;
                                if (wordsLength > limitMaxLength) {
                                    var trimmed = tval.split('', limitMaxLength).join("");
                                    $this.val(trimmed);
                                }
                            }
                        }
                        remainder = remain;
                        break;
                    case 'words':
                        if (e.type=="keyup") {
                            var tval = $this.val().trim();
                            if(tval.length > 0 && tval != null){
                                var wordsLength = this.value.match(/\S+/g).length;
                                if (wordsLength > limitMaxLength) {
                                    var trimmed = tval.split(/\s+/, limitMaxLength).join(" ");
                                    $this.val(trimmed + " ");
                                }
                                remainder = limitMaxLength - wordsLength;
                            }
                        }
                        break;
                    default:
                        break;
                }
                if (e.type=="keyup") {
                    if ( limitTextMessage ) {
                        if(limitMaxLength != '' && limitMaxLength != 0){
                            if (remainder <= 0) {
                                remainder = 0;
                            }
                            if (tval.length == 0 || tval == null) {
                                remainder = limitMaxLength;
                            }
                        }
                        limitTextMessage.html( remainder );
                    }
                }
            }
        });

        $(document).on('click', '.ays-poll-password-toggle', function(e){
            var $this  = $(this);
            
            var parent = $this.parents('.ays-poll-password-input-box-visibility');
            var passwordInput = parent.find('.ays-poll-password-input');

            var visibilityOn  = parent.find('.ays-poll-password-toggle-visibility');
            var visibilityOff = parent.find('.ays-poll-password-toggle-visibility-off');

            if( $this.hasClass('ays-poll-password-toggle-visibility-off') ) {
                passwordInput.attr('type', 'text');
                    
                if ( visibilityOn.hasClass('ays_poll_display_none') ) {
                    visibilityOn.removeClass('ays_poll_display_none');
                }

                if ( ! visibilityOff.hasClass('ays_poll_display_none') ) {
                    visibilityOff.addClass('ays_poll_display_none');
                }

            } else if( $this.hasClass('ays-poll-password-toggle-visibility') ) {
                passwordInput.attr('type', 'password');

                if ( ! visibilityOn.hasClass('ays_poll_display_none') ) {
                    visibilityOn.addClass('ays_poll_display_none');
                }

                if ( visibilityOff.hasClass('ays_poll_display_none') ) {
                    visibilityOff.removeClass('ays_poll_display_none');
                }                
            }
        });
        

    })
})(jQuery);
// source --> https://hcp-menarini.ie/wp-content/plugins/poll-maker/public/js/poll-maker-public-category.js?ver=5.5.8 
(function($) {
	'use strict'

    $(document).ready(function() {
        var widthForNext = 1;
        var widthForPrev = 0;
        var containers = $(document).find('.ays_poll_category-container');

        containers.each(function() {
            var $j = $(this).attr('data-var');
            var catContainer = $('#' + window['catContainer' + $j]);
            catContainer.append(window['pollsGlobalPool' + $j][window['catIndex' + $j]]);

            var previousNextBtnContainer = $("<div class='previous_next_buttons'></div>");
            var btn = $("<button id='catBtn" + $j + "' class='ays-poll_previous_next_buttons ays-poll-next-btn ays_p_n_buttons" + $j + "' type='button' data-name='next'> " + window['aysPollBtnText' + $j] + " </button>");
            var previousBtn = $("<button id='previousBtn" + $j + "' class='ays-poll_previous_next_buttons ays-poll-previous-btn ays_p_n_buttons" + $j + "' type='button' data-name='previous'> " + window['aysPollPreviousBtnText' + $j] + "</button>");
            btn.css(dataCss);
            previousBtn.css(dataCss);

            if (catContainer.find('.apm-need-sign-in').length > 0 || !window['showNext' + $j]) {
                btn.prop('disabled', true);
            } else {
            	btn.prop('disabled', !window['showNext' + $j]);
            }

            if (window['catIndex' + $j] != 0 ) {
                previousBtn.prop('disabled', false);
            } else {
                previousBtn.prop('disabled', true);
            }

            if (window['pollsGlobalPool'+$j].length == 1) {
                btn.prop('disabled', true);
            }

            var nextPrevButtonsWidths = JSON.parse(window['aysPollWidths'+$j]);
            $(document).on('click', ".ays_p_n_buttons" + $j, function() {
                if (window['showNext' + $j]) {
                    if($(this).attr('data-name') == 'next') {
                        if(nextPrevButtonsWidths[widthForNext] == "0px") {
                            nextPrevButtonsWidths[widthForNext] = "100%";
                        }

                        $(this).parent().css("width", nextPrevButtonsWidths[widthForNext]);
                        previousBtn.prop('disabled', false);

                        var previousPollHtml = emptyCatCont($(this));
                        window['pollsGlobalPool' + $j][window['catIndex' + $j]] = previousPollHtml;
                        window['catIndex'+ $j]++;
                        if(typeof(window['pollsGlobalPool' + $j][window['catIndex' + $j]]) != 'undefined'){
                            catContainer.empty().append(window['pollsGlobalPool' + $j][window['catIndex' + $j]]);
                        }

                        catContainer.append(previousNextBtnContainer);
                        var checkIfVoted = catContainer.find('.results-apm').length > 0 ? true : false;
                        if (window['catIndex' + $j] != window['pollsGlobalPool' + $j].length - 1) {
                            if (catContainer.find('.apm-need-sign-in').length > 0 || !window['showNext'+$j]) {
                                btn.prop('disabled', true);
                            } else {
                                var checkVal = false;
                                if (window['showNextVal'+$j] == false) {
                                    checkVal = true;
                                }
                                btn.prop('disabled', checkVal);
                            }

                            if(checkIfVoted) {
                                btn.prop('disabled', false);
                            }
                        } else {
                            btn.prop('disabled', true);
                        }

                        widthForPrev++;
                        widthForNext++;
                    } else if($(this).attr('data-name') == 'previous') {
                        widthForNext--;
                        widthForPrev--;

                        if (widthForPrev == 0) {
                            widthForPrev == "100%";
                        }

                        if (nextPrevButtonsWidths[widthForPrev] == "0px") {
                            nextPrevButtonsWidths[widthForPrev] = "100%";
                        }

                        $(this).parent().css("width", nextPrevButtonsWidths[widthForPrev]);
                        var nextPollHtml = emptyCatCont($(this));

                        window['pollsGlobalPool' + $j][window['catIndex' + $j]] = nextPollHtml;
                        window['catIndex' + $j]--;

                        btn.prop('disabled', false);
                        previousBtn.prop('disabled', false);
                        catContainer.empty().append(window['pollsGlobalPool' + $j][window['catIndex' + $j]]);
                        catContainer.append(previousNextBtnContainer);
                        if (window['catIndex' + $j] == 0) {
                            previousBtn.prop('disabled', true);
                        }
                    }
                } else {
                    window['catIndex' + $j] = 0;
                }
            });

            $(document).on('click', ".ays-poll_previous_next_buttons" ,function() {
                $(document).find(".ays-poll_previous_next_buttons").css(dataCss);
            });

            $(document).on('mouseleave', ".ays_p_n_buttons" + $j, function() {
                $(this).css(dataCss);
            });

            $(document).on('mouseenter', ".ays_p_n_buttons" + $j, function() {
                $(this).css(hoverCss);
            });

            previousNextBtnContainer.append(previousBtn);
            previousNextBtnContainer.append(btn);
            catContainer.append(previousNextBtnContainer);

            if (!window['showNext' + $j]) {
                btn.prop('disabled', true);
            }
        });

        function emptyCatCont(current) {
            var content1 = current.parents('.ays_poll_category-container').clone();
            var prevPollHtml = '';

            if (content1.find('.ays-poll_previous_next_buttons').length > 0) {
                content1.find('.previous_next_buttons').remove();
                prevPollHtml = content1.html();
                return prevPollHtml;
            }

            return false;
        }
    });

})(jQuery);
// source --> https://hcp-menarini.ie/wp-content/plugins/poll-maker/public/js/poll-maker-autosize.js?ver=5.5.8 
/*!
	autosize 4.0.2
	license: MIT
	http://www.jacklmoore.com/autosize
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,function(e,t){"use strict";var n,o,p="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1<n.indexOf(e)},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);-1<t&&(n.splice(t,1),o.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(r){if(r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!p.has(r)){var e,n=null,o=null,i=null,d=function(){r.clientWidth!==o&&a()},l=function(t){window.removeEventListener("resize",d,!1),r.removeEventListener("input",a,!1),r.removeEventListener("keyup",a,!1),r.removeEventListener("autosize:destroy",l,!1),r.removeEventListener("autosize:update",a,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),p.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",l,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",a,!1),window.addEventListener("resize",d,!1),r.addEventListener("input",a,!1),r.addEventListener("autosize:update",a,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",p.set(r,{destroy:l,update:a}),"vertical"===(e=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===e.resize&&(r.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),a()}function s(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function u(){if(0!==r.scrollHeight){var e=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),t=document.documentElement&&document.documentElement.scrollTop;r.style.height="",r.style.height=r.scrollHeight+n+"px",o=r.clientWidth,e.forEach(function(e){e.node.scrollTop=e.scrollTop}),t&&(document.documentElement.scrollTop=t)}}function a(){u();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n<e?"hidden"===t.overflowY&&(s("scroll"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(s("hidden"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),i!==n){i=n;var o=c("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}}function i(e){var t=p.get(e);t&&t.destroy()}function d(e){var t=p.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return r(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.default=l,e.exports=t.default});