(function(){
"use strict";
var $window=jQuery(window),
$document=jQuery(document),
$html_dom=document.querySelector('html'),
$adminbar=jQuery('#wpadminbar'),
$body=jQuery('body');
window.trx_effects_get_cookie=function(name){
var defa=arguments[1]!=undefined ? arguments[1]:null;
var start=document.cookie.indexOf(name + '=');
var len=start + name.length + 1;
if((!start)&&(name!=document.cookie.substring(0, name.length))){
return defa;
}
if(start==-1)
return defa;
var end=document.cookie.indexOf(';', len);
if(end==-1)
end=document.cookie.length;
return unescape(document.cookie.substring(len, end));
};
window.trx_effects_set_cookie=function(name, value){
var expires=arguments[2]!=undefined ? arguments[2]:0;
var path=arguments[3]!=undefined ? arguments[3]:'/';
var domain=arguments[4]!=undefined ? arguments[4]:'';
var secure=arguments[5]!=undefined ? arguments[5]:'';
var today=new Date();
today.setTime(today.getTime());
if(expires){
expires=expires * 1000 * 60 * 60 * 24;
}
var expires_date=new Date(today.getTime() + (expires));
document.cookie=name + '='
+ escape(value)
+ ((expires) ? ';expires=' + expires_date.toGMTString():'')
+ ((path)    ? ';path=' + path:'')
+ ((domain)  ? ';domain=' + domain:'')
+ ((secure)  ? ';secure':'');
};
window.trx_effects_del_cookie=function(name){
var path=arguments[1]!=undefined ? arguments[1]:'/';
var domain=arguments[2]!=undefined ? arguments[2]:'';
if(trx_effects_get_cookie(name))
document.cookie=name + '=' + ((path) ? ';path=' + path:'')
+ ((domain) ? ';domain=' + domain:'')
+ ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
};
window.trx_effects_document_animate_to=function(id, callback){
var oft = !isNaN(id) ? Number(id):0;
if(isNaN(id)){
if(id.indexOf('#')==-1) id='#' + id;
var obj=jQuery(id).eq(0);
if(obj.length===0) return;
oft=obj.offset().top;
}
var st=jQuery(window).scrollTop();
var oft2=Math.max(0, oft - trx_effects_fixed_rows_height());
var speed=Math.min(1200, Math.max(300, Math.round(Math.abs(oft2-st) / jQuery(window).height() * 300)));
if(true||st===0){
setTimeout(function(){
if(isNaN(id)) oft=obj.offset().top;
oft2=Math.max(0, oft - trx_effects_fixed_rows_height());
jQuery('body,html').stop(true).animate({scrollTop: oft2}, Math.floor(speed/2), 'linear', callback);
}, Math.floor(speed/2));
}
jQuery('body,html').stop(true).animate({scrollTop: oft2}, speed, 'linear', callback);
};
window.trx_effects_add_to_url=function(loc, prm){
var ignore_empty=arguments[2]!==undefined ? arguments[2]:true;
var q=loc.indexOf('?');
var attr={};
var i;
if(q > 0){
var qq=loc.substr(q+1).split('&');
var parts='';
for (i=0; i < qq.length; i++){
parts=qq[i].split('=');
attr[parts[0]]=parts.length>1 ? parts[1]:'';
}}
for (var p in prm){
attr[p]=prm[p];
}
loc=(q > 0 ? loc.substr(0, q):loc) + '?';
i=0;
for (p in attr){
if(ignore_empty&&attr[p]==='') continue;
loc +=(i++ > 0 ? '&':'') + p + '=' + attr[p];
}
return loc;
};
window.trx_effects_is_local_link=function(url){
var rez=url!==undefined;
if(rez){
var url_pos=url.indexOf('#');
if(url_pos===0&&url.length==1)
rez=false;
else {
if(url_pos < 0) url_pos=url.length;
var loc=window.location.href;
var loc_pos=loc.indexOf('#');
if(loc_pos > 0) loc=loc.substring(0, loc_pos);
rez=url_pos===0;
if(!rez) rez=loc==url.substring(0, url_pos);
}}
return rez;
};
window.trx_effects_get_embed_from_url=function(url, autoplay){
if(autoplay===undefined){
autoplay=true;
}
url=url.replace('/watch?v=', '/embed/')
.replace('/vimeo.com/', '/player.vimeo.com/video/');
if(autoplay){
url +=(url.indexOf('?') > 0 ? '&':'?') + '&autoplay=1';
}
return '<iframe src="'+url+'" border="0" width="1280" height="720"></iframe>';
};
window.trx_effects_set_autoplay=function(container, value){
if(value===undefined) value=1;
container.find('.video_frame > iframe, iframe').each(function (){
var src=jQuery(this).attr('src');
if(src===undefined) src='';
if(src.indexOf('youtube')>=0||src.indexOf('vimeo')>=0){
jQuery(this).attr('src', trx_effects_add_to_url(src, {'autoplay': value}));
}});
};
var _adminbar_height=0;
var _update_adminbar_height=function(){
_adminbar_height=trx_effects_adminbar_height_calc();
};
$document.ready(_update_adminbar_height);
$window.on('resize', _update_adminbar_height);
window.trx_effects_adminbar_height_calc=function(){
return $adminbar.length===0
|| $adminbar.css('display')=='none'
|| $adminbar.css('position')=='absolute'
? 0
: $adminbar.height();
};
window.trx_effects_adminbar_height=function(){
return _adminbar_height;
};
var $fixed_rows=false,
_fixed_rows_height=0;
var _update_fixed_rows=function(){
if($fixed_rows===false){
$fixed_rows=jQuery('.sc_layouts_row_fixed');
}
_fixed_rows_height=trx_effects_fixed_rows_height_calc();
$html_dom.style.setProperty('--fixed-rows-height',(_fixed_rows_height + trx_effects_adminbar_height()) + 'px');
};
$document.ready(_update_fixed_rows);
$document.on('trx_effects_action_init action.sc_layouts_row_fixed_on action.sc_layouts_row_fixed_off', _update_fixed_rows);
$window.on('resize', _update_fixed_rows);
window.trx_effects_fixed_rows_height_calc=function(){
var oft=0;
if($fixed_rows.length > 0){
var $fixed_on=$fixed_rows.filter('.sc_layouts_row_fixed_on');
if($fixed_on.length > 0
&& ! $body.hasClass('hide_fixed_rows')
){
$fixed_on.each(function(){
var $row=jQuery(this);
if($row.css('position')=='fixed'){
oft +=$row.outerHeight();
}});
}}
return oft;
};
window.trx_effects_fixed_rows_height=function(){
var with_admin_bar=arguments.length > 0 ? arguments[0]:true,
with_fixed_rows=arguments.length > 1 ? arguments[1]:true;
return(with_admin_bar ? trx_effects_adminbar_height():0)
+(with_fixed_rows ? _fixed_rows_height:0);
};
window.trx_effects_browser_is_mobile=function(){
var check=false;
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|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(a)||/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(a.substr(0,4)))check=true})(navigator.userAgent||navigator.vendor||window.opera);
return check;
};
window.trx_effects_browser_is_ios=function(){
return navigator.userAgent.match(/iPad|iPhone|iPod/i)!=null||navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)?true:false;
};
window.trx_effects_is_retina=function(){
var mediaQuery='(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)';
return (window.devicePixelRatio > 1)||(window.matchMedia&&window.matchMedia(mediaQuery).matches);
};
window.trx_effects_get_file_name=function(path){
path=path.replace(/\\/g, '/');
var pos=path.lastIndexOf('/');
if(pos >=0)
path=path.substr(pos+1);
return path;
};
window.trx_effects_get_file_ext=function(path){
var pos=path.lastIndexOf('.');
path=pos >=0 ? path.substr(pos+1):'';
return path;
};
window.trx_effects_get_basename=function(path){
return trx_effects_get_file_name(path).replace('.'+trx_effects_get_file_ext(path), '');
};
window.trx_effects_is_images_loaded=function(cont){
var complete=true;
cont.find('img').each(function(){
if(!complete) return;
var img=jQuery(this).get(0);
if(typeof img.naturalWidth=='number'&&typeof img.naturalHeight=='number')
complete = !(img.naturalWidth==0&&img.naturalHeight==0);
else if(typeof img.complete=='boolean')
complete=img.complete;
});
return complete;
};
window.trx_effects_when_images_loaded=function(cont, callback, max_delay){
if(max_delay===undefined){
var max_delay=3000;
}
if(max_delay <=0||trx_effects_is_images_loaded(cont)){
callback();
}else{
setTimeout(function(){
trx_effects_when_images_loaded(cont, callback, max_delay - 200);
}, 200);
}};
window.trx_effects_round_number=function(num){
var precision=arguments[1]!==undefined ? arguments[1]:0;
var p=Math.pow(10, precision);
return Math.round(num*p)/p;
};
Number.prototype.formatMoney=function(c, d, t){
var n=this,
c=c==undefined ? 2:(isNaN(c=Math.abs(c)) ? 2:c),
d=d==undefined ? ".":d,
t=t==undefined ? ",":t,
s=n < 0 ? "-":"",
i=String(parseInt(n=Math.abs(Number(n)||0).toFixed(c))),
j=(j=i.length) > 3 ? j % 3:0;
return s
+ (j ? i.substr(0, j) + t:"")
+ i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t)
+ (c ? d + Math.abs(n - i).toFixed(c).slice(2):"");
};
window.trx_effects_proper=function(str){
return str.replace(/(\b\w)/gi, function(m){ return m.toUpperCase(); });
};
window.trx_effects_replicate=function(str, num){
var rez='';
for (var i=0; i < num; i++){
rez +=str;
}
return rez;
};
window.trx_effects_split=function(str, delimiter){
var rez=[],
quotes=false,
pos=0;
for(var i=0; i < str.length; i++){
if(str[i]==delimiter&&! quotes){
rez.push(str.substring(pos, i));
pos=i + 1;
}else if(str[ i ]=='"'){
quotes = ! quotes;
}}
rez.push(str.substring(pos, i));
return rez;
};
window.trx_effects_parse_atts=function(str, delimiter){
var obj={};
if(! delimiter){
delimiter=' ';
}
if(str!==undefined){
if(delimiter=='&'){
str=str.replace(/&amp;/g, '&');
}
var pairs=trx_effects_split(str, delimiter);
for(var i in pairs){
if(pairs[i].indexOf('=')!=-1){
var pair=pairs[i].split('=');
obj[ pair[0] ]=('' + pair[1]).slice(0, 1)=='"'&&('' + pair[1]).slice(-1)=='"'
||('' + pair[1]).slice(0, 1)=="'"&&('' + pair[1]).slice(-1)=="'"
? pair[1].slice(1, -1)
: pair[1];
}}
}
return obj;
};
window.trx_effects_prepare_macros=function(str, args){
if(! str||typeof str!='string'){
return str;
}
if(str.indexOf('[') >=0&&str.indexOf(']') >=0){
str=str.replace(/([\[])([\[\]\S]+?)[\s]+([^\[\]]+)?([\]])/g,
function(match, p1, p2, p3, p4){
var allowed_css=trx_effects_apply_filters('trx_effects_filter/prepare_macros_allowed_css', {
'valign': 'vertical-align',
'color': 'color',
'bgcolor': 'background-color',
'bdcolor': 'border-color',
'border': 'border-width',
'radius': 'border-radius',
'padding': 'padding',
'margin': 'margin',
'top': 'top',
'left': 'left',
'right': 'right',
'bottom': 'bottom'
},
'common'
),
image_css=trx_effects_apply_filters('trx_effects_filter/prepare_macros_allowed_css', {
'size': { 'rule': 'max-height', 'default': '1em' },
},
'image'
),
icon_css=trx_effects_apply_filters('trx_effects_filter/prepare_macros_allowed_css', {
'size': { 'rule': 'font-size', 'default': '1em' },
},
'icon'
),
atts=false;
if(p2=='image'){
atts=p3 ? trx_effects_parse_atts(p3):{};
if(! atts['url']){
atts['url']=TRX_EFFECTS_STORAGE['elementor_placeholder_image'] ? TRX_EFFECTS_STORAGE['elementor_placeholder_image']:'';
var get_url_by_size=function(data, thumb_size){
var url='';
for(var i in data['media_details']['sizes']){
if(('' + i).indexOf(thumb_size) >=0){
url=data['media_details']['sizes'][i]['source_url'];
break;
}}
return url;
};
if(atts['id']){
if(TRX_EFFECTS_STORAGE['fetch_images' ]===undefined){
TRX_EFFECTS_STORAGE['fetch_images']={};}
if(! TRX_EFFECTS_STORAGE['fetch_images'][ atts['id'] ]){
args['class']=(args['class'] ? args['class'] + ' ':'') + 'trx_effects_image_placeholder trx_effects_image_' + atts['id'];
jQuery.get(TRX_EFFECTS_STORAGE['rest_url'] + 'wp/v2/media/' + atts['id'] + '/', function(response){
if(response&&response['media_details']&&response['media_details']['sizes']){
TRX_EFFECTS_STORAGE['fetch_images'][ atts['id'] ]=response;
jQuery('.trx_effects_image_' + atts['id'])
.removeClass('trx_effects_image_placeholder')
.attr('src', get_url_by_size(response, atts['thumb'] ? '-' + atts['thumb']:'-tiny'));
}});
}else{
atts['url']=get_url_by_size(TRX_EFFECTS_STORAGE['fetch_images'][ atts['id'] ], atts['thumb'] ? '-' + atts['thumb']:'-tiny');
}}
}
return atts['url']
? '<img src="' + atts['url'] + '"'
+(atts['id'] ? ' id="trx_effects_image_' + atts['id'] + '"':'')
+(atts['alt'] ? ' alt="' + atts['alt'] + '"':'')
+(args['class']||atts['class'] ? ' class="' +(args['class'] ? args['class'] + ' ':'') +(( atts['class'] ? atts['class']:'')) + '"':'')
+ ' style="'
+ trx_effects_get_css_from_atts(atts, trx_effects_object_merge(allowed_css, image_css))
+(atts['css'] ? atts['css']:'')
+ '"'
+ '>'
: '';
}else if(p2=='icon'){
atts=p3 ? trx_effects_parse_atts(p3):{};
if(atts['name']&&atts['name'].slice(0, 5)!='icon-'){
atts['name']='icon-' + atts['name'];
}
return atts['name']
? '<span class="' + atts['name'] +(args['class'] ? ' ' + args['class']:'') +(atts['class'] ? ' ' + atts['class']:'') + '"'
+ ' style="'
+ trx_effects_get_css_from_atts(atts, trx_effects_object_merge(allowed_css, icon_css))
+(atts['css'] ? atts['css']:'')
+ '"'
+ '></span>'
: '';
}else if(p2.slice(0, 1)!='&'){
return p1 + p2 + p4;
}else{
return match;
}}
);
}
return str
.replace(/\{\{/g, "<i>")
.replace(/\}\}/g, "</i>")
.replace(/\(\(/g, "<b>")
.replace(/\)\)/g, "</b>")
.replace(/\|\|/g, "<br>")
.replace(/(\^(\d+))/g, "<sup>$2</sup>");
};
window.trx_effects_remove_macros=function(str){
return str
.replace(/[^\[]([\[][^\[\]]+[\]])[^\]]/g, "")
.replace(/\{\{/g, "")
.replace(/\}\}/g, "")
.replace(/\(\(/g, "")
.replace(/\)\)/g, "")
.replace(/\|\|/g, "");
};
window.trx_effects_parse_codes=function(text, tag_start, tag_end){
if(tag_start===undefined) tag_start='{{';
if(tag_end===undefined) tag_end='}}';
var r1=new RegExp(tag_start, 'g');
var r2=new RegExp(tag_end, 'g');
return text.replace(r1, '<').replace(r2, '>');
};
window.trx_effects_is_on=function(prm){
return prm>0||['true', 'on', 'yes', 'show'].indexOf((''+prm).toLowerCase()) >=0;
};
window.trx_effects_is_off=function(prm){
return prm==''||prm==0||['false', 'off', 'no', 'none', 'hide'].indexOf((''+prm).toLowerCase()) >=0;
};
window.trx_effects_is_inherit=function(prm){
return ['inherit'].indexOf((''+prm).toLowerCase()) >=0;
};
window.trx_effects_get_class_by_prefix=function(classes, prefix){
var rez='';
if(classes){
classes=classes.split(' ');
for (var i=0; i < classes.length; i++){
if(classes[i].indexOf(prefix) >=0){
rez=classes[i].replace(/[\s]+/g, '');
break;
}}
}
return rez;
};
window.trx_effects_chg_class_by_prefix=function(classes, prefix, new_value){
var chg=false;
if(! classes) classes='';
classes=classes.replace(/[\s]+/g, ' ').split(' ');
new_value=new_value.replace(/[\s]+/g, '');
if(typeof prefix=='string'){
prefix=[prefix];
}
for (var i=0; i < classes.length; i++){
for (var j=0; j < prefix.length; j++){
if(classes[i].indexOf(prefix[j]) >=0){
classes[i]=new_value;
chg=true;
break;
}}
if(chg) break;
}
if(! chg&&new_value){
if(classes.length==1&&classes[0]==='')
classes[0]=new_value;
else
classes.push(new_value);
}
return classes.join(' ').replace(/[\s]{2,}/g, ' ');
};
window.trx_effects_get_icon_class=function(classes){
var classes=classes.split(' ');
var icon='';
for (var i=0; i < classes.length; i++){
if(classes[i].indexOf('icon-') >=0){
icon=classes[i];
break;
}}
return icon;
};
window.trx_effects_chg_icon_class=function(classes, icon){
var chg=false;
classes=classes.split(' ');
for (var i=0; i < classes.length; i++){
if(classes[i].indexOf('icon-') >=0){
classes[i]=icon;
chg=true;
break;
}}
if(!chg){
if(classes.length==1&&classes[0]==='')
classes[0]=icon;
else
classes.push(icon);
}
return classes.join(' ');
};
function trx_effects_get_next_token(str, pos){
var token='';
if(pos < str.length){
if(str[pos]=='<'){
while(pos < str.length&&str[pos]!='>'){
token +=str[pos++];
}
token +=str[pos++];
if(token.slice(0, 3)=='<i '||token.slice(0, 3)=='<i>'||token.slice(0, 4)=='<svg'){
while(pos < str.length&&token.indexOf('</i>')==-1&&token.indexOf('</svg>')==-1){
token +=str[pos++];
}}
}else{
token=str[pos++];
}}
return token;
}
window.trx_effects_wrap_words=function(txt, before, after){
var rez='', token='', in_word=false, cnt=0, is_icon=false, is_space=false;
for(var i=0; i < txt.length; i++){
token=trx_effects_get_next_token(txt, i);
is_icon=token.slice(0, 3)=='<i '||token.slice(0, 3)=='<i>'||token.slice(0, 4)=='<img'||token.slice(0, 4)=='<svg';
is_space=token==' '||/^[\s]*$/.test(token);
if(in_word){
if(token.slice(0, 1)=='<'||is_space){
rez +=after;
in_word=false;
}}else{
if(! is_space&&(token.slice(0, 1)!='<'||is_icon)){
rez +=before.replace('>', ' data-animation-index="' + cnt + '">');
in_word=true;
cnt++;
}}
rez +=token;
i +=token.length - 1;
if(is_icon||(in_word&&i==txt.length - 1)){
rez +=after;
in_word=false;
}}
return rez;
};
window.trx_effects_wrap_chars=function(txt, before, after, before_word, after_word){
var rez='', token='', in_word=false, cnt=0, is_icon=false, is_space=false;
if(before_word===undefined) before_word='';
if(after_word===undefined) after_word='';
for(var i=0; i < txt.length; i++){
token=trx_effects_get_next_token(txt, i);
is_icon=token.slice(0, 3)=='<i '||token.slice(0, 3)=='<i>'||token.slice(0, 4)=='<img'||token.slice(0, 4)=='<svg';
is_space=token==' '||/^[\s]*$/.test(token);
if(in_word){
if(token.slice(0, 1)=='<'||is_space){
rez +=after_word;
in_word=false;
}}else{
if(! is_space&&(token.slice(0, 1)!='<'||is_icon)){
rez +=before_word;
in_word=true;
}}
rez +=token.slice(0, 1)=='<'&&! is_icon
? token
:(is_space
? token
: before.replace('>', ' data-animation-index="' + cnt + '">') + token + after
);
i +=token.length - 1;
if(is_icon||(in_word&&i==txt.length - 1)){
rez +=after_word;
in_word=false;
}
if(token.slice(0, 1)!='<'||is_icon){
cnt++;
}}
return rez;
};
window.trx_effects_clear_tags=function(str){
return str.replace(/<\/?[^>]+>/g, '');
};
window.trx_effects_esc_html=function(str){
return str
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
};
window.trx_effects_prepare_css_value=function(val){
if(val!==''&&val!='inherit'){
var parts=('' + val).split(' ');
for(var i=0; i < parts.length; i++){
if(parts[i]===''){
continue;
}
var ed=('' + parts[i]).slice(-1);
if('0' <=ed&&ed <='9'){
parts[i] +='px';
}}
val=parts.join(' ');
}
return val;
};
window.trx_effects_units2px=function(val, block, dir){
var value=parseFloat(val);
var unit=('' + val).replace(('' + value), '').toLowerCase();
if(unit){
if(unit=='vw'){
value=Math.round(value * $window.width() / 100);
}else if(unit=='vh'){
value=Math.round(value * $window.height() / 100);
}else if(unit=='%'&&block&&block.length){
value=Math.round(value *(dir=='x' ? block.eq(0).outerWidth():block.eq(0).outerHeight()) / 100);
}else if(unit=='em'&&block&&block.length){
value=parseFloat(getComputedStyle(block.get(0))['fontSize']) * value;
}else if(unit=='rem'){
value=parseFloat(getComputedStyle($body.get(0))['fontSize']) * value;
}}
return value;
};
window.trx_effects_get_css_from_atts=function(atts, allowed){
var css='',
rule='',
atts_with_units=[ 'margin', 'padding', 'border-radius', 'border-width', 'font-size', 'line-height', 'letter-spacing', 'width', 'height', 'top', 'right', 'bottom', 'left' ];
for(var k in allowed){
if(allowed[ k ]&&(atts.hasOwnProperty(k)||typeof allowed[ k ]=='object'&&allowed[ k ].hasOwnProperty('default'))){
rule=typeof allowed[ k ]=='object' ? allowed[ k ]['rule']:allowed[ k ];
if(typeof allowed[ k ]=='object'){
css +=rule + ':' +(atts[ k ]
?(atts_with_units.indexOf(rule) >=0 ? trx_effects_prepare_css_value(atts[ k ]):atts[ k ])
:(atts_with_units.indexOf(rule) >=0 ? trx_effects_prepare_css_value(allowed[ k ]['default']):allowed[ k ]['default'])
)
+ ';';
}else{
css +=rule + ':' +(atts_with_units.indexOf(rule) >=0 ? trx_effects_prepare_css_value(atts[ k ]):atts[ k ]) + ';';
}}
}
return css;
};
window.trx_effects_hex2rgb=function(hex){
hex=parseInt(((hex.indexOf('#') > -1) ? hex.substring(1):hex), 16);
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};};
window.trx_effects_hex2rgba=function(hex, alpha){
var rgb=trx_effects_hex2rgb(hex);
return 'rgba('+rgb.r+','+rgb.g+','+rgb.b+','+alpha+')';
};
window.trx_effects_rgb2hex=function(color){
var aRGB;
color=color.replace(/\s/g,"").toLowerCase();
if(color=='rgba(0,0,0,0)'||color=='rgba(0%,0%,0%,0%)')
color='transparent';
if(color.indexOf('rgba(')==0)
aRGB=color.match(/^rgba\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i);
else
aRGB=color.match(/^rgb\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i);
if(aRGB){
color='';
for (var i=1; i <=3; i++)
color +=Math.round((aRGB[i][aRGB[i].length-1]=="%"?2.55:1)*parseInt(aRGB[i])).toString(16).replace(/^(.)$/,'0$1');
} else
color=color.replace(/^#?([\da-f])([\da-f])([\da-f])$/i, '$1$1$2$2$3$3');
return (color.substr(0,1)!='#' ? '#':'') + color;
};
window.trx_effects_components2hex=function(r,g,b){
return '#'+
Number(r).toString(16).toUpperCase().replace(/^(.)$/,'0$1') +
Number(g).toString(16).toUpperCase().replace(/^(.)$/,'0$1') +
Number(b).toString(16).toUpperCase().replace(/^(.)$/,'0$1');
};
window.trx_effects_rgb2components=function(color){
color=trx_effects_rgb2hex(color);
var matches=color.match(/^#?([\dabcdef]{2})([\dabcdef]{2})([\dabcdef]{2})$/i);
if(!matches) return false;
for (var i=1, rgb=new Array(3); i <=3; i++)
rgb[i-1]=parseInt(matches[i],16);
return rgb;
};
window.trx_effects_hex2hsb=function(hex){
var h=arguments[1]!==undefined ? arguments[1]:0;
var s=arguments[2]!==undefined ? arguments[2]:0;
var b=arguments[3]!==undefined ? arguments[3]:0;
var hsb=trx_effects_rgb2hsb(trx_effects_hex2rgb(hex));
hsb.h=Math.min(359, hsb.h + h);
hsb.s=Math.min(100, hsb.s + s);
hsb.b=Math.min(100, hsb.b + b);
return hsb;
};
window.trx_effects_hsb2hex=function(hsb){
var rgb=trx_effects_hsb2rgb(hsb);
return trx_effects_components2hex(rgb.r, rgb.g, rgb.b);
};
window.trx_effects_rgb2hsb=function(rgb){
var hsb={};
hsb.b=Math.max(Math.max(rgb.r,rgb.g),rgb.b);
hsb.s=(hsb.b <=0) ? 0:Math.round(100*(hsb.b - Math.min(Math.min(rgb.r,rgb.g),rgb.b))/hsb.b);
hsb.b=Math.round((hsb.b /255)*100);
if((rgb.r==rgb.g)&&(rgb.g==rgb.b))  hsb.h=0;
else if(rgb.r>=rgb.g&&rgb.g>=rgb.b) hsb.h=60*(rgb.g-rgb.b)/(rgb.r-rgb.b);
else if(rgb.g>=rgb.r&&rgb.r>=rgb.b) hsb.h=60  + 60*(rgb.g-rgb.r)/(rgb.g-rgb.b);
else if(rgb.g>=rgb.b&&rgb.b>=rgb.r) hsb.h=120 + 60*(rgb.b-rgb.r)/(rgb.g-rgb.r);
else if(rgb.b>=rgb.g&&rgb.g>=rgb.r) hsb.h=180 + 60*(rgb.b-rgb.g)/(rgb.b-rgb.r);
else if(rgb.b>=rgb.r&&rgb.r>=rgb.g) hsb.h=240 + 60*(rgb.r-rgb.g)/(rgb.b-rgb.g);
else if(rgb.r>=rgb.b&&rgb.b>=rgb.g) hsb.h=300 + 60*(rgb.r-rgb.b)/(rgb.r-rgb.g);
else 								   hsb.h=0;
hsb.h=Math.round(hsb.h);
return hsb;
};
window.trx_effects_hsb2rgb=function(hsb){
var rgb={};
var h=Math.round(hsb.h);
var s=Math.round(hsb.s*255/100);
var v=Math.round(hsb.b*255/100);
if(s==0){
rgb.r=rgb.g=rgb.b=v;
}else{
var t1=v;
var t2=(255-s)*v/255;
var t3=(t1-t2)*(h%60)/60;
if(h==360) h=0;
if(h<60){ rgb.r=t1;	rgb.b=t2;   rgb.g=t2+t3; }
else if(h<120){ rgb.g=t1; rgb.b=t2;	rgb.r=t1-t3; }
else if(h<180){ rgb.g=t1; rgb.r=t2;	rgb.b=t2+t3; }
else if(h<240){ rgb.b=t1; rgb.r=t2;	rgb.g=t1-t3; }
else if(h<300){ rgb.b=t1; rgb.g=t2;	rgb.r=t2+t3; }
else if(h<360){ rgb.r=t1; rgb.g=t2;	rgb.b=t1-t3; }else{ rgb.r=0;  rgb.g=0;	rgb.b=0;	 }}
return { r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b) };};
window.trx_effects_clear_listbox=function(box){
for (var i=box.options.length-1; i >=0; i--)
box.options[i]=null;
};
window.trx_effects_add_listbox_item=function(box, val, text){
var item=new Option();
item.value=val;
item.text=text;
box.options.add(item);
};
window.trx_effects_del_listbox_item_by_value=function(box, val){
for (var i=0; i < box.options.length; i++){
if(box.options[i].value==val){
box.options[i]=null;
break;
}}
};
window.trx_effects_del_listbox_item_by_text=function(box, txt){
for (var i=0; i < box.options.length; i++){
if(box.options[i].text==txt){
box.options[i]=null;
break;
}}
};
window.trx_effects_find_listbox_item_by_value=function(box, val){
var idx=-1;
for (var i=0; i < box.options.length; i++){
if(box.options[i].value==val){
idx=i;
break;
}}
return idx;
};
window.trx_effects_find_listbox_item_by_text=function(box, txt){
var idx=-1;
for (var i=0; i < box.options.length; i++){
if(box.options[i].text==txt){
idx=i;
break;
}}
return idx;
};
window.trx_effects_select_listbox_item_by_value=function(box, val){
for (var i=0; i < box.options.length; i++){
box.options[i].selected=(val==box.options[i].value);
}};
window.trx_effects_select_listbox_item_by_text=function(box, txt){
for (var i=0; i < box.options.length; i++){
box.options[i].selected=(txt==box.options[i].text);
}};
window.trx_effects_get_listbox_values=function(box){
var delim=arguments[1] ? arguments[1]:',';
var str='';
for (var i=0; i < box.options.length; i++){
str +=(str ? delim:'') + box.options[i].value;
}
return str;
};
window.trx_effects_get_listbox_texts=function(box){
var delim=arguments[1] ? arguments[1]:',';
var str='';
for (var i=0; i < box.options.length; i++){
str +=(str ? delim:'') + box.options[i].text;
}
return str;
};
window.trx_effects_sort_listbox=function(box){
var temp_opts=new Array();
var temp=new Option();
for(var i=0; i<box.options.length; i++){
temp_opts[i]=box.options[i].clone();
}
for(var x=0; x<temp_opts.length-1; x++){
for(var y=(x+1); y<temp_opts.length; y++){
if(temp_opts[x].text > temp_opts[y].text){
temp=temp_opts[x];
temp_opts[x]=temp_opts[y];
temp_opts[y]=temp;
}}
}
for(i=0; i<box.options.length; i++){
box.options[i]=temp_opts[i].clone();
}};
window.trx_effects_get_listbox_selected_index=function(box){
for (var i=0; i < box.options.length; i++){
if(box.options[i].selected)
return i;
}
return -1;
};
window.trx_effects_get_listbox_selected_value=function(box){
for (var i=0; i < box.options.length; i++){
if(box.options[i].selected){
return box.options[i].value;
}}
return null;
};
window.trx_effects_get_listbox_selected_text=function(box){
for (var i=0; i < box.options.length; i++){
if(box.options[i].selected){
return box.options[i].text;
}}
return null;
};
window.trx_effects_get_listbox_selected_option=function(box){
for (var i=0; i < box.options.length; i++){
if(box.options[i].selected){
return box.options[i];
}}
return null;
};
window.trx_effects_get_radio_value=function(radioGroupObj){
for (var i=0; i < radioGroupObj.length; i++){
if(radioGroupObj[i].checked) return radioGroupObj[i].value;
}
return null;
};
window.trx_effects_set_radio_checked_by_num=function(radioGroupObj, num){
for (var i=0; i < radioGroupObj.length; i++){
if(radioGroupObj[i].checked&&i!=num) radioGroupObj[i].checked=false;
else if(i==num) radioGroupObj[i].checked=true;
}};
window.trx_effects_set_radio_checked_by_value=function(radioGroupObj, val){
for (var i=0; i < radioGroupObj.length; i++){
if(radioGroupObj[i].checked&&radioGroupObj[i].value!=val) radioGroupObj[i].checked=false;
else if(radioGroupObj[i].value==val) radioGroupObj[i].checked=true;
}};
window.trx_effects_debounce=function(func, wait){
var timeout;
return function (){
var context=this,
args=arguments;
var later=function later(){
timeout=null;
func.apply(context, args);
};
var callNow = ! timeout;
clearTimeout(timeout);
timeout=setTimeout(later, wait);
if(callNow){
func.apply(context, args);
}};};
window.trx_effects_throttle=function(func, wait, debounce){
var timeout=null;
return function (){
var context=this,
args=arguments;
var throttler=function (){
timeout=null;
func.apply(context, args);
};
if(debounce&&timeout){
clearTimeout(timeout);
timeout=null;
}
if(debounce||! timeout){
timeout=setTimeout(throttler, wait);
}};};
window.trx_effects_transition_end=function(){
var e=document.createElement("transitionDetector"),
t={
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
transition: "transitionend"
},
r="transitionend";
for(var n in t){
if(undefined!==e.style[n]){
r=t[n];
break;
}}
return r;
};
window.trx_effects_animation_end=function(){
var e=document.createElement("animationDetector"),
t={
animation: "animationend",
OAnimation: "oAnimationEnd",
MozAnimation: "animationend",
WebkitAnimation: "webkitAnimationEnd"
},
r="animationend";
for(var n in t){
if(undefined!==e.style[n]){
r=t[n];
break;
}}
return r;
};
var support={
transitions: window.Modernizr ? Modernizr.csstransitions:false,
animations: window.Modernizr ? Modernizr.cssanimations:false
},
trans_end_event_names={ 'WebkitTransition': 'webkitTransitionEnd', 'MozTransition': 'transitionend', 'OTransition': 'oTransitionEnd', 'msTransition': 'MSTransitionEnd', 'transition': 'transitionend' },
trans_end_event_name=window.Modernizr ? trans_end_event_names[ Modernizr.prefixed('transition') ]:trx_effects_transition_end(),
anima_end_event_names={ 'WebkitAnimation': 'webkitAnimationEnd', 'MozAnimation': 'animationend', 'OAnimation': 'oAnimationEnd', 'msAnimation': 'MSAnimationEnd', 'animation': 'animationend' },
anima_end_event_name=window.Modernizr ? anima_end_event_names[ Modernizr.prefixed('animation') ]:trx_effects_animation_end();
window.trx_effects_on_end_transition=function(el, callback, timeout){
var on_end_callback=function(e){
if(support.transitions){
if(e.target!=this){
return;
}
this.removeEventListener(trans_end_event_name, on_end_callback);
}
if(callback&&typeof callback==='function'){
callback.call(this);
}};
if(support.transitions){
el.addEventListener(trans_end_event_name, on_end_callback, false);
}else{
setTimeout(function(){
if(callback&&typeof callback==='function'){
callback.call(this);
}}, timeout||0);
}};
window.trx_effects_on_end_animation=function(el, callback, timeout){
var on_end_callback=function(e){
if(support.animations){
if(e.target!=this){
return;
}
this.removeEventListener(anima_end_event_name, on_end_callback);
}
if(callback&&typeof callback==='function'){
callback.call(this);
}};
if(support.animations){
el.addEventListener(anima_end_event_name, on_end_callback, false);
}else{
setTimeout(function(){
if(callback&&typeof callback==='function'){
callback.call(this);
}}, timeout||0);
}};
window.trx_effects_elementor_get_settings_by_cid=function(cid, keys){
if(typeof elementorFrontend!='undefined'){
var settings=elementorFrontend.config.elements.data[cid].attributes;
if(keys){
var params={};
for(var s in settings){
for(var i=0; i < keys.length; i++){
if(s.indexOf(keys[i])===0){
if(typeof settings[s]=='object'&&settings[s].hasOwnProperty('models')){
var tmp=[];
for(var m=0; m < settings[s]['models'].length; m++){
tmp.push(settings[s]['models'][m]['attributes']);
}
params[s]=tmp;
}else{
params[s]=settings[s];
}
break;
}}
}
return params;
}
return settings;
}
return false;
};
window.trx_effects_get_responsive_breakpoint=function(){
var rez='desktop', ww=$window.width();
if(TRX_EFFECTS_STORAGE['elementor_breakpoints']){
for(var bp_name in TRX_EFFECTS_STORAGE['elementor_breakpoints']){
if(TRX_EFFECTS_STORAGE['elementor_breakpoints'][bp_name] < ww){
break;
}
rez=bp_name;
}}
return rez;
};
window.trx_effects_object_clone=function(obj){
var copy;
if(null===obj||"object"!=typeof obj){
return obj;
}
if(obj instanceof Date){
copy=new Date();
copy.setTime(obj.getTime());
return copy;
}
if(obj instanceof Array){
copy=[];
for (var i=0, len=obj.length; i < len; i++){
copy[i]=trx_effects_object_clone(obj[i]);
}
return copy;
}
if(obj instanceof Object){
copy={};
for (var attr in obj){
if(obj.hasOwnProperty(attr)){
copy[attr]=trx_effects_object_clone(obj[attr]);
}}
return copy;
}
return obj;
};
window.trx_effects_object_merge=function(o1, o2){
for (var i=1; i<arguments.length; i++){
if(arguments[i]){
for (var prop in arguments[i]){
if(arguments[i].hasOwnProperty(prop)){
o1[prop]=arguments[i][prop];
}}
}}
return o1;
};
window.trx_effects_is_object=function(o){
return typeof o==='object'&&o!==null&&o.constructor&&o.constructor===Object;
};
window.trx_effects_object_extend=function(){
var args=[], total=arguments.length;
while(total--){
args[ total ]=arguments[ total ];
}
var to=Object(args[0]);
for(var i=1; i < args.length; i++){
var nextSource=args[i];
if(nextSource!==undefined&&nextSource!==null){
var keysArray=Object.keys(Object(nextSource));
for(var nextIndex=0, len=keysArray.length; nextIndex < len; nextIndex++){
var nextKey=keysArray[ nextIndex ];
var desc=Object.getOwnPropertyDescriptor(nextSource, nextKey);
if(desc!==undefined&&desc.enumerable){
if(trx_effects_is_object(to[ nextKey ])&&trx_effects_is_object(nextSource[ nextKey ])){
trx_effects_object_extend(to[ nextKey ], nextSource[ nextKey ]);
}else if(! trx_effects_is_object(to[ nextKey ])&&trx_effects_is_object(nextSource[ nextKey ])){
to[ nextKey ]={};
trx_effects_object_extend(to[ nextKey ], nextSource[ nextKey ]);
}else{
to[ nextKey ]=nextSource[ nextKey ];
}}
}}
}
return to;
};
window.trx_effects_get_class=function(obj){
if(obj instanceof Object&&!(obj instanceof Array)&&!(obj instanceof Function)&&obj.constructor){
var arr=obj.constructor.toString().match(/function\s*(\w+)/);
if(arr&&arr.length==2) return arr[1];
}
return false;
};
window.trx_effects_array_merge=function(a1, a2){
if(a2){
for(var i in a2){
a1[i]=a2[i];
}}
return a1;
};
window.trx_effects_array_first_key=function(arr){
var rez=null;
for (var i in arr){
rez=i;
break;
}
return rez;
};
window.trx_effects_array_first_value=function(arr){
var rez=null;
for (var i in arr){
rez=arr[i];
break;
}
return rez;
};
window.trx_effects_serialize=function(mixed_val){
var obj_to_array=arguments.length==1||argument[1]===true;
switch(typeof(mixed_val)){
case "number":
if(isNaN(mixed_val)||!isFinite(mixed_val))
return false;
else
return (Math.floor(mixed_val)==mixed_val ? "i":"d") + ":" + mixed_val + ";";
case "string":
return "s:" + mixed_val.length + ":\"" + mixed_val + "\";";
case "boolean":
return "b:" + (mixed_val ? "1":"0") + ";";
case "object":
if(mixed_val===null){
return "N;";
}else if(mixed_val instanceof Array){
var idxobj={ idx: -1 };
var map=[];
for (var i=0; i < mixed_val.length; i++){
idxobj.idx++;
var ser=trx_effects_serialize(mixed_val[i]);
if(ser)
map.push(trx_effects_serialize(idxobj.idx) + ser);
}
return "a:" + mixed_val.length + ":{" + map.join("") + "}";
}else{
var class_name=trx_effects_get_class(mixed_val);
if(class_name==undefined)
return false;
var props=new Array();
for (var prop in mixed_val){
var ser=trx_effects_serialize(mixed_val[prop]);
if(ser)
props.push(trx_effects_serialize(prop) + ser);
}
if(obj_to_array)
return "a:" + props.length + ":{" + props.join("") + "}";
else
return "O:" + class_name.length + ":\"" + class_name + "\":" + props.length + ":{" + props.join("") + "}";
}
case "undefined":
return "N;";
}
return false;
};
var filters={};
window.trx_effects_add_filter=function(filter, callback, priority){
if(priority===undefined) priority=10;
if(typeof wp!='undefined'&&typeof wp.hooks!='undefined'){
wp.hooks.addFilter(filter, 'trx_effects', callback, priority);
}else{
if(! filters[filter]) filters[filter]={};
if(! filters[filter][priority]) filters[filter][priority]=[];
filters[filter][priority].push(callback);
}};
window.trx_effects_apply_filters=function(filter, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9){
if(typeof wp!='undefined'&&typeof wp.hooks!='undefined'&&typeof wp.hooks.applyFilters!='undefined'){
arg1=wp.hooks.applyFilters(filter, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}else if(typeof filters[filter]=='object'){
var keys=Object.keys(filters[filter]).sort();
for (var i=0; i < keys.length; i++){
for (var j=0; j < filters[filter][keys[i]].length; j++){
if(typeof filters[filter][keys[i]][j]=='function'){
arg1=filters[filter][keys[i]][j](arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}}
}}
return arg1;
};
window.trx_effects_add_action=function(action, callback, priority){
if(typeof wp!='undefined'&&typeof wp.hooks!='undefined'){
wp.hooks.addAction(action, 'trx_effects', callback, priority==undefined ? 10:priority);
}else{
trx_effects_add_filter(action, callback, priority);
}};
window.trx_effects_do_action=function(action, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9){
if(typeof wp!='undefined'&&typeof wp.hooks!='undefined'&&typeof wp.hooks.doActions!='undefined'){
wp.hooks.doActions(action, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}else{
trx_effects_apply_filters(action, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}};})();
(function(){
"use strict";
var $window=jQuery(window),
$document=jQuery(document),
$body;
$document.ready(function(){
$body=jQuery('body');
window.trx_effects_intersection_observer=new TrxEffectsIntersectionObserver();
$document.trigger('trx_effects_action_init');
});
$document.on('trx_effects_action_init', function(){
$document.trigger('trx_effects_action_init_hidden_elements', [ $body ]);
});
$window.on('elementor/frontend/init', function(){
if(typeof window.elementorFrontend!=='undefined'
&& typeof window.elementorFrontend.hooks!=='undefined'
&& elementorFrontend.isEditMode()
){
var init_hidden_elements_immediately=false,
init_hidden_elements_immediately_start=trx_effects_throttle(function(){
init_hidden_elements_immediately=true;
init_hidden_elements($body);
}, 2500, true),
init_hidden_elements=function($cont){
$document.trigger('trx_effects_action_init_hidden_elements', [$cont]);
};
elementorFrontend.hooks.addAction('frontend/element_ready/global', function($cont){
if(init_hidden_elements_immediately){
init_hidden_elements($cont);
}else{
init_hidden_elements_immediately_start();
}});
}});
$document.on('ajaxComplete', function(e){
setTimeout(function(){
$document.trigger('trx_effects_action_got_ajax_response');
}, 100);
});
$document.on('action.before_remove_content', function(e, $cont){
$document.trigger('trx_effects_action_before_remove_content', [$cont]);
});
$document.on('action.after_add_content', function(e, $cont){
$document.trigger('trx_effects_action_after_add_content', [$cont]);
});
$document.on('action.build_page_toc', function(e){
$document.trigger('trx_effects_action_build_page_toc');
});
$document.on('action.activate_tab', function(e, $cont){
$document.trigger('trx_effects_action_activate_tab', [$cont]);
});
$document.on('action.deactivate_tab', function(e, $cont){
$document.trigger('trx_effects_action_deactivate_tab', [$cont]);
});
var $show_on_scroll=false;
var _window_height=$window.height(),
_window_scroll_top=$window.scrollTop();
setTimeout(function(){
$document.on('trx_effects_action_init_hidden_elements trx_effects_action_got_ajax_response', function(e, $cont){
$show_on_scroll=jQuery('.trx_effects_show_on_scroll');
if($show_on_scroll.length > 0){
trx_effects_intersection_observer.add($show_on_scroll);
trx_effects_intersection_observer.on_scroll();
trx_effects_show_on_scroll();
}});
}, 10);
$window.on('scroll', trx_effects_show_on_scroll);
function trx_effects_show_on_scroll(){
_window_height=$window.height();
_window_scroll_top=$window.scrollTop();
if($show_on_scroll){
$show_on_scroll.each(function(){
var item=jQuery(this);
if(item.hasClass('trx_effects_in_viewport')){
if(item.offset().top < _window_scroll_top + _window_height * 0.75){
item.removeClass('trx_effects_show_on_scroll').addClass('trx_effects_showed_on_scroll');
trx_effects_intersection_observer.remove(item);
$show_on_scroll=jQuery('.trx_effects_show_on_scroll');
}}
});
}}
var TrxEffectsIntersectionObserver=function(){
this.observer=false;
this.items={};
if(typeof IntersectionObserver!='undefined'){
var intersection_observer=this;
this.observer=new IntersectionObserver(function(entries){
entries.forEach(function(entry){
intersection_observer.in_out(jQuery(entry.target), entry.isIntersecting||entry.intersectionRatio > 0 ? 'in':'out', entry);
});
}, {
root: null,
rootMargin: '0px',
threshold: 0	
});
}else{
$window.on('scroll', this.on_scroll);
}};
TrxEffectsIntersectionObserver.prototype.on_scroll=function(){
for(var i in this.items){
if(! this.items[i]||this.items[i].length===0){
continue;
}
var item=this.items[i],
item_top=item.offset().top,
item_height=item.height();
this.in_out(item, item_top + item_height > _window_scroll_top&&item_top < _window_scroll_top + _window_height ? 'in':'out');
}};
TrxEffectsIntersectionObserver.prototype.in_out=function(item, state, entry){
var callback='';
if(state=='in'){
if(! item.hasClass('trx_effects_in_viewport')){
item.addClass('trx_effects_in_viewport');
callback=item.data('trx-effects-intersection-callback');
if(callback){
callback(item, true, entry);
}}
}else{
if(item.hasClass('trx_effects_in_viewport')){
item.removeClass('trx_effects_in_viewport');
callback=item.data('trx-effects-intersection-callback');
if(callback){
callback(item, false, entry);
}}
}};
TrxEffectsIntersectionObserver.prototype.add=function(items, callback){
var intersection_observer=this;
items.each(function(){
var $self=jQuery(this),
id=$self.attr('id');
if(! $self.hasClass('trx_effects_intersection_inited')){
if(! id){
id='io-' +('' + Math.random()).replace('.', '');
$self.attr('id', id);
}
$self.addClass('trx_effects_intersection_inited');
if(callback){
$self.data('trx-effects-intersection-callback', callback);
}
intersection_observer.items[id]=$self;
if(intersection_observer.observer){
intersection_observer.observer.observe($self.get(0));
}}
});
};
TrxEffectsIntersectionObserver.prototype.remove=function(items){
var intersection_observer=this;
items.each(function(){
var $self=jQuery(this),
id=$self.attr('id');
if($self.hasClass('trx_effects_intersection_inited')){
$self.removeClass('trx_effects_intersection_inited');
delete intersection_observer.items[id];
if(intersection_observer.observer){
intersection_observer.observer.unobserve($self.get(0));
}}
});
};})();