!function(e){const t=e(".jeg_dark_mode_toggle"),o=e("body");for(var a,r,d=void 0===jnewsoption.site_slug?"/":jnewsoption.site_slug,i=void 0===jnewsoption.site_domain?window.location.hostname:jnewsoption.site_domain,n=window.location,c=new URL(n),s=c.searchParams.get("vc_editable"),g=c.searchParams.get("elementor-preview"),m=[],l=[],f=[],h=[],_=[],k=[],u=[],j=[],p=[e(".jeg_header_wrapper"),e(".jeg_header_sticky"),e(".jeg_navbar_mobile_wrapper"),e(".jeg_about")],w=(a="darkmode",(r=document.cookie.match("(^|;) ?"+a+"=([^;]*)(;|$)"))?r[2]:null),v=(new Date).getHours(),y=o.hasClass("jeg_full_dark"),C=0;C<4;C++)m[C]=p[C].find("img.jeg_logo_img").attr("data-light-src"),l[C]=p[C].find("img.jeg_logo_img").attr("data-light-srcset"),f[C]=p[C].find("img.jeg_logo_img").attr("data-dark-src"),h[C]=p[C].find("img.jeg_logo_img").attr("data-dark-srcset"),p[C].find(".footer_logo img").each((function(t,o){_[C]=void 0===_[C]?[]:_[C],k[C]=void 0===k[C]?[]:k[C],u[C]=void 0===u[C]?[]:u[C],j[C]=void 0===j[C]?[]:j[C],_[C][t]=e(o).attr("data-light-src"),k[C][t]=e(o).attr("data-light-srcset"),u[C][t]=e(o).attr("data-dark-src"),j[C][t]=e(o).attr("data-dark-srcset")}));if(o.hasClass("jeg_toggle_dark")&&(t.on("change",(function(){null===s&&null===g&&function(t){if(t.is(":checked")){o.addClass("jnews-dark-mode"),o.trigger("tinymce-add-dm");for(var a=0;a<4;a++)p[a].find(".jeg_logo_img").attr({src:f[a],srcset:h[a]}),p[a].find(".footer_logo img").each((function(t,o){e(o).attr({src:u[a][t],srcset:j[a][t],"data-srcset":j[a][t]})}));document.cookie="darkmode = true;path = "+d+";domain = "+i}else if(!t.is(":checked")){o.removeClass("jnews-dark-mode"),o.trigger("tinymce-remove-dm");for(a=0;a<4;a++)p[a].find(".jeg_logo_img").attr({src:m[a],srcset:l[a]}),p[a].find(".footer_logo img").each((function(t,o){e(o).attr({src:_[a][t],srcset:k[a][t],"data-srcset":k[a][t]})}));document.cookie="darkmode = false;path = "+d+";domain = "+i}}(e(this))})),t.click((function(){e(this).is(":checked")?t.each((function(){e(this).prop("checked",!0).trigger("change")})):e(this).is(":checked")||t.each((function(){e(this).prop("checked",!1).trigger("change")}))}))),o.hasClass("jeg_timed_dark"))if(v>=18||v<=6){o.addClass("jnews-dark-mode"),o.trigger("tinymce-add-dm");for(C=0;C<4;C++)p[C].find(".jeg_logo_img").attr({src:f[C],srcset:h[C]}),p[C].find(".footer_logo img").each((function(t,o){e(o).attr({src:u[C][t],srcset:j[C][t],"data-srcset":j[C][t]})}));document.cookie="darkmode = true;path = "+d+";domain = "+i}else{o.removeClass("jnews-dark-mode"),o.trigger("tinymce-remove-dm");for(C=0;C<4;C++)p[C].find(".jeg_logo_img").attr({src:m[C],srcset:l[C]}),p[C].find(".footer_logo img").each((function(t,o){e(o).attr({src:_[C][t],srcset:k[C][t],"data-srcset":k[C][t]})}));document.cookie="darkmode = false;path = "+d+";domain = "+i}"true"===w?(t.prop("checked",!0).trigger("change"),document.cookie="darkmode = true;path = "+d+";domain = "+i):"false"===w&&(t.prop("checked",!1).trigger("change"),document.cookie="darkmode = false;path = "+d+";domain = "+i),e(document).on("tinymce-editor-init",function(t,a){o.on("tinymce-add-dm",(function(){e(a.getBody()).addClass("jnews-dark-mode")})),o.on("tinymce-remove-dm",(function(){e(a.getBody()).removeClass("jnews-dark-mode")})),y||"true"===w?o.trigger("tinymce-add-dm"):o.trigger("tinymce-remove-dm")}.bind(o).bind(w))}(jQuery);