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jD,EAAE,+BAA+B2C,WAAW,CAAC,6BAC7C3C,EAAE,+BAA+B4C,QAAQ,CAAC,4BAC1C5C,EAAE,2BAA2Bc,IAAI,CAAC,eAAgB,CAAA,GAClDd,EAAE,oBAAoBc,IAAI,CAAC,WAAY,MACvCd,EAAG,+BAA+B2C,WAAW,CAAE,YAC/C3C,EAAG,+BAA+B4C,QAAQ,CAAE,gBAE9C,EACD,GAEA5C,EAAEE,UAAUgD,OAAO,CAAC,SAASJ,CAAC,EACP,IAAbA,EAAEK,OAAO,EACJnD,EAAE,+BAA+BoC,QAAQ,CAAC,+BAC1CpC,EAAE,+BAA+B2C,WAAW,CAAC,6BACzD3C,EAAE,+BAA+B4C,QAAQ,CAAC,4BAC1C5C,EAAE,2BAA2Bc,IAAI,CAAC,eAAgB,CAAA,GAClDd,EAAE,oBAAoBc,IAAI,CAAC,WAAY,MACvCd,EAAG,+BAA+B2C,WAAW,CAAE,YAC/C3C,EAAG,+BAA+B4C,QAAQ,CAAE,gBAC5C5C,EAAE,2BAA2BsB,KAAK,GAGlC","sources":["","src/socialshare.js"],"sourcesContent":["(() => {\n\n(function($) {\n function checkSidebarState() {\n let $sidebar = $('.et_social_sidebar_networks');\n let $button = $('.et_social_hide_sidebar');\n if ($sidebar.length > 0) {\n if ($sidebar.hasClass('et_social_visible_sidebar')) {\n $button.prop('ariaExpanded', true);\n $('.et_social_share').prop('tabindex', '0');\n $('.et_social_hide_sidebar .fa').removeClass('fa-share-alt');\n $('.et_social_hide_sidebar .fa').addClass('fa-close');\n } else {\n $button.prop('ariaExpanded', false);\n $('.et_social_share').prop('tabindex', '-1');\n $('.et_social_hide_sidebar .fa').removeClass('fa-close');\n $('.et_social_hide_sidebar .fa').addClass('fa-share-alt');\n }\n }\n }\n document.querySelectorAll('.et_social_hide_sidebar').forEach((button)=>{\n button.addEventListener('keydown', function(event) {\n if (event.key === 'Enter' || event.key === ' ') $(this).click();\n });\n });\n $(function() {\n $('body').on('click', '.et_social_share', function() {\n var $this_el = $(this), social_type = $this_el.data('social_type'), share_link = 'media' == social_type ? $this_el.data('social_link') : $this_el.prop('href');\n var left = $(window).width() / 2 - 275;\n var top = $(window).height() / 2 - 225;\n var new_window = window.open(share_link, '', 'scrollbars=1, height=450, width=550, left=' + left + ', top=' + top);\n if (window.focus) new_window.focus();\n return false;\n });\n function get_url_parameter(param_name) {\n var page_url = window.location.search.substring(1);\n var url_variables = page_url.split('&');\n for(var i = 0; i < url_variables.length; i++){\n var curr_param_name = url_variables[i].split('=');\n if (curr_param_name[0] == param_name) return curr_param_name[1];\n }\n }\n function setCookieExpire(days) {\n var ms = days * 86400000;\n var date = new Date();\n date.setTime(date.getTime() + ms);\n return \"; expires=\" + date.toUTCString();\n }\n function checkCookieValue(cookieName, value) {\n return parseCookies()[cookieName] === value;\n }\n function parseCookies() {\n var cookies = document.cookie.split('; ');\n var ret = {};\n for(var i = cookies.length - 1; i >= 0; i--){\n var el = cookies[i].split('=');\n ret[el[0]] = el[1];\n }\n return ret;\n }\n function set_cookie($expire) {\n cookieExpire = setCookieExpire($expire);\n document.cookie = 'etSocialCookie=true' + cookieExpire;\n }\n //separate function for the setTimeout to make it work properly within the loop.\n function make_popup_visible($popup, $delay) {\n setTimeout(function() {\n $popup.addClass('et_social_visible et_social_animated');\n if ($('.et_social_resize').length) $('.et_social_resize').each(function() {\n define_popup_position($(this));\n });\n }, $delay);\n }\n function auto_popup(this_el, delay) {\n var $current_popup_auto = this_el;\n if (!$current_popup_auto.hasClass('et_social_animated')) {\n var $cookies_expire_auto = $current_popup_auto.data('cookie_duration') ? $current_popup_auto.data('cookie_duration') : false, $delay = delay;\n if (false !== $cookies_expire_auto && !checkCookieValue('etSocialCookie', 'true') || false == $cookies_expire_auto) {\n make_popup_visible($current_popup_auto, $delay);\n if (false !== $cookies_expire_auto) set_cookie($cookies_expire_auto);\n }\n }\n }\n function define_popup_position($this_popup) {\n setTimeout(function() {\n // make sure all css transitions are finished to calculate the heights correctly\n var this_popup = $this_popup, networks_div = this_popup.find('.et_social_networks'), header_height = this_popup.find('.et_social_header').outerHeight() || 0, total_count_height = this_popup.find('.et_social_totalcount').height(), extra_height = 0 < total_count_height ? 20 : 0;\n this_popup.height(this_popup.find('.et_social_icons_container').innerHeight() + header_height + total_count_height + 20 + extra_height);\n var popup_max_height = this_popup.hasClass('et_social_popup_content') ? $(window).height() : $(window).height() - 60;\n if (this_popup.hasClass('et_social_popup_content') && 768 < $(window).width()) popup_max_height = popup_max_height - 50;\n this_popup.css({\n 'max-height': popup_max_height + 'px'\n });\n if (this_popup.hasClass('et_social_popup_content')) {\n var top_position = $(window).height() / 2 - this_popup.innerHeight() / 2;\n this_popup.css({\n 'top': top_position + 'px'\n });\n }\n var networks_div_height = this_popup.height() - header_height + total_count_height - extra_height;\n networks_div.height(networks_div_height);\n }, 400);\n }\n $(window).on('resize', ()=>{\n if ($('.et_social_resize').length) $('.et_social_resize').each(function() {\n define_popup_position($(this));\n });\n });\n $('.et_social_hide_sidebar').on('click', function() {\n $('.et_social_hide_sidebar').toggleClass('et_social_hidden_sidebar');\n $('.et_social_sidebar_networks').toggleClass('et_social_hidden_sidebar et_social_visible_sidebar');\n checkSidebarState();\n });\n });\n $(function() {\n $(\".et_social_sidebar_networks\").bind(\"focusout\", function(e) {\n if (e.currentTarget.contains(e.relatedTarget)) ;\n else {\n $('.et_social_sidebar_networks').removeClass('et_social_visible_sidebar');\n $('.et_social_sidebar_networks').addClass('et_social_hidden_sidebar');\n $('.et_social_hide_sidebar').prop('ariaExpanded', false);\n $('.et_social_share').prop('tabindex', '-1');\n $('.et_social_hide_sidebar .fa').removeClass('fa-close');\n $('.et_social_hide_sidebar .fa').addClass('fa-share-alt');\n }\n });\n });\n $(document).keydown(function(e) {\n if (e.keyCode == 27) {\n if ($('.et_social_sidebar_networks').hasClass('et_social_visible_sidebar')) {\n $('.et_social_sidebar_networks').removeClass('et_social_visible_sidebar');\n $('.et_social_sidebar_networks').addClass('et_social_hidden_sidebar');\n $('.et_social_hide_sidebar').prop('ariaExpanded', false);\n $('.et_social_share').prop('tabindex', '-1');\n $('.et_social_hide_sidebar .fa').removeClass('fa-close');\n $('.et_social_hide_sidebar .fa').addClass('fa-share-alt');\n $('.et_social_hide_sidebar').focus();\n }\n }\n });\n})(jQuery);\n\n})();\n//# sourceMappingURL=socialshare.js.map\n","import './scss/socialshare.scss'\r\n\r\n(function($){\r\n\tfunction checkSidebarState() {\r\n\t\tlet $sidebar = $('.et_social_sidebar_networks');\r\n\t\tlet $button = $('.et_social_hide_sidebar');\r\n\r\n\t\tif ($sidebar.length > 0) {\r\n\t\t\tif ($sidebar.hasClass('et_social_visible_sidebar')) {\r\n\t\t\t\t$button.prop('ariaExpanded', true);\r\n\t\t\t\t$('.et_social_share').prop('tabindex', '0');\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').removeClass( 'fa-share-alt' );\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').addClass( 'fa-close' );\r\n\t\t\t} else {\r\n\t\t\t\t$button.prop('ariaExpanded', false);\r\n\t\t\t\t$('.et_social_share').prop('tabindex', '-1');\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').removeClass( 'fa-close' );\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').addClass( 'fa-share-alt' );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tdocument.querySelectorAll('.et_social_hide_sidebar').forEach(button => {\r\n\t\tbutton.addEventListener('keydown', function(event) {\r\n\t\t\tif (event.key === 'Enter' || event.key === ' ') {\r\n\t\t\t\t$(this).click();\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t$( function () {\r\n\t\t$( 'body' ).on( 'click', '.et_social_share', function() {\r\n\t\t\tvar $this_el = $(this),\r\n\t\t\t\tsocial_type = $this_el.data( 'social_type' ),\r\n\t\t\t\tshare_link = 'media' == social_type ? $this_el.data( 'social_link' ) : $this_el.prop( 'href' );\r\n\r\n\t\t\tvar left = ( $( window ).width()/2 ) - ( 550/2 );\r\n\t\t\tvar top = ( $( window ).height()/2 ) - ( 450/2 );\r\n\t\t\tvar new_window = window.open( share_link, '', 'scrollbars=1, height=450, width=550, left=' + left + ', top=' + top );\r\n\r\n\t\t\tif ( window.focus ) {\r\n\t\t\t\tnew_window.focus();\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\tfunction get_url_parameter( param_name ) {\r\n\t\t\tvar page_url = window.location.search.substring(1);\r\n\t\t\tvar url_variables = page_url.split('&');\r\n\t\t\tfor ( var i = 0; i < url_variables.length; i++ ) {\r\n\t\t\t\t\tvar curr_param_name = url_variables[i].split( '=' );\r\n\t\t\t\tif ( curr_param_name[0] == param_name ) {\r\n\t\t\t\t\treturn curr_param_name[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction setCookieExpire(days) {\r\n\r\n\t\t\tvar ms = days*24*60*60*1000;\r\n\r\n\t\t\tvar date = new Date();\r\n\t\t\tdate.setTime(date.getTime() + ms);\r\n\r\n\t\t\treturn \"; expires=\" + date.toUTCString();\r\n\t\t}\r\n\r\n\t\tfunction checkCookieValue(cookieName, value) {\r\n\t\t\treturn parseCookies()[cookieName] === value;\r\n\t\t}\r\n\r\n\t\tfunction parseCookies() {\r\n\t\t\tvar cookies = document.cookie.split('; ');\r\n\r\n\t\t\tvar ret = {};\r\n\t\t\tfor (var i = cookies.length - 1; i >= 0; i--) {\r\n\t\t\t var el = cookies[i].split('=');\r\n\t\t\t ret[el[0]] = el[1];\r\n\t\t\t}\r\n\t\t\treturn ret;\r\n\t\t}\r\n\r\n\t\tfunction set_cookie( $expire ) {\r\n\t\t\tcookieExpire = setCookieExpire( $expire );\r\n\t\t\tdocument.cookie = 'etSocialCookie=true' + cookieExpire;\r\n\t\t}\r\n\r\n\t\t//separate function for the setTimeout to make it work properly within the loop.\r\n\t\tfunction make_popup_visible( $popup, $delay ){\r\n\t\t\tsetTimeout( function() {\r\n\t\t\t\t$popup.addClass( 'et_social_visible et_social_animated' );\r\n\t\t\t\tif ( $( '.et_social_resize' ).length ) {\r\n\t\t\t\t\t$( '.et_social_resize' ).each( function() {\r\n\t\t\t\t\t\tdefine_popup_position( $( this ) );\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}, $delay );\r\n\t\t}\r\n\r\n\t\tfunction auto_popup( this_el, delay ) {\r\n\t\t\tvar $current_popup_auto = this_el;\r\n\t\t\tif ( ! $current_popup_auto.hasClass( 'et_social_animated' ) ) {\r\n\t\t\t\tvar $cookies_expire_auto = $current_popup_auto.data( 'cookie_duration' ) ? $current_popup_auto.data( 'cookie_duration' ) : false,\r\n\t\t\t\t\t$delay = delay;\r\n\r\n\t\t\t\tif ( ( false !== $cookies_expire_auto && ! checkCookieValue( 'etSocialCookie', 'true' ) ) || false == $cookies_expire_auto ) {\r\n\r\n\t\t\t\t\tmake_popup_visible ( $current_popup_auto, $delay );\r\n\r\n\t\t\t\t\tif ( false !== $cookies_expire_auto ) {\r\n\t\t\t\t\t\tset_cookie( $cookies_expire_auto );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction define_popup_position( $this_popup ) {\r\n\t\t\tsetTimeout( function() { // make sure all css transitions are finished to calculate the heights correctly\r\n\t\t\t\tvar this_popup = $this_popup,\r\n\t\t\t\t\tnetworks_div = this_popup.find( '.et_social_networks' ),\r\n\t\t\t\t\theader_height = this_popup.find( '.et_social_header' ).outerHeight() || 0,\r\n\t\t\t\t\ttotal_count_height = this_popup.find( '.et_social_totalcount' ).height(),\r\n\t\t\t\t\textra_height = 0 < total_count_height ? 20 : 0;\r\n\r\n\t\t\t\tthis_popup.height( this_popup.find( '.et_social_icons_container' ).innerHeight() + header_height + total_count_height + 20 + extra_height );\r\n\r\n\t\t\t\tvar\tpopup_max_height = this_popup.hasClass( 'et_social_popup_content' ) ? $( window ).height() : $( window ).height() - 60;\r\n\r\n\t\t\t\tif ( this_popup.hasClass( 'et_social_popup_content' ) && 768 < $( window ).width() ) {\r\n\t\t\t\t\tpopup_max_height = popup_max_height - 50;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis_popup.css( { 'max-height' : popup_max_height + 'px' } );\r\n\r\n\t\t\t\tif( this_popup.hasClass( 'et_social_popup_content' ) ) {\r\n\t\t\t\t\tvar top_position = $( window ).height() / 2 - this_popup.innerHeight() / 2;\r\n\t\t\t\t\tthis_popup.css( { 'top' : top_position + 'px' } );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar networks_div_height = this_popup.height() - header_height + total_count_height - extra_height;\r\n\t\t\t\tnetworks_div.height( networks_div_height );\r\n\t\t\t}, 400 );\r\n\t\t}\r\n\r\n\t\t$( window ).on( 'resize', () => {\r\n\t\t\tif ( $( '.et_social_resize' ).length ) {\r\n\t\t\t\t$( '.et_social_resize' ).each( function() {\r\n\t\t\t\t\tdefine_popup_position( $( this ) );\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$( '.et_social_hide_sidebar' ).on('click', function(){\r\n\t\t\t$( '.et_social_hide_sidebar' ).toggleClass( 'et_social_hidden_sidebar' );\r\n\t\t\t$( '.et_social_sidebar_networks' ).toggleClass( 'et_social_hidden_sidebar et_social_visible_sidebar' );\r\n\t\t\tcheckSidebarState();\r\n\t\t});\r\n\t});\r\n\r\n\t$(function(){\r\n\t\t$(\".et_social_sidebar_networks\").bind(\"focusout\", function (e) {\r\n\t\t\tif (e.currentTarget.contains(e.relatedTarget)) {\r\n\t\t\t} else {\r\n\t\t\t\t$('.et_social_sidebar_networks').removeClass('et_social_visible_sidebar');\r\n\t\t\t\t$('.et_social_sidebar_networks').addClass('et_social_hidden_sidebar');\r\n\t\t\t\t$('.et_social_hide_sidebar').prop('ariaExpanded', false);\r\n\t\t\t\t$('.et_social_share').prop('tabindex', '-1');\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').removeClass( 'fa-close' );\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').addClass( 'fa-share-alt' );\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t$(document).keydown(function(e){\r\n if(e.keyCode == 27) {\r\n if ($('.et_social_sidebar_networks').hasClass('et_social_visible_sidebar')) {\r\n $('.et_social_sidebar_networks').removeClass('et_social_visible_sidebar');\r\n\t\t\t\t$('.et_social_sidebar_networks').addClass('et_social_hidden_sidebar');\r\n\t\t\t\t$('.et_social_hide_sidebar').prop('ariaExpanded', false);\r\n\t\t\t\t$('.et_social_share').prop('tabindex', '-1');\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').removeClass( 'fa-close' );\r\n\t\t\t\t$( '.et_social_hide_sidebar .fa').addClass( 'fa-share-alt' );\r\n\t\t\t\t$('.et_social_hide_sidebar').focus();\r\n } \r\n } \r\n });\r\n\r\n})(jQuery)\r\n"],"names":["$","jQuery","document","querySelectorAll","forEach","button","addEventListener","event","key","click","on","$this_el","share_link","data","prop","left","window","width","top","height","new_window","open","focus","length","each","$this_popup","setTimeout","networks_div","this_popup","find","header_height","outerHeight","total_count_height","extra_height","innerHeight","popup_max_height","hasClass","css","top_position","networks_div_height","$sidebar","$button","toggleClass","removeClass","addClass","bind","e","currentTarget","contains","relatedTarget","keydown","keyCode","checkSidebarState","social_type","get_url_parameter","param_name","page_url","location","search","substring","url_variables","split","i","curr_param_name","setCookieExpire","days","ms","date","Date","setTime","getTime","toUTCString","checkCookieValue","cookieName","value","parseCookies","cookies","cookie","ret","el","set_cookie","$expire","cookieExpire","make_popup_visible","$popup","$delay","define_popup_position","auto_popup","this_el","delay","$current_popup_auto","$cookies_expire_auto"],"version":3,"file":"socialshare.js.map"}