(function($){
"use strict";
const $window=$(window);
window.rheaIsRTL=function (){
let isRTL=false;
if(document.querySelector('body').classList.contains('rtl')){
isRTL=true;
}
return isRTL;
}
$(document).ready(function (){
const stickyHeader=$('#rhea-sticky-header');
if(stickyHeader.length){
const headerHeight=stickyHeader.height();
$window.on('scroll', function (){
let $this=$(this);
if($this.width() > 1024){
if($this.scrollTop() >(headerHeight + 100)){
stickyHeader.addClass('sticked');
}else{
stickyHeader.removeClass('sticked');
}}
});
}
const $body=$('body');
$body.on('click', '.rhea_pagination_wrapper a', function(e){
e.preventDefault();
var thisParent=$(this).parents('.rhea_ele_property_ajax_target');
var id=$(thisParent).attr('id');
var thisLoader=$(thisParent).find('.rhea_svg_loader');
var thisInner=$(thisParent).find('.home-properties-section-inner-target');
var pageNav=$(thisParent).find('.rhea_pagination_wrapper a');
var thisLink=$(this);
if(!(thisLink).hasClass('current')){
var link=$(this).attr('href');
thisInner.fadeTo('slow', 0.5);
thisLoader.slideDown('fast');
thisParent.load(link + ' #' + id + ' .home-properties-section-inner-target', function(response, status, xhr){
if(status=='success'){
thisInner.fadeTo('fast', 1);
pageNav.removeClass('current');
thisLink.addClass('current');
thisLoader.slideUp('fast');
if(typeof EREloadNewsSlider!='undefined'&&$.isFunction(EREloadNewsSlider)){
EREloadNewsSlider();
}
if(typeof setVideoHeightElementor!='undefined'&&$.isFunction(setVideoHeightElementor)){
setVideoHeightElementor();
}
$('html, body').animate({
scrollTop:$('#' + id).offset().top - 32
}, 1000);
}else{
thisInner.fadeTo('fast', 1);
thisLoader.slideUp('fast');
}});
}});
$body.on("click", ".rhea-ultra-properties-ajax-pagination a", function(event){
const $this=$(this),
currentPageNum=parseInt($this.data('page')),
propertiesContainer=$this.closest(".rhea-ultra-properties-container"),
propertiesInner=propertiesContainer.find('.rhea-ultra-properties-inner-container'),
propertiesStatsWrapper=propertiesContainer.find('.rhea-ultra-properties-top-bar-stats-wrapper'),
paginationContainer=propertiesContainer.find(".rhea-ultra-properties-ajax-pagination"),
paginationItems=propertiesContainer.find(".pagination a"),
loader=propertiesContainer.find(".rhea_svg_loader");
if($this.hasClass("current")){
return false;
}
loader.slideDown();
if(typeof propertiesMapNewData!=="undefined"){
$.ajax({
url:ajaxurl,
type:'post',
data:{
action:'rhea_map_properties_data',
paged:currentPageNum,
properties_args:JSON.parse(propertiesMapNewData.rheaPropertiesArgs)
},
success:function(response){
if(response.data){
const rheaUpdateMapData=$.Event('rheaUpdateMapData', {
mapProperties:JSON.stringify(response.data)
});
$(document).trigger(rheaUpdateMapData);
}}
});
}
$.ajax({
url:$this.attr('href'),
method:'GET',
success:function(response){
let $response=$(response);
propertiesStatsWrapper.html($response.find(".rhea-ultra-properties-top-bar-stats-wrapper > .rhea-ultra-properties-stats"));
paginationContainer.html($response.find(".rhea-ultra-properties-ajax-pagination > .pagination"));
propertiesInner.html($response.find(".rhea-ultra-properties-inner-container > div"));
paginationItems.removeClass('current');
$this.addClass('current');
loader.slideUp();
$('html, body').animate({
scrollTop:propertiesContainer.find('.rhea-ultra-properties-inner-container').offset().top - 100
}, 1000);
}});
event.preventDefault();
});
let rheaStatusBox=$('.rhea-ultra-property-card-three-wrapper .rhea-ultra-status-box');
if(0 < rheaStatusBox.length){
rheaStatusBox.each(function (){
if(! $.trim($(this).html()).length){
$(this).addClass('rhea-empty-wrapper');
}});
}
$('body').on('click', '.rhea-ultra-property-card-five-popup', function (){
let thisPopUp=$(this).data('src');
let galleryItems=$(thisPopUp).find('.rhea-gallery-item');
galleryItems.each(function (){
let thisUlr=$(this).data('bg-image');
$(this).css('background-image', 'url("' + thisUlr + '")');
});
});
rheaEqualWidthButtons('.rhea-equal-width-btn-1', '.rhea-equal-width-btn-2');
});
window.rheaEqualWidthButtons=function(btn1, btn2){
const rheaW1=$(btn1).innerWidth();
const rheaW2=$(btn2).innerWidth();
if(rheaW1 > rheaW2){
$(btn2).css('width', rheaW1 + "px");
}else{
$(btn1).css('width', rheaW2 + "px");
}}
window.rheaMenuDisplayScreen=function(size, widgetID){
const lgMenu=$(".rhea-lg-menu-" + widgetID);
const responsiveMenu=$(".rhea-responsive-men-" + widgetID);
if(innerWidth < size){
lgMenu.hide();
responsiveMenu.show();
}else{
lgMenu.show();
responsiveMenu.hide();
}}
window.rheaSelectPicker=function(id){
if($().selectpicker){
$(id).selectpicker({
iconBase:'fas',
dropupAuto:'true',
width:"100%",
tickIcon:'fa-check',
selectAllText:'<span class="rhea_select_bs_buttons rhea_bs_select"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><polygon points="22.1 9 20.4 7.3 14.1 13.9 15.8 15.6 "/><polygon points="27.3 7.3 16 19.3 9.6 12.8 7.9 14.5 16 22.7 29 9 "/><polygon points="1 14.5 9.2 22.7 10.9 21 2.7 12.8 "/></svg></span>',
deselectAllText:'<span class="rhea_select_bs_buttons rhea_bs_deselect"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><style type="text/css">  \n' +
'\t.rh-st0{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}\n' +
'</style><path class="rhea_des rh-st0" d="M3.4 10.5H20c3.8 0 7 3.1 7 7v0c0 3.8-3.1 7-7 7h-6"/><polyline class="rhea_des rh-st0" points="8.4 15.5 3.4 10.5 8.4 5.5 "/></svg></span>'
});
}};
window.rheaSearchFields=function(id, fieldCount, topFields, collapsedFields){
var divList=$(id).find('.rhea_prop_search__option');
divList.sort(function(a, b){
return $(a).data("key-position") - $(b).data("key-position")
});
$(topFields).html(divList).promise().done(function (){
var getDataTopBar=fieldCount;
var advanceSearch=$(topFields).find('.rhea_prop_search__option');
var prePendTo=$(collapsedFields);
var i=0;
var j=0;
advanceSearch.each(function (){
if(i < getDataTopBar + 1){
if($(this).hasClass('hide-fields')){
j=2;
}
if($(this).hasClass('rvr-hide-fields')){
j++;
}}
i++;
});
var advanceElements=getDataTopBar + j + 1;
if(advanceElements > 0){
var advanceFieldsSmart=$(topFields)
.find('.rhea_prop_search__option:nth-of-type(n+' + advanceElements + ')');
advanceFieldsSmart.detach().prependTo(prePendTo);
}});
};
window.rheaOpenSearchPopup=function(trigger, popup){
$(trigger).on('click', function (){
$(popup).addClass('active');
$(popup).fadeIn('fast');
});
$('.rhea-popup-close').on('click', function (){
$(popup).removeClass('active');
$(popup).fadeOut('fast');
$(trigger).removeClass('rhea_advance_open');
})
}
window.rheaPropertySlider=function(id, min, max, pos='before', separator=',', currency='$', min_searched='', max_searched='', step=100){
function thousandSeparator(n){
if(typeof n==='number'){
n +='';
var x=n.split('.');
var x1=x[0];
var x2=x.length > 1 ? '.' + x[1]:'';
var rgx=/(\d+)(\d{3})/;
while(rgx.test(x1)){
x1=x1.replace(rgx, '$1' + separator + '$2');
}
return x1 + x2;
}else{
return n;
}}
var getPosition=pos;
var PosBefore='';
var PosAfter='';
if(getPosition==='before'){
PosBefore=currency;
}else{
PosAfter=currency;
}
var minVal=min;
var maxVal=max;
if(min_searched!==''){
minVal=min_searched
}
if(max_searched!==''){
maxVal=max_searched
}
$(id).slider({
range:true,
min:min,
max:max,
step:step,
values:[minVal, maxVal],
slide:function(event, ui){
if(ui.values[0] >=ui.values[1] - Math.round(ui.values[1] / 10)){
return false;
}
for(var i=0; i < ui.values.length; ++i){
$("input.rhea_slider_value[data-index=" + i + "]").val(ui.values[i]);
$("span.rhea_price_display[data-index=" + i + "]")
.text(PosBefore + thousandSeparator(ui.values[i]) + PosAfter);
}}
});
};
window.rheaSearchAdvanceState=function(buttonID, wrapperID){
$(buttonID).on('click', function (){
$(buttonID).toggleClass('rhea_advance_open');
if($(buttonID).hasClass('rhea_advance_open')){
$(wrapperID).slideDown('normal');
}else{
$(wrapperID).slideUp('normal');
}});
};
window.rheaFeaturesState=function(buttonID, wrapperID){
$(buttonID).on('click', function (){
$(buttonID).toggleClass('rhea_features_open');
if($(buttonID).hasClass('rhea_features_open')){
$(wrapperID).slideDown('normal');
}else{
$(wrapperID).slideUp('normal');
}});
};
window.rheaSearchStatusChange=function(priceOther, PriceRent, statusID, rent_status='for-rent'){
if(''!==rent_status){
var rhea_property_status_changed=function(new_status){
var price_for_others=$(priceOther);
var price_for_rent=$(PriceRent);
if(price_for_others.length > 0&&price_for_rent.length > 0){
if(new_status===rent_status){
price_for_others.addClass('hide-fields').find('select').prop('disabled', true);
price_for_rent.removeClass('hide-fields').find('select').prop('disabled', false);
}else{
price_for_rent.addClass('hide-fields').find('select').prop('disabled', true);
price_for_others.removeClass('hide-fields').find('select').prop('disabled', false);
}}
};
$(statusID).change(function(e){
var selected_status=$(this).val();
rhea_property_status_changed(selected_status);
$('.rhea_multi_select_picker').selectpicker('refresh');
});
var selected_status=$(statusID).val();
if(selected_status===rent_status){
rhea_property_status_changed(selected_status);
}}
};
window.minMaxPriceValidation=function(minID, maxID){
$(minID).add(maxID).on('change', function (){
var min_text_val=$(minID).val();
var min_int_val=(isNaN(min_text_val)) ? 0:parseInt(min_text_val);
var max_text_val=$(maxID).val();
var max_int_val=(isNaN(max_text_val)) ? 0:parseInt(max_text_val);
if(( min_int_val >=max_int_val)&&(min_int_val!=0)&&(max_int_val!=0)){
$(minID).add(maxID).siblings('.dropdown-toggle').addClass('rhea-error');
}else{
$(minID).add(maxID).siblings('.dropdown-toggle').removeClass('rhea-error');
}});
};
window.minMaxRentPriceValidation=function(minID, maxID){
$(minID).add(maxID).on('change', function (){
var min_text_val=$(minID).val();
var min_int_val=(isNaN(min_text_val)) ? 0:parseInt(min_text_val);
var max_text_val=$(maxID).val();
var max_int_val=(isNaN(max_text_val)) ? 0:parseInt(max_text_val);
if(( min_int_val >=max_int_val)&&(min_int_val!=0)&&(max_int_val!=0)){
$(minID).add(maxID).siblings('.dropdown-toggle').addClass('rhea-error');
}else{
$(minID).add(maxID).siblings('.dropdown-toggle').removeClass('rhea-error');
}});
};
window.minMaxAreaValidation=function(minID, maxID){
$(minID).add(maxID).on('change', function(obj, e){
var min_text_val=$(minID).val();
var min_int_val=(isNaN(min_text_val)) ? 0:parseInt(min_text_val);
var max_text_val=$(maxID).val();
var max_int_val=(isNaN(max_text_val)) ? 0:parseInt(max_text_val);
if(( min_int_val >=max_int_val)&&(min_int_val!=0)&&(max_int_val!=0)){
$(minID).add(maxID).addClass('rhea-error');
}else{
$(minID).add(maxID).removeClass('rhea-error');
}});
};
window.rheaLoadMapBoxMap=function(id, settingObj){
let ThisMapID=id,
mapBoxContainer=document.getElementById(id);
mapBoxContainer.className=mapBoxContainer.className + ' mapbox-dl-map-wrap rhea-mapbox-wrap';
if(typeof settingObj!=="undefined"){
if(0 < settingObj.properties.length&&typeof settingObj.settings.api_key!=='undefined'){
const eleMapBoxAPI=settingObj.settings.api_key,
mapBoxPropertiesData=settingObj.properties,
widgetSettings=settingObj.settings,
mapBoxStyle=widgetSettings.style,
mapBoxMarkerType='pin'; //widgetSettings.marker_type;
let tileLayer=L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
let mapBounds=[];
for(let i=0; i < mapBoxPropertiesData.length; i++){
if(mapBoxPropertiesData[i].lat&&mapBoxPropertiesData[i].lng){
mapBounds.push([mapBoxPropertiesData[i].lat, mapBoxPropertiesData[i].lng]);
}}
let mapBoxCenter=L.latLng(27.664827, -81.515755);
if(1===mapBounds.length){
mapBoxCenter=L.latLng(mapBounds[0]);
}
L.mapbox.accessToken=eleMapBoxAPI;
const mapBoxProperties=L.mapbox.map(mapBoxContainer)
.setView(mapBoxCenter, 12)
.addLayer(L.mapbox.styleLayer(mapBoxStyle));
if(1 < mapBounds.length){
mapBoxProperties.fitBounds(mapBounds);
}
let markers=new L.MarkerClusterGroup();
for(let i=0; i < mapBoxPropertiesData.length; i++){
if(mapBoxPropertiesData[i].lat&&mapBoxPropertiesData[i].lng){
let propertyMapData=mapBoxPropertiesData[i],
markerLatLng=L.latLng(propertyMapData.lat, propertyMapData.lng),
propertyMarker,
markerOptions={
id:propertyMapData.id,
riseOnHover:true
};
if(propertyMapData.title){
markerOptions.title=propertyMapData.title;
}
if('pin'===mapBoxMarkerType){
let iconOptions={
iconUrl:propertyMapData.icon,
iconSize:[42, 57],
iconAnchor:[20, 57],
popupAnchor:[1, -54]
};
if(propertyMapData.retinaIcon){
iconOptions.iconRetinaUrl=propertyMapData.retinaIcon;
}
markerOptions.icon=L.icon(iconOptions);
propertyMarker=L.marker(markerLatLng, markerOptions);
}else{
propertyMarker=new L.CircleMarker(markerLatLng, {
fillColor:'#1cb2ff', //widgetSettings.marker_color,
color:'#1cb2ff', //widgetSettings.marker_color,
weight:2,
fillOpacity:0.6,
opacity:0.6,
radius:25
}).addTo(mapBoxProperties);
}
let popupContentWrapper=document.createElement("div");
popupContentWrapper.className='mapboxgl-popup-content';
let popupContent="";
if(propertyMapData.thumb){
popupContent +='<a class="mapbox-popup-thumb-link" href="' + propertyMapData.url + '"><img class="mapbox-popup-thumb" src="' + propertyMapData.thumb + '" alt="' + propertyMapData.title + '"/></a>';
}
if(propertyMapData.title){
popupContent +='<h5 class="mapbox-popup-title"><a class="mapbox-popup-link" href="' + propertyMapData.url + '">' + propertyMapData.title + '</a></h5>';
}
if(propertyMapData.price){
popupContent +='<p><span class="mapbox-popup-price">' + propertyMapData.price + '</span></p>';
}
popupContentWrapper.innerHTML=popupContent;
propertyMarker.popupContents=popupContentWrapper;
propertyMarker.id=propertyMapData.id;
propertyMarker.className='mapboxgl-wrapper';
propertyMarker.bindPopup(popupContentWrapper);
markers.addLayer(propertyMarker);
}}
mapBoxProperties.addLayer(markers);
mapBoxProperties.scrollWheelZoom.disable();
mapBoxProperties.on('popupopen', function(e){
var px=mapBoxProperties.project(e.target._popup._latlng);
px.y -=e.target._popup._container.clientHeight / 2;
mapBoxProperties.panTo(mapBoxProperties.unproject(px), { animate:true });
});
function is_marker_in_cluster(marker, cluster){
let length=cluster.length;
for(let i=0; i < length; i++){
if(cluster[i].id==marker){
return true;
}}
return false;
}
function mapbox_open_popup(markerid){
mapBoxProperties.eachLayer(function(layer){
if(typeof layer._childCount!=="undefined"){
let markersincluster=layer.getAllChildMarkers();
if(is_marker_in_cluster(markerid, markersincluster)){
layer.spiderfy();
markersincluster.forEach(function(property_marker){
if(property_marker.id===parseInt(markerid)){
property_marker.openPopup();
}});
}}else{
if(layer.id===parseInt(markerid)){
layer.openPopup();
}}
});
}
function mapbox_close_popup(markerid){
mapBoxProperties.eachLayer(function(layer){
if(typeof layer._childCount!=="undefined"){
var markersincluster=layer.getAllChildMarkers();
if(is_marker_in_cluster(markerid, markersincluster)){
layer.unspiderfy();
markersincluster.forEach(function(property_marker){
if(property_marker.id==parseInt(markerid)){
layer.closePopup();
}});
}}else{
if(layer.id==parseInt(markerid)){
layer.closePopup();
mapBoxProperties.closePopup();
}}
});
}
let realhomesInfoboxPopupTrigger=function (){
$('.rh_popup_info_map').each(function(i){
let property_ID=$(this).attr('data-rh-id').replace(/[^\d.]/g, '');
$(this)
.on('mouseenter', function (){
mapbox_open_popup(property_ID);
})
.on('mouseleave', function (){
mapbox_close_popup(property_ID);
});
});
return false;
};
let RHisMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true:false;
if(! RHisMobile){
realhomesInfoboxPopupTrigger();
}}else{
var fallbackLayer=L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
});
var fallbackMapOptions={
center:[27.664827, -81.515755],
zoom:12
};
var fallbackMap=L.map(ThisMapID, fallbackMapOptions);
fallbackMap.addLayer(fallbackLayer);
}}
};
window.rheaLocationsHandler=function(hierarchicalLocations,
locationPlaceholders,
selectBoxesIDs,
slugsInQueryParams,
selectBoxesCount,
anyValue,
multiSelect){
(function (){
prepareSelectBoxes();
let parentLocations=[];
for(let selectIndex=0; selectIndex < selectBoxesCount; selectIndex++){
const currentSelect=$('#' + selectBoxesIDs[selectIndex]); 
const currentIsLast=(selectBoxesCount===(selectIndex + 1)); 
if(selectIndex===0){ 
parentLocations=addParentLocations(currentSelect, currentIsLast);
}else{ 
if(parentLocations.length > 0){
let currentLocations=[];
const previousSelect=$('#' + selectBoxesIDs[selectIndex - 1]);
if(previousSelect.val()===anyValue){
for(let i=0; i < parentLocations.length; i++){
let tempLocations=addChildrenLocations(currentSelect, parentLocations[i].children, '', currentIsLast);
if(tempLocations.length > 0){
currentLocations=$.merge(currentLocations, tempLocations);
}}
}else{
let previousLocation=searchLocation(previousSelect.val(), hierarchicalLocations);
if(previousLocation&&previousLocation.children.length > 0){
currentLocations=addChildrenLocations(currentSelect, previousLocation.children, '', currentIsLast);
}}
previousSelect.change(updateChildSelect);
parentLocations=currentLocations;
}}
if(parentLocations.length===0){
disableSelect(currentSelect);
break;
}else{
selectParamOption(currentSelect);
}}   
})(); 
function addParentLocations(targetSelect, addAllChildren){
let addedLocations=[];
let insertionCounter=0;
hierarchicalLocations.forEach(function(currentLocation, index, locationsArray){
targetSelect.append('<option value="' + currentLocation.slug + '">' + currentLocation.name + '</option>');
addedLocations[insertionCounter++]=currentLocation;
if(addAllChildren&&currentLocation.children.length){
addChildrenLocations(targetSelect, currentLocation.children, '- ', addAllChildren);
}});
return addedLocations;
}
function addChildrenLocations(targetSelect, childrenLocations, prefix, addAllChildren){
let addedChildrenLocations=[];
let insertionCounter=0;
childrenLocations.forEach(function(currentLocation, index, locationsArray){
targetSelect.append('<option value="' + currentLocation.slug + '">' + prefix + currentLocation.name + '</option>');
addedChildrenLocations[insertionCounter++]=currentLocation;
if(addAllChildren&&currentLocation.children.length){
let tempLocations=addChildrenLocations(targetSelect, currentLocation.children, prefix + '- ', addAllChildren);
if(tempLocations.length > 0){
addedChildrenLocations=$.merge(addedChildrenLocations, tempLocations);
}}
});
return addedChildrenLocations;
}
function searchLocation(slug, locations){
let targetLocation=false;
for(let index=0; index < locations.length; index++){
let currentLocation=locations[index];
if(currentLocation.slug===slug){
targetLocation=currentLocation;
break;
}
if(currentLocation.children.length > 0){
targetLocation=searchLocation(slug, currentLocation.children);
if(targetLocation){
break;
}}
}
return targetLocation;
}
function updateChildSelect(event){
let selectedSlug=$(this).val();
let currentSelectIndex=selectBoxesIDs.indexOf($(this).attr('id'));
if(selectedSlug===anyValue&&(currentSelectIndex > -1)&&(currentSelectIndex <(selectBoxesCount - 1))){
for(let s=currentSelectIndex; s <(selectBoxesCount - 1); s++){
let childSelectIsLast=(selectBoxesCount===(s + 2));
let childSelect=$('#' + selectBoxesIDs[s + 1]);
childSelect.empty();
addAnyOption(childSelect);
let anyChildLocations=[];
$('#' + selectBoxesIDs[s] + ' > option').each(function (){
if(this.value!==anyValue){
let relatedLocation=searchLocation(this.value, hierarchicalLocations);
if(relatedLocation&&relatedLocation.children.length > 0){
let tempChildrenLocations=addChildrenLocations(childSelect, relatedLocation.children, '', childSelectIsLast);
if(tempChildrenLocations.length > 0){
anyChildLocations=$.merge(anyChildLocations, tempChildrenLocations);
}}
}});
if(anyChildLocations.length > 0){
enableSelect(childSelect);
}else{
disableSelect(childSelect);
break;
}}   
}else{
let selectedParentLocation=searchLocation(selectedSlug, hierarchicalLocations);
if(selectedParentLocation){
let childLocations=[];
for(let childSelectIndex=currentSelectIndex + 1; childSelectIndex < selectBoxesCount; childSelectIndex++){
let childSelectIsLast=(selectBoxesCount===(childSelectIndex + 1));
let childSelect=$('#' + selectBoxesIDs[childSelectIndex]);
childSelect.empty();
if(childLocations.length===0){
if(selectedParentLocation.children.length > 0){
addAnyOption(childSelect);
let tempLocations=addChildrenLocations(childSelect, selectedParentLocation.children, '', childSelectIsLast);
if(tempLocations.length > 0){
childLocations=tempLocations;
}}
}else if(childLocations.length > 0){ 
let currentLocations=[];
for(let i=0; i < childLocations.length; i++){
let tempChildLocation=childLocations[i];
if(tempChildLocation.children.length > 0){
addAnyOption(childSelect);
let tempLocations=addChildrenLocations(childSelect, tempChildLocation.children, '', childSelectIsLast);
if(tempLocations.length > 0){
currentLocations=$.merge(currentLocations, tempLocations);
}}
}
childLocations=currentLocations;
}
if(childLocations.length > 0){
enableSelect(childSelect);
}else{
disableSelect(childSelect);
break;
}} 
}}
}
function addAnyOption(targetSelect){
if(targetSelect.has('option').length > 0){
return;
}
let targetSelectIndex=selectBoxesIDs.indexOf(targetSelect.attr('id'));
if(targetSelect.parents('.rhea_prop_search__select')
.hasClass('rhea_location_prop_search_' + targetSelectIndex)){
targetSelect.append('<option value="' + anyValue + '" selected="selected">' + locationPlaceholders[targetSelectIndex] + '</option>');
}}
function disableSelect(targetSelect){
let targetSelectID=targetSelect.attr('id');
targetSelect.empty();
targetSelect.closest('.option-bar').addClass('disabled');
if(targetSelect.is(':enabled')){
targetSelect.prop('disabled', true);
targetSelect.parents('.rhea_prop_search__select').addClass('rhea_disable_parent');
}
let targetSelectIndex=selectBoxesIDs.indexOf(targetSelectID);
let nextSelectBoxesCount=selectBoxesCount -(targetSelectIndex + 1);
if(nextSelectBoxesCount > 0){
let nextSelect=$('#' + selectBoxesIDs[targetSelectIndex + 1]);
disableSelect(nextSelect);
}}
function enableSelect(targetSelect){
let targetSelectID=targetSelect.attr('id');
if(targetSelect.is(':disabled')){
targetSelect.prop('disabled', false);
}
targetSelect.parents('.rhea_prop_search__select').map(function (){
if($(this).hasClass('rhea_disable_parent')){
$(this).removeClass('rhea_disable_parent');
}});
let optionWrapper=targetSelect.closest('.option-bar');
if(optionWrapper.hasClass('disabled')){
optionWrapper.removeClass('disabled');
}}
function selectParamOption(currentSelect){
if(Object.keys(slugsInQueryParams).length > 0){
let selectName=currentSelect.attr('name');
if(typeof selectName!=="undefined"){
selectName=selectName.replace(/[\[\]]+/g, ''); 
}
if(typeof slugsInQueryParams[selectName]!=='undefined'){
let tempValue=slugsInQueryParams[selectName];
if(Array.isArray(tempValue)){
for(let i=0; i < tempValue.length; i++){
currentSelect.find('option[value="' + tempValue[i] + '"]').prop('selected', true);
}}else{
currentSelect.find('option[value="' + tempValue + '"]').prop('selected', true);
}}
}}
function prepareSelectBoxes(){
for(let selectIndex=0; selectIndex < selectBoxesCount; selectIndex++){
let currentSelectId=selectBoxesIDs[selectIndex];
let currentSelect=$('#' + currentSelectId);
if(( multiSelect!=='multiple') &&
(currentSelect.has('option').length===0) &&
(currentSelect.parents('.rhea_prop_search__select')
.hasClass('rhea_location_prop_search_' + selectIndex))){
addAnyOption(currentSelect);
}}
}};
var rheaLocationSuccessList=function(data, thisParent, refreshList=false){
if(true===refreshList){
thisParent.find('option').not(':selected, .none').remove().end();
}
var getSelected=$(thisParent).val();
jQuery.each(data, function(index, text){
if(getSelected){
if(getSelected.indexOf(text[0]) < 0){
thisParent.append($('<option value="' + text[0] + '">' + text[1] + '</option>')
);
}}else{
thisParent.append($('<option value="' + text[0] + '">' + text[1] + '</option>')
);
}});
thisParent.selectpicker('refresh');
$(parent).find('ul.dropdown-menu li:first-of-type a').focus();
$(parent).find('input').focus();
};
var rheaLoaderFadeIn=function(parent){
$(parent).find('.rhea-location-ajax-loader').fadeIn('fast');
};
var rheaLoaderFadeOut=function(parent){
$(parent).find('.rhea-location-ajax-loader').fadeOut('fast');
};
var rheaTriggerAjaxOnLoad=function(parent, thisParent, ajaxurl, hideEmpty, SortAlpha, fieldValue=''){
$.ajax({
url:ajaxurl,
dataType:'json',
delay:250,
data:{
action:'rhea_get_location_options',
query:fieldValue,
hideemptyfields:hideEmpty,
sortplpha:SortAlpha
},
beforeSend:rheaLoaderFadeIn(parent),
success:function(data){
rheaLoaderFadeOut(parent);
rheaLocationSuccessList(data, thisParent, true);
}});
};
var rheaTriggerAjaxOnScroll=function(parent, thisParent, farmControl, ajaxurl, hideEmpty, SortAlpha, fieldValue=''){
var paged=2;
farmControl.on('keyup', function(e){
paged=2;
fieldValue=$(this).val();
});
var targetInner=$(parent).find('div.inner');
targetInner.on('scroll', function (){
var thisInner=$(this);
var thisInnerHeight=thisInner.innerHeight();
var getScrollIndex=thisInner.scrollTop() + thisInnerHeight;
if(getScrollIndex >=$(this)[0].scrollHeight){
$.ajax({
url:ajaxurl,
dataType:'json',
delay:250,
data:{
action:'rhea_get_location_options',
query:fieldValue,
page:paged,
hideemptyfields:hideEmpty,
sortplpha:SortAlpha
},
beforeSend:rheaLoaderFadeIn(parent),
success:function(data){
rheaLoaderFadeOut(parent);
paged++;
rheaLocationSuccessList(data, thisParent, false);
if(! $.trim(data)){
$(parent).find('.rhea-location-ajax-loader').fadeTo("fast", 0);
}}
});
}});
};
window.rheaAjaxSelect=function(parent, id, ajaxurl, hideEmpty, SortAlpha){
var farmControl=$(parent).find('.form-control');
var thisParent=$(id);
rheaTriggerAjaxOnScroll(parent, thisParent, farmControl, ajaxurl, hideEmpty, SortAlpha);
rheaTriggerAjaxOnLoad(parent, thisParent, ajaxurl, hideEmpty, SortAlpha);
farmControl.on('keyup', function(e){
var fieldValue=$(this).val();
fieldValue=fieldValue.trim();
var wordcounts=jQuery.trim(fieldValue).length;
$(parent).find('.rhea-location-ajax-loader').fadeTo("fast", 1);
if(wordcounts > 0){
$.ajax({
url:ajaxurl,
dataType:'json',
delay:250,
data:{
action:'rhea_get_location_options',
query:fieldValue,
hideemptyfields:hideEmpty,
sortplpha:SortAlpha
},
beforeSend:rheaLoaderFadeIn(parent),
success:function(data){
rheaLoaderFadeOut(parent);
thisParent.find('option').not(':selected').remove().end();
if(fieldValue&&data){
rheaLocationSuccessList(data, thisParent);
}else{
thisParent.find('option').not(':selected').remove().end();
thisParent.selectpicker('refresh');
$(parent).find('ul.dropdown-menu li:first-of-type a').focus();
$(parent).find('input').focus();
}}
});
}else{
rheaTriggerAjaxOnLoad(parent, thisParent, ajaxurl, hideEmpty, SortAlpha)
}});
};
window.searchFormAjaxKeywords=function(id, url){
var inputField=$(id).find('input');
inputField.keyup(function (){
var charCount=inputField.val().length;
if(charCount > 1){
$(id).find('.rhea-properties-data-list').slideDown();
$(id).find('.rhea_sfoi_ajax_loader').show();
$(id).find('.rhea-field-icon-wrapper').addClass('rhea-search-fade')
$.ajax({
url:url,
type:'POST',
data:{
action:'rh_sfoi_data_fetch',
keyword:$(this).val()
},
success:function(data){
$(id).find('.rhea-properties-data-list').html(data);
$(id).find('.rhea_sfoi_ajax_loader').hide();
$(id).find('.rhea-field-icon-wrapper').removeClass('rhea-search-fade')
}});
}else{
$(id).find('.rhea-properties-data-list').slideUp();
}});
}
window.rheaTestimonialsTwoCarousel=function(id, itemsFluid=4, items=3, itemsTab=2, itemsMob=1, gap=30, dots=true, rtl=false){
if($().owlCarousel){
$(id).owlCarousel({
loop:false,
dots:dots,
nav:false,
margin:gap,
rtl:rtl,
responsive:{
0:{
items:itemsMob
},
767:{
items:itemsTab
},
1024:{
items:items
},
1440:{
items:itemsFluid
}}
});
}};
window.rheaTestimonialsThreeCarousel=function(slide1, slide2, navSelectors, animationspeed='600', slideshowspeed='5000', slideShow1=true, direction1='horizontal', animation1='fade', reverse1=false, animation2='fade', reverse2=false){
if($().flexslider){
$(slide1).flexslider({
controlNav:false,
directionNav:false,
animationLoop:true,
slideshow:slideShow1,
direction:direction1,
animation:animation1,
reverse:reverse1,
animationSpeed:animationspeed,
slideshowSpeed:slideshowspeed
});
$(slide2).flexslider({
controlNav:false,
animation:animation2,
animationLoop:true,
slideshow:slideShow1,
reverse:reverse2,
customDirectionNav:$(navSelectors),
sync:$(slide1),
animationSpeed:animationspeed,
slideshowSpeed:slideshowspeed
});
}};
window.rheaTestimonialsFourCarousel=function(slider, navSelectors, animation='fade', animationSpeed='600', reverse=false, slideshow=false, slideshowSpeed='5000'){
if($().flexslider){
$(slider).flexslider({
controlNav:false,
directionNav:false,
animation:animation,
animationSpeed:animationSpeed,
reverse:reverse,
slideshow:slideshow,
slideshowSpeed:slideshowSpeed
});
$(navSelectors).on('click', function(event){
$(slider).flexslider($(this).attr('href'));
event.preventDefault();
});
}};
window.EREloadNewsSlider=function (){
if($().flexslider){
$('.rhea-listing-news-slider').each(function (){
$(this).flexslider({
animation:"slide",
slideshow:false,
controlNav:false,
customDirectionNav:$(this).next('.rhea-news-directional-nav').find('a')
});
});
}}
window.ultraFeaturedSlider=function(s1, s2){
var s1=$(s1);
var s2=$(s2);
var maxItems=3;
var $sliderItemTotal=$(".rhea-slider-item-total");
s2.flexslider({
move:1,
directionNav:false,
animation:"slide",
controlNav:false,
animationLoop:false,
slideshow:false,
itemWidth:10,
itemMargin:12,
asNavFor:s1,
maxItems:maxItems,
minItems:1,
start:function(item){
slideCounter(item);
},
after:function(item){
slideCounter(item);
}});
function slideCounter(item){
$sliderItemTotal.text(item.count - maxItems - item.currentSlide);
}
s1.flexslider({
smoothHeight:true,
animation:"fade",
controlNav:false,
animationLoop:false,
slideshow:false,
sync:s2
});
}
window.rheaSubmitContactForm=function(formID, btnSelector){
if(jQuery().validate&&jQuery().ajaxSubmit){
var submitButton=$(btnSelector),
ajaxLoader=$(formID).find('.rhea-ajax-loader'),
messageContainer=$(formID).find('.rhea-message-container'),
errorContainer=$(formID).find(".rhea-error-container");
var formOptions={
beforeSubmit:function (){
submitButton.attr('disabled', 'disabled');
ajaxLoader.fadeIn('fast');
messageContainer.fadeOut('fast');
errorContainer.fadeOut('fast');
},
success:function(ajax_response, statusText, xhr, $form){
var response=$.parseJSON(ajax_response);
ajaxLoader.fadeOut('fast');
submitButton.removeAttr('disabled');
if(response.success){
$form.resetForm();
messageContainer.html(response.message).fadeIn('fast');
setTimeout(function (){
messageContainer.fadeOut('slow')
}, 5000);
if(typeof inspiryResetReCAPTCHA=='function'){
inspiryResetReCAPTCHA();
}
if(typeof CFOSData!=='undefined'){
setTimeout(function (){
window.location.replace(CFOSData.redirectPageUrl);
}, 1000);
}
if(typeof contactFromData!=='undefined'){
setTimeout(function (){
window.location.replace(contactFromData.redirectPageUrl);
}, 1000);
}}else{
errorContainer.html(response.message).fadeIn('fast');
}}
};
$(formID).validate({
errorLabelContainer:errorContainer,
submitHandler:function(form){
$(form).ajaxSubmit(formOptions);
}});
}};
function isInViewport(node){
var rect=node.getBoundingClientRect();
return (
(rect.height > 0||rect.width > 0) &&
rect.bottom >=0 &&
rect.right >=0 &&
rect.top <=(window.innerHeight||document.documentElement.clientHeight) &&
rect.left <=(window.innerWidth||document.documentElement.clientWidth)
)
}
function scrollParallax(selector){
var scrolled=jQuery(window).scrollTop();
jQuery(selector).each(function(index, element){
var initY=jQuery(this).offset().top;
var height=jQuery(this).height();
var endY=initY + jQuery(this).height();
var visible=isInViewport(this);
if(visible){
var diff=scrolled - initY;
var ratio=Math.round(( diff / height) * 100);
jQuery(this).css('background-position', 'center ' + parseInt(( ratio * 1)) + 'px')
}})
}
jQuery('.ere_cta_parallax').each(function (){
scrollParallax(this);
});
jQuery(window).scroll(function (){
jQuery('.ere_cta_parallax').each(function (){
scrollParallax(this);
});
});
window.rheaTestimonialsFiveCarousel=function(settings){
if($().owlCarousel){
let carouselOptions={
items:1,
margin:0,
nav:false,
autoHeight:true,
loop:settings.loop,
autoplay:settings.autoplay,
autoplayTimeout:settings.autoplaySpeed,
autoplayHoverPause:true,
smartSpeed:settings.animationSpeed,
dotsContainer:settings.dots,
rtl:$('body').hasClass('rtl')
};
if('fade'===settings.slideAnimation){
carouselOptions.animateOut='fadeOut';
carouselOptions.animateIn='fadeIn';
}
$(settings.id).owlCarousel(carouselOptions);
}};
window.rheaImageCarousel=function(settings){
if($().slick){
const imageCarouselWrap=$(settings.wrapper),
imageCarousel=$(settings.id);
imageCarousel.on('init', function(event, slick, direction){
$(event.currentTarget).show();
});
imageCarousel.slick({
fade:settings.fade,
speed:settings.speed,
infinite:settings.infinite,
autoplay:settings.autoplay,
autoplaySpeed:settings.autoplaySpeed,
pauseOnHover:settings.pauseOnHover,
pauseOnInteraction:settings.pauseOnInteraction,
slidesToShow:settings.slidesToShow,
slidesToScroll:settings.slidesToScroll,
rows:1,
slidesPerRow:1,
dots:settings.dots,
arrows:settings.arrows,
prevArrow:imageCarouselWrap.find('.rhea-image-carousel-button-prev'),
nextArrow:imageCarouselWrap.find('.rhea-image-carousel-button-next'),
vertical:false,
mobileFirst:true,
adaptiveHeight:false,
rtl:$('body').hasClass('rtl'),
responsive:[
{
breakpoint:1025,
settings:{
slidesToShow:settings.slidesToShow,
slidesToScroll:settings.slidesToScroll
}},
{
breakpoint:768,
settings:{
slidesToShow:settings.slidesToShowTablet,
slidesToScroll:settings.slidesToScrollTablet
}},
{
breakpoint:380,
settings:{
slidesToShow:settings.slidesToShowMobile,
slidesToScroll:settings.slidesToScrollMobile
}},
{
breakpoint:0,
settings:{
slidesToShow:1,
slidesToScroll:1
}}
]
});
}};
window.rheaAccordion=function(id){
$('#' + id + ' > .rhea-accordion-title').on('click', function(event){
var $this=$(this);
if($this.hasClass('rhea-accordion-active')){
$this.next('.rhea-accordion-content').slideUp(500, function (){
$this.removeClass('rhea-accordion-active')
});
}else{
$this.siblings('.rhea-accordion-title').removeClass('rhea-accordion-active');
$this.addClass('rhea-accordion-active')
.next('.rhea-accordion-content')
.slideDown(500)
.siblings('.rhea-accordion-content')
.slideUp(500);
}});
};
window.rheaTabs=function(id){
const tabsContainer=$('#' + id);
const tabsList=tabsContainer.find('.rhea-tabs-list li');
const tabsContentWrapper=tabsContainer.find('.rhea-tabs-content-wrapper');
const tabsContent=tabsContainer.find('.rhea-tabs-content-wrapper .rhea-tabs-content');
if(tabsContent.length){
let minHeight=0;
let contentHeights=[];
tabsContent.each(function(index){
contentHeights.push($(this).outerHeight());
});
if(contentHeights){
minHeight=Math.max.apply(Math, contentHeights) +(tabsContentWrapper.outerHeight() - tabsContentWrapper.height());
tabsContainer.css('min-height', minHeight);
}}
tabsList.on('click', function(event){
const $this=$(this);
tabsList.removeClass('rhea-tabs-active');
$this.addClass('rhea-tabs-active');
tabsContent.hide().removeClass('rhea-tabs-active');
tabsContent.eq($this.index()).show().addClass('rhea-tabs-active');
});
};
window.rheaImageGallery=function(settings){
if(jQuery().isotope){
const container=$(settings.containerId),
filterLinks=$(settings.filters),
galleryOptions={
filter:"*",
animationEngine:'best-available',
itemSelector:settings.itemSelector
};
if('grid'===settings.layout){
galleryOptions.layoutMode='fitRows';
}
const gallery=container.isotope(galleryOptions);
gallery.isotope('layout');
filterLinks.on('click', function(event){
filterLinks.removeClass('current');
$(this).addClass('current');
gallery.isotope({ filter:'.' + $(this).attr('data-filter') });
event.preventDefault();
});
}};
window.rheaFeaturedNavPosition=function(id1, id2){
var sliderWidth=$(id1).outerWidth();
var slideHeight=$(id1).outerHeight();
$(id2).width(sliderWidth);
$(id2).css('top', slideHeight);
}
window.rheaScheduleTourForm=function(id){
if(jQuery().validate&&jQuery().ajaxSubmit){
const formId=$(id),
submitButton=formId.find('.rhea-stf-submit'),
ajaxLoader=formId.find('.rhea-stf-ajax-loader'),
messageContainer=formId.find('.rhea-stf-message-container'),
errorContainer=formId.find(".rhea-stf-error-container");
const formOptions={
beforeSubmit:function (){
submitButton.attr('disabled', 'disabled');
ajaxLoader.fadeIn('fast');
messageContainer.fadeOut('fast');
errorContainer.fadeOut('fast');
},
success:function(ajax_response, statusText, xhr, $form){
var response=$.parseJSON(ajax_response);
ajaxLoader.fadeOut('fast');
submitButton.removeAttr('disabled');
if(response.success){
$form.resetForm();
messageContainer.html(response.message).fadeIn('fast');
setTimeout(function (){
messageContainer.fadeOut('slow')
}, 5000);
}else{
errorContainer.html(response.message).fadeIn('fast');
}}
};
$(id).validate({
errorLabelContainer:errorContainer,
submitHandler:function(form){
$(form).ajaxSubmit(formOptions);
}});
}};
if(jQuery().isotope){
$('.rhea_properties_cities_wrapper.masonry').isotope({
itemSelector:'.rhea_property_city',
masonry:{
horizontalOrder:true
}})
}
window.onload=function(event){
setTimeout(function (){
$('.rhea_multi_select_picker').selectpicker('refresh');
$('.rhea_multi_select_picker_location ').selectpicker('refresh');
}, 500);
}
window.rheaServicesSlider=function(id){
const carousel=$(id).find('.rhea-service-carousel-tabs');
const slider=$(id).find('.rhea-service-carousel-images');
const navPrev=$(id).find('.rhea-prev-service');
const navNext=$(id).find('.rhea-next-service');
carousel.slick({
slidesToShow:4,
slidesToScroll:1,
asNavFor:slider,
dots:false,
centerMode:false,
focusOnSelect:true,
prevArrow:navPrev,
nextArrow:navNext,
responsive:[
{
breakpoint:1200,
settings:{
slidesToShow:3
}},
{
breakpoint:800,
settings:{
slidesToShow:2
}}
]
});
slider.slick({
slidesToShow:1,
slidesToScroll:1,
arrows:false,
fade:true,
draggable:false
});
}
window.rvrGuestsFieldsCounter=function(field, wrapper){
$('.rhea-guests-number').each(function (){
let decrement=$(this).find('.minus');
let increment=$(this).find('.plus');
let $input=$(this).find('input');
let currentCounter='';
let adultsRequired=false;
if($(this).hasClass('adults-field')){
currentCounter=$(this).closest('.rhea-guests-field-dropdown-box').find('.adults i');
adultsRequired=true;
}
if($(this).hasClass('children-field')){
currentCounter=$(this).closest('.rhea-guests-field-dropdown-box').find('.children i');
}
if($(this).hasClass('infants-field')){
currentCounter=$(this).closest('.rhea-guests-field-dropdown-box').find('.infants i');
}
decrement.on('click', function (){
let count=parseInt($input.val()) - 1;
if(true===adultsRequired){
count=count < 1 ? 1:count;
}else{
count=count < 0 ? 0:count;
}
$input.val(count);
$input.change();
currentCounter.html(count);
return false;
});
increment.on('click', function (){
let count=parseInt($input.val()) + 1;
$input.val(count);
$input.change();
currentCounter.html(count);
return false;
});
});
$(field).on('click', function (){
if(! $(wrapper).hasClass('active')){
$(wrapper).addClass('active');
}else{
$(wrapper).removeClass('active');
}});
$('body').on("click", function(e){
const target=$('.rhea-guests-field-dropdown-box, .rhea-guests-field-dropdown-box *');
const targetDrop=$('.rhea-rvr-guests-fields-wrapper');
if(targetDrop.hasClass('active')){
if($(e.target).is(target)===false&&$(e.target).is(targetDrop)===false){
targetDrop.removeClass("active");
}}
});
}})(jQuery);
!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.7",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,o){return o=null==o?u.length-1:+o,function(){for(var n=Math.max(arguments.length-o,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+o];switch(o){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(o+1),r=0;r<o;r++)e[r]=arguments[r];return e[o]=t,u.apply(this,e)}}function o(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function i(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=i("String"),Y=i("Number"),Z=i("Date"),nn=i("RegExp"),tn=i("Error"),rn=i("Symbol"),en=i("ArrayBuffer"),a=i("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=i("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=i("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||i("Array");function y(n,t){return null!=n&&q.call(n,t)}var on=i("Arguments"),an=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,o="constructor";for(y(n,o)&&!t.contains(o)&&t.push(o);r--;)(o=J[r])in n&&n[o]!==u[o]&&!t.contains(o)&&t.push(o)}function b(n){if(!o(n))return[];if(W)return W(n);var t,r=[];for(t in n)y(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=b(t),e=r.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=r[o];if(t[i]!==u[i]||!(i in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,t,r,e){var u;return n===t?0!==n||1/n==1/t:null!=n&&null!=t&&(n!=n?t!=t:("function"==(u=typeof n)||"object"==u||"object"==typeof t)&&function n(t,r,e,u){t instanceof m&&(t=t._wrapped);r instanceof m&&(r=r._wrapped);var o=s.call(t);if(o!==s.call(r))return!1;if(un&&"[object Object]"==o&&h(t)){if(!h(r))return!1;o=bn}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return F.valueOf.call(t)===F.valueOf.call(r);case"[object ArrayBuffer]":case bn:return n(gn(t),gn(r),e,u)}o="[object Array]"===o;if(!o&&vn(t)){var i=d(t);if(i!==d(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof r)return!1;var i=t.constructor,a=r.constructor;if(i!==a&&!(p(i)&&i instanceof i&&p(a)&&a instanceof a)&&"constructor"in t&&"constructor"in r)return!1}e=e||[];u=u||[];var f=e.length;for(;f--;)if(e[f]===t)return u[f]===r;e.push(t);u.push(r);if(o){if((f=t.length)!==r.length)return!1;for(;f--;)if(!mn(t[f],r[f],e,u))return!1}else{var c,l=b(t);if(f=l.length,b(r).length!==f)return!1;for(;f--;)if(c=l[f],!y(r,c)||!mn(t[c],r[c],e,u))return!1}e.pop();u.pop();return!0}(n,t,r,e))}function c(n){if(!o(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var t=c(n);if(g(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==_n||!p(n[wn])}}var wn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(wn,u),_n=t.concat(u),r=["add"].concat(t,wn,"has"),u=a?jn(U):i("Map"),t=a?jn(_n):i("WeakMap"),U=a?jn(r):i("Set"),a=i("WeakSet");function j(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function An(n){for(var t={},r=b(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function xn(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function Sn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),o=u.length,i=0;i<o;i++){var a=u[i];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var On=Sn(c),w=Sn(b),Mn=Sn(c,!0);function En(n){var t;return o(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function Bn(n){return v(n)?n:[n]}function _(n){return m.toPath(n)}function Nn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function In(n,t,r){n=Nn(n,_(t));return H(n)?r:n}function Tn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function kn(t){return t=_(t),function(n){return Nn(n,t)}}function x(u,o,n){if(void 0===o)return u;switch(null==n?3:n){case 1:return function(n){return u.call(o,n)};case 3:return function(n,t,r){return u.call(o,n,t,r)};case 4:return function(n,t,r,e){return u.call(o,n,t,r,e)}}return function(){return u.apply(o,arguments)}}function Dn(n,t,r){return null==n?Tn:p(n)?x(n,t,r):(o(n)&&!v(n)?A:kn)(n)}function Rn(n,t){return Dn(n,t,1/0)}function S(n,t,r){return m.iteratee!==Rn?m.iteratee(n,t):Dn(n,t,r)}function Vn(){}function Fn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(t){function r(n){return t[n]}var n="(?:"+b(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;e<t;e++)r[e]=o[e]===a?arguments[n++]:o[e];for(;n<arguments.length;)r.push(arguments[n++]);return Jn(u,i,this,this,r)}var a=M.placeholder;return i}),Gn=(M.placeholder=m,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Jn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(g);function B(n,t,r,e){if(e=e||[],t||0===t){if(t<=0)return e.concat(n)}else t=1/0;for(var u=e.length,o=0,i=g(n);o<i;o++){var a=n[o];if(E(a)&&(v(a)||an(a)))if(1<t)B(a,t-1,r,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else r||(e[u++]=a)}return e}var Hn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var nt=M(Zn,2);function tt(n,t,r){t=S(t,r);for(var e,u=b(n),o=0,i=u.length;o<i;o++)if(t(n[e=u[o]],e,n))return e}function rt(o){return function(n,t,r){t=S(t,r);for(var e=g(n),u=0<o?0:e-1;0<=u&&u<e;u+=o)if(t(n[u],u,n))return u;return-1}}var et=rt(1),ut=rt(-1);function ot(n,t,r,e){for(var u=(r=S(r,e,1))(t),o=0,i=g(n);o<i;){var a=Math.floor((o+i)/2);r(n[a])<u?o=a+1:i=a}return o}function it(o,i,a){return function(n,t,r){var e=0,u=g(n);if("number"==typeof r)0<o?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=i(f.call(n,e,u),fn))?r+e:-1;for(r=0<o?e:u-1;0<=r&&r<u;r+=o)if(n[r]===t)return r;return-1}}var at=it(1,et,ot),ft=it(-1,ut);function ct(n,t,r){t=(E(n)?et:tt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,o=n.length;u<o;u++)t(n[u],u,n);else for(var e=b(n),u=0,o=e.length;u<o;u++)t(n[e[u]],e[u],n);return n}function I(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=t(n[a],a,n)}return o}function lt(p){return function(n,t,r,e){var u=3<=arguments.length,o=n,i=x(t,e,4),a=r,f=!E(o)&&b(o),c=(f||o).length,l=0<p?0:c-1;for(u||(a=o[f?f[l]:l],l+=p);0<=l&&l<c;l+=p){var s=f?f[l]:l;a=i(a,o[s],s,o)}return a}}var st=lt(1),pt=lt(-1);function T(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!t(n[i],i,n))return!1}return!0}function vt(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(t(n[i],i,n))return!0}return!1}function k(n,t,r,e){return E(n)||(n=j(n)),0<=at(n,t,r="number"==typeof r&&!e?r:0)}var yt=l(function(n,r,e){var u,o;return p(r)?o=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),I(n,function(n){var t=o;if(!t){if(null==(n=u&&u.length?Nn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function dt(n,t){return I(n,kn(t))}function gt(n,e,t){var r,u,o=-1/0,i=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&o<r&&(o=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(i<u||u===-1/0&&o===-1/0)&&(o=n,i=u)});return o}var bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mt(n){return n?v(n)?f.call(n):X(n)?n.match(bt):E(n)?I(n,Tn):j(n):[]}function jt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Fn(n.length-1)];for(var e=mt(n),r=g(e),u=(t=Math.max(Math.min(t,r),0),r-1),o=0;o<t;o++){var i=Fn(o,u),a=e[o];e[o]=e[i],e[i]=a}return e.slice(0,t)}function D(o,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);o(u,n,t)}),u}}var wt=D(function(n,t,r){y(n,r)?n[r].push(t):n[r]=[t]}),_t=D(function(n,t,r){n[r]=t}),At=D(function(n,t,r){y(n,r)?n[r]++:n[r]=1}),xt=D(function(n,t,r){n[r?0:1].push(t)},!0);function St(n,t,r){return t in r}var Ot=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=c(n)):(e=St,t=B(t,!1,!1),n=Object(n));for(var u=0,o=t.length;u<o;u++){var i=t[u],a=n[i];e(a,i,n)&&(r[i]=a)}}return r}),Mt=l(function(n,r){var t,e=r[0];return p(e)?(e=Yn(e),1<r.length&&(t=r[1])):(r=I(B(r,!1,!1),String),e=function(n,t){return!k(r,t)}),Ot(n,e,t)});function Et(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Bt(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Et(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Nt=l(function(n,t){return t=B(t,!0,!0),T(n,function(n){return!k(t,n)})}),It=l(function(n,t){return Nt(n,t)});function Tt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],o=[],i=0,a=g(n);i<a;i++){var f=n[i],c=r?r(f,i,n):f;t&&!r?(i&&o===c||u.push(f),o=c):r?k(o,c)||(o.push(c),u.push(f)):k(u,f)||u.push(f)}return u}var kt=l(function(n){return Tt(B(n,!0,!0))});function Dt(n){for(var t=n&&gt(n,g).length||0,r=Array(t),e=0;e<t;e++)r[e]=dt(n,e);return r}var Rt=l(Dt);function Vt(n,t){return n._chain?m(t).chain():t}function Ft(r){return N(xn(r),function(n){var t=m[n]=r[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Vt(this,t.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];m.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];m.prototype[n]=function(){var n=this._wrapped;return Vt(this,n=null!=n?t.apply(n,arguments):n)}});n=Ft({__proto__:null,VERSION:n,restArguments:l,isObject:o,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=g(n))&&(v(n)||X(n)||an(n))?0===t:0===g(b(n)))},isMatch:dn,isEqual:function(n,t){return mn(n,t)},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:b,allKeys:c,values:j,pairs:function(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:w,assign:w,defaults:Mn,create:function(n,t){return n=En(n),t&&w(n,t),n},clone:function(n){return o(n)?v(n)?n.slice():On({},n):n},tap:function(n,t){return t(n),n},get:In,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!y(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=b(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=t(n[a],a,n)}return o},identity:Tn,constant:cn,noop:Vn,toPath:Bn,property:kn,propertyOf:function(t){return null==t?Vn:function(n){return In(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Fn,now:O,escape:qn,unescape:r,templateSettings:Un,template:function(o,n,t){n=Mn({},n=!n&&t?t:n,m.templateSettings);var r,t=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),i=0,a="__p+='";if(o.replace(t,function(n,t,r,e,u){return a+=o.slice(i,u).replace(Ln,$n),i=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!Cn.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,m)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var o=null==n?void 0:n[t[u]];void 0===o&&(o=r,u=e),n=p(o)?o.call(n):o}return n},uniqueId:function(n){var t=++Kn+"";return n?n+t:t},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function o(n){var t=o.cache,r=""+(u?u.apply(this,arguments):n);return y(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return o.cache={},o},delay:Qn,defer:Xn,throttle:function(r,e,u){function o(){l=!1===u.leading?0:O(),i=null,c=r.apply(a,f),i||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(i&&(clearTimeout(i),i=null),l=n,c=r.apply(a,f),i||(a=f=null)):i||!1===u.trailing||(i=setTimeout(o,t)),c}var i,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(i),l=0,i=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-i;n<r?o=setTimeout(u,r-n):(o=null,e||(f=t.apply(c,a)),o||(a=c=null))}var o,i,a,f,c,n=l(function(n){return c=this,a=n,i=O(),o||(o=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(o),o=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Yn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Zn,once:nt,findKey:tt,findIndex:et,findLastIndex:ut,sortedIndex:ot,indexOf:at,lastIndexOf:ft,find:ct,detect:ct,findWhere:function(n,t){return ct(n,A(t))},each:N,forEach:N,map:I,collect:I,reduce:st,foldl:st,inject:st,reduceRight:pt,foldr:pt,filter:T,select:T,reject:function(n,t,r){return T(n,Yn(S(t)),r)},every:ht,all:ht,some:vt,any:vt,contains:k,includes:k,include:k,invoke:yt,pluck:dt,where:function(n,t){return T(n,A(t))},max:gt,min:function(n,e,t){var r,u,o=1/0,i=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<o&&(o=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<i||u===1/0&&o===1/0)&&(o=n,i=u)});return o},shuffle:function(n){return jt(n,1/0)},sample:jt,sortBy:function(n,e,t){var u=0;return e=S(e,t),dt(I(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:wt,indexBy:_t,countBy:At,partition:xt,toArray:mt,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Ot,omit:Mt,first:Bt,head:Bt,take:Bt,initial:Et,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:It,uniq:Tt,unique:Tt,union:kt,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=g(n);e<u;e++){var o=n[e];if(!k(t,o)){for(var i=1;i<r&&k(arguments[i],o);i++);i===r&&t.push(o)}}return t},difference:Nt,unzip:Dt,transpose:Dt,zip:Rt,object:function(n,t){for(var r={},e=0,u=g(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),o=0;o<e;o++,n+=r)u[o]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Ft,default:m});return n._=n});
window.wp=window.wp||{},function(r){var t="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(a){var n,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(t){var e=document.querySelector("script#tmpl-"+a);if(e)return(n=n||_.template(r(e).html(),s))(t);throw new Error("Template not found: #tmpl-"+a)}}),wp.ajax={settings:t.ajax||{},post:function(t,e){return wp.ajax.send({data:_.isObject(t)?t:_.extend(e||{},{action:t})})},send:function(n,t){var e,a;return _.isObject(n)?t=n:(t=t||{}).data=_.extend(t.data||{},{action:n}),t=_.defaults(t||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(e=(a=r.Deferred(function(a){t.success&&a.done(t.success),t.error&&a.fail(t.error),delete t.success,delete t.error,a.jqXHR=r.ajax(t).done(function(t){var e;"1"!==t&&1!==t||(t={success:!0}),_.isObject(t)&&!_.isUndefined(t.success)?(e=this,a.done(function(){n&&n.data&&"query-attachments"===n.data.action&&a.jqXHR.hasOwnProperty("getResponseHeader")&&a.jqXHR.getResponseHeader("X-WP-Total")?e.totalAttachments=parseInt(a.jqXHR.getResponseHeader("X-WP-Total"),10):e.totalAttachments=0}),a[t.success?"resolveWith":"rejectWith"](this,[t.data])):a.rejectWith(this,[t])}).fail(function(){a.rejectWith(this,arguments)})})).promise()).abort=function(){return a.jqXHR.abort(),this},e}}}(jQuery);