function loadPollQs(){var n=$("#cthr-polling"),t=n.find(".poll-content"),i;n.find(".loading").addClass("show");i=n.find(".side-box-content").outerHeight(!0);n.find(".side-box-content").height(i);t.html("");t.load("/Base/LoadPoll?_v20191114",{param_pollIdArray:unescape($.cookie("cthrpolling"))},function(i,r){r=="success"&&(i==""?$("#cthr-polling").empty():($(".poll-collapse").addClass("fadeIn"),$(".poll-popup").addClass("opened"),n.find(".loading").removeClass("show"),n.find(".side-box-content").removeAttr("style"),t.find(".poll-qs").mCustomScrollbar(),setTimeout(function(){t.find(".poll-qs .btns").css("padding-bottom","1px")},200),t.html(t.html())))})}function loadPollResult(n){var t=$("#cthr-polling"),u=window.localStorage,i=t.find(".poll-content"),r;t.find(".loading").addClass("show");r=t.find(".side-box-content").outerHeight(!0);t.find(".side-box-content").height(r);i.html("");i.load("/Base/LoadPollResult?_v20191114",{param_poll_id:n,param_pollIdArray:unescape($.cookie("cthrpolling"))},function(n,r){r=="success"&&(t.find(".loading").removeClass("show"),t.find(".side-box-content").removeAttr("style"),i.find(".poll-result").mCustomScrollbar(),setTimeout(function(){i.find(".poll-result .mCSB_container").css("padding-bottom","1px")},200),i.find(".progress-bar").each(function(n){u.setItem("op-"+(n+1)+"-result",$(this).parent().find(".current-value .counter").html());$(this).animate({width:""+parseInt($(this).parent().find(".current-value .counter").html(),10)+"%"},300);$(this).parent().find(".current-value .counter").counterUp({delay:10,time:500})}))})}function updatePollAnswerCountAjax(n,t){$.ajax({cache:!1,type:"POST",url:"/Base/UpdatePollAnswerCount",dataType:"json",data:JSON.stringify({poll_id:n,answer_id:t}),contentType:"application/json; charset=utf-8",async:!1,cache:!1,timeout:8e3,complete:function(){return!0},error:function(){return!1}})}function detectIE(){var n=window.navigator.userAgent,i=n.indexOf("MSIE "),u,r,t;return i>0?"IE "+parseInt(n.substring(i+5,n.indexOf(".",i)),10):(u=n.indexOf("Trident/"),u>0)?(r=n.indexOf("rv:"),"IE "+parseInt(n.substring(r+3,n.indexOf(".",r)),10)):(t=n.indexOf("Edge/"),t>0)?"IE "+parseInt(n.substring(t+5,n.indexOf(".",t)),10):"Not IE"}$(function(){var n=!1;(!$.cookie("cthrpolling")||isNaN(parseInt($.cookie("cthrpolling")))||$.cookie("cthrpolling").indexOf(",")<0)&&$.cookie("cthrpolling","0",{expires:365,path:"/"});setTimeout(function(){n||$(".poll-popup").removeClass("opened")},1e4);$(".poll-popup .loading").imagesLoaded(function(){var n=$("#cthr-polling");n.find(".poll-content").html(loadPollQs())});$(".poll-popup").on("click",".poll-collapse",function(){var t=$(this),n=$(this).closest(".poll-popup");n.hasClass("opened")?n.removeClass("opened"):n.addClass("opened")});$(".poll-popup").on("click",".poll-qs .poll-qs-label",function(){var n=$(this).parents(".poll-qs").attr("data-poll-id"),i=$(this).siblings(".poll-qs-input").attr("data-answer-id"),r=unescape($.cookie("cthrpolling")),t=[];t.push(r.split(","));t.push(n);$.cookie("cthrpolling",t.join(","),{expires:365,path:"/"});updatePollAnswerCountAjax(n,i);loadPollResult(n)});$(".poll-popup").on("click",".poll-result .next-qs-btn",function(){$("#cthr-polling").find(".poll-content").html(loadPollQs());n=!0});$(".poll-popup").on("click",".poll-qs .skip-qs-btn, .poll-qs .close-btn",function(){var i=$(this).parents(".poll-qs").attr("data-poll-id"),r=unescape($.cookie("cthrpolling")),t=[];t.push(r.split(","));t.push(i);$.cookie("cthrpolling",t.join(","),{expires:365,path:"/"});$("#cthr-polling").find(".poll-content").html(loadPollQs());n=!0});$(".poll-popup").on("click",".close-btn",function(){var t=$(".poll-collapse"),n=$(".poll-collapse").closest(".poll-popup");if(n.hasClass("opened")){n.removeClass("opened");n.on("transitionend MSTransitionEnd webkitTransitionEnd oTransitionEnd",function(){n.hasClass("opened")||(t.removeClass("fadeIn"),setTimeout(function(){$("#cthr-polling").empty()},200))})}})});$(window).resize(function(){setTimeout(function(){$(".slider-nav .slick-list").height($(".slick-active").height())},500)});$(function(){function Utils(){}function u(i){i();n.length>0?t.hasClass("show")||t.addClass("show"):t.removeClass("show")}function f(n,t){var r=$("form#enquiry-form"),f=!0,h=[],s,u,i;$("div.type-enquiry input[id^='cb-enq-']").each(function(){$(this).prop("checked")&&h.push($(this).val())});s=[];$("div.job-indus input[id^='jobindus-']").each(function(){$(this).prop("checked")&&s.push($(this).val())});u={name:r.find("input#enquiry-form-name").val(),company:r.find("input#enquiry-form-company").val(),industry:s,email:r.find("input#enquiry-form-email").val(),countryCode:$.trim(r.find("select#enquiry-form-country-code").val()),contactNo:r.find("input#enquiry-form-contact").val(),typeEnquiry:h,content:$.trim(r.find("textarea#enquiry-form-content").val())};i=r.find("div.name .alert-danger");u.name==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):i.hide();i=r.find("div.company .alert-danger");u.company==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):i.hide();i=r.find("div.job-indus .alert-danger");u.industry==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):i.hide();i=r.find("div.email .alert-danger");u.email==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):e(u.email)?i.hide():(f=!1,i.find(".alertMsg").html(i.attr("data-err-invalid")),i.show());i=r.find("div.contact-no .alert-danger");u.contactNo==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):o(u.contactNo,u.countryCode)?i.hide():(f=!1,i.find(".alertMsg").html(i.attr("data-err-invalid")),i.show());i=r.find("div.type-enquiry .alert-danger");u.typeEnquiry==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):i.hide();i=r.find("div.enquiry-content .alert-danger");u.content==""?(f=!1,i.find(".alertMsg").html(i.attr("data-err-empty")),i.show()):i.hide();f&&t&&($("#loading_image").show(),$.ajax({type:"POST",url:"/CTHR/SubmitEnquiry",cache:!1,async:!1,data:u,my_name:"submitEnquiry",success:function(n){n===!0&&($("#loading_image").hide(),$("form#enquiry-form").remove(),$("div.advertise-ways").hide(),$("div.msg-open-form.open-desc").hide(),$("#thankyouMsgDiv").show(),$("div[canvas=container]").scrollTop()<$("#get-started-on-ctgoodjobs").offset().top+$("#get-started-on-ctgoodjobs").height()&&$("div[canvas=container]").animate({scrollTop:$("#get-started-on-ctgoodjobs").offset().top},1e3))},error:function(){return!1}}))}function e(n){return(bValid=!1,n?(i=n.indexOf("@"),i>0&&(j=n.indexOf(".",i),j>0&&n.indexOf("/")<0&&n.indexOf(" ")<0&&n.charAt(n.length-1)!="."&&(bValid=!0))):bValid=!0,n.indexOf("'")<0||(bValid=!1),!bValid)?!1:!0}function o(n,t){var r=!0;for(i=0;i<n.length;i++)if(chr=n.charAt(i),!(chr>="0"&&chr<="9"||chr==" "||chr=="-")){r=!1;break}return t!="undefined"&&t=="+852"&&n.length!=8&&(r=!1),r}var Utils,r,t,n;$(".slider-nav").slick({dots:!0,speed:300,slidesToShow:1,slidesToScroll:1,autoplay:!0,autoplaySpeed:8e3,responsive:[{breakpoint:768,settings:{adaptiveHeight:!0}}]});$(window).on("resize orientationchange",function(){$(".slider-nav").slick("refresh")});detectIE()&&setTimeout(function(){$(".slider-nav").slick("refresh")},800);Utils.prototype={constructor:Utils,isElementInView:function(n,t){var i=$("div[canvas=container]").scrollTop(),u=i+$("div[canvas=container]").height(),r=$(n).offset()!=undefined?$(n).offset().top:0,f=r+$(n).height();return t===!0?i<r&&u>f:r<=u&&f>=i}};Utils=new Utils;r=!1;$("div[canvas=container]").scroll(function(){var n=Utils.isElementInView($("#recruitment-tools"),!1),t=Utils.isElementInView($("#get-started-on-ctgoodjobs"),!1);(n||t)&&r==!1&&(r=!0,insertActionLogAjax("scroll","cthr-home","why-ct-section"))});$(document).on("click",".slider-header.header-recruitment a#myhr-explore-btn",function(){insertActionLogAjax("click","cthr-home","myhr-explore-btn")});$(".slider-header.header-salary-check a#salarycheck-explore-btn").on("click",function(){insertActionLogAjax("click","cthr-home","salarycheck-explore-btn")});$(".slider-header.header-survey-report a#survey-report-explore-btn").on("click",function(){insertActionLogAjax("click","cthr-home","survey-report-explore-btn")});$(".slider-header.header-hr-courses a#hr-course-explore-btn").on("click",function(){insertActionLogAjax("click","cthr-home","hr-course-explore-btn")});$(".slider-header.header-survey-report #extra-survey-report a").on("click",function(){insertActionLogAjax("click","cthr-home","survey-report-slider",$(this).attr("data-blk-id"))});$(".slider-header.header-hr-courses #extra-hr-courses a").on("click",function(){insertActionLogAjax("click","cthr-home","hr-courses-slider",$(this).attr("data-blk-id"))});$("#cthr-highlights .article-blk a").on("click",function(){insertActionLogAjax("click","cthr-home","article-news-blk",$(this).parent().attr("data-blk-id"))});$(".slider-header.header-hr-courses #extra-hr-courses a").each(function(){insertActionLogAjax("impression","cthr-home","hr-courses-slider",$(this).attr("data-blk-id"))});$("header .title").fitText(1.2,{minFontSize:"20px",maxFontSize:"30px"});$("#explore-recruitment-tools-btn").add("#get-started-now-btn").on("click",function(){$("#employer-login-modal").modal("hide")});$("[canvas=container]").on("scroll",function(){$("footer").length>0&&(window.matchMedia("(max-width: 767px)").matches?$(this).scrollTop()>160?$(".sticky-contact-us").fadeIn(400):$(".sticky-contact-us").fadeOut(400):window.matchMedia("(min-width: 768px) and (max-height: 768px)").matches?$(this).scrollTop()>160&&$(this).scrollTop()+$(this).innerHeight()<$(this)[0].scrollHeight-$(".sticky-back-to-top").scrollTop()?$(".sticky-contact-us").fadeIn(400):$(".sticky-contact-us").fadeOut(400):$(this).scrollTop()+$(this).innerHeight()<$(this)[0].scrollHeight&&$(".sticky-contact-us").fadeIn(400))});t=$(".act-field .clear-btn");n=[];window.addEventListener("click",function(n){var t=$(".criteria-content.show");t.length>0&&($(".criteria-content.show").prev().parent().has(n.target).length||t.has(n.target).length||($(".criteria-content").removeClass("show"),$(".criteria-w").removeClass("criteria-on")))});$(".act-field").on("click",function(n){if($(".criteria-w").not($(this).parent()).removeClass("criteria-on"),$(n.target).is("a.done-btn"))$(".criteria-content").removeClass("show"),$(".criteria-w").removeClass("criteria-on");else{$(this).parents(".criteria-w").toggleClass("criteria-on");var t=$(this).attr("data-target-menu"),i=$(t);$(".criteria-content").not(t).removeClass("show");i.toggleClass("show")}});$(".clear-btn").click(function(t){if(t.stopPropagation(),$(this).css("opacity")!=0){var i=$(this).closest(".act-field").find(".field-txt");u(function(){var t=$(".criteria-content li");t.find("input[type=checkbox]").prop("checked",!1);t.find(".item").removeClass("selected");n=[];$(i).html($(i).attr("data-msg-default"))})}else $(this).closest(".act-field").click()});$(".criteria-w:not(.single-choice) .criteria-content .primary").on("click","a",function(t){var f,s,i;t.preventDefault();var e=$(this),r=$(this).closest(".criteria-w").find(".field-txt"),o=$(this).find("input").attr("id");e.hasClass("selected")?u(function(){var t=n.indexOf(o);t>-1&&n.splice(t,1)}):u(function(){n.push(o)});f=$(this).find("input[type=checkbox]");f.prop("checked",!f.prop("checked"));e.toggleClass("selected");s=ui_add_more!="undefined"?ui_add_more:"more";i="";n.length?(n.length==1&&(i+=$("#"+n[n.length-1]).closest(".cb-item").find(".title").html()),n.length==2&&(i+=$("#"+n[0]).closest(".cb-item").find(".title").html()+" , "+$("#"+n[1]).closest(".cb-item").find(".title").html()),n.length>2&&(i+=$("#"+n[0]).closest(".cb-item").find(".title").html()+" , "+$("#"+n[1]).closest(".cb-item").find(".title").html(),i+="  + "+(n.length-2),i+=" "+s),$(r).html(i)):$(r).html($(r).attr("data-msg-default"))});$(".submit a#enquiry-form-send").on("click",function(n){n.preventDefault();f($(this),!0)})}),function(n){window.addEventListener("click",function(t){var i=n(".multiselect .choice-w.p-show"),r,u;i.length>0&&(r=n(t.target).closest(".multiselect"),u=n(i.closest(".multiselect")),u.each(function(){n(this).is(r)||(n(this).find(".choice-w").removeClass("p-show").removeAttr("style"),n(this).find(".choice-w").find(".item-list .primary .header-item").removeClass("selected"),n("body").hasClass("mobile")&&(n(this).find(".choice-w").prev().find(".btn-done").removeClass("show"),n(this).find(".choice-w").prev().removeClass("cs-show")))}),n(".bootstrap-select.open").removeClass("open"))});n(".choice").mCustomScrollbar({theme:"dark",mouseWheel:{scrollAmount:200}});n(".w-toggle-btns input").each(function(){var t=n(this),i=t.next(),r=i.html();i.remove();t.iCheck({checkboxClass:"icheckbox_line-blue",insert:r})});n(".multiselect .custom-select .clear-btn").removeClass("show").delay(2).addClass("v-hidden");n(".multiselect .choice-w").hasClass("w-toggle-btns")?n(".w-toggle-btns input").iCheck("uncheck"):n(".multiselect .checkbox-custom:checked").prop("checked",!1);n(".w-toggle-btns input").on("ifClicked",function(){n(this).closest(".item").click()});n(".multiselect .btn-done").on("click",function(){n(this).closest(".choice-w").removeClass("p-show").removeAttr("style");n(this).closest(".choice-w").find(".item-list .primary .header-item").removeClass("selected")});n(".multiselect .select-all-options .select-all").on("click",function(){n(this).closest(".choice-w").hasClass("w-toggle-btns")?n(this).closest(".choice-w").find(".choice .item").each(function(){n(this).find(".icheckbox_line-blue").hasClass("checked")||n(this).click()}):n(this).closest(".select-all-options").next(".choice").find(".item").each(function(){n(this).find(".checkbox-custom").prop("checked")||n(this).click()})});n(".multiselect .custom-select").on("click",function(){n(n(this).data("target")).toggle();var r=n(this).attr("data-target"),t=n(r),i=n(this).find(".btn-done");n(this).closest(".multiselect").hasClass("multilayer")&&(t.find(".primary .header-item").removeClass("open"),t.find(".primary .header-item i").removeClass("fa-angle-up").addClass("fa-angle-down"),t.find(".secondary").hide());n(this).toggleClass("cs-show");t.toggleClass("p-show");n("body").hasClass("mobile")&&(i.hasClass("show")?(i.removeClass("show").delay(2).addClass("v-hidden"),n(this).removeClass("cs-show")):(i.removeClass("v-hidden").addClass("show"),n(this).addClass("cs-show")))});n(".multiselect .custom-item .btn-custom-input-submit").on("click",function(){var r=n(this).closest(".custom-item"),t=n(this).closest(".multiselect"),u=t.find(".custom-select .clear-btn"),i;r.addClass("selected");u.hasClass("show")||u.removeClass("v-hidden").addClass("show");i=t.find(".custom-select .icon").length>0?t.find(".custom-select .text"):t.find(".custom-select span:first");i.hasClass("not-selected")&&i.removeClass("not-selected");i.html(r.find(".form-control-custom").val());t.find(".choice-w").removeClass("p-show").removeAttr("style")});n(".multiselect").find(".multiselect-dropdown a").on("click",function(t){var r=n(this),i=n(this).closest(".multiselect"),s=i.find(".custom-select .clear-btn"),y=i.find(".custom-select .btn-done"),e=n(this).attr("data-id"),a,v=typeof ui_add_more!="undefined"?ui_add_more:"more",h,f,o,c,u,l;return n(this).closest(".multiselect-dropdown").hasClass("primary")&&(a=n(this).closest(".multiselect-dropdown").find('.secondary[data-parent-id="'+e+'"]')),n(this).closest(".multiselect-dropdown").hasClass("single-choice")?r.hasClass("header-item")||(h=n(this).find("input[type=radio]"),h.prop("checked",!h.prop("checked")),h.prop("checked")&&(r.addClass("selected"),s.hasClass("show")||s.removeClass("v-hidden").addClass("show"),u=i.find(".custom-select .icon").length>0?i.find(".custom-select .text"):i.find(".custom-select span:first"),u.hasClass("not-selected")&&u.removeClass("not-selected"),u.html(r.find(".radio-custom-label").html()),i.find(".choice-w").removeClass("p-show").removeAttr("style"))):(i.data("selectedIds")||i.data("selectedIds",[]),r.hasClass("header-item")?r.hasClass("w-cb")&&n(t.target).is(".checkbox-custom-label")?(f=n(this).find("input[type=checkbox]"),f.prop("checked",!f.prop("checked"))):(r.toggleClass("open"),r.find("i").toggleClass("fa-angle-down").toggleClass("fa-angle-up"),a.slideToggle(250),r.toggleClass("selected")):(f=n(this).find("input[type=checkbox]"),f.prop("checked",!f.prop("checked")),i.find(".choice-w").hasClass("w-toggle-btns")&&f.parent().toggleClass("checked"),f.prop("checked")?i.find(".choice-w").attr("data-max-choice")?i.data("selectedIds").length<i.find(".choice-w").attr("data-max-choice")?(i.data("selectedIds").push(e),r.addClass("selected"),o=i.find('.choice-w a[data-id="'+e+'"] > label').html(),i.closest(".multiselect-dropdown").hasClass("primary")?i.find(".choice-w > .selected").append('<a href="javascript:void(0)" data-parent-id="'+r.closest(".secondary").attr("data-parent-id")+'" data-cb-item="'+e+'" class="round-tag">'+o+'<i class="fa fa-times"><\/i><\/a>'):i.find(".choice-w > .selected").append('<a href="javascript:void(0)" data-cb-item="'+e+'" class="round-tag">'+o+'<i class="fa fa-times"><\/i><\/a>'),i.find(".alert").hide()):(i.find(".alert").show(),f.prop("checked",!f.prop("checked"))):(i.data("selectedIds").push(e),r.addClass("selected"),o=i.find('.choice-w a[data-id="'+e+'"] > label').html(),i.find(".choice-w > .selected").append('<a href="javascript:void(0)" data-cb-item="'+e+'" class="round-tag">'+o+'<i class="fa fa-times"><\/i><\/a>')):(i.find(".alert").hide(),r.removeClass("selected"),c=i.data("selectedIds").indexOf(e),c>-1&&i.data("selectedIds").splice(c,1),n('.round-tag[data-cb-item="'+e+'"]').remove()),i.data("selectedIds").length>0?(s.hasClass("show")||s.removeClass("v-hidden").addClass("show"),i.data("selectedIds").length>1?(u=i.find(".custom-select .icon").length>0?i.find(".custom-select .text"):i.find(".custom-select span:first"),i.find(".choice-w").hasClass("w-toggle-btns")?u.html(i.find('.choice-w a[data-id="'+i.data("selectedIds")[0]+'"] .text-w-icon').html()+" +"+(i.data("selectedIds").length-1)+" "+v):u.html(i.find('.choice-w a[data-id="'+i.data("selectedIds")[0]+'"] > label').html()+" +"+(i.data("selectedIds").length-1)+" "+v)):(u=i.find(".custom-select .icon").length>0?i.find(".custom-select .text"):i.find(".custom-select span:first"),u.hasClass("not-selected")&&u.removeClass("not-selected"),i.find(".choice-w").hasClass("w-toggle-btns")?u.html(i.find('.choice-w a[data-id="'+i.data("selectedIds")[0]+'"] .text-w-icon').html()):u.html(i.find('.choice-w a[data-id="'+i.data("selectedIds")[0]+'"] > label').html())),n(this).closest(".multiselect-dropdown").hasClass("primary")&&(r.closest(".secondary").find(".checkbox-custom:checked").length<=0?(r.closest(".secondary").slideUp(),r.closest(".secondary").prev(".header-item").removeClass("selected"),r.closest(".secondary").prev(".header-item").removeClass("open"),r.closest(".secondary").prev(".header-item").find("i").removeClass("fa-angle-up").addClass("fa-angle-down"),r.closest(".secondary").prev(".header-item").find(".badge").hide()):(r.closest(".secondary").prev(".header-item").find(".badge").html(r.closest(".secondary").find(".checkbox-custom:checked").length),r.closest(".secondary").prev(".header-item").find(".badge").show()))):(s.removeClass("show").delay(2).addClass("v-hidden"),u=i.find(".custom-select .icon").length>0?i.find(".custom-select .text"):i.find(".custom-select span:first"),u.addClass("not-selected"),l=i.prev("label").clone(),l.find("span").remove(),u.attr("data-no-value")?u.html(u.attr("data-no-value")):u.html("Choose "+l.html()),n(this).closest(".multiselect-dropdown").hasClass("primary")&&(i.find(".secondary").slideUp(),i.find(".primary .header-item").removeClass("selected"),i.find(".primary .header-item").removeClass("open"),i.find(".primary .header-item i").removeClass("fa-angle-up").addClass("fa-angle-down"),i.find(".primary .header-item .badge").hide())))),!1});n(".multiselect").on("click",".round-tag",function(){var t=n(this).closest(".multiselect"),e=n(this).attr("data-cb-item"),o=t.find(".custom-select .clear-btn"),s=typeof ui_add_more!="undefined"?ui_add_more:"more",i=t.find('.choice-w a[data-id="'+e+'"]'),u,r,f;return i.find(".checkbox-custom").prop("checked",!1),i.removeClass("selected"),t.data("selectedIds")||t.data("selectedIds",[]),u=t.data("selectedIds").indexOf(e),u>-1&&t.data("selectedIds").splice(u,1),n(this).remove(),t.data("selectedIds").length>0?(r=t.find(".custom-select .icon").length>0?t.find(".custom-select .text"):t.find(".custom-select span:first"),t.data("selectedIds").length>1?r.html(t.find('.choice-w a[data-id="'+t.data("selectedIds")[0]+'"] > label').html()+" +"+(t.data("selectedIds").length-1)+" "+s):(r.hasClass("not-selected")&&r.removeClass("not-selected"),r.html(t.find('.choice-w a[data-id="'+t.data("selectedIds")[0]+'"] > label').html())),i.closest(".multiselect-dropdown").hasClass("primary")&&(i.closest(".secondary").find(".checkbox-custom:checked").length<=0?(i.closest(".secondary").slideUp(),i.closest(".secondary").prev(".header-item").removeClass("selected"),i.closest(".secondary").prev(".header-item").removeClass("open"),i.closest(".secondary").prev(".header-item").find("i").removeClass("fa-angle-up").addClass("fa-angle-down"),i.closest(".secondary").prev(".header-item").find(".badge").hide()):(i.closest(".secondary").prev(".header-item").find(".badge").html(i.closest(".secondary").find(".checkbox-custom:checked").length),i.closest(".secondary").prev(".header-item").find(".badge").show())),t.data("selectedIds").length<t.find(".choice-w").attr("data-max-choice")&&t.find(".alert").hide()):(o.removeClass("show").delay(2).addClass("v-hidden"),r=t.find(".custom-select .icon").length>0?t.find(".custom-select .text"):t.find(".custom-select span:first"),r.addClass("not-selected"),f=t.prev("label").clone(),f.find("span").remove(),r.attr("data-no-value")?r.html(r.attr("data-no-value")):r.html("Choose "+f.html()),t.find(".multiselect-dropdown").hasClass("primary")&&(t.find(".secondary").slideUp(),t.find(".primary .header-item").removeClass("selected"),t.find(".primary .header-item.w-cb input").prop("checked",!1),t.find(".primary .header-item").removeClass("open"),t.find(".primary .header-item i").removeClass("fa-angle-up").addClass("fa-angle-down"),t.find(".primary .header-item .badge").hide())),!1});n(".multiselect .custom-select .clear-btn").on("click",function(t){var i,f,r,u;return t.stopPropagation(),i=n(this).closest(".multiselect"),f=i.find(".choice-w li"),i.find(".multiselect-dropdown").hasClass("single-choice")?(f.find("input[type=radio]").prop("checked",!1),n(this).removeClass("show").delay(2).addClass("v-hidden"),r=i.find(".custom-select .icon").length>0?i.find(".custom-select .text"):i.find(".custom-select span:first"),r.addClass("not-selected"),u=i.prev(".col-form-label").clone(),u.find("span").remove(),r.attr("data-no-value")?r.html(r.attr("data-no-value")):r.html("Choose "+u.html())):(n(".multiselect .choice-w").hasClass("w-toggle-btns")?f.find("input").iCheck("uncheck"):f.find("input[type=checkbox]").prop("checked",!1),f.find(".item").removeClass("selected"),n(this).removeClass("show").delay(2).addClass("v-hidden"),r=i.find(".custom-select .icon").length>0?i.find(".custom-select .text"):i.find(".custom-select span:first"),r.addClass("not-selected"),u=i.prev("label").clone(),u.find("span").remove(),r.attr("data-no-value")?r.html(i.find(".custom-select .text").attr("data-no-value")):r.html("Choose "+u.html()),i.find(".alert").hide(),i.find(".multiselect-dropdown").hasClass("primary")&&(i.find(".secondary").slideUp(),i.find(".primary .header-item").removeClass("selected"),i.find(".primary .header-item").removeClass("open"),i.find(".primary .header-item i").removeClass("fa-angle-up").addClass("fa-angle-down"),i.find(".primary .header-item .badge").hide()),i.find(".choice-w > .selected").html(""),i.data("selectedIds",[])),!1});n(".selectpicker").selectpicker({noneSelectedText:""});n(".selectpicker").on("shown.bs.select",function(){var t=n(".multiselect .choice-w.p-show");t.removeClass("p-show").removeAttr("style");t.find(".item-list .primary .header-item").removeClass("selected");n("body").hasClass("mobile")&&(t.prev().find(".btn-done").removeClass("show"),t.prev().removeClass("cs-show"))});n(document).on("show.bs.dropdown",function(){n(".dropdown-backdrop").off().remove()})}(jQuery)