index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
chaty
/
admin
/
assets
/
js
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/chaty/admin/assets/js/cht-scripts.min.js
function checkForUserCountry(){""!=getUserCountry()&&setWhatsAppCountryFlag()}function getUserCountry(){var t=chatyGetCookie("cht_country_code");return t||setClientCountry(),t}function setClientCountry(){chatyGetCookie("cht_country_code")||jQuery.get("https://www.cloudflare.com/cdn-cgi/trace",function(t){if(t){var e="-",a=t.match("loc=(.*)");a.length>1&&(a=a[1])&&""==(e=a.toUpperCase())&&(e="-")}chatySetCookie("cht_country_code",e,720),setWhatsAppCountryFlag()})}function setWhatsAppCountryFlag(){if(jQuery("#channel_input_Whatsapp").length){cht_settings.channel_settings.Whatsapp=document.querySelector("#channel_input_Whatsapp"),cht_settings.channel_settings.Whatsapp_Country=window.intlTelInput(cht_settings.channel_settings.Whatsapp,{formatOnDisplay:!1,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,autoHideDialCode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"});var t=getUserCountry();"-"!=t&&""==jQuery("#channel_input_Whatsapp").val()?setTimeout(function(){cht_settings.channel_settings.Whatsapp_Country.setCountry(t),jQuery("#channel_input_Whatsapp").trigger("keyup")},200):""!=jQuery("#channel_input_Whatsapp").val()&&setTimeout(function(){jQuery("#channel_input_Whatsapp").trigger("keyup")},200)}jQuery(".custom-channel-Whatsapp:not(#channel_input_Whatsapp)").length&&jQuery(".custom-channel-Whatsapp:not(#channel_input_Whatsapp)").each(function(){var t=jQuery(this).closest("li.chaty-channel").data("id");void 0!=t&&jQuery("#channel_input_"+t).length&&(cht_settings.channel_settings[t]=document.querySelector("#channel_input_"+t),window.intlTelInput(cht_settings.channel_settings[t],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"}))})}function check_for_number_chaty(t,e){return!!(""!=t&&("+"==t[0]&&(t=t.substr(1,t.length)),"Phone"==e&&"*"==t[0]&&(t=t.substr(1,t.length)),isNaN(t)))}function check_for_preview_pos(){if(jQuery(".chaty-setting-form").length){if(jQuery(window).width()>1179){var t=parseInt(jQuery(".chaty-setting-form").offset().top);jQuery(".btn-save-sticky").css("top",t+58),jQuery(".btn-help, .preview-help-btn").css("top",t+58+145),jQuery("a.remove-chaty-widget-sticky").css("top",t+58+145+119)}else jQuery(".btn-save-sticky").attr("style",""),jQuery(".btn-help, .preview-help-btn").attr("style",""),jQuery("a.remove-chaty-widget-sticky").attr("style","")}}jQuery(function(t){"use strict";var e,a=!1,i=!1,c=!1,o=!1,n=!1,s=!1,l=!1;function r(){if(t(".chaty-popup").hide(),0==t("#cht-form .js-chanel-desktop").length||0==t("#cht-form .js-chanel-mobile").length)return t("#no-device-popup").show(),!1;if(0==t("#cht-form .js-chanel-desktop:checked").length&&0==t("#cht-form .js-chanel-mobile:checked").length)return t("#device-popup").show(),!1;var e=0;return(t("#channels-selected-list > li:not(#chaty-social-close)").find(".channels__input").each(function(){""==jQuery.trim(t(this).val())?e++:jQuery(this).hasClass("custom-channel-Whatsapp")&&-1==jQuery.trim(t(this).val()).indexOf("-")&&e++}),e!=t("#channels-selected-list > li:not(#chaty-social-close)").find(".channels__input").length||t("#chaty-social-Contact_Us").length||t("#chaty-social-Chatway").length)?p():(t("#no-device-value").show(),!1)}function h(){t.ajax({type:"POST",url:ajaxurl,data:{action:"get_chatway_status"},success:function(e){"completed"==e?(t(".chatway--notice--info").addClass("hidden"),t(".chatway--notice").addClass("hidden")):(t(".chatway--notice").removeClass("hidden"),t(".chatway--notice--info").addClass("hidden"),t(".plugin-"+e).removeClass("hidden")),"not-installed"==e||"not-activated"==e?t(".chaty-widget-tab").removeClass("chatway--active"):t(".chaty-widget-tab").addClass("chatway--active")}})}function p(){return(t(".chaty-popup").hide(),t("#trigger_on_time").is(":checked")||t("#chaty_trigger_on_exit").is(":checked")||t("#chaty_trigger_on_scroll").is(":checked"))?d():(t("#trigger-popup").show(),!1)}function d(){return(t(".chaty-popup").hide(),t(".cht_active").is(":checked"))?(a=!0,t("#cht-form").trigger("submit"),!0):(t("#status-popup").show(),!1)}function u(){if(g=!0,i){if(c){if(o){if(n){if(s)!l&&(l=!0,t("#channels-selected-list .phone-number").length&&t("#channels-selected-list .phone-number").each(function(){if(""!=jQuery.trim(t(this).val())&&jQuery.trim(t(this).val()).length>13)return t("#custom-message-popup .chaty-popup-header").text(t(this).data("label")+" number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the "+t(this).data("label")+" number you're trying to enter isn't valid. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}));else if(s=!0,t("#cht-form #Viber").length&&""!=t("#cht-form #Viber").val()){var a=jQuery.trim(t("#cht-form #Viber").val());if(e=check_for_number_chaty(a,"Viber"))return t("#custom-message-popup .chaty-popup-header").text("Viber number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the Viber number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(n=!0,t("#cht-form #SMS").length&&""!=t("#cht-form #SMS").val()){var a=jQuery.trim(t("#cht-form #SMS").val());if(e=check_for_number_chaty(a,"SMS"))return t("#custom-message-popup .chaty-popup-header").text("SMS number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the SMS number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(o=!0,t("#cht-form #Facebook_Messenger").length&&""!=t("#cht-form #Facebook_Messenger").val()){var a=jQuery.trim(t("#Facebook_Messenger").val());if(t("#cht-form #Facebook_Messenger").val(a),!/(?:http:\/\/)?facebook\.com\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/.test(a)&&!/(?:http:\/\/)?m\.me\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-]*)/.test(a))return t("#custom-message-popup .chaty-popup-header").text("Facebook page's URL is not valid"),t("#custom-message-popup .chaty-popup-body").text("Please make sure your Facebook page's URL looks like, <br/>https://m.me/YOURPAGE"),t("#custom-message-popup").show(),!1}}else if(c=!0,t("#cht-form #Phone").length&&""!=t("#cht-form #Phone").val()){var a=jQuery.trim(t("#cht-form #Phone").val());if(e=check_for_number_chaty(a,"Phone"))return t("#custom-message-popup .chaty-popup-header").text("Phone number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the phone number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}}else if(i=!0,t("#cht-form #Whatsapp").length&&""!=t("#cht-form #Whatsapp").val()){var a=jQuery.trim(t("#cht-form #Whatsapp").val());if(e=check_for_number_chaty(a,"Whatsapp"))return t("#custom-message-popup .chaty-popup-header").text("Whatsapp number is not valid"),t("#custom-message-popup .chaty-popup-body").text("Seems like the WhatsApp number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?"),t("#custom-message-popup").show(),!1}return r()}t(document).on("change",'input[name="cht_social_Chatway[chatway_position]"]:checked',function(e){t("#chaty-social-Chatway").removeClass(["above-chaty","inside-chaty","outside-chaty"]),t("#chaty-social-Chatway").addClass(t(this).val()),change_custom_preview()}),t(window).on("load",function(){setTimeout(()=>{t(".wp-editor-container iframe").contents().find("body").css({backgroundColor:"#fff",margin:0,padding:"0px 10px"})},500)});let g=!0;t(document).ready(function(){t(document).on("click",".btn-cancel.is-chatway, .icon.chat-channel-Chatway",function(e){e.preventDefault(),t("#remove-chatway-channel").show()}),t(document).on("click",".btn-cancel.is-chatway",function(e){e.preventDefault(),t("#remove-chatway-channel").show()}),t(document).on("click","#chatway-view-button",function(e){let a="free";t("section").is("#pro")&&(a="pro"),t("#chatyway-info-popup .chaty-popup-inner").removeClass(["step-1","step-2","step-3"]),t("#chatyway-info-popup .chaty-popup-inner").addClass("step-3");let i=t('input[name="chatway_position"]:checked').val();if(t("#chaty_widget_url").length){t("#chatyway-info-popup").hide(),window.location=t("#chaty_widget_url").val()+"&chatway_position="+i;return}t.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"choose_social",social:"Chatway",position:i,nonce_code:cht_nonce_ajax.cht_nonce,version:a,widget_index:t("#widget_index").val()},beforeSend:function(t){},success:function(e){t("#channels-selected-list").prepend(e);let a="Chatway";var i={material:{regular:{"list-icon":"","icon-style":"mt-regular",icons:["some","some2"]}}};t("#icon-picker-"+a).length&&t("#select-icon-"+a).length&&AestheticIconPicker({selector:"#icon-picker-"+a,onClick:"#select-icon-"+a,iconLibrary:i}),t("#icon-picker-agent-"+a).length&&t("#select-icon-agent-"+a).length&&AestheticIconPicker({selector:"#icon-picker-agent-"+a,onClick:"#select-icon-agent-"+a,iconLibrary:i}),t(document).trigger("chatyColorPicker/trigger",[{$scope:t("#chaty-social-Chatway"),element:".chaty-color-field"}]);let c=[];t(".channels-icons > .icon.active").each((t,e)=>{c.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:c,target:"Chatway",action:"added",isExceeded:!1}),t("#chaty-chatway").hasClass("completed")&&t("#chaty-social-channel").trigger("click"),h(),change_custom_preview()}})}),document.addEventListener("visibilitychange",function(){t("#chaty-social-Chatway").length&&"visible"===document.visibilityState&&h()}),t(".add-live-chat-btn").on("click",function(){t("#chatyway-info-popup").hide()}),t(document).on("change",'input[name="cht_social_Chatway[chatway_icon]"]:checked',function(){let e=t('label[for="icon-'+t(this).val()+'"] .chatway-icon').html(),a=t('input[name="cht_social_Chatway[bg_color]"]').val(),i="Chatway";t("#chaty-social-Chatway .chaty-main-svg").html(e),t("#chaty-social-Chatway .chaty-main-svg .color-element").css({fill:a}),jQuery("#cht_social_image_"+i).val(""),jQuery("#cht_social_image_src_"+i).attr("src",default_image),jQuery("#chaty_image_"+i).removeClass("icon-active").removeClass("img-active"),jQuery("#chaty_image_"+i+" .fa-icon").val(""),change_custom_preview()}),t(document).on("click","#chatway-custom-image",function(e){e.preventDefault();let a="Chatway";var i=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){let c=i.state().get("selection").first().toJSON();t("#cht_social_image_"+a).val(c.id),t(".custom-image-"+a+" img").attr("src",c.url),t(".chatway-custom-image img").attr("src",c.url),t("#chaty_image_"+a).addClass("img-active").removeClass("icon-active"),t("#chaty_image_"+a+" .fa-icon").val(""),t(".chatway-custom-image").addClass("img-active"),change_custom_preview(),t("#chatway-custom-image").prop("checked",!0)})}),t(document).on("click","#chatway-remove-custom-image",function(e){t(".chatway-custom-image").removeClass("img-active"),t("#chaty_image_Chatway").removeClass("img-active").removeClass("icon-active"),t("#chaty_image_Chatway .fa-icon").val(""),t("#cht_social_image_Chatway").val("")}),t(document).on("click",".remove--chatway",function(e){e.preventDefault(),t("#chaty-social-Chatway").remove(),t(".chat-channel-Chatway").removeClass("active"),change_custom_preview(),t("#remove-chatway-channel").hide();let a=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{a.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:a,target:"Chatway",action:"removed",isExceeded:!1})}),t(document).on("change","input[name='cht_position']:checked",function(){"custom"==t(this).val()?t("#positionPro").show():t("#positionPro").hide(),change_custom_preview()}),jQuery(".add-live-chat-btn").on("click",function(){jQuery("#chatyway-info-popup").hide()});var e=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))?1:0;t(document).on("change","input[name='cta_type']:checked",function(){"simple-view"==t(this).val()?(t("#simple-view").removeClass("hide-it"),t("#chat-view").addClass("hide-it"),t(".chaty-chat-view-option").removeClass("hide-option"),t("#cta-header-color-setting").addClass("hide-it")):(t("#simple-view").addClass("hide-it"),t("#chat-view").removeClass("hide-it"),t(".chaty-chat-view-option").addClass("hide-option"),t("#cta-header-color-setting").removeClass("hide-it")),change_custom_preview()}),t(document).on("click",".add-properties",function(e){e.preventDefault(),t(this).closest(".properties-box").toggleClass("active")}),t(document).on("click",".properties-list a",function(e){e.preventDefault();var a=t.trim(t(this).data("txt"));if(t(this).closest(".form-horizontal__item").hasClass("has-iframe")){var i=t(this).closest(".form-horizontal__item").find("iframe");i.contents().find("p").length?i.contents().find("p:last-child").append(" "+a):i.contents().find(".mce-content-body").append(" "+a)}else a=t.trim(t.trim(t(this).closest(".form-horizontal__item").find(".add-properties").val())+" "+a),t(this).closest(".form-horizontal__item").find(".add-properties").val(a);change_custom_preview()}),t(document).on("click","#cta_woocommerce_status",function(){t(this).is(":checked")?t(".woocommerce-settings").addClass("active"):t(".woocommerce-settings").removeClass("active")}),t(".form-fonts").SumoSelect({placeholder:"Select font family",csvDispCount:3}),t(".url-options, .url-select, .country-list").SumoSelect(),t("#chaty_attention_effect, #chaty_default_state").SumoSelect({placeholder:"Select font family",csvDispCount:3}),t(document).on("click","#chaty-social-channel",function(){t("#current_step").val(0)}),t(document).on("click","#chaty-app-customize-widget",function(){t("#current_step").val(1)}),t(document).on("click","#chaty-triger-targeting",function(){t("#current_step").val(2)}),jQuery(document).on("click","#update-chaty-traffic-source-rule",function(t){jQuery(".traffic-options-box").addClass("active"),jQuery("#chaty_traffic_source").val("yes")}),jQuery(document).on("click","#remove-traffic-rules",function(t){jQuery(".traffic-options-box").removeClass("active"),jQuery("#chaty_traffic_source").val("no")}),jQuery(document).on("click",".remove-traffic-option",function(t){jQuery(this).closest(".custom-traffic-rule").remove()}),t(document).on("click",".field-setting-col:not(.hide-label-setting) .field-label",function(e){e.preventDefault(),t(this).closest(".label-flex").toggleClass("input-active")}),t(document).on("click",".chaty-switch-toggle",function(){setTimeout(function(){t(".chaty-field-setting").each(function(){t(this).is(":checked")?(t(this).closest(".field-setting-col").find(".field-settings").addClass("active"),t(this).closest(".field-setting-col").removeClass("hide-label-setting")):(t(this).closest(".field-setting-col").find(".field-settings").removeClass("active"),t(this).closest(".field-setting-col").addClass("hide-label-setting"))})},100)}),t(document).on("change",".chaty-close_form_after-setting",function(){setTimeout(function(){t(".chaty-close_form_after-setting").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".close_form_after-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".close_form_after-settings").removeClass("active")})},100)}),t(document).on("click",".agent-button-action, .add-agent-btn",function(t){t.preventDefault(),jQuery("#agent-popup").show()}),t(document).on("keyup","#channel_input_Whatsapp",function(){if(""!=t.trim(t(this).val())){var e=cht_settings.channel_settings.Whatsapp_Country.getSelectedCountryData(),a=t.trim(t(this).val());if("+"!=a[0]&&(a="+"+a,t(this).val(a),t(this).trigger("change")),Reflect.has(e,"dialCode")){var i=e.dialCode;if(a.length>i.length+1&&!a.includes("-")&&a.startsWith(`+${i}`)){var c=a.replace(`+${i}`,"");c=c.replaceAll(" ",""),t(this).val("+"+i+"-"+c)}}e.dialCode&&(a.length<=e.dialCode.length+1?t(this).closest(".test-btn").find(".wf-test-button").removeClass("active"):t(this).closest(".test-btn").find(".wf-test-button").addClass("active")),a.length>0&&!e.dialCode&&t(this).closest(".test-btn").find(".wf-test-button").removeClass("active"),"+"==a[0]&&1==t(this).val().length&&(t(this).closest(".channels__input-box").find(".iti__selected-flag").find(".iti__flag").attr("class","iti__flag"),t(this).closest(".channels__input-box").find(".iti__selected-flag").attr("title",""))}else""==t.trim(t(this).val())&&(t(this).closest(".channels__input-box").find(".iti__selected-flag").find(".iti__flag").attr("class","iti__flag"),t(this).closest(".channels__input-box").find(".iti__selected-flag").attr("title",""))}),t(document).on("click",".remove-zero-btn",function(){let e=t("#channel_input_Whatsapp").val();e=e.replace(/-0+/,"-"),t("#channel_input_Whatsapp").val(e),t(".chaty-popup").hide(),g=!0,u()}),t(document).on("change",".custom-channel-Whatsapp",function(){g=!1}),t(document).on("change",".chaty-redirect-setting",function(){setTimeout(function(){t(".chaty-redirect-setting").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".redirect_action-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".redirect_action-settings").removeClass("active")})},100)}),t(document).on("click",".email-setting",function(){setTimeout(function(){t(".email-setting-field").each(function(){t(this).is(":checked")?t(this).closest(".form-field-setting-col").find(".email-settings").addClass("active"):t(this).closest(".form-field-setting-col").find(".email-settings").removeClass("active")})},100)});let m=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{m.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:m,target:null,action:"added",isExceeded:!1}),setTimeout(()=>{t(".whatsapp-welcome-message iframe").contents().find("body").css({backgroundColor:"#fff"})},100),t(document).on("click",".chaty-embedded-window",function(){setTimeout(function(){t(".embedded_window-checkbox").each(function(){if(t(this).is(":checked")){t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message").addClass("active");let e=t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message iframe");e.contents().find("body").css({backgroundColor:"#fff"});var a=t(".csaas-widget").find(".csaas-cta-close").find("button").html(),i="csaas-form-0-Whatsapp";t("#"+i).addClass("is-active"),t(".csaas-widget").removeClass("csaas-open"),t(".csaas").addClass("form-open"),t("#"+i).addClass("active"),t(".csaas-widget").find(".open-csaas-channel").html(a)}else{t(this).closest("li.chaty-channel").find(".whatsapp-welcome-message").removeClass("active");var i="csaas-form-0-Whatsapp";t("#"+i).removeClass("is-active"),t(".csaas-widget").addClass("csaas-open"),t(".csaas").removeClass("form-open"),t("#"+i).removeClass("active")}})},300)}),jQuery("input[name='switchPreview']:checked").trigger("change"),t(document).on("change","#cht-form input",function(){i=!1,c=!1,o=!1,n=!1,s=!1,l=!1}),t(document).on("click",".remove-js-script",function(e){e.preventDefault(),t(this).closest(".channels__input-box").find("input").val(""),t(this).closest(".channels__input-box").find("input").removeClass("cht-input-error").removeClass("cht-js-error"),t(this).closest(".channels__input-box").find(".cht-error-message").remove(),t(this).remove()}),t("#cht-form").on("submit",function(){if(a)return!0;t(this).find(".cht-input-error").removeClass("cht-input-error"),t(this).find(".cht-js-error").removeClass("cht-input-error"),t(this).find(".cht-error-message").remove(),t(this).find(".remove-js-script").remove(),set_social_channel_order();var e=0;return(t("#chaty-page-options .cht-required").length&&t("#chaty-page-options .cht-required").each(function(){""==jQuery.trim(t(this).val())&&(t(this).addClass("cht-input-error"),e++)}),t(".chaty-data-and-time-rules .cht-required").length&&t(".chaty-data-and-time-rules .cht-required").each(function(){""==jQuery.trim(t(this).val())&&(t(this).addClass("cht-input-error"),e++)}),cht_nonce_ajax.has_js_access||t("#channels-selected-list .channels__input").each(function(){""!=t.trim(t(this).val())&&-1!=t.trim(t(this).val()).toLowerCase().indexOf("javascript")&&(t("body, html").scrollTop(0),t("#chaty-social-channel").trigger("click"),t(this).addClass("cht-input-error cht-js-error"),t(this).after("<span class='cht-error-message'>"+cht_nonce_ajax.js_message+"</span><a href='#' class='remove-js-script'>"+cht_nonce_ajax.remove+"</a>"),e++)}),0==e)?function e(){if(g)return u();if(t(".phone-number-list").html(""),t("#channel_input_Whatsapp").length&&""!=t("#channel_input_Whatsapp").val()&&-1!=t("#channel_input_Whatsapp").val().indexOf("-0")){let a=t("#channel_input_Whatsapp").val(),i,c=`<div class='number-list is-not-agent'>${t(".phone-number-list").data("label")}: <b>${a}</b> <a class="whatsapp-test-btn" target="_blank" href='${"https://wa.me/"+toHtmlEntities(t.trim(a).replace(/[^a-zA-Z0-9 ]/g,""))}'>Test</a></div>`;return t(".phone-number-list").html(c),t("#whatsapp-message-popup").show(),!1}return u()}():(t(".cht-input-error:first").focus(),!1)}),t(".chaty-popup-outer").on("click",function(e){t(".chaty-popup").hide()}),t(".check-for-numbers").on("click",function(){u()}),t(".check-for-device").on("click",function(){r()}),t(".check-for-triggers").on("click",function(){p()}),t(".check-for-status").on("click",function(){d()}),t(".change-status-and-save").on("click",function(){t(".cht_active").prop("checked",!0),a=!0,t(".chaty-popup").hide(),t("#cht-form").trigger("submit")}),t(".status-and-save").on("click",function(){t(".cht_active").prop("checked",!1),a=!0,t(".chaty-popup").hide(),t("#cht-form").trigger("submit")}),jQuery(document).on("click","#create-date-rule",function(t){jQuery("#date-schedule").addClass("active"),jQuery("#cht_date_rules").val("yes")}),jQuery(document).on("click","#remove-date-rule",function(t){jQuery("#date-schedule").removeClass("active"),jQuery("#cht_date_rules").val("no")}),jQuery(document).on("click",".wf-test-button",function(){var a=jQuery(this).data("slug");jQuery("#"+a+"_popup").addClass("active");var i="",c=t(".custom-channel-"+a).val();if(console.log(c),"Whatsapp"==a){var o=c.replaceAll("+","").replaceAll(" ","").replaceAll("-","");i=e?"https://wa.me/"+o:"https://web.whatsapp.com/send?phone="+o,t("#"+a+"_popup").find(".phone-value").text(c)}"Facebook_Messenger"==a&&(i=c,t("#"+a+"_popup").find(".phone-value").text(c)),window.open(i,"_blank")}),t(document).on("click",".edit-number",function(){var e=t(this).closest(".test-popup").data("label");t(".custom-channel-"+e).focus(),t(".test-popup").removeClass("active")}),jQuery(document).on("click",".test-popup-bg, .test-popup-close-btn, .test-popup .save-btn",function(){jQuery(".test-popup").removeClass("active")}),t(document).on("keyup",".custom-channel-Facebook_Messenger",function(){""!=t(this).val()?t(this).closest(".test-btn").find(".wf-test-button").addClass("active"):t(this).closest(".test-btn").find(".wf-test-button").removeClass("active")}),t(document).on("click",".test-popup .contact-link",function(){t(".chaty-help-form").addClass("active"),t(".test-popup").removeClass("active")}),t(document).on("keyup","#wp_popup_headline, #wp_popup_nickname",function(){change_custom_preview()});var f="";t(document).on("click",".upload-wp-profile",function(){f=t(this).data("for");var e=wp.media({title:"Select Whatsapp Profile",multiple:!1,library:{type:"image"}}).open().on("select",function(a){var i=e.state().get("selection").first().toJSON();t("#"+f+"-custom-image-upload .img-value").val(i.url),t("#"+f+"-custom-image-upload").addClass("active"),t("#"+f+"-custom-image-upload .image-info").html("<img src='"+i.url+"'>"),change_custom_preview()})}),t(document).on("click",".remove-custom-img",function(){t(this).closest(".custom-img-upload").removeClass("active"),t(this).closest(".custom-img-upload").find(".image-info").html(""),t(this).closest(".custom-img-upload").find(".img-value").val(""),change_custom_preview()}),checkForUserCountry()})}),function(t){jQuery(window).on("popstate",function(t){window.onbeforeunload=null,window.history&&window.history.pushState&&window.history.back()}),jQuery(document).ready(function(){jQuery(".chaty-table").length||jQuery("body input, body .icon, body textarea, body .btn-cancel:not(.close-btn-set) ").on("click",function(t){window.onbeforeunload=function(t){(t=t||window.event).preventDefault=!0,t.cancelBubble=!0,t.returnValue="Your beautiful goodbye message"}}),jQuery(document).on("submit","form",function(t){window.onbeforeunload=null}),jQuery(document).on("change",".channel-select-input",function(e){var a=t(this).closest("li").attr("data-id");jQuery.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{social:jQuery(this).val(),channel:a,action:"get_chaty_settings"},success:function(e){1==e.status&&("Whatsapp"==e.data.slug?t("#channel_input_"+e.channel).length&&(cht_settings.channel_settings[e.channel]=document.querySelector("#channel_input_"+e.channel),window.intlTelInput(cht_settings.channel_settings[e.channel],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"})):t("#chaty-social-"+e.channel+" .channels__input-box").html("<input type='text' class='channels__input' name='cht_social_"+e.channel+"[value]' id='channel_input_"+e.channel+"' />"),jQuery(".custom-icon-"+e.channel+" svg").html(e.data.svg),jQuery("#chaty-social-"+e.channel).attr("data-channel",e.data.slug),jQuery("#chaty-social-"+e.channel).find(".sp-preview-inner").css("background-color",e.data.color),jQuery("#chaty-social-"+e.channel).find(".chaty-color-field").val(e.data.color),jQuery("#chaty-social-"+e.channel).find(".channels__input").attr("placeholder",e.data.placeholder),jQuery("#chaty-social-"+e.channel).find(".channel-example").text(e.data.example),jQuery("#chaty-social-"+e.channel).find(".chaty-title").val(e.data.title),jQuery("#chaty-social-"+e.channel).find(".icon").attr("data-title",e.data.title),jQuery("#chaty-social-"+e.channel).find(".chaty-color-field").trigger("change"),jQuery(".help-section").html(""),""!=e.data.help_link?jQuery(".help-section").html('<div class="viber-help"><a target="_blank" href="'+e.data.help_link+'">'+e.data.help_title+"</a></div>"):""!=e.data.help_text&&jQuery(".help-section").html('<div class="viber-help"><span class="help-text">'+e.data.help_text+'</span><span class="help-title">'+e.data.help_title+"</span></div>"))}})}),jQuery(document).on("click","#chaty_icons_view",function(t){jQuery(".page-body .chaty-widget").removeClass("vertical").removeClass("horizontal"),jQuery(".page-body .chaty-widget").addClass(jQuery(this).val())}),jQuery(".upg").on("click",function(t){jQuery(".valid_domain_input").val(jQuery(".valid_domain_input").val().replace(" ","")),/^(http(s)?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(jQuery(".valid_domain_input").val())||(t.preventDefault(),jQuery(".valid_domain").fadeIn().css({display:"block"}))}),jQuery(document).on("blur","#channels-selected-list > li:not(#chaty-social-close) .channels__input",function(){jQuery(this).hasClass("border-red")&&""!=jQuery(this).val()&&jQuery(this).removeClass("border-red")});var e=1000000003;jQuery(".show_up").on("click",function(){e+=10,jQuery("#upgrade-modal").css({"z-index":e,display:"block","margin-left":"-258px"})}),jQuery(".color-picker-btn, .color-picker-btn-close, .color-picker-custom button").on("click",function(t){t.preventDefault(),jQuery(".color-picker-box").toggle(),jQuery(".color-picker-btn").toggle()}),t(window).on("click",function(t){0===jQuery(t.target).parents(".color-picker-dropdown").length&&(jQuery(".color-picker-btn").show(),jQuery(".color-picker-box").hide())}),jQuery(".color-picker-radio input").on("change",function(){var t=jQuery(this);if(jQuery('.color-picker-custom input[name="cht_custom_color"]').val(""),jQuery(".color-picker-custom .circle").html("?").css({"background-color":"#fff"}),t.prop("checked")){jQuery(".color-picker-radio input").prop("checked",!1),t.prop("checked",!0);var e=t.val(),a=t.prop("title")}else e=jQuery(".color-picker-custom input").val(),a="Custom";""!=e&&-1==e.indexOf("#")&&(e="#"+e),jQuery(".color-picker-btn .circle").css({backgroundColor:e}),jQuery(".color-picker-btn .text").text(a),jQuery("#chaty-social-close ellipse").attr("fill",e)}),jQuery(".color-picker-custom input").on("change",function(){jQuery(".color-picker-radio input").prop("checked",!1);var t=jQuery(this).val();""!=t&&-1==t.indexOf("#")&&(t="#"+t),jQuery(".color-picker-btn .circle").css({backgroundColor:t}),jQuery(".color-picker-btn .text").text("Custom"),jQuery("#chaty-social-close ellipse").attr("fill",t)}),jQuery('[name="cht_position"]').on("change",function(){jQuery("#positionCustom").prop("checked")?jQuery("#positionPro").show():jQuery("#positionPro").hide()}),jQuery(".update_token").on("click",function(e){e.preventDefault();var a=jQuery('input[name="cht_token"]').val();t.ajax({type:"POST",url:ajaxurl,data:{action:"add_token",nonce_code:cht_nonce_ajax.cht_nonce,token:a},beforeSend:function(t){},success:function(t){t?(alert("Your pro plan is activated"),location.reload()):alert("You`ve entered a wrong token")},error:function(t,e,a){}})})})}(jQuery),function(t){jQuery(document).ready(function(){c();var e=jQuery(".channels-icons > .icon-sm:not(.chat-channel-Chatway)"),a=jQuery(".social-inputs"),i=0;function c(){!jQuery("section").is("#pro")&&(jQuery(".channels-selected__item").length<=1?jQuery(".channels-selected__item").hide():jQuery(".channels-selected__item").length>=2&&jQuery(".channels-selected__item").show())}jQuery("input[name=cht_custom_color]").on("keyup",function(t){var e=jQuery(this).val();jQuery(".circle").html(""),""!=e&&(-1==e.indexOf("#")&&(e="#"+e),jQuery(".color-picker-custom .circle").css({"background-color":e})),jQuery(this).val().length<1&&jQuery(".color-picker-custom .circle").html("?")}),e.on("click",function(){jQuery(".popover").removeClass("shake-it"),++i,c();var o=jQuery(this),n=o.data("social");if(a.find(".social-form-group"),o.hasClass("active")){var s=","+jQuery(this).attr("data-social"),l=jQuery(".add_slug").val();l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),o.toggleClass("active");let h=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{h.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:h,target:n,action:"removed",isExceeded:!1});return}if(e.addClass("disabled"),icon=jQuery(this).data("social"),"1"==jQuery(".add_slug").val().indexOf(icon)&&""!=jQuery(".add_slug").val()){var s=","+icon,l=jQuery(".add_slug").val();l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l),l=l.replace(s,""),jQuery(".add_slug").val(l)}else jQuery(".add_slug").val(jQuery(".add_slug").val()+","+jQuery(this).attr("data-social"));o.toggleClass("active"),t.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"choose_social",social:n,nonce_code:cht_nonce_ajax.cht_nonce,version:"free",widget_index:jQuery("#widget_index").val()},beforeSend:function(t){},success:function(a){var i=jQuery(a),o=i.find(".icon").data("title");if(i.data("channel"),!jQuery('.channels-selected div[data-social="'+o+'"]').length&&(jQuery("#chaty-social-close").before(i),jQuery("#chaty-social-"+n+" .chaty-whatsapp-setting-textarea").length&&(editorId=jQuery("#chaty-social-"+n+" .chaty-whatsapp-setting-textarea").attr("id"),tinymce.init({selector:jQuery("#chaty-social-"+n+" .chaty-whatsapp-setting-textarea").attr("id"),toolbar:"bold, italic, underline | emoji",menubar:!1,branding:!1,setup:function(t){t.addButton("emoji",{image:cht_nonce_ajax.icon_img,onclick:function t(){let{createPopup:e}=window.picmoPopup,a=jQuery(".mce-emoji-custom-icon button").attr("id"),i=document.querySelector("#"+a),c=e({},{referenceElement:i,triggerElement:i,position:"right-start",hideOnEmojiSelect:!1});c.toggle(),c.addEventListener("emoji:select",t=>{let e=tinyMCE.get(editorId);e.selection.getNode()&&e.selection.getNode()!==e.getBody()||(e.focus(),e.selection.select(e.getBody(),!0),e.selection.collapse(!1)),tinymce.activeEditor.execCommand("mceInsertContent",!1,t.emoji),change_custom_preview(),jQuery("#csaas-form-0-Whatsapp .csaas-whatsapp-message .csaas-whatsapp-message-content").html(e.getContent())})},classes:"emoji-custom-icon"}),t.on("keyup",function(e){change_custom_preview(),jQuery("#csaas-form-0-Whatsapp .csaas-whatsapp-message .csaas-whatsapp-message-content").html(t.getContent())})}}),tinymce.execCommand("mceAddEditor",!0,editorId))),e.removeClass("disabled"),t("#iconWidget").show(),r(),c(),set_social_channel_order(),check_for_chaty_close_button(),t("#channel_input_Whatsapp").length){cht_settings.channel_settings.Whatsapp=document.querySelector("#channel_input_Whatsapp"),cht_settings.channel_settings.Whatsapp_Country=window.intlTelInput(cht_settings.channel_settings.Whatsapp,{formatOnDisplay:!1,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,autoHideDialCode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"});var s=getUserCountry();"-"!=s&&""==t("#channel_input_Whatsapp").val()?setTimeout(function(){cht_settings.channel_settings.Whatsapp_Country.setCountry(s),t("#channel_input_Whatsapp").closest(".channels__input-box").find(".iti__selected-flag").find(".iti__flag").addClass("iti__"+s),t("#channel_input_Whatsapp").trigger("keyup")},200):""!=t("#channel_input_Whatsapp").val()&&setTimeout(function(){t("#channel_input_Whatsapp").trigger("keyup")},200)}jQuery(".custom-channel-Whatsapp").length&&jQuery(".custom-channel-Whatsapp").each(function(){if(!jQuery(this).closest(".iti__flag-container").length){var t=jQuery(this).closest("li.chaty-channel").data("id");jQuery("#channel_input_"+t).length&&(cht_settings.channel_settings[t]=document.querySelector("#channel_input_"+t),window.intlTelInput(cht_settings.channel_settings[t],{dropdownContainer:document.body,formatOnDisplay:!0,hiddenInput:"full_number",initialCountry:"auto",nationalMode:!1,utilsScript:cht_settings.plugin_url+"admin/assets/js/utils.js"}))}}),jQuery(document).trigger("chatyColorPicker/trigger",[{$scope:jQuery(`#chaty-social-${n}`),element:".chaty-color-field"}]);let l=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{l.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:l,target:n,action:"added",isExceeded:!1})},error:function(t,e,a){}}),c()}),jQuery("body").on("click",".icon, .btn-cancel:not(.close-btn-set):not(.is-chatway)",function(t){if(!jQuery(this).hasClass("close-btn-set")){if(t.preventDefault(),!(jQuery(this).hasClass("icon")&&jQuery(this).hasClass("active"))){if(icon=jQuery(this).data("social"),jQuery(this).hasClass("btn-cancel")){jQuery('.icon.active[data-social^="'+icon+'"]').removeClass("active");var e=","+icon,a=jQuery(".add_slug").val();a=a.replace(e,""),jQuery(".add_slug").val(a);let i=[];jQuery(".channels-icons > .icon.active").each((t,e)=>{i.push(e.dataset.social)}),wp.hooks.doAction("chaty.channel_update",{channel:i,target:icon,action:"removed",isExceeded:!1})}jQuery("#chaty-social-"+icon).remove(),jQuery(this).parent(".channels-selected__item"),r(),c(),set_social_channel_order(),check_for_chaty_close_button()}}}),jQuery(".btn-help").on("click",function(t){window.open("https://premio.io/help/chaty/","_blank")}),jQuery(".free-custom-radio, .free-custom-checkbox").on("click",function(t){t.stopPropagation()});var o=jQuery("[name=cht_cta]"),n=jQuery(".preview .tooltip-show");o.on("keyup",function(){var t=jQuery(".preview .page .icon");o.val().length>=1?t.removeClass("no-tooltip"):t.addClass("no-tooltip"),n.attr("data-title",o.val())});var s='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',l=document.getElementById("iconWidget");function r(){change_custom_preview()}function h(t){return t.element,jQuery('<span><i class="'+t.text+'"></i> '+t.text+"</span>")}function p(t,e){if(jQuery("#iconWidget").length){if(t?l.innerHTML=t:l.innerHTML="",e){var a=jQuery(".color-picker-custom input").val()?jQuery(".color-picker-custom input").val():jQuery(".color-picker-radio input:checked").val();""!=a&&-1==a.indexOf("#")&&(a="#"+a),jQuery(".preview .page #iconWidget svg circle").css({fill:a}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:a}),jQuery("#chaty-social-close ellipse").attr("fill",a)}"open"==(thisVal=jQuery("#chaty_default_state").val())?jQuery(".hide-show-button").addClass("active"):jQuery(".hide-show-button").removeClass("active"),jQuery(".chaty-widget").removeClass("active").removeClass("hover").removeClass("click").removeClass("hide_arrow"),"open"==thisVal?(jQuery(".chaty-widget").addClass("active").addClass("click"),"open"==thisVal&&jQuery(i+":checked").length>1&&jQuery(".chaty-widget").addClass("hide_arrow")):"hover"==thisVal?jQuery(".chaty-widget").addClass("hover"):jQuery(".chaty-widget").addClass("click"),jQuery(".chaty-channels").html("");var i=".js-chanel-mobile";if(d())var i=".js-chanel-desktop";"open"==thisVal&&jQuery(i+":checked").length>1?(jQuery("#chaty_attention_effect").val(""),jQuery("#chaty_attention_effect, .test_textarea").attr("disabled",!0),jQuery("#chaty_attention_effect option:first-child").text("Doesn't apply for the open state"),"Doesn't apply for the open state"!=jQuery(".test_textarea").val()&&jQuery(".test_textarea").attr("data-value",jQuery(".test_textarea").val()),jQuery(".test_textarea").val("Doesn't apply for the open state"),jQuery("#cht_number_of_messages").attr("disabled",!0),jQuery("#cht_pending_messages").attr("disabled",!0),jQuery(".disable-message").addClass("label-tooltip").addClass("icon"),jQuery("#cht_pending_messages").attr("checked",!1),jQuery(".pending-message-items").removeClass("active"),jQuery(".cta-action-radio input").attr("disabled",!0)):(jQuery("#chaty_attention_effect, .test_textarea").attr("disabled",!1),jQuery("#chaty_attention_effect option:first-child").text("None"),jQuery(".test_textarea").attr("placeholder",""),"Doesn't apply for the open state"==jQuery(".test_textarea").val()&&jQuery(".test_textarea").val(jQuery(".test_textarea").attr("data-value")),jQuery("#cht_number_of_messages").attr("disabled",!1),jQuery("#cht_pending_messages").attr("disabled",!1),jQuery(".disable-message").removeClass("label-tooltip").removeClass("icon"),jQuery(".cta-action-radio input").attr("disabled",!1)),jQuery(".page-body .chaty-widget").removeClass("vertical").removeClass("horizontal"),jQuery(i+":checked").length>1?(jQuery(i+":checked").each(function(){var t=jQuery(this).closest("li").find(".icon").html(),t=jQuery(this).closest("li").find(".icon").html(),e=jQuery(this).closest("li").find(".chaty-title").val(),a=jQuery(this).closest(".channels-selected__item").hasClass("img-active")?"img-active":"";""!=e&&(e="<span class='social-tooltip'>"+e+"</span>"),jQuery(".chaty-channels").append("<div class='social-item-box "+a+"'><span class='tooltip-icon'>"+t+"</span>"+e+"</div>")}),"open"==jQuery("#chaty_default_state").val()&&jQuery("#cht_close_button").is(":checked")?(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):"open"!=jQuery("#chaty_default_state").val()?(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):"open"==jQuery("#chaty_default_state").val()&&(jQuery("#iconWidget").hide(),jQuery(".chaty-widget .tooltiptext").hide(),jQuery(".chaty-widget").addClass("hide-arrow")),jQuery(".chaty-widget").removeClass("has-single"),jQuery(".page-body .chaty-widget").addClass(jQuery("#chaty_icons_view").val())):1==jQuery(i+":checked").length?("open"!=jQuery("#chaty_default_state").val()||jQuery("#cht_close_button").is(":checked")?"open"!=jQuery("#chaty_default_state").val()&&(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")):(jQuery("#iconWidget").css("display","block"),jQuery(".chaty-widget .tooltiptext").css("display","block"),jQuery(".chaty-widget").removeClass("hide-arrow")),jQuery(".chaty-widget").addClass("has-single"),jQuery(".chaty-widget").removeClass("hide-arrow")):0==jQuery(i+":checked").length&&(jQuery("#iconWidget").hide(),jQuery(".chaty-widget .tooltiptext").hide(),jQuery(".chaty-widget").addClass("hide-arrow"),jQuery(".chaty-widget").removeClass("has-single")),jQuery(".chaty-channels .remove-icon-img").remove(),jQuery("#trigger_on_time").is(":checked")?jQuery("#chaty_trigger_time").attr("readonly",!1):jQuery("#chaty_trigger_time").attr("readonly",!0),jQuery("#chaty_trigger_hide").is(":checked")?jQuery("#chaty_trigger_hide_time").attr("readonly",!1):jQuery("#chaty_trigger_hide_time").attr("readonly",!0),jQuery("#chaty_trigger_on_scroll").is(":checked")?jQuery("#chaty_trigger_on_page_scroll").attr("readonly",!1):jQuery("#chaty_trigger_on_page_scroll").attr("readonly",!0),""==jQuery(".chaty-widget .tooltiptext").text()?jQuery(".chaty-widget .tooltiptext").hide():"open"==jQuery("#chaty_default_state").val()&&jQuery(i+":checked").length>1?jQuery(".chaty-widget .tooltiptext").hide():jQuery(".chaty-widget .tooltiptext").css("display","block")}}function d(){return!!jQuery("#previewDesktop").is(":checked")}jQuery(".color-picker-radio input:checked").val(),jQuery(document).on("keyup","textarea.test_textarea, .chaty-title",function(){r()}),jQuery(".js-switch-preview").on("change",function(){d()?jQuery(this).closest(".preview").removeClass("mobiel-view"):jQuery(this).closest(".preview").addClass("mobiel-view"),r()}),jQuery(document).on("change","input[name='cht_pending_messages']",function(){jQuery("#cht_pending_messages").is(":checked")?jQuery(".pending-message-items").addClass("active"):jQuery(".pending-message-items").removeClass("active"),r()}),jQuery(document).on("change","#cht_number_of_messages",function(){r()}),jQuery(document).on("change","#cht_number_color, #cht_number_bg_color",function(){r()}),jQuery(document).on("keyup","#cht_number_of_messages",function(){r()}),jQuery(document).on("blur","#cht_number_of_messages",function(){r()}),jQuery(document).on("change",".js-chanel-icon",function(){r()}),jQuery(document).on("change",".js-widget-i",function(t){s=t.target.classList.contains("js-upload")?jQuery(".file-preview-image").last().parent().html():jQuery("i[data-type="+jQuery(".js-widget-i:checked").val()+"]").html(),r()}),"chat-image"!==jQuery(".js-widget-i:checked").attr("data-type")&&(s=jQuery("i[data-type="+jQuery(".js-widget-i:checked").attr("data-type")+"]").html(),r())}),jQuery(document).ready(function(){jQuery(".toast-message").length&&(jQuery(".toast-message").show(),jQuery(".toast-message").addClass("active"),setTimeout(function(){jQuery(".toast-message").removeClass("active")},5e3)),jQuery(document).on("click",".toast-close-btn a",function(t){t.preventDefault(),jQuery(".toast-message").removeClass("active")}),jQuery(document).on("click",".chaty-popup-box button, #chaty-intro-popup",function(e){e.stopPropagation();var a=jQuery("#chaty_update_popup_status").val();t("#chaty-intro-popup").remove(),t.ajax({type:"POST",url:ajaxurl,data:{action:"update_popup_status",nonce:a},beforeSend:function(t){},success:function(t){},error:function(t,e,a){}})}),jQuery(document).on("click",".chaty-popup-box",function(t){}),jQuery(document).on("click",".remove-chaty-options",function(e){e.preventDefault(),e.stopPropagation(),confirm("Are you sure you want to delete this widget?")&&t.ajax({type:"POST",url:ajaxurl,data:{action:"remove_chaty_widget",nonce_code:cht_nonce_ajax.cht_nonce,widget_index:jQuery("#widget_index").val()},beforeSend:function(t){},success:function(t){window.location=t},error:function(t,e,a){}})}),window.location.href,window.location.href.indexOf("page=chaty-app&widget=")>-1&&jQuery("#toplevel_page_chaty-app .wp-submenu.wp-submenu-wrap li").each(function(){var t=jQuery(this).find("a").attr("href");void 0!==t&&(jQuery(this).removeClass("current"),window.location.href.indexOf(t)>-1&&t.indexOf("&widget=")>-1&&jQuery(this).addClass("current"))})})}(jQuery),jQuery(window).on("resize",function(){check_for_preview_pos()}),jQuery(window).on("scroll",function(){check_for_preview_pos()}),jQuery(document).ready(function(){check_for_preview_pos()});var totalPageOptions=0,pageOptionContent="",totalDateAndTimeOptions=0,dateAndTimeOptionContent="";jQuery(document).ready(function(){var t=!1;function e(){jQuery(".chaty-whatsapp-setting-textarea").length&&jQuery(".chaty-whatsapp-setting-textarea").each(function(){jQuery("#cht_social_embedded_message_"+jQuery(this).data("id")+"_ifr").length&&tinymce.get(jQuery(this).attr("id")).remove();var t=jQuery(this).attr("id");tinymce.init({selector:jQuery(this).attr("id"),toolbar:"bold, italic, underline | emoji",menubar:!1,branding:!1,setup:function(e){e.addButton("emoji",{image:cht_nonce_ajax.icon_img,onclick:function e(){let{createPopup:a}=window.picmoPopup,i=jQuery(".mce-emoji-custom-icon button").attr("id"),c=document.querySelector("#"+i),o=a({},{referenceElement:c,triggerElement:c,position:"right-start",hideOnEmojiSelect:!1});o.toggle(),o.addEventListener("emoji:select",e=>{let a=tinyMCE.get(t);a.selection.getNode()&&a.selection.getNode()!==a.getBody()||(a.focus(),a.selection.select(a.getBody(),!0),a.selection.collapse(!1)),tinymce.activeEditor.execCommand("mceInsertContent",!1,e.emoji),change_custom_preview(),jQuery("#csaas-form-0-Whatsapp .csaas-whatsapp-message .csaas-whatsapp-message-content").html(a.getContent())})},classes:"emoji-custom-icon"}),e.on("keyup",function(t){change_custom_preview(),jQuery("#csaas-form-0-Whatsapp .csaas-whatsapp-message .csaas-whatsapp-message-content").html(e.getContent())})}}),tinymce.execCommand("mceAddEditor",!0,jQuery(this).attr("id"))})}if((/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(t=!0),totalPageOptions=parseInt(jQuery(".chaty-page-option").length),pageOptionContent=jQuery(".chaty-page-options-html").html(),jQuery(".chaty-page-options-html").remove(),totalDateAndTimeOptions=parseInt(jQuery(".chaty-date-time-option").length),dateAndTimeOptionContent=jQuery(".chaty-date-and-time-options-html").html(),jQuery(".chaty-date-and-time-options-html").remove(),e(),jQuery(".create-rule").on("click",function(){let t=jQuery(this).parents(".chaty-option-box");t.find(".chaty-page-options").removeClass("hidden"),t.find(".remove-rules").removeClass("hidden").addClass("inline-block")}),jQuery(".remove-rules").on("click",function(){let t=jQuery(this).parents(".chaty-option-box");t.find(".chaty-page-options").addClass("hidden"),t.find(".remove-rules").removeClass("inline-block").addClass("hidden")}),jQuery(document).on("change","#chaty_attention_effect",function(){change_custom_preview()}),jQuery(document).on("change","input[name='cht_color']:checked",function(){var t=jQuery(this),e=t.val(),a=t.prop("title");jQuery(".color-picker-btn .circle").css({backgroundColor:e}),jQuery(".color-picker-btn .text").text(a),jQuery("#chaty-social-close ellipse").attr("fill",e),jQuery(".preview .page #iconWidget svg circle").css({fill:e}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:e}),jQuery("#cht_custom_color").val(jQuery(this).val()),change_custom_preview()}),jQuery(document).on("change","input[name='cht_position']:checked",function(){change_custom_preview()}),setInterval(function(){var t=jQuery("#chaty_attention_effect").attr("data-effect");""!=t?(jQuery("#iconWidget").removeClass("chaty-animation-"+t),jQuery("#iconWidget").removeClass("start-now"),setTimeout(function(){jQuery("#iconWidget").addClass("chaty-animation-"+jQuery("#chaty_attention_effect").val()).addClass("start-now")},1e3)):jQuery("#chaty_attention_effect").attr("data-effect",jQuery("#chaty_attention_effect").val())},5e3),jQuery(document).on("click",".remove-chaty",function(){jQuery(".page-options").toggle()}),jQuery(document).on("click",".remove-page-option",function(){jQuery(".chaty-data-and-time-rules ").toggle()}),jQuery("#image-upload-content .custom-control-label").on("click",function(t){return t.stopPropagation(),jQuery(this).closest(".custom-control").find("input[type=radio]").attr("checked",!0),jQuery(".js-widget-i").trigger("change"),!1}),jQuery(document).trigger("chatyColorPicker/trigger",[{$scope:jQuery(document),element:".chaty-color-field"}]),jQuery(".chaty-color-field").on("change",function(){chaty_set_bg_color(),change_custom_preview()}),jQuery(".remove-chaty-img").on("click",function(t){t.stopPropagation()}),t||jQuery("#channels-selected-list").sortable({placeholder:"ui-chaty-state-hl",items:"li.chaty-channel:not(#chaty-social-close)",handle:".move-icon",stop:function(){e()},update:function(t,a){set_social_channel_order(),change_custom_preview(),e()}}),jQuery(".close-button-img img, .close-button-img .image-upload").on("click",function(){var t=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){imageData=t.state().get("selection").first().toJSON(),jQuery(".close-button-img").addClass("active"),jQuery(".close-button-img input").val(imageData.id),jQuery(".close-button-img img").attr("src",imageData.url),change_custom_preview()})}),jQuery(".remove-close-img").on("click",function(){default_image=jQuery("#default_image").val(),jQuery(".close-button-img").removeClass("active"),jQuery(".close-button-img input").val(""),jQuery(".close-button-img img").attr("src",default_image),change_custom_preview()}),jQuery(document).on("click",".chaty-widget.click",function(t){t.preventDefault(),jQuery(".chaty-widget").toggleClass("active")}),jQuery(document).on("change",".url-options.cht-required",function(t){thisVal=jQuery(this).val(),newURL=siteURL=jQuery("#chaty_site_url").val(),"page_has_url"==thisVal?newURL=siteURL:"page_contains"==thisVal?newURL=siteURL+"%s%":"page_start_with"==thisVal?newURL=siteURL+"s%":"page_end_with"==thisVal&&(newURL=siteURL+"%s"),jQuery(this).closest(".url-content").find(".chaty-url").text(newURL)}),check_for_chaty_close_button(),chaty_set_bg_color(),change_custom_preview(),jQuery(".chaty-settings.cls-btn a, .close-btn-set").on("click",function(t){t.preventDefault(),jQuery(".cls-btn-settings, .close-btn-set").toggleClass("active")}),0==jQuery("input[name='cht_position']:checked").length&&(jQuery("#right-position").attr("checked",!0),jQuery("input[name='cht_position']:checked").trigger("change")),0==jQuery("input[name='widget_icon']:checked").length&&(jQuery("input[name='widget_icon']:first").attr("checked",!0),jQuery("input[name='widget_icon']:checked").trigger("change")),jQuery(document).on("change","#cht_widget_font",function(){var t=jQuery("#cht_widget_font").val();"System Stack"==t&&(t="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif");var e=jQuery("#cht_widget_font option:selected").data("group");jQuery(".chaty-google-font").remove(),"Google Fonts"==e&&(jQuery("head").append('<link class="chaty-google-font" rel="preload" as="style" href="https://fonts.googleapis.com/css?family='+t+'&display=swap">'),jQuery("head").append('<link class="chaty-google-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family='+t+'&display=swap">')),change_custom_preview()}),""!=jQuery("#cht_widget_font").val()){var a=jQuery("#cht_widget_font").val();"System Stack"==a&&(a="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"),jQuery("#csaas-widget-0").css("font-family",a);var i=jQuery("#cht_widget_font option:selected").data("group");jQuery(".chaty-google-font").remove(),"Google Fonts"==i&&(jQuery("head").append('<link class="chaty-google-font" rel="preload" as="style" href="https://fonts.googleapis.com/css?family='+a+'&display=swap">'),jQuery("head").append('<link class="chaty-google-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family='+a+'&display=swap">'))}}),jQuery(window).on("load",function(){check_for_chaty_close_button(),chaty_set_bg_color(),jQuery(".chaty-page-options .chaty-page-option").removeClass("last"),jQuery(".chaty-page-options .chaty-page-option:last").addClass("last"),jQuery(".url-options.cht-required").each(function(){jQuery(this).trigger("change")})});var selectedsocialSlug="";function upload_chaty_image(t){selectedsocialSlug=t;var e=wp.media({title:"Upload Image",multiple:!1,library:{type:"image"}}).open().on("select",function(t){imageData=e.state().get("selection").first().toJSON(),jQuery("#cht_social_image_"+selectedsocialSlug).val(imageData.id),jQuery(".custom-image-"+selectedsocialSlug+" img").attr("src",imageData.url),jQuery("#chaty-social-"+selectedsocialSlug+" .channels-selected__item").addClass("img-active"),change_custom_preview()})}function toggle_chaty_setting(t){if(jQuery("#chaty-social-"+t).find(".chaty-advance-settings").toggle(),jQuery("#chaty-social-"+t).find(".chaty-advance-settings").toggleClass("active"),"Contact_Us"==t&&jQuery("#Contact_Us-close-btn").length){var e=jQuery("#Contact_Us-close-btn").data("nonce");jQuery("#Contact_Us-close-btn").hasClass("active")||(jQuery("#Contact_Us-close-btn").addClass("active"),jQuery.ajax({type:"POST",url:ajaxurl,data:{nonce:e,action:"update_channel_setting"},success:function(t){}}))}jQuery("#chaty-social-"+t+" .chaty-advance-settings.active").length&&jQuery("body,html").animate({scrollTop:jQuery("#chaty-social-"+t+" .chaty-advance-settings.active").offset().top-50},500)}function chaty_set_bg_color(){jQuery(".chaty-color-field:not(.button-color)").each(function(){""!=jQuery(this).val()&&"#ffffff"!=jQuery(this).val()&&("Linkedin"!=jQuery(this).closest("li").data("id")||"Linkedin"==jQuery(this).closest("li").data("id")&&"#ffffff"!=jQuery(this).val())&&(defaultColor=jQuery(this).val(),jQuery(this).closest(".channels-selected__item").find(".color-element").css("fill",defaultColor),jQuery(this).closest(".channels-selected__item").find(".custom-chaty-image").css("background",defaultColor),jQuery(this).closest(".channels-selected__item").find(".facustom-icon").css("background",defaultColor))}),change_custom_preview()}function upload_qr_code(){var t=wp.media({title:"Upload QR Image",multiple:!1,library:{type:"image"}}).open().on("select",function(e){imageData=t.state().get("selection").first().toJSON(),jQuery("#upload_qr_code_val").val(imageData.id),jQuery("#upload_qr_code img").attr("src",imageData.url),jQuery(".remove-qr-code").addClass("active"),change_custom_preview()})}function remove_qr_code(){jQuery(".remove-qr-code").removeClass("active"),jQuery("#upload_qr_code_val").val(""),default_image=jQuery("#default_image").val(),jQuery("#upload_qr_code img").attr("src",default_image),change_custom_preview()}function remove_chaty_image(t){default_image=jQuery("#default_image").val(),jQuery("#chaty-social-"+t+" .channels-selected__item").removeClass("img-active"),jQuery("#cht_social_image_"+t).val(""),jQuery("#cht_social_image_src_"+t).attr("src",default_image),change_custom_preview()}var baseIcon='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',defaultIcon='<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n <style type="text/css">.st0 {fill: #A886CD;} .st1 {fill: #FFFFFF;}\n </style><g><circle class="st0" cx="-469" cy="534.7" r="27"/></g><path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n <path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n <path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0\n C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n </svg>',iconBlock=document.getElementById("iconWidget");function set_social_channel_order(){socialString=[],jQuery("#channels-selected-list li").each(function(){socialString.push(jQuery(this).attr("data-id"))}),socialString=socialString.join(","),jQuery("#cht_numb_slug").val(socialString),check_for_chaty_close_button()}var imageDataEvent=!1;function check_for_chaty_close_button(){jQuery("#channels-selected-list > li:not(.chaty-cls-setting)").length>=2?jQuery("#chaty-social-close").show():jQuery("#chaty-social-close").hide();var t="";jQuery("#channels-selected-list > li").each(function(){"undefined"!=jQuery(this).attr("data-id")&&""!=jQuery(this).attr("data-id")&&(t+=jQuery(this).attr("data-id")+","),t=t.trimRight(",")}),jQuery(".add_slug").val(t)}function getChtPreviewDesktop(){return!!jQuery("#previewDesktop").is(":checked")}function setChtIcon(t,e){if(jQuery("iconWidget").length){if(iconBlock=document.getElementById("iconWidget"),t?iconBlock.innerHTML=t:iconBlock.innerHTML="",e){var a=jQuery(".color-picker-custom input").val()?jQuery(".color-picker-custom input").val():jQuery(".color-picker-radio input:checked").val();jQuery(".preview .page #iconWidget svg circle").css({fill:a}),jQuery(".preview .page .chaty-close-icon ellipse").css({fill:a}),jQuery("#chaty-social-close ellipse").attr("fill",a)}jQuery(".js-widget-i:checked").trigger("change")}}function chatySetCookie(t,e,a){var i=new Date;i.setTime(i.getTime()+864e5*a);var c="expires="+i.toUTCString();document.cookie=t+"="+e+"; "+c+"; path=/; SameSite=Lax"}function chatyGetCookie(t){for(var t=t+"=",e=document.cookie.split(";"),a=0;a<e.length;a++){for(var i=e[a];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return null}function chatyCheckCookie(t){var e=chatyGetCookie(t);return""!=e&&null!==e}function chatyDeleteCookie(t){document.cookie=t+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"}function remove_custom_image(t){console.log("socId: "+t),default_image=jQuery("#default_image").val(),jQuery("#cht_social_image_"+t).val(""),jQuery("#cht_social_image_src_"+t).attr("src",default_image),jQuery("#chaty_image_"+t).removeClass("icon-active").removeClass("img-active"),jQuery("#chaty_image_"+t+" .fa-icon").val(""),jQuery("input[name='cht_social_Chatway[chatway_icon]']:first").prop("checked",!0).trigger("change"),console.log(t),"Chatway"==t&&jQuery(".chatway-custom-image").removeClass("img-active"),change_custom_preview()}jQuery(".close-chaty-popup-btn").on("click",function(t){t.stopPropagation(),jQuery(".chaty-popup").hide()}),jQuery(function(t){"use strict";t(document).ready(function(){t(document).on("click",".chat-slider-options .slide-option",function(e){if(e.preventDefault(),!t(this).hasClass("active")){var a=t(this).data("slide");t(".chat-slides .chat-slide").removeClass("active"),t(".chat-slides .chat-slide-"+a).addClass("active"),t(".chat-slider-options .slide-option").removeClass("active"),t(".chat-slider-options .slide-"+a).addClass("active")}}),jQuery(document).on("click",".add-chatyway",function(t){t.preventDefault(),jQuery("#chatyway-info-popup").show()}),t(document).on("click","a.close-dashboard-pro-box",function(e){e.preventDefault(),t(".dashboard-pro-box").slideUp()}),t(document).on("click","#cta-option-chat-view-pro",function(){t("#chat-view-popup").show()}),t(document).on("click",".chat-view-popup-content",function(t){t.stopPropagation()}),t(document).on("mouseover",".chat-view-content",function(e){t(".chat-view-content").addClass("stop-animate")}).on("mouseleave",".chat-view-content",function(){t(".chat-view-content").removeClass("stop-animate")}),t(document).on("click",".chat-view-popup-overlay",function(){t("#chat-view-popup").hide()}),t(document).on("click",".chat-slider-options .prev-slide, .chat-slider-options .next-slide",function(e){e.preventDefault();var a=parseInt(t(".chat-slider-options .slide-option.active").data("slide"));t(".chat-slides .chat-slide").removeClass("active"),t(".chat-slider-options .slide-option").removeClass("active"),t(".chat-slides .chat-slide-"+(a=1==a?2:1)).addClass("active"),t(".chat-slider-options .slide-"+a).addClass("active")}),setInterval(function(){if(!t(".chat-view-content").hasClass("stop-animate")){var e=parseInt(t(".chat-slider-options .slide-option.active").data("slide"));t(".chat-slides .chat-slide").removeClass("active"),t(".chat-slider-options .slide-option").removeClass("active"),t(".chat-slides .chat-slide-"+(e=1==e?2:1)).addClass("active"),t(".chat-slider-options .slide-"+e).addClass("active")}},4e3)})});