(function (){
var originalOnAdd=L.Marker.prototype.onAdd;
var originalOnRemove=L.Marker.prototype.onRemove;
L.Marker.mergeOptions({
bounceOnAdd: false,
bounceOnAddOptions: {
duration: 1000,
height: -1
},
bounceOnAddCallback: function(){}});
L.Marker.include({
_toPoint: function (latlng){
return this._map.latLngToContainerPoint(latlng);
},
_toLatLng: function (point){
return this._map.containerPointToLatLng(point);
},
_motionStep: function (opts){
var self=this;
var start=new Date();
self._intervalId=setInterval(function (){
var timePassed=new Date() - start;
var progress=timePassed / opts.duration;
if(progress > 1){
progress=1;
}
var delta=opts.delta(progress);
opts.step(delta);
if(progress===1){
opts.end();
clearInterval(self._intervalId);
}}, opts.delay||10);
},
_bounceMotion: function (delta, duration, callback){
var original=L.latLng(this._origLatlng),
start_y=this._dropPoint.y,
start_x=this._dropPoint.x,
distance=this._point.y - start_y;
var self=this;
this._motionStep({
delay: 10,
duration: duration||1000,
delta: delta,
step: function (delta){
self._dropPoint.y =
start_y
+ (distance * delta)
- (self._map.project(self._map.getCenter()).y - self._origMapCenter.y);
self._dropPoint.x =
start_x
- (self._map.project(self._map.getCenter()).x - self._origMapCenter.x);
self.setLatLng(self._toLatLng(self._dropPoint));
},
end: function (){
self.setLatLng(original);
if(typeof callback==="function") callback();
}});
},
_easeOutBounce: function (pos){
if((pos) < (1 / 2.75)){
return (7.5625 * pos * pos);
}else if(pos < (2 / 2.75)){
return (7.5625 * (pos -=(1.5 / 2.75)) * pos + 0.75);
}else if(pos < (2.5 / 2.75)){
return (7.5625 * (pos -=(2.25 / 2.75)) * pos + 0.9375);
}else{
return (7.5625 * (pos -=(2.625 / 2.75)) * pos + 0.984375);
}},
bounce: function(options, endCallback){
this._origLatlng=this.getLatLng();
this._bounce(options, endCallback);
},
_bounce: function (options, endCallback){
if(typeof options==="function"){
endCallback=options;
options=null;
}
options=options||{duration: 1000, height: -1};
if(typeof options==="number"){
options.duration=arguments[0];
options.height=arguments[1];
}
this._origMapCenter=this._map.project(this._map.getCenter());
this._dropPoint=this._getDropPoint(options.height);
this._bounceMotion(this._easeOutBounce, options.duration, endCallback);
},
_getDropPoint: function (height){
this._point=this._toPoint(this._origLatlng);
var top_y;
if(height===undefined||height < 0){
top_y=this._toPoint(this._map.getBounds()._northEast).y;
}else{
top_y=this._point.y - height;
}
return new L.Point(this._point.x, top_y);
},
onAdd: function (map){
this._map=map;
this._origLatlng=this._latlng;
if(this.options.bounceOnAdd===true){
if(typeof this.options.bounceOnAddDuration!=='undefined'){
this.options.bounceOnAddOptions.duration=this.options.bounceOnAddDuration;
}
if(typeof this.options.bounceOnAddHeight!=='undefined'){
this.options.bounceOnAddOptions.height=this.options.bounceOnAddHeight;
}
this._dropPoint=this._getDropPoint(this.options.bounceOnAddOptions.height);
this.setLatLng(this._toLatLng(this._dropPoint));
}
originalOnAdd.call(this, map);
if(this.options.bounceOnAdd===true){
this._bounce(this.options.bounceOnAddOptions, this.options.bounceOnAddCallback);
}},
onRemove: function (map){
clearInterval(this._intervalId);
originalOnRemove.call(this, map);
}});
})();
!function(e,t,i){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,n=this._featureGroup,r=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,_=!0;if(this._map){var u=(new Date).getTime(),d=L.bind(function(){for(var c=(new Date).getTime();h>l;l++){if(s&&0===l%200){var p=(new Date).getTime()-c;if(p>o)break}if(i=e[l],i instanceof L.LayerGroup)_&&(e=e.slice(),_=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var f=i.__parent.getAllChildMarkers(),m=f[0]===i?f[1]:f[0];n.removeLayer(m)}}else r.addLayer(i),t||this.fire("layeradd",{layer:i})}a&&a(l,h,(new Date).getTime()-u),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;h>l;l++)i=e[l],i instanceof L.LayerGroup?(_&&(e=e.slice(),_=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||c.push(i):r.addLayer(i);return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=n;for(t=0;h>t;t++)i=a[t],i instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,n,r,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),n=s.length-1;n>=0;n--){for(i=!0,r=o.length-1;r>=0;r--)if(o[r].layer===s[n]){i=!1;break}i&&e.call(t,s[n])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){"function"!=typeof t&&(t=function(){});var i=function(){!e._icon&&!e.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),e._icon?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",i,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=this._map.getMinZoom();t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){e.target.__dragStart&&this._moveChild(e.target,e.target.__dragStart,e.target._latlng),delete e.target.__dragStart},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,s=this._featureGroup,o=this._map,a=this._map.getMinZoom();t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,_=l._markers;for(this._arraySplice(_,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return i+=10>t?"small":100>t?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(t||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){for(var t=e.layer,i=t;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(e||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._map.getMinZoom(),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=this._map.getMaxZoom(),t=this._map.getMinZoom(),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,n,r=this._gridClusters,s=this._gridUnclustered,o=this._map.getMinZoom();for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=r[t].getNearObject(i);if(a)return a._addChild(e),e.__parent=a,void 0;if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);r[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var _=l;for(n=t-1;n>h._zoom;n--)_=new this._markerCluster(this,n,_),r[n].addObject(_,this._map.project(a.getLatLng(),n));return h._addChild(_),this._removeFromGridUnclustered(a,t),void 0}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._map.getMinZoom(),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==i&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,n=e.getLayers(),r=0;for(t=t||[];r<n.length;r++)i=n[r],i instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}}),L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._map.getMinZoom(),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._map.getMinZoom(),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i,n=this._getExpandedVisibleBounds(),r=this._featureGroup,s=this._map.getMinZoom();this._ignoreMove=!0,this._topClusterLevel._recursively(n,e,s,function(s){var o,a=s._latlng,h=s._markers;for(n.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(r.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,n)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,n)),i=h.length-1;i>=0;i--)o=h[i],n.contains(o._latlng)||r.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,t),r.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(n,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,s,function(e){r.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._map.getMinZoom(),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=this._map.getMinZoom();e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(n,i,r,function(e){e._recursivelyRemoveChildrenFromMap(n,r,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(t.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)},L.MarkerCluster=L.Marker.extend({initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e){e=e||[];for(var t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(e);for(var i=this._markers.length-1;i>=0;i--)e.push(this._markers[i]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),n=this._group._map,r=n.getBoundsZoom(this._bounds),s=this._zoom+1,o=n.getZoom();i.length>0&&r>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}r>s?this._group._map.setView(this._latlng,s):o>=r?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,n,r=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<r.length;e++)i=r[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)t=s[e],t._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,n=t._childCount,o+=i.lat*n,a+=i.lng*n;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,n,r=e._markers;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())},function(e){var i,n,r=e._childClusters;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var s=n._markers[r];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),n._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)r=e._markers[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)r=e._childClusters[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var s,o,a=this._childClusters,h=this._zoom;if(h>=t&&(n&&n(this),r&&h===i&&r(this)),t>h||i>h)for(s=a.length-1;s>=0;s--)o=a[s],e.intersects(o._bounds)&&o._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),L.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var e=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,e}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,s=r[n]=r[n]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,n,r=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[r]=a[r]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,n=h.length;n>i;i++)if(h[i]===e)return h.splice(i,1),1===n&&delete a[r],!0},eachObject:function(e,t){var i,n,r,s,o,a,h,l=this._grid;for(i in l){o=l[i];for(n in o)for(a=o[n],r=0,s=a.length;s>r;r++)h=e.call(t,a[r]),h&&(r--,s--)}},getNearObject:function(e){var t,i,n,r,s,o,a,h,l=this._getCoord(e.x),_=this._getCoord(e.y),u=this._objectPoint,d=this._sqCellSize,c=null;for(t=_-1;_+1>=t;t++)if(r=this._grid[t])for(i=l-1;l+1>=i;i++)if(s=r[i])for(n=0,o=s.length;o>n;n++)a=s[n],h=this._sqDist(u[L.Util.stamp(a)],e),d>h&&(d=h,c=a);return c},_getCoord:function(e){return Math.floor(e/this._cellSize)},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,n,r,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)n=t[i],r=this.getDistant(n,e),r>0&&(a.push(n),r>s&&(s=r,o=n));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints))):[e[0]]},getConvexHull:function(e){var t,i=!1,n=!1,r=!1,s=!1,o=null,a=null,h=null,l=null,_=null,u=null;for(t=e.length-1;t>=0;t--){var d=e[t];(i===!1||d.lat>i)&&(o=d,i=d.lat),(n===!1||d.lat<n)&&(a=d,n=d.lat),(r===!1||d.lng>r)&&(h=d,r=d.lng),(s===!1||d.lng<s)&&(l=d,s=d.lng)}n!==i?(u=a,_=o):(u=l,_=h);var c=[].concat(this.buildConvexHull([u,_],e),this.buildConvexHull([_,u],e));return c}}}(),L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),n=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),n.push(e);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(),i=this._group,n=i._map,r=n.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,r):(r.y+=10,e=this._generatePointsCircle(t.length,r)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,n,r=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),s=r/this._2PI,o=this._2PI/e,a=[];for(a.length=e,i=e-1;i>=0;i--)n=this._circleStartAngle+i*o,a[i]=new L.Point(t.x+s*Math.cos(n),t.y+s*Math.sin(n))._round();return a},_generatePointsSpiral:function(e,t){var i,n=this._group.options.spiderfyDistanceMultiplier,r=n*this._spiralLengthStart,s=n*this._spiralFootSeparation,o=n*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e-1;i>=0;i--)a+=s/r+5e-4*i,h[i]=new L.Point(t.x+r*Math.cos(a),t.y+r*Math.sin(a))._round(),r+=o/a;return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,n=i._map,r=i._featureGroup,s=this.getAllChildMarkers();for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],r.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(n.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,n,r,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),n=e[i],r=new L.Polyline([this._latlng,s],l),a.addLayer(r),n._spiderLeg=r,n._preSpiderfyLatlng=n._latlng,n.setLatLng(s),n.setZIndexOffset&&n.setZIndexOffset(1e6),h.addLayer(n);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var n,r,s,o,a,h,l=this,_=this._group,u=_._map,d=_._featureGroup,c=this._latlng,p=u.latLngToLayerPoint(c),f=L.Path.SVG,m=L.extend({},this._group.options.spiderLegPolylineOptions),g=m.opacity;for(g===i&&(g=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),f?(m.opacity=0,m.className=(m.className||"")+" leaflet-cluster-spider-leg"):m.opacity=g,_._ignoreMove=!0,n=0;n<e.length;n++)r=e[n],h=u.layerPointToLatLng(t[n]),s=new L.Polyline([c,h],m),u.addLayer(s),r._spiderLeg=s,f&&(o=s._path,a=o.getTotalLength()+.1,o.style.strokeDasharray=a,o.style.strokeDashoffset=a),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),d.addLayer(r),r._setPos&&r._setPos(p);for(_._forceLayout(),_._animationStart(),n=e.length-1;n>=0;n--)h=u.layerPointToLatLng(t[n]),r=e[n],r._preSpiderfyLatlng=r._latlng,r.setLatLng(h),r.clusterShow&&r.clusterShow(),f&&(s=r._spiderLeg,o=s._path,o.style.strokeDashoffset=0,s.setStyle({opacity:g}));this.setOpacity(.3),_._ignoreMove=!1,setTimeout(function(){_._animationEnd(),_.fire("spiderfied",{cluster:l,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,n,r,s,o,a=this,h=this._group,l=h._map,_=h._featureGroup,u=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(),c=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)t=d[i],t._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(u),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&_.removeLayer(t),c&&(n=t._spiderLeg,r=n._path,s=r.getTotalLength()+.1,r.style.strokeDashoffset=s,n.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&_.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)
}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}})}(window,document);
!function(t,i){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(void 0!==i&&i.L?module.exports=t(L):module.exports=t(require("leaflet"))),void 0!==i&&i.L&&(i.L.Control.Locate=t(L))}(function(t){var i=t.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPan",keepCurrentZoomLevel:!1,flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,markerClass:t.CircleMarker,circleStyle:{color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:2,opacity:.5},markerStyle:{color:"#136AEC",fillColor:"#2A93EE",fillOpacity:.7,weight:2,opacity:.9,radius:5},followCircleStyle:{},followMarkerStyle:{},icon:"fa fa-map-marker",iconLoading:"fa fa-spinner fa-spin",iconElementTag:"span",circlePadding:[0,0],metric:!0,createButtonCallback:function(i,s){var o=t.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",i);return o.title=s.strings.title,{link:o,icon:t.DomUtil.create(s.iconElementTag,s.icon,o)}},onLocationError:function(t,i){alert(t.message)},onLocationOutsideMapBounds:function(t){t.stop(),alert(t.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize:function(i){for(var s in i)"object"==typeof this.options[s]?t.extend(this.options[s],i[s]):this.options[s]=i[s];this.options.followMarkerStyle=t.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=t.extend({},this.options.circleStyle,this.options.followCircleStyle)},onAdd:function(i){var s=t.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._layer=this.options.layer||new t.LayerGroup,this._layer.addTo(i),this._event=void 0,this._prevBounds=null;var o=this.options.createButtonCallback(s,this.options);return this._link=o.link,this._icon=o.icon,t.DomEvent.on(this._link,"click",t.DomEvent.stopPropagation).on(this._link,"click",t.DomEvent.preventDefault).on(this._link,"click",this._onClick,this).on(this._link,"dblclick",t.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),s},_onClick:function(){if(this._justClicked=!0,this._userPanned=!1,this._active&&!this._event)this.stop();else if(this._active&&void 0!==this._event)switch(this._map.getBounds().contains(this._event.latlng)?this.options.clickBehavior.inView:this.options.clickBehavior.outOfView){case"setView":this.setView();break;case"stop":this.stop(),this.options.returnToPrevBounds&&(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds)}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start:function(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop:function(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},_activate:function(){this._active||(this._map.locate(this.options.locateOptions),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this))},_deactivate:function(){this._map.stopLocate(),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this)},setView:function(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this.options.keepCurrentZoomLevel)(t=this.options.flyTo?this._map.flyTo:this._map.panTo).bind(this._map)([this._event.latitude,this._event.longitude]);else{var t=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;t.bind(this._map)(this._event.bounds,{padding:this.options.circlePadding,maxZoom:this.options.locateOptions.maxZoom})}},_drawMarker:function(){void 0===this._event.accuracy&&(this._event.accuracy=0);var i=this._event.accuracy,s=this._event.latlng;if(this.options.drawCircle){var o=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(s).setRadius(i).setStyle(o):this._circle=t.circle(s,i,o).addTo(this._layer)}var e,n;if(this.options.metric?(e=i.toFixed(0),n=this.options.strings.metersUnit):(e=(3.2808399*i).toFixed(0),n=this.options.strings.feetUnit),this.options.drawMarker){var a=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(s),this._marker.setStyle&&this._marker.setStyle(a)):this._marker=new this.options.markerClass(s,a).addTo(this._layer)}var l=this.options.strings.popup;this.options.showPopup&&l&&this._marker&&this._marker.bindPopup(t.Util.template(l,{distance:e,unit:n}))._popup.setLatLng(s)},_removeMarker:function(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload:function(){this.stop(),this._map.off("unload",this._unload,this)},_onLocationError:function(t){3==t.code&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(t,this))},_onLocationFound:function(t){if((!this._event||this._event.latlng.lat!==t.latlng.lat||this._event.latlng.lng!==t.latlng.lng||this._event.accuracy!==t.accuracy)&&this._active){switch(this._event=t,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"always":this.setView()}this._justClicked=!1}},_onDrag:function(){this._event&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing:function(){return!!this._active&&("always"===this.options.setView||("untilPan"===this.options.setView?!this._userPanned:void 0))},_isOutsideMapBounds:function(){return void 0!==this._event&&(this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng))},_updateContainerStyle:function(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses:function(i){"requesting"==i?(t.DomUtil.removeClasses(this._container,"active following"),t.DomUtil.addClasses(this._container,"requesting"),t.DomUtil.removeClasses(this._icon,this.options.icon),t.DomUtil.addClasses(this._icon,this.options.iconLoading)):"active"==i?(t.DomUtil.removeClasses(this._container,"requesting following"),t.DomUtil.addClasses(this._container,"active"),t.DomUtil.removeClasses(this._icon,this.options.iconLoading),t.DomUtil.addClasses(this._icon,this.options.icon)):"following"==i&&(t.DomUtil.removeClasses(this._container,"requesting"),t.DomUtil.addClasses(this._container,"active following"),t.DomUtil.removeClasses(this._icon,this.options.iconLoading),t.DomUtil.addClasses(this._icon,this.options.icon))},_cleanClasses:function(){t.DomUtil.removeClass(this._container,"requesting"),t.DomUtil.removeClass(this._container,"active"),t.DomUtil.removeClass(this._container,"following"),t.DomUtil.removeClasses(this._icon,this.options.iconLoading),t.DomUtil.addClasses(this._icon,this.options.icon)},_resetVariables:function(){this._active=!1,this._justClicked=!1,this._userPanned=!1}});return t.control.locate=function(i){return new t.Control.Locate(i)},function(){var i=function(i,s,o){(o=o.split(" ")).forEach(function(o){t.DomUtil[i].call(this,s,o)})};t.DomUtil.addClasses=function(t,s){i("addClass",t,s)},t.DomUtil.removeClasses=function(t,s){i("removeClass",t,s)}}(),i},window);
(function($){function sc_setScroll(a,b,c){return"transition"==c.transition&&"swing"==b&&(b="ease"),{anims:[],duration:a,orgDuration:a,easing:b,startTime:getTime()}}function sc_startScroll(a,b){for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e&&e[0][b.transition](e[1],a.duration,a.easing,e[2])}}function sc_stopScroll(a,b){is_boolean(b)||(b=!0),is_object(a.pre)&&sc_stopScroll(a.pre,b);for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e[0].stop(!0),b&&(e[0].css(e[1]),is_function(e[2])&&e[2]())}is_object(a.post)&&sc_stopScroll(a.post,b)}function sc_afterScroll(a,b,c){switch(b&&b.remove(),c.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":a.css("opacity",1),a.css("filter","")}}function sc_fireCallbacks(a,b,c,d,e){if(b[c]&&b[c].call(a,d),e[c].length)for(var f=0,g=e[c].length;g>f;f++)e[c][f].call(a,d);return[]}function sc_fireQueue(a,b,c){return b.length&&(a.trigger(cf_e(b[0][0],c),b[0][1]),b.shift()),b}function sc_hideHiddenItems(a){a.each(function(){var a=$(this);a.data("_cfs_isHidden",a.is(":hidden")).hide()})}function sc_showHiddenItems(a){a&&a.each(function(){var a=$(this);a.data("_cfs_isHidden")||a.show()})}function sc_clearTimers(a){return a.auto&&clearTimeout(a.auto),a.progress&&clearInterval(a.progress),a}function sc_mapCallbackArguments(a,b,c,d,e,f,g){return{width:g.width,height:g.height,items:{old:a,skipped:b,visible:c},scroll:{items:d,direction:e,duration:f}}}function sc_getDuration(a,b,c,d){var e=a.duration;return"none"==a.fx?0:("auto"==e?e=b.scroll.duration/b.scroll.items*c:10>e&&(e=d/e),1>e?0:("fade"==a.fx&&(e/=2),Math.round(e)))}function nv_showNavi(a,b,c){var d=is_number(a.items.minimum)?a.items.minimum:a.items.visible+1;if("show"==b||"hide"==b)var e=b;else if(d>b){debug(c,"Not enough items ("+b+" total, "+d+" needed): Hiding navigation.");var e="hide"}else var e="show";var f="show"==e?"removeClass":"addClass",g=cf_c("hidden",c);a.auto.button&&a.auto.button[e]()[f](g),a.prev.button&&a.prev.button[e]()[f](g),a.next.button&&a.next.button[e]()[f](g),a.pagination.container&&a.pagination.container[e]()[f](g)}function nv_enableNavi(a,b,c){if(!a.circular&&!a.infinite){var d="removeClass"==b||"addClass"==b?b:!1,e=cf_c("disabled",c);if(a.auto.button&&d&&a.auto.button[d](e),a.prev.button){var f=d||0==b?"addClass":"removeClass";a.prev.button[f](e)}if(a.next.button){var f=d||b==a.items.visible?"addClass":"removeClass";a.next.button[f](e)}}}function go_getObject(a,b){return is_function(b)?b=b.call(a):is_undefined(b)&&(b={}),b}function go_getItemsObject(a,b){return b=go_getObject(a,b),is_number(b)?b={visible:b}:"variable"==b?b={visible:b,width:b,height:b}:is_object(b)||(b={}),b}function go_getScrollObject(a,b){return b=go_getObject(a,b),is_number(b)?b=50>=b?{items:b}:{duration:b}:is_string(b)?b={easing:b}:is_object(b)||(b={}),b}function go_getNaviObject(a,b){if(b=go_getObject(a,b),is_string(b)){var c=cf_getKeyCode(b);b=-1==c?$(b):c}return b}function go_getAutoObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_boolean(b)?b={play:b}:is_number(b)&&(b={timeoutDuration:b}),b.progress&&(is_string(b.progress)||is_jquery(b.progress))&&(b.progress={bar:b.progress}),b}function go_complementAutoObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_boolean(b.play)||(b.play=!0),is_number(b.delay)||(b.delay=0),is_undefined(b.pauseOnEvent)&&(b.pauseOnEvent=!0),is_boolean(b.pauseOnResize)||(b.pauseOnResize=!0),is_number(b.timeoutDuration)||(b.timeoutDuration=10>b.duration?2500:5*b.duration),b.progress&&(is_function(b.progress.bar)&&(b.progress.bar=b.progress.bar.call(a)),is_string(b.progress.bar)&&(b.progress.bar=$(b.progress.bar)),b.progress.bar?(is_function(b.progress.updater)||(b.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(b.progress.interval)||(b.progress.interval=50)):b.progress=!1),b}function go_getPrevNextObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_number(b)&&(b={key:b}),b}function go_complementPrevNextObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_string(b.key)&&(b.key=cf_getKeyCode(b.key)),b}function go_getPaginationObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={container:b}:is_boolean(b)&&(b={keys:b}),b}function go_complementPaginationObject(a,b){return is_function(b.container)&&(b.container=b.container.call(a)),is_string(b.container)&&(b.container=$(b.container)),is_number(b.items)||(b.items=!1),is_boolean(b.keys)||(b.keys=!1),is_function(b.anchorBuilder)||is_false(b.anchorBuilder)||(b.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(b.deviation)||(b.deviation=0),b}function go_getSwipeObject(a,b){return is_function(b)&&(b=b.call(a)),is_undefined(b)&&(b={onTouch:!1}),is_true(b)?b={onTouch:b}:is_number(b)&&(b={items:b}),b}function go_complementSwipeObject(a,b){return is_boolean(b.onTouch)||(b.onTouch=!0),is_boolean(b.onMouse)||(b.onMouse=!1),is_object(b.options)||(b.options={}),is_boolean(b.options.triggerOnTouchEnd)||(b.options.triggerOnTouchEnd=!1),b}function go_getMousewheelObject(a,b){return is_function(b)&&(b=b.call(a)),is_true(b)?b={}:is_number(b)?b={items:b}:is_undefined(b)&&(b=!1),b}function go_complementMousewheelObject(a,b){return b}function gn_getItemIndex(a,b,c,d,e){if(is_string(a)&&(a=$(a,e)),is_object(a)&&(a=$(a,e)),is_jquery(a)?(a=e.children().index(a),is_boolean(c)||(c=!1)):is_boolean(c)||(c=!0),is_number(a)||(a=0),is_number(b)||(b=0),c&&(a+=d.first),a+=b,d.total>0){for(;a>=d.total;)a-=d.total;for(;0>a;)a+=d.total}return a}function gn_getVisibleItemsPrev(a,b,c){for(var d=0,e=0,f=c;f>=0;f--){var g=a.eq(f);if(d+=g.is(":visible")?g[b.d.outerWidth](!0):0,d>b.maxDimension)return e;0==f&&(f=a.length),e++}}function gn_getVisibleItemsPrevFilter(a,b,c){return gn_getItemsPrevFilter(a,b.items.filter,b.items.visibleConf.org,c)}function gn_getScrollItemsPrevFilter(a,b,c,d){return gn_getItemsPrevFilter(a,b.items.filter,d,c)}function gn_getItemsPrevFilter(a,b,c,d){for(var e=0,f=0,g=d,h=a.length;g>=0;g--){if(f++,f==h)return f;var i=a.eq(g);if(i.is(b)&&(e++,e==c))return f;0==g&&(g=h)}}function gn_getVisibleOrg(a,b){return b.items.visibleConf.org||a.children().slice(0,b.items.visible).filter(b.items.filter).length}function gn_getVisibleItemsNext(a,b,c){for(var d=0,e=0,f=c,g=a.length-1;g>=f;f++){var h=a.eq(f);if(d+=h.is(":visible")?h[b.d.outerWidth](!0):0,d>b.maxDimension)return e;if(e++,e==g+1)return e;f==g&&(f=-1)}}function gn_getVisibleItemsNextTestCircular(a,b,c,d){var e=gn_getVisibleItemsNext(a,b,c);return b.circular||c+e>d&&(e=d-c),e}function gn_getVisibleItemsNextFilter(a,b,c){return gn_getItemsNextFilter(a,b.items.filter,b.items.visibleConf.org,c,b.circular)}function gn_getScrollItemsNextFilter(a,b,c,d){return gn_getItemsNextFilter(a,b.items.filter,d+1,c,b.circular)-1}function gn_getItemsNextFilter(a,b,c,d){for(var f=0,g=0,h=d,i=a.length-1;i>=h;h++){if(g++,g>=i)return g;var j=a.eq(h);if(j.is(b)&&(f++,f==c))return g;h==i&&(h=-1)}}function gi_getCurrentItems(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsPrev(a,b,c){return a.slice(c,b.items.visibleConf.old+c)}function gi_getNewItemsPrev(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsNext(a,b){return a.slice(0,b.items.visibleConf.old)}function gi_getNewItemsNext(a,b,c){return a.slice(c,b.items.visible+c)}function sz_storeMargin(a,b,c){b.usePadding&&(is_string(c)||(c="_cfs_origCssMargin"),a.each(function(){var a=$(this),d=parseInt(a.css(b.d.marginRight),10);is_number(d)||(d=0),a.data(c,d)}))}function sz_resetMargin(a,b,c){if(b.usePadding){var d=is_boolean(c)?c:!1;is_number(c)||(c=0),sz_storeMargin(a,b,"_cfs_tempCssMargin"),a.each(function(){var a=$(this);a.css(b.d.marginRight,d?a.data("_cfs_tempCssMargin"):c+a.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(a){a.each(function(){var a=$(this);a.data("_cfs_origCss",a.attr("style")||"")})}function sz_restoreOrigCss(a){a.each(function(){var a=$(this);a.attr("style",a.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(a,b){var d=(a.items.visible,a.items[a.d.width]),e=a[a.d.height],f=is_percentage(e);b.each(function(){var b=$(this),c=d-ms_getPaddingBorderMargin(b,a,"Width");b[a.d.width](c),f&&b[a.d.height](ms_getPercentage(c,e))})}function sz_setSizes(a,b){var c=a.parent(),d=a.children(),e=gi_getCurrentItems(d,b),f=cf_mapWrapperSizes(ms_getSizes(e,b,!0),b,!1);if(c.css(f),b.usePadding){var g=b.padding,h=g[b.d[1]];b.align&&0>h&&(h=0);var i=e.last();i.css(b.d.marginRight,i.data("_cfs_origCssMargin")+h),a.css(b.d.top,g[b.d[0]]),a.css(b.d.left,g[b.d[3]])}return a.css(b.d.width,f[b.d.width]+2*ms_getTotalSize(d,b,"width")),a.css(b.d.height,ms_getLargestSize(d,b,"height")),f}function ms_getSizes(a,b,c){return[ms_getTotalSize(a,b,"width",c),ms_getLargestSize(a,b,"height",c)]}function ms_getLargestSize(a,b,c,d){return is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d?b[b.d[c]]:is_number(b.items[b.d[c]])?b.items[b.d[c]]:(c=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ms_getTrueLargestSize(a,b,c))}function ms_getTrueLargestSize(a,b,c){for(var d=0,e=0,f=a.length;f>e;e++){var g=a.eq(e),h=g.is(":visible")?g[b.d[c]](!0):0;h>d&&(d=h)}return d}function ms_getTotalSize(a,b,c,d){if(is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d)return b[b.d[c]];if(is_number(b.items[b.d[c]]))return b.items[b.d[c]]*a.length;for(var e=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",f=0,g=0,h=a.length;h>g;g++){var i=a.eq(g);f+=i.is(":visible")?i[b.d[e]](!0):0}return f}function ms_getParentSize(a,b,c){var d=a.is(":visible");d&&a.hide();var e=a.parent()[b.d[c]]();return d&&a.show(),e}function ms_getMaxDimension(a,b){return is_number(a[a.d.width])?a[a.d.width]:b}function ms_hasVariableSizes(a,b,c){for(var d=!1,e=!1,f=0,g=a.length;g>f;f++){var h=a.eq(f),i=h.is(":visible")?h[b.d[c]](!0):0;d===!1?d=i:d!=i&&(e=!0),0==d&&(e=!0)}return e}function ms_getPaddingBorderMargin(a,b,c){return a[b.d["outer"+c]](!0)-a[b.d[c.toLowerCase()]]()}function ms_getPercentage(a,b){if(is_percentage(b)){if(b=parseInt(b.slice(0,-1),10),!is_number(b))return a;a*=b/100}return a}function cf_e(a,b,c,d,e){return is_boolean(c)||(c=!0),is_boolean(d)||(d=!0),is_boolean(e)||(e=!1),c&&(a=b.events.prefix+a),d&&(a=a+"."+b.events.namespace),d&&e&&(a+=b.serialNumber),a}function cf_c(a,b){return is_string(b.classnames[a])?b.classnames[a]:a}function cf_mapWrapperSizes(a,b,c){is_boolean(c)||(c=!0);var d=b.usePadding&&c?b.padding:[0,0,0,0],e={};return e[b.d.width]=a[0]+d[1]+d[3],e[b.d.height]=a[1]+d[0]+d[2],e}function cf_sortParams(a,b){for(var c=[],d=0,e=a.length;e>d;d++)for(var f=0,g=b.length;g>f;f++)if(b[f].indexOf(typeof a[d])>-1&&is_undefined(c[f])){c[f]=a[d];break}return c}function cf_getPadding(a){if(is_undefined(a))return[0,0,0,0];if(is_number(a))return[a,a,a,a];if(is_string(a)&&(a=a.split("px").join("").split("em").join("").split(" ")),!is_array(a))return[0,0,0,0];for(var b=0;4>b;b++)a[b]=parseInt(a[b],10);switch(a.length){case 0:return[0,0,0,0];case 1:return[a[0],a[0],a[0],a[0]];case 2:return[a[0],a[1],a[0],a[1]];case 3:return[a[0],a[1],a[2],a[1]];default:return[a[0],a[1],a[2],a[3]]}}function cf_getAlignPadding(a,b){var c=is_number(b[b.d.width])?Math.ceil(b[b.d.width]-ms_getTotalSize(a,b,"width")):0;switch(b.align){case"left":return[0,c];case"right":return[c,0];case"center":default:return[Math.ceil(c/2),Math.floor(c/2)]}}function cf_getDimensions(a){for(var b=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],c=b[0].length,d="right"==a.direction||"left"==a.direction?0:1,e={},f=0;c>f;f++)e[b[0][f]]=b[d][f];return e}function cf_getAdjust(a,b,c,d){var e=a;if(is_function(c))e=c.call(d,e);else if(is_string(c)){var f=c.split("+"),g=c.split("-");if(g.length>f.length)var h=!0,i=g[0],j=g[1];else var h=!1,i=f[0],j=f[1];switch(i){case"even":e=1==a%2?a-1:a;break;case"odd":e=0==a%2?a-1:a;break;default:e=a}j=parseInt(j,10),is_number(j)&&(h&&(j=-j),e+=j)}return(!is_number(e)||1>e)&&(e=1),e}function cf_getItemsAdjust(a,b,c,d){return cf_getItemAdjustMinMax(cf_getAdjust(a,b,c,d),b.items.visibleConf)}function cf_getItemAdjustMinMax(a,b){return is_number(b.min)&&b.min>a&&(a=b.min),is_number(b.max)&&a>b.max&&(a=b.max),1>a&&(a=1),a}function cf_getSynchArr(a){is_array(a)||(a=[[a]]),is_array(a[0])||(a=[a]);for(var b=0,c=a.length;c>b;b++)is_string(a[b][0])&&(a[b][0]=$(a[b][0])),is_boolean(a[b][1])||(a[b][1]=!0),is_boolean(a[b][2])||(a[b][2]=!0),is_number(a[b][3])||(a[b][3]=0);return a}function cf_getKeyCode(a){return"right"==a?39:"left"==a?37:"up"==a?38:"down"==a?40:-1}function cf_setCookie(a,b,c){if(a){var d=b.triggerHandler(cf_e("currentPosition",c));$.fn.carouFredSel.cookie.set(a,d)}}function cf_getCookie(a){var b=$.fn.carouFredSel.cookie.get(a);return""==b?0:b}function in_mapCss(a,b){for(var c={},d=0,e=b.length;e>d;d++)c[b[d]]=a.css(b[d]);return c}function in_complementItems(a,b,c,d){return is_object(a.visibleConf)||(a.visibleConf={}),is_object(a.sizesConf)||(a.sizesConf={}),0==a.start&&is_number(d)&&(a.start=d),is_object(a.visible)?(a.visibleConf.min=a.visible.min,a.visibleConf.max=a.visible.max,a.visible=!1):is_string(a.visible)?("variable"==a.visible?a.visibleConf.variable=!0:a.visibleConf.adjust=a.visible,a.visible=!1):is_function(a.visible)&&(a.visibleConf.adjust=a.visible,a.visible=!1),is_string(a.filter)||(a.filter=c.filter(":hidden").length>0?":visible":"*"),a[b.d.width]||(b.responsive?(debug(!0,"Set a "+b.d.width+" for the items!"),a[b.d.width]=ms_getTrueLargestSize(c,b,"outerWidth")):a[b.d.width]=ms_hasVariableSizes(c,b,"outerWidth")?"variable":c[b.d.outerWidth](!0)),a[b.d.height]||(a[b.d.height]=ms_hasVariableSizes(c,b,"outerHeight")?"variable":c[b.d.outerHeight](!0)),a.sizesConf.width=a.width,a.sizesConf.height=a.height,a}function in_complementVisibleItems(a,b){return"variable"==a.items[a.d.width]&&(a.items.visibleConf.variable=!0),a.items.visibleConf.variable||(is_number(a[a.d.width])?a.items.visible=Math.floor(a[a.d.width]/a.items[a.d.width]):(a.items.visible=Math.floor(b/a.items[a.d.width]),a[a.d.width]=a.items.visible*a.items[a.d.width],a.items.visibleConf.adjust||(a.align=!1)),("Infinity"==a.items.visible||1>a.items.visible)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),a.items.visibleConf.variable=!0)),a}function in_complementPrimarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerWidth")),a}function in_complementSecondarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerHeight")),a||(a=b.items[b.d.height]),a}function in_getAlignPadding(a,b){var c=cf_getAlignPadding(gi_getCurrentItems(b,a),a);return a.padding[a.d[1]]=c[1],a.padding[a.d[3]]=c[0],a}function in_getResponsiveValues(a,b){var d=cf_getItemAdjustMinMax(Math.ceil(a[a.d.width]/a.items[a.d.width]),a.items.visibleConf);d>b.length&&(d=b.length);var e=Math.floor(a[a.d.width]/d);return a.items.visible=d,a.items[a.d.width]=e,a[a.d.width]=d*e,a}function bt_pauseOnHoverConfig(a){if(is_string(a))var b=a.indexOf("immediate")>-1?!0:!1,c=a.indexOf("resume")>-1?!0:!1;else var b=c=!1;return[b,c]}function bt_mousesheelNumber(a){return is_number(a)?a:null}function is_null(a){return null===a}function is_undefined(a){return is_null(a)||a===void 0||""===a||"undefined"===a}function is_array(a){return a instanceof Array}function is_jquery(a){return a instanceof jQuery}function is_object(a){return(a instanceof Object||"object"==typeof a)&&!is_null(a)&&!is_jquery(a)&&!is_array(a)&&!is_function(a)}function is_number(a){return(a instanceof Number||"number"==typeof a)&&!isNaN(a)}function is_string(a){return(a instanceof String||"string"==typeof a)&&!is_undefined(a)&&!is_true(a)&&!is_false(a)}function is_function(a){return a instanceof Function||"function"==typeof a}function is_boolean(a){return a instanceof Boolean||"boolean"==typeof a||is_true(a)||is_false(a)}function is_true(a){return a===!0||"true"===a}function is_false(a){return a===!1||"false"===a}function is_percentage(a){return is_string(a)&&"%"==a.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(a,b){debug(!0,a+" is DEPRECATED, support for it will be removed. Use "+b+" instead.")}function debug(a,b){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(a)){var c=" ("+a.selector+")";a=a.debug}else var c="";if(!a)return!1;b=is_string(b)?"carouFredSel"+c+": "+b:["carouFredSel"+c+":",b],window.console.log(b)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={};FN._init=function(a,b,c){a=go_getObject($tt0,a),a.items=go_getItemsObject($tt0,a.items),a.scroll=go_getScrollObject($tt0,a.scroll),a.auto=go_getAutoObject($tt0,a.auto),a.prev=go_getPrevNextObject($tt0,a.prev),a.next=go_getPrevNextObject($tt0,a.next),a.pagination=go_getPaginationObject($tt0,a.pagination),a.swipe=go_getSwipeObject($tt0,a.swipe),a.mousewheel=go_getMousewheelObject($tt0,a.mousewheel),b&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,a)),opts=$.extend(!0,{},$.fn.carouFredSel.defaults,a),opts.d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var d=$cfs.children(),e=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,e),opts.items=in_complementItems(opts.items,opts,d,c),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,d),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,d),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(e,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):(opts.items.visible||(opts=in_complementVisibleItems(opts,e)),opts[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(d,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(d,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,d,e);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getAlignPadding(opts,d),opts.usePadding=!0);break;default:opts.align=!1,opts.usePadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},FN._build=function(){$cfs.data("_cfs_isCarousel",!0);var a=$cfs.children(),b=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),c="relative";switch(b.position){case"absolute":case"fixed":c=b.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(b),$wrp.css({overflow:"hidden",position:c}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",b.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(a,opts),sz_storeOrigCss(a),opts.responsive&&sz_setResponsiveSizes(opts,a)},FN._bind_events=function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(a,b){return a.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),b)),!0}),$cfs.bind(cf_e("finish",conf),function(a){return a.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(a,b,c){if(a.stopPropagation(),tmrs=sc_clearTimers(tmrs),b&&crsl.isScrolling){scrl.isStopped=!0;var d=getTime()-scrl.startTime;scrl.duration-=d,scrl.pre&&(scrl.pre.duration-=d),scrl.post&&(scrl.post.duration-=d),sc_stopScroll(scrl,!1)}if(crsl.isPaused||crsl.isScrolling||c&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause){var e=opts.auto.timeoutDuration-tmrs.timePassed,f=100-Math.ceil(100*e/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,f,e)}return!0}),$cfs.bind(cf_e("play",conf),function(a,b,c,d){a.stopPropagation(),tmrs=sc_clearTimers(tmrs);var e=[b,c,d],f=["string","number","boolean"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],"prev"!=b&&"next"!=b&&(b=crsl.direction),is_number(c)||(c=0),is_boolean(d)||(d=!1),d&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return a.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var h=opts.auto.timeoutDuration+c;return dur2=h-tmrs.timePassed,perc=100-Math.ceil(100*dur2/h),opts.auto.progress&&(tmrs.progress=setInterval(function(){var a=getTime()-tmrs.startTime+tmrs.timePassed,b=Math.ceil(100*a/h);opts.auto.progress.updater.call(opts.auto.progress.bar[0],b)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),b):$cfs.trigger(cf_e(b,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(a){return a.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(a,b,c,d,e){if(a.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return a.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var f=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(f>itms.total)return a.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+f+" needed): Not scrolling.");var g=[b,c,d,e],h=["object","number/string","function","boolean"],i=cf_sortParams(g,h);b=i[0],c=i[1],d=i[2],e=i[3];var j=a.type.slice(conf.events.prefix.length);if(is_object(b)||(b={}),is_function(d)&&(b.onAfter=d),is_boolean(e)&&(b.queue=e),b=$.extend(!0,{},opts[j],b),b.conditions&&!b.conditions.call($tt0,j))return a.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(c)){if("*"!=opts.items.filter)c="visible";else for(var k=[c,b.items,opts[j].items],i=0,l=k.length;l>i;i++)if(is_number(k[i])||"page"==k[i]||"visible"==k[i]){c=k[i];break}switch(c){case"page":return a.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(j+"Page",conf),[b,d]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(c=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]]),a.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(b.duration>0&&crsl.isScrolling)return b.queue&&("last"==b.queue&&(queu=[]),("first"!=b.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]])),a.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+j,conf),[b,c]),opts.synchronise)for(var m=opts.synchronise,n=[b,c],o=0,l=m.length;l>o;o++){var p=j;m[o][2]||(p="prev"==p?"next":"prev"),m[o][1]||(n[0]=m[o][0].triggerHandler("_cfs_triggerEvent",["configuration",p])),n[1]=c+m[o][3],m[o][0].trigger("_cfs_triggerEvent",["slide_"+p,n])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if(opts.items.visibleConf.variable)c=gn_getVisibleItemsPrev(d,opts,itms.total-1);else if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsPrevFilter(d,opts,itms.total-1,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}if(opts.circular||itms.total-c<itms.first&&(c=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){var f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0);f>=opts.items.visible+c&&itms.total>c&&(c++,f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=f}else if("*"!=opts.items.filter){var f=gn_getVisibleItemsNextFilter(d,opts,itms.total-c);opts.items.visible=cf_getItemsAdjust(f,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items backward."),itms.first+=c;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&b.onEnd&&b.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-c,itms.total).prependTo($cfs),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),g=gi_getOldItemsPrev(d,opts,c),h=gi_getNewItemsPrev(d,opts),i=d.eq(c-1),j=g.last(),k=h.last();sz_resetMargin(d,opts);var l=0,m=0;if(opts.align){var n=cf_getAlignPadding(h,opts);l=n[0],m=n[1]}var o=0>l?opts.padding[opts.d[3]]:0,p=!1,q=$();if(c>opts.items.visible&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,i=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(h,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B={},C={},D=sc_getDuration(b,opts,c,t);switch(b.fx){case"cover":case"cover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visible),opts,"width")}p&&(opts.items[opts.d.width]=r),sz_resetMargin(d,opts,!0),m>=0&&sz_resetMargin(j,opts,opts.padding[opts.d[1]]),l>=0&&sz_resetMargin(i,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=m,opts.padding[opts.d[3]]=l),B[opts.d.left]=-(t-o),C[opts.d.left]=-(v-o),x[opts.d.left]=u[opts.d.width];var E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){},L=function(){},M=function(){},N=function(){},O=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp)}switch(b.fx){case"crossfade":case"uncover":case"uncover-fade":s.children().slice(0,c).remove(),s.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":s.children().slice(opts.items.visible).remove(),s.css(C)}if($cfs.css(B),scrl=sc_setScroll(D,b.easing,conf),w[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(E=function(){$wrp.css(u)},F=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){switch(k.not(i).length&&(y[opts.d.marginRight]=i.data("_cfs_origCssMargin"),0>l?i.css(y):(K=function(){i.css(y)},L=function(){scrl.anims.push([i,y])})),b.fx){case"cover":case"cover-fade":s.children().eq(c-1).css(y)}k.not(j).length&&(z[opts.d.marginRight]=j.data("_cfs_origCssMargin"),G=function(){j.css(z)},H=function(){scrl.anims.push([j,z])}),m>=0&&(A[opts.d.marginRight]=k.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],I=function(){k.css(A)},J=function(){scrl.anims.push([k,A])})}O=function(){$cfs.css(w)};var P=opts.items.visible+c-itms.total;N=function(){if(P>0&&($cfs.children().slice(itms.total).remove(),g=$($cfs.children().slice(itms.total-(opts.items.visible-P)).get().concat($cfs.children().slice(0,P).get()))),sc_showHiddenItems(p),opts.usePadding){var a=$cfs.children().eq(opts.items.visible+c-1);a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var Q=sc_mapCallbackArguments(g,q,h,c,"prev",D,u);switch(M=function(){sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",Q,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",Q,clbk),b.fx){case"none":$cfs.css(w),E(),G(),I(),K(),O(),N(),M();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){E(),G(),I(),K(),O(),N(),scrl=sc_setScroll(D,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},M]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},M]),F(),G(),I(),K(),O(),N();break;case"cover":scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"uncover":scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;default:scrl.anims.push([$cfs,w,function(){N(),M()}]),F(),H(),J(),L()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0
}),$cfs.bind(cf_e("slide_next",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsNextFilter(d,opts,0,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}var f=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable)var g=gn_getVisibleItemsNext(d,opts,c),e=gn_getVisibleItemsPrev(d,opts,f-1);else var g=opts.items.visible,e=opts.items.visible;c+g>f&&(c=f-e)}if(opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-c>=g&&itms.total>c;)c++,g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=g}else if("*"!=opts.items.filter){var g=gn_getVisibleItemsNextFilter(d,opts,c);opts.items.visible=cf_getItemsAdjust(g,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items forward."),itms.first-=c;0>itms.first;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&b.onEnd&&b.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),h=gi_getOldItemsNext(d,opts),i=gi_getNewItemsNext(d,opts,c),j=d.eq(c-1),k=h.last(),l=i.last();sz_resetMargin(d,opts);var m=0,n=0;if(opts.align){var o=cf_getAlignPadding(i,opts);m=o[0],n=o[1]}var p=!1,q=$();if(c>opts.items.visibleConf.old&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,j=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(i,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B=sc_getDuration(b,opts,c,t);switch(b.fx){case"uncover":case"uncover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visibleConf.old),opts,"width")}p&&(opts.items[opts.d.width]=r),opts.align&&0>opts.padding[opts.d[1]]&&(opts.padding[opts.d[1]]=0),sz_resetMargin(d,opts,!0),sz_resetMargin(k,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=n,opts.padding[opts.d[3]]=m),A[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var C=function(){},D=function(){},E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp),s.children().slice(opts.items.visibleConf.old).remove()}switch(b.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),s.css("zIndex",0)}if(scrl=sc_setScroll(B,b.easing,conf),w[opts.d.left]=-t,x[opts.d.left]=-v,0>m&&(w[opts.d.left]+=m),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(C=function(){$wrp.css(u)},D=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){var L=l.data("_cfs_origCssMargin");n>=0&&(L+=opts.padding[opts.d[1]]),l.css(opts.d.marginRight,L),j.not(k).length&&(z[opts.d.marginRight]=k.data("_cfs_origCssMargin")),E=function(){k.css(z)},F=function(){scrl.anims.push([k,z])};var M=j.data("_cfs_origCssMargin");m>0&&(M+=opts.padding[opts.d[3]]),y[opts.d.marginRight]=M,G=function(){j.css(y)},H=function(){scrl.anims.push([j,y])}}K=function(){$cfs.css(A)};var N=opts.items.visible+c-itms.total;J=function(){N>0&&$cfs.children().slice(itms.total).remove();var a=$cfs.children().slice(0,c).appendTo($cfs).last();if(N>0&&(i=gi_getCurrentItems(d,opts)),sc_showHiddenItems(p),opts.usePadding){if(itms.total<opts.items.visible+c){var b=$cfs.children().eq(opts.items.visible-1);b.css(opts.d.marginRight,b.data("_cfs_origCssMargin")+opts.padding[opts.d[1]])}a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var O=sc_mapCallbackArguments(h,q,i,c,"next",B,u);switch(I=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",O,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",O,clbk),b.fx){case"none":$cfs.css(w),C(),E(),G(),K(),J(),I();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){C(),E(),G(),K(),J(),scrl=sc_setScroll(B,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},I]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},I]),D(),E(),G(),K(),J();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"uncover":scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;default:scrl.anims.push([$cfs,w,function(){K(),J(),I()}]),D(),F(),H()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0}),$cfs.bind(cf_e("slideTo",conf),function(a,b,c,d,e,f,g){a.stopPropagation();var h=[b,c,d,e,f,g],i=["string/number/object","number","boolean","object","string","function"],j=cf_sortParams(h,i);return e=j[3],f=j[4],g=j[5],b=gn_getItemIndex(j[0],j[1],j[2],itms,$cfs),0==b?!1:(is_object(e)||(e=!1),"prev"!=f&&"next"!=f&&(f=opts.circular?itms.total/2>=b?"next":"prev":0==itms.first||itms.first>b?"next":"prev"),"prev"==f&&(b=itms.total-b),$cfs.trigger(cf_e(f,conf),[e,b,g]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d-1,b,"prev",c])}),$cfs.bind(cf_e("nextPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d+1,b,"next",c])}),$cfs.bind(cf_e("slideToPage",conf),function(a,b,c,d,e){a.stopPropagation(),is_number(b)||(b=$cfs.triggerHandler(cf_e("currentPage",conf)));var f=opts.pagination.items||opts.items.visible,g=Math.ceil(itms.total/f)-1;return 0>b&&(b=g),b>g&&(b=0),$cfs.triggerHandler(cf_e("slideTo",conf),[b*f,0,!0,c,d,e])}),$cfs.bind(cf_e("jumpToStart",conf),function(a,b){if(a.stopPropagation(),b=b?gn_getItemIndex(b,0,!0,itms,$cfs):0,b+=itms.first,0!=b){if(itms.total>0)for(;b>itms.total;)b-=itms.total;$cfs.prepend($cfs.children().slice(b,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(a,b){if(a.stopPropagation(),b)b=cf_getSynchArr(b);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");b=opts.synchronise}for(var c=$cfs.triggerHandler(cf_e("currentPosition",conf)),d=!0,e=0,f=b.length;f>e;e++)b[e][0].triggerHandler(cf_e("slideTo",conf),[c,b[e][3],!0])||(d=!1);return d}),$cfs.bind(cf_e("queue",conf),function(a,b,c){return a.stopPropagation(),is_function(b)?b.call($tt0,queu):is_array(b)?queu=b:is_undefined(b)||queu.push([b,c]),queu}),$cfs.bind(cf_e("insertItem",conf),function(a,b,c,d,e){a.stopPropagation();var f=[b,c,d,e],g=["string/object","string/number/object","boolean","number"],h=cf_sortParams(f,g);if(b=h[0],c=h[1],d=h[2],e=h[3],is_object(b)&&!is_jquery(b)?b=$(b):is_string(b)&&(b=$(b)),!is_jquery(b)||0==b.length)return debug(conf,"Not a valid object.");is_undefined(c)&&(c="end"),sz_storeMargin(b,opts),sz_storeOrigCss(b);var i=c,j="before";"end"==c?d?(0==itms.first?(c=itms.total-1,j="after"):(c=itms.first,itms.first+=b.length),0>c&&(c=0)):(c=itms.total-1,j="after"):c=gn_getItemIndex(c,e,d,itms,$cfs);var k=$cfs.children().eq(c);return k.length?k[j](b):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(b)),"end"==i||d||itms.first>c&&(itms.first+=b.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(a,b,c,d){a.stopPropagation();var e=[b,c,d],f=["string/number/object","boolean","number"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],b instanceof $&&b.length>1)return i=$(),b.each(function(){var e=$cfs.trigger(cf_e("removeItem",conf),[$(this),c,d]);e&&(i=i.add(e))}),i;if(is_undefined(b)||"end"==b)i=$cfs.children().last();else{b=gn_getItemIndex(b,d,c,itms,$cfs);var i=$cfs.children().eq(b);i.length&&itms.first>b&&(itms.first-=i.length)}return i&&i.length&&(i.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf))),i}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length);return is_array(b)&&(clbk[c]=b),is_function(b)&&clbk[c].push(b),clbk[c]}),$cfs.bind(cf_e("currentPosition",conf),function(a,b){if(a.stopPropagation(),0==itms.first)var c=0;else var c=itms.total-itms.first;return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("currentPage",conf),function(a,b){a.stopPropagation();var e,c=opts.pagination.items||opts.items.visible,d=Math.ceil(itms.total/c-1);return e=0==itms.first?0:itms.first<itms.total%c?0:itms.first!=c||opts.circular?Math.round((itms.total-itms.first)/c):d,0>e&&(e=0),e>d&&(e=d),is_function(b)&&b.call($tt0,e),e}),$cfs.bind(cf_e("currentVisible",conf),function(a,b){a.stopPropagation();var c=gi_getCurrentItems($cfs.children(),opts);return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("slice",conf),function(a,b,c,d){if(a.stopPropagation(),0==itms.total)return!1;var e=[b,c,d],f=["number","number","function"],g=cf_sortParams(e,f);if(b=is_number(g[0])?g[0]:0,c=is_number(g[1])?g[1]:itms.total,d=g[2],b+=itms.first,c+=itms.first,items.total>0){for(;b>itms.total;)b-=itms.total;for(;c>itms.total;)c-=itms.total;for(;0>b;)b+=itms.total;for(;0>c;)c+=itms.total}var i,h=$cfs.children();return i=c>b?h.slice(b,c):$(h.slice(b,itms.total).get().concat(h.slice(0,c).get())),is_function(d)&&d.call($tt0,i),i}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length),d=crsl[c];return is_function(b)&&b.call($tt0,d),d}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+"=b"),c!==!1?reInit=!0:eval("opts."+a+"=b")}if(reInit){sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons();var sz=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkAnchors",conf),function(a,b,c){return a.stopPropagation(),is_undefined(b)?b=$("body"):is_string(b)&&(b=$(b)),is_jquery(b)&&0!=b.length?(is_string(c)||(c="a.caroufredsel"),b.find(c).each(function(){var a=this.hash||"";a.length>0&&-1!=$cfs.children().index($(a))&&$(this).unbind("click").click(function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),a)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(a,b){if(a.stopPropagation(),opts.pagination.container){var d=opts.pagination.items||opts.items.visible,e=Math.ceil(itms.total/d);b&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var a=0;e>a;a++){var b=$cfs.children().eq(gn_getItemIndex(a*d,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(b[0],a+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(a){$(this).bind(opts.pagination.event,function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[a*d,-opts.pagination.deviation,!0,opts.pagination])})})}));var f=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return f>=e&&(f=0),0>f&&(f=e-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(f).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(){var b=opts.items.visible,c=$cfs.children(),d=ms_getParentSize($wrp,opts,"width");if(itms.total=c.length,crsl.primarySizePercentage?(opts.maxDimension=d,opts[opts.d.width]=ms_getPercentage(d,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,d),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,opts=in_getResponsiveValues(opts,c,d),b=opts.items.visible,sz_setResponsiveSizes(opts,c)):opts.items.visibleConf.variable?b=gn_getVisibleItemsNext(c,opts,0):"*"!=opts.items.filter&&(b=gn_getVisibleItemsNextFilter(c,opts,0)),!opts.circular&&0!=itms.first&&b>itms.first){if(opts.items.visibleConf.variable)var e=gn_getVisibleItemsPrev(c,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var e=gn_getVisibleItemsPrevFilter(c,opts,itms.first)-itms.first;else var e=opts.items.visible-itms.first;debug(conf,"Preventing non-circular: sliding "+e+" items backward."),$cfs.trigger(cf_e("prev",conf),e)}opts.items.visible=cf_getItemsAdjust(b,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,c);var f=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,f]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),f}),$cfs.bind(cf_e("destroy",conf),function(a,b){return a.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),b&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(a,b,c){return a.stopPropagation(),$cfs.triggerHandler(cf_e(b,conf),c)})},FN._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},FN._bind_buttons=function(){if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(a){a.preventDefault();var b=!1,c=null;crsl.isPaused?b="play":opts.auto.pauseOnEvent&&(b="pause",c=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),b&&$cfs.trigger(cf_e(b,conf),c)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b==opts.next.key&&(a.preventDefault(),$cfs.trigger(cf_e("next",conf))),b==opts.prev.key&&(a.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b>=49&&58>b&&(b=(b-49)*opts.items.visible,itms.total>=b&&(a.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[b,0,!0,opts.pagination])))}),$.fn.swipe){var b="ontouchstart"in window;if(b&&opts.swipe.onTouch||!b&&opts.swipe.onMouse){var c=$.extend(!0,{},opts.prev,opts.swipe),d=$.extend(!0,{},opts.next,opts.swipe),e=function(){$cfs.trigger(cf_e("prev",conf),[c])},f=function(){$cfs.trigger(cf_e("next",conf),[d])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=f,opts.swipe.options.swipeDown=e;break;default:opts.swipe.options.swipeLeft=f,opts.swipe.options.swipeRight=e}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var g=$.extend(!0,{},opts.prev,opts.mousewheel),h=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(a,b){a.preventDefault(),b>0?$cfs.trigger(cf_e("prev",conf),[g]):$cfs.trigger(cf_e("next",conf),[h])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize){var i=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},j=$(window),k=null;if($.debounce&&"debounce"==conf.onWindowResize)k=$.debounce(200,i);else if($.throttle&&"throttle"==conf.onWindowResize)k=$.throttle(300,i);else{var l=0,m=0;k=function(){var a=j.width(),b=j.height();(a!=l||b!=m)&&(i(),l=a,m=b)}}j.bind(cf_e("resize",conf,!1,!0,!0),k)}},FN._unbind_buttons=function(){var b=(cf_e("",conf),cf_e("",conf,!1));ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(b),opts.auto.button&&opts.auto.button.unbind(b),opts.prev.button&&opts.prev.button.unbind(b),opts.next.button&&opts.next.button.unbind(b),opts.pagination.container&&(opts.pagination.container.unbind(b),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,1>s.length)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(a){return'<a href="#"><span>'+a+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(a){$(this).css("width",a+"%")},$.fn.carouFredSel.cookie={get:function(a){a+="=";for(var b=document.cookie.split(";"),c=0,d=b.length;d>c;c++){for(var e=b[c];" "==e.charAt(0);)e=e.slice(1);if(0==e.indexOf(a))return e.slice(a.length)}return 0},set:function(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*60*60*24*c),d="; expires="+e.toGMTString()}document.cookie=a+"="+b+d+"; path=/"},remove:function(a){$.fn.carouFredSel.cookie.set(a,"",-1)}},$.extend($.easing,{quadratic:function(a){var b=a*a;return a*(-b*a+4*b-6*a+4)},cubic:function(a){return a*(4*a*a-9*a+6)},elastic:function(a){var b=a*a;return a*(33*b*b-106*b*a+126*b-67*a+15)}}))})(jQuery);
(function(factory){
'use strict';
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports!=='undefined'){
module.exports=factory(require('jquery'));
}else{
factory(jQuery);
}}(function($){
'use strict';
var Slick=window.Slick||{};
Slick=(function(){
var instanceUid=0;
function Slick(element, settings){
var _=this, dataSettings;
_.defaults={
accessibility: true,
adaptiveHeight: false,
appendArrows: $(element),
appendDots: $(element),
arrows: true,
asNavFor: null,
prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',
nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',
autoplay: false,
autoplaySpeed: 3000,
centerMode: false,
centerPadding: '50px',
cssEase: 'ease',
customPaging: function(slider, i){
return $('<button type="button" data-role="none" role="button" tabindex="0" />').text(i + 1);
},
dots: false,
dotsClass: 'slick-dots',
draggable: true,
easing: 'linear',
edgeFriction: 0.35,
fade: false,
focusOnSelect: false,
infinite: true,
initialSlide: 0,
lazyLoad: 'ondemand',
mobileFirst: false,
pauseOnHover: true,
pauseOnFocus: true,
pauseOnDotsHover: false,
respondTo: 'window',
responsive: null,
rows: 1,
rtl: false,
slide: '',
slidesPerRow: 1,
slidesToShow: 1,
slidesToScroll: 1,
speed: 500,
swipe: true,
swipeToSlide: false,
touchMove: true,
touchThreshold: 5,
useCSS: true,
useTransform: true,
variableWidth: false,
vertical: false,
verticalSwiping: false,
waitForAnimate: true,
zIndex: 1000
};
_.initials={
animating: false,
dragging: false,
autoPlayTimer: null,
currentDirection: 0,
currentLeft: null,
currentSlide: 0,
direction: 1,
$dots: null,
listWidth: null,
listHeight: null,
loadIndex: 0,
$nextArrow: null,
$prevArrow: null,
slideCount: null,
slideWidth: null,
$slideTrack: null,
$slides: null,
sliding: false,
slideOffset: 0,
swipeLeft: null,
$list: null,
touchObject: {},
transformsEnabled: false,
unslicked: false
};
$.extend(_, _.initials);
_.activeBreakpoint=null;
_.animType=null;
_.animProp=null;
_.breakpoints=[];
_.breakpointSettings=[];
_.cssTransitions=false;
_.focussed=false;
_.interrupted=false;
_.hidden='hidden';
_.paused=true;
_.positionProp=null;
_.respondTo=null;
_.rowCount=1;
_.shouldClick=true;
_.$slider=$(element);
_.$slidesCache=null;
_.transformType=null;
_.transitionType=null;
_.visibilityChange='visibilitychange';
_.windowWidth=0;
_.windowTimer=null;
dataSettings=$(element).data('slick')||{};
_.options=$.extend({}, _.defaults, settings, dataSettings);
_.currentSlide=_.options.initialSlide;
_.originalSettings=_.options;
if(typeof document.mozHidden!=='undefined'){
_.hidden='mozHidden';
_.visibilityChange='mozvisibilitychange';
}else if(typeof document.webkitHidden!=='undefined'){
_.hidden='webkitHidden';
_.visibilityChange='webkitvisibilitychange';
}
_.autoPlay=$.proxy(_.autoPlay, _);
_.autoPlayClear=$.proxy(_.autoPlayClear, _);
_.autoPlayIterator=$.proxy(_.autoPlayIterator, _);
_.changeSlide=$.proxy(_.changeSlide, _);
_.clickHandler=$.proxy(_.clickHandler, _);
_.selectHandler=$.proxy(_.selectHandler, _);
_.setPosition=$.proxy(_.setPosition, _);
_.swipeHandler=$.proxy(_.swipeHandler, _);
_.dragHandler=$.proxy(_.dragHandler, _);
_.keyHandler=$.proxy(_.keyHandler, _);
_.instanceUid=instanceUid++;
_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;
_.registerBreakpoints();
_.init(true);
}
return Slick;
}());
Slick.prototype.activateADA=function(){
var _=this;
_.$slideTrack.find('.slick-active').attr({
'aria-hidden': 'false'
}).find('a, input, button, select').attr({
'tabindex': '0'
});
};
Slick.prototype.addSlide=Slick.prototype.slickAdd=function(markup, index, addBefore){
var _=this;
if(typeof(index)==='boolean'){
addBefore=index;
index=null;
}else if(index < 0||(index >=_.slideCount)){
return false;
}
_.unload();
if(typeof(index)==='number'){
if(index===0&&_.$slides.length===0){
$(markup).appendTo(_.$slideTrack);
}else if(addBefore){
$(markup).insertBefore(_.$slides.eq(index));
}else{
$(markup).insertAfter(_.$slides.eq(index));
}}else{
if(addBefore===true){
$(markup).prependTo(_.$slideTrack);
}else{
$(markup).appendTo(_.$slideTrack);
}}
_.$slides=_.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slides.each(function(index, element){
$(element).attr('data-slick-index', index);
});
_.$slidesCache=_.$slides;
_.reinit();
};
Slick.prototype.animateHeight=function(){
var _=this;
if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){
var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.animate({
height: targetHeight
}, _.options.speed);
}};
Slick.prototype.animateSlide=function(targetLeft, callback){
var animProps={},
_=this;
_.animateHeight();
if(_.options.rtl===true&&_.options.vertical===false){
targetLeft=-targetLeft;
}
if(_.transformsEnabled===false){
if(_.options.vertical===false){
_.$slideTrack.animate({
left: targetLeft
}, _.options.speed, _.options.easing, callback);
}else{
_.$slideTrack.animate({
top: targetLeft
}, _.options.speed, _.options.easing, callback);
}}else{
if(_.cssTransitions===false){
if(_.options.rtl===true){
_.currentLeft=-(_.currentLeft);
}
$({
animStart: _.currentLeft
}).animate({
animStart: targetLeft
}, {
duration: _.options.speed,
easing: _.options.easing,
step: function(now){
now=Math.ceil(now);
if(_.options.vertical===false){
animProps[_.animType]='translate(' +
now + 'px, 0px)';
_.$slideTrack.css(animProps);
}else{
animProps[_.animType]='translate(0px,' +
now + 'px)';
_.$slideTrack.css(animProps);
}},
complete: function(){
if(callback){
callback.call();
}}
});
}else{
_.applyTransition();
targetLeft=Math.ceil(targetLeft);
if(_.options.vertical===false){
animProps[_.animType]='translate3d(' + targetLeft + 'px, 0px, 0px)';
}else{
animProps[_.animType]='translate3d(0px,' + targetLeft + 'px, 0px)';
}
_.$slideTrack.css(animProps);
if(callback){
setTimeout(function(){
_.disableTransition();
callback.call();
}, _.options.speed);
}}
}};
Slick.prototype.getNavTarget=function(){
var _=this,
asNavFor=_.options.asNavFor;
if(asNavFor&&asNavFor!==null){
asNavFor=$(asNavFor).not(_.$slider);
}
return asNavFor;
};
Slick.prototype.asNavFor=function(index){
var _=this,
asNavFor=_.getNavTarget();
if(asNavFor!==null&&typeof asNavFor==='object'){
asNavFor.each(function(){
var target=$(this).slick('getSlick');
if(!target.unslicked){
target.slideHandler(index, true);
}});
}};
Slick.prototype.applyTransition=function(slide){
var _=this,
transition={};
if(_.options.fade===false){
transition[_.transitionType]=_.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
}else{
transition[_.transitionType]='opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
}
if(_.options.fade===false){
_.$slideTrack.css(transition);
}else{
_.$slides.eq(slide).css(transition);
}};
Slick.prototype.autoPlay=function(){
var _=this;
_.autoPlayClear();
if(_.slideCount > _.options.slidesToShow){
_.autoPlayTimer=setInterval(_.autoPlayIterator, _.options.autoplaySpeed);
}};
Slick.prototype.autoPlayClear=function(){
var _=this;
if(_.autoPlayTimer){
clearInterval(_.autoPlayTimer);
}};
Slick.prototype.autoPlayIterator=function(){
var _=this,
slideTo=_.currentSlide + _.options.slidesToScroll;
if(!_.paused&&!_.interrupted&&!_.focussed){
if(_.options.infinite===false){
if(_.direction===1&&(_.currentSlide + 1)===(_.slideCount - 1)){
_.direction=0;
}
else if(_.direction===0){
slideTo=_.currentSlide - _.options.slidesToScroll;
if(_.currentSlide - 1===0){
_.direction=1;
}}
}
_.slideHandler(slideTo);
}};
Slick.prototype.buildArrows=function(){
var _=this;
if(_.options.arrows===true){
_.$prevArrow=$(_.options.prevArrow).addClass('slick-arrow');
_.$nextArrow=$(_.options.nextArrow).addClass('slick-arrow');
if(_.slideCount > _.options.slidesToShow){
_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
if(_.htmlExpr.test(_.options.prevArrow)){
_.$prevArrow.prependTo(_.options.appendArrows);
}
if(_.htmlExpr.test(_.options.nextArrow)){
_.$nextArrow.appendTo(_.options.appendArrows);
}
if(_.options.infinite!==true){
_.$prevArrow
.addClass('slick-disabled')
.attr('aria-disabled', 'true');
}}else{
_.$prevArrow.add(_.$nextArrow)
.addClass('slick-hidden')
.attr({
'aria-disabled': 'true',
'tabindex': '-1'
});
}}
};
Slick.prototype.buildDots=function(){
var _=this,
i, dot;
if(_.options.dots===true&&_.slideCount > _.options.slidesToShow){
_.$slider.addClass('slick-dotted');
dot=$('<ul />').addClass(_.options.dotsClass);
for (i=0; i <=_.getDotCount(); i +=1){
dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
}
_.$dots=dot.appendTo(_.options.appendDots);
_.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');
}};
Slick.prototype.buildOut=function(){
var _=this;
_.$slides =
_.$slider
.children(_.options.slide + ':not(.slick-cloned)')
.addClass('slick-slide');
_.slideCount=_.$slides.length;
_.$slides.each(function(index, element){
$(element)
.attr('data-slick-index', index)
.data('originalStyling', $(element).attr('style')||'');
});
_.$slider.addClass('slick-slider');
_.$slideTrack=(_.slideCount===0) ?
$('<div class="slick-track"/>').appendTo(_.$slider) :
_.$slides.wrapAll('<div class="slick-track"/>').parent();
_.$list=_.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent();
_.$slideTrack.css('opacity', 0);
if(_.options.centerMode===true||_.options.swipeToSlide===true){
_.options.slidesToScroll=1;
}
$('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
_.setupInfinite();
_.buildArrows();
_.buildDots();
_.updateDots();
_.setSlideClasses(typeof _.currentSlide==='number' ? _.currentSlide:0);
if(_.options.draggable===true){
_.$list.addClass('draggable');
}};
Slick.prototype.buildRows=function(){
var _=this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
newSlides=document.createDocumentFragment();
originalSlides=_.$slider.children();
if(_.options.rows > 1){
slidesPerSection=_.options.slidesPerRow * _.options.rows;
numOfSlides=Math.ceil(originalSlides.length / slidesPerSection
);
for(a=0; a < numOfSlides; a++){
var slide=document.createElement('div');
for(b=0; b < _.options.rows; b++){
var row=document.createElement('div');
for(c=0; c < _.options.slidesPerRow; c++){
var target=(a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
if(originalSlides.get(target)){
row.appendChild(originalSlides.get(target));
}}
slide.appendChild(row);
}
newSlides.appendChild(slide);
}
_.$slider.empty().append(newSlides);
_.$slider.children().children().children()
.css({
'width':(100 / _.options.slidesPerRow) + '%',
'display': 'inline-block'
});
}};
Slick.prototype.checkResponsive=function(initial, forceUpdate){
var _=this,
breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint=false;
var sliderWidth=_.$slider.width();
var windowWidth=window.innerWidth||$(window).width();
if(_.respondTo==='window'){
respondToWidth=windowWidth;
}else if(_.respondTo==='slider'){
respondToWidth=sliderWidth;
}else if(_.respondTo==='min'){
respondToWidth=Math.min(windowWidth, sliderWidth);
}
if(_.options.responsive &&
_.options.responsive.length &&
_.options.responsive!==null){
targetBreakpoint=null;
for (breakpoint in _.breakpoints){
if(_.breakpoints.hasOwnProperty(breakpoint)){
if(_.originalSettings.mobileFirst===false){
if(respondToWidth < _.breakpoints[breakpoint]){
targetBreakpoint=_.breakpoints[breakpoint];
}}else{
if(respondToWidth > _.breakpoints[breakpoint]){
targetBreakpoint=_.breakpoints[breakpoint];
}}
}}
if(targetBreakpoint!==null){
if(_.activeBreakpoint!==null){
if(targetBreakpoint!==_.activeBreakpoint||forceUpdate){
_.activeBreakpoint =
targetBreakpoint;
if(_.breakpointSettings[targetBreakpoint]==='unslick'){
_.unslick(targetBreakpoint);
}else{
_.options=$.extend({}, _.originalSettings,
_.breakpointSettings[
targetBreakpoint]);
if(initial===true){
_.currentSlide=_.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint=targetBreakpoint;
}}else{
_.activeBreakpoint=targetBreakpoint;
if(_.breakpointSettings[targetBreakpoint]==='unslick'){
_.unslick(targetBreakpoint);
}else{
_.options=$.extend({}, _.originalSettings,
_.breakpointSettings[
targetBreakpoint]);
if(initial===true){
_.currentSlide=_.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint=targetBreakpoint;
}}else{
if(_.activeBreakpoint!==null){
_.activeBreakpoint=null;
_.options=_.originalSettings;
if(initial===true){
_.currentSlide=_.options.initialSlide;
}
_.refresh(initial);
triggerBreakpoint=targetBreakpoint;
}}
if(!initial&&triggerBreakpoint!==false){
_.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
}}
};
Slick.prototype.changeSlide=function(event, dontAnimate){
var _=this,
$target=$(event.currentTarget),
indexOffset, slideOffset, unevenOffset;
if($target.is('a')){
event.preventDefault();
}
if(!$target.is('li')){
$target=$target.closest('li');
}
unevenOffset=(_.slideCount % _.options.slidesToScroll!==0);
indexOffset=unevenOffset ? 0:(_.slideCount - _.currentSlide) % _.options.slidesToScroll;
switch (event.data.message){
case 'previous':
slideOffset=indexOffset===0 ? _.options.slidesToScroll:_.options.slidesToShow - indexOffset;
if(_.slideCount > _.options.slidesToShow){
_.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
}
break;
case 'next':
slideOffset=indexOffset===0 ? _.options.slidesToScroll:indexOffset;
if(_.slideCount > _.options.slidesToShow){
_.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
}
break;
case 'index':
var index=event.data.index===0 ? 0 :
event.data.index||$target.index() * _.options.slidesToScroll;
_.slideHandler(_.checkNavigable(index), false, dontAnimate);
$target.children().trigger('focus');
break;
default:
return;
}};
Slick.prototype.checkNavigable=function(index){
var _=this,
navigables, prevNavigable;
navigables=_.getNavigableIndexes();
prevNavigable=0;
if(index > navigables[navigables.length - 1]){
index=navigables[navigables.length - 1];
}else{
for (var n in navigables){
if(index < navigables[n]){
index=prevNavigable;
break;
}
prevNavigable=navigables[n];
}}
return index;
};
Slick.prototype.cleanUpEvents=function(){
var _=this;
if(_.options.dots&&_.$dots!==null){
$('li', _.$dots)
.off('click.slick', _.changeSlide)
.off('mouseenter.slick', $.proxy(_.interrupt, _, true))
.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
}
_.$slider.off('focus.slick blur.slick');
if(_.options.arrows===true&&_.slideCount > _.options.slidesToShow){
_.$prevArrow&&_.$prevArrow.off('click.slick', _.changeSlide);
_.$nextArrow&&_.$nextArrow.off('click.slick', _.changeSlide);
}
_.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
_.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
_.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
_.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
_.$list.off('click.slick', _.clickHandler);
$(document).off(_.visibilityChange, _.visibility);
_.cleanUpSlideEvents();
if(_.options.accessibility===true){
_.$list.off('keydown.slick', _.keyHandler);
}
if(_.options.focusOnSelect===true){
$(_.$slideTrack).children().off('click.slick', _.selectHandler);
}
$(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
$(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
$('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
$(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
$(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
};
Slick.prototype.cleanUpSlideEvents=function(){
var _=this;
_.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
_.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
};
Slick.prototype.cleanUpRows=function(){
var _=this, originalSlides;
if(_.options.rows > 1){
originalSlides=_.$slides.children().children();
originalSlides.removeAttr('style');
_.$slider.empty().append(originalSlides);
}};
Slick.prototype.clickHandler=function(event){
var _=this;
if(_.shouldClick===false){
event.stopImmediatePropagation();
event.stopPropagation();
event.preventDefault();
}};
Slick.prototype.destroy=function(refresh){
var _=this;
_.autoPlayClear();
_.touchObject={};
_.cleanUpEvents();
$('.slick-cloned', _.$slider).detach();
if(_.$dots){
_.$dots.remove();
}
if(_.$prevArrow&&_.$prevArrow.length){
_.$prevArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css('display','');
if(_.htmlExpr.test(_.options.prevArrow)){
_.$prevArrow.remove();
}}
if(_.$nextArrow&&_.$nextArrow.length){
_.$nextArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css('display','');
if(_.htmlExpr.test(_.options.nextArrow)){
_.$nextArrow.remove();
}}
if(_.$slides){
_.$slides
.removeClass('slick-slide slick-active slick-center slick-visible slick-current')
.removeAttr('aria-hidden')
.removeAttr('data-slick-index')
.each(function(){
$(this).attr('style', $(this).data('originalStyling'));
});
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.detach();
_.$list.detach();
_.$slider.append(_.$slides);
}
_.cleanUpRows();
_.$slider.removeClass('slick-slider');
_.$slider.removeClass('slick-initialized');
_.$slider.removeClass('slick-dotted');
_.unslicked=true;
if(!refresh){
_.$slider.trigger('destroy', [_]);
}};
Slick.prototype.disableTransition=function(slide){
var _=this,
transition={};
transition[_.transitionType]='';
if(_.options.fade===false){
_.$slideTrack.css(transition);
}else{
_.$slides.eq(slide).css(transition);
}};
Slick.prototype.fadeSlide=function(slideIndex, callback){
var _=this;
if(_.cssTransitions===false){
_.$slides.eq(slideIndex).css({
zIndex: _.options.zIndex
});
_.$slides.eq(slideIndex).animate({
opacity: 1
}, _.options.speed, _.options.easing, callback);
}else{
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity: 1,
zIndex: _.options.zIndex
});
if(callback){
setTimeout(function(){
_.disableTransition(slideIndex);
callback.call();
}, _.options.speed);
}}
};
Slick.prototype.fadeSlideOut=function(slideIndex){
var _=this;
if(_.cssTransitions===false){
_.$slides.eq(slideIndex).animate({
opacity: 0,
zIndex: _.options.zIndex - 2
}, _.options.speed, _.options.easing);
}else{
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity: 0,
zIndex: _.options.zIndex - 2
});
}};
Slick.prototype.filterSlides=Slick.prototype.slickFilter=function(filter){
var _=this;
if(filter!==null){
_.$slidesCache=_.$slides;
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.filter(filter).appendTo(_.$slideTrack);
_.reinit();
}};
Slick.prototype.focusHandler=function(){
var _=this;
_.$slider
.off('focus.slick blur.slick')
.on('focus.slick blur.slick',
'*:not(.slick-arrow)', function(event){
event.stopImmediatePropagation();
var $sf=$(this);
setTimeout(function(){
if(_.options.pauseOnFocus){
_.focussed=$sf.is(':focus');
_.autoPlay();
}}, 0);
});
};
Slick.prototype.getCurrent=Slick.prototype.slickCurrentSlide=function(){
var _=this;
return _.currentSlide;
};
Slick.prototype.getDotCount=function(){
var _=this;
var breakPoint=0;
var counter=0;
var pagerQty=0;
if(_.options.infinite===true){
while (breakPoint < _.slideCount){
++pagerQty;
breakPoint=counter + _.options.slidesToScroll;
counter +=_.options.slidesToScroll <=_.options.slidesToShow ? _.options.slidesToScroll:_.options.slidesToShow;
}}else if(_.options.centerMode===true){
pagerQty=_.slideCount;
}else if(!_.options.asNavFor){
pagerQty=1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
}else{
while (breakPoint < _.slideCount){
++pagerQty;
breakPoint=counter + _.options.slidesToScroll;
counter +=_.options.slidesToScroll <=_.options.slidesToShow ? _.options.slidesToScroll:_.options.slidesToShow;
}}
return pagerQty - 1;
};
Slick.prototype.getLeft=function(slideIndex){
var _=this,
targetLeft,
verticalHeight,
verticalOffset=0,
targetSlide;
_.slideOffset=0;
verticalHeight=_.$slides.first().outerHeight(true);
if(_.options.infinite===true){
if(_.slideCount > _.options.slidesToShow){
_.slideOffset=(_.slideWidth * _.options.slidesToShow) * -1;
verticalOffset=(verticalHeight * _.options.slidesToShow) * -1;
}
if(_.slideCount % _.options.slidesToScroll!==0){
if(slideIndex + _.options.slidesToScroll > _.slideCount&&_.slideCount > _.options.slidesToShow){
if(slideIndex > _.slideCount){
_.slideOffset=((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
verticalOffset=((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
}else{
_.slideOffset=((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
verticalOffset=((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
}}
}}else{
if(slideIndex + _.options.slidesToShow > _.slideCount){
_.slideOffset=((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
verticalOffset=((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
}}
if(_.slideCount <=_.options.slidesToShow){
_.slideOffset=0;
verticalOffset=0;
}
if(_.options.centerMode===true&&_.options.infinite===true){
_.slideOffset +=_.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
}else if(_.options.centerMode===true){
_.slideOffset=0;
_.slideOffset +=_.slideWidth * Math.floor(_.options.slidesToShow / 2);
}
if(_.options.vertical===false){
targetLeft=((slideIndex * _.slideWidth) * -1) + _.slideOffset;
}else{
targetLeft=((slideIndex * verticalHeight) * -1) + verticalOffset;
}
if(_.options.variableWidth===true){
if(_.slideCount <=_.options.slidesToShow||_.options.infinite===false){
targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex);
}else{
targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
}
if(_.options.rtl===true){
if(targetSlide[0]){
targetLeft=(_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
}else{
targetLeft=0;
}}else{
targetLeft=targetSlide[0] ? targetSlide[0].offsetLeft * -1:0;
}
if(_.options.centerMode===true){
if(_.slideCount <=_.options.slidesToShow||_.options.infinite===false){
targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex);
}else{
targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
}
if(_.options.rtl===true){
if(targetSlide[0]){
targetLeft=(_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
}else{
targetLeft=0;
}}else{
targetLeft=targetSlide[0] ? targetSlide[0].offsetLeft * -1:0;
}
targetLeft +=(_.$list.width() - targetSlide.outerWidth()) / 2;
}}
return targetLeft;
};
Slick.prototype.getOption=Slick.prototype.slickGetOption=function(option){
var _=this;
return _.options[option];
};
Slick.prototype.getNavigableIndexes=function(){
var _=this,
breakPoint=0,
counter=0,
indexes=[],
max;
if(_.options.infinite===false){
max=_.slideCount;
}else{
breakPoint=_.options.slidesToScroll * -1;
counter=_.options.slidesToScroll * -1;
max=_.slideCount * 2;
}
while (breakPoint < max){
indexes.push(breakPoint);
breakPoint=counter + _.options.slidesToScroll;
counter +=_.options.slidesToScroll <=_.options.slidesToShow ? _.options.slidesToScroll:_.options.slidesToShow;
}
return indexes;
};
Slick.prototype.getSlick=function(){
return this;
};
Slick.prototype.getSlideCount=function(){
var _=this,
slidesTraversed, swipedSlide, centerOffset;
centerOffset=_.options.centerMode===true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2):0;
if(_.options.swipeToSlide===true){
_.$slideTrack.find('.slick-slide').each(function(index, slide){
if(slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)){
swipedSlide=slide;
return false;
}});
slidesTraversed=Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide)||1;
return slidesTraversed;
}else{
return _.options.slidesToScroll;
}};
Slick.prototype.goTo=Slick.prototype.slickGoTo=function(slide, dontAnimate){
var _=this;
_.changeSlide({
data: {
message: 'index',
index: parseInt(slide)
}}, dontAnimate);
};
Slick.prototype.init=function(creation){
var _=this;
if(!$(_.$slider).hasClass('slick-initialized')){
$(_.$slider).addClass('slick-initialized');
_.buildRows();
_.buildOut();
_.setProps();
_.startLoad();
_.loadSlider();
_.initializeEvents();
_.updateArrows();
_.updateDots();
_.checkResponsive(true);
_.focusHandler();
}
if(creation){
_.$slider.trigger('init', [_]);
}
if(_.options.accessibility===true){
_.initADA();
}
if(_.options.autoplay){
_.paused=false;
_.autoPlay();
}};
Slick.prototype.initADA=function(){
var _=this;
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
'aria-hidden': 'true',
'tabindex': '-1'
}).find('a, input, button, select').attr({
'tabindex': '-1'
});
_.$slideTrack.attr('role', 'listbox');
_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i){
$(this).attr({
'role': 'option',
'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
});
});
if(_.$dots!==null){
_.$dots.attr('role', 'tablist').find('li').each(function(i){
$(this).attr({
'role': 'presentation',
'aria-selected': 'false',
'aria-controls': 'navigation' + _.instanceUid + i + '',
'id': 'slick-slide' + _.instanceUid + i + ''
});
})
.first().attr('aria-selected', 'true').end()
.find('button').attr('role', 'button').end()
.closest('div').attr('role', 'toolbar');
}
_.activateADA();
};
Slick.prototype.initArrowEvents=function(){
var _=this;
if(_.options.arrows===true&&_.slideCount > _.options.slidesToShow){
_.$prevArrow
.off('click.slick')
.on('click.slick', {
message: 'previous'
}, _.changeSlide);
_.$nextArrow
.off('click.slick')
.on('click.slick', {
message: 'next'
}, _.changeSlide);
}};
Slick.prototype.initDotEvents=function(){
var _=this;
if(_.options.dots===true&&_.slideCount > _.options.slidesToShow){
$('li', _.$dots).on('click.slick', {
message: 'index'
}, _.changeSlide);
}
if(_.options.dots===true&&_.options.pauseOnDotsHover===true){
$('li', _.$dots)
.on('mouseenter.slick', $.proxy(_.interrupt, _, true))
.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
}};
Slick.prototype.initSlideEvents=function(){
var _=this;
if(_.options.pauseOnHover){
_.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
_.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
}};
Slick.prototype.initializeEvents=function(){
var _=this;
_.initArrowEvents();
_.initDotEvents();
_.initSlideEvents();
_.$list.on('touchstart.slick mousedown.slick', {
action: 'start'
}, _.swipeHandler);
_.$list.on('touchmove.slick mousemove.slick', {
action: 'move'
}, _.swipeHandler);
_.$list.on('touchend.slick mouseup.slick', {
action: 'end'
}, _.swipeHandler);
_.$list.on('touchcancel.slick mouseleave.slick', {
action: 'end'
}, _.swipeHandler);
_.$list.on('click.slick', _.clickHandler);
$(document).on(_.visibilityChange, $.proxy(_.visibility, _));
if(_.options.accessibility===true){
_.$list.on('keydown.slick', _.keyHandler);
}
if(_.options.focusOnSelect===true){
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
}
$(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
$(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
$('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
$(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
$(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
};
Slick.prototype.initUI=function(){
var _=this;
if(_.options.arrows===true&&_.slideCount > _.options.slidesToShow){
_.$prevArrow.show();
_.$nextArrow.show();
}
if(_.options.dots===true&&_.slideCount > _.options.slidesToShow){
_.$dots.show();
}};
Slick.prototype.keyHandler=function(event){
var _=this;
if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')){
if(event.keyCode===37&&_.options.accessibility===true){
_.changeSlide({
data: {
message: _.options.rtl===true ? 'next':'previous'
}});
}else if(event.keyCode===39&&_.options.accessibility===true){
_.changeSlide({
data: {
message: _.options.rtl===true ? 'previous':'next'
}});
}}
};
Slick.prototype.lazyLoad=function(){
var _=this,
loadRange, cloneRange, rangeStart, rangeEnd;
function loadImages(imagesScope){
$('img[data-lazy]', imagesScope).each(function(){
var image=$(this),
imageSource=$(this).attr('data-lazy'),
imageToLoad=document.createElement('img');
imageToLoad.onload=function(){
image
.animate({ opacity: 0 }, 100, function(){
image
.attr('src', imageSource)
.animate({ opacity: 1 }, 200, function(){
image
.removeAttr('data-lazy')
.removeClass('slick-loading');
});
_.$slider.trigger('lazyLoaded', [_, image, imageSource]);
});
};
imageToLoad.onerror=function(){
image
.removeAttr('data-lazy')
.removeClass('slick-loading')
.addClass('slick-lazyload-error');
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
};
imageToLoad.src=imageSource;
});
}
if(_.options.centerMode===true){
if(_.options.infinite===true){
rangeStart=_.currentSlide + (_.options.slidesToShow / 2 + 1);
rangeEnd=rangeStart + _.options.slidesToShow + 2;
}else{
rangeStart=Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
rangeEnd=2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
}}else{
rangeStart=_.options.infinite ? _.options.slidesToShow + _.currentSlide:_.currentSlide;
rangeEnd=Math.ceil(rangeStart + _.options.slidesToShow);
if(_.options.fade===true){
if(rangeStart > 0) rangeStart--;
if(rangeEnd <=_.slideCount) rangeEnd++;
}}
loadRange=_.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
loadImages(loadRange);
if(_.slideCount <=_.options.slidesToShow){
cloneRange=_.$slider.find('.slick-slide');
loadImages(cloneRange);
} else
if(_.currentSlide >=_.slideCount - _.options.slidesToShow){
cloneRange=_.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
loadImages(cloneRange);
}else if(_.currentSlide===0){
cloneRange=_.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
loadImages(cloneRange);
}};
Slick.prototype.loadSlider=function(){
var _=this;
_.setPosition();
_.$slideTrack.css({
opacity: 1
});
_.$slider.removeClass('slick-loading');
_.initUI();
if(_.options.lazyLoad==='progressive'){
_.progressiveLazyLoad();
}};
Slick.prototype.next=Slick.prototype.slickNext=function(){
var _=this;
_.changeSlide({
data: {
message: 'next'
}});
};
Slick.prototype.orientationChange=function(){
var _=this;
_.checkResponsive();
_.setPosition();
};
Slick.prototype.pause=Slick.prototype.slickPause=function(){
var _=this;
_.autoPlayClear();
_.paused=true;
};
Slick.prototype.play=Slick.prototype.slickPlay=function(){
var _=this;
_.autoPlay();
_.options.autoplay=true;
_.paused=false;
_.focussed=false;
_.interrupted=false;
};
Slick.prototype.postSlide=function(index){
var _=this;
if(!_.unslicked){
_.$slider.trigger('afterChange', [_, index]);
_.animating=false;
_.setPosition();
_.swipeLeft=null;
if(_.options.autoplay){
_.autoPlay();
}
if(_.options.accessibility===true){
_.initADA();
}}
};
Slick.prototype.prev=Slick.prototype.slickPrev=function(){
var _=this;
_.changeSlide({
data: {
message: 'previous'
}});
};
Slick.prototype.preventDefault=function(event){
event.preventDefault();
};
Slick.prototype.progressiveLazyLoad=function(tryCount){
tryCount=tryCount||1;
var _=this,
$imgsToLoad=$('img[data-lazy]', _.$slider),
image,
imageSource,
imageToLoad;
if($imgsToLoad.length){
image=$imgsToLoad.first();
imageSource=image.attr('data-lazy');
imageToLoad=document.createElement('img');
imageToLoad.onload=function(){
image
.attr('src', imageSource)
.removeAttr('data-lazy')
.removeClass('slick-loading');
if(_.options.adaptiveHeight===true){
_.setPosition();
}
_.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
_.progressiveLazyLoad();
};
imageToLoad.onerror=function(){
if(tryCount < 3){
setTimeout(function(){
_.progressiveLazyLoad(tryCount + 1);
}, 500);
}else{
image
.removeAttr('data-lazy')
.removeClass('slick-loading')
.addClass('slick-lazyload-error');
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
_.progressiveLazyLoad();
}};
imageToLoad.src=imageSource;
}else{
_.$slider.trigger('allImagesLoaded', [ _ ]);
}};
Slick.prototype.refresh=function(initializing){
var _=this, currentSlide, lastVisibleIndex;
lastVisibleIndex=_.slideCount - _.options.slidesToShow;
if(!_.options.infinite&&(_.currentSlide > lastVisibleIndex)){
_.currentSlide=lastVisibleIndex;
}
if(_.slideCount <=_.options.slidesToShow){
_.currentSlide=0;
}
currentSlide=_.currentSlide;
_.destroy(true);
$.extend(_, _.initials, { currentSlide: currentSlide });
_.init();
if(!initializing){
_.changeSlide({
data: {
message: 'index',
index: currentSlide
}}, false);
}};
Slick.prototype.registerBreakpoints=function(){
var _=this, breakpoint, currentBreakpoint, l,
responsiveSettings=_.options.responsive||null;
if($.type(responsiveSettings)==='array'&&responsiveSettings.length){
_.respondTo=_.options.respondTo||'window';
for(breakpoint in responsiveSettings){
l=_.breakpoints.length-1;
currentBreakpoint=responsiveSettings[breakpoint].breakpoint;
if(responsiveSettings.hasOwnProperty(breakpoint)){
while(l >=0){
if(_.breakpoints[l]&&_.breakpoints[l]===currentBreakpoint){
_.breakpoints.splice(l,1);
}
l--;
}
_.breakpoints.push(currentBreakpoint);
_.breakpointSettings[currentBreakpoint]=responsiveSettings[breakpoint].settings;
}}
_.breakpoints.sort(function(a, b){
return(_.options.mobileFirst) ? a-b:b-a;
});
}};
Slick.prototype.reinit=function(){
var _=this;
_.$slides =
_.$slideTrack
.children(_.options.slide)
.addClass('slick-slide');
_.slideCount=_.$slides.length;
if(_.currentSlide >=_.slideCount&&_.currentSlide!==0){
_.currentSlide=_.currentSlide - _.options.slidesToScroll;
}
if(_.slideCount <=_.options.slidesToShow){
_.currentSlide=0;
}
_.registerBreakpoints();
_.setProps();
_.setupInfinite();
_.buildArrows();
_.updateArrows();
_.initArrowEvents();
_.buildDots();
_.updateDots();
_.initDotEvents();
_.cleanUpSlideEvents();
_.initSlideEvents();
_.checkResponsive(false, true);
if(_.options.focusOnSelect===true){
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
}
_.setSlideClasses(typeof _.currentSlide==='number' ? _.currentSlide:0);
_.setPosition();
_.focusHandler();
_.paused = !_.options.autoplay;
_.autoPlay();
_.$slider.trigger('reInit', [_]);
};
Slick.prototype.resize=function(){
var _=this;
if($(window).width()!==_.windowWidth){
clearTimeout(_.windowDelay);
_.windowDelay=window.setTimeout(function(){
_.windowWidth=$(window).width();
_.checkResponsive();
if(!_.unslicked){ _.setPosition(); }}, 50);
}};
Slick.prototype.removeSlide=Slick.prototype.slickRemove=function(index, removeBefore, removeAll){
var _=this;
if(typeof(index)==='boolean'){
removeBefore=index;
index=removeBefore===true ? 0:_.slideCount - 1;
}else{
index=removeBefore===true ? --index:index;
}
if(_.slideCount < 1||index < 0||index > _.slideCount - 1){
return false;
}
_.unload();
if(removeAll===true){
_.$slideTrack.children().remove();
}else{
_.$slideTrack.children(this.options.slide).eq(index).remove();
}
_.$slides=_.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slidesCache=_.$slides;
_.reinit();
};
Slick.prototype.setCSS=function(position){
var _=this,
positionProps={},
x, y;
if(_.options.rtl===true){
position=-position;
}
x=_.positionProp=='left' ? Math.ceil(position) + 'px':'0px';
y=_.positionProp=='top' ? Math.ceil(position) + 'px':'0px';
positionProps[_.positionProp]=position;
if(_.transformsEnabled===false){
_.$slideTrack.css(positionProps);
}else{
positionProps={};
if(_.cssTransitions===false){
positionProps[_.animType]='translate(' + x + ', ' + y + ')';
_.$slideTrack.css(positionProps);
}else{
positionProps[_.animType]='translate3d(' + x + ', ' + y + ', 0px)';
_.$slideTrack.css(positionProps);
}}
};
Slick.prototype.setDimensions=function(){
var _=this;
if(_.options.vertical===false){
if(_.options.centerMode===true){
_.$list.css({
padding: ('0px ' + _.options.centerPadding)
});
}}else{
_.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
if(_.options.centerMode===true){
_.$list.css({
padding: (_.options.centerPadding + ' 0px')
});
}}
_.listWidth=_.$list.width();
_.listHeight=_.$list.height();
if(_.options.vertical===false&&_.options.variableWidth===false){
_.slideWidth=Math.ceil(_.listWidth / _.options.slidesToShow);
_.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
}else if(_.options.variableWidth===true){
_.$slideTrack.width(5000 * _.slideCount);
}else{
_.slideWidth=Math.ceil(_.listWidth);
_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
}
var offset=_.$slides.first().outerWidth(true) - _.$slides.first().width();
if(_.options.variableWidth===false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
};
Slick.prototype.setFade=function(){
var _=this,
targetLeft;
_.$slides.each(function(index, element){
targetLeft=(_.slideWidth * index) * -1;
if(_.options.rtl===true){
$(element).css({
position: 'relative',
right: targetLeft,
top: 0,
zIndex: _.options.zIndex - 2,
opacity: 0
});
}else{
$(element).css({
position: 'relative',
left: targetLeft,
top: 0,
zIndex: _.options.zIndex - 2,
opacity: 0
});
}});
_.$slides.eq(_.currentSlide).css({
zIndex: _.options.zIndex - 1,
opacity: 1
});
};
Slick.prototype.setHeight=function(){
var _=this;
if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){
var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.css('height', targetHeight);
}};
Slick.prototype.setOption =
Slick.prototype.slickSetOption=function(){
var _=this, l, item, option, value, refresh=false, type;
if($.type(arguments[0])==='object'){
option=arguments[0];
refresh=arguments[1];
type='multiple';
}else if($.type(arguments[0])==='string'){
option=arguments[0];
value=arguments[1];
refresh=arguments[2];
if(arguments[0]==='responsive'&&$.type(arguments[1])==='array'){
type='responsive';
}else if(typeof arguments[1]!=='undefined'){
type='single';
}}
if(type==='single'){
_.options[option]=value;
}else if(type==='multiple'){
$.each(option , function(opt, val){
_.options[opt]=val;
});
}else if(type==='responsive'){
for(item in value){
if($.type(_.options.responsive)!=='array'){
_.options.responsive=[ value[item] ];
}else{
l=_.options.responsive.length-1;
while(l >=0){
if(_.options.responsive[l].breakpoint===value[item].breakpoint){
_.options.responsive.splice(l,1);
}
l--;
}
_.options.responsive.push(value[item]);
}}
}
if(refresh){
_.unload();
_.reinit();
}};
Slick.prototype.setPosition=function(){
var _=this;
_.setDimensions();
_.setHeight();
if(_.options.fade===false){
_.setCSS(_.getLeft(_.currentSlide));
}else{
_.setFade();
}
_.$slider.trigger('setPosition', [_]);
};
Slick.prototype.setProps=function(){
var _=this,
bodyStyle=document.body.style;
_.positionProp=_.options.vertical===true ? 'top':'left';
if(_.positionProp==='top'){
_.$slider.addClass('slick-vertical');
}else{
_.$slider.removeClass('slick-vertical');
}
if(bodyStyle.WebkitTransition!==undefined ||
bodyStyle.MozTransition!==undefined ||
bodyStyle.msTransition!==undefined){
if(_.options.useCSS===true){
_.cssTransitions=true;
}}
if(_.options.fade){
if(typeof _.options.zIndex==='number'){
if(_.options.zIndex < 3){
_.options.zIndex=3;
}}else{
_.options.zIndex=_.defaults.zIndex;
}}
if(bodyStyle.OTransform!==undefined){
_.animType='OTransform';
_.transformType='-o-transform';
_.transitionType='OTransition';
if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined) _.animType=false;
}
if(bodyStyle.MozTransform!==undefined){
_.animType='MozTransform';
_.transformType='-moz-transform';
_.transitionType='MozTransition';
if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.MozPerspective===undefined) _.animType=false;
}
if(bodyStyle.webkitTransform!==undefined){
_.animType='webkitTransform';
_.transformType='-webkit-transform';
_.transitionType='webkitTransition';
if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined) _.animType=false;
}
if(bodyStyle.msTransform!==undefined){
_.animType='msTransform';
_.transformType='-ms-transform';
_.transitionType='msTransition';
if(bodyStyle.msTransform===undefined) _.animType=false;
}
if(bodyStyle.transform!==undefined&&_.animType!==false){
_.animType='transform';
_.transformType='transform';
_.transitionType='transition';
}
_.transformsEnabled=_.options.useTransform&&(_.animType!==null&&_.animType!==false);
};
Slick.prototype.setSlideClasses=function(index){
var _=this,
centerOffset, allSlides, indexOffset, remainder;
allSlides=_.$slider
.find('.slick-slide')
.removeClass('slick-active slick-center slick-current')
.attr('aria-hidden', 'true');
_.$slides
.eq(index)
.addClass('slick-current');
if(_.options.centerMode===true){
centerOffset=Math.floor(_.options.slidesToShow / 2);
if(_.options.infinite===true){
if(index >=centerOffset&&index <=(_.slideCount - 1) - centerOffset){
_.$slides
.slice(index - centerOffset, index + centerOffset + 1)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}else{
indexOffset=_.options.slidesToShow + index;
allSlides
.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}
if(index===0){
allSlides
.eq(allSlides.length - 1 - _.options.slidesToShow)
.addClass('slick-center');
}else if(index===_.slideCount - 1){
allSlides
.eq(_.options.slidesToShow)
.addClass('slick-center');
}}
_.$slides
.eq(index)
.addClass('slick-center');
}else{
if(index >=0&&index <=(_.slideCount - _.options.slidesToShow)){
_.$slides
.slice(index, index + _.options.slidesToShow)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}else if(allSlides.length <=_.options.slidesToShow){
allSlides
.addClass('slick-active')
.attr('aria-hidden', 'false');
}else{
remainder=_.slideCount % _.options.slidesToShow;
indexOffset=_.options.infinite===true ? _.options.slidesToShow + index:index;
if(_.options.slidesToShow==_.options.slidesToScroll&&(_.slideCount - index) < _.options.slidesToShow){
allSlides
.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}else{
allSlides
.slice(indexOffset, indexOffset + _.options.slidesToShow)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}}
}
if(_.options.lazyLoad==='ondemand'){
_.lazyLoad();
}};
Slick.prototype.setupInfinite=function(){
var _=this,
i, slideIndex, infiniteCount;
if(_.options.fade===true){
_.options.centerMode=false;
}
if(_.options.infinite===true&&_.options.fade===false){
slideIndex=null;
if(_.slideCount > _.options.slidesToShow){
if(_.options.centerMode===true){
infiniteCount=_.options.slidesToShow + 1;
}else{
infiniteCount=_.options.slidesToShow;
}
for (i=_.slideCount; i > (_.slideCount -
infiniteCount); i -=1){
slideIndex=i - 1;
$(_.$slides[slideIndex]).clone(true).attr('id', '')
.attr('data-slick-index', slideIndex - _.slideCount)
.prependTo(_.$slideTrack).addClass('slick-cloned');
}
for (i=0; i < infiniteCount; i +=1){
slideIndex=i;
$(_.$slides[slideIndex]).clone(true).attr('id', '')
.attr('data-slick-index', slideIndex + _.slideCount)
.appendTo(_.$slideTrack).addClass('slick-cloned');
}
_.$slideTrack.find('.slick-cloned').find('[id]').each(function(){
$(this).attr('id', '');
});
}}
};
Slick.prototype.interrupt=function(toggle){
var _=this;
if(!toggle){
_.autoPlay();
}
_.interrupted=toggle;
};
Slick.prototype.selectHandler=function(event){
var _=this;
var targetElement =
$(event.target).is('.slick-slide') ?
$(event.target) :
$(event.target).parents('.slick-slide');
var index=parseInt(targetElement.attr('data-slick-index'));
if(!index) index=0;
if(_.slideCount <=_.options.slidesToShow){
_.setSlideClasses(index);
_.asNavFor(index);
return;
}
_.slideHandler(index);
};
Slick.prototype.slideHandler=function(index, sync, dontAnimate){
var targetSlide, animSlide, oldSlide, slideLeft, targetLeft=null,
_=this, navTarget;
sync=sync||false;
if(_.animating===true&&_.options.waitForAnimate===true){
return;
}
if(_.options.fade===true&&_.currentSlide===index){
return;
}
if(_.slideCount <=_.options.slidesToShow){
return;
}
if(sync===false){
_.asNavFor(index);
}
targetSlide=index;
targetLeft=_.getLeft(targetSlide);
slideLeft=_.getLeft(_.currentSlide);
_.currentLeft=_.swipeLeft===null ? slideLeft:_.swipeLeft;
if(_.options.infinite===false&&_.options.centerMode===false&&(index < 0||index > _.getDotCount() * _.options.slidesToScroll)){
if(_.options.fade===false){
targetSlide=_.currentSlide;
if(dontAnimate!==true){
_.animateSlide(slideLeft, function(){
_.postSlide(targetSlide);
});
}else{
_.postSlide(targetSlide);
}}
return;
}else if(_.options.infinite===false&&_.options.centerMode===true&&(index < 0||index > (_.slideCount - _.options.slidesToScroll))){
if(_.options.fade===false){
targetSlide=_.currentSlide;
if(dontAnimate!==true){
_.animateSlide(slideLeft, function(){
_.postSlide(targetSlide);
});
}else{
_.postSlide(targetSlide);
}}
return;
}
if(_.options.autoplay){
clearInterval(_.autoPlayTimer);
}
if(targetSlide < 0){
if(_.slideCount % _.options.slidesToScroll!==0){
animSlide=_.slideCount - (_.slideCount % _.options.slidesToScroll);
}else{
animSlide=_.slideCount + targetSlide;
}}else if(targetSlide >=_.slideCount){
if(_.slideCount % _.options.slidesToScroll!==0){
animSlide=0;
}else{
animSlide=targetSlide - _.slideCount;
}}else{
animSlide=targetSlide;
}
_.animating=true;
_.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
oldSlide=_.currentSlide;
_.currentSlide=animSlide;
_.setSlideClasses(_.currentSlide);
if(_.options.asNavFor){
navTarget=_.getNavTarget();
navTarget=navTarget.slick('getSlick');
if(navTarget.slideCount <=navTarget.options.slidesToShow){
navTarget.setSlideClasses(_.currentSlide);
}}
_.updateDots();
_.updateArrows();
if(_.options.fade===true){
if(dontAnimate!==true){
_.fadeSlideOut(oldSlide);
_.fadeSlide(animSlide, function(){
_.postSlide(animSlide);
});
}else{
_.postSlide(animSlide);
}
_.animateHeight();
return;
}
if(dontAnimate!==true){
_.animateSlide(targetLeft, function(){
_.postSlide(animSlide);
});
}else{
_.postSlide(animSlide);
}};
Slick.prototype.startLoad=function(){
var _=this;
if(_.options.arrows===true&&_.slideCount > _.options.slidesToShow){
_.$prevArrow.hide();
_.$nextArrow.hide();
}
if(_.options.dots===true&&_.slideCount > _.options.slidesToShow){
_.$dots.hide();
}
_.$slider.addClass('slick-loading');
};
Slick.prototype.swipeDirection=function(){
var xDist, yDist, r, swipeAngle, _=this;
xDist=_.touchObject.startX - _.touchObject.curX;
yDist=_.touchObject.startY - _.touchObject.curY;
r=Math.atan2(yDist, xDist);
swipeAngle=Math.round(r * 180 / Math.PI);
if(swipeAngle < 0){
swipeAngle=360 - Math.abs(swipeAngle);
}
if((swipeAngle <=45)&&(swipeAngle >=0)){
return (_.options.rtl===false ? 'left':'right');
}
if((swipeAngle <=360)&&(swipeAngle >=315)){
return (_.options.rtl===false ? 'left':'right');
}
if((swipeAngle >=135)&&(swipeAngle <=225)){
return (_.options.rtl===false ? 'right':'left');
}
if(_.options.verticalSwiping===true){
if((swipeAngle >=35)&&(swipeAngle <=135)){
return 'down';
}else{
return 'up';
}}
return 'vertical';
};
Slick.prototype.swipeEnd=function(event){
var _=this,
slideCount,
direction;
_.dragging=false;
_.interrupted=false;
_.shouldClick=(_.touchObject.swipeLength > 10) ? false:true;
if(_.touchObject.curX===undefined){
return false;
}
if(_.touchObject.edgeHit===true){
_.$slider.trigger('edge', [_, _.swipeDirection() ]);
}
if(_.touchObject.swipeLength >=_.touchObject.minSwipe){
direction=_.swipeDirection();
switch(direction){
case 'left':
case 'down':
slideCount =
_.options.swipeToSlide ?
_.checkNavigable(_.currentSlide + _.getSlideCount()) :
_.currentSlide + _.getSlideCount();
_.currentDirection=0;
break;
case 'right':
case 'up':
slideCount =
_.options.swipeToSlide ?
_.checkNavigable(_.currentSlide - _.getSlideCount()) :
_.currentSlide - _.getSlideCount();
_.currentDirection=1;
break;
default:
}
if(direction!='vertical'){
_.slideHandler(slideCount);
_.touchObject={};
_.$slider.trigger('swipe', [_, direction ]);
}}else{
if(_.touchObject.startX!==_.touchObject.curX){
_.slideHandler(_.currentSlide);
_.touchObject={};}}
};
Slick.prototype.swipeHandler=function(event){
var _=this;
if((_.options.swipe===false)||('ontouchend' in document&&_.options.swipe===false)){
return;
}else if(_.options.draggable===false&&event.type.indexOf('mouse')!==-1){
return;
}
_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined ?
event.originalEvent.touches.length:1;
_.touchObject.minSwipe=_.listWidth / _.options
.touchThreshold;
if(_.options.verticalSwiping===true){
_.touchObject.minSwipe=_.listHeight / _.options
.touchThreshold;
}
switch (event.data.action){
case 'start':
_.swipeStart(event);
break;
case 'move':
_.swipeMove(event);
break;
case 'end':
_.swipeEnd(event);
break;
}};
Slick.prototype.swipeMove=function(event){
var _=this,
edgeWasHit=false,
curLeft, swipeDirection, swipeLength, positionOffset, touches;
touches=event.originalEvent!==undefined ? event.originalEvent.touches:null;
if(!_.dragging||touches&&touches.length!==1){
return false;
}
curLeft=_.getLeft(_.currentSlide);
_.touchObject.curX=touches!==undefined ? touches[0].pageX:event.clientX;
_.touchObject.curY=touches!==undefined ? touches[0].pageY:event.clientY;
_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
if(_.options.verticalSwiping===true){
_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
}
swipeDirection=_.swipeDirection();
if(swipeDirection==='vertical'){
return;
}
if(event.originalEvent!==undefined&&_.touchObject.swipeLength > 4){
event.preventDefault();
}
positionOffset=(_.options.rtl===false ? 1:-1) * (_.touchObject.curX > _.touchObject.startX ? 1:-1);
if(_.options.verticalSwiping===true){
positionOffset=_.touchObject.curY > _.touchObject.startY ? 1:-1;
}
swipeLength=_.touchObject.swipeLength;
_.touchObject.edgeHit=false;
if(_.options.infinite===false){
if((_.currentSlide===0&&swipeDirection==='right')||(_.currentSlide >=_.getDotCount()&&swipeDirection==='left')){
swipeLength=_.touchObject.swipeLength * _.options.edgeFriction;
_.touchObject.edgeHit=true;
}}
if(_.options.vertical===false){
_.swipeLeft=curLeft + swipeLength * positionOffset;
}else{
_.swipeLeft=curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
}
if(_.options.verticalSwiping===true){
_.swipeLeft=curLeft + swipeLength * positionOffset;
}
if(_.options.fade===true||_.options.touchMove===false){
return false;
}
if(_.animating===true){
_.swipeLeft=null;
return false;
}
_.setCSS(_.swipeLeft);
};
Slick.prototype.swipeStart=function(event){
var _=this,
touches;
_.interrupted=true;
if(_.touchObject.fingerCount!==1||_.slideCount <=_.options.slidesToShow){
_.touchObject={};
return false;
}
if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined){
touches=event.originalEvent.touches[0];
}
_.touchObject.startX=_.touchObject.curX=touches!==undefined ? touches.pageX:event.clientX;
_.touchObject.startY=_.touchObject.curY=touches!==undefined ? touches.pageY:event.clientY;
_.dragging=true;
};
Slick.prototype.unfilterSlides=Slick.prototype.slickUnfilter=function(){
var _=this;
if(_.$slidesCache!==null){
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.appendTo(_.$slideTrack);
_.reinit();
}};
Slick.prototype.unload=function(){
var _=this;
$('.slick-cloned', _.$slider).remove();
if(_.$dots){
_.$dots.remove();
}
if(_.$prevArrow&&_.htmlExpr.test(_.options.prevArrow)){
_.$prevArrow.remove();
}
if(_.$nextArrow&&_.htmlExpr.test(_.options.nextArrow)){
_.$nextArrow.remove();
}
_.$slides
.removeClass('slick-slide slick-active slick-visible slick-current')
.attr('aria-hidden', 'true')
.css('width', '');
};
Slick.prototype.unslick=function(fromBreakpoint){
var _=this;
_.$slider.trigger('unslick', [_, fromBreakpoint]);
_.destroy();
};
Slick.prototype.updateArrows=function(){
var _=this,
centerOffset;
centerOffset=Math.floor(_.options.slidesToShow / 2);
if(_.options.arrows===true &&
_.slideCount > _.options.slidesToShow &&
!_.options.infinite){
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
if(_.currentSlide===0){
_.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
}else if(_.currentSlide >=_.slideCount - _.options.slidesToShow&&_.options.centerMode===false){
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
}else if(_.currentSlide >=_.slideCount - 1&&_.options.centerMode===true){
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
}}
};
Slick.prototype.updateDots=function(){
var _=this;
if(_.$dots!==null){
_.$dots
.find('li')
.removeClass('slick-active')
.attr('aria-hidden', 'true');
_.$dots
.find('li')
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
.addClass('slick-active')
.attr('aria-hidden', 'false');
}};
Slick.prototype.visibility=function(){
var _=this;
if(_.options.autoplay){
if(document[_.hidden]){
_.interrupted=true;
}else{
_.interrupted=false;
}}
};
$.fn.slick=function(){
var _=this,
opt=arguments[0],
args=Array.prototype.slice.call(arguments, 1),
l=_.length,
i,
ret;
for (i=0; i < l; i++){
if(typeof opt=='object'||typeof opt=='undefined')
_[i].slick=new Slick(_[i], opt);
else
ret=_[i].slick[opt].apply(_[i].slick, args);
if(typeof ret!='undefined') return ret;
}
return _;
};}));
!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g--;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.settings.center&&(this.$stage.children(".center").removeClass("center"),this.$stage.children().eq(this.current()).addClass("center"))}}],e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var b,c,e;b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&e<=0&&this.preloadAutoWidthImages(b)}this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('<div class="'+this.settings.stageOuterClass+'"/>'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this.$element.is(":visible")?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.$element.is(":visible")&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),this.settings.responsive!==!1&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var d=-1,e=30,f=this.width(),g=this.coordinates();return this.settings.freeDrag||a.each(g,a.proxy(function(a,h){return"left"===c&&b>h-e&&b<h+e?d=a:"right"===c&&b>h-f-e&&b<h-f+e?d=a+1:this.op(b,"<",h)&&this.op(b,">",g[a+1]||h-f)&&(d="left"===c?a+1:a),d===-1},this)),this.settings.loop||(this.op(b,">",g[this.minimum()])?d=b=this.minimum():this.op(b,"<",g[this.maximum()])&&(d=b=this.maximum())),d},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){for(b=this._items.length,c=this._items[--b].width(),d=this.$element.width();b--&&(c+=this._items[b].width()+this.settings.margin,!(c>d)););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=f*-1*g),a=c+e,d=((a-h)%g+g)%g+h,d!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.$element.is(":visible")&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),this.settings.responsive!==!1&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&a.namespace.indexOf("owl")!==-1?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.$element.is(":visible"),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.$element.is(":visible")!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&e*-1||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.$stage.children().toArray().slice(b,c),e=[],f=0;a.each(d,function(b,c){e.push(a(c).height())}),f=Math.max.apply(null,e),this._core.$stage.parent().height(f).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?'<div class="owl-video-tn '+j+'" '+i+'="'+a+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+a+')"></div>',b.after(d),b.after(e)};if(b.wrap('<div class="owl-video-wrapper"'+g+"></div>"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),"youtube"===f.type?c='<iframe width="'+g+'" height="'+h+'" src="//www.youtube.com/embed/'+f.id+"?autoplay=1&rel=0&v="+f.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===f.type?c='<iframe src="//player.vimeo.com/video/'+f.id+'?autoplay=1" width="'+g+'" height="'+h+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>':"vzaar"===f.type&&(c='<iframe frameborder="0"height="'+h+'"width="'+g+'" allowfullscreen mozallowfullscreen webkitAllowFullScreen src="//view.vzaar.com/'+f.id+'/player?autoplay=true"></iframe>'),a('<div class="owl-video-frame">'+c+"</div>").insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},
a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._timeout=null,this._paused=!1,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._core.settings.autoplay&&this._setAutoPlayInterval()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype.play=function(a,b){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._setAutoPlayInterval())},e.prototype._getNextTimeout=function(d,e){return this._timeout&&b.clearTimeout(this._timeout),b.setTimeout(a.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||c.hidden||this._core.next(e||this._core.settings.autoplaySpeed)},this),d||this._core.settings.autoplayTimeout)},e.prototype._setAutoPlayInterval=function(){this._timeout=this._getNextTimeout()},e.prototype.stop=function(){this._core.is("rotating")&&(b.clearTimeout(this._timeout),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a("<div>").addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
(function (factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
module.exports=factory;
}else{
factory(jQuery);
}}(function ($){
var toFix=['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind=('onwheel' in document||document.documentMode >=9) ?
['wheel']:['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice=Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if($.event.fixHooks){
for(var i=toFix.length; i;){
$.event.fixHooks[ toFix[--i] ]=$.event.mouseHooks;
}}
var special=$.event.special.mousewheel={
version: '3.1.9',
setup: function(){
if(this.addEventListener){
for(var i=toBind.length; i;){
this.addEventListener(toBind[--i], handler, false);
}}else{
this.onmousewheel=handler;
}
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
},
teardown: function(){
if(this.removeEventListener){
for(var i=toBind.length; i;){
this.removeEventListener(toBind[--i], handler, false);
}}else{
this.onmousewheel=null;
}},
getLineHeight: function(elem){
return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent':'parent']().css('fontSize'), 10);
},
getPageHeight: function(elem){
return $(elem).height();
},
settings: {
adjustOldDeltas: true
}};
$.fn.extend({
mousewheel: function(fn){
return fn ? this.bind('mousewheel', fn):this.trigger('mousewheel');
},
unmousewheel: function(fn){
return this.unbind('mousewheel', fn);
}});
function handler(event){
var orgEvent=event||window.event,
args=slice.call(arguments, 1),
delta=0,
deltaX=0,
deltaY=0,
absDelta=0;
event=$.event.fix(orgEvent);
event.type='mousewheel';
if('detail'      in orgEvent){ deltaY=orgEvent.detail * -1;      }
if('wheelDelta'  in orgEvent){ deltaY=orgEvent.wheelDelta;       }
if('wheelDeltaY' in orgEvent){ deltaY=orgEvent.wheelDeltaY;      }
if('wheelDeltaX' in orgEvent){ deltaX=orgEvent.wheelDeltaX * -1; }
if('axis' in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){
deltaX=deltaY * -1;
deltaY=0;
}
delta=deltaY===0 ? deltaX:deltaY;
if('deltaY' in orgEvent){
deltaY=orgEvent.deltaY * -1;
delta=deltaY;
}
if('deltaX' in orgEvent){
deltaX=orgEvent.deltaX;
if(deltaY===0){ delta=deltaX * -1; }}
if(deltaY===0&&deltaX===0){ return; }
if(orgEvent.deltaMode===1){
var lineHeight=$.data(this, 'mousewheel-line-height');
delta  *=lineHeight;
deltaY *=lineHeight;
deltaX *=lineHeight;
}else if(orgEvent.deltaMode===2){
var pageHeight=$.data(this, 'mousewheel-page-height');
delta  *=pageHeight;
deltaY *=pageHeight;
deltaX *=pageHeight;
}
absDelta=Math.max(Math.abs(deltaY), Math.abs(deltaX));
if(!lowestDelta||absDelta < lowestDelta){
lowestDelta=absDelta;
if(shouldAdjustOldDeltas(orgEvent, absDelta)){
lowestDelta /=40;
}}
if(shouldAdjustOldDeltas(orgEvent, absDelta)){
delta  /=40;
deltaX /=40;
deltaY /=40;
}
delta=Math[ delta  >=1 ? 'floor':'ceil' ](delta  / lowestDelta);
deltaX=Math[ deltaX >=1 ? 'floor':'ceil' ](deltaX / lowestDelta);
deltaY=Math[ deltaY >=1 ? 'floor':'ceil' ](deltaY / lowestDelta);
event.deltaX=deltaX;
event.deltaY=deltaY;
event.deltaFactor=lowestDelta;
event.deltaMode=0;
args.unshift(event, delta, deltaX, deltaY);
if(nullLowestDeltaTimeout){ clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout=setTimeout(nullLowestDelta, 200);
return ($.event.dispatch||$.event.handle).apply(this, args);
}
function nullLowestDelta(){
lowestDelta=null;
}
function shouldAdjustOldDeltas(orgEvent, absDelta){
return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta % 120===0;
}}));
!function(a,b,c){a.fn.jScrollPane=function(d){function e(d,e){function f(b){var e,h,j,l,m,n,q=!1,r=!1;if(P=b,Q===c)m=d.scrollTop(),n=d.scrollLeft(),d.css({overflow:"hidden",padding:0}),R=d.innerWidth()+tb,S=d.innerHeight(),d.width(R),Q=a('<div class="jspPane" />').css("padding",sb).append(d.children()),T=a('<div class="jspContainer" />').css({width:R+"px",height:S+"px"}).append(Q).appendTo(d);else{if(d.css("width",""),q=P.stickToBottom&&C(),r=P.stickToRight&&D(),l=d.innerWidth()+tb!=R||d.outerHeight()!=S,l&&(R=d.innerWidth()+tb,S=d.innerHeight(),T.css({width:R+"px",height:S+"px"})),!l&&ub==U&&Q.outerHeight()==V)return d.width(R),void 0;ub=U,Q.css("width",""),d.width(R),T.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Q.css("overflow","auto"),U=b.contentWidth?b.contentWidth:Q[0].scrollWidth,V=Q[0].scrollHeight,Q.css("overflow",""),W=U/R,X=V/S,Y=X>1,Z=W>1,Z||Y?(d.addClass("jspScrollable"),e=P.maintainPosition&&(ab||db),e&&(h=A(),j=B()),g(),i(),k(),e&&(y(r?U-R:h,!1),x(q?V-S:j,!1)),H(),E(),N(),P.enableKeyboardNavigation&&J(),P.clickOnTrack&&o(),L(),P.hijackInternalLinks&&M()):(d.removeClass("jspScrollable"),Q.css({top:0,left:0,width:T.width()-tb}),F(),I(),K(),p()),P.autoReinitialise&&!rb?rb=setInterval(function(){f(P)},P.autoReinitialiseDelay):!P.autoReinitialise&&rb&&clearInterval(rb),m&&d.scrollTop(0)&&x(m,!1),n&&d.scrollLeft(0)&&y(n,!1),d.trigger("jsp-initialised",[Z||Y])}function g(){Y&&(T.append(a('<div class="jspVerticalBar" />').append(a('<div class="jspCap jspCapTop" />'),a('<div class="jspTrack" />').append(a('<div class="jspDrag" />').append(a('<div class="jspDragTop" />'),a('<div class="jspDragBottom" />'))),a('<div class="jspCap jspCapBottom" />'))),eb=T.find(">.jspVerticalBar"),fb=eb.find(">.jspTrack"),$=fb.find(">.jspDrag"),P.showArrows&&(jb=a('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",m(0,-1)).bind("click.jsp",G),kb=a('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",m(0,1)).bind("click.jsp",G),P.arrowScrollOnHover&&(jb.bind("mouseover.jsp",m(0,-1,jb)),kb.bind("mouseover.jsp",m(0,1,kb))),l(fb,P.verticalArrowPositions,jb,kb)),hb=S,T.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){hb-=a(this).outerHeight()}),$.hover(function(){$.addClass("jspHover")},function(){$.removeClass("jspHover")}).bind("mousedown.jsp",function(b){a("html").bind("dragstart.jsp selectstart.jsp",G),$.addClass("jspActive");var c=b.pageY-$.position().top;return a("html").bind("mousemove.jsp",function(a){r(a.pageY-c,!1)}).bind("mouseup.jsp mouseleave.jsp",q),!1}),h())}function h(){fb.height(hb+"px"),ab=0,gb=P.verticalGutter+fb.outerWidth(),Q.width(R-gb-tb);try{0===eb.position().left&&Q.css("margin-left",gb+"px")}catch(a){}}function i(){Z&&(T.append(a('<div class="jspHorizontalBar" />').append(a('<div class="jspCap jspCapLeft" />'),a('<div class="jspTrack" />').append(a('<div class="jspDrag" />').append(a('<div class="jspDragLeft" />'),a('<div class="jspDragRight" />'))),a('<div class="jspCap jspCapRight" />'))),lb=T.find(">.jspHorizontalBar"),mb=lb.find(">.jspTrack"),bb=mb.find(">.jspDrag"),P.showArrows&&(pb=a('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",m(-1,0)).bind("click.jsp",G),qb=a('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",m(1,0)).bind("click.jsp",G),P.arrowScrollOnHover&&(pb.bind("mouseover.jsp",m(-1,0,pb)),qb.bind("mouseover.jsp",m(1,0,qb))),l(mb,P.horizontalArrowPositions,pb,qb)),bb.hover(function(){bb.addClass("jspHover")},function(){bb.removeClass("jspHover")}).bind("mousedown.jsp",function(b){a("html").bind("dragstart.jsp selectstart.jsp",G),bb.addClass("jspActive");var c=b.pageX-bb.position().left;return a("html").bind("mousemove.jsp",function(a){t(a.pageX-c,!1)}).bind("mouseup.jsp mouseleave.jsp",q),!1}),nb=T.innerWidth(),j())}function j(){T.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){nb-=a(this).outerWidth()}),mb.width(nb+"px"),db=0}function k(){if(Z&&Y){var b=mb.outerHeight(),c=fb.outerWidth();hb-=b,a(lb).find(">.jspCap:visible,>.jspArrow").each(function(){nb+=a(this).outerWidth()}),nb-=c,S-=c,R-=b,mb.parent().append(a('<div class="jspCorner" />').css("width",b+"px")),h(),j()}Z&&Q.width(T.outerWidth()-tb+"px"),V=Q.outerHeight(),X=V/S,Z&&(ob=Math.ceil(1/W*nb),ob>P.horizontalDragMaxWidth?ob=P.horizontalDragMaxWidth:ob<P.horizontalDragMinWidth&&(ob=P.horizontalDragMinWidth),bb.width(ob+"px"),cb=nb-ob,u(db)),Y&&(ib=Math.ceil(1/X*hb),ib>P.verticalDragMaxHeight?ib=P.verticalDragMaxHeight:ib<P.verticalDragMinHeight&&(ib=P.verticalDragMinHeight),$.height(ib+"px"),_=hb-ib,s(ab))}function l(a,b,c,d){var e,f="before",g="after";"os"==b&&(b=/Mac/.test(navigator.platform)?"after":"split"),b==f?g=b:b==g&&(f=b,e=c,c=d,d=e),a[f](c)[g](d)}function m(a,b,c){return function(){return n(a,b,this,c),this.blur(),!1}}function n(b,c,d,e){d=a(d).addClass("jspActive");var f,g,h=!0,i=function(){0!==b&&vb.scrollByX(b*P.arrowButtonSpeed),0!==c&&vb.scrollByY(c*P.arrowButtonSpeed),g=setTimeout(i,h?P.initialDelay:P.arrowRepeatFreq),h=!1};i(),f=e?"mouseout.jsp":"mouseup.jsp",e=e||a("html"),e.bind(f,function(){d.removeClass("jspActive"),g&&clearTimeout(g),g=null,e.unbind(f)})}function o(){p(),Y&&fb.bind("mousedown.jsp",function(b){if(b.originalTarget===c||b.originalTarget==b.currentTarget){var d,e=a(this),f=e.offset(),g=b.pageY-f.top-ab,h=!0,i=function(){var a=e.offset(),c=b.pageY-a.top-ib/2,f=S*P.scrollPagePercent,k=_*f/(V-S);if(0>g)ab-k>c?vb.scrollByY(-f):r(c);else{if(!(g>0))return j(),void 0;c>ab+k?vb.scrollByY(f):r(c)}d=setTimeout(i,h?P.initialDelay:P.trackClickRepeatFreq),h=!1},j=function(){d&&clearTimeout(d),d=null,a(document).unbind("mouseup.jsp",j)};return i(),a(document).bind("mouseup.jsp",j),!1}}),Z&&mb.bind("mousedown.jsp",function(b){if(b.originalTarget===c||b.originalTarget==b.currentTarget){var d,e=a(this),f=e.offset(),g=b.pageX-f.left-db,h=!0,i=function(){var a=e.offset(),c=b.pageX-a.left-ob/2,f=R*P.scrollPagePercent,k=cb*f/(U-R);if(0>g)db-k>c?vb.scrollByX(-f):t(c);else{if(!(g>0))return j(),void 0;c>db+k?vb.scrollByX(f):t(c)}d=setTimeout(i,h?P.initialDelay:P.trackClickRepeatFreq),h=!1},j=function(){d&&clearTimeout(d),d=null,a(document).unbind("mouseup.jsp",j)};return i(),a(document).bind("mouseup.jsp",j),!1}})}function p(){mb&&mb.unbind("mousedown.jsp"),fb&&fb.unbind("mousedown.jsp")}function q(){a("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"),$&&$.removeClass("jspActive"),bb&&bb.removeClass("jspActive")}function r(a,b){Y&&(0>a?a=0:a>_&&(a=_),b===c&&(b=P.animateScroll),b?vb.animate($,"top",a,s):($.css("top",a),s(a)))}function s(a){a===c&&(a=$.position().top),T.scrollTop(0),ab=a;var b=0===ab,e=ab==_,f=a/_,g=-f*(V-S);(wb!=b||yb!=e)&&(wb=b,yb=e,d.trigger("jsp-arrow-change",[wb,yb,xb,zb])),v(b,e),Q.css("top",g),d.trigger("jsp-scroll-y",[-g,b,e]).trigger("scroll")}function t(a,b){Z&&(0>a?a=0:a>cb&&(a=cb),b===c&&(b=P.animateScroll),b?vb.animate(bb,"left",a,u):(bb.css("left",a),u(a)))}function u(a){a===c&&(a=bb.position().left),T.scrollTop(0),db=a;var b=0===db,e=db==cb,f=a/cb,g=-f*(U-R);(xb!=b||zb!=e)&&(xb=b,zb=e,d.trigger("jsp-arrow-change",[wb,yb,xb,zb])),w(b,e),Q.css("left",g),d.trigger("jsp-scroll-x",[-g,b,e]).trigger("scroll")}function v(a,b){P.showArrows&&(jb[a?"addClass":"removeClass"]("jspDisabled"),kb[b?"addClass":"removeClass"]("jspDisabled"))}function w(a,b){P.showArrows&&(pb[a?"addClass":"removeClass"]("jspDisabled"),qb[b?"addClass":"removeClass"]("jspDisabled"))}function x(a,b){var c=a/(V-S);r(c*_,b)}function y(a,b){var c=a/(U-R);t(c*cb,b)}function z(b,c,d){var e,f,g,h,i,j,k,l,m,n=0,o=0;try{e=a(b)}catch(p){return}for(f=e.outerHeight(),g=e.outerWidth(),T.scrollTop(0),T.scrollLeft(0);!e.is(".jspPane");)if(n+=e.position().top,o+=e.position().left,e=e.offsetParent(),/^body|html$/i.test(e[0].nodeName))return;h=B(),j=h+S,h>n||c?l=n-P.horizontalGutter:n+f>j&&(l=n-S+f+P.horizontalGutter),isNaN(l)||x(l,d),i=A(),k=i+R,i>o||c?m=o-P.horizontalGutter:o+g>k&&(m=o-R+g+P.horizontalGutter),isNaN(m)||y(m,d)}function A(){return-Q.position().left}function B(){return-Q.position().top}function C(){var a=V-S;return a>20&&a-B()<10}function D(){var a=U-R;return a>20&&a-A()<10}function E(){T.unbind(Bb).bind(Bb,function(a,b,c,d){var e=db,f=ab,g=a.deltaFactor||P.mouseWheelSpeed;return vb.scrollBy(c*g,-d*g,!1),e==db&&f==ab})}function F(){T.unbind(Bb)}function G(){return!1}function H(){Q.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(a){z(a.target,!1)})}function I(){Q.find(":input,a").unbind("focus.jsp")}function J(){function b(){var a=db,b=ab;switch(c){case 40:vb.scrollByY(P.keyboardSpeed,!1);break;case 38:vb.scrollByY(-P.keyboardSpeed,!1);break;case 34:case 32:vb.scrollByY(S*P.scrollPagePercent,!1);break;case 33:vb.scrollByY(-S*P.scrollPagePercent,!1);break;case 39:vb.scrollByX(P.keyboardSpeed,!1);break;case 37:vb.scrollByX(-P.keyboardSpeed,!1)}return e=a!=db||b!=ab}var c,e,f=[];Z&&f.push(lb[0]),Y&&f.push(eb[0]),Q.focus(function(){d.focus()}),d.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(d){if(d.target===this||f.length&&a(d.target).closest(f).length){var g=db,h=ab;switch(d.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:c=d.keyCode,b();break;case 35:x(V-S),c=null;break;case 36:x(0),c=null}return e=d.keyCode==c&&g!=db||h!=ab,!e}}).bind("keypress.jsp",function(a){return a.keyCode==c&&b(),!e}),P.hideFocus?(d.css("outline","none"),"hideFocus"in T[0]&&d.attr("hideFocus",!0)):(d.css("outline",""),"hideFocus"in T[0]&&d.attr("hideFocus",!1))}function K(){d.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function L(){if(location.hash&&location.hash.length>1){var b,c,d=escape(location.hash.substr(1));try{b=a("#"+d+', a[name="'+d+'"]')}catch(e){return}b.length&&Q.find(d)&&(0===T.scrollTop()?c=setInterval(function(){T.scrollTop()>0&&(z(b,!0),a(document).scrollTop(T.position().top),clearInterval(c))},50):(z(b,!0),a(document).scrollTop(T.position().top)))}}function M(){a(document.body).data("jspHijack")||(a(document.body).data("jspHijack",!0),a(document.body).delegate("a[href*=#]","click",function(c){var d,e,f,g,h,i,j=this.href.substr(0,this.href.indexOf("#")),k=location.href;if(-1!==location.href.indexOf("#")&&(k=location.href.substr(0,location.href.indexOf("#"))),j===k){d=escape(this.href.substr(this.href.indexOf("#")+1));try{e=a("#"+d+', a[name="'+d+'"]')}catch(l){return}e.length&&(f=e.closest(".jspScrollable"),g=f.data("jsp"),g.scrollToElement(e,!0),f[0].scrollIntoView&&(h=a(b).scrollTop(),i=e.offset().top,(h>i||i>h+a(b).height())&&f[0].scrollIntoView()),c.preventDefault())}}))}function N(){var a,b,c,d,e,f=!1;T.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(g){var h=g.originalEvent.touches[0];a=A(),b=B(),c=h.pageX,d=h.pageY,e=!1,f=!0}).bind("touchmove.jsp",function(g){if(f){var h=g.originalEvent.touches[0],i=db,j=ab;return vb.scrollTo(a+c-h.pageX,b+d-h.pageY),e=e||Math.abs(c-h.pageX)>5||Math.abs(d-h.pageY)>5,i==db&&j==ab}}).bind("touchend.jsp",function(){f=!1}).bind("click.jsp-touchclick",function(){return e?(e=!1,!1):void 0})}function O(){var a=B(),b=A();d.removeClass("jspScrollable").unbind(".jsp"),d.replaceWith(Ab.append(Q.children())),Ab.scrollTop(a),Ab.scrollLeft(b),rb&&clearInterval(rb)}var P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb=this,wb=!0,xb=!0,yb=!1,zb=!1,Ab=d.clone(!1,!1).empty(),Bb=a.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";"border-box"===d.css("box-sizing")?(sb=0,tb=0):(sb=d.css("paddingTop")+" "+d.css("paddingRight")+" "+d.css("paddingBottom")+" "+d.css("paddingLeft"),tb=(parseInt(d.css("paddingLeft"),10)||0)+(parseInt(d.css("paddingRight"),10)||0)),a.extend(vb,{reinitialise:function(b){b=a.extend({},P,b),f(b)},scrollToElement:function(a,b,c){z(a,b,c)},scrollTo:function(a,b,c){y(a,c),x(b,c)},scrollToX:function(a,b){y(a,b)},scrollToY:function(a,b){x(a,b)},scrollToPercentX:function(a,b){y(a*(U-R),b)},scrollToPercentY:function(a,b){x(a*(V-S),b)},scrollBy:function(a,b,c){vb.scrollByX(a,c),vb.scrollByY(b,c)},scrollByX:function(a,b){var c=A()+Math[0>a?"floor":"ceil"](a),d=c/(U-R);t(d*cb,b)},scrollByY:function(a,b){var c=B()+Math[0>a?"floor":"ceil"](a),d=c/(V-S);r(d*_,b)},positionDragX:function(a,b){t(a,b)},positionDragY:function(a,b){r(a,b)},animate:function(a,b,c,d){var e={};e[b]=c,a.animate(e,{duration:P.animateDuration,easing:P.animateEase,queue:!1,step:d})},getContentPositionX:function(){return A()},getContentPositionY:function(){return B()},getContentWidth:function(){return U},getContentHeight:function(){return V},getPercentScrolledX:function(){return A()/(U-R)},getPercentScrolledY:function(){return B()/(V-S)},getIsScrollableH:function(){return Z},getIsScrollableV:function(){return Y},getContentPane:function(){return Q},scrollToBottom:function(a){r(_,a)},hijackInternalLinks:a.noop,destroy:function(){O()}}),f(e)}return d=a.extend({},a.fn.jScrollPane.defaults,d),a.each(["arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){d[this]=d[this]||d.speed}),this.each(function(){var b=a(this),c=b.data("jsp");c?c.reinitialise(d):(a("script",b).filter('[type="text/javascript"],:not([type])').remove(),c=new e(b,d),b.data("jsp",c))})},a.fn.jScrollPane.defaults={showArrows:!1,maintainPosition:!0,stickToBottom:!1,stickToRight:!1,clickOnTrack:!0,autoReinitialise:!1,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:!1,animateDuration:300,animateEase:"linear",hijackInternalLinks:!1,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:3,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:!1,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:!0,hideFocus:!1,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8}}(jQuery,this);
!function(a,b){"use strict";function c(b){b=a.extend({},D,b||{}),null===C&&(C=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled"),c.external&&(c.links=!0);var d=b.find("[selected]").not(":disabled"),g=b.find("option").index(d);c.multiple||""===c.label?c.label="":(b.prepend('<option value="" class="selecter-placeholder" selected>'+c.label+"</option>"),g>-1&&g++);var h=b.find("option, optgroup"),j=h.filter("option");d.length||(d=j.eq(0));var k=g>-1?g:0,q=""!==c.label?c.label:d.text(),s="div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1;var t="",u="";u+="<"+s+' class="selecter '+c.customClass,A?u+=" mobile":c.cover&&(u+=" cover"),u+=c.multiple?" multiple":" closed",c.disabled&&(u+=" disabled"),u+='" tabindex="'+c.tabIndex+'">',u+="</"+s+">",c.multiple||(t+='<span class="selecter-selected">',t+=a("<span></span>").text(v(q,c.trim)).html(),t+="</span>"),t+='<div class="selecter-options">',t+="</div>",b.addClass("selecter-element").wrap(u).after(t);var w=b.parent(".selecter"),y=a.extend({$select:b,$allOptions:h,$options:j,$selecter:w,$selected:w.find(".selecter-selected"),$itemsWrapper:w.find(".selecter-options"),index:-1,guid:x++},c);e(y),y.multiple||r(k,y),void 0!==a.fn.scroller&&y.$itemsWrapper.scroller(),y.$selecter.on("touchstart.selecter",".selecter-selected",y,f).on("click.selecter",".selecter-selected",y,i).on("click.selecter",".selecter-item",y,m).on("close.selecter",y,l).data("selecter",y),y.$select.on("change.selecter",y,n),A||(y.$selecter.on("focusin.selecter",y,o).on("blur.selecter",y,p),y.$select.on("focusin.selecter",y,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.hasClass("selecter-placeholder")&&(c+=" placeholder"),h.is(":selected")&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(v(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(a){a.stopPropagation();var b=a.data;b.touchStartEvent=a.originalEvent,b.touchStartX=b.touchStartEvent.touches[0].clientX,b.touchStartY=b.touchStartEvent.touches[0].clientY,b.$selecter.on("touchmove.selecter",".selecter-selected",b,g).on("touchend.selecter",".selecter-selected",b,h)}function g(a){var b=a.data,c=a.originalEvent;(Math.abs(c.touches[0].clientX-b.touchStartX)>10||Math.abs(c.touches[0].clientY-b.touchStartY)>10)&&b.$selecter.off("touchmove.selecter touchend.selecter")}function h(a){var b=a.data;b.touchStartEvent.preventDefault(),b.$selecter.off("touchmove.selecter touchend.selecter"),i(a)}function i(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),d.mobile||!A||B)d.$selecter.hasClass("closed")?j(c):d.$selecter.hasClass("open")&&l(c);else{var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}}function j(a){a.preventDefault(),a.stopPropagation();var b=a.data;if(!b.$selecter.hasClass("open")){{var c=b.$selecter.offset(),d=C.outerHeight(),e=b.$itemsWrapper.outerHeight(!0);b.index>=0?b.$items.eq(b.index).position():{left:0,top:0}}c.top+e>d&&b.$selecter.addClass("bottom"),b.$itemsWrapper.show(),b.$selecter.removeClass("closed").addClass("open"),C.on("click.selecter-"+b.guid,":not(.selecter-options)",b,k),s(b)}}function k(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&l(b)}function l(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),C.off(".selecter-"+b.guid))}function m(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);e!==d.index&&(r(e,d),t(d))}d.multiple||l(b)}}function n(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+w(d.val())+"']"));r(f,e),t(e)}}function o(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter-"+c.guid,c,q),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function p(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter-"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function q(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(l(b),r(c.index,c)),t(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,z?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||z&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e||e===c.index)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&(r(e,c),s(c))}}function r(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e)if(b.multiple)d?(b.$options.eq(a).prop("selected",null),c.removeClass("selected")):(b.$options.eq(a).prop("selected",!0),c.addClass("selected"));else if(a>-1&&a<b.$items.length){{var f=c.html();c.data("value")}b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a,c.addClass("selected"),b.index=a}else""!==b.label&&b.$selected.html(b.label)}function s(b){var c=b.$items.eq(b.index),d=b.index>=0&&!c.hasClass("placeholder")?c.position():{left:0,top:0};void 0!==a.fn.scroller?b.$itemsWrapper.scroller("scroll",b.$itemsWrapper.find(".scroller-content").scrollTop()+d.top,0).scroller("reset"):b.$itemsWrapper.scrollTop(b.$itemsWrapper.scrollTop()+d.top)}function t(a){a.links?u(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function u(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function v(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function w(a){return"string"==typeof a?a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"):a}var x=0,y=b.navigator.userAgent||b.navigator.vendor||b.opera,z=/Firefox/i.test(y),A=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(y),B=z&&A,C=null,D={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,mobile:!1,trim:0},E={defaults:function(b){return D=a.extend(D,b||{}),"object"==typeof this?a(this):!0},disable:function(b){return a(this).each(function(c,d){var e=a(d).parent(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).parent(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.find(".selecter-placeholder").remove(),d.$selected.remove(),d.$itemsWrapper.remove(),d.$selecter.off(".selecter"),d.$select.off(".selecter").removeClass("selecter-element").show().unwrap())})},enable:function(b){return a(this).each(function(c,d){var e=a(d).parent(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},refresh:function(){return E.update.apply(a(this))},update:function(){return a(this).each(function(b,c){var d=a(c).parent(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),d.multiple||r(f,d)}})}};a.fn.selecter=function(a){return E[a]?E[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&E.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window);
;(function($){
window.MapifyTooltip=function(settings){
this.dom_node=$('<div></div>');
this.dom_node.data('tooltip', this);
this.settings=settings;
this.class_prefix='mpfy';
this.creation_id=0;
this.visible=false;
this.dom_node.addClass(this.settings.classes);
this.node=function(){
return this.dom_node;
}
this.init=function(){
MapifyTooltip._instances.push(this);
this.creation_id=MapifyTooltip._instances.length;
var inner_wrap=$('<div class="inner-wrap"></div>');
this.node().append(inner_wrap);
inner_wrap.append($('<div class="top"></div>'));
inner_wrap.append($('<div class="center"></div>')
.append('<div class="tltpcnt">' + this.settings.content + '</div>')
);
inner_wrap.append($('<div class="bottom" style="border-top: 20px solid rgba(' + this.settings.rgba[0] + ', ' + this.settings.rgba[1] + ', ' + this.settings.rgba[2] + ', ' + this.settings.rgba[3] + ');"></div>'));
inner_wrap
.find('.mpfy-tooltip-content')
.css('backgroundColor', 'rgba(' + this.settings.rgba[0] + ', ' + this.settings.rgba[1] + ', ' + this.settings.rgba[2] + ', ' + this.settings.rgba[3] + ')');
if(this.settings.close_behavior=='manual'){
var close_button=$('<a href="#" class="' + this.class_prefix + '-close-tooltip ' + this.class_prefix + '-notext">&nbsp;</a>');
close_button.data('tooltip', this);
close_button.on('click', function(e){
var t=$(this).data('tooltip');
t.node().trigger({
'type': 'tooltip_close'
});
e.preventDefault();
});
this.node().find('.center:first').prepend(close_button);
}
$('body').append(this.node());
this.node()
.on('tooltip_mouseover', function(e){
var t=$(this).data('tooltip');
t.show(e.settings.left, e.settings.top);
})
.on('tooltip_mouseout', function(e){
var t=$(this).data('tooltip');
if(t.settings.close_behavior=='auto'){
t.hide();
}})
.on('tooltip_close', function(e){
var t=$(this).data('tooltip');
t.hide();
});
}
this.show=function(l, t){
l=Math.round(l);
t=Math.round(t);
if($('body').css('position')==='relative'){
t -=$('body').offset().top;
}
for (var i=0; i < MapifyTooltip._instances.length; i++){
var instance=MapifyTooltip._instances[i];
if(instance.creation_id!=this.creation_id){
instance.hide();
}}
var tooltip_width=this.node().width();
var arrow_width=30;
var arrow_margin='0 auto';
if(l < 0){
arrow_margin='0 0 0 ' + Math.floor(tooltip_width / 2 + l - arrow_width / 2).toString() + 'px';
l=0;
}else if(l + tooltip_width > $(window).width()){
var excess=l + tooltip_width - $(window).width();
arrow_margin='0 0 0 ' + Math.floor(tooltip_width / 2 + excess - arrow_width / 2).toString() + 'px';
l=$(window).width() - tooltip_width;
}
if(this.settings.animate&&!this.visible){
this.node().find('.inner-wrap:first')
.stop()
.css({
'top': 7,
'opacity': 0
})
.animate({
'top': 0,
'opacity': 1
}, 300);
}
this.node()
.stop()
.css({
'left': l,
'top': t,
'opacity': 1
})
.show();
this.node().find('.bottom:first').css({
'margin': arrow_margin
});
this.visible=true;
}
this.showCentered=function(l, t){
var l=l - Math.ceil(this.node().width() / 2);
var t=t - this.node().height();
this.show(l, t);
}
this.hide=function(){
if(!this.visible){
return false;
}
if(this.settings.animate){
this.node().stop().fadeTo(300, 0, function(){
$(this).hide();
})
}else{
this.node().hide();
}
this.visible=false;
this.node().trigger({
'type': 'tooltip_closed'
});
}
this.setContent=function(content){
this.node().find('.tltpcnt:first').html(content);
}
this.setGoogleMap=function(map){
var me=this;
google.maps.event.addListener(map, 'center_changed', function(){
me.hide();
});
google.maps.event.addListener(map, 'zoom_changed', function(){
me.hide();
});
google.maps.event.addListener(map, 'dragstart', function(){
me.hide();
});
}
this.setImageMap=function(map){
var me=this;
google.maps.event.addListener(map, 'center_changed', function(){
me.hide();
});
google.maps.event.addListener(map, 'zoom_changed', function(){
me.hide();
});
google.maps.event.addListener(map, 'dragstart', function(){
me.hide();
});
}
this.init();
}
MapifyTooltip._instances=[];
})(jQuery);
(function(modules){
var installedModules={};
function __webpack_require__(moduleId){
if(installedModules[moduleId]){
return installedModules[moduleId].exports;
}
var module=installedModules[moduleId]={
i: moduleId,
l: false,
exports: {}
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.l=true;
return module.exports;
}
__webpack_require__.m=modules;
__webpack_require__.c=installedModules;
__webpack_require__.i=function(value){ return value; };
__webpack_require__.d=function(exports, name, getter){
if(!__webpack_require__.o(exports, name)){
Object.defineProperty(exports, name, {
configurable: false,
enumerable: true,
get: getter
});
}
};
__webpack_require__.n=function(module){
var getter=module&&module.__esModule ?
function getDefault(){ return module['default']; } :
function getModuleExports(){ return module; };
__webpack_require__.d(getter, 'a', getter);
return getter;
};
__webpack_require__.o=function(object, property){ return Object.prototype.hasOwnProperty.call(object, property); };
__webpack_require__.p="";
return __webpack_require__(__webpack_require__.s=13);
})
([
(function(module, exports, __webpack_require__){
(function(process, Promise, global, setImmediate){
!function(e){if(true)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise){
var SomePromiseArray=Promise._SomePromiseArray;
function any(promises){
var ret=new SomePromiseArray(promises);
var promise=ret.promise();
ret.setHowMany(1);
ret.setUnwrap();
ret.init();
return promise;
}
Promise.any=function (promises){
return any(promises);
};
Promise.prototype.any=function (){
return any(this);
};};
},{}],2:[function(_dereq_,module,exports){
"use strict";
var firstLineError;
try {throw new Error(); } catch (e){firstLineError=e;}
var schedule=_dereq_("./schedule");
var Queue=_dereq_("./queue");
var util=_dereq_("./util");
function Async(){
this._customScheduler=false;
this._isTickUsed=false;
this._lateQueue=new Queue(16);
this._normalQueue=new Queue(16);
this._haveDrainedQueues=false;
this._trampolineEnabled=true;
var self=this;
this.drainQueues=function (){
self._drainQueues();
};
this._schedule=schedule;
}
Async.prototype.setScheduler=function(fn){
var prev=this._schedule;
this._schedule=fn;
this._customScheduler=true;
return prev;
};
Async.prototype.hasCustomScheduler=function(){
return this._customScheduler;
};
Async.prototype.enableTrampoline=function(){
this._trampolineEnabled=true;
};
Async.prototype.disableTrampolineIfNecessary=function(){
if(util.hasDevTools){
this._trampolineEnabled=false;
}};
Async.prototype.haveItemsQueued=function (){
return this._isTickUsed||this._haveDrainedQueues;
};
Async.prototype.fatalError=function(e, isNode){
if(isNode){
process.stderr.write("Fatal " + (e instanceof Error ? e.stack:e) +
"\n");
process.exit(2);
}else{
this.throwLater(e);
}};
Async.prototype.throwLater=function(fn, arg){
if(arguments.length===1){
arg=fn;
fn=function (){ throw arg; };}
if(typeof setTimeout!=="undefined"){
setTimeout(function(){
fn(arg);
}, 0);
} else try {
this._schedule(function(){
fn(arg);
});
} catch (e){
throw new Error("No async scheduler available\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}};
function AsyncInvokeLater(fn, receiver, arg){
this._lateQueue.push(fn, receiver, arg);
this._queueTick();
}
function AsyncInvoke(fn, receiver, arg){
this._normalQueue.push(fn, receiver, arg);
this._queueTick();
}
function AsyncSettlePromises(promise){
this._normalQueue._pushOne(promise);
this._queueTick();
}
if(!util.hasDevTools){
Async.prototype.invokeLater=AsyncInvokeLater;
Async.prototype.invoke=AsyncInvoke;
Async.prototype.settlePromises=AsyncSettlePromises;
}else{
Async.prototype.invokeLater=function (fn, receiver, arg){
if(this._trampolineEnabled){
AsyncInvokeLater.call(this, fn, receiver, arg);
}else{
this._schedule(function(){
setTimeout(function(){
fn.call(receiver, arg);
}, 100);
});
}};
Async.prototype.invoke=function (fn, receiver, arg){
if(this._trampolineEnabled){
AsyncInvoke.call(this, fn, receiver, arg);
}else{
this._schedule(function(){
fn.call(receiver, arg);
});
}};
Async.prototype.settlePromises=function(promise){
if(this._trampolineEnabled){
AsyncSettlePromises.call(this, promise);
}else{
this._schedule(function(){
promise._settlePromises();
});
}};}
Async.prototype._drainQueue=function(queue){
while (queue.length() > 0){
var fn=queue.shift();
if(typeof fn!=="function"){
fn._settlePromises();
continue;
}
var receiver=queue.shift();
var arg=queue.shift();
fn.call(receiver, arg);
}};
Async.prototype._drainQueues=function (){
this._drainQueue(this._normalQueue);
this._reset();
this._haveDrainedQueues=true;
this._drainQueue(this._lateQueue);
};
Async.prototype._queueTick=function (){
if(!this._isTickUsed){
this._isTickUsed=true;
this._schedule(this.drainQueues);
}};
Async.prototype._reset=function (){
this._isTickUsed=false;
};
module.exports=Async;
module.exports.firstLineError=firstLineError;
},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL, tryConvertToPromise, debug){
var calledBind=false;
var rejectThis=function(_, e){
this._reject(e);
};
var targetRejected=function(e, context){
context.promiseRejectionQueued=true;
context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
};
var bindingResolved=function(thisArg, context){
if(((this._bitField & 50397184)===0)){
this._resolveCallback(context.target);
}};
var bindingRejected=function(e, context){
if(!context.promiseRejectionQueued) this._reject(e);
};
Promise.prototype.bind=function (thisArg){
if(!calledBind){
calledBind=true;
Promise.prototype._propagateFrom=debug.propagateFromFunction();
Promise.prototype._boundValue=debug.boundValueFunction();
}
var maybePromise=tryConvertToPromise(thisArg);
var ret=new Promise(INTERNAL);
ret._propagateFrom(this, 1);
var target=this._target();
ret._setBoundTo(maybePromise);
if(maybePromise instanceof Promise){
var context={
promiseRejectionQueued: false,
promise: ret,
target: target,
bindingPromise: maybePromise
};
target._then(INTERNAL, targetRejected, undefined, ret, context);
maybePromise._then(bindingResolved, bindingRejected, undefined, ret, context);
ret._setOnCancel(maybePromise);
}else{
ret._resolveCallback(target);
}
return ret;
};
Promise.prototype._setBoundTo=function (obj){
if(obj!==undefined){
this._bitField=this._bitField | 2097152;
this._boundTo=obj;
}else{
this._bitField=this._bitField & (~2097152);
}};
Promise.prototype._isBound=function (){
return (this._bitField & 2097152)===2097152;
};
Promise.bind=function (thisArg, value){
return Promise.resolve(value).bind(thisArg);
};};
},{}],4:[function(_dereq_,module,exports){
"use strict";
var old;
if(typeof Promise!=="undefined") old=Promise;
function noConflict(){
try { if(Promise===bluebird) Promise=old; }
catch (e){}
return bluebird;
}
var bluebird=_dereq_("./promise")();
bluebird.noConflict=noConflict;
module.exports=bluebird;
},{"./promise":22}],5:[function(_dereq_,module,exports){
"use strict";
var cr=Object.create;
if(cr){
var callerCache=cr(null);
var getterCache=cr(null);
callerCache[" size"]=getterCache[" size"]=0;
}
module.exports=function(Promise){
var util=_dereq_("./util");
var canEvaluate=util.canEvaluate;
var isIdentifier=util.isIdentifier;
var getMethodCaller;
var getGetter;
if(false){
var makeMethodCaller=function (methodName){
return new Function("ensureMethod", "                                    \n\
return function(obj){                                               \n\
'use strict'                                                     \n\
var len=this.length;                                           \n\
ensureMethod(obj, 'methodName');                                 \n\
switch(len){                                                    \n\
case 1: return obj.methodName(this[0]);                      \n\
case 2: return obj.methodName(this[0], this[1]);             \n\
case 3: return obj.methodName(this[0], this[1], this[2]);    \n\
case 0: return obj.methodName();                             \n\
default:                                                     \n\
return obj.methodName.apply(obj, this);                  \n\
}                                                                \n\
};                                                                   \n\
".replace(/methodName/g, methodName))(ensureMethod);
};
var makeGetter=function (propertyName){
return new Function("obj", "                                             \n\
'use strict';                                                        \n\
return obj.propertyName;                                             \n\
".replace("propertyName", propertyName));
};
var getCompiled=function(name, compiler, cache){
var ret=cache[name];
if(typeof ret!=="function"){
if(!isIdentifier(name)){
return null;
}
ret=compiler(name);
cache[name]=ret;
cache[" size"]++;
if(cache[" size"] > 512){
var keys=Object.keys(cache);
for (var i=0; i < 256; ++i) delete cache[keys[i]];
cache[" size"]=keys.length - 256;
}}
return ret;
};
getMethodCaller=function(name){
return getCompiled(name, makeMethodCaller, callerCache);
};
getGetter=function(name){
return getCompiled(name, makeGetter, getterCache);
};}
function ensureMethod(obj, methodName){
var fn;
if(obj!=null) fn=obj[methodName];
if(typeof fn!=="function"){
var message="Object " + util.classString(obj) + " has no method '" +
util.toString(methodName) + "'";
throw new Promise.TypeError(message);
}
return fn;
}
function caller(obj){
var methodName=this.pop();
var fn=ensureMethod(obj, methodName);
return fn.apply(obj, this);
}
Promise.prototype.call=function (methodName){
var args=[].slice.call(arguments, 1);;
if(false){
if(canEvaluate){
var maybeCaller=getMethodCaller(methodName);
if(maybeCaller!==null){
return this._then(maybeCaller, undefined, undefined, args, undefined);
}}
}
args.push(methodName);
return this._then(caller, undefined, undefined, args, undefined);
};
function namedGetter(obj){
return obj[this];
}
function indexedGetter(obj){
var index=+this;
if(index < 0) index=Math.max(0, index + obj.length);
return obj[index];
}
Promise.prototype.get=function (propertyName){
var isIndex=(typeof propertyName==="number");
var getter;
if(!isIndex){
if(canEvaluate){
var maybeGetter=getGetter(propertyName);
getter=maybeGetter!==null ? maybeGetter:namedGetter;
}else{
getter=namedGetter;
}}else{
getter=indexedGetter;
}
return this._then(getter, undefined, undefined, propertyName, undefined);
};};
},{"./util":36}],6:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, PromiseArray, apiRejection, debug){
var util=_dereq_("./util");
var tryCatch=util.tryCatch;
var errorObj=util.errorObj;
var async=Promise._async;
Promise.prototype["break"]=Promise.prototype.cancel=function(){
if(!debug.cancellation()) return this._warn("cancellation is disabled");
var promise=this;
var child=promise;
while (promise._isCancellable()){
if(!promise._cancelBy(child)){
if(child._isFollowing()){
child._followee().cancel();
}else{
child._cancelBranched();
}
break;
}
var parent=promise._cancellationParent;
if(parent==null||!parent._isCancellable()){
if(promise._isFollowing()){
promise._followee().cancel();
}else{
promise._cancelBranched();
}
break;
}else{
if(promise._isFollowing()) promise._followee().cancel();
promise._setWillBeCancelled();
child=promise;
promise=parent;
}}
};
Promise.prototype._branchHasCancelled=function(){
this._branchesRemainingToCancel--;
};
Promise.prototype._enoughBranchesHaveCancelled=function(){
return this._branchesRemainingToCancel===undefined ||
this._branchesRemainingToCancel <=0;
};
Promise.prototype._cancelBy=function(canceller){
if(canceller===this){
this._branchesRemainingToCancel=0;
this._invokeOnCancel();
return true;
}else{
this._branchHasCancelled();
if(this._enoughBranchesHaveCancelled()){
this._invokeOnCancel();
return true;
}}
return false;
};
Promise.prototype._cancelBranched=function(){
if(this._enoughBranchesHaveCancelled()){
this._cancel();
}};
Promise.prototype._cancel=function(){
if(!this._isCancellable()) return;
this._setCancelled();
async.invoke(this._cancelPromises, this, undefined);
};
Promise.prototype._cancelPromises=function(){
if(this._length() > 0) this._settlePromises();
};
Promise.prototype._unsetOnCancel=function(){
this._onCancelField=undefined;
};
Promise.prototype._isCancellable=function(){
return this.isPending()&&!this._isCancelled();
};
Promise.prototype.isCancellable=function(){
return this.isPending()&&!this.isCancelled();
};
Promise.prototype._doInvokeOnCancel=function(onCancelCallback, internalOnly){
if(util.isArray(onCancelCallback)){
for (var i=0; i < onCancelCallback.length; ++i){
this._doInvokeOnCancel(onCancelCallback[i], internalOnly);
}}else if(onCancelCallback!==undefined){
if(typeof onCancelCallback==="function"){
if(!internalOnly){
var e=tryCatch(onCancelCallback).call(this._boundValue());
if(e===errorObj){
this._attachExtraTrace(e.e);
async.throwLater(e.e);
}}
}else{
onCancelCallback._resultCancelled(this);
}}
};
Promise.prototype._invokeOnCancel=function(){
var onCancelCallback=this._onCancel();
this._unsetOnCancel();
async.invoke(this._doInvokeOnCancel, this, onCancelCallback);
};
Promise.prototype._invokeInternalOnCancel=function(){
if(this._isCancellable()){
this._doInvokeOnCancel(this._onCancel(), true);
this._unsetOnCancel();
}};
Promise.prototype._resultCancelled=function(){
this.cancel();
};};
},{"./util":36}],7:[function(_dereq_,module,exports){
"use strict";
module.exports=function(NEXT_FILTER){
var util=_dereq_("./util");
var getKeys=_dereq_("./es5").keys;
var tryCatch=util.tryCatch;
var errorObj=util.errorObj;
function catchFilter(instances, cb, promise){
return function(e){
var boundTo=promise._boundValue();
predicateLoop: for (var i=0; i < instances.length; ++i){
var item=instances[i];
if(item===Error ||
(item!=null&&item.prototype instanceof Error)){
if(e instanceof item){
return tryCatch(cb).call(boundTo, e);
}}else if(typeof item==="function"){
var matchesPredicate=tryCatch(item).call(boundTo, e);
if(matchesPredicate===errorObj){
return matchesPredicate;
}else if(matchesPredicate){
return tryCatch(cb).call(boundTo, e);
}}else if(util.isObject(e)){
var keys=getKeys(item);
for (var j=0; j < keys.length; ++j){
var key=keys[j];
if(item[key]!=e[key]){
continue predicateLoop;
}}
return tryCatch(cb).call(boundTo, e);
}}
return NEXT_FILTER;
};}
return catchFilter;
};},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise){
var longStackTraces=false;
var contextStack=[];
Promise.prototype._promiseCreated=function(){};
Promise.prototype._pushContext=function(){};
Promise.prototype._popContext=function(){return null;};
Promise._peekContext=Promise.prototype._peekContext=function(){};
function Context(){
this._trace=new Context.CapturedTrace(peekContext());
}
Context.prototype._pushContext=function (){
if(this._trace!==undefined){
this._trace._promiseCreated=null;
contextStack.push(this._trace);
}};
Context.prototype._popContext=function (){
if(this._trace!==undefined){
var trace=contextStack.pop();
var ret=trace._promiseCreated;
trace._promiseCreated=null;
return ret;
}
return null;
};
function createContext(){
if(longStackTraces) return new Context();
}
function peekContext(){
var lastIndex=contextStack.length - 1;
if(lastIndex >=0){
return contextStack[lastIndex];
}
return undefined;
}
Context.CapturedTrace=null;
Context.create=createContext;
Context.deactivateLongStackTraces=function(){};
Context.activateLongStackTraces=function(){
var Promise_pushContext=Promise.prototype._pushContext;
var Promise_popContext=Promise.prototype._popContext;
var Promise_PeekContext=Promise._peekContext;
var Promise_peekContext=Promise.prototype._peekContext;
var Promise_promiseCreated=Promise.prototype._promiseCreated;
Context.deactivateLongStackTraces=function(){
Promise.prototype._pushContext=Promise_pushContext;
Promise.prototype._popContext=Promise_popContext;
Promise._peekContext=Promise_PeekContext;
Promise.prototype._peekContext=Promise_peekContext;
Promise.prototype._promiseCreated=Promise_promiseCreated;
longStackTraces=false;
};
longStackTraces=true;
Promise.prototype._pushContext=Context.prototype._pushContext;
Promise.prototype._popContext=Context.prototype._popContext;
Promise._peekContext=Promise.prototype._peekContext=peekContext;
Promise.prototype._promiseCreated=function(){
var ctx=this._peekContext();
if(ctx&&ctx._promiseCreated==null) ctx._promiseCreated=this;
};};
return Context;
};},{}],9:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, Context){
var getDomain=Promise._getDomain;
var async=Promise._async;
var Warning=_dereq_("./errors").Warning;
var util=_dereq_("./util");
var canAttachTrace=util.canAttachTrace;
var unhandledRejectionHandled;
var possiblyUnhandledRejection;
var bluebirdFramePattern =
/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/;
var nodeFramePattern=/\((?:timers\.js):\d+:\d+\)/;
var parseLinePattern=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/;
var stackFramePattern=null;
var formatStack=null;
var indentStackFrames=false;
var printWarning;
var debugging = !!(util.env("BLUEBIRD_DEBUG")!=0 &&
(true ||
util.env("BLUEBIRD_DEBUG") ||
util.env("NODE_ENV")==="development"));
var warnings = !!(util.env("BLUEBIRD_WARNINGS")!=0 &&
(debugging||util.env("BLUEBIRD_WARNINGS")));
var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES")!=0 &&
(debugging||util.env("BLUEBIRD_LONG_STACK_TRACES")));
var wForgottenReturn=util.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0 &&
(warnings||!!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));
Promise.prototype.suppressUnhandledRejections=function(){
var target=this._target();
target._bitField=((target._bitField & (~1048576)) |
524288);
};
Promise.prototype._ensurePossibleRejectionHandled=function (){
if((this._bitField & 524288)!==0) return;
this._setRejectionIsUnhandled();
var self=this;
setTimeout(function(){
self._notifyUnhandledRejection();
}, 1);
};
Promise.prototype._notifyUnhandledRejectionIsHandled=function (){
fireRejectionEvent("rejectionHandled",
unhandledRejectionHandled, undefined, this);
};
Promise.prototype._setReturnedNonUndefined=function(){
this._bitField=this._bitField | 268435456;
};
Promise.prototype._returnedNonUndefined=function(){
return (this._bitField & 268435456)!==0;
};
Promise.prototype._notifyUnhandledRejection=function (){
if(this._isRejectionUnhandled()){
var reason=this._settledValue();
this._setUnhandledRejectionIsNotified();
fireRejectionEvent("unhandledRejection",
possiblyUnhandledRejection, reason, this);
}};
Promise.prototype._setUnhandledRejectionIsNotified=function (){
this._bitField=this._bitField | 262144;
};
Promise.prototype._unsetUnhandledRejectionIsNotified=function (){
this._bitField=this._bitField & (~262144);
};
Promise.prototype._isUnhandledRejectionNotified=function (){
return (this._bitField & 262144) > 0;
};
Promise.prototype._setRejectionIsUnhandled=function (){
this._bitField=this._bitField | 1048576;
};
Promise.prototype._unsetRejectionIsUnhandled=function (){
this._bitField=this._bitField & (~1048576);
if(this._isUnhandledRejectionNotified()){
this._unsetUnhandledRejectionIsNotified();
this._notifyUnhandledRejectionIsHandled();
}};
Promise.prototype._isRejectionUnhandled=function (){
return (this._bitField & 1048576) > 0;
};
Promise.prototype._warn=function(message, shouldUseOwnTrace, promise){
return warn(message, shouldUseOwnTrace, promise||this);
};
Promise.onPossiblyUnhandledRejection=function (fn){
var domain=getDomain();
possiblyUnhandledRejection =
typeof fn==="function" ? (domain===null ?
fn:util.domainBind(domain, fn))
: undefined;
};
Promise.onUnhandledRejectionHandled=function (fn){
var domain=getDomain();
unhandledRejectionHandled =
typeof fn==="function" ? (domain===null ?
fn:util.domainBind(domain, fn))
: undefined;
};
var disableLongStackTraces=function(){};
Promise.longStackTraces=function (){
if(async.haveItemsQueued()&&!config.longStackTraces){
throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
if(!config.longStackTraces&&longStackTracesIsSupported()){
var Promise_captureStackTrace=Promise.prototype._captureStackTrace;
var Promise_attachExtraTrace=Promise.prototype._attachExtraTrace;
config.longStackTraces=true;
disableLongStackTraces=function(){
if(async.haveItemsQueued()&&!config.longStackTraces){
throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
Promise.prototype._captureStackTrace=Promise_captureStackTrace;
Promise.prototype._attachExtraTrace=Promise_attachExtraTrace;
Context.deactivateLongStackTraces();
async.enableTrampoline();
config.longStackTraces=false;
};
Promise.prototype._captureStackTrace=longStackTracesCaptureStackTrace;
Promise.prototype._attachExtraTrace=longStackTracesAttachExtraTrace;
Context.activateLongStackTraces();
async.disableTrampolineIfNecessary();
}};
Promise.hasLongStackTraces=function (){
return config.longStackTraces&&longStackTracesIsSupported();
};
var fireDomEvent=(function(){
try {
if(typeof CustomEvent==="function"){
var event=new CustomEvent("CustomEvent");
util.global.dispatchEvent(event);
return function(name, event){
var domEvent=new CustomEvent(name.toLowerCase(), {
detail: event,
cancelable: true
});
return !util.global.dispatchEvent(domEvent);
};}else if(typeof Event==="function"){
var event=new Event("CustomEvent");
util.global.dispatchEvent(event);
return function(name, event){
var domEvent=new Event(name.toLowerCase(), {
cancelable: true
});
domEvent.detail=event;
return !util.global.dispatchEvent(domEvent);
};}else{
var event=document.createEvent("CustomEvent");
event.initCustomEvent("testingtheevent", false, true, {});
util.global.dispatchEvent(event);
return function(name, event){
var domEvent=document.createEvent("CustomEvent");
domEvent.initCustomEvent(name.toLowerCase(), false, true,
event);
return !util.global.dispatchEvent(domEvent);
};}} catch (e){}
return function(){
return false;
};})();
var fireGlobalEvent=(function(){
if(util.isNode){
return function(){
return process.emit.apply(process, arguments);
};}else{
if(!util.global){
return function(){
return false;
};}
return function(name){
var methodName="on" + name.toLowerCase();
var method=util.global[methodName];
if(!method) return false;
method.apply(util.global, [].slice.call(arguments, 1));
return true;
};}})();
function generatePromiseLifecycleEventObject(name, promise){
return {promise: promise};}
var eventToObjectGenerator={
promiseCreated: generatePromiseLifecycleEventObject,
promiseFulfilled: generatePromiseLifecycleEventObject,
promiseRejected: generatePromiseLifecycleEventObject,
promiseResolved: generatePromiseLifecycleEventObject,
promiseCancelled: generatePromiseLifecycleEventObject,
promiseChained: function(name, promise, child){
return {promise: promise, child: child};},
warning: function(name, warning){
return {warning: warning};},
unhandledRejection: function (name, reason, promise){
return {reason: reason, promise: promise};},
rejectionHandled: generatePromiseLifecycleEventObject
};
var activeFireEvent=function (name){
var globalEventFired=false;
try {
globalEventFired=fireGlobalEvent.apply(null, arguments);
} catch (e){
async.throwLater(e);
globalEventFired=true;
}
var domEventFired=false;
try {
domEventFired=fireDomEvent(name,
eventToObjectGenerator[name].apply(null, arguments));
} catch (e){
async.throwLater(e);
domEventFired=true;
}
return domEventFired||globalEventFired;
};
Promise.config=function(opts){
opts=Object(opts);
if("longStackTraces" in opts){
if(opts.longStackTraces){
Promise.longStackTraces();
}else if(!opts.longStackTraces&&Promise.hasLongStackTraces()){
disableLongStackTraces();
}}
if("warnings" in opts){
var warningsOption=opts.warnings;
config.warnings = !!warningsOption;
wForgottenReturn=config.warnings;
if(util.isObject(warningsOption)){
if("wForgottenReturn" in warningsOption){
wForgottenReturn = !!warningsOption.wForgottenReturn;
}}
}
if("cancellation" in opts&&opts.cancellation&&!config.cancellation){
if(async.haveItemsQueued()){
throw new Error(
"cannot enable cancellation after promises are in use");
}
Promise.prototype._clearCancellationData =
cancellationClearCancellationData;
Promise.prototype._propagateFrom=cancellationPropagateFrom;
Promise.prototype._onCancel=cancellationOnCancel;
Promise.prototype._setOnCancel=cancellationSetOnCancel;
Promise.prototype._attachCancellationCallback =
cancellationAttachCancellationCallback;
Promise.prototype._execute=cancellationExecute;
propagateFromFunction=cancellationPropagateFrom;
config.cancellation=true;
}
if("monitoring" in opts){
if(opts.monitoring&&!config.monitoring){
config.monitoring=true;
Promise.prototype._fireEvent=activeFireEvent;
}else if(!opts.monitoring&&config.monitoring){
config.monitoring=false;
Promise.prototype._fireEvent=defaultFireEvent;
}}
return Promise;
};
function defaultFireEvent(){ return false; }
Promise.prototype._fireEvent=defaultFireEvent;
Promise.prototype._execute=function(executor, resolve, reject){
try {
executor(resolve, reject);
} catch (e){
return e;
}};
Promise.prototype._onCancel=function (){};
Promise.prototype._setOnCancel=function (handler){ ; };
Promise.prototype._attachCancellationCallback=function(onCancel){
;
};
Promise.prototype._captureStackTrace=function (){};
Promise.prototype._attachExtraTrace=function (){};
Promise.prototype._clearCancellationData=function(){};
Promise.prototype._propagateFrom=function (parent, flags){
;
;
};
function cancellationExecute(executor, resolve, reject){
var promise=this;
try {
executor(resolve, reject, function(onCancel){
if(typeof onCancel!=="function"){
throw new TypeError("onCancel must be a function, got: " +
util.toString(onCancel));
}
promise._attachCancellationCallback(onCancel);
});
} catch (e){
return e;
}}
function cancellationAttachCancellationCallback(onCancel){
if(!this._isCancellable()) return this;
var previousOnCancel=this._onCancel();
if(previousOnCancel!==undefined){
if(util.isArray(previousOnCancel)){
previousOnCancel.push(onCancel);
}else{
this._setOnCancel([previousOnCancel, onCancel]);
}}else{
this._setOnCancel(onCancel);
}}
function cancellationOnCancel(){
return this._onCancelField;
}
function cancellationSetOnCancel(onCancel){
this._onCancelField=onCancel;
}
function cancellationClearCancellationData(){
this._cancellationParent=undefined;
this._onCancelField=undefined;
}
function cancellationPropagateFrom(parent, flags){
if((flags & 1)!==0){
this._cancellationParent=parent;
var branchesRemainingToCancel=parent._branchesRemainingToCancel;
if(branchesRemainingToCancel===undefined){
branchesRemainingToCancel=0;
}
parent._branchesRemainingToCancel=branchesRemainingToCancel + 1;
}
if((flags & 2)!==0&&parent._isBound()){
this._setBoundTo(parent._boundTo);
}}
function bindingPropagateFrom(parent, flags){
if((flags & 2)!==0&&parent._isBound()){
this._setBoundTo(parent._boundTo);
}}
var propagateFromFunction=bindingPropagateFrom;
function boundValueFunction(){
var ret=this._boundTo;
if(ret!==undefined){
if(ret instanceof Promise){
if(ret.isFulfilled()){
return ret.value();
}else{
return undefined;
}}
}
return ret;
}
function longStackTracesCaptureStackTrace(){
this._trace=new CapturedTrace(this._peekContext());
}
function longStackTracesAttachExtraTrace(error, ignoreSelf){
if(canAttachTrace(error)){
var trace=this._trace;
if(trace!==undefined){
if(ignoreSelf) trace=trace._parent;
}
if(trace!==undefined){
trace.attachExtraTrace(error);
}else if(!error.__stackCleaned__){
var parsed=parseStackAndMessage(error);
util.notEnumerableProp(error, "stack",
parsed.message + "\n" + parsed.stack.join("\n"));
util.notEnumerableProp(error, "__stackCleaned__", true);
}}
}
function checkForgottenReturns(returnValue, promiseCreated, name, promise,
parent){
if(returnValue===undefined&&promiseCreated!==null &&
wForgottenReturn){
if(parent!==undefined&&parent._returnedNonUndefined()) return;
if((promise._bitField & 65535)===0) return;
if(name) name=name + " ";
var handlerLine="";
var creatorLine="";
if(promiseCreated._trace){
var traceLines=promiseCreated._trace.stack.split("\n");
var stack=cleanStack(traceLines);
for (var i=stack.length - 1; i >=0; --i){
var line=stack[i];
if(!nodeFramePattern.test(line)){
var lineMatches=line.match(parseLinePattern);
if(lineMatches){
handlerLine="at " + lineMatches[1] +
":" + lineMatches[2] + ":" + lineMatches[3] + " ";
}
break;
}}
if(stack.length > 0){
var firstUserLine=stack[0];
for (var i=0; i < traceLines.length; ++i){
if(traceLines[i]===firstUserLine){
if(i > 0){
creatorLine="\n" + traceLines[i - 1];
}
break;
}}
}}
var msg="a promise was created in a " + name +
"handler " + handlerLine + "but was not returned from it, " +
"see http://goo.gl/rRqMUw" +
creatorLine;
promise._warn(msg, true, promiseCreated);
}}
function deprecated(name, replacement){
var message=name +
" is deprecated and will be removed in a future version.";
if(replacement) message +=" Use " + replacement + " instead.";
return warn(message);
}
function warn(message, shouldUseOwnTrace, promise){
if(!config.warnings) return;
var warning=new Warning(message);
var ctx;
if(shouldUseOwnTrace){
promise._attachExtraTrace(warning);
}else if(config.longStackTraces&&(ctx=Promise._peekContext())){
ctx.attachExtraTrace(warning);
}else{
var parsed=parseStackAndMessage(warning);
warning.stack=parsed.message + "\n" + parsed.stack.join("\n");
}
if(!activeFireEvent("warning", warning)){
formatAndLogError(warning, "", true);
}}
function reconstructStack(message, stacks){
for (var i=0; i < stacks.length - 1; ++i){
stacks[i].push("From previous event:");
stacks[i]=stacks[i].join("\n");
}
if(i < stacks.length){
stacks[i]=stacks[i].join("\n");
}
return message + "\n" + stacks.join("\n");
}
function removeDuplicateOrEmptyJumps(stacks){
for (var i=0; i < stacks.length; ++i){
if(stacks[i].length===0 ||
((i + 1 < stacks.length)&&stacks[i][0]===stacks[i+1][0])){
stacks.splice(i, 1);
i--;
}}
}
function removeCommonRoots(stacks){
var current=stacks[0];
for (var i=1; i < stacks.length; ++i){
var prev=stacks[i];
var currentLastIndex=current.length - 1;
var currentLastLine=current[currentLastIndex];
var commonRootMeetPoint=-1;
for (var j=prev.length - 1; j >=0; --j){
if(prev[j]===currentLastLine){
commonRootMeetPoint=j;
break;
}}
for (var j=commonRootMeetPoint; j >=0; --j){
var line=prev[j];
if(current[currentLastIndex]===line){
current.pop();
currentLastIndex--;
}else{
break;
}}
current=prev;
}}
function cleanStack(stack){
var ret=[];
for (var i=0; i < stack.length; ++i){
var line=stack[i];
var isTraceLine="    (No stack trace)"===line ||
stackFramePattern.test(line);
var isInternalFrame=isTraceLine&&shouldIgnore(line);
if(isTraceLine&&!isInternalFrame){
if(indentStackFrames&&line.charAt(0)!==" "){
line="    " + line;
}
ret.push(line);
}}
return ret;
}
function stackFramesAsArray(error){
var stack=error.stack.replace(/\s+$/g, "").split("\n");
for (var i=0; i < stack.length; ++i){
var line=stack[i];
if("    (No stack trace)"===line||stackFramePattern.test(line)){
break;
}}
if(i > 0&&error.name!="SyntaxError"){
stack=stack.slice(i);
}
return stack;
}
function parseStackAndMessage(error){
var stack=error.stack;
var message=error.toString();
stack=typeof stack==="string"&&stack.length > 0
? stackFramesAsArray(error):["    (No stack trace)"];
return {
message: message,
stack: error.name=="SyntaxError" ? stack:cleanStack(stack)
};}
function formatAndLogError(error, title, isSoft){
if(typeof console!=="undefined"){
var message;
if(util.isObject(error)){
var stack=error.stack;
message=title + formatStack(stack, error);
}else{
message=title + String(error);
}
if(typeof printWarning==="function"){
printWarning(message, isSoft);
}else if(typeof console.log==="function" ||
typeof console.log==="object"){
console.log(message);
}}
}
function fireRejectionEvent(name, localHandler, reason, promise){
var localEventFired=false;
try {
if(typeof localHandler==="function"){
localEventFired=true;
if(name==="rejectionHandled"){
localHandler(promise);
}else{
localHandler(reason, promise);
}}
} catch (e){
async.throwLater(e);
}
if(name==="unhandledRejection"){
if(!activeFireEvent(name, reason, promise)&&!localEventFired){
formatAndLogError(reason, "Unhandled rejection ");
}}else{
activeFireEvent(name, promise);
}}
function formatNonError(obj){
var str;
if(typeof obj==="function"){
str="[function " +
(obj.name||"anonymous") +
"]";
}else{
str=obj&&typeof obj.toString==="function"
? obj.toString():util.toString(obj);
var ruselessToString=/\[object [a-zA-Z0-9$_]+\]/;
if(ruselessToString.test(str)){
try {
var newStr=JSON.stringify(obj);
str=newStr;
}
catch(e){
}}
if(str.length===0){
str="(empty array)";
}}
return ("(<" + snip(str) + ">, no stack trace)");
}
function snip(str){
var maxChars=41;
if(str.length < maxChars){
return str;
}
return str.substr(0, maxChars - 3) + "...";
}
function longStackTracesIsSupported(){
return typeof captureStackTrace==="function";
}
var shouldIgnore=function(){ return false; };
var parseLineInfoRegex=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
function parseLineInfo(line){
var matches=line.match(parseLineInfoRegex);
if(matches){
return {
fileName: matches[1],
line: parseInt(matches[2], 10)
};}}
function setBounds(firstLineError, lastLineError){
if(!longStackTracesIsSupported()) return;
var firstStackLines=firstLineError.stack.split("\n");
var lastStackLines=lastLineError.stack.split("\n");
var firstIndex=-1;
var lastIndex=-1;
var firstFileName;
var lastFileName;
for (var i=0; i < firstStackLines.length; ++i){
var result=parseLineInfo(firstStackLines[i]);
if(result){
firstFileName=result.fileName;
firstIndex=result.line;
break;
}}
for (var i=0; i < lastStackLines.length; ++i){
var result=parseLineInfo(lastStackLines[i]);
if(result){
lastFileName=result.fileName;
lastIndex=result.line;
break;
}}
if(firstIndex < 0||lastIndex < 0||!firstFileName||!lastFileName ||
firstFileName!==lastFileName||firstIndex >=lastIndex){
return;
}
shouldIgnore=function(line){
if(bluebirdFramePattern.test(line)) return true;
var info=parseLineInfo(line);
if(info){
if(info.fileName===firstFileName &&
(firstIndex <=info.line&&info.line <=lastIndex)){
return true;
}}
return false;
};}
function CapturedTrace(parent){
this._parent=parent;
this._promisesCreated=0;
var length=this._length=1 + (parent===undefined ? 0:parent._length);
captureStackTrace(this, CapturedTrace);
if(length > 32) this.uncycle();
}
util.inherits(CapturedTrace, Error);
Context.CapturedTrace=CapturedTrace;
CapturedTrace.prototype.uncycle=function(){
var length=this._length;
if(length < 2) return;
var nodes=[];
var stackToIndex={};
for (var i=0, node=this; node!==undefined; ++i){
nodes.push(node);
node=node._parent;
}
length=this._length=i;
for (var i=length - 1; i >=0; --i){
var stack=nodes[i].stack;
if(stackToIndex[stack]===undefined){
stackToIndex[stack]=i;
}}
for (var i=0; i < length; ++i){
var currentStack=nodes[i].stack;
var index=stackToIndex[currentStack];
if(index!==undefined&&index!==i){
if(index > 0){
nodes[index - 1]._parent=undefined;
nodes[index - 1]._length=1;
}
nodes[i]._parent=undefined;
nodes[i]._length=1;
var cycleEdgeNode=i > 0 ? nodes[i - 1]:this;
if(index < length - 1){
cycleEdgeNode._parent=nodes[index + 1];
cycleEdgeNode._parent.uncycle();
cycleEdgeNode._length =
cycleEdgeNode._parent._length + 1;
}else{
cycleEdgeNode._parent=undefined;
cycleEdgeNode._length=1;
}
var currentChildLength=cycleEdgeNode._length + 1;
for (var j=i - 2; j >=0; --j){
nodes[j]._length=currentChildLength;
currentChildLength++;
}
return;
}}
};
CapturedTrace.prototype.attachExtraTrace=function(error){
if(error.__stackCleaned__) return;
this.uncycle();
var parsed=parseStackAndMessage(error);
var message=parsed.message;
var stacks=[parsed.stack];
var trace=this;
while (trace!==undefined){
stacks.push(cleanStack(trace.stack.split("\n")));
trace=trace._parent;
}
removeCommonRoots(stacks);
removeDuplicateOrEmptyJumps(stacks);
util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
util.notEnumerableProp(error, "__stackCleaned__", true);
};
var captureStackTrace=(function stackDetection(){
var v8stackFramePattern=/^\s*at\s*/;
var v8stackFormatter=function(stack, error){
if(typeof stack==="string") return stack;
if(error.name!==undefined &&
error.message!==undefined){
return error.toString();
}
return formatNonError(error);
};
if(typeof Error.stackTraceLimit==="number" &&
typeof Error.captureStackTrace==="function"){
Error.stackTraceLimit +=6;
stackFramePattern=v8stackFramePattern;
formatStack=v8stackFormatter;
var captureStackTrace=Error.captureStackTrace;
shouldIgnore=function(line){
return bluebirdFramePattern.test(line);
};
return function(receiver, ignoreUntil){
Error.stackTraceLimit +=6;
captureStackTrace(receiver, ignoreUntil);
Error.stackTraceLimit -=6;
};}
var err=new Error();
if(typeof err.stack==="string" &&
err.stack.split("\n")[0].indexOf("stackDetection@") >=0){
stackFramePattern=/@/;
formatStack=v8stackFormatter;
indentStackFrames=true;
return function captureStackTrace(o){
o.stack=new Error().stack;
};}
var hasStackAfterThrow;
try { throw new Error(); }
catch(e){
hasStackAfterThrow=("stack" in e);
}
if(!("stack" in err)&&hasStackAfterThrow &&
typeof Error.stackTraceLimit==="number"){
stackFramePattern=v8stackFramePattern;
formatStack=v8stackFormatter;
return function captureStackTrace(o){
Error.stackTraceLimit +=6;
try { throw new Error(); }
catch(e){ o.stack=e.stack; }
Error.stackTraceLimit -=6;
};}
formatStack=function(stack, error){
if(typeof stack==="string") return stack;
if((typeof error==="object" ||
typeof error==="function") &&
error.name!==undefined &&
error.message!==undefined){
return error.toString();
}
return formatNonError(error);
};
return null;
})([]);
if(typeof console!=="undefined"&&typeof console.warn!=="undefined"){
printWarning=function (message){
console.warn(message);
};
if(util.isNode&&process.stderr.isTTY){
printWarning=function(message, isSoft){
var color=isSoft ? "\u001b[33m":"\u001b[31m";
console.warn(color + message + "\u001b[0m\n");
};}else if(!util.isNode&&typeof (new Error().stack)==="string"){
printWarning=function(message, isSoft){
console.warn("%c" + message,
isSoft ? "color: darkorange":"color: red");
};}}
var config={
warnings: warnings,
longStackTraces: false,
cancellation: false,
monitoring: false
};
if(longStackTraces) Promise.longStackTraces();
return {
longStackTraces: function(){
return config.longStackTraces;
},
warnings: function(){
return config.warnings;
},
cancellation: function(){
return config.cancellation;
},
monitoring: function(){
return config.monitoring;
},
propagateFromFunction: function(){
return propagateFromFunction;
},
boundValueFunction: function(){
return boundValueFunction;
},
checkForgottenReturns: checkForgottenReturns,
setBounds: setBounds,
warn: warn,
deprecated: deprecated,
CapturedTrace: CapturedTrace,
fireDomEvent: fireDomEvent,
fireGlobalEvent: fireGlobalEvent
};};
},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise){
function returner(){
return this.value;
}
function thrower(){
throw this.reason;
}
Promise.prototype["return"] =
Promise.prototype.thenReturn=function (value){
if(value instanceof Promise) value.suppressUnhandledRejections();
return this._then(returner, undefined, undefined, {value: value}, undefined);
};
Promise.prototype["throw"] =
Promise.prototype.thenThrow=function (reason){
return this._then(thrower, undefined, undefined, {reason: reason}, undefined);
};
Promise.prototype.catchThrow=function (reason){
if(arguments.length <=1){
return this._then(undefined, thrower, undefined, {reason: reason}, undefined);
}else{
var _reason=arguments[1];
var handler=function(){throw _reason;};
return this.caught(reason, handler);
}};
Promise.prototype.catchReturn=function (value){
if(arguments.length <=1){
if(value instanceof Promise) value.suppressUnhandledRejections();
return this._then(undefined, returner, undefined, {value: value}, undefined);
}else{
var _value=arguments[1];
if(_value instanceof Promise) _value.suppressUnhandledRejections();
var handler=function(){return _value;};
return this.caught(value, handler);
}};};
},{}],11:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL){
var PromiseReduce=Promise.reduce;
var PromiseAll=Promise.all;
function promiseAllThis(){
return PromiseAll(this);
}
function PromiseMapSeries(promises, fn){
return PromiseReduce(promises, fn, INTERNAL, INTERNAL);
}
Promise.prototype.each=function (fn){
return PromiseReduce(this, fn, INTERNAL, 0)
._then(promiseAllThis, undefined, undefined, this, undefined);
};
Promise.prototype.mapSeries=function (fn){
return PromiseReduce(this, fn, INTERNAL, INTERNAL);
};
Promise.each=function (promises, fn){
return PromiseReduce(promises, fn, INTERNAL, 0)
._then(promiseAllThis, undefined, undefined, promises, undefined);
};
Promise.mapSeries=PromiseMapSeries;
};},{}],12:[function(_dereq_,module,exports){
"use strict";
var es5=_dereq_("./es5");
var Objectfreeze=es5.freeze;
var util=_dereq_("./util");
var inherits=util.inherits;
var notEnumerableProp=util.notEnumerableProp;
function subError(nameProperty, defaultMessage){
function SubError(message){
if(!(this instanceof SubError)) return new SubError(message);
notEnumerableProp(this, "message",
typeof message==="string" ? message:defaultMessage);
notEnumerableProp(this, "name", nameProperty);
if(Error.captureStackTrace){
Error.captureStackTrace(this, this.constructor);
}else{
Error.call(this);
}}
inherits(SubError, Error);
return SubError;
}
var _TypeError, _RangeError;
var Warning=subError("Warning", "warning");
var CancellationError=subError("CancellationError", "cancellation error");
var TimeoutError=subError("TimeoutError", "timeout error");
var AggregateError=subError("AggregateError", "aggregate error");
try {
_TypeError=TypeError;
_RangeError=RangeError;
} catch(e){
_TypeError=subError("TypeError", "type error");
_RangeError=subError("RangeError", "range error");
}
var methods=("join pop push shift unshift slice filter forEach some " +
"every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");
for (var i=0; i < methods.length; ++i){
if(typeof Array.prototype[methods[i]]==="function"){
AggregateError.prototype[methods[i]]=Array.prototype[methods[i]];
}}
es5.defineProperty(AggregateError.prototype, "length", {
value: 0,
configurable: false,
writable: true,
enumerable: true
});
AggregateError.prototype["isOperational"]=true;
var level=0;
AggregateError.prototype.toString=function(){
var indent=Array(level * 4 + 1).join(" ");
var ret="\n" + indent + "AggregateError of:" + "\n";
level++;
indent=Array(level * 4 + 1).join(" ");
for (var i=0; i < this.length; ++i){
var str=this[i]===this ? "[Circular AggregateError]":this[i] + "";
var lines=str.split("\n");
for (var j=0; j < lines.length; ++j){
lines[j]=indent + lines[j];
}
str=lines.join("\n");
ret +=str + "\n";
}
level--;
return ret;
};
function OperationalError(message){
if(!(this instanceof OperationalError))
return new OperationalError(message);
notEnumerableProp(this, "name", "OperationalError");
notEnumerableProp(this, "message", message);
this.cause=message;
this["isOperational"]=true;
if(message instanceof Error){
notEnumerableProp(this, "message", message.message);
notEnumerableProp(this, "stack", message.stack);
}else if(Error.captureStackTrace){
Error.captureStackTrace(this, this.constructor);
}}
inherits(OperationalError, Error);
var errorTypes=Error["__BluebirdErrorTypes__"];
if(!errorTypes){
errorTypes=Objectfreeze({
CancellationError: CancellationError,
TimeoutError: TimeoutError,
OperationalError: OperationalError,
RejectionError: OperationalError,
AggregateError: AggregateError
});
es5.defineProperty(Error, "__BluebirdErrorTypes__", {
value: errorTypes,
writable: false,
enumerable: false,
configurable: false
});
}
module.exports={
Error: Error,
TypeError: _TypeError,
RangeError: _RangeError,
CancellationError: errorTypes.CancellationError,
OperationalError: errorTypes.OperationalError,
TimeoutError: errorTypes.TimeoutError,
AggregateError: errorTypes.AggregateError,
Warning: Warning
};},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){
var isES5=(function(){
"use strict";
return this===undefined;
})();
if(isES5){
module.exports={
freeze: Object.freeze,
defineProperty: Object.defineProperty,
getDescriptor: Object.getOwnPropertyDescriptor,
keys: Object.keys,
names: Object.getOwnPropertyNames,
getPrototypeOf: Object.getPrototypeOf,
isArray: Array.isArray,
isES5: isES5,
propertyIsWritable: function(obj, prop){
var descriptor=Object.getOwnPropertyDescriptor(obj, prop);
return !!(!descriptor||descriptor.writable||descriptor.set);
}};}else{
var has={}.hasOwnProperty;
var str={}.toString;
var proto={}.constructor.prototype;
var ObjectKeys=function (o){
var ret=[];
for (var key in o){
if(has.call(o, key)){
ret.push(key);
}}
return ret;
};
var ObjectGetDescriptor=function(o, key){
return {value: o[key]};};
var ObjectDefineProperty=function (o, key, desc){
o[key]=desc.value;
return o;
};
var ObjectFreeze=function (obj){
return obj;
};
var ObjectGetPrototypeOf=function (obj){
try {
return Object(obj).constructor.prototype;
}
catch (e){
return proto;
}};
var ArrayIsArray=function (obj){
try {
return str.call(obj)==="[object Array]";
}
catch(e){
return false;
}};
module.exports={
isArray: ArrayIsArray,
keys: ObjectKeys,
names: ObjectKeys,
defineProperty: ObjectDefineProperty,
getDescriptor: ObjectGetDescriptor,
freeze: ObjectFreeze,
getPrototypeOf: ObjectGetPrototypeOf,
isES5: isES5,
propertyIsWritable: function(){
return true;
}};}},{}],14:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL){
var PromiseMap=Promise.map;
Promise.prototype.filter=function (fn, options){
return PromiseMap(this, fn, options, INTERNAL);
};
Promise.filter=function (promises, fn, options){
return PromiseMap(promises, fn, options, INTERNAL);
};};
},{}],15:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, tryConvertToPromise, NEXT_FILTER){
var util=_dereq_("./util");
var CancellationError=Promise.CancellationError;
var errorObj=util.errorObj;
var catchFilter=_dereq_("./catch_filter")(NEXT_FILTER);
function PassThroughHandlerContext(promise, type, handler){
this.promise=promise;
this.type=type;
this.handler=handler;
this.called=false;
this.cancelPromise=null;
}
PassThroughHandlerContext.prototype.isFinallyHandler=function(){
return this.type===0;
};
function FinallyHandlerCancelReaction(finallyHandler){
this.finallyHandler=finallyHandler;
}
FinallyHandlerCancelReaction.prototype._resultCancelled=function(){
checkCancel(this.finallyHandler);
};
function checkCancel(ctx, reason){
if(ctx.cancelPromise!=null){
if(arguments.length > 1){
ctx.cancelPromise._reject(reason);
}else{
ctx.cancelPromise._cancel();
}
ctx.cancelPromise=null;
return true;
}
return false;
}
function succeed(){
return finallyHandler.call(this, this.promise._target()._settledValue());
}
function fail(reason){
if(checkCancel(this, reason)) return;
errorObj.e=reason;
return errorObj;
}
function finallyHandler(reasonOrValue){
var promise=this.promise;
var handler=this.handler;
if(!this.called){
this.called=true;
var ret=this.isFinallyHandler()
? handler.call(promise._boundValue())
: handler.call(promise._boundValue(), reasonOrValue);
if(ret===NEXT_FILTER){
return ret;
}else if(ret!==undefined){
promise._setReturnedNonUndefined();
var maybePromise=tryConvertToPromise(ret, promise);
if(maybePromise instanceof Promise){
if(this.cancelPromise!=null){
if(maybePromise._isCancelled()){
var reason =
new CancellationError("late cancellation observer");
promise._attachExtraTrace(reason);
errorObj.e=reason;
return errorObj;
}else if(maybePromise.isPending()){
maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this));
}}
return maybePromise._then(succeed, fail, undefined, this, undefined);
}}
}
if(promise.isRejected()){
checkCancel(this);
errorObj.e=reasonOrValue;
return errorObj;
}else{
checkCancel(this);
return reasonOrValue;
}}
Promise.prototype._passThrough=function(handler, type, success, fail){
if(typeof handler!=="function") return this.then();
return this._then(success,
fail,
undefined,
new PassThroughHandlerContext(this, type, handler),
undefined);
};
Promise.prototype.lastly =
Promise.prototype["finally"]=function (handler){
return this._passThrough(handler,
0,
finallyHandler,
finallyHandler);
};
Promise.prototype.tap=function (handler){
return this._passThrough(handler, 1, finallyHandler);
};
Promise.prototype.tapCatch=function (handlerOrPredicate){
var len=arguments.length;
if(len===1){
return this._passThrough(handlerOrPredicate,
1,
undefined,
finallyHandler);
}else{
var catchInstances=new Array(len - 1),
j=0, i;
for (i=0; i < len - 1; ++i){
var item=arguments[i];
if(util.isObject(item)){
catchInstances[j++]=item;
}else{
return Promise.reject(new TypeError(
"tapCatch statement predicate: "
+ "expecting an object but got " + util.classString(item)
));
}}
catchInstances.length=j;
var handler=arguments[i];
return this._passThrough(catchFilter(catchInstances, handler, this),
1,
undefined,
finallyHandler);
}};
return PassThroughHandlerContext;
};},{"./catch_filter":7,"./util":36}],16:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise,
apiRejection,
INTERNAL,
tryConvertToPromise,
Proxyable,
debug){
var errors=_dereq_("./errors");
var TypeError=errors.TypeError;
var util=_dereq_("./util");
var errorObj=util.errorObj;
var tryCatch=util.tryCatch;
var yieldHandlers=[];
function promiseFromYieldHandler(value, yieldHandlers, traceParent){
for (var i=0; i < yieldHandlers.length; ++i){
traceParent._pushContext();
var result=tryCatch(yieldHandlers[i])(value);
traceParent._popContext();
if(result===errorObj){
traceParent._pushContext();
var ret=Promise.reject(errorObj.e);
traceParent._popContext();
return ret;
}
var maybePromise=tryConvertToPromise(result, traceParent);
if(maybePromise instanceof Promise) return maybePromise;
}
return null;
}
function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack){
if(debug.cancellation()){
var internal=new Promise(INTERNAL);
var _finallyPromise=this._finallyPromise=new Promise(INTERNAL);
this._promise=internal.lastly(function(){
return _finallyPromise;
});
internal._captureStackTrace();
internal._setOnCancel(this);
}else{
var promise=this._promise=new Promise(INTERNAL);
promise._captureStackTrace();
}
this._stack=stack;
this._generatorFunction=generatorFunction;
this._receiver=receiver;
this._generator=undefined;
this._yieldHandlers=typeof yieldHandler==="function"
? [yieldHandler].concat(yieldHandlers)
: yieldHandlers;
this._yieldedPromise=null;
this._cancellationPhase=false;
}
util.inherits(PromiseSpawn, Proxyable);
PromiseSpawn.prototype._isResolved=function(){
return this._promise===null;
};
PromiseSpawn.prototype._cleanup=function(){
this._promise=this._generator=null;
if(debug.cancellation()&&this._finallyPromise!==null){
this._finallyPromise._fulfill();
this._finallyPromise=null;
}};
PromiseSpawn.prototype._promiseCancelled=function(){
if(this._isResolved()) return;
var implementsReturn=typeof this._generator["return"]!=="undefined";
var result;
if(!implementsReturn){
var reason=new Promise.CancellationError("generator .return() sentinel");
Promise.coroutine.returnSentinel=reason;
this._promise._attachExtraTrace(reason);
this._promise._pushContext();
result=tryCatch(this._generator["throw"]).call(this._generator,
reason);
this._promise._popContext();
}else{
this._promise._pushContext();
result=tryCatch(this._generator["return"]).call(this._generator,
undefined);
this._promise._popContext();
}
this._cancellationPhase=true;
this._yieldedPromise=null;
this._continue(result);
};
PromiseSpawn.prototype._promiseFulfilled=function(value){
this._yieldedPromise=null;
this._promise._pushContext();
var result=tryCatch(this._generator.next).call(this._generator, value);
this._promise._popContext();
this._continue(result);
};
PromiseSpawn.prototype._promiseRejected=function(reason){
this._yieldedPromise=null;
this._promise._attachExtraTrace(reason);
this._promise._pushContext();
var result=tryCatch(this._generator["throw"])
.call(this._generator, reason);
this._promise._popContext();
this._continue(result);
};
PromiseSpawn.prototype._resultCancelled=function(){
if(this._yieldedPromise instanceof Promise){
var promise=this._yieldedPromise;
this._yieldedPromise=null;
promise.cancel();
}};
PromiseSpawn.prototype.promise=function (){
return this._promise;
};
PromiseSpawn.prototype._run=function (){
this._generator=this._generatorFunction.call(this._receiver);
this._receiver =
this._generatorFunction=undefined;
this._promiseFulfilled(undefined);
};
PromiseSpawn.prototype._continue=function (result){
var promise=this._promise;
if(result===errorObj){
this._cleanup();
if(this._cancellationPhase){
return promise.cancel();
}else{
return promise._rejectCallback(result.e, false);
}}
var value=result.value;
if(result.done===true){
this._cleanup();
if(this._cancellationPhase){
return promise.cancel();
}else{
return promise._resolveCallback(value);
}}else{
var maybePromise=tryConvertToPromise(value, this._promise);
if(!(maybePromise instanceof Promise)){
maybePromise =
promiseFromYieldHandler(maybePromise,
this._yieldHandlers,
this._promise);
if(maybePromise===null){
this._promiseRejected(new TypeError(
"A value %s was yielded that could not be treated as a promise\u000a\u000a    See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) +
"From coroutine:\u000a" +
this._stack.split("\n").slice(1, -7).join("\n")
)
);
return;
}}
maybePromise=maybePromise._target();
var bitField=maybePromise._bitField;
;
if(((bitField & 50397184)===0)){
this._yieldedPromise=maybePromise;
maybePromise._proxy(this, null);
}else if(((bitField & 33554432)!==0)){
Promise._async.invoke(this._promiseFulfilled, this, maybePromise._value()
);
}else if(((bitField & 16777216)!==0)){
Promise._async.invoke(this._promiseRejected, this, maybePromise._reason()
);
}else{
this._promiseCancelled();
}}
};
Promise.coroutine=function (generatorFunction, options){
if(typeof generatorFunction!=="function"){
throw new TypeError("generatorFunction must be a function\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
var yieldHandler=Object(options).yieldHandler;
var PromiseSpawn$=PromiseSpawn;
var stack=new Error().stack;
return function (){
var generator=generatorFunction.apply(this, arguments);
var spawn=new PromiseSpawn$(undefined, undefined, yieldHandler,
stack);
var ret=spawn.promise();
spawn._generator=generator;
spawn._promiseFulfilled(undefined);
return ret;
};};
Promise.coroutine.addYieldHandler=function(fn){
if(typeof fn!=="function"){
throw new TypeError("expecting a function but got " + util.classString(fn));
}
yieldHandlers.push(fn);
};
Promise.spawn=function (generatorFunction){
debug.deprecated("Promise.spawn()", "Promise.coroutine()");
if(typeof generatorFunction!=="function"){
return apiRejection("generatorFunction must be a function\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
var spawn=new PromiseSpawn(generatorFunction, this);
var ret=spawn.promise();
spawn._run(Promise.spawn);
return ret;
};};
},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){
"use strict";
module.exports =
function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async,
getDomain){
var util=_dereq_("./util");
var canEvaluate=util.canEvaluate;
var tryCatch=util.tryCatch;
var errorObj=util.errorObj;
var reject;
if(false){
if(canEvaluate){
var thenCallback=function(i){
return new Function("value", "holder", "                             \n\
'use strict';                                                    \n\
holder.pIndex=value;                                           \n\
holder.checkFulfillment(this);                                   \n\
".replace(/Index/g, i));
};
var promiseSetter=function(i){
return new Function("promise", "holder", "                           \n\
'use strict';                                                    \n\
holder.pIndex=promise;                                         \n\
".replace(/Index/g, i));
};
var generateHolderClass=function(total){
var props=new Array(total);
for (var i=0; i < props.length; ++i){
props[i]="this.p" + (i+1);
}
var assignment=props.join("=") + "=null;";
var cancellationCode="var promise;\n" + props.map(function(prop){
return "                                                         \n\
promise=" + prop + ";                                      \n\
if(promise instanceof Promise){                            \n\
promise.cancel();                                        \n\
}                                                            \n\
";
}).join("\n");
var passedArguments=props.join(", ");
var name="Holder$" + total;
var code="return function(tryCatch, errorObj, Promise, async){    \n\
'use strict';                                                    \n\
function [TheName](fn){                                         \n\
[TheProperties]                                              \n\
this.fn=fn;                                                \n\
this.asyncNeeded=true;                                     \n\
this.now=0;                                                \n\
}                                                                \n\
\n\
[TheName].prototype._callFunction=function(promise){          \n\
promise._pushContext();                                      \n\
var ret=tryCatch(this.fn)([ThePassedArguments]);           \n\
promise._popContext();                                       \n\
if(ret===errorObj){                                      \n\
promise._rejectCallback(ret.e, false);                   \n\
}else{                                                     \n\
promise._resolveCallback(ret);                           \n\
}                                                            \n\
};                                                               \n\
\n\
[TheName].prototype.checkFulfillment=function(promise){       \n\
var now=++this.now;                                        \n\
if(now===[TheTotal]){                                    \n\
if(this.asyncNeeded){                                  \n\
async.invoke(this._callFunction, this, promise);     \n\
}else{                                                 \n\
this._callFunction(promise);                         \n\
}                                                        \n\
\n\
}                                                            \n\
};                                                               \n\
\n\
[TheName].prototype._resultCancelled=function(){              \n\
[CancellationCode]                                           \n\
};                                                               \n\
\n\
return [TheName];                                                \n\
}(tryCatch, errorObj, Promise, async);                               \n\
";
code=code.replace(/\[TheName\]/g, name)
.replace(/\[TheTotal\]/g, total)
.replace(/\[ThePassedArguments\]/g, passedArguments)
.replace(/\[TheProperties\]/g, assignment)
.replace(/\[CancellationCode\]/g, cancellationCode);
return new Function("tryCatch", "errorObj", "Promise", "async", code)
(tryCatch, errorObj, Promise, async);
};
var holderClasses=[];
var thenCallbacks=[];
var promiseSetters=[];
for (var i=0; i < 8; ++i){
holderClasses.push(generateHolderClass(i + 1));
thenCallbacks.push(thenCallback(i + 1));
promiseSetters.push(promiseSetter(i + 1));
}
reject=function (reason){
this._reject(reason);
};}}
Promise.join=function (){
var last=arguments.length - 1;
var fn;
if(last > 0&&typeof arguments[last]==="function"){
fn=arguments[last];
if(false){
if(last <=8&&canEvaluate){
var ret=new Promise(INTERNAL);
ret._captureStackTrace();
var HolderClass=holderClasses[last - 1];
var holder=new HolderClass(fn);
var callbacks=thenCallbacks;
for (var i=0; i < last; ++i){
var maybePromise=tryConvertToPromise(arguments[i], ret);
if(maybePromise instanceof Promise){
maybePromise=maybePromise._target();
var bitField=maybePromise._bitField;
;
if(((bitField & 50397184)===0)){
maybePromise._then(callbacks[i], reject,
undefined, ret, holder);
promiseSetters[i](maybePromise, holder);
holder.asyncNeeded=false;
}else if(((bitField & 33554432)!==0)){
callbacks[i].call(ret,
maybePromise._value(), holder);
}else if(((bitField & 16777216)!==0)){
ret._reject(maybePromise._reason());
}else{
ret._cancel();
}}else{
callbacks[i].call(ret, maybePromise, holder);
}}
if(!ret._isFateSealed()){
if(holder.asyncNeeded){
var domain=getDomain();
if(domain!==null){
holder.fn=util.domainBind(domain, holder.fn);
}}
ret._setAsyncGuaranteed();
ret._setOnCancel(holder);
}
return ret;
}}
}
var args=[].slice.call(arguments);;
if(fn) args.pop();
var ret=new PromiseArray(args).promise();
return fn!==undefined ? ret.spread(fn):ret;
};};
},{"./util":36}],18:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise,
PromiseArray,
apiRejection,
tryConvertToPromise,
INTERNAL,
debug){
var getDomain=Promise._getDomain;
var util=_dereq_("./util");
var tryCatch=util.tryCatch;
var errorObj=util.errorObj;
var async=Promise._async;
function MappingPromiseArray(promises, fn, limit, _filter){
this.constructor$(promises);
this._promise._captureStackTrace();
var domain=getDomain();
this._callback=domain===null ? fn:util.domainBind(domain, fn);
this._preservedValues=_filter===INTERNAL
? new Array(this.length())
: null;
this._limit=limit;
this._inFlight=0;
this._queue=[];
async.invoke(this._asyncInit, this, undefined);
}
util.inherits(MappingPromiseArray, PromiseArray);
MappingPromiseArray.prototype._asyncInit=function(){
this._init$(undefined, -2);
};
MappingPromiseArray.prototype._init=function (){};
MappingPromiseArray.prototype._promiseFulfilled=function (value, index){
var values=this._values;
var length=this.length();
var preservedValues=this._preservedValues;
var limit=this._limit;
if(index < 0){
index=(index * -1) - 1;
values[index]=value;
if(limit >=1){
this._inFlight--;
this._drainQueue();
if(this._isResolved()) return true;
}}else{
if(limit >=1&&this._inFlight >=limit){
values[index]=value;
this._queue.push(index);
return false;
}
if(preservedValues!==null) preservedValues[index]=value;
var promise=this._promise;
var callback=this._callback;
var receiver=promise._boundValue();
promise._pushContext();
var ret=tryCatch(callback).call(receiver, value, index, length);
var promiseCreated=promise._popContext();
debug.checkForgottenReturns(ret,
promiseCreated,
preservedValues!==null ? "Promise.filter":"Promise.map",
promise
);
if(ret===errorObj){
this._reject(ret.e);
return true;
}
var maybePromise=tryConvertToPromise(ret, this._promise);
if(maybePromise instanceof Promise){
maybePromise=maybePromise._target();
var bitField=maybePromise._bitField;
;
if(((bitField & 50397184)===0)){
if(limit >=1) this._inFlight++;
values[index]=maybePromise;
maybePromise._proxy(this, (index + 1) * -1);
return false;
}else if(((bitField & 33554432)!==0)){
ret=maybePromise._value();
}else if(((bitField & 16777216)!==0)){
this._reject(maybePromise._reason());
return true;
}else{
this._cancel();
return true;
}}
values[index]=ret;
}
var totalResolved=++this._totalResolved;
if(totalResolved >=length){
if(preservedValues!==null){
this._filter(values, preservedValues);
}else{
this._resolve(values);
}
return true;
}
return false;
};
MappingPromiseArray.prototype._drainQueue=function (){
var queue=this._queue;
var limit=this._limit;
var values=this._values;
while (queue.length > 0&&this._inFlight < limit){
if(this._isResolved()) return;
var index=queue.pop();
this._promiseFulfilled(values[index], index);
}};
MappingPromiseArray.prototype._filter=function (booleans, values){
var len=values.length;
var ret=new Array(len);
var j=0;
for (var i=0; i < len; ++i){
if(booleans[i]) ret[j++]=values[i];
}
ret.length=j;
this._resolve(ret);
};
MappingPromiseArray.prototype.preservedValues=function (){
return this._preservedValues;
};
function map(promises, fn, options, _filter){
if(typeof fn!=="function"){
return apiRejection("expecting a function but got " + util.classString(fn));
}
var limit=0;
if(options!==undefined){
if(typeof options==="object"&&options!==null){
if(typeof options.concurrency!=="number"){
return Promise.reject(new TypeError("'concurrency' must be a number but it is " +
util.classString(options.concurrency)));
}
limit=options.concurrency;
}else{
return Promise.reject(new TypeError(
"options argument must be an object but it is " +
util.classString(options)));
}}
limit=typeof limit==="number" &&
isFinite(limit)&&limit >=1 ? limit:0;
return new MappingPromiseArray(promises, fn, limit, _filter).promise();
}
Promise.prototype.map=function (fn, options){
return map(this, fn, options, null);
};
Promise.map=function (promises, fn, options, _filter){
return map(promises, fn, options, _filter);
};};
},{"./util":36}],19:[function(_dereq_,module,exports){
"use strict";
module.exports =
function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug){
var util=_dereq_("./util");
var tryCatch=util.tryCatch;
Promise.method=function (fn){
if(typeof fn!=="function"){
throw new Promise.TypeError("expecting a function but got " + util.classString(fn));
}
return function (){
var ret=new Promise(INTERNAL);
ret._captureStackTrace();
ret._pushContext();
var value=tryCatch(fn).apply(this, arguments);
var promiseCreated=ret._popContext();
debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret);
ret._resolveFromSyncValue(value);
return ret;
};};
Promise.attempt=Promise["try"]=function (fn){
if(typeof fn!=="function"){
return apiRejection("expecting a function but got " + util.classString(fn));
}
var ret=new Promise(INTERNAL);
ret._captureStackTrace();
ret._pushContext();
var value;
if(arguments.length > 1){
debug.deprecated("calling Promise.try with more than 1 argument");
var arg=arguments[1];
var ctx=arguments[2];
value=util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)
: tryCatch(fn).call(ctx, arg);
}else{
value=tryCatch(fn)();
}
var promiseCreated=ret._popContext();
debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret);
ret._resolveFromSyncValue(value);
return ret;
};
Promise.prototype._resolveFromSyncValue=function (value){
if(value===util.errorObj){
this._rejectCallback(value.e, false);
}else{
this._resolveCallback(value, true);
}};};
},{"./util":36}],20:[function(_dereq_,module,exports){
"use strict";
var util=_dereq_("./util");
var maybeWrapAsError=util.maybeWrapAsError;
var errors=_dereq_("./errors");
var OperationalError=errors.OperationalError;
var es5=_dereq_("./es5");
function isUntypedError(obj){
return obj instanceof Error &&
es5.getPrototypeOf(obj)===Error.prototype;
}
var rErrorKey=/^(?:name|message|stack|cause)$/;
function wrapAsOperationalError(obj){
var ret;
if(isUntypedError(obj)){
ret=new OperationalError(obj);
ret.name=obj.name;
ret.message=obj.message;
ret.stack=obj.stack;
var keys=es5.keys(obj);
for (var i=0; i < keys.length; ++i){
var key=keys[i];
if(!rErrorKey.test(key)){
ret[key]=obj[key];
}}
return ret;
}
util.markAsOriginatingFromRejection(obj);
return obj;
}
function nodebackForPromise(promise, multiArgs){
return function(err, value){
if(promise===null) return;
if(err){
var wrapped=wrapAsOperationalError(maybeWrapAsError(err));
promise._attachExtraTrace(wrapped);
promise._reject(wrapped);
}else if(!multiArgs){
promise._fulfill(value);
}else{
var args=[].slice.call(arguments, 1);;
promise._fulfill(args);
}
promise=null;
};}
module.exports=nodebackForPromise;
},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise){
var util=_dereq_("./util");
var async=Promise._async;
var tryCatch=util.tryCatch;
var errorObj=util.errorObj;
function spreadAdapter(val, nodeback){
var promise=this;
if(!util.isArray(val)) return successAdapter.call(promise, val, nodeback);
var ret =
tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));
if(ret===errorObj){
async.throwLater(ret.e);
}}
function successAdapter(val, nodeback){
var promise=this;
var receiver=promise._boundValue();
var ret=val===undefined
? tryCatch(nodeback).call(receiver, null)
: tryCatch(nodeback).call(receiver, null, val);
if(ret===errorObj){
async.throwLater(ret.e);
}}
function errorAdapter(reason, nodeback){
var promise=this;
if(!reason){
var newReason=new Error(reason + "");
newReason.cause=reason;
reason=newReason;
}
var ret=tryCatch(nodeback).call(promise._boundValue(), reason);
if(ret===errorObj){
async.throwLater(ret.e);
}}
Promise.prototype.asCallback=Promise.prototype.nodeify=function (nodeback,
options){
if(typeof nodeback=="function"){
var adapter=successAdapter;
if(options!==undefined&&Object(options).spread){
adapter=spreadAdapter;
}
this._then(adapter,
errorAdapter,
undefined,
this,
nodeback
);
}
return this;
};};
},{"./util":36}],22:[function(_dereq_,module,exports){
"use strict";
module.exports=function(){
var makeSelfResolutionError=function (){
return new TypeError("circular promise resolution chain\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
};
var reflectHandler=function(){
return new Promise.PromiseInspection(this._target());
};
var apiRejection=function(msg){
return Promise.reject(new TypeError(msg));
};
function Proxyable(){}
var UNDEFINED_BINDING={};
var util=_dereq_("./util");
var getDomain;
if(util.isNode){
getDomain=function(){
var ret=process.domain;
if(ret===undefined) ret=null;
return ret;
};}else{
getDomain=function(){
return null;
};}
util.notEnumerableProp(Promise, "_getDomain", getDomain);
var es5=_dereq_("./es5");
var Async=_dereq_("./async");
var async=new Async();
es5.defineProperty(Promise, "_async", {value: async});
var errors=_dereq_("./errors");
var TypeError=Promise.TypeError=errors.TypeError;
Promise.RangeError=errors.RangeError;
var CancellationError=Promise.CancellationError=errors.CancellationError;
Promise.TimeoutError=errors.TimeoutError;
Promise.OperationalError=errors.OperationalError;
Promise.RejectionError=errors.OperationalError;
Promise.AggregateError=errors.AggregateError;
var INTERNAL=function(){};
var APPLY={};
var NEXT_FILTER={};
var tryConvertToPromise=_dereq_("./thenables")(Promise, INTERNAL);
var PromiseArray =
_dereq_("./promise_array")(Promise, INTERNAL,
tryConvertToPromise, apiRejection, Proxyable);
var Context=_dereq_("./context")(Promise);
var createContext=Context.create;
var debug=_dereq_("./debuggability")(Promise, Context);
var CapturedTrace=debug.CapturedTrace;
var PassThroughHandlerContext =
_dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER);
var catchFilter=_dereq_("./catch_filter")(NEXT_FILTER);
var nodebackForPromise=_dereq_("./nodeback");
var errorObj=util.errorObj;
var tryCatch=util.tryCatch;
function check(self, executor){
if(self==null||self.constructor!==Promise){
throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
if(typeof executor!=="function"){
throw new TypeError("expecting a function but got " + util.classString(executor));
}}
function Promise(executor){
if(executor!==INTERNAL){
check(this, executor);
}
this._bitField=0;
this._fulfillmentHandler0=undefined;
this._rejectionHandler0=undefined;
this._promise0=undefined;
this._receiver0=undefined;
this._resolveFromExecutor(executor);
this._promiseCreated();
this._fireEvent("promiseCreated", this);
}
Promise.prototype.toString=function (){
return "[object Promise]";
};
Promise.prototype.caught=Promise.prototype["catch"]=function (fn){
var len=arguments.length;
if(len > 1){
var catchInstances=new Array(len - 1),
j=0, i;
for (i=0; i < len - 1; ++i){
var item=arguments[i];
if(util.isObject(item)){
catchInstances[j++]=item;
}else{
return apiRejection("Catch statement predicate: " +
"expecting an object but got " + util.classString(item));
}}
catchInstances.length=j;
fn=arguments[i];
return this.then(undefined, catchFilter(catchInstances, fn, this));
}
return this.then(undefined, fn);
};
Promise.prototype.reflect=function (){
return this._then(reflectHandler,
reflectHandler, undefined, this, undefined);
};
Promise.prototype.then=function (didFulfill, didReject){
if(debug.warnings()&&arguments.length > 0 &&
typeof didFulfill!=="function" &&
typeof didReject!=="function"){
var msg=".then() only accepts functions but was passed: " +
util.classString(didFulfill);
if(arguments.length > 1){
msg +=", " + util.classString(didReject);
}
this._warn(msg);
}
return this._then(didFulfill, didReject, undefined, undefined, undefined);
};
Promise.prototype.done=function (didFulfill, didReject){
var promise =
this._then(didFulfill, didReject, undefined, undefined, undefined);
promise._setIsFinal();
};
Promise.prototype.spread=function (fn){
if(typeof fn!=="function"){
return apiRejection("expecting a function but got " + util.classString(fn));
}
return this.all()._then(fn, undefined, undefined, APPLY, undefined);
};
Promise.prototype.toJSON=function (){
var ret={
isFulfilled: false,
isRejected: false,
fulfillmentValue: undefined,
rejectionReason: undefined
};
if(this.isFulfilled()){
ret.fulfillmentValue=this.value();
ret.isFulfilled=true;
}else if(this.isRejected()){
ret.rejectionReason=this.reason();
ret.isRejected=true;
}
return ret;
};
Promise.prototype.all=function (){
if(arguments.length > 0){
this._warn(".all() was passed arguments but it does not take any");
}
return new PromiseArray(this).promise();
};
Promise.prototype.error=function (fn){
return this.caught(util.originatesFromRejection, fn);
};
Promise.getNewLibraryCopy=module.exports;
Promise.is=function (val){
return val instanceof Promise;
};
Promise.fromNode=Promise.fromCallback=function(fn){
var ret=new Promise(INTERNAL);
ret._captureStackTrace();
var multiArgs=arguments.length > 1 ? !!Object(arguments[1]).multiArgs
: false;
var result=tryCatch(fn)(nodebackForPromise(ret, multiArgs));
if(result===errorObj){
ret._rejectCallback(result.e, true);
}
if(!ret._isFateSealed()) ret._setAsyncGuaranteed();
return ret;
};
Promise.all=function (promises){
return new PromiseArray(promises).promise();
};
Promise.cast=function (obj){
var ret=tryConvertToPromise(obj);
if(!(ret instanceof Promise)){
ret=new Promise(INTERNAL);
ret._captureStackTrace();
ret._setFulfilled();
ret._rejectionHandler0=obj;
}
return ret;
};
Promise.resolve=Promise.fulfilled=Promise.cast;
Promise.reject=Promise.rejected=function (reason){
var ret=new Promise(INTERNAL);
ret._captureStackTrace();
ret._rejectCallback(reason, true);
return ret;
};
Promise.setScheduler=function(fn){
if(typeof fn!=="function"){
throw new TypeError("expecting a function but got " + util.classString(fn));
}
return async.setScheduler(fn);
};
Promise.prototype._then=function (
didFulfill,
didReject,
_,    receiver,
internalData
){
var haveInternalData=internalData!==undefined;
var promise=haveInternalData ? internalData:new Promise(INTERNAL);
var target=this._target();
var bitField=target._bitField;
if(!haveInternalData){
promise._propagateFrom(this, 3);
promise._captureStackTrace();
if(receiver===undefined &&
((this._bitField & 2097152)!==0)){
if(!((bitField & 50397184)===0)){
receiver=this._boundValue();
}else{
receiver=target===this ? undefined:this._boundTo;
}}
this._fireEvent("promiseChained", this, promise);
}
var domain=getDomain();
if(!((bitField & 50397184)===0)){
var handler, value, settler=target._settlePromiseCtx;
if(((bitField & 33554432)!==0)){
value=target._rejectionHandler0;
handler=didFulfill;
}else if(((bitField & 16777216)!==0)){
value=target._fulfillmentHandler0;
handler=didReject;
target._unsetRejectionIsUnhandled();
}else{
settler=target._settlePromiseLateCancellationObserver;
value=new CancellationError("late cancellation observer");
target._attachExtraTrace(value);
handler=didReject;
}
async.invoke(settler, target, {
handler: domain===null ? handler
: (typeof handler==="function" &&
util.domainBind(domain, handler)),
promise: promise,
receiver: receiver,
value: value
});
}else{
target._addCallbacks(didFulfill, didReject, promise, receiver, domain);
}
return promise;
};
Promise.prototype._length=function (){
return this._bitField & 65535;
};
Promise.prototype._isFateSealed=function (){
return (this._bitField & 117506048)!==0;
};
Promise.prototype._isFollowing=function (){
return (this._bitField & 67108864)===67108864;
};
Promise.prototype._setLength=function (len){
this._bitField=(this._bitField & -65536) |
(len & 65535);
};
Promise.prototype._setFulfilled=function (){
this._bitField=this._bitField | 33554432;
this._fireEvent("promiseFulfilled", this);
};
Promise.prototype._setRejected=function (){
this._bitField=this._bitField | 16777216;
this._fireEvent("promiseRejected", this);
};
Promise.prototype._setFollowing=function (){
this._bitField=this._bitField | 67108864;
this._fireEvent("promiseResolved", this);
};
Promise.prototype._setIsFinal=function (){
this._bitField=this._bitField | 4194304;
};
Promise.prototype._isFinal=function (){
return (this._bitField & 4194304) > 0;
};
Promise.prototype._unsetCancelled=function(){
this._bitField=this._bitField & (~65536);
};
Promise.prototype._setCancelled=function(){
this._bitField=this._bitField | 65536;
this._fireEvent("promiseCancelled", this);
};
Promise.prototype._setWillBeCancelled=function(){
this._bitField=this._bitField | 8388608;
};
Promise.prototype._setAsyncGuaranteed=function(){
if(async.hasCustomScheduler()) return;
this._bitField=this._bitField | 134217728;
};
Promise.prototype._receiverAt=function (index){
var ret=index===0 ? this._receiver0:this[
index * 4 - 4 + 3];
if(ret===UNDEFINED_BINDING){
return undefined;
}else if(ret===undefined&&this._isBound()){
return this._boundValue();
}
return ret;
};
Promise.prototype._promiseAt=function (index){
return this[
index * 4 - 4 + 2];
};
Promise.prototype._fulfillmentHandlerAt=function (index){
return this[
index * 4 - 4 + 0];
};
Promise.prototype._rejectionHandlerAt=function (index){
return this[
index * 4 - 4 + 1];
};
Promise.prototype._boundValue=function(){};
Promise.prototype._migrateCallback0=function (follower){
var bitField=follower._bitField;
var fulfill=follower._fulfillmentHandler0;
var reject=follower._rejectionHandler0;
var promise=follower._promise0;
var receiver=follower._receiverAt(0);
if(receiver===undefined) receiver=UNDEFINED_BINDING;
this._addCallbacks(fulfill, reject, promise, receiver, null);
};
Promise.prototype._migrateCallbackAt=function (follower, index){
var fulfill=follower._fulfillmentHandlerAt(index);
var reject=follower._rejectionHandlerAt(index);
var promise=follower._promiseAt(index);
var receiver=follower._receiverAt(index);
if(receiver===undefined) receiver=UNDEFINED_BINDING;
this._addCallbacks(fulfill, reject, promise, receiver, null);
};
Promise.prototype._addCallbacks=function (
fulfill,
reject,
promise,
receiver,
domain
){
var index=this._length();
if(index >=65535 - 4){
index=0;
this._setLength(0);
}
if(index===0){
this._promise0=promise;
this._receiver0=receiver;
if(typeof fulfill==="function"){
this._fulfillmentHandler0 =
domain===null ? fulfill:util.domainBind(domain, fulfill);
}
if(typeof reject==="function"){
this._rejectionHandler0 =
domain===null ? reject:util.domainBind(domain, reject);
}}else{
var base=index * 4 - 4;
this[base + 2]=promise;
this[base + 3]=receiver;
if(typeof fulfill==="function"){
this[base + 0] =
domain===null ? fulfill:util.domainBind(domain, fulfill);
}
if(typeof reject==="function"){
this[base + 1] =
domain===null ? reject:util.domainBind(domain, reject);
}}
this._setLength(index + 1);
return index;
};
Promise.prototype._proxy=function (proxyable, arg){
this._addCallbacks(undefined, undefined, arg, proxyable, null);
};
Promise.prototype._resolveCallback=function(value, shouldBind){
if(((this._bitField & 117506048)!==0)) return;
if(value===this)
return this._rejectCallback(makeSelfResolutionError(), false);
var maybePromise=tryConvertToPromise(value, this);
if(!(maybePromise instanceof Promise)) return this._fulfill(value);
if(shouldBind) this._propagateFrom(maybePromise, 2);
var promise=maybePromise._target();
if(promise===this){
this._reject(makeSelfResolutionError());
return;
}
var bitField=promise._bitField;
if(((bitField & 50397184)===0)){
var len=this._length();
if(len > 0) promise._migrateCallback0(this);
for (var i=1; i < len; ++i){
promise._migrateCallbackAt(this, i);
}
this._setFollowing();
this._setLength(0);
this._setFollowee(promise);
}else if(((bitField & 33554432)!==0)){
this._fulfill(promise._value());
}else if(((bitField & 16777216)!==0)){
this._reject(promise._reason());
}else{
var reason=new CancellationError("late cancellation observer");
promise._attachExtraTrace(reason);
this._reject(reason);
}};
Promise.prototype._rejectCallback =
function(reason, synchronous, ignoreNonErrorWarnings){
var trace=util.ensureErrorObject(reason);
var hasStack=trace===reason;
if(!hasStack&&!ignoreNonErrorWarnings&&debug.warnings()){
var message="a promise was rejected with a non-error: " +
util.classString(reason);
this._warn(message, true);
}
this._attachExtraTrace(trace, synchronous ? hasStack:false);
this._reject(reason);
};
Promise.prototype._resolveFromExecutor=function (executor){
if(executor===INTERNAL) return;
var promise=this;
this._captureStackTrace();
this._pushContext();
var synchronous=true;
var r=this._execute(executor, function(value){
promise._resolveCallback(value);
}, function (reason){
promise._rejectCallback(reason, synchronous);
});
synchronous=false;
this._popContext();
if(r!==undefined){
promise._rejectCallback(r, true);
}};
Promise.prototype._settlePromiseFromHandler=function (
handler, receiver, value, promise
){
var bitField=promise._bitField;
if(((bitField & 65536)!==0)) return;
promise._pushContext();
var x;
if(receiver===APPLY){
if(!value||typeof value.length!=="number"){
x=errorObj;
x.e=new TypeError("cannot .spread() a non-array: " +
util.classString(value));
}else{
x=tryCatch(handler).apply(this._boundValue(), value);
}}else{
x=tryCatch(handler).call(receiver, value);
}
var promiseCreated=promise._popContext();
bitField=promise._bitField;
if(((bitField & 65536)!==0)) return;
if(x===NEXT_FILTER){
promise._reject(value);
}else if(x===errorObj){
promise._rejectCallback(x.e, false);
}else{
debug.checkForgottenReturns(x, promiseCreated, "",  promise, this);
promise._resolveCallback(x);
}};
Promise.prototype._target=function(){
var ret=this;
while (ret._isFollowing()) ret=ret._followee();
return ret;
};
Promise.prototype._followee=function(){
return this._rejectionHandler0;
};
Promise.prototype._setFollowee=function(promise){
this._rejectionHandler0=promise;
};
Promise.prototype._settlePromise=function(promise, handler, receiver, value){
var isPromise=promise instanceof Promise;
var bitField=this._bitField;
var asyncGuaranteed=((bitField & 134217728)!==0);
if(((bitField & 65536)!==0)){
if(isPromise) promise._invokeInternalOnCancel();
if(receiver instanceof PassThroughHandlerContext &&
receiver.isFinallyHandler()){
receiver.cancelPromise=promise;
if(tryCatch(handler).call(receiver, value)===errorObj){
promise._reject(errorObj.e);
}}else if(handler===reflectHandler){
promise._fulfill(reflectHandler.call(receiver));
}else if(receiver instanceof Proxyable){
receiver._promiseCancelled(promise);
}else if(isPromise||promise instanceof PromiseArray){
promise._cancel();
}else{
receiver.cancel();
}}else if(typeof handler==="function"){
if(!isPromise){
handler.call(receiver, value, promise);
}else{
if(asyncGuaranteed) promise._setAsyncGuaranteed();
this._settlePromiseFromHandler(handler, receiver, value, promise);
}}else if(receiver instanceof Proxyable){
if(!receiver._isResolved()){
if(((bitField & 33554432)!==0)){
receiver._promiseFulfilled(value, promise);
}else{
receiver._promiseRejected(value, promise);
}}
}else if(isPromise){
if(asyncGuaranteed) promise._setAsyncGuaranteed();
if(((bitField & 33554432)!==0)){
promise._fulfill(value);
}else{
promise._reject(value);
}}
};
Promise.prototype._settlePromiseLateCancellationObserver=function(ctx){
var handler=ctx.handler;
var promise=ctx.promise;
var receiver=ctx.receiver;
var value=ctx.value;
if(typeof handler==="function"){
if(!(promise instanceof Promise)){
handler.call(receiver, value, promise);
}else{
this._settlePromiseFromHandler(handler, receiver, value, promise);
}}else if(promise instanceof Promise){
promise._reject(value);
}};
Promise.prototype._settlePromiseCtx=function(ctx){
this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);
};
Promise.prototype._settlePromise0=function(handler, value, bitField){
var promise=this._promise0;
var receiver=this._receiverAt(0);
this._promise0=undefined;
this._receiver0=undefined;
this._settlePromise(promise, handler, receiver, value);
};
Promise.prototype._clearCallbackDataAtIndex=function(index){
var base=index * 4 - 4;
this[base + 2] =
this[base + 3] =
this[base + 0] =
this[base + 1]=undefined;
};
Promise.prototype._fulfill=function (value){
var bitField=this._bitField;
if(((bitField & 117506048) >>> 16)) return;
if(value===this){
var err=makeSelfResolutionError();
this._attachExtraTrace(err);
return this._reject(err);
}
this._setFulfilled();
this._rejectionHandler0=value;
if((bitField & 65535) > 0){
if(((bitField & 134217728)!==0)){
this._settlePromises();
}else{
async.settlePromises(this);
}}
};
Promise.prototype._reject=function (reason){
var bitField=this._bitField;
if(((bitField & 117506048) >>> 16)) return;
this._setRejected();
this._fulfillmentHandler0=reason;
if(this._isFinal()){
return async.fatalError(reason, util.isNode);
}
if((bitField & 65535) > 0){
async.settlePromises(this);
}else{
this._ensurePossibleRejectionHandled();
}};
Promise.prototype._fulfillPromises=function (len, value){
for (var i=1; i < len; i++){
var handler=this._fulfillmentHandlerAt(i);
var promise=this._promiseAt(i);
var receiver=this._receiverAt(i);
this._clearCallbackDataAtIndex(i);
this._settlePromise(promise, handler, receiver, value);
}};
Promise.prototype._rejectPromises=function (len, reason){
for (var i=1; i < len; i++){
var handler=this._rejectionHandlerAt(i);
var promise=this._promiseAt(i);
var receiver=this._receiverAt(i);
this._clearCallbackDataAtIndex(i);
this._settlePromise(promise, handler, receiver, reason);
}};
Promise.prototype._settlePromises=function (){
var bitField=this._bitField;
var len=(bitField & 65535);
if(len > 0){
if(((bitField & 16842752)!==0)){
var reason=this._fulfillmentHandler0;
this._settlePromise0(this._rejectionHandler0, reason, bitField);
this._rejectPromises(len, reason);
}else{
var value=this._rejectionHandler0;
this._settlePromise0(this._fulfillmentHandler0, value, bitField);
this._fulfillPromises(len, value);
}
this._setLength(0);
}
this._clearCancellationData();
};
Promise.prototype._settledValue=function(){
var bitField=this._bitField;
if(((bitField & 33554432)!==0)){
return this._rejectionHandler0;
}else if(((bitField & 16777216)!==0)){
return this._fulfillmentHandler0;
}};
function deferResolve(v){this.promise._resolveCallback(v);}
function deferReject(v){this.promise._rejectCallback(v, false);}
Promise.defer=Promise.pending=function(){
debug.deprecated("Promise.defer", "new Promise");
var promise=new Promise(INTERNAL);
return {
promise: promise,
resolve: deferResolve,
reject: deferReject
};};
util.notEnumerableProp(Promise,
"_makeSelfResolutionError",
makeSelfResolutionError);
_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection,
debug);
_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug);
_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug);
_dereq_("./direct_resolve")(Promise);
_dereq_("./synchronous_inspection")(Promise);
_dereq_("./join")(
Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain);
Promise.Promise=Promise;
Promise.version="3.5.1";
_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);
_dereq_('./call_get.js')(Promise);
_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);
_dereq_('./timers.js')(Promise, INTERNAL, debug);
_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);
_dereq_('./nodeify.js')(Promise);
_dereq_('./promisify.js')(Promise, INTERNAL);
_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);
_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);
_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);
_dereq_('./settle.js')(Promise, PromiseArray, debug);
_dereq_('./some.js')(Promise, PromiseArray, apiRejection);
_dereq_('./filter.js')(Promise, INTERNAL);
_dereq_('./each.js')(Promise, INTERNAL);
_dereq_('./any.js')(Promise);
util.toFastProperties(Promise);
util.toFastProperties(Promise.prototype);
function fillTypes(value){
var p=new Promise(INTERNAL);
p._fulfillmentHandler0=value;
p._rejectionHandler0=value;
p._promise0=value;
p._receiver0=value;
}
fillTypes({a: 1});
fillTypes({b: 2});
fillTypes({c: 3});
fillTypes(1);
fillTypes(function(){});
fillTypes(undefined);
fillTypes(false);
fillTypes(new Promise(INTERNAL));
debug.setBounds(Async.firstLineError, util.lastLineError);
return Promise;
};},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL, tryConvertToPromise,
apiRejection, Proxyable){
var util=_dereq_("./util");
var isArray=util.isArray;
function toResolutionValue(val){
switch(val){
case -2: return [];
case -3: return {};
case -6: return new Map();
}}
function PromiseArray(values){
var promise=this._promise=new Promise(INTERNAL);
if(values instanceof Promise){
promise._propagateFrom(values, 3);
}
promise._setOnCancel(this);
this._values=values;
this._length=0;
this._totalResolved=0;
this._init(undefined, -2);
}
util.inherits(PromiseArray, Proxyable);
PromiseArray.prototype.length=function (){
return this._length;
};
PromiseArray.prototype.promise=function (){
return this._promise;
};
PromiseArray.prototype._init=function init(_, resolveValueIfEmpty){
var values=tryConvertToPromise(this._values, this._promise);
if(values instanceof Promise){
values=values._target();
var bitField=values._bitField;
;
this._values=values;
if(((bitField & 50397184)===0)){
this._promise._setAsyncGuaranteed();
return values._then(init,
this._reject,
undefined,
this,
resolveValueIfEmpty
);
}else if(((bitField & 33554432)!==0)){
values=values._value();
}else if(((bitField & 16777216)!==0)){
return this._reject(values._reason());
}else{
return this._cancel();
}}
values=util.asArray(values);
if(values===null){
var err=apiRejection(
"expecting an array or an iterable object but got " + util.classString(values)).reason();
this._promise._rejectCallback(err, false);
return;
}
if(values.length===0){
if(resolveValueIfEmpty===-5){
this._resolveEmptyArray();
}else{
this._resolve(toResolutionValue(resolveValueIfEmpty));
}
return;
}
this._iterate(values);
};
PromiseArray.prototype._iterate=function(values){
var len=this.getActualLength(values.length);
this._length=len;
this._values=this.shouldCopyValues() ? new Array(len):this._values;
var result=this._promise;
var isResolved=false;
var bitField=null;
for (var i=0; i < len; ++i){
var maybePromise=tryConvertToPromise(values[i], result);
if(maybePromise instanceof Promise){
maybePromise=maybePromise._target();
bitField=maybePromise._bitField;
}else{
bitField=null;
}
if(isResolved){
if(bitField!==null){
maybePromise.suppressUnhandledRejections();
}}else if(bitField!==null){
if(((bitField & 50397184)===0)){
maybePromise._proxy(this, i);
this._values[i]=maybePromise;
}else if(((bitField & 33554432)!==0)){
isResolved=this._promiseFulfilled(maybePromise._value(), i);
}else if(((bitField & 16777216)!==0)){
isResolved=this._promiseRejected(maybePromise._reason(), i);
}else{
isResolved=this._promiseCancelled(i);
}}else{
isResolved=this._promiseFulfilled(maybePromise, i);
}}
if(!isResolved) result._setAsyncGuaranteed();
};
PromiseArray.prototype._isResolved=function (){
return this._values===null;
};
PromiseArray.prototype._resolve=function (value){
this._values=null;
this._promise._fulfill(value);
};
PromiseArray.prototype._cancel=function(){
if(this._isResolved()||!this._promise._isCancellable()) return;
this._values=null;
this._promise._cancel();
};
PromiseArray.prototype._reject=function (reason){
this._values=null;
this._promise._rejectCallback(reason, false);
};
PromiseArray.prototype._promiseFulfilled=function (value, index){
this._values[index]=value;
var totalResolved=++this._totalResolved;
if(totalResolved >=this._length){
this._resolve(this._values);
return true;
}
return false;
};
PromiseArray.prototype._promiseCancelled=function(){
this._cancel();
return true;
};
PromiseArray.prototype._promiseRejected=function (reason){
this._totalResolved++;
this._reject(reason);
return true;
};
PromiseArray.prototype._resultCancelled=function(){
if(this._isResolved()) return;
var values=this._values;
this._cancel();
if(values instanceof Promise){
values.cancel();
}else{
for (var i=0; i < values.length; ++i){
if(values[i] instanceof Promise){
values[i].cancel();
}}
}};
PromiseArray.prototype.shouldCopyValues=function (){
return true;
};
PromiseArray.prototype.getActualLength=function (len){
return len;
};
return PromiseArray;
};},{"./util":36}],24:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL){
var THIS={};
var util=_dereq_("./util");
var nodebackForPromise=_dereq_("./nodeback");
var withAppended=util.withAppended;
var maybeWrapAsError=util.maybeWrapAsError;
var canEvaluate=util.canEvaluate;
var TypeError=_dereq_("./errors").TypeError;
var defaultSuffix="Async";
var defaultPromisified={__isPromisified__: true};
var noCopyProps=[
"arity",    "length",
"name",
"arguments",
"caller",
"callee",
"prototype",
"__isPromisified__"
];
var noCopyPropsPattern=new RegExp("^(?:" + noCopyProps.join("|") + ")$");
var defaultFilter=function(name){
return util.isIdentifier(name) &&
name.charAt(0)!=="_" &&
name!=="constructor";
};
function propsFilter(key){
return !noCopyPropsPattern.test(key);
}
function isPromisified(fn){
try {
return fn.__isPromisified__===true;
}
catch (e){
return false;
}}
function hasPromisified(obj, key, suffix){
var val=util.getDataPropertyOrDefault(obj, key + suffix,
defaultPromisified);
return val ? isPromisified(val):false;
}
function checkValid(ret, suffix, suffixRegexp){
for (var i=0; i < ret.length; i +=2){
var key=ret[i];
if(suffixRegexp.test(key)){
var keyWithoutAsyncSuffix=key.replace(suffixRegexp, "");
for (var j=0; j < ret.length; j +=2){
if(ret[j]===keyWithoutAsyncSuffix){
throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a    See http://goo.gl/MqrFmX\u000a"
.replace("%s", suffix));
}}
}}
}
function promisifiableMethods(obj, suffix, suffixRegexp, filter){
var keys=util.inheritedDataKeys(obj);
var ret=[];
for (var i=0; i < keys.length; ++i){
var key=keys[i];
var value=obj[key];
var passesDefaultFilter=filter===defaultFilter
? true:defaultFilter(key, value, obj);
if(typeof value==="function" &&
!isPromisified(value) &&
!hasPromisified(obj, key, suffix) &&
filter(key, value, obj, passesDefaultFilter)){
ret.push(key, value);
}}
checkValid(ret, suffix, suffixRegexp);
return ret;
}
var escapeIdentRegex=function(str){
return str.replace(/([$])/, "\\$");
};
var makeNodePromisifiedEval;
if(false){
var switchCaseArgumentOrder=function(likelyArgumentCount){
var ret=[likelyArgumentCount];
var min=Math.max(0, likelyArgumentCount - 1 - 3);
for(var i=likelyArgumentCount - 1; i >=min; --i){
ret.push(i);
}
for(var i=likelyArgumentCount + 1; i <=3; ++i){
ret.push(i);
}
return ret;
};
var argumentSequence=function(argumentCount){
return util.filledRange(argumentCount, "_arg", "");
};
var parameterDeclaration=function(parameterCount){
return util.filledRange(Math.max(parameterCount, 3), "_arg", "");
};
var parameterCount=function(fn){
if(typeof fn.length==="number"){
return Math.max(Math.min(fn.length, 1023 + 1), 0);
}
return 0;
};
makeNodePromisifiedEval =
function(callback, receiver, originalName, fn, _, multiArgs){
var newParameterCount=Math.max(0, parameterCount(fn) - 1);
var argumentOrder=switchCaseArgumentOrder(newParameterCount);
var shouldProxyThis=typeof callback==="string"||receiver===THIS;
function generateCallForArgumentCount(count){
var args=argumentSequence(count).join(", ");
var comma=count > 0 ? ", ":"";
var ret;
if(shouldProxyThis){
ret="ret=callback.call(this, {{args}}, nodeback); break;\n";
}else{
ret=receiver===undefined
? "ret=callback({{args}}, nodeback); break;\n"
: "ret=callback.call(receiver, {{args}}, nodeback); break;\n";
}
return ret.replace("{{args}}", args).replace(", ", comma);
}
function generateArgumentSwitchCase(){
var ret="";
for (var i=0; i < argumentOrder.length; ++i){
ret +="case " + argumentOrder[i] +":" +
generateCallForArgumentCount(argumentOrder[i]);
}
ret +="                                                             \n\
default:                                                             \n\
var args=new Array(len + 1);                                   \n\
var i=0;                                                       \n\
for (var i=0; i < len; ++i){                                  \n\
args[i]=arguments[i];                                       \n\
}                                                                \n\
args[i]=nodeback;                                              \n\
[CodeForCall]                                                    \n\
break;                                                           \n\
".replace("[CodeForCall]", (shouldProxyThis
? "ret=callback.apply(this, args);\n"
: "ret=callback.apply(receiver, args);\n"));
return ret;
}
var getFunctionCode=typeof callback==="string"
? ("this!=null ? this['"+callback+"']:fn")
: "fn";
var body="'use strict';                                                \n\
var ret=function (Parameters){                                    \n\
'use strict';                                                    \n\
var len=arguments.length;                                      \n\
var promise=new Promise(INTERNAL);                             \n\
promise._captureStackTrace();                                    \n\
var nodeback=nodebackForPromise(promise, " + multiArgs + ");   \n\
var ret;                                                         \n\
var callback=tryCatch([GetFunctionCode]);                      \n\
switch(len){                                                    \n\
[CodeForSwitchCase]                                          \n\
}                                                                \n\
if(ret===errorObj){                                          \n\
promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\
}                                                                \n\
if(!promise._isFateSealed()) promise._setAsyncGuaranteed();     \n\
return promise;                                                  \n\
};                                                                   \n\
notEnumerableProp(ret, '__isPromisified__', true);                   \n\
return ret;                                                          \n\
".replace("[CodeForSwitchCase]", generateArgumentSwitchCase())
.replace("[GetFunctionCode]", getFunctionCode);
body=body.replace("Parameters", parameterDeclaration(newParameterCount));
return new Function("Promise",
"fn",
"receiver",
"withAppended",
"maybeWrapAsError",
"nodebackForPromise",
"tryCatch",
"errorObj",
"notEnumerableProp",
"INTERNAL",
body)(
Promise,
fn,
receiver,
withAppended,
maybeWrapAsError,
nodebackForPromise,
util.tryCatch,
util.errorObj,
util.notEnumerableProp,
INTERNAL);
};}
function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs){
var defaultThis=(function(){return this;})();
var method=callback;
if(typeof method==="string"){
callback=fn;
}
function promisified(){
var _receiver=receiver;
if(receiver===THIS) _receiver=this;
var promise=new Promise(INTERNAL);
promise._captureStackTrace();
var cb=typeof method==="string"&&this!==defaultThis
? this[method]:callback;
var fn=nodebackForPromise(promise, multiArgs);
try {
cb.apply(_receiver, withAppended(arguments, fn));
} catch(e){
promise._rejectCallback(maybeWrapAsError(e), true, true);
}
if(!promise._isFateSealed()) promise._setAsyncGuaranteed();
return promise;
}
util.notEnumerableProp(promisified, "__isPromisified__", true);
return promisified;
}
var makeNodePromisified=canEvaluate
? makeNodePromisifiedEval
: makeNodePromisifiedClosure;
function promisifyAll(obj, suffix, filter, promisifier, multiArgs){
var suffixRegexp=new RegExp(escapeIdentRegex(suffix) + "$");
var methods =
promisifiableMethods(obj, suffix, suffixRegexp, filter);
for (var i=0, len=methods.length; i < len; i+=2){
var key=methods[i];
var fn=methods[i+1];
var promisifiedKey=key + suffix;
if(promisifier===makeNodePromisified){
obj[promisifiedKey] =
makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);
}else{
var promisified=promisifier(fn, function(){
return makeNodePromisified(key, THIS, key,
fn, suffix, multiArgs);
});
util.notEnumerableProp(promisified, "__isPromisified__", true);
obj[promisifiedKey]=promisified;
}}
util.toFastProperties(obj);
return obj;
}
function promisify(callback, receiver, multiArgs){
return makeNodePromisified(callback, receiver, undefined,
callback, null, multiArgs);
}
Promise.promisify=function (fn, options){
if(typeof fn!=="function"){
throw new TypeError("expecting a function but got " + util.classString(fn));
}
if(isPromisified(fn)){
return fn;
}
options=Object(options);
var receiver=options.context===undefined ? THIS:options.context;
var multiArgs = !!options.multiArgs;
var ret=promisify(fn, receiver, multiArgs);
util.copyDescriptors(fn, ret, propsFilter);
return ret;
};
Promise.promisifyAll=function (target, options){
if(typeof target!=="function"&&typeof target!=="object"){
throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
options=Object(options);
var multiArgs = !!options.multiArgs;
var suffix=options.suffix;
if(typeof suffix!=="string") suffix=defaultSuffix;
var filter=options.filter;
if(typeof filter!=="function") filter=defaultFilter;
var promisifier=options.promisifier;
if(typeof promisifier!=="function") promisifier=makeNodePromisified;
if(!util.isIdentifier(suffix)){
throw new RangeError("suffix must be a valid identifier\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
var keys=util.inheritedDataKeys(target);
for (var i=0; i < keys.length; ++i){
var value=target[keys[i]];
if(keys[i]!=="constructor" &&
util.isClass(value)){
promisifyAll(value.prototype, suffix, filter, promisifier,
multiArgs);
promisifyAll(value, suffix, filter, promisifier, multiArgs);
}}
return promisifyAll(target, suffix, filter, promisifier, multiArgs);
};};
},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){
"use strict";
module.exports=function(
Promise, PromiseArray, tryConvertToPromise, apiRejection){
var util=_dereq_("./util");
var isObject=util.isObject;
var es5=_dereq_("./es5");
var Es6Map;
if(typeof Map==="function") Es6Map=Map;
var mapToEntries=(function(){
var index=0;
var size=0;
function extractEntry(value, key){
this[index]=value;
this[index + size]=key;
index++;
}
return function mapToEntries(map){
size=map.size;
index=0;
var ret=new Array(map.size * 2);
map.forEach(extractEntry, ret);
return ret;
};})();
var entriesToMap=function(entries){
var ret=new Es6Map();
var length=entries.length / 2 | 0;
for (var i=0; i < length; ++i){
var key=entries[length + i];
var value=entries[i];
ret.set(key, value);
}
return ret;
};
function PropertiesPromiseArray(obj){
var isMap=false;
var entries;
if(Es6Map!==undefined&&obj instanceof Es6Map){
entries=mapToEntries(obj);
isMap=true;
}else{
var keys=es5.keys(obj);
var len=keys.length;
entries=new Array(len * 2);
for (var i=0; i < len; ++i){
var key=keys[i];
entries[i]=obj[key];
entries[i + len]=key;
}}
this.constructor$(entries);
this._isMap=isMap;
this._init$(undefined, isMap ? -6:-3);
}
util.inherits(PropertiesPromiseArray, PromiseArray);
PropertiesPromiseArray.prototype._init=function (){};
PropertiesPromiseArray.prototype._promiseFulfilled=function (value, index){
this._values[index]=value;
var totalResolved=++this._totalResolved;
if(totalResolved >=this._length){
var val;
if(this._isMap){
val=entriesToMap(this._values);
}else{
val={};
var keyOffset=this.length();
for (var i=0, len=this.length(); i < len; ++i){
val[this._values[i + keyOffset]]=this._values[i];
}}
this._resolve(val);
return true;
}
return false;
};
PropertiesPromiseArray.prototype.shouldCopyValues=function (){
return false;
};
PropertiesPromiseArray.prototype.getActualLength=function (len){
return len >> 1;
};
function props(promises){
var ret;
var castValue=tryConvertToPromise(promises);
if(!isObject(castValue)){
return apiRejection("cannot await properties of a non-object\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}else if(castValue instanceof Promise){
ret=castValue._then(Promise.props, undefined, undefined, undefined, undefined);
}else{
ret=new PropertiesPromiseArray(castValue).promise();
}
if(castValue instanceof Promise){
ret._propagateFrom(castValue, 2);
}
return ret;
}
Promise.prototype.props=function (){
return props(this);
};
Promise.props=function (promises){
return props(promises);
};};
},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){
"use strict";
function arrayMove(src, srcIndex, dst, dstIndex, len){
for (var j=0; j < len; ++j){
dst[j + dstIndex]=src[j + srcIndex];
src[j + srcIndex]=void 0;
}}
function Queue(capacity){
this._capacity=capacity;
this._length=0;
this._front=0;
}
Queue.prototype._willBeOverCapacity=function (size){
return this._capacity < size;
};
Queue.prototype._pushOne=function (arg){
var length=this.length();
this._checkCapacity(length + 1);
var i=(this._front + length) & (this._capacity - 1);
this[i]=arg;
this._length=length + 1;
};
Queue.prototype.push=function (fn, receiver, arg){
var length=this.length() + 3;
if(this._willBeOverCapacity(length)){
this._pushOne(fn);
this._pushOne(receiver);
this._pushOne(arg);
return;
}
var j=this._front + length - 3;
this._checkCapacity(length);
var wrapMask=this._capacity - 1;
this[(j + 0) & wrapMask]=fn;
this[(j + 1) & wrapMask]=receiver;
this[(j + 2) & wrapMask]=arg;
this._length=length;
};
Queue.prototype.shift=function (){
var front=this._front,
ret=this[front];
this[front]=undefined;
this._front=(front + 1) & (this._capacity - 1);
this._length--;
return ret;
};
Queue.prototype.length=function (){
return this._length;
};
Queue.prototype._checkCapacity=function (size){
if(this._capacity < size){
this._resizeTo(this._capacity << 1);
}};
Queue.prototype._resizeTo=function (capacity){
var oldCapacity=this._capacity;
this._capacity=capacity;
var front=this._front;
var length=this._length;
var moveItemsCount=(front + length) & (oldCapacity - 1);
arrayMove(this, 0, this, oldCapacity, moveItemsCount);
};
module.exports=Queue;
},{}],27:[function(_dereq_,module,exports){
"use strict";
module.exports=function(
Promise, INTERNAL, tryConvertToPromise, apiRejection){
var util=_dereq_("./util");
var raceLater=function (promise){
return promise.then(function(array){
return race(array, promise);
});
};
function race(promises, parent){
var maybePromise=tryConvertToPromise(promises);
if(maybePromise instanceof Promise){
return raceLater(maybePromise);
}else{
promises=util.asArray(promises);
if(promises===null)
return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));
}
var ret=new Promise(INTERNAL);
if(parent!==undefined){
ret._propagateFrom(parent, 3);
}
var fulfill=ret._fulfill;
var reject=ret._reject;
for (var i=0, len=promises.length; i < len; ++i){
var val=promises[i];
if(val===undefined&&!(i in promises)){
continue;
}
Promise.cast(val)._then(fulfill, reject, undefined, ret, null);
}
return ret;
}
Promise.race=function (promises){
return race(promises, undefined);
};
Promise.prototype.race=function (){
return race(this, undefined);
};};
},{"./util":36}],28:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise,
PromiseArray,
apiRejection,
tryConvertToPromise,
INTERNAL,
debug){
var getDomain=Promise._getDomain;
var util=_dereq_("./util");
var tryCatch=util.tryCatch;
function ReductionPromiseArray(promises, fn, initialValue, _each){
this.constructor$(promises);
var domain=getDomain();
this._fn=domain===null ? fn:util.domainBind(domain, fn);
if(initialValue!==undefined){
initialValue=Promise.resolve(initialValue);
initialValue._attachCancellationCallback(this);
}
this._initialValue=initialValue;
this._currentCancellable=null;
if(_each===INTERNAL){
this._eachValues=Array(this._length);
}else if(_each===0){
this._eachValues=null;
}else{
this._eachValues=undefined;
}
this._promise._captureStackTrace();
this._init$(undefined, -5);
}
util.inherits(ReductionPromiseArray, PromiseArray);
ReductionPromiseArray.prototype._gotAccum=function(accum){
if(this._eachValues!==undefined &&
this._eachValues!==null &&
accum!==INTERNAL){
this._eachValues.push(accum);
}};
ReductionPromiseArray.prototype._eachComplete=function(value){
if(this._eachValues!==null){
this._eachValues.push(value);
}
return this._eachValues;
};
ReductionPromiseArray.prototype._init=function(){};
ReductionPromiseArray.prototype._resolveEmptyArray=function(){
this._resolve(this._eachValues!==undefined ? this._eachValues
: this._initialValue);
};
ReductionPromiseArray.prototype.shouldCopyValues=function (){
return false;
};
ReductionPromiseArray.prototype._resolve=function(value){
this._promise._resolveCallback(value);
this._values=null;
};
ReductionPromiseArray.prototype._resultCancelled=function(sender){
if(sender===this._initialValue) return this._cancel();
if(this._isResolved()) return;
this._resultCancelled$();
if(this._currentCancellable instanceof Promise){
this._currentCancellable.cancel();
}
if(this._initialValue instanceof Promise){
this._initialValue.cancel();
}};
ReductionPromiseArray.prototype._iterate=function (values){
this._values=values;
var value;
var i;
var length=values.length;
if(this._initialValue!==undefined){
value=this._initialValue;
i=0;
}else{
value=Promise.resolve(values[0]);
i=1;
}
this._currentCancellable=value;
if(!value.isRejected()){
for (; i < length; ++i){
var ctx={
accum: null,
value: values[i],
index: i,
length: length,
array: this
};
value=value._then(gotAccum, undefined, undefined, ctx, undefined);
}}
if(this._eachValues!==undefined){
value=value
._then(this._eachComplete, undefined, undefined, this, undefined);
}
value._then(completed, completed, undefined, value, this);
};
Promise.prototype.reduce=function (fn, initialValue){
return reduce(this, fn, initialValue, null);
};
Promise.reduce=function (promises, fn, initialValue, _each){
return reduce(promises, fn, initialValue, _each);
};
function completed(valueOrReason, array){
if(this.isFulfilled()){
array._resolve(valueOrReason);
}else{
array._reject(valueOrReason);
}}
function reduce(promises, fn, initialValue, _each){
if(typeof fn!=="function"){
return apiRejection("expecting a function but got " + util.classString(fn));
}
var array=new ReductionPromiseArray(promises, fn, initialValue, _each);
return array.promise();
}
function gotAccum(accum){
this.accum=accum;
this.array._gotAccum(accum);
var value=tryConvertToPromise(this.value, this.array._promise);
if(value instanceof Promise){
this.array._currentCancellable=value;
return value._then(gotValue, undefined, undefined, this, undefined);
}else{
return gotValue.call(this, value);
}}
function gotValue(value){
var array=this.array;
var promise=array._promise;
var fn=tryCatch(array._fn);
promise._pushContext();
var ret;
if(array._eachValues!==undefined){
ret=fn.call(promise._boundValue(), value, this.index, this.length);
}else{
ret=fn.call(promise._boundValue(),
this.accum, value, this.index, this.length);
}
if(ret instanceof Promise){
array._currentCancellable=ret;
}
var promiseCreated=promise._popContext();
debug.checkForgottenReturns(ret,
promiseCreated,
array._eachValues!==undefined ? "Promise.each":"Promise.reduce",
promise
);
return ret;
}};},{"./util":36}],29:[function(_dereq_,module,exports){
"use strict";
var util=_dereq_("./util");
var schedule;
var noAsyncScheduler=function(){
throw new Error("No async scheduler available\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
};
var NativePromise=util.getNativePromise();
if(util.isNode&&typeof MutationObserver==="undefined"){
var GlobalSetImmediate=global.setImmediate;
var ProcessNextTick=process.nextTick;
schedule=util.isRecentNode
? function(fn){ GlobalSetImmediate.call(global, fn); }
: function(fn){ ProcessNextTick.call(process, fn); };}else if(typeof NativePromise==="function" &&
typeof NativePromise.resolve==="function"){
var nativePromise=NativePromise.resolve();
schedule=function(fn){
nativePromise.then(fn);
};}else if((typeof MutationObserver!=="undefined") &&
!(typeof window!=="undefined" &&
window.navigator &&
(window.navigator.standalone||window.cordova))){
schedule=(function(){
var div=document.createElement("div");
var opts={attributes: true};
var toggleScheduled=false;
var div2=document.createElement("div");
var o2=new MutationObserver(function(){
div.classList.toggle("foo");
toggleScheduled=false;
});
o2.observe(div2, opts);
var scheduleToggle=function(){
if(toggleScheduled) return;
toggleScheduled=true;
div2.classList.toggle("foo");
};
return function schedule(fn){
var o=new MutationObserver(function(){
o.disconnect();
fn();
});
o.observe(div, opts);
scheduleToggle();
};})();
}else if(typeof setImmediate!=="undefined"){
schedule=function (fn){
setImmediate(fn);
};}else if(typeof setTimeout!=="undefined"){
schedule=function (fn){
setTimeout(fn, 0);
};}else{
schedule=noAsyncScheduler;
}
module.exports=schedule;
},{"./util":36}],30:[function(_dereq_,module,exports){
"use strict";
module.exports =
function(Promise, PromiseArray, debug){
var PromiseInspection=Promise.PromiseInspection;
var util=_dereq_("./util");
function SettledPromiseArray(values){
this.constructor$(values);
}
util.inherits(SettledPromiseArray, PromiseArray);
SettledPromiseArray.prototype._promiseResolved=function (index, inspection){
this._values[index]=inspection;
var totalResolved=++this._totalResolved;
if(totalResolved >=this._length){
this._resolve(this._values);
return true;
}
return false;
};
SettledPromiseArray.prototype._promiseFulfilled=function (value, index){
var ret=new PromiseInspection();
ret._bitField=33554432;
ret._settledValueField=value;
return this._promiseResolved(index, ret);
};
SettledPromiseArray.prototype._promiseRejected=function (reason, index){
var ret=new PromiseInspection();
ret._bitField=16777216;
ret._settledValueField=reason;
return this._promiseResolved(index, ret);
};
Promise.settle=function (promises){
debug.deprecated(".settle()", ".reflect()");
return new SettledPromiseArray(promises).promise();
};
Promise.prototype.settle=function (){
return Promise.settle(this);
};};
},{"./util":36}],31:[function(_dereq_,module,exports){
"use strict";
module.exports =
function(Promise, PromiseArray, apiRejection){
var util=_dereq_("./util");
var RangeError=_dereq_("./errors").RangeError;
var AggregateError=_dereq_("./errors").AggregateError;
var isArray=util.isArray;
var CANCELLATION={};
function SomePromiseArray(values){
this.constructor$(values);
this._howMany=0;
this._unwrap=false;
this._initialized=false;
}
util.inherits(SomePromiseArray, PromiseArray);
SomePromiseArray.prototype._init=function (){
if(!this._initialized){
return;
}
if(this._howMany===0){
this._resolve([]);
return;
}
this._init$(undefined, -5);
var isArrayResolved=isArray(this._values);
if(!this._isResolved() &&
isArrayResolved &&
this._howMany > this._canPossiblyFulfill()){
this._reject(this._getRangeError(this.length()));
}};
SomePromiseArray.prototype.init=function (){
this._initialized=true;
this._init();
};
SomePromiseArray.prototype.setUnwrap=function (){
this._unwrap=true;
};
SomePromiseArray.prototype.howMany=function (){
return this._howMany;
};
SomePromiseArray.prototype.setHowMany=function (count){
this._howMany=count;
};
SomePromiseArray.prototype._promiseFulfilled=function (value){
this._addFulfilled(value);
if(this._fulfilled()===this.howMany()){
this._values.length=this.howMany();
if(this.howMany()===1&&this._unwrap){
this._resolve(this._values[0]);
}else{
this._resolve(this._values);
}
return true;
}
return false;
};
SomePromiseArray.prototype._promiseRejected=function (reason){
this._addRejected(reason);
return this._checkOutcome();
};
SomePromiseArray.prototype._promiseCancelled=function (){
if(this._values instanceof Promise||this._values==null){
return this._cancel();
}
this._addRejected(CANCELLATION);
return this._checkOutcome();
};
SomePromiseArray.prototype._checkOutcome=function(){
if(this.howMany() > this._canPossiblyFulfill()){
var e=new AggregateError();
for (var i=this.length(); i < this._values.length; ++i){
if(this._values[i]!==CANCELLATION){
e.push(this._values[i]);
}}
if(e.length > 0){
this._reject(e);
}else{
this._cancel();
}
return true;
}
return false;
};
SomePromiseArray.prototype._fulfilled=function (){
return this._totalResolved;
};
SomePromiseArray.prototype._rejected=function (){
return this._values.length - this.length();
};
SomePromiseArray.prototype._addRejected=function (reason){
this._values.push(reason);
};
SomePromiseArray.prototype._addFulfilled=function (value){
this._values[this._totalResolved++]=value;
};
SomePromiseArray.prototype._canPossiblyFulfill=function (){
return this.length() - this._rejected();
};
SomePromiseArray.prototype._getRangeError=function (count){
var message="Input array must contain at least " +
this._howMany + " items but contains only " + count + " items";
return new RangeError(message);
};
SomePromiseArray.prototype._resolveEmptyArray=function (){
this._reject(this._getRangeError(0));
};
function some(promises, howMany){
if((howMany | 0)!==howMany||howMany < 0){
return apiRejection("expecting a positive integer\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
var ret=new SomePromiseArray(promises);
var promise=ret.promise();
ret.setHowMany(howMany);
ret.init();
return promise;
}
Promise.some=function (promises, howMany){
return some(promises, howMany);
};
Promise.prototype.some=function (howMany){
return some(this, howMany);
};
Promise._SomePromiseArray=SomePromiseArray;
};},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise){
function PromiseInspection(promise){
if(promise!==undefined){
promise=promise._target();
this._bitField=promise._bitField;
this._settledValueField=promise._isFateSealed()
? promise._settledValue():undefined;
}else{
this._bitField=0;
this._settledValueField=undefined;
}}
PromiseInspection.prototype._settledValue=function(){
return this._settledValueField;
};
var value=PromiseInspection.prototype.value=function (){
if(!this.isFulfilled()){
throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
return this._settledValue();
};
var reason=PromiseInspection.prototype.error =
PromiseInspection.prototype.reason=function (){
if(!this.isRejected()){
throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a    See http://goo.gl/MqrFmX\u000a");
}
return this._settledValue();
};
var isFulfilled=PromiseInspection.prototype.isFulfilled=function(){
return (this._bitField & 33554432)!==0;
};
var isRejected=PromiseInspection.prototype.isRejected=function (){
return (this._bitField & 16777216)!==0;
};
var isPending=PromiseInspection.prototype.isPending=function (){
return (this._bitField & 50397184)===0;
};
var isResolved=PromiseInspection.prototype.isResolved=function (){
return (this._bitField & 50331648)!==0;
};
PromiseInspection.prototype.isCancelled=function(){
return (this._bitField & 8454144)!==0;
};
Promise.prototype.__isCancelled=function(){
return (this._bitField & 65536)===65536;
};
Promise.prototype._isCancelled=function(){
return this._target().__isCancelled();
};
Promise.prototype.isCancelled=function(){
return (this._target()._bitField & 8454144)!==0;
};
Promise.prototype.isPending=function(){
return isPending.call(this._target());
};
Promise.prototype.isRejected=function(){
return isRejected.call(this._target());
};
Promise.prototype.isFulfilled=function(){
return isFulfilled.call(this._target());
};
Promise.prototype.isResolved=function(){
return isResolved.call(this._target());
};
Promise.prototype.value=function(){
return value.call(this._target());
};
Promise.prototype.reason=function(){
var target=this._target();
target._unsetRejectionIsUnhandled();
return reason.call(target);
};
Promise.prototype._value=function(){
return this._settledValue();
};
Promise.prototype._reason=function(){
this._unsetRejectionIsUnhandled();
return this._settledValue();
};
Promise.PromiseInspection=PromiseInspection;
};},{}],33:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL){
var util=_dereq_("./util");
var errorObj=util.errorObj;
var isObject=util.isObject;
function tryConvertToPromise(obj, context){
if(isObject(obj)){
if(obj instanceof Promise) return obj;
var then=getThen(obj);
if(then===errorObj){
if(context) context._pushContext();
var ret=Promise.reject(then.e);
if(context) context._popContext();
return ret;
}else if(typeof then==="function"){
if(isAnyBluebirdPromise(obj)){
var ret=new Promise(INTERNAL);
obj._then(ret._fulfill,
ret._reject,
undefined,
ret,
null
);
return ret;
}
return doThenable(obj, then, context);
}}
return obj;
}
function doGetThen(obj){
return obj.then;
}
function getThen(obj){
try {
return doGetThen(obj);
} catch (e){
errorObj.e=e;
return errorObj;
}}
var hasProp={}.hasOwnProperty;
function isAnyBluebirdPromise(obj){
try {
return hasProp.call(obj, "_promise0");
} catch (e){
return false;
}}
function doThenable(x, then, context){
var promise=new Promise(INTERNAL);
var ret=promise;
if(context) context._pushContext();
promise._captureStackTrace();
if(context) context._popContext();
var synchronous=true;
var result=util.tryCatch(then).call(x, resolve, reject);
synchronous=false;
if(promise&&result===errorObj){
promise._rejectCallback(result.e, true, true);
promise=null;
}
function resolve(value){
if(!promise) return;
promise._resolveCallback(value);
promise=null;
}
function reject(reason){
if(!promise) return;
promise._rejectCallback(reason, synchronous, true);
promise=null;
}
return ret;
}
return tryConvertToPromise;
};},{"./util":36}],34:[function(_dereq_,module,exports){
"use strict";
module.exports=function(Promise, INTERNAL, debug){
var util=_dereq_("./util");
var TimeoutError=Promise.TimeoutError;
function HandleWrapper(handle){
this.handle=handle;
}
HandleWrapper.prototype._resultCancelled=function(){
clearTimeout(this.handle);
};
var afterValue=function(value){ return delay(+this).thenReturn(value); };
var delay=Promise.delay=function (ms, value){
var ret;
var handle;
if(value!==undefined){
ret=Promise.resolve(value)
._then(afterValue, null, null, ms, undefined);
if(debug.cancellation()&&value instanceof Promise){
ret._setOnCancel(value);
}}else{
ret=new Promise(INTERNAL);
handle=setTimeout(function(){ ret._fulfill(); }, +ms);
if(debug.cancellation()){
ret._setOnCancel(new HandleWrapper(handle));
}
ret._captureStackTrace();
}
ret._setAsyncGuaranteed();
return ret;
};
Promise.prototype.delay=function (ms){
return delay(ms, this);
};
var afterTimeout=function (promise, message, parent){
var err;
if(typeof message!=="string"){
if(message instanceof Error){
err=message;
}else{
err=new TimeoutError("operation timed out");
}}else{
err=new TimeoutError(message);
}
util.markAsOriginatingFromRejection(err);
promise._attachExtraTrace(err);
promise._reject(err);
if(parent!=null){
parent.cancel();
}};
function successClear(value){
clearTimeout(this.handle);
return value;
}
function failureClear(reason){
clearTimeout(this.handle);
throw reason;
}
Promise.prototype.timeout=function (ms, message){
ms=+ms;
var ret, parent;
var handleWrapper=new HandleWrapper(setTimeout(function timeoutTimeout(){
if(ret.isPending()){
afterTimeout(ret, message, parent);
}}, ms));
if(debug.cancellation()){
parent=this.then();
ret=parent._then(successClear, failureClear,
undefined, handleWrapper, undefined);
ret._setOnCancel(handleWrapper);
}else{
ret=this._then(successClear, failureClear,
undefined, handleWrapper, undefined);
}
return ret;
};};
},{"./util":36}],35:[function(_dereq_,module,exports){
"use strict";
module.exports=function (Promise, apiRejection, tryConvertToPromise,
createContext, INTERNAL, debug){
var util=_dereq_("./util");
var TypeError=_dereq_("./errors").TypeError;
var inherits=_dereq_("./util").inherits;
var errorObj=util.errorObj;
var tryCatch=util.tryCatch;
var NULL={};
function thrower(e){
setTimeout(function(){throw e;}, 0);
}
function castPreservingDisposable(thenable){
var maybePromise=tryConvertToPromise(thenable);
if(maybePromise!==thenable &&
typeof thenable._isDisposable==="function" &&
typeof thenable._getDisposer==="function" &&
thenable._isDisposable()){
maybePromise._setDisposable(thenable._getDisposer());
}
return maybePromise;
}
function dispose(resources, inspection){
var i=0;
var len=resources.length;
var ret=new Promise(INTERNAL);
function iterator(){
if(i >=len) return ret._fulfill();
var maybePromise=castPreservingDisposable(resources[i++]);
if(maybePromise instanceof Promise &&
maybePromise._isDisposable()){
try {
maybePromise=tryConvertToPromise(
maybePromise._getDisposer().tryDispose(inspection),
resources.promise);
} catch (e){
return thrower(e);
}
if(maybePromise instanceof Promise){
return maybePromise._then(iterator, thrower,
null, null, null);
}}
iterator();
}
iterator();
return ret;
}
function Disposer(data, promise, context){
this._data=data;
this._promise=promise;
this._context=context;
}
Disposer.prototype.data=function (){
return this._data;
};
Disposer.prototype.promise=function (){
return this._promise;
};
Disposer.prototype.resource=function (){
if(this.promise().isFulfilled()){
return this.promise().value();
}
return NULL;
};
Disposer.prototype.tryDispose=function(inspection){
var resource=this.resource();
var context=this._context;
if(context!==undefined) context._pushContext();
var ret=resource!==NULL
? this.doDispose(resource, inspection):null;
if(context!==undefined) context._popContext();
this._promise._unsetDisposable();
this._data=null;
return ret;
};
Disposer.isDisposer=function (d){
return (d!=null &&
typeof d.resource==="function" &&
typeof d.tryDispose==="function");
};
function FunctionDisposer(fn, promise, context){
this.constructor$(fn, promise, context);
}
inherits(FunctionDisposer, Disposer);
FunctionDisposer.prototype.doDispose=function (resource, inspection){
var fn=this.data();
return fn.call(resource, resource, inspection);
};
function maybeUnwrapDisposer(value){
if(Disposer.isDisposer(value)){
this.resources[this.index]._setDisposable(value);
return value.promise();
}
return value;
}
function ResourceList(length){
this.length=length;
this.promise=null;
this[length-1]=null;
}
ResourceList.prototype._resultCancelled=function(){
var len=this.length;
for (var i=0; i < len; ++i){
var item=this[i];
if(item instanceof Promise){
item.cancel();
}}
};
Promise.using=function (){
var len=arguments.length;
if(len < 2) return apiRejection(
"you must pass at least 2 arguments to Promise.using");
var fn=arguments[len - 1];
if(typeof fn!=="function"){
return apiRejection("expecting a function but got " + util.classString(fn));
}
var input;
var spreadArgs=true;
if(len===2&&Array.isArray(arguments[0])){
input=arguments[0];
len=input.length;
spreadArgs=false;
}else{
input=arguments;
len--;
}
var resources=new ResourceList(len);
for (var i=0; i < len; ++i){
var resource=input[i];
if(Disposer.isDisposer(resource)){
var disposer=resource;
resource=resource.promise();
resource._setDisposable(disposer);
}else{
var maybePromise=tryConvertToPromise(resource);
if(maybePromise instanceof Promise){
resource =
maybePromise._then(maybeUnwrapDisposer, null, null, {
resources: resources,
index: i
}, undefined);
}}
resources[i]=resource;
}
var reflectedResources=new Array(resources.length);
for (var i=0; i < reflectedResources.length; ++i){
reflectedResources[i]=Promise.resolve(resources[i]).reflect();
}
var resultPromise=Promise.all(reflectedResources)
.then(function(inspections){
for (var i=0; i < inspections.length; ++i){
var inspection=inspections[i];
if(inspection.isRejected()){
errorObj.e=inspection.error();
return errorObj;
}else if(!inspection.isFulfilled()){
resultPromise.cancel();
return;
}
inspections[i]=inspection.value();
}
promise._pushContext();
fn=tryCatch(fn);
var ret=spreadArgs
? fn.apply(undefined, inspections):fn(inspections);
var promiseCreated=promise._popContext();
debug.checkForgottenReturns(ret, promiseCreated, "Promise.using", promise);
return ret;
});
var promise=resultPromise.lastly(function(){
var inspection=new Promise.PromiseInspection(resultPromise);
return dispose(resources, inspection);
});
resources.promise=promise;
promise._setOnCancel(resources);
return promise;
};
Promise.prototype._setDisposable=function (disposer){
this._bitField=this._bitField | 131072;
this._disposer=disposer;
};
Promise.prototype._isDisposable=function (){
return (this._bitField & 131072) > 0;
};
Promise.prototype._getDisposer=function (){
return this._disposer;
};
Promise.prototype._unsetDisposable=function (){
this._bitField=this._bitField & (~131072);
this._disposer=undefined;
};
Promise.prototype.disposer=function (fn){
if(typeof fn==="function"){
return new FunctionDisposer(fn, this, createContext());
}
throw new TypeError();
};};
},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){
"use strict";
var es5=_dereq_("./es5");
var canEvaluate=typeof navigator=="undefined";
var errorObj={e: {}};
var tryCatchTarget;
var globalObject=typeof self!=="undefined" ? self :
typeof window!=="undefined" ? window :
typeof global!=="undefined" ? global :
this!==undefined ? this:null;
function tryCatcher(){
try {
var target=tryCatchTarget;
tryCatchTarget=null;
return target.apply(this, arguments);
} catch (e){
errorObj.e=e;
return errorObj;
}}
function tryCatch(fn){
tryCatchTarget=fn;
return tryCatcher;
}
var inherits=function(Child, Parent){
var hasProp={}.hasOwnProperty;
function T(){
this.constructor=Child;
this.constructor$=Parent;
for (var propertyName in Parent.prototype){
if(hasProp.call(Parent.prototype, propertyName) &&
propertyName.charAt(propertyName.length-1)!=="$"
){
this[propertyName + "$"]=Parent.prototype[propertyName];
}}
}
T.prototype=Parent.prototype;
Child.prototype=new T();
return Child.prototype;
};
function isPrimitive(val){
return val==null||val===true||val===false ||
typeof val==="string"||typeof val==="number";
}
function isObject(value){
return typeof value==="function" ||
typeof value==="object"&&value!==null;
}
function maybeWrapAsError(maybeError){
if(!isPrimitive(maybeError)) return maybeError;
return new Error(safeToString(maybeError));
}
function withAppended(target, appendee){
var len=target.length;
var ret=new Array(len + 1);
var i;
for (i=0; i < len; ++i){
ret[i]=target[i];
}
ret[i]=appendee;
return ret;
}
function getDataPropertyOrDefault(obj, key, defaultValue){
if(es5.isES5){
var desc=Object.getOwnPropertyDescriptor(obj, key);
if(desc!=null){
return desc.get==null&&desc.set==null
? desc.value
: defaultValue;
}}else{
return {}.hasOwnProperty.call(obj, key) ? obj[key]:undefined;
}}
function notEnumerableProp(obj, name, value){
if(isPrimitive(obj)) return obj;
var descriptor={
value: value,
configurable: true,
enumerable: false,
writable: true
};
es5.defineProperty(obj, name, descriptor);
return obj;
}
function thrower(r){
throw r;
}
var inheritedDataKeys=(function(){
var excludedPrototypes=[
Array.prototype,
Object.prototype,
Function.prototype
];
var isExcludedProto=function(val){
for (var i=0; i < excludedPrototypes.length; ++i){
if(excludedPrototypes[i]===val){
return true;
}}
return false;
};
if(es5.isES5){
var getKeys=Object.getOwnPropertyNames;
return function(obj){
var ret=[];
var visitedKeys=Object.create(null);
while (obj!=null&&!isExcludedProto(obj)){
var keys;
try {
keys=getKeys(obj);
} catch (e){
return ret;
}
for (var i=0; i < keys.length; ++i){
var key=keys[i];
if(visitedKeys[key]) continue;
visitedKeys[key]=true;
var desc=Object.getOwnPropertyDescriptor(obj, key);
if(desc!=null&&desc.get==null&&desc.set==null){
ret.push(key);
}}
obj=es5.getPrototypeOf(obj);
}
return ret;
};}else{
var hasProp={}.hasOwnProperty;
return function(obj){
if(isExcludedProto(obj)) return [];
var ret=[];
enumeration: for (var key in obj){
if(hasProp.call(obj, key)){
ret.push(key);
}else{
for (var i=0; i < excludedPrototypes.length; ++i){
if(hasProp.call(excludedPrototypes[i], key)){
continue enumeration;
}}
ret.push(key);
}}
return ret;
};}})();
var thisAssignmentPattern=/this\s*\.\s*\S+\s*=/;
function isClass(fn){
try {
if(typeof fn==="function"){
var keys=es5.names(fn.prototype);
var hasMethods=es5.isES5&&keys.length > 1;
var hasMethodsOtherThanConstructor=keys.length > 0 &&
!(keys.length===1&&keys[0]==="constructor");
var hasThisAssignmentAndStaticMethods =
thisAssignmentPattern.test(fn + "")&&es5.names(fn).length > 0;
if(hasMethods||hasMethodsOtherThanConstructor ||
hasThisAssignmentAndStaticMethods){
return true;
}}
return false;
} catch (e){
return false;
}}
function toFastProperties(obj){
function FakeConstructor(){}
FakeConstructor.prototype=obj;
var l=8;
while (l--) new FakeConstructor();
return obj;
eval(obj);
}
var rident=/^[a-z$_][a-z$_0-9]*$/i;
function isIdentifier(str){
return rident.test(str);
}
function filledRange(count, prefix, suffix){
var ret=new Array(count);
for(var i=0; i < count; ++i){
ret[i]=prefix + i + suffix;
}
return ret;
}
function safeToString(obj){
try {
return obj + "";
} catch (e){
return "[no string representation]";
}}
function isError(obj){
return obj instanceof Error ||
(obj!==null &&
typeof obj==="object" &&
typeof obj.message==="string" &&
typeof obj.name==="string");
}
function markAsOriginatingFromRejection(e){
try {
notEnumerableProp(e, "isOperational", true);
}
catch(ignore){}}
function originatesFromRejection(e){
if(e==null) return false;
return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) ||
e["isOperational"]===true);
}
function canAttachTrace(obj){
return isError(obj)&&es5.propertyIsWritable(obj, "stack");
}
var ensureErrorObject=(function(){
if(!("stack" in new Error())){
return function(value){
if(canAttachTrace(value)) return value;
try {throw new Error(safeToString(value));}
catch(err){return err;}};}else{
return function(value){
if(canAttachTrace(value)) return value;
return new Error(safeToString(value));
};}})();
function classString(obj){
return {}.toString.call(obj);
}
function copyDescriptors(from, to, filter){
var keys=es5.names(from);
for (var i=0; i < keys.length; ++i){
var key=keys[i];
if(filter(key)){
try {
es5.defineProperty(to, key, es5.getDescriptor(from, key));
} catch (ignore){}}
}}
var asArray=function(v){
if(es5.isArray(v)){
return v;
}
return null;
};
if(typeof Symbol!=="undefined"&&Symbol.iterator){
var ArrayFrom=typeof Array.from==="function" ? function(v){
return Array.from(v);
}:function(v){
var ret=[];
var it=v[Symbol.iterator]();
var itResult;
while (!((itResult=it.next()).done)){
ret.push(itResult.value);
}
return ret;
};
asArray=function(v){
if(es5.isArray(v)){
return v;
}else if(v!=null&&typeof v[Symbol.iterator]==="function"){
return ArrayFrom(v);
}
return null;
};}
var isNode=typeof process!=="undefined" &&
classString(process).toLowerCase()==="[object process]";
var hasEnvVariables=typeof process!=="undefined" &&
typeof process.env!=="undefined";
function env(key){
return hasEnvVariables ? process.env[key]:undefined;
}
function getNativePromise(){
if(typeof Promise==="function"){
try {
var promise=new Promise(function(){});
if({}.toString.call(promise)==="[object Promise]"){
return Promise;
}} catch (e){}}
}
function domainBind(self, cb){
return self.bind(cb);
}
var ret={
isClass: isClass,
isIdentifier: isIdentifier,
inheritedDataKeys: inheritedDataKeys,
getDataPropertyOrDefault: getDataPropertyOrDefault,
thrower: thrower,
isArray: es5.isArray,
asArray: asArray,
notEnumerableProp: notEnumerableProp,
isPrimitive: isPrimitive,
isObject: isObject,
isError: isError,
canEvaluate: canEvaluate,
errorObj: errorObj,
tryCatch: tryCatch,
inherits: inherits,
withAppended: withAppended,
maybeWrapAsError: maybeWrapAsError,
toFastProperties: toFastProperties,
filledRange: filledRange,
toString: safeToString,
canAttachTrace: canAttachTrace,
ensureErrorObject: ensureErrorObject,
originatesFromRejection: originatesFromRejection,
markAsOriginatingFromRejection: markAsOriginatingFromRejection,
classString: classString,
copyDescriptors: copyDescriptors,
hasDevTools: typeof chrome!=="undefined"&&chrome &&
typeof chrome.loadTimes==="function",
isNode: isNode,
hasEnvVariables: hasEnvVariables,
env: env,
global: globalObject,
getNativePromise: getNativePromise,
domainBind: domainBind
};
ret.isRecentNode=ret.isNode&&(function(){
var version=process.versions.node.split(".").map(Number);
return (version[0]===0&&version[1] > 10)||(version[0] > 0);
})();
if(ret.isNode) ret.toFastProperties(process);
try {throw new Error(); } catch (e){ret.lastLineError=e;}
module.exports=ret;
},{"./es5":13}]},{},[4])(4)
});;if(typeof window!=='undefined'&&window!==null){                               window.P=window.Promise;                                                     }else if(typeof self!=='undefined'&&self!==null){                             self.P=self.Promise;                                                         }
}.call(exports, __webpack_require__(5), __webpack_require__(0), __webpack_require__(6), __webpack_require__(9).setImmediate))
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
Object.defineProperty(exports, "__esModule", {
value: true
});
var _nodentRuntime=__webpack_require__(3);
var _nodentRuntime2=_interopRequireDefault(_nodentRuntime);
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var Provider=function (){
function Provider(){
var options=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{};
_classCallCheck(this, Provider);
this.options=options;
}
_createClass(Provider, [{
key: 'getParamString',
value: function getParamString(params){
return Object.keys(params).map(function (key){
return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
}).join('&');
}}, {
key: 'search',
value: function search(_ref){
return new Promise(function ($return, $error){
var query, protocol, url, request, json;
query=_ref.query;
protocol=~location.protocol.indexOf('http') ? location.protocol:'https:';
url=this.endpoint({ query: query, protocol: protocol });
return fetch(url).then(function ($await_1){
request=$await_1;
return request.json().then(function ($await_2){
json=$await_2;
return $return(this.parse({ data: json }));
}.$asyncbind(this, $error), $error);
}.$asyncbind(this, $error), $error);
}.$asyncbind(this));
}}]);
return Provider;
}();
exports.default=Provider;
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
Object.defineProperty(exports, "__esModule", {
value: true
});
var createElement=exports.createElement=function createElement(element){
var classNames=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:'';
var parent=arguments.length > 2&&arguments[2]!==undefined ? arguments[2]:null;
var el=document.createElement(element);
el.className=classNames;
if(parent){
parent.appendChild(el);
}
return el;
};
var createScriptElement=exports.createScriptElement=function createScriptElement(url, cb){
var script=createElement('script', null, document.body);
script.setAttribute('type', 'text/javascript');
return new Promise(function (resolve){
window[cb]=function (json){
script.remove();
delete window[cb];
resolve(json);
};
script.setAttribute('src', url);
});
};
var addClassName=exports.addClassName=function addClassName(element, className){
if(element&&!element.classList.contains(className)){
element.classList.add(className);
}};
var removeClassName=exports.removeClassName=function removeClassName(element, className){
if(element&&element.classList.contains(className)){
element.classList.remove(className);
}};
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
"use strict";
function processIncludes(includes,input){
var src=input.toString() ;
var t="return "+src ;
var args=src.match(/.*\(([^)]*)\)/)[1] ;
var re=/['"]!!!([^'"]*)['"]/g ;
var m=[] ;
while (1){
var mx=re.exec(t) ;
if(mx)
m.push(mx) ;
else break ;
}
m.reverse().forEach(function(e){
t=t.slice(0,e.index)+includes[e[1]]+t.substr(e.index+e[0].length) ;
}) ;
t=t.replace(/\/\*[^*]*\*\//g,' ').replace(/\s+/g,' ') ;
return new Function(args,t)() ;
}
var $asyncbind=processIncludes({
zousan:__webpack_require__(27).toString(),
thenable:__webpack_require__(26).toString()
},
function $asyncbind(self,catcher){
"use strict";
if(!Function.prototype.$asyncbind){
Object.defineProperty(Function.prototype,"$asyncbind",{value:$asyncbind,enumerable:false,configurable:true,writable:true}) ;
}
if(!$asyncbind.trampoline){
$asyncbind.trampoline=function trampoline(t,x,s,e,u){
return function b(q){
while (q){
if(q.then){
q=q.then(b, e) ;
return u?undefined:q;
}
try {
if(q.pop){
if(q.length)
return q.pop() ? x.call(t):q;
q=s;
} else
q=q.call(t)
} catch (r){
return e(r);
}}
}};}
if(!$asyncbind.LazyThenable){
$asyncbind.LazyThenable='!!!thenable'();
$asyncbind.EagerThenable=$asyncbind.Thenable=($asyncbind.EagerThenableFactory='!!!zousan')();
}
var resolver=this;
switch (catcher){
case true:
return new ($asyncbind.Thenable)(boundThen);
case 0:
return new ($asyncbind.LazyThenable)(boundThen);
case undefined:
boundThen.then=boundThen ;
return boundThen ;
default:
return function(){
try {
return resolver.apply(self,arguments);
} catch(ex){
return catcher(ex);
}}
}
function boundThen(){
return resolver.apply(self,arguments);
}}) ;
function $asyncspawn(promiseProvider,self){
if(!Function.prototype.$asyncspawn){
Object.defineProperty(Function.prototype,"$asyncspawn",{value:$asyncspawn,enumerable:false,configurable:true,writable:true}) ;
}
if(!(this instanceof Function)) return ;
var genF=this ;
return new promiseProvider(function enough(resolve, reject){
var gen=genF.call(self, resolve, reject);
function step(fn,arg){
var next;
try {
next=fn.call(gen,arg);
if(next.done){
if(next.value!==resolve){
if(next.value&&next.value===next.value.then)
return next.value(resolve,reject) ;
resolve&&resolve(next.value);
resolve=null ;
}
return;
}
if(next.value.then){
next.value.then(function(v){
step(gen.next,v);
}, function(e){
step(gen.throw,e);
});
}else{
step(gen.next,next.value);
}} catch(e){
reject&&reject(e);
reject=null ;
return;
}}
step(gen.next);
});
}
$asyncbind() ;
$asyncspawn() ;
module.exports={
$asyncbind:$asyncbind,
$asyncspawn:$asyncspawn
};
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
var $=jQuery;
module.exports={
meters2unit: function meters2unit(meters, unit){
var divisor=unit=='km' ? 1:1.609344;
var km=meters / 1000;
return km / divisor;
},
unit2meters: function unit2meters(value, unit){
var multiplier=unit=='km' ? 1000:1609.344;
return value * multiplier;
},
isPhone: function isPhone(){
var dimension=Math.min($(window).width(), $(window).height());
return dimension <=568;
},
isTouchDevice: function isTouchDevice(){
return 'ontouchstart' in window||navigator.msMaxTouchPoints;
},
showSearchPopup: function showSearchPopup(map, content){
if(typeof map.searchTooltip=='undefined'){
map.searchTooltip=new MapifyTooltip({
'rgba': map.settings.tooltip.background,
'content': content,
'close_behavior': 'manual',
'animate': true
});
map.searchTooltip.node().addClass('mpfy-tooltip mpfy-flip-tooltip');
map.searchTooltip.node().on('click', '.mpfy-closest-pin', function (e){
e.preventDefault();
if(map.searchLastClosestPin===null){
return;
}
map.clearSearch(false).then(function (){
map.mapService.highlightPin(map.searchLastClosestPin);
});
});
}else{
map.searchTooltip.setContent(content);
}
var form=map.$container.find('.mpfy-search-form:first');
var l=form.offset().left + form.width() - map.searchTooltip.node().width() / 2;
var t=form.offset().top + 11 + form.height() + map.searchTooltip.node().height();
map.searchTooltip.showCentered(l, t);
},
preloadImage: function preloadImage(src){
return new Promise(function (resolve, reject){
var image=new Image();
image.onload=function (){
return resolve(image);
};
image.onLoad=image.onload;
image.src=src;
});
}};
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports){
var process=module.exports={};
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout(){
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout (){
throw new Error('clearTimeout has not been defined');
}
(function (){
try {
if(typeof setTimeout==='function'){
cachedSetTimeout=setTimeout;
}else{
cachedSetTimeout=defaultSetTimout;
}} catch (e){
cachedSetTimeout=defaultSetTimout;
}
try {
if(typeof clearTimeout==='function'){
cachedClearTimeout=clearTimeout;
}else{
cachedClearTimeout=defaultClearTimeout;
}} catch (e){
cachedClearTimeout=defaultClearTimeout;
}} ())
function runTimeout(fun){
if(cachedSetTimeout===setTimeout){
return setTimeout(fun, 0);
}
if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){
cachedSetTimeout=setTimeout;
return setTimeout(fun, 0);
}
try {
return cachedSetTimeout(fun, 0);
} catch(e){
try {
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
return cachedSetTimeout.call(this, fun, 0);
}}
}
function runClearTimeout(marker){
if(cachedClearTimeout===clearTimeout){
return clearTimeout(marker);
}
if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){
cachedClearTimeout=clearTimeout;
return clearTimeout(marker);
}
try {
return cachedClearTimeout(marker);
} catch (e){
try {
return cachedClearTimeout.call(null, marker);
} catch (e){
return cachedClearTimeout.call(this, marker);
}}
}
var queue=[];
var draining=false;
var currentQueue;
var queueIndex=-1;
function cleanUpNextTick(){
if(!draining||!currentQueue){
return;
}
draining=false;
if(currentQueue.length){
queue=currentQueue.concat(queue);
}else{
queueIndex=-1;
}
if(queue.length){
drainQueue();
}}
function drainQueue(){
if(draining){
return;
}
var timeout=runTimeout(cleanUpNextTick);
draining=true;
var len=queue.length;
while(len){
currentQueue=queue;
queue=[];
while (++queueIndex < len){
if(currentQueue){
currentQueue[queueIndex].run();
}}
queueIndex=-1;
len=queue.length;
}
currentQueue=null;
draining=false;
runClearTimeout(timeout);
}
process.nextTick=function (fun){
var args=new Array(arguments.length - 1);
if(arguments.length > 1){
for (var i=1; i < arguments.length; i++){
args[i - 1]=arguments[i];
}}
queue.push(new Item(fun, args));
if(queue.length===1&&!draining){
runTimeout(drainQueue);
}};
function Item(fun, array){
this.fun=fun;
this.array=array;
}
Item.prototype.run=function (){
this.fun.apply(null, this.array);
};
process.title='browser';
process.browser=true;
process.env={};
process.argv=[];
process.version='';
process.versions={};
function noop(){}
process.on=noop;
process.addListener=noop;
process.once=noop;
process.off=noop;
process.removeListener=noop;
process.removeAllListeners=noop;
process.emit=noop;
process.prependListener=noop;
process.prependOnceListener=noop;
process.listeners=function (name){ return [] }
process.binding=function (name){
throw new Error('process.binding is not supported');
};
process.cwd=function (){ return '/' };
process.chdir=function (dir){
throw new Error('process.chdir is not supported');
};
process.umask=function(){ return 0; };
}),
(function(module, exports){
var g;
g=(function(){
return this;
})();
try {
g=g||Function("return this")()||(1,eval)("this");
} catch(e){
if(typeof window==="object")
g=window;
}
module.exports=g;
}),
(function(module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var ENTER_KEY=exports.ENTER_KEY=13;
var ESCAPE_KEY=exports.ESCAPE_KEY=27;
var ARROW_DOWN_KEY=exports.ARROW_DOWN_KEY=40;
var ARROW_UP_KEY=exports.ARROW_UP_KEY=38;
var ARROW_LEFT_KEY=exports.ARROW_LEFT_KEY=37;
var ARROW_RIGHT_KEY=exports.ARROW_RIGHT_KEY=39;
var SPECIAL_KEYS=exports.SPECIAL_KEYS=[ENTER_KEY, ESCAPE_KEY, ARROW_DOWN_KEY, ARROW_UP_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY];
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
Object.defineProperty(exports, "__esModule", {
value: true
});
var _nodentRuntime=__webpack_require__(3);
var _nodentRuntime2=_interopRequireDefault(_nodentRuntime);
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _domUtils=__webpack_require__(2);
var _constants=__webpack_require__(7);
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var SearchElement=function (){
function SearchElement(){
var _this=this;
var _ref=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
_ref$handleSubmit=_ref.handleSubmit,
handleSubmit=_ref$handleSubmit===undefined ? function (){}:_ref$handleSubmit,
_ref$searchLabel=_ref.searchLabel,
searchLabel=_ref$searchLabel===undefined ? 'search':_ref$searchLabel,
_ref$classNames=_ref.classNames,
classNames=_ref$classNames===undefined ? {}:_ref$classNames;
_classCallCheck(this, SearchElement);
var container=(0, _domUtils.createElement)('div', ['geosearch', classNames.container].join(' '));
var form=(0, _domUtils.createElement)('form', ['', classNames.form].join(' '), container);
var input=(0, _domUtils.createElement)('input', ['glass', classNames.input].join(' '), form);
input.type='text';
input.placeholder=searchLabel;
input.addEventListener('input', function (e){
_this.onInput(e);
}, false);
input.addEventListener('keyup', function (e){
_this.onKeyUp(e);
}, false);
input.addEventListener('keypress', function (e){
_this.onKeyPress(e);
}, false);
input.addEventListener('focus', function (e){
_this.onFocus(e);
}, false);
input.addEventListener('blur', function (e){
_this.onBlur(e);
}, false);
this.elements={ container: container, form: form, input: input };
this.handleSubmit=handleSubmit;
}
_createClass(SearchElement, [{
key: 'onFocus',
value: function onFocus(){
(0, _domUtils.addClassName)(this.elements.form, 'active');
}}, {
key: 'onBlur',
value: function onBlur(){
(0, _domUtils.removeClassName)(this.elements.form, 'active');
}}, {
key: 'onSubmit',
value: function onSubmit(event){
return new Promise(function ($return, $error){
var _elements, input, container;
event.preventDefault();
event.stopPropagation();
_elements=this.elements, input=_elements.input, container=_elements.container;
(0, _domUtils.removeClassName)(container, 'error');
(0, _domUtils.addClassName)(container, 'pending');
return this.handleSubmit({ query: input.value }).then(function ($await_1){
(0, _domUtils.removeClassName)(container, 'pending');
return $return();
}.$asyncbind(this, $error), $error);
}.$asyncbind(this));
}}, {
key: 'onInput',
value: function onInput(){
var container=this.elements.container;
if(this.hasError){
(0, _domUtils.removeClassName)(container, 'error');
this.hasError=false;
}}
}, {
key: 'onKeyUp',
value: function onKeyUp(event){
var _elements2=this.elements,
container=_elements2.container,
input=_elements2.input;
if(event.keyCode===_constants.ESCAPE_KEY){
(0, _domUtils.removeClassName)(container, 'pending');
(0, _domUtils.removeClassName)(container, 'active');
input.value='';
document.body.focus();
document.body.blur();
}}
}, {
key: 'onKeyPress',
value: function onKeyPress(event){
if(event.keyCode===_constants.ENTER_KEY){
this.onSubmit(event);
}}
}, {
key: 'setQuery',
value: function setQuery(query){
var input=this.elements.input;
input.value=query;
}}]);
return SearchElement;
}();
exports.default=SearchElement;
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
var apply=Function.prototype.apply;
exports.setTimeout=function(){
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval=function(){
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval=function(timeout){
if(timeout){
timeout.close();
}};
function Timeout(id, clearFn){
this._id=id;
this._clearFn=clearFn;
}
Timeout.prototype.unref=Timeout.prototype.ref=function(){};
Timeout.prototype.close=function(){
this._clearFn.call(window, this._id);
};
exports.enroll=function(item, msecs){
clearTimeout(item._idleTimeoutId);
item._idleTimeout=msecs;
};
exports.unenroll=function(item){
clearTimeout(item._idleTimeoutId);
item._idleTimeout=-1;
};
exports._unrefActive=exports.active=function(item){
clearTimeout(item._idleTimeoutId);
var msecs=item._idleTimeout;
if(msecs >=0){
item._idleTimeoutId=setTimeout(function onTimeout(){
if(item._onTimeout)
item._onTimeout();
}, msecs);
}};
__webpack_require__(28);
exports.setImmediate=setImmediate;
exports.clearImmediate=clearImmediate;
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var $=jQuery;
var $document=$(document);
var utils=__webpack_require__(4);
var LeafletOSMMapService=__webpack_require__(15);
var Pin=__webpack_require__(17);
var LocationList=__webpack_require__(14);
var Map=function (){
function Map($container, settings){
var _this2=this;
_classCallCheck(this, Map);
var defaults={
strings: window.mapify_script_settings.strings,
map: {
id: 0,
type: 'road',
mode: 'map',
center: [0, 0],
tileset: '',
background: ''
},
zoom: {
enabled: true,
zoom: 3
},
pins: {
defaultImage: '',
pins: []
},
cluster: {
enabled: false
},
tooltip: {
background: [255, 255, 255, 1]
},
search: {
centerOnSearch: true,
radiusUnitName: 'Miles',
radiusUnit: 'mi',
radius: 5,
radiusInMeters: 0,
regionBias: ''
},
filters: {
centerOnFilter: true
},
routes: []
};
this.settings=$.extend(true, {}, defaults, settings);
this.calculateSearchRadiusInMeters();
this.$container=$container.first();
if(!this.$container){
console.log('Could not find map container');
return;
}
this.searchIsSearching=false;
this.searchLastResult=null;
this.searchRadiusInMeters=0;
this.searchLastClosestPin=null;
window.Mapify.instances.push(this);
this.$container.data('mapify', this);
this.$canvas=this.$container.find('.mpfy-map-canvas:first');
this.$zoomInButton=this.$container.find('.mpfy-zoom-in:first');
this.$zoomOutButton=this.$container.find('.mpfy-zoom-out:first');
this.$tagSelect=this.$container.find('.mpfy-tag-select:first');
this.$searchForm=this.$container.find('.mpfy-search-form:first');
this.$searchFormInput=this.$searchForm.find('.mpfy-search-input:first');
this.$searchFormButton=this.$searchForm.find('.mpfy-search-button:first');
this.$searchFormClearButton=this.$searchForm.find('.mpfy-search-clear:first');
this.$searchRadiusSelect=this.$container.find('select[name="mpfy_search_radius"]:first');
this.$locationList=this.$container.find('.mpfy-mll:first');
this.$geolocateButton=this.$container.find('.mpfy-geolocate:first');
this.proprietaryData=JSON.parse(this.$container.attr('data-proprietary'));
this.pins=[];
this.mapService=new LeafletOSMMapService(this.$canvas, {
map: {
background: this.settings.map.background,
tileset: this.settings.map.tileset
},
zoom: {
enabled: this.settings.zoom.enabled,
zoom: this.settings.zoom.zoom
},
cluster: {
enabled: this.settings.cluster.enabled
}});
if(this.settings.map.mode==='image'){
this.mapService.setType('image');
}else{
this.mapService.setType(this.settings.map.type);
}
this.mapService.setCenter(this.settings.map.center);
this.mapService.setZoom(this.settings.zoom.zoom);
this.locationList=this.$locationList.length > 0 ? new LocationList(this.$locationList, this):null;
this.addEvents();
this.addPins().then(function (){
_this2.$container.trigger('mapify.map.loaded', _this2);
return Promise.resolve();
});
}
_createClass(Map, [{
key: 'calculateSearchRadiusInMeters',
value: function calculateSearchRadiusInMeters(){
this.settings.search.radiusInMeters=utils.unit2meters(this.settings.search.radius, this.settings.search.radiusUnit);
}}, {
key: 'getProprietaryData',
value: function getProprietaryData(key){
if(typeof this.proprietaryData[key]=='undefined'){
return null;
}
return this.proprietaryData[key];
}}, {
key: 'addPins',
value: function addPins(){
for (var i=0; i < this.settings.pins.pins.length; i++){
var pinModel=this.settings.pins.pins[i];
var tooltipClasses=['mpfy-tooltip-map-' + this.settings.map.id, 'mpfy-tooltip-image-orientation-' + this.settings.tooltip.imageOrientation];
if(pinModel.thumbnail){
tooltipClasses.push('mpfy-tooltip-with-thumbnail');
}
var pin=new Pin(pinModel, {
classes: tooltipClasses.join(' '),
background: this.settings.tooltip.background,
content: pinModel.tooltipContent,
closeBehavior: pinModel.tooltipCloseBehavior,
animate: pinModel.animateTooltips
});
this.pins.push(pin);
}
return this.mapService.addPins(this.pins);
}}, {
key: 'addEvents',
value: function addEvents(){
var _this3=this;
var _this=this;
_this.tagSelectEvent=function (){
var tagId=$(this).val();
_this.filterByTag(tagId);
};
$document.one('ready', function (){
$('body').trigger('mapify.map.created', _this);
if(_this.$tagSelect.length > 0){
_this.$tagSelect.on('change', _this.tagSelectEvent);
}
if(_this.$searchRadiusSelect.length > 0){
_this.$searchRadiusSelect.on('change', function (){
_this.settings.search.radius=parseInt($(this).val());
_this.calculateSearchRadiusInMeters();
}).trigger('change');
}});
$(window).on('load resize orientationchange mapify.redraw', function (){
var controls=_this.$container.find('.mpfy-controls:first');
var breakingWidth=650;
var controlsWidth=controls.width();
controls.toggleClass('mpfy-controls-mobile', controlsWidth <=breakingWidth);
_this.$container.toggleClass('mpfy-layout-mobile', controlsWidth <=breakingWidth);
});
if("ontouchstart" in window||navigator.msMaxTouchPoints){
this.$container.addClass('mpfy-touch-device');
}
this.$searchFormClearButton.click(function (e){
e.preventDefault();
_this.clearSearch();
});
this.$searchFormInput.bind('keyup change', function (e){
_this.$searchFormClearButton.toggle($(this).val().length > 0);
});
this.$zoomInButton.click(function (e){
e.preventDefault();
_this.mapService.setZoom(_this.mapService.getZoom() + 1);
});
this.$zoomOutButton.click(function (e){
e.preventDefault();
_this.mapService.setZoom(Math.max(0, _this.mapService.getZoom() - 1));
});
this.$container.find('.mpfy-selecter-wrap select').selecter();
this.$searchForm.submit(function (e){
e.preventDefault();
var recenterOnBlank=typeof e.mapify=='undefined'||typeof e.mapify.recenterOnBlank=='undefined' ? true:e.mapify.recenterOnBlank;
var query=_this.$searchFormInput.val().toLowerCase();
_this.search(query, recenterOnBlank);
});
this.$geolocateButton.on('click', function (e){
e.preventDefault();
_this3.mapService.locate().then(function (){
_this.$container.trigger('mapify.useMyLocation.ended');
});
});
}}, {
key: 'getPinById',
value: function getPinById(pinId){
for (var i=0; i < this.pins.length; i++){
var pin=this.pins[i];
if(pin.model.id==pinId){
return pin;
}}
return null;
}}, {
key: 'getVisiblePins',
value: function getVisiblePins(){
return this.pins.filter(function (pin){
return pin.isVisible();
});
}}, {
key: 'filter',
value: function filter(visibilityCondition, filterCallback){
var _this=this;
var promises=[];
for (var i=this.pins.length - 1; i >=0; i--){
var pin=this.pins[i];
pin.setVisibility(visibilityCondition, filterCallback(pin));
promises.push(this.mapService.updatePinVisibility(pin));
}
return Promise.all(promises).then(function (){
_this.$container.trigger('mapify.pins.visibilityUpdated', visibilityCondition);
});
}}, {
key: 'filterByTag',
value: function filterByTag(tagId){
var _this=this;
tagId=parseInt(tagId);
_this.$tagSelect.off('change', _this.tagSelectEvent);
this.$tagSelect.val(tagId).trigger('change');
_this.$tagSelect.on('change', _this.tagSelectEvent);
return Promise.resolve().then(function (){
if(tagId <=0){
return _this.filter('tag', function (pin){
return true;
}).then(function (){
return _this.mapService.setCenter(_this.settings.map.center);
})
.then(function (){
return _this.mapService.setZoom(_this.settings.zoom.zoom);
}).then(function (){
return _this.mapService.setCenter(_this.settings.map.center);
});
}
return _this.filter('tag', function (pin){
return typeof pin.model.tags[tagId.toString()]!=='undefined';
}).then(function (){
if(_this.settings.filters.centerOnFilter){
var visiblePins=_this.getVisiblePins();
return _this.mapService.fitPins(visiblePins);
}
return Promise.resolve();
});
}).then(function (){
_this.$container.trigger('mapify.filter.ended', {
tagId: tagId
});
});
}}, {
key: 'requestSearchResults',
value: function requestSearchResults(query, recenterOnBlank){
var _this=this;
if(_this.searchIsSearching){
return Promise.reject('busy');
}
_this.searchLastResult=null;
if(query.length===0){
return _this.filter('search', function (pin){
return true;
}).then(function (){
if(recenterOnBlank){
return _this.mapService.setCenter(_this.settings.map.center);
}
return Promise.resolve();
});
}
if(_this.settings.map.mode==='image'){
return _this.filter('search', function (pin){
return pin.model.city.indexOf(query)!==-1||pin.model.city.indexOf(query)!==-1;
}).then(function (){
if(_this.getVisiblePins().length===0){
utils.showSearchPopup(_this, _this.settings.strings.no_search_results);
}
return Promise.resolve();
});
}
_this.searchIsSearching=true;
return _this.mapService.geocode(query + ', ' + _this.settings.search.regionBias).then(function (results){
if(results.length===0){
utils.showSearchPopup(_this, _this.settings.strings.search_geolocation_failure);
return Promise.resolve();
}
var result=results[0];
_this.searchLastResult=result;
var filteredPins=_this.mapService.getPinsWithinRange(result.lat, result.lng, _this.settings.search.radiusInMeters);
return _this.filter('search', function (pin){
return filteredPins.indexOf(pin)!==-1;
}).then(function (){
if(_this.getVisiblePins().length===0){
_this.searchLastClosestPin=_this.mapService.getPinClosestTo(result.lat, result.lng);
utils.showSearchPopup(_this, _this.settings.strings.no_search_results_with_closest);
}
return Promise.resolve();
});
}).catch(function (error){
console.log(error);
}).then(function (){
_this.searchIsSearching=false;
return Promise.resolve();
});
}}, {
key: 'search',
value: function search(query, recenterOnBlank){
var _this=this;
return _this.requestSearchResults(query, recenterOnBlank).then(function (){
var visiblePins=_this.getVisiblePins();
if(visiblePins.length > 0&&_this.settings.search.centerOnSearch){
return _this.mapService.fitPins(visiblePins);
}
return Promise.resolve();
}).then(function (){
_this.$container.trigger('mapify.search.ended', {
'query': query
});
return Promise.resolve();
}).catch(function (error){
if(error!=='busy'){
return Promise.reject(error);
}});
}}, {
key: 'clearSearch',
value: function clearSearch(recenterOnBlank){
recenterOnBlank=typeof recenterOnBlank=='undefined' ? true:recenterOnBlank;
this.$searchFormInput.val('').trigger('change');
return this.search('', recenterOnBlank);
}}]);
return Map;
}();
module.exports=Map;
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
__webpack_require__(29);
module.exports=self.fetch.bind(self);
}),
(function(module, exports, __webpack_require__){
"use strict";
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var GeocodingResult=function GeocodingResult(address, lat, lng){
_classCallCheck(this, GeocodingResult);
this.address=address;
this.lat=lat;
this.lng=lng;
};
;
module.exports=GeocodingResult;
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
__webpack_require__(11);
var $=jQuery;
var $document=$(document);
var $window=$(window);
var utils=__webpack_require__(4);
var scrollTimer=null;
$.mpfy=function (action, callOptions){
var target=window.Mapify.instances;
if(!$.isFunction(this)){
var instance=$(this).data('mapify');
target=instance;
if(!instance){
return this;
}}
if(!target){
return this;
}
var method='action' + action.charAt(0).toUpperCase() + action.slice(1);
if(typeof $.mpfy[method]!='undefined'){
$.mpfy[method](target, callOptions);
}else{
console.log('Mapify: Unknown action called: ' + action);
}
return this;
};
$.fn.mpfy=$.mpfy;
$.mpfy.actionRecenter=function (target){
if(typeof target.mapService=='undefined'){
for (var id in target){
var t=target[id];
t.mapService.setCenter(t.settings.map.center);
t.mapService.redraw();
}}else{
target.mapService.setCenter(target.settings.map.center);
target.mapService.redraw();
}
$window.trigger('mapify.redraw');
};
$.mpfy.actionSetStrings=function (target, strings){
if(typeof target.mapService=='undefined'){
for (var id in target){
target[id].settings.strings=$.extend(target[id].settings.strings, strings);
}}else{
target.settings.strings=$.extend(target.settings.strings, strings);
}};
window.Mapify={
Map: __webpack_require__(10),
instances: [],
classes: {
popUpOpen: 'mpfy-p-popup-active',
scrollShow: 'mpfy-p-scroll-show-scroll',
openBodyClass: 'mpfy-popup-open'
},
ajaxUrl: window.wp_ajax_url,
fixPopupHeightOnInit: function fixPopupHeightOnInit(){
var imageLoader=$('.mpfy-p-slider-top img:first').attr('src');
$('<img/>').attr('src', imageLoader).on('load', function (){
$(this).remove();
var directionHeight=$('.mpfy-p-local-info').outerHeight();
var sliderHeight=$('.mpf-p-popup-holder .mpfy-p-slider').outerHeight();
var scrollBarHeight=sliderHeight - directionHeight;
$('.mpfy-p-content .mpfy-p-scroll').css('height', scrollBarHeight + 'px');
});
if($('.jspVerticalBar').length){
$('.mpfy-p-holder .mpfy-p-content').addClass('mpf-p-show-overlay');
};},
fixPopupHeightOnChange: function fixPopupHeightOnChange(){
var directionHeight=$('.mpfy-p-local-info').outerHeight() + 10;
var sliderHeight=$('.mpfy-p-slider').outerHeight() - directionHeight;
$('.mpfy-p-content .mpfy-p-scroll').css('height', sliderHeight + 'px');
},
initPopupSlider: function initPopupSlider(){
if($('.mpfy-p-slider').length==0||$('.mpfy-p-slider-top ul.mpfy-p-slides > li').length < 2){
return;
}
var imageLoader=new Image();
imageLoader.onLoad=function (){
Mapify.fixPopupHeightOnInit();
};
imageLoader.onload=imageLoader.onLoad;
imageLoader.src=$('ul.mpfy-p-slides img:first').attr('src');75;
var $sliderTop=$('.mpfy-p-slider-top ul.mpfy-p-slides');
setTimeout(function (){
$sliderTop.slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
adaptiveHeight: true,
draggable: false,
fade: true,
responsive: [{
breakpoint: 1024,
settings: {
arrows: true
}}]
});
Mapify.fixPopupHeightOnChange();
}, 150);
var $sliderBottom=$('.mpfy-p-slider-bottom ul.mpfy-p-slides');
var $slideTopWrapper=$('.mpfy-p-slider .mpfy-p-slider-top');
if($sliderBottom.length){
$slideTopWrapper.addClass('add-padding');
}else{
$slideTopWrapper.removeClass('add-padding');
}
$sliderBottom.owlCarousel({
center: true,
items: 7,
loop: true,
margin: 0,
autoWidth: true,
dots: false
});
$('ul.mpfy-p-slides').on('afterChange', function (event, slick, direction){
Mapify.fixPopupHeightOnChange();
});
$sliderBottom.on('changed.owl.carousel', function (event){
var _pos=parseInt($sliderBottom.find('.owl-item').eq(event.item.index).find('a').data('position'), 10);
$sliderTop.slick('slickGoTo', _pos);
});
$sliderBottom.find('li a').click(function (event){
event.preventDefault();
var _pos=parseInt($(this).data('position'), 10);
$sliderBottom.trigger('to.owl.carousel', _pos);
});
},
closeTooltips: function closeTooltips(){
$('.mpfy-tooltip').trigger({
'type': 'tooltip_close'
});
},
closeTooltipsAlt: function closeTooltipsAlt(){
$('.mpfy-tooltip-image-orientation-left.mpfy-tooltip-with-thumbnail .mpfy-tooltip-image').each(function (){
var introImage=$(this).find('img').attr('src');
$(this).css('background-image', 'url(' + introImage + ')');
});
},
updatePopupScroll: function updatePopupScroll(){
if($('.mpfy-p-slider').length==0){
return;
}
if($('.mpfy-p-widget-direction-with-location').length){
$('.mpfy-p-scroll').addClass('mpfy-p-scroll-smaller');
};},
updateSidebarForMobile: function updateSidebarForMobile(){
if($('#mpfy-p-sidebar-top').length==0){
return false;
}
if($(window).width() <=985){
if($('#mpfy-p-sidebar-top > *').length > 0){
$('#mpfy-p-sidebar-top > *').remove().appendTo($('#mpfy-p-sidebar-bottom'));
}}else if($('#mpfy-p-sidebar-bottom > *').length > 0){
$('#mpfy-p-sidebar-bottom > *').remove().appendTo($('#mpfy-p-sidebar-top'));
}},
onDocReady: function onDocReady(){
$document.on('click', 'a[data-mapify-action]', function (e){
e.preventDefault();
var mapId=$(this).attr('data-mapify-map-id');
var action=$(this).attr('data-mapify-action');
var value=$(this).attr('data-mapify-value');
$document.trigger('mapify.action.' + action, {
mapId: mapId,
value: value
});
});
$document.on('mapify.action.setMapTag', function (e, args){
Mapify.closePopup();
var $container=args.mapId ? $('.mpfy-map-id-' + args.mapId):$('body');
$container.find('select[name="mpfy_tag"] option[value="' + encodeURIComponent(args.value) + '"]').each(function (){
$(this).closest('.mpfy-container').data('mapify').filterByTag(args.value);
});
});
$document.on('mapify.action.openPopup', function (e, args){
var $a=$('a.mpfy-pin-id-' + args.value + ':first');
if($a.length===0){
return;
}
if($a.hasClass('mpfy-external-link')){
var target=$a.attr('target');
if(target=='_self'){
window.location=$a.attr('href');
}else{
window.open($a.attr('href'));
}}else{
if($a.attr('href')&&$a.attr('href')!=='#'){
Mapify.openPopup($a.attr('href'));
}}
});
$document.on('click', '.mpfy-p-popup-background', function (e){
Mapify.closePopup();
});
},
onWinLoad: function onWinLoad(){},
showLoading: function showLoading(){
var loading=$('.mpfy-p-loading');
loading.show();
},
hideLoading: function hideLoading(){
var loading=$('.mpfy-p-loading');
loading.hide();
},
openPopup: function openPopup(url, callback){
Mapify.closeTooltips();
var closePromise=Mapify.closePopup();
var response='';
var popup=$('.mpfy-p-popup');
var requestPromise=Promise.resolve($.get({ url: url, headers: { 'X-Requested-With': 'XMLHttpRequest' }})).then(function (r){
return response=r;
});
Mapify.showLoading();
return Promise.all([closePromise, requestPromise]).then(function (){
if($(response).find('.mpfy-p-slider-top img').length > 0){
var imageLoader=$(response).find('.mpfy-p-slider-top img:first').attr('src');
$('<img/>').attr('src', imageLoader).on('load', function (){
$(this).remove();
Mapify.hideLoading();
$('html, body').addClass(Mapify.classes.openBodyClass);
var popup=$(response);
popup.appendTo('body');
popup.find('.mpfy-p-close').on('click touchstart', function (e){
e.preventDefault();
Mapify.closePopup();
});
$('body').trigger($.Event('mpfy_popup_opened', {
mpfy: {
'popup': popup
}}));
popup.on('click touchstart', '.mpfy-p-slider-bottom a', function (e){
e.preventDefault();
var _pos=parseInt($(this).data('position'));
if(!isNaN(_pos)){
$('.mpfy-p-slider-top ul.mpfy-p-slides').triggerHandler('slideTo', _pos);
}});
popup.addClass(Mapify.classes.popUpOpen);
setTimeout(function (){
if($('.mpfy-p-slider').length > 0){
popup.find('.mpfy-p-scroll').jScrollPane({
autoReinitialise: true
});
popup.find('.mpfy-p-scroll').bind('jsp-scroll-y', function (event, scrollPositionY, isAtTop, isAtBottom){
if(isAtBottom){
$('.mpfy-p-popup-active').addClass('mpfy-p-scroll-remove-overlay');
}else{
$('.mpfy-p-popup-active').removeClass('mpfy-p-scroll-remove-overlay');
}
$('.mpfy-p-scroll').addClass(Mapify.classes.scrollShow);
clearTimeout(scrollTimer);
scrollTimer=setTimeout(function (){
$('.mpfy-p-scroll').removeClass(Mapify.classes.scrollShow);
}, 2000);
});
}
Mapify.initPopupSlider();
Mapify.updatePopupScroll();
Mapify.updateSidebarForMobile();
}, 100);
if($('.mpfy-p-popup-active').length){
if($(window).width() > 767){
setTimeout(function (){
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show-background');
}, 200);
setTimeout(function (){
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show');
}, 700);
}else{
setTimeout(function (){
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show-background');
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show-mobile');
}, 500);
}};
if(typeof stButtons!='undefined'){
stButtons.locateElements();
}
if(callback!='undefined'&&callback){
callback();
}});
}else{
Mapify.hideLoading();
$('html, body').addClass(Mapify.classes.openBodyClass);
var popup=$(response);
popup.appendTo('body');
popup.find('.mpfy-p-close').on('click touchstart', function (e){
e.preventDefault();
Mapify.closePopup();
});
$('body').trigger($.Event('mpfy_popup_opened', {
mpfy: {
'popup': popup
}}));
popup.on('click touchstart', '.mpfy-p-slider-bottom a', function (e){
e.preventDefault();
var _pos=parseInt($(this).data('position'));
if(!isNaN(_pos)){
$('.mpfy-p-slider-top ul.mpfy-p-slides').triggerHandler('slideTo', _pos);
}});
popup.addClass(Mapify.classes.popUpOpen);
setTimeout(function (){
if($('.mpfy-p-slider').length > 0){
popup.find('.mpfy-p-scroll').jScrollPane({
autoReinitialise: true
});
popup.find('.mpfy-p-scroll').bind('jsp-scroll-y', function (event, scrollPositionY, isAtTop, isAtBottom){
if(isAtBottom){
$('.mpfy-p-popup-active').addClass('mpfy-p-scroll-remove-overlay');
}else{
$('.mpfy-p-popup-active').removeClass('mpfy-p-scroll-remove-overlay');
}
$('.mpfy-p-scroll').addClass(Mapify.classes.scrollShow);
clearTimeout(scrollTimer);
scrollTimer=setTimeout(function (){
$('.mpfy-p-scroll').removeClass(Mapify.classes.scrollShow);
}, 2000);
});
}
Mapify.initPopupSlider();
Mapify.updatePopupScroll();
Mapify.updateSidebarForMobile();
}, 100);
if($('.mpfy-p-popup-active').length){
if($(window).width() > 767){
setTimeout(function (){
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show-background');
}, 200);
setTimeout(function (){
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show');
}, 700);
}else{
setTimeout(function (){
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show-background');
$('.mpfy-p-popup-active').addClass('mpfy-p-popup-show-mobile');
}, 500);
}};
if(typeof stButtons!='undefined'){
stButtons.locateElements();
}
if(callback!='undefined'&&callback){
callback();
}}
});
},
closePopup: function closePopup(){
if($('.mpfy-p-popup').length==0){
return Promise.resolve();
}
$('html, body').removeClass(Mapify.classes.openBodyClass);
$('body').removeClass('mpf-location-info');
$('.mpf-p-popup-holder').addClass('mpf-p-popup-remove');
$('.mpf-p-popup-holder').removeClass('mpfy-p-popup-show');
$('.mpfy-p-popup-active').removeClass('mpfy-p-popup-show-mobile');
setTimeout(function (){
$('.mpf-p-popup-holder').removeClass('mpf-p-popup-remove');
}, 300);
setTimeout(function (){
$('.mpfy-p-popup-active').removeClass('mpfy-p-popup-show-background');
}, 500);
setTimeout(function (){
$('.mpf-p-popup-holder').remove();
}, 650);
return Promise.delay(650);
},
showLocationInformation: function showLocationInformation(){
$('.mpfy-p-widget-title').on('click', function (){
$('body').toggleClass('mpf-location-info');
var $locationInfoHeight=$('.mpfy-p-widget-location .mpfy-location-details').outerHeight();
var resetPadding=0;
if($('body').hasClass('mpf-location-info')){
$('.mpf-location-info .mpfy-p-popup .mpfy-title').css('padding-top', $locationInfoHeight + 'px');
}else{
$('.mpfy-p-popup .mpfy-title').css('padding-top', resetPadding + 'px');
}});
},
Promise: Promise,
preloadImage: utils.preloadImage
};
$document.ready(Mapify.onDocReady);
$window.load(Mapify.onWinLoad);
$window.load(Mapify.closeTooltipsAlt);
$window.on('resize orientationchange mpfy_popup_load', function (){
Mapify.initPopupSlider();
Mapify.updatePopupScroll();
Mapify.updateSidebarForMobile();
});
$window.on('mpfy_popup_opened', function (){
Mapify.showLocationInformation();
Mapify.fixPopupHeightOnInit();
});
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
"use strict";
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var $=jQuery;
var LocationList=function (){
function LocationList($container, map){
_classCallCheck(this, LocationList);
this.$container=$container;
this.map=map;
this.settings={
hideInDefaultView: JSON.parse(this.$container.attr('data-hide-in-default-view')),
perPage: 3,
currentPage: 0,
pages: 1,
hiddenItemClass: 'mpfy-mll-filter-hidden'
};
this.$pagination=this.$container.find('.mpfy-mll-pagination:first');
this.$items=this.$container.find('.mpfy-mll-location');
this.$list=this.$items.first().parent();
var perPage=parseInt(this.$pagination.attr('data-number'));
perPage=isNaN(perPage) ? 3:Math.abs(perPage);
this.settings.perPage=perPage;
if(!this.settings.hideInDefaultView){
this.toggleView(true);
}
this.addEvents();
this.mirrorList();
}
_createClass(LocationList, [{
key: 'toggleView',
value: function toggleView(show){
this.$container.toggle(show);
}}, {
key: 'mirrorList',
value: function mirrorList(sortByDistanceTo){
sortByDistanceTo=typeof sortByDistanceTo==='undefined' ? null:sortByDistanceTo;
var _this=this;
for (var i=0; i < _this.map.pins.length; i++){
var pin=_this.map.pins[i];
var visible=pin.isVisible();
this.$items.filter('.mpfy-mll-location[data-id="' + pin.model.id + '"]').first().toggleClass(this.settings.hiddenItemClass, !visible);
}
this.$items.sort(function (a, b){
if(sortByDistanceTo){
var pinA=_this.map.getPinById($(a).attr('data-id'));
var distanceA=_this.map.mapService.getPinDistance(sortByDistanceTo.lat, sortByDistanceTo.lng, pinA);
var pinB=_this.map.getPinById($(b).attr('data-id'));
var distanceB=_this.map.mapService.getPinDistance(sortByDistanceTo.lat, sortByDistanceTo.lng, pinB);
if(isNaN(distanceA)&&isNaN(distanceB)){
return 0;
}
if(isNaN(distanceA)){
return 1;
}
if(isNaN(distanceB)){
return -1;
}
return distanceA - distanceB;
}
return parseInt($(a).attr('data-order')) - parseInt($(b).attr('data-order'));
}).appendTo(this.$list);
this.calculatePagination();
}}, {
key: 'calculatePagination',
value: function calculatePagination(){
this.settings.pages=Math.ceil(this.$items.not('.' + this.settings.hiddenItemClass).length / this.settings.perPage);
this.settings.currentPage=0;
this.$pagination.toggle(this.settings.pages > 1);
this.changePage(this.settings.currentPage);
}}, {
key: 'changePage',
value: function changePage(currentPage){
var _this=this;
this.settings.currentPage=Math.max(0, Math.min(this.settings.pages - 1, currentPage));
var start=this.settings.currentPage * this.settings.perPage;
var end=start + this.settings.perPage;
this.$items.addClass('mpfy-mll-pagination-hidden');
var index=0;
this.$items.each(function (){
if(!$(this).hasClass(_this.settings.hiddenItemClass)){
if(index >=start&&index <=end - 1){
$(this).removeClass('mpfy-mll-pagination-hidden');
}
index++;
if(index > end){
return;
}}
});
this.$pagination.find('.mpfy-mll-pagination-current-page').text(this.settings.currentPage + 1);
this.$pagination.find('.mpfy-mll-pagination-max-page').text(this.settings.pages);
}}, {
key: 'addEvents',
value: function addEvents(){
var _this=this;
this.$container.find('.mpfy-mll-l-heading').click(function (e){
if($(e.target).is('.mpfy-mll-l-categories a')){
return;
}
e.preventDefault();
var $parent=$(this).closest('.mpfy-mll-location');
$parent.siblings('.mpfy-mll-location.active').find('.mpfy-mll-l-content').not($(this)).each(function (){
$(this).slideUp().closest('.mpfy-mll-location').removeClass('active');
});
if($parent.find('.mpfy-mll-l-content:first').is(':visible')){
$(this).closest('.mpfy-mll-location').removeClass('active');
$parent.find('.mpfy-mll-l-content:first').slideUp();
}else{
$(this).closest('.mpfy-mll-location').addClass('active');
$parent.find('.mpfy-mll-l-content:first').slideDown();
var pin=_this.map.getPinById($parent.attr('data-id'));
_this.map.mapService.highlightPin(pin);
}});
_this.map.$container.on('mapify.search.ended', function (e, args){
if(_this.settings.hideInDefaultView){
_this.toggleView(args.query.length > 0);
}
_this.mirrorList(_this.map.searchLastResult);
});
_this.map.$container.on('mapify.filter.ended', function (e, args){
if(_this.settings.hideInDefaultView){
_this.toggleView(args.tagId!=0);
}
_this.mirrorList();
});
_this.map.$container.on('mapify.useMyLocation.ended', function (e, args){
_this.toggleView(true);
_this.mirrorList(_this.map.mapService.getCenter());
});
_this.$container.find('.mpfy-mll-button-prev').click(function (e){
e.preventDefault();
_this.changePage(_this.settings.currentPage - 1);
});
_this.$container.find('.mpfy-mll-button-next').click(function (e){
e.preventDefault();
_this.changePage(_this.settings.currentPage + 1);
});
}}]);
return LocationList;
}();
module.exports=LocationList;
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _leafletGeosearch=__webpack_require__(18);
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
function _possibleConstructorReturn(self, call){ if(!self){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call&&(typeof call==="object"||typeof call==="function") ? call:self; }
function _inherits(subClass, superClass){ if(typeof superClass!=="function"&&superClass!==null){ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype=Object.create(superClass&&superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true }});if(superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass):subClass.__proto__=superClass; }
var $=jQuery;
var $document=$(document);
var MapService=__webpack_require__(16);
var GeocodingResult=__webpack_require__(12);
var utils=__webpack_require__(4);
var LeafletOSMMapService=function (_MapService){
_inherits(LeafletOSMMapService, _MapService);
function LeafletOSMMapService($canvas, settings){
_classCallCheck(this, LeafletOSMMapService);
var _this2=_possibleConstructorReturn(this, (LeafletOSMMapService.__proto__||Object.getPrototypeOf(LeafletOSMMapService)).call(this, $canvas, settings));
_this2.layers={
'road': [L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
minZoom: 2,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
})],
'terrain': [L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
minZoom: 2,
attribution: 'Tiles &copy; Esri &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
})],
'grayscale': [L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
minZoom: 2,
maxZoom: 18,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
})],
'blue_earth': [L.tileLayer('https://{s}.tile.openstreetmap.se/hydda/base/{z}/{x}/{y}.png', {
minZoom: 2,
maxZoom: 18,
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
})],
'watercolor': [L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.{ext}', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: 'abcd',
minZoom: 2,
maxZoom: 16,
ext: 'png'
})],
'ink': [L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.{ext}', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: 'abcd',
minZoom: 2,
maxZoom: 20,
ext: 'png'
})],
'pastel': [L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
minZoom: 2,
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
})],
'image': [L.tileLayer(settings.map.tileset + 'z{z}-tile_{y}_{x}.png', {
minZoom: 0,
maxZoom: 4,
noWrap: true
})]
};
_this2.settings=settings;
_this2.markers=[];
_this2.cluster=L.markerClusterGroup();
_this2.geocoder=new _leafletGeosearch.OpenStreetMapProvider();
_this2.$canvas=$canvas;
_this2.worldBounds=[[-85, -180],
[85, 180]
];
_this2.type=null;
_this2.map=L.map(_this2.$canvas.get(0), {
'attributionControl': false,
'zoomControl': false,
'doubleClickZoom': false,
'scrollWheelZoom': _this2.settings.zoom.enabled,
'attribution': '',
'maxBoundsViscosity': 0.9
});
_this2.map.on('dblclick', function (e){
return $(_this2).trigger('dblclick', e.latlng);
});
_this2.map.addLayer(_this2.cluster);
_this2.markersContainer=_this2.settings.cluster.enabled ? _this2.cluster:_this2.map;
_this2.StealthLocateControl=L.Control.Locate.extend({
onAdd: function onAdd(m){
this._layer=this.options.layer||L.layerGroup();
this._layer.addTo(m);
this._event=undefined;
this._prevBounds=null;
var container=L.DomUtil.create('div');
var linkAndIcon=this.options.createButtonCallback(container, this.options);
this._link=linkAndIcon.link;
this._icon=linkAndIcon.icon;
this._resetVariables();
this._map.on('unload', this._unload, this);
return container;
}});
_this2.attributionControl=L.control.attribution({
prefix: false
});
_this2.locateControl=new _this2.StealthLocateControl({
icon: 'icon-null-class',
iconLoading: 'icon-loading-null-class'
});
_this2.locateControl.addTo(_this2.map);
_this2.$canvas.css({
'background': _this2.settings.map.background
});
return _this2;
}
_createClass(LeafletOSMMapService, [{
key: 'setType',
value: function setType(type){
var _this3=this;
for (var layerType in this.layers){
var layerGroup=this.layers[layerType];
for (var i=0; i < layerGroup.length; i++){
this.map.removeLayer(layerGroup[i]);
}}
for (var i=0; i < this.layers[type].length; i++){
this.map.addLayer(this.layers[type][i]);
}
this.type=type;
setTimeout(function (){
if(type==='image'){
_this3.map.setMaxBounds(null);
}else{
_this3.map.setMaxBounds(_this3.worldBounds);
}}, 0);
}}, {
key: 'getCenter',
value: function getCenter(){
return this.map.getCenter();
}}, {
key: 'setCenter',
value: function setCenter(center){
var _this=this;
return new Promise(function (resolve, reject){
_this.map.once('moveend', resolve);
_this.map.panTo(center, {
reset: true,
animate: false,
noMoveStart: true
});
});
}}, {
key: 'setZoom',
value: function setZoom(zoom){
var _this=this;
return new Promise(function (resolve, reject){
if(_this.map.getZoom()===zoom){
resolve();
return;
}
_this.map.once('zoomend', resolve);
_this.map.setZoom(zoom, {
reset: true,
animate: false
});
});
}}, {
key: 'getZoom',
value: function getZoom(){
return this.map.getZoom();
}}, {
key: 'addPinWithIcon',
value: function addPinWithIcon(pin, icon){
var _this=this;
var markerOptions={
'draggable': false,
'riseOnHover': true
};
if(icon){
markerOptions.icon=icon;
}
if(pin.model.animatePinpoints&&!this.settings.cluster.enabled){
markerOptions.bounceOnAdd=true;
}
var marker=L.marker(pin.model.latlng, markerOptions);
marker._Mapify=pin;
this.markersContainer.addLayer(marker);
this.markers.push(marker);
marker.on('mouseover', function (e){
var pin=this._Mapify;
pin.mouseover=true;
setTimeout(function (){
pin.mouseover=false;
});
_this.showMarkerTooltip(this);
});
marker.on('mouseout', function (e){
var pin=this._Mapify;
var tooltip=pin.tooltip;
if(!tooltip){
return;
}
tooltip.node().trigger({
'type': 'tooltip_mouseout'
});
});
marker.on('click', function (e){
var marker=this;
var pin=marker._Mapify;
var tooltip=pin.tooltip;
var hover=function hover(){
_this.showMarkerTooltip(marker);
};
var click=function click(){
$document.trigger('mapify.action.openPopup', {
value: pin.model.id
});
};
if(tooltip&&!tooltip.node().is(':visible')){
hover();
return;
}
click();
});
if(pin.tooltip){
this.map.on('movestart', function (){
pin.tooltip.hide();
});
this.map.on('moveend', function (){
pin.tooltip.hide();
});
this.map.on('zoomstart', function (){
pin.tooltip.hide();
});
this.map.on('zoomend', function (){
pin.tooltip.hide();
});
this.map.on('viewreset', function (){
pin.tooltip.hide();
});
}}
}, {
key: 'addPin',
value: function addPin(pin){
var _this=this;
return new Promise(function (resolve, reject){
var onImageLoaded=function onImageLoaded(){
var width=pin.model.image.size ? pin.model.image.size[0]:0;
var height=pin.model.image.size ? pin.model.image.size[1]:0;
if(!width){
width=pin.image.width;
height=pin.image.height;
}
var icon=L.icon({
'iconUrl': pin.model.image.url,
'iconAnchor': [width / 2, height]
});
_this.addPinWithIcon(pin, icon);
resolve();
};
if(pin.model.image.url){
if(pin.image.complete){
onImageLoaded();
}else{
pin.image.onload=onImageLoaded;
pin.image.onLoad=pin.image.onload;
}}else{
_this.addPinWithIcon(pin, null);
resolve();
}});
}}, {
key: 'addPins',
value: function addPins(pins){
var promises=[];
for (var i=0; i < pins.length; i++){
var pin=pins[i];
promises.push(this.addPin(pin));
}
return Promise.all(promises);
}}, {
key: 'showTooltip',
value: function showTooltip(tooltip, latLng, anchor){
var $win=$(window);
if(tooltip.node().is(':visible')){
return false;
}
var containerPoint=this.map.latLngToContainerPoint(latLng);
var left=this.$canvas.offset().left + containerPoint.x - Math.ceil(tooltip.node().width() / 2) + anchor[0];
var top=this.$canvas.offset().top + containerPoint.y - tooltip.node().height() + anchor[1];
if($win.width() >=767&&tooltip.node().hasClass('mpfy-tooltip-image-orientation-left')&&tooltip.node().hasClass('mpfy-tooltip-with-thumbnail')){
var left=this.$canvas.offset().left + containerPoint.x - Math.ceil(tooltip.node().width() / 2 - 61) + anchor[0];
};
setTimeout(function (){
tooltip.node().trigger({
'type': 'tooltip_mouseover',
'settings': {
'left': left,
'top': top
}});
}, 100);
}}, {
key: 'showMarkerTooltip',
value: function showMarkerTooltip(marker){
var _this=this;
var latLng=marker.getLatLng();
var pin=marker._Mapify;
var tooltip=pin.tooltip;
if(!tooltip){
return;
}
var anchor=[0, -10];
if(pin.model.image.url){
if(pin.model.image.anchor[1] > 0){
anchor[1] -=pin.model.image.anchor[1];
}else{
anchor[1] -=pin.image.height;
}}else{
anchor[1]=-50;
}
if(utils.isPhone()){
var targetPoint=_this.map.project(latLng, _this.getZoom());
var targetLatLng=_this.map.unproject(targetPoint.add(L.point([0, -128])));
_this.setCenter(targetLatLng).then(function (){
_this.showTooltip(tooltip, latLng, anchor);
});
}else{
_this.showTooltip(tooltip, latLng, anchor);
}}
}, {
key: 'geocode',
value: function geocode(query){
return this.geocoder.search({ query: query }).then(function (results){
var filteredResults=[];
for (var i=0; i < results.length; i++){
var result=results[i];
filteredResults.push(new GeocodingResult(result.label, result.y, result.x));
}
return Promise.resolve(filteredResults);
});
}}, {
key: 'getPinsWithinRange',
value: function getPinsWithinRange(lat, lng, rangeInMeters){
var target=[lat, lng];
return this.markers.filter(function (marker){
var distance=marker.getLatLng().distanceTo(target);
return distance <=rangeInMeters;
}).map(function (marker){
return marker._Mapify;
});
}}, {
key: 'getPinClosestTo',
value: function getPinClosestTo(lat, lng){
var lowestDistance=-1;
var closestPin=null;
for (var i=0; i < this.markers.length; i++){
var marker=this.markers[i];
var distance=marker.getLatLng().distanceTo([lat, lng]);
if(lowestDistance < 0||distance < lowestDistance){
lowestDistance=distance;
closestPin=marker._Mapify;
}}
return closestPin;
}}, {
key: 'getPinDistance',
value: function getPinDistance(lat, lng, pin){
var marker=this.getPinMarker(pin);
var distance=marker.getLatLng().distanceTo([lat, lng]);
return distance;
}}, {
key: 'highlightPin',
value: function highlightPin(pin){
var _this=this;
var marker=this.getPinMarker(pin);
if(!marker){
return Promise.resolve();
}
return Promise.resolve().then(function (){
if(!_this.settings.cluster.enabled){
return Promise.resolve();
}
var zoomToLayer=Promise.promisify(_this.cluster.zoomToShowLayer, { context: _this.cluster });
return zoomToLayer(marker);
}).then(function (){
return _this.setCenter(marker.getLatLng());
}).then(function (){
return _this.showMarkerTooltip(marker);
});
}}, {
key: 'getPinMarker',
value: function getPinMarker(pin){
for (var i=0; i < this.markers.length; i++){
var marker=this.markers[i];
if(marker._Mapify===pin){
return marker;
}}
return null;
}}, {
key: 'fitPins',
value: function fitPins(pins){
var _this=this;
if(pins.length===0){
return;
}
var latLngs=pins.map(function (pin){
return pin.model.latlng;
});
var bounds=L.latLngBounds(latLngs);
return new Promise(function (resolve, reject){
_this.map.once('viewreset', resolve);
_this.map.fitBounds(bounds, {
reset: true,
animate: false,
noMoveStart: true,
maxZoom: _this.map.getZoom(),
padding: [50, 50]
});
});
}}, {
key: 'updatePinVisibility',
value: function updatePinVisibility(pin){
var _this=this;
var marker=_this.getPinMarker(pin);
if(!marker){
return;
}
return new Promise(function (resolve, reject){
if(pin.isVisible()){
if(!_this.markersContainer.hasLayer(marker)){
var markerLatLng=marker.getLatLng();
_this.markersContainer.on('layeradd', resolve);
_this.markersContainer.addLayer(marker);
marker.setLatLng(markerLatLng);
return;
}}else{
if(_this.markersContainer.hasLayer(marker)){
_this.markersContainer.on('layerremove', resolve);
_this.markersContainer.removeLayer(marker);
return;
}}
resolve();
});
}}, {
key: 'locate',
value: function locate(){
var _this4=this;
return new Promise(function (resolve, reject){
_this4.map.once('locationfound', resolve);
_this4.map.once('locationerror', reject);
_this4.locateControl._onClick();
});
}}, {
key: 'redraw',
value: function redraw(){
this.map._onResize();
}}]);
return LeafletOSMMapService;
}(MapService);
;
module.exports=LeafletOSMMapService;
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
"use strict";
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var MapService=function (){
function MapService(){
_classCallCheck(this, MapService);
}
_createClass(MapService, [{
key: "construct",
value: function construct($canvas, settings){}}, {
key: "setType",
value: function setType(type){}}, {
key: "getCenter",
value: function getCenter(){}}, {
key: "setCenter",
value: function setCenter(center){}}, {
key: "setZoom",
value: function setZoom(zoom){}}, {
key: "getZoom",
value: function getZoom(){}}, {
key: "addPins",
value: function addPins(pins, clustered){}}, {
key: "geocode",
value: function geocode(query){}}, {
key: "getPinsWithinRange",
value: function getPinsWithinRange(lat, lng, rangeInMeters){}}, {
key: "getPinClosestTo",
value: function getPinClosestTo(lat, lng){}}, {
key: "getPinDistance",
value: function getPinDistance(lat, lng, pin){}}, {
key: "highlightPin",
value: function highlightPin(pin){}}, {
key: "fitPins",
value: function fitPins(pins){}}, {
key: "updatePinVisibility",
value: function updatePinVisibility(pin){}}, {
key: "locate",
value: function locate(){}}, {
key: "redraw",
value: function redraw(){}}]);
return MapService;
}();
;
module.exports=MapService;
}),
(function(module, exports, __webpack_require__){
"use strict";
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var $=jQuery;
var Pin=function (){
function Pin(model, tooltipSettings){
_classCallCheck(this, Pin);
this.model=model;
this.map=null;
this.mouseover=false;
this.visibilityConditions={
tag: true,
search: true
};
var pinImage=null;
if(this.model.image.url){
pinImage=new Image();
pinImage.src=this.model.image.url;
}
this.image=pinImage;
var tooltip=null;
if(this.model.tooltipEnabled){
tooltip=new MapifyTooltip({
classes: 'mpfy-tooltip ' + tooltipSettings.classes,
rgba: tooltipSettings.background,
content: tooltipSettings.content,
close_behavior: tooltipSettings.closeBehavior,
animate: tooltipSettings.animate
});
}
this.tooltip=tooltip;
}
_createClass(Pin, [{
key: 'isVisible',
value: function isVisible(){
var visible=true;
for (var option in this.visibilityConditions){
if(!this.visibilityConditions[option]){
visible=false;
break;
}}
return visible;
}}, {
key: 'setVisibility',
value: function setVisibility(condition, visible){
var wasVisible=this.isVisible();
this.visibilityConditions[condition]=visible;
}}]);
return Pin;
}();
;
module.exports=Pin;
}),
(function(module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _leafletControl=__webpack_require__(19);
Object.defineProperty(exports, 'GeoSearchControl', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_leafletControl).default;
}});
var _searchElement=__webpack_require__(8);
Object.defineProperty(exports, 'SearchElement', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_searchElement).default;
}});
var _bingProvider=__webpack_require__(20);
Object.defineProperty(exports, 'BingProvider', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_bingProvider).default;
}});
var _esriProvider=__webpack_require__(21);
Object.defineProperty(exports, 'EsriProvider', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_esriProvider).default;
}});
var _googleProvider=__webpack_require__(22);
Object.defineProperty(exports, 'GoogleProvider', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_googleProvider).default;
}});
var _openStreetMapProvider=__webpack_require__(23);
Object.defineProperty(exports, 'OpenStreetMapProvider', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_openStreetMapProvider).default;
}});
var _provider=__webpack_require__(1);
Object.defineProperty(exports, 'Provider', {
enumerable: true,
get: function get(){
return _interopRequireDefault(_provider).default;
}});
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
Object.defineProperty(exports, "__esModule", {
value: true
});
var _nodentRuntime=__webpack_require__(3);
var _nodentRuntime2=_interopRequireDefault(_nodentRuntime);
var _extends=Object.assign||function (target){ for (var i=1; i < arguments.length; i++){ var source=arguments[i]; for (var key in source){ if(Object.prototype.hasOwnProperty.call(source, key)){ target[key]=source[key]; }} } return target; };
exports.default=LeafletControl;
var _lodash=__webpack_require__(25);
var _lodash2=_interopRequireDefault(_lodash);
var _searchElement=__webpack_require__(8);
var _searchElement2=_interopRequireDefault(_searchElement);
var _resultList=__webpack_require__(24);
var _resultList2=_interopRequireDefault(_resultList);
var _domUtils=__webpack_require__(2);
var _constants=__webpack_require__(7);
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
var defaultOptions=function defaultOptions(){
return {
position: 'topleft',
style: 'button',
showMarker: true,
showPopup: false,
popupFormat: function popupFormat(_ref){
var result=_ref.result;
return '' + result.label;
},
marker: {
icon: new L.Icon.Default(),
draggable: false
},
maxMarkers: 1,
retainZoomLevel: false,
animateZoom: true,
searchLabel: 'Enter address',
notFoundMessage: 'Sorry, that address could not be found.',
messageHideDelay: 3000,
zoomLevel: 18,
classNames: {
container: 'leaflet-bar leaflet-control leaflet-control-geosearch',
button: 'leaflet-bar-part leaflet-bar-part-single',
resetButton: 'reset',
msgbox: 'leaflet-bar message',
form: '',
input: ''
},
autoComplete: true,
autoCompleteDelay: 250,
autoClose: false,
keepResult: false
};};
var wasHandlerEnabled={};
var mapHandlers=['dragging', 'touchZoom', 'doubleClickZoom', 'scrollWheelZoom', 'boxZoom', 'keyboard'];
var Control={
initialize: function initialize(options){
var _this=this;
this.markers=new L.FeatureGroup();
this.handlersDisabled=false;
this.options=_extends({}, defaultOptions(), options);
var _options=this.options,
style=_options.style,
classNames=_options.classNames,
searchLabel=_options.searchLabel,
autoComplete=_options.autoComplete,
autoCompleteDelay=_options.autoCompleteDelay;
if(style!=='button'){
this.options.classNames.container +=' ' + options.style;
}
this.searchElement=new _searchElement2.default(_extends({}, this.options, {
handleSubmit: function handleSubmit(query){
return _this.onSubmit(query);
}}));
var _searchElement$elemen=this.searchElement.elements,
container=_searchElement$elemen.container,
form=_searchElement$elemen.form,
input=_searchElement$elemen.input;
var button=(0, _domUtils.createElement)('a', classNames.button, container);
button.title=searchLabel;
button.href='#';
button.addEventListener('click', function (e){
_this.onClick(e);
}, false);
var resetButton=(0, _domUtils.createElement)('a', classNames.resetButton, form);
resetButton.innerHTML='X';
button.href='#';
resetButton.addEventListener('click', function (){
_this.clearResults(null, true);
}, false);
if(autoComplete){
this.resultList=new _resultList2.default({
handleClick: function handleClick(_ref2){
var result=_ref2.result;
input.value=result.label;
_this.onSubmit({ query: result.label });
}});
form.appendChild(this.resultList.elements.container);
input.addEventListener('keyup', (0, _lodash2.default)(function (e){
return _this.autoSearch(e);
}, autoCompleteDelay), true);
input.addEventListener('keydown', function (e){
return _this.selectResult(e);
}, true);
input.addEventListener('keydown', function (e){
return _this.clearResults(e, true);
}, true);
}
form.addEventListener('mouseenter', function (e){
return _this.disableHandlers(e);
}, true);
form.addEventListener('mouseleave', function (e){
return _this.restoreHandlers(e);
}, true);
this.elements={ button: button, resetButton: resetButton };},
onAdd: function onAdd(map){
var _options2=this.options,
showMarker=_options2.showMarker,
style=_options2.style;
this.map=map;
if(showMarker){
this.markers.addTo(map);
}
if(style==='bar'){
var form=this.searchElement.elements.form;
var root=map.getContainer().querySelector('.leaflet-control-container');
var container=(0, _domUtils.createElement)('div', 'leaflet-control-geosearch bar');
container.appendChild(form);
root.appendChild(container);
this.elements.container=container;
}
return this.searchElement.elements.container;
},
onRemove: function onRemove(){
var container=this.elements.container;
if(container){
container.remove();
}
return this;
},
onClick: function onClick(event){
event.preventDefault();
var _searchElement$elemen2=this.searchElement.elements,
container=_searchElement$elemen2.container,
input=_searchElement$elemen2.input;
if(container.classList.contains('active')){
(0, _domUtils.removeClassName)(container, 'active');
this.clearResults();
}else{
(0, _domUtils.addClassName)(container, 'active');
input.focus();
}},
disableHandlers: function disableHandlers(e){
var _this2=this;
var form=this.searchElement.elements.form;
if(this.handlersDisabled||e&&e.target!==form){
return;
}
this.handlersDisabled=true;
mapHandlers.forEach(function (handler){
if(_this2.map[handler]){
wasHandlerEnabled[handler]=_this2.map[handler].enabled();
_this2.map[handler].disable();
}});
},
restoreHandlers: function restoreHandlers(e){
var _this3=this;
var form=this.searchElement.elements.form;
if(!this.handlersDisabled||e&&e.target!==form){
return;
}
this.handlersDisabled=false;
mapHandlers.forEach(function (handler){
if(wasHandlerEnabled[handler]){
_this3.map[handler].enable();
}});
},
selectResult: function selectResult(event){
if(![_constants.ENTER_KEY, _constants.ARROW_DOWN_KEY, _constants.ARROW_UP_KEY].includes(event.keyCode)){
return;
}
event.preventDefault();
var input=this.searchElement.elements.input;
if(event.keyCode===_constants.ENTER_KEY){
this.onSubmit({ query: input.value });
return;
}
var list=this.resultList;
var max=list.count() - 1;
if(max < 0){
return;
}
var next=event.code==='ArrowDown' ? ~~list.selected + 1:~~list.selected - 1;
var idx=next < 0 ? max:next > max ? 0:next;
var item=list.select(idx);
input.value=item.label;
},
clearResults: function clearResults(event){
var force=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:false;
if(event&&event.keyCode!==_constants.ESCAPE_KEY){
return;
}
var input=this.searchElement.elements.input;
var _options3=this.options,
keepResult=_options3.keepResult,
autoComplete=_options3.autoComplete;
if(force||!keepResult){
input.value='';
this.markers.clearLayers();
}
if(autoComplete){
this.resultList.clear();
}},
autoSearch: function autoSearch(event){
return new Promise(function ($return, $error){
var query, provider, results;
if(_constants.SPECIAL_KEYS.includes(event.keyCode)){
return $return();
}
query=event.target.value;
provider=this.options.provider;
if(query.length){
return provider.search({ query: query }).then(function ($await_2){
results=$await_2;
this.resultList.render(results);
return $If_1.call(this);
}.$asyncbind(this, $error), $error);
}else{
this.resultList.clear();
return $If_1.call(this);
}
function $If_1(){
return $return();
}}.$asyncbind(this));
},
onSubmit: function onSubmit(query){
return new Promise(function ($return, $error){
var provider, results;
provider=this.options.provider;
return provider.search(query).then(function ($await_3){
results=$await_3;
if(results&&results.length > 0){
this.showResult(results[0], query);
}
return $return();
}.$asyncbind(this, $error), $error);
}.$asyncbind(this));
},
showResult: function showResult(result, _ref3){
var query=_ref3.query;
var autoClose=this.options.autoClose;
var markers=Object.keys(this.markers._layers);
if(markers.length >=this.options.maxMarkers){
this.markers.removeLayer(markers[0]);
}
var marker=this.addMarker(result, query);
this.centerMap(result);
this.map.fireEvent('geosearch/showlocation', {
location: result,
marker: marker
});
if(autoClose){
this.closeResults();
}},
closeResults: function closeResults(){
var container=this.searchElement.elements.container;
if(container.classList.contains('active')){
(0, _domUtils.removeClassName)(container, 'active');
}
this.restoreHandlers();
this.clearResults();
},
addMarker: function addMarker(result, query){
var _this4=this;
var _options4=this.options,
options=_options4.marker,
showPopup=_options4.showPopup,
popupFormat=_options4.popupFormat;
var marker=new L.Marker([result.y, result.x], options);
var popupLabel=result.label;
if(typeof popupFormat==='function'){
popupLabel=popupFormat({ query: query, result: result });
}
marker.bindPopup(popupLabel);
this.markers.addLayer(marker);
if(showPopup){
marker.openPopup();
}
if(options.draggable){
marker.on('dragend', function (args){
_this4.map.fireEvent('geosearch/marker/dragend', {
location: marker.getLatLng(),
event: args
});
});
}
return marker;
},
centerMap: function centerMap(result){
var _options5=this.options,
retainZoomLevel=_options5.retainZoomLevel,
animateZoom=_options5.animateZoom;
var resultBounds=new L.LatLngBounds(result.bounds);
var bounds=resultBounds.isValid() ? resultBounds:this.markers.getBounds();
if(!retainZoomLevel&&resultBounds.isValid()){
this.map.fitBounds(bounds, { animate: animateZoom });
}else{
this.map.setView(bounds.getCenter(), this.getZoom(), { animate: animateZoom });
}},
getZoom: function getZoom(){
var _options6=this.options,
retainZoomLevel=_options6.retainZoomLevel,
zoomLevel=_options6.zoomLevel;
return retainZoomLevel ? this.map.getZoom():zoomLevel;
}};
function LeafletControl(){
if(!L||!L.Control||!L.Control.extend){
throw new Error('Leaflet must be loaded before instantiating the GeoSearch control');
}
var LControl=L.Control.extend(Control);
for (var _len=arguments.length, options=Array(_len), _key=0; _key < _len; _key++){
options[_key]=arguments[_key];
}
return new (Function.prototype.bind.apply(LControl, [null].concat(options)))();
}
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(Promise){
Object.defineProperty(exports, "__esModule", {
value: true
});
var _nodentRuntime=__webpack_require__(3);
var _nodentRuntime2=_interopRequireDefault(_nodentRuntime);
var _extends=Object.assign||function (target){ for (var i=1; i < arguments.length; i++){ var source=arguments[i]; for (var key in source){ if(Object.prototype.hasOwnProperty.call(source, key)){ target[key]=source[key]; }} } return target; };
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _provider=__webpack_require__(1);
var _provider2=_interopRequireDefault(_provider);
var _domUtils=__webpack_require__(2);
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
function _possibleConstructorReturn(self, call){ if(!self){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call&&(typeof call==="object"||typeof call==="function") ? call:self; }
function _inherits(subClass, superClass){ if(typeof superClass!=="function"&&superClass!==null){ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype=Object.create(superClass&&superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true }});if(superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass):subClass.__proto__=superClass; }
var Provider=function (_BaseProvider){
_inherits(Provider, _BaseProvider);
function Provider(){
_classCallCheck(this, Provider);
return _possibleConstructorReturn(this, (Provider.__proto__||Object.getPrototypeOf(Provider)).apply(this, arguments));
}
_createClass(Provider, [{
key: 'endpoint',
value: function endpoint(){
var _ref=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
query=_ref.query,
protocol=_ref.protocol,
jsonp=_ref.jsonp;
var params=this.options.params;
var paramString=this.getParamString(_extends({}, params, {
query: query,
jsonp: jsonp
}));
return protocol + '//dev.virtualearth.net/REST/v1/Locations?' + paramString;
}}, {
key: 'parse',
value: function parse(_ref2){
var data=_ref2.data;
if(data.resourceSets.length===0){
return [];
}
return data.resourceSets[0].resources.map(function (r){
return {
x: r.point.coordinates[1],
y: r.point.coordinates[0],
label: r.address.formattedAddress,
bounds: [[r.bbox[0], r.bbox[1]],
[r.bbox[2], r.bbox[3]]],
raw: r
};});
}}, {
key: 'search',
value: function search(_ref3){
return new Promise(function ($return, $error){
var query, protocol, jsonp, url, json;
query=_ref3.query;
protocol=~location.protocol.indexOf('http') ? location.protocol:'https:';
jsonp='BING_JSONP_CB_' + Date.now();
url=this.endpoint({ query: query, protocol: protocol, jsonp: jsonp });
return (0, _domUtils.createScriptElement)(url, jsonp).then(function ($await_1){
json=$await_1;
return $return(this.parse({ data: json }));
}.$asyncbind(this, $error), $error);
}.$asyncbind(this));
}}]);
return Provider;
}(_provider2.default);
exports.default=Provider;
}.call(exports, __webpack_require__(0)))
}),
(function(module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends=Object.assign||function (target){ for (var i=1; i < arguments.length; i++){ var source=arguments[i]; for (var key in source){ if(Object.prototype.hasOwnProperty.call(source, key)){ target[key]=source[key]; }} } return target; };
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _provider=__webpack_require__(1);
var _provider2=_interopRequireDefault(_provider);
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
function _possibleConstructorReturn(self, call){ if(!self){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call&&(typeof call==="object"||typeof call==="function") ? call:self; }
function _inherits(subClass, superClass){ if(typeof superClass!=="function"&&superClass!==null){ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype=Object.create(superClass&&superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true }});if(superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass):subClass.__proto__=superClass; }
var Provider=function (_BaseProvider){
_inherits(Provider, _BaseProvider);
function Provider(){
_classCallCheck(this, Provider);
return _possibleConstructorReturn(this, (Provider.__proto__||Object.getPrototypeOf(Provider)).apply(this, arguments));
}
_createClass(Provider, [{
key: 'endpoint',
value: function endpoint(){
var _ref=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
query=_ref.query,
protocol=_ref.protocol;
var params=this.options.params;
var paramString=this.getParamString(_extends({}, params, {
f: 'json',
text: query
}));
return protocol + '//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?' + paramString;
}}, {
key: 'parse',
value: function parse(_ref2){
var data=_ref2.data;
return data.locations.map(function (r){
return {
x: r.feature.geometry.x,
y: r.feature.geometry.y,
label: r.name,
bounds: [[r.extent.ymin, r.extent.xmin],
[r.extent.ymax, r.extent.xmax]],
raw: r
};});
}}]);
return Provider;
}(_provider2.default);
exports.default=Provider;
}),
(function(module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends=Object.assign||function (target){ for (var i=1; i < arguments.length; i++){ var source=arguments[i]; for (var key in source){ if(Object.prototype.hasOwnProperty.call(source, key)){ target[key]=source[key]; }} } return target; };
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _provider=__webpack_require__(1);
var _provider2=_interopRequireDefault(_provider);
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
function _possibleConstructorReturn(self, call){ if(!self){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call&&(typeof call==="object"||typeof call==="function") ? call:self; }
function _inherits(subClass, superClass){ if(typeof superClass!=="function"&&superClass!==null){ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype=Object.create(superClass&&superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true }});if(superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass):subClass.__proto__=superClass; }
var Provider=function (_BaseProvider){
_inherits(Provider, _BaseProvider);
function Provider(){
_classCallCheck(this, Provider);
return _possibleConstructorReturn(this, (Provider.__proto__||Object.getPrototypeOf(Provider)).apply(this, arguments));
}
_createClass(Provider, [{
key: 'endpoint',
value: function endpoint(){
var _ref=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
query=_ref.query,
protocol=_ref.protocol;
var params=this.options.params;
var paramString=this.getParamString(_extends({}, params, {
address: query
}));
var proto=params&&params.key ? 'https:':protocol;
return proto + '//maps.googleapis.com/maps/api/geocode/json?' + paramString;
}}, {
key: 'parse',
value: function parse(_ref2){
var data=_ref2.data;
return data.results.map(function (r){
return {
x: r.geometry.location.lng,
y: r.geometry.location.lat,
label: r.formatted_address,
bounds: [[r.geometry.viewport.southwest.lat, r.geometry.viewport.southwest.lng],
[r.geometry.viewport.northeast.lat, r.geometry.viewport.northeast.lng]],
raw: r
};});
}}]);
return Provider;
}(_provider2.default);
exports.default=Provider;
}),
(function(module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends=Object.assign||function (target){ for (var i=1; i < arguments.length; i++){ var source=arguments[i]; for (var key in source){ if(Object.prototype.hasOwnProperty.call(source, key)){ target[key]=source[key]; }} } return target; };
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _provider=__webpack_require__(1);
var _provider2=_interopRequireDefault(_provider);
function _interopRequireDefault(obj){ return obj&&obj.__esModule ? obj:{ default: obj };}
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
function _possibleConstructorReturn(self, call){ if(!self){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call&&(typeof call==="object"||typeof call==="function") ? call:self; }
function _inherits(subClass, superClass){ if(typeof superClass!=="function"&&superClass!==null){ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype=Object.create(superClass&&superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true }});if(superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass):subClass.__proto__=superClass; }
var Provider=function (_BaseProvider){
_inherits(Provider, _BaseProvider);
function Provider(){
_classCallCheck(this, Provider);
return _possibleConstructorReturn(this, (Provider.__proto__||Object.getPrototypeOf(Provider)).apply(this, arguments));
}
_createClass(Provider, [{
key: 'endpoint',
value: function endpoint(){
var _ref=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
query=_ref.query,
protocol=_ref.protocol;
var params=this.options.params;
var paramString=this.getParamString(_extends({}, params, {
format: 'json',
q: query
}));
return protocol + '//nominatim.openstreetmap.org/search?' + paramString;
}}, {
key: 'parse',
value: function parse(_ref2){
var data=_ref2.data;
return data.map(function (r){
return {
x: r.lon,
y: r.lat,
label: r.display_name,
bounds: [[parseFloat(r.boundingbox[0]), parseFloat(r.boundingbox[2])],
[parseFloat(r.boundingbox[1]), parseFloat(r.boundingbox[3])]],
raw: r
};});
}}]);
return Provider;
}(_provider2.default);
exports.default=Provider;
}),
(function(module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass=function (){ function defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }} return function (Constructor, protoProps, staticProps){ if(protoProps) defineProperties(Constructor.prototype, protoProps); if(staticProps) defineProperties(Constructor, staticProps); return Constructor; };}();
var _domUtils=__webpack_require__(2);
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
var cx=function cx(){
for (var _len=arguments.length, classnames=Array(_len), _key=0; _key < _len; _key++){
classnames[_key]=arguments[_key];
}
return classnames.join(' ').trim();
};
var ResultList=function (){
function ResultList(){
var _ref=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
_ref$handleClick=_ref.handleClick,
handleClick=_ref$handleClick===undefined ? function (){}:_ref$handleClick,
_ref$classNames=_ref.classNames,
classNames=_ref$classNames===undefined ? {}:_ref$classNames;
_classCallCheck(this, ResultList);
_initialiseProps.call(this);
this.props={ handleClick: handleClick, classNames: classNames };
this.selected=-1;
var container=(0, _domUtils.createElement)('div', cx('results', classNames.container));
var resultItem=(0, _domUtils.createElement)('div', cx(classNames.item));
container.addEventListener('click', this.onClick, true);
this.elements={ container: container, resultItem: resultItem };}
_createClass(ResultList, [{
key: 'render',
value: function render(){
var results=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:[];
var _elements=this.elements,
container=_elements.container,
resultItem=_elements.resultItem;
this.clear();
results.forEach(function (result, idx){
var child=resultItem.cloneNode(true);
child.setAttribute('data-key', idx);
child.innerHTML=result.label;
container.appendChild(child);
});
if(results.length > 0){
(0, _domUtils.addClassName)(container, 'active');
}
this.results=results;
}}, {
key: 'select',
value: function select(index){
var container=this.elements.container;
Array.from(container.children).forEach(function (child, idx){
return idx===index ? (0, _domUtils.addClassName)(child, 'active'):(0, _domUtils.removeClassName)(child, 'active');
});
this.selected=index;
return this.results[index];
}}, {
key: 'count',
value: function count(){
return this.results ? this.results.length:0;
}}, {
key: 'clear',
value: function clear(){
var container=this.elements.container;
this.selected=-1;
while (container.lastChild){
container.removeChild(container.lastChild);
}
(0, _domUtils.removeClassName)(container, 'active');
}}]);
return ResultList;
}();
var _initialiseProps=function _initialiseProps(){
var _this=this;
this.onClick=function (){
var _ref2=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:{},
target=_ref2.target;
var handleClick=_this.props.handleClick;
var container=_this.elements.container;
if(target.parentNode!==container||!target.hasAttribute('data-key')){
return;
}
var idx=target.getAttribute('data-key');
var result=_this.results[idx];
handleClick({ result: result });
};};
exports.default=ResultList;
}),
(function(module, exports, __webpack_require__){
(function(global){
var FUNC_ERROR_TEXT='Expected a function';
var NAN=0 / 0;
var symbolTag='[object Symbol]';
var reTrim=/^\s+|\s+$/g;
var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;
var reIsBinary=/^0b[01]+$/i;
var reIsOctal=/^0o[0-7]+$/i;
var freeParseInt=parseInt;
var freeGlobal=typeof global=='object'&&global&&global.Object===Object&&global;
var freeSelf=typeof self=='object'&&self&&self.Object===Object&&self;
var root=freeGlobal||freeSelf||Function('return this')();
var objectProto=Object.prototype;
var objectToString=objectProto.toString;
var nativeMax=Math.max,
nativeMin=Math.min;
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp){
*   console.log(_.now() - stamp);
* }, _.now());
*
*/
var now=function(){
return root.Date.now();
};
function debounce(func, wait, options){
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime=0,
leading=false,
maxing=false,
trailing=true;
if(typeof func!='function'){
throw new TypeError(FUNC_ERROR_TEXT);
}
wait=toNumber(wait)||0;
if(isObject(options)){
leading = !!options.leading;
maxing='maxWait' in options;
maxWait=maxing ? nativeMax(toNumber(options.maxWait)||0, wait):maxWait;
trailing='trailing' in options ? !!options.trailing:trailing;
}
function invokeFunc(time){
var args=lastArgs,
thisArg=lastThis;
lastArgs=lastThis=undefined;
lastInvokeTime=time;
result=func.apply(thisArg, args);
return result;
}
function leadingEdge(time){
lastInvokeTime=time;
timerId=setTimeout(timerExpired, wait);
return leading ? invokeFunc(time):result;
}
function remainingWait(time){
var timeSinceLastCall=time - lastCallTime,
timeSinceLastInvoke=time - lastInvokeTime,
result=wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke):result;
}
function shouldInvoke(time){
var timeSinceLastCall=time - lastCallTime,
timeSinceLastInvoke=time - lastInvokeTime;
return (lastCallTime===undefined||(timeSinceLastCall >=wait) ||
(timeSinceLastCall < 0)||(maxing&&timeSinceLastInvoke >=maxWait));
}
function timerExpired(){
var time=now();
if(shouldInvoke(time)){
return trailingEdge(time);
}
timerId=setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time){
timerId=undefined;
if(trailing&&lastArgs){
return invokeFunc(time);
}
lastArgs=lastThis=undefined;
return result;
}
function cancel(){
if(timerId!==undefined){
clearTimeout(timerId);
}
lastInvokeTime=0;
lastArgs=lastCallTime=lastThis=timerId=undefined;
}
function flush(){
return timerId===undefined ? result:trailingEdge(now());
}
function debounced(){
var time=now(),
isInvoking=shouldInvoke(time);
lastArgs=arguments;
lastThis=this;
lastCallTime=time;
if(isInvoking){
if(timerId===undefined){
return leadingEdge(lastCallTime);
}
if(maxing){
timerId=setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}}
if(timerId===undefined){
timerId=setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel=cancel;
debounced.flush=flush;
return debounced;
}
function isObject(value){
var type=typeof value;
return !!value&&(type=='object'||type=='function');
}
function isObjectLike(value){
return !!value&&typeof value=='object';
}
function isSymbol(value){
return typeof value=='symbol' ||
(isObjectLike(value)&&objectToString.call(value)==symbolTag);
}
function toNumber(value){
if(typeof value=='number'){
return value;
}
if(isSymbol(value)){
return NAN;
}
if(isObject(value)){
var other=typeof value.valueOf=='function' ? value.valueOf():value;
value=isObject(other) ? (other + ''):other;
}
if(typeof value!='string'){
return value===0 ? value:+value;
}
value=value.replace(reTrim, '');
var isBinary=reIsBinary.test(value);
return (isBinary||reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2:8)
: (reIsBadHex.test(value) ? NAN:+value);
}
module.exports=debounce;
}.call(exports, __webpack_require__(6)))
}),
(function(module, exports){
module.exports=function(){
function isThenable(obj){
return obj&&(obj instanceof Object)&&typeof obj.then==="function";
}
function resolution(p,r,how){
try {
var x=how ? how(r):r ;
if(p===x) 
return p.reject(new TypeError("Promise resolution loop")) ;
if(isThenable(x)){
x.then(function(y){
resolution(p,y);
},function(e){
p.reject(e)
}) ;
}else{
p.resolve(x) ;
}} catch (ex){
p.reject(ex) ;
}}
function Chained(){};
Chained.prototype={
resolve:_unchained,
reject:_unchained,
then:thenChain
};
function _unchained(v){}
function thenChain(res,rej){
this.resolve=res;
this.reject=rej;
}
function then(res,rej){
var chain=new Chained() ;
try {
this._resolver(function(value){
return isThenable(value) ? value.then(res,rej):resolution(chain,value,res);
},function(ex){
resolution(chain,ex,rej) ;
}) ;
} catch (ex){
resolution(chain,ex,rej);
}
return chain ;
}
function Thenable(resolver){
this._resolver=resolver ;
this.then=then ;
};
Thenable.resolve=function(v){
return Thenable.isThenable(v) ? v:{then:function(resolve){return resolve(v)}};};
Thenable.isThenable=isThenable ;
return Thenable ;
} ;
}),
(function(module, exports, __webpack_require__){
"use strict";
(function(process, setImmediate){
module.exports=function(tick){
tick=tick||(typeof process==="object"&&process.nextTick)||(typeof setImmediate==="function"&&setImmediate)||function(f){setTimeout(f,0)};
var soon=(function (){
var fq=[], fqStart=0, bufferSize=1024;
function callQueue(){
while (fq.length - fqStart){
try { fq[fqStart]() } catch(ex){  }
fq[fqStart++]=undefined;
if(fqStart===bufferSize){
fq.splice(0, bufferSize);
fqStart=0;
}}
}
return function (fn){
fq.push(fn);
if(fq.length - fqStart===1)
tick(callQueue);
};})();
function Zousan(func){
if(func){
var me=this;
func(function (arg){
me.resolve(arg);
}, function (arg){
me.reject(arg);
});
}}
Zousan.prototype={
resolve: function (value){
if(this.state!==undefined)
return;
if(value===this)
return this.reject(new TypeError("Attempt to resolve promise with self"));
var me=this;
if(value&&(typeof value==="function"||typeof value==="object")){
try {
var first=0;
var then=value.then;
if(typeof then==="function"){
then.call(value, function (ra){
if(!first++){
me.resolve(ra);
}}, function (rr){
if(!first++){
me.reject(rr);
}});
return;
}} catch (e){
if(!first)
this.reject(e);
return;
}}
this.state=STATE_FULFILLED;
this.v=value;
if(me.c)
soon(function (){
for (var n=0, l=me.c.length;n < l; n++)
STATE_FULFILLED(me.c[n], value);
});
},
reject: function (reason){
if(this.state!==undefined)
return;
this.state=STATE_REJECTED;
this.v=reason;
var clients=this.c;
if(clients)
soon(function (){
for (var n=0, l=clients.length;n < l; n++)
STATE_REJECTED(clients[n], reason);
});
},
then: function (onF, onR){
var p=new Zousan();
var client={
y: onF,
n: onR,
p: p
};
if(this.state===undefined){
if(this.c)
this.c.push(client);
else
this.c=[client];
}else{
var s=this.state, a=this.v;
soon(function (){
s(client, a);
});
}
return p;
}};
function STATE_FULFILLED(c, arg){
if(typeof c.y==="function"){
try {
var yret=c.y.call(undefined, arg);
c.p.resolve(yret);
} catch (err){
c.p.reject(err);
}} else
c.p.resolve(arg);
}
function STATE_REJECTED(c, reason){
if(typeof c.n==="function"){
try {
var yret=c.n.call(undefined, reason);
c.p.resolve(yret);
} catch (err){
c.p.reject(err);
}} else
c.p.reject(reason);
}
Zousan.resolve=function (val){
if(val&&(val instanceof Zousan))
return val ;
var z=new Zousan();
z.resolve(val);
return z;
};
Zousan.reject=function (err){
if(err&&(err instanceof Zousan))
return err ;
var z=new Zousan();
z.reject(err);
return z;
};
Zousan.version="2.3.3-nodent" ;
return Zousan ;
};
}.call(exports, __webpack_require__(5), __webpack_require__(9).setImmediate))
}),
(function(module, exports, __webpack_require__){
(function(global, process){(function (global, undefined){
"use strict";
if(global.setImmediate){
return;
}
var nextHandle=1;
var tasksByHandle={};
var currentlyRunningATask=false;
var doc=global.document;
var registerImmediate;
function setImmediate(callback){
if(typeof callback!=="function"){
callback=new Function("" + callback);
}
var args=new Array(arguments.length - 1);
for (var i=0; i < args.length; i++){
args[i]=arguments[i + 1];
}
var task={ callback: callback, args: args };
tasksByHandle[nextHandle]=task;
registerImmediate(nextHandle);
return nextHandle++;
}
function clearImmediate(handle){
delete tasksByHandle[handle];
}
function run(task){
var callback=task.callback;
var args=task.args;
switch (args.length){
case 0:
callback();
break;
case 1:
callback(args[0]);
break;
case 2:
callback(args[0], args[1]);
break;
case 3:
callback(args[0], args[1], args[2]);
break;
default:
callback.apply(undefined, args);
break;
}}
function runIfPresent(handle){
if(currentlyRunningATask){
setTimeout(runIfPresent, 0, handle);
}else{
var task=tasksByHandle[handle];
if(task){
currentlyRunningATask=true;
try {
run(task);
} finally {
clearImmediate(handle);
currentlyRunningATask=false;
}}
}}
function installNextTickImplementation(){
registerImmediate=function(handle){
process.nextTick(function (){ runIfPresent(handle); });
};}
function canUsePostMessage(){
if(global.postMessage&&!global.importScripts){
var postMessageIsAsynchronous=true;
var oldOnMessage=global.onmessage;
global.onmessage=function(){
postMessageIsAsynchronous=false;
};
global.postMessage("", "*");
global.onmessage=oldOnMessage;
return postMessageIsAsynchronous;
}}
function installPostMessageImplementation(){
var messagePrefix="setImmediate$" + Math.random() + "$";
var onGlobalMessage=function(event){
if(event.source===global &&
typeof event.data==="string" &&
event.data.indexOf(messagePrefix)===0){
runIfPresent(+event.data.slice(messagePrefix.length));
}};
if(global.addEventListener){
global.addEventListener("message", onGlobalMessage, false);
}else{
global.attachEvent("onmessage", onGlobalMessage);
}
registerImmediate=function(handle){
global.postMessage(messagePrefix + handle, "*");
};}
function installMessageChannelImplementation(){
var channel=new MessageChannel();
channel.port1.onmessage=function(event){
var handle=event.data;
runIfPresent(handle);
};
registerImmediate=function(handle){
channel.port2.postMessage(handle);
};}
function installReadyStateChangeImplementation(){
var html=doc.documentElement;
registerImmediate=function(handle){
var script=doc.createElement("script");
script.onreadystatechange=function (){
runIfPresent(handle);
script.onreadystatechange=null;
html.removeChild(script);
script=null;
};
html.appendChild(script);
};}
function installSetTimeoutImplementation(){
registerImmediate=function(handle){
setTimeout(runIfPresent, 0, handle);
};}
var attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);
attachTo=attachTo&&attachTo.setTimeout ? attachTo:global;
if({}.toString.call(global.process)==="[object process]"){
installNextTickImplementation();
}else if(canUsePostMessage()){
installPostMessageImplementation();
}else if(global.MessageChannel){
installMessageChannelImplementation();
}else if(doc&&"onreadystatechange" in doc.createElement("script")){
installReadyStateChangeImplementation();
}else{
installSetTimeoutImplementation();
}
attachTo.setImmediate=setImmediate;
attachTo.clearImmediate=clearImmediate;
}(typeof self==="undefined" ? typeof global==="undefined" ? this:global:self));
}.call(exports, __webpack_require__(6), __webpack_require__(5)))
}),
(function(module, exports, __webpack_require__){
(function(Promise){(function(self){
'use strict';
if(self.fetch){
return
}
var support={
searchParams: 'URLSearchParams' in self,
iterable: 'Symbol' in self&&'iterator' in Symbol,
blob: 'FileReader' in self&&'Blob' in self&&(function(){
try {
new Blob()
return true
} catch(e){
return false
}})(),
formData: 'FormData' in self,
arrayBuffer: 'ArrayBuffer' in self
}
if(support.arrayBuffer){
var viewClasses=[
'[object Int8Array]',
'[object Uint8Array]',
'[object Uint8ClampedArray]',
'[object Int16Array]',
'[object Uint16Array]',
'[object Int32Array]',
'[object Uint32Array]',
'[object Float32Array]',
'[object Float64Array]'
]
var isDataView=function(obj){
return obj&&DataView.prototype.isPrototypeOf(obj)
}
var isArrayBufferView=ArrayBuffer.isView||function(obj){
return obj&&viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
}}
function normalizeName(name){
if(typeof name!=='string'){
name=String(name)
}
if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)){
throw new TypeError('Invalid character in header field name')
}
return name.toLowerCase()
}
function normalizeValue(value){
if(typeof value!=='string'){
value=String(value)
}
return value
}
function iteratorFor(items){
var iterator={
next: function(){
var value=items.shift()
return {done: value===undefined, value: value}}
}
if(support.iterable){
iterator[Symbol.iterator]=function(){
return iterator
}}
return iterator
}
function Headers(headers){
this.map={}
if(headers instanceof Headers){
headers.forEach(function(value, name){
this.append(name, value)
}, this)
}else if(Array.isArray(headers)){
headers.forEach(function(header){
this.append(header[0], header[1])
}, this)
}else if(headers){
Object.getOwnPropertyNames(headers).forEach(function(name){
this.append(name, headers[name])
}, this)
}}
Headers.prototype.append=function(name, value){
name=normalizeName(name)
value=normalizeValue(value)
var oldValue=this.map[name]
this.map[name]=oldValue ? oldValue+','+value:value
}
Headers.prototype['delete']=function(name){
delete this.map[normalizeName(name)]
}
Headers.prototype.get=function(name){
name=normalizeName(name)
return this.has(name) ? this.map[name]:null
}
Headers.prototype.has=function(name){
return this.map.hasOwnProperty(normalizeName(name))
}
Headers.prototype.set=function(name, value){
this.map[normalizeName(name)]=normalizeValue(value)
}
Headers.prototype.forEach=function(callback, thisArg){
for (var name in this.map){
if(this.map.hasOwnProperty(name)){
callback.call(thisArg, this.map[name], name, this)
}}
}
Headers.prototype.keys=function(){
var items=[]
this.forEach(function(value, name){ items.push(name) })
return iteratorFor(items)
}
Headers.prototype.values=function(){
var items=[]
this.forEach(function(value){ items.push(value) })
return iteratorFor(items)
}
Headers.prototype.entries=function(){
var items=[]
this.forEach(function(value, name){ items.push([name, value]) })
return iteratorFor(items)
}
if(support.iterable){
Headers.prototype[Symbol.iterator]=Headers.prototype.entries
}
function consumed(body){
if(body.bodyUsed){
return Promise.reject(new TypeError('Already read'))
}
body.bodyUsed=true
}
function fileReaderReady(reader){
return new Promise(function(resolve, reject){
reader.onload=function(){
resolve(reader.result)
}
reader.onerror=function(){
reject(reader.error)
}})
}
function readBlobAsArrayBuffer(blob){
var reader=new FileReader()
var promise=fileReaderReady(reader)
reader.readAsArrayBuffer(blob)
return promise
}
function readBlobAsText(blob){
var reader=new FileReader()
var promise=fileReaderReady(reader)
reader.readAsText(blob)
return promise
}
function readArrayBufferAsText(buf){
var view=new Uint8Array(buf)
var chars=new Array(view.length)
for (var i=0; i < view.length; i++){
chars[i]=String.fromCharCode(view[i])
}
return chars.join('')
}
function bufferClone(buf){
if(buf.slice){
return buf.slice(0)
}else{
var view=new Uint8Array(buf.byteLength)
view.set(new Uint8Array(buf))
return view.buffer
}}
function Body(){
this.bodyUsed=false
this._initBody=function(body){
this._bodyInit=body
if(!body){
this._bodyText=''
}else if(typeof body==='string'){
this._bodyText=body
}else if(support.blob&&Blob.prototype.isPrototypeOf(body)){
this._bodyBlob=body
}else if(support.formData&&FormData.prototype.isPrototypeOf(body)){
this._bodyFormData=body
}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(body)){
this._bodyText=body.toString()
}else if(support.arrayBuffer&&support.blob&&isDataView(body)){
this._bodyArrayBuffer=bufferClone(body.buffer)
this._bodyInit=new Blob([this._bodyArrayBuffer])
}else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(body)||isArrayBufferView(body))){
this._bodyArrayBuffer=bufferClone(body)
}else{
throw new Error('unsupported BodyInit type')
}
if(!this.headers.get('content-type')){
if(typeof body==='string'){
this.headers.set('content-type', 'text/plain;charset=UTF-8')
}else if(this._bodyBlob&&this._bodyBlob.type){
this.headers.set('content-type', this._bodyBlob.type)
}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(body)){
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
}}
}
if(support.blob){
this.blob=function(){
var rejected=consumed(this)
if(rejected){
return rejected
}
if(this._bodyBlob){
return Promise.resolve(this._bodyBlob)
}else if(this._bodyArrayBuffer){
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
}else if(this._bodyFormData){
throw new Error('could not read FormData body as blob')
}else{
return Promise.resolve(new Blob([this._bodyText]))
}}
this.arrayBuffer=function(){
if(this._bodyArrayBuffer){
return consumed(this)||Promise.resolve(this._bodyArrayBuffer)
}else{
return this.blob().then(readBlobAsArrayBuffer)
}}
}
this.text=function(){
var rejected=consumed(this)
if(rejected){
return rejected
}
if(this._bodyBlob){
return readBlobAsText(this._bodyBlob)
}else if(this._bodyArrayBuffer){
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
}else if(this._bodyFormData){
throw new Error('could not read FormData body as text')
}else{
return Promise.resolve(this._bodyText)
}}
if(support.formData){
this.formData=function(){
return this.text().then(decode)
}}
this.json=function(){
return this.text().then(JSON.parse)
}
return this
}
var methods=['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
function normalizeMethod(method){
var upcased=method.toUpperCase()
return (methods.indexOf(upcased) > -1) ? upcased:method
}
function Request(input, options){
options=options||{}
var body=options.body
if(input instanceof Request){
if(input.bodyUsed){
throw new TypeError('Already read')
}
this.url=input.url
this.credentials=input.credentials
if(!options.headers){
this.headers=new Headers(input.headers)
}
this.method=input.method
this.mode=input.mode
if(!body&&input._bodyInit!=null){
body=input._bodyInit
input.bodyUsed=true
}}else{
this.url=String(input)
}
this.credentials=options.credentials||this.credentials||'omit'
if(options.headers||!this.headers){
this.headers=new Headers(options.headers)
}
this.method=normalizeMethod(options.method||this.method||'GET')
this.mode=options.mode||this.mode||null
this.referrer=null
if((this.method==='GET'||this.method==='HEAD')&&body){
throw new TypeError('Body not allowed for GET or HEAD requests')
}
this._initBody(body)
}
Request.prototype.clone=function(){
return new Request(this, { body: this._bodyInit })
}
function decode(body){
var form=new FormData()
body.trim().split('&').forEach(function(bytes){
if(bytes){
var split=bytes.split('=')
var name=split.shift().replace(/\+/g, ' ')
var value=split.join('=').replace(/\+/g, ' ')
form.append(decodeURIComponent(name), decodeURIComponent(value))
}})
return form
}
function parseHeaders(rawHeaders){
var headers=new Headers()
rawHeaders.split(/\r?\n/).forEach(function(line){
var parts=line.split(':')
var key=parts.shift().trim()
if(key){
var value=parts.join(':').trim()
headers.append(key, value)
}})
return headers
}
Body.call(Request.prototype)
function Response(bodyInit, options){
if(!options){
options={}}
this.type='default'
this.status='status' in options ? options.status:200
this.ok=this.status >=200&&this.status < 300
this.statusText='statusText' in options ? options.statusText:'OK'
this.headers=new Headers(options.headers)
this.url=options.url||''
this._initBody(bodyInit)
}
Body.call(Response.prototype)
Response.prototype.clone=function(){
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
url: this.url
})
}
Response.error=function(){
var response=new Response(null, {status: 0, statusText: ''})
response.type='error'
return response
}
var redirectStatuses=[301, 302, 303, 307, 308]
Response.redirect=function(url, status){
if(redirectStatuses.indexOf(status)===-1){
throw new RangeError('Invalid status code')
}
return new Response(null, {status: status, headers: {location: url}})
}
self.Headers=Headers
self.Request=Request
self.Response=Response
self.fetch=function(input, init){
return new Promise(function(resolve, reject){
var request=new Request(input, init)
var xhr=new XMLHttpRequest()
xhr.onload=function(){
var options={
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders()||'')
}
options.url='responseURL' in xhr ? xhr.responseURL:options.headers.get('X-Request-URL')
var body='response' in xhr ? xhr.response:xhr.responseText
resolve(new Response(body, options))
}
xhr.onerror=function(){
reject(new TypeError('Network request failed'))
}
xhr.ontimeout=function(){
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if(request.credentials==='include'){
xhr.withCredentials=true
}
if('responseType' in xhr&&support.blob){
xhr.responseType='blob'
}
request.headers.forEach(function(value, name){
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit==='undefined' ? null:request._bodyInit)
})
}
self.fetch.polyfill=true
})(typeof self!=='undefined' ? self:this);
}.call(exports, __webpack_require__(0)))
})
]);
(function($, $window, $document){
$('body').on('mpfy_popup_opened', function(e){
e.mpfy.popup.on('click', '.mpfy-p-social-small', function(e){
$(this).toggleClass('mpfy-p-social-small-open');
});
});
})(jQuery, jQuery(window), jQuery(document));
!function(){"use strict";var t=0,e={};function i(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+t,this.options=i.Adapter.extend({},i.defaults,o),this.element=this.options.element,this.adapter=new i.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=i.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=i.Context.findOrCreateByElement(this.options.context),i.offsetAliases[this.options.offset]&&(this.options.offset=i.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),e[this.key]=this,t+=1}i.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},i.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},i.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete e[this.key]},i.prototype.disable=function(){return this.enabled=!1,this},i.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},i.prototype.next=function(){return this.group.next(this)},i.prototype.previous=function(){return this.group.previous(this)},i.invokeAll=function(t){var i=[];for(var o in e)i.push(e[o]);for(var n=0,r=i.length;n<r;n++)i[n][t]()},i.destroyAll=function(){i.invokeAll("destroy")},i.disableAll=function(){i.invokeAll("disable")},i.enableAll=function(){for(var t in i.Context.refreshAll(),e)e[t].enabled=!0;return this},i.refreshAll=function(){i.Context.refreshAll()},i.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},i.viewportWidth=function(){return document.documentElement.clientWidth},i.adapters=[],i.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},i.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=i}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}var e=0,i={},o=window.Waypoint,n=window.onload;function r(t){this.element=t,this.Adapter=o.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+e,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,i[t.waypointContextKey]=this,e+=1,o.windowContext||(o.windowContext=!0,o.windowContext=new r(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}r.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},r.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),o=this.element==this.element.window;t&&e&&!o&&(this.adapter.off(".waypoints"),delete i[this.key])},r.prototype.createThrottledResizeHandler=function(){var t=this;function e(){t.handleResize(),t.didResize=!1}this.adapter.on("resize.waypoints",(function(){t.didResize||(t.didResize=!0,o.requestAnimationFrame(e))}))},r.prototype.createThrottledScrollHandler=function(){var t=this;function e(){t.handleScroll(),t.didScroll=!1}this.adapter.on("scroll.waypoints",(function(){t.didScroll&&!o.isTouch||(t.didScroll=!0,o.requestAnimationFrame(e))}))},r.prototype.handleResize=function(){o.Context.refreshAll()},r.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll?o.forward:o.backward;for(var r in this.waypoints[i]){var s=this.waypoints[i][r];if(null!==s.triggerPoint){var a=o.oldScroll<s.triggerPoint,l=o.newScroll>=s.triggerPoint;(a&&l||!a&&!l)&&(s.queueTrigger(n),t[s.group.id]=s.group)}}}for(var h in t)t[h].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},r.prototype.innerHeight=function(){return this.element==this.element.window?o.viewportHeight():this.adapter.innerHeight()},r.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},r.prototype.innerWidth=function(){return this.element==this.element.window?o.viewportWidth():this.adapter.innerWidth()},r.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;o<n;o++)t[o].destroy()},r.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),n={};for(var r in this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,c,u=this.waypoints[r][a],d=u.options.offset,f=u.triggerPoint,w=0,y=null==f;u.element!==u.element.window&&(w=u.adapter.offset()[s.offsetProp]),"function"==typeof d?d=d.apply(u):"string"==typeof d&&(d=parseFloat(d),u.options.offset.indexOf("%")>-1&&(d=Math.ceil(s.contextDimension*d/100))),l=s.contextScroll-s.contextOffset,u.triggerPoint=Math.floor(w+l-d),h=f<s.oldScroll,p=u.triggerPoint>=s.oldScroll,c=!h&&!p,!y&&(h&&p)?(u.queueTrigger(s.backward),n[u.group.id]=u.group):(!y&&c||y&&s.oldScroll>=u.triggerPoint)&&(u.queueTrigger(s.forward),n[u.group.id]=u.group)}}return o.requestAnimationFrame((function(){for(var t in n)n[t].flushTriggers()})),this},r.findOrCreateByElement=function(t){return r.findByElement(t)||new r(t)},r.refreshAll=function(){for(var t in i)i[t].refresh()},r.findByElement=function(t){return i[t.waypointContextKey]},window.onload=function(){n&&n(),r.refreshAll()},o.requestAnimationFrame=function(e){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t).call(window,e)},o.Context=r}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}var i={vertical:{},horizontal:{}},o=window.Waypoint;function n(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),i[this.axis][this.name]=this}n.prototype.add=function(t){this.waypoints.push(t)},n.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},n.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;r<s;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},n.prototype.next=function(e){this.waypoints.sort(t);var i=o.Adapter.inArray(e,this.waypoints);return i===this.waypoints.length-1?null:this.waypoints[i+1]},n.prototype.previous=function(e){this.waypoints.sort(t);var i=o.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},n.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},n.prototype.remove=function(t){var e=o.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},n.prototype.first=function(){return this.waypoints[0]},n.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},n.findOrCreate=function(t){return i[t.axis][t.name]||new n(t)},o.Group=n}(),function(){"use strict";var t=window.jQuery,e=window.Waypoint;function i(e){this.$element=t(e)}t.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],(function(t,e){i.prototype[e]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[e].apply(this.$element,t)}})),t.each(["extend","inArray","isEmptyObject"],(function(e,o){i[o]=t[o]})),e.adapters.push({name:"jquery",Adapter:i}),e.Adapter=i}(),function(){"use strict";var t=window.Waypoint;function e(e){return function(){var i=[],o=arguments[0];return"function"==typeof arguments[0]&&((o=e.extend({},arguments[1])).handler=arguments[0]),this.each((function(){var n=e.extend({},o,{element:this});"string"==typeof n.context&&(n.context=e(this).closest(n.context)[0]),i.push(new t(n))})),i}}window.jQuery&&(window.jQuery.fn.waypoint=e(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=e(window.Zepto))}();;if(!Array.isArray){Array.isArray=function(e){return Object.prototype.toString.call(e)==='[object Array]'}}(function(e){'use strict';const opt={'bubbles':!0,'cancelable':!0};e(window).on('av-height-change',function(e){const event=new CustomEvent('avia_height_change',opt);window.dispatchEvent(event)});e('body').on('av_resize_finished',function(e){const event=new CustomEvent('avia_resize_finished',opt);document.body.dispatchEvent(event)})})(jQuery);(function(e){'use strict';e(function(){e.avia_utilities=e.avia_utilities||{};o('html');s('html');c();i();new e.AviaTooltip({'class':'avia-search-tooltip',data:'avia-search-tooltip',event:'click',position:'bottom',scope:'body',attach:'element',within_screen:!0,close_keys:27});new e.AviaTooltip({'class':'avia-related-tooltip',data:'avia-related-tooltip',scope:'.related_posts, .av-share-box',attach:'element',delay:0});new e.AviaAjaxSearch({scope:'#header, .avia_search_element'});if(e.fn.avia_iso_sort){e('.grid-sort-container').avia_iso_sort()};a();e.avia_utilities.avia_ajax_call();e.avia_utilities.postSwipeSupport()});e.avia_utilities=e.avia_utilities||{};e.avia_utilities.postSwipeSupport=function(){if(!e.fn.avia_swipe_trigger){return};const body=document.getElementsByTagName('body'),methods={};methods.beforeTrigger=function(t,i){const loader=e.avia_utilities.loading();loader.show()};methods.afterTrigger=function(e,t){let body=document.getElementsByTagName('body');if(!body.length){return};let dir=t=='prev'?'swiped-ltr':'swiped-rtl';body[0].classList.add('av-post-swiped-overlay',dir)};if(!body.length||!body[0].classList.contains('avia-post-nav-swipe-enabled')){return};let single=document.querySelector('.single #main');if(single==null){return};let prev=document.querySelector('#wrap_all .avia-post-nav.avia-post-prev'),next=document.querySelector('#wrap_all .avia-post-nav.avia-post-next'),param={prev:prev,next:next,delay_trigger:!0,event:{prev:'native_click',next:'native_click'},beforeTrigger:methods.beforeTrigger,afterTrigger:methods.afterTrigger};e(single).avia_swipe_trigger(param)};e.avia_utilities.avia_ajax_call=function(t){if(typeof t=='undefined'){t='body'};e('a.avianolink').on('click',function(e){e.preventDefault()});e('a.aviablank').attr('target','_blank');if(e.fn.avia_activate_lightbox){e(t).avia_activate_lightbox()};if(e.fn.avia_scrollspy){if(t=='body'){e('body').avia_scrollspy({target:'.main_menu .menu li > a'})}else{e('body').avia_scrollspy('refresh')}};if(e.fn.avia_smoothscroll){e('a[href*="#"]',t).avia_smoothscroll(t)};l(t);n(t);r(t);if(e.fn.avia_html5_activation&&e.fn.mediaelementplayer){e('.avia_video, .avia_audio',t).avia_html5_activation({ratio:'16:9'})}};e.avia_utilities.log=function(e,t,i){if(typeof console=='undefined'){return};if(typeof t=='undefined'){t='log'};t='AVIA-'+t.toUpperCase();console.log('['+t+'] '+e);if(typeof i!='undefined'){console.log(i)}};function i(){var n=e(window),i=e('html').is('.html_header_sidebar')?'#main':'#header',a=e(i),r=a.parents('div').eq(0),l=e(i+' .container').first(),t='',o=function(){var i='',o=Math.round(l.width()),s=Math.round(a.width()),n=Math.round(r.width());i+=' #header .three.units{width:'+(o*0.25)+'px;}';i+=' #header .six.units{width:'+(o*0.50)+'px;}';i+=' #header .nine.units{width:'+(o*0.75)+'px;}';i+=' #header .twelve.units{width:'+(o)+'px;}';i+=' .av-framed-box .av-layout-tab-inner .container{width:'+(n)+'px;}';i+=' .html_header_sidebar .av-layout-tab-inner .container{width:'+(s)+'px;}';i+=' .boxed .av-layout-tab-inner .container{width:'+(s)+'px;}';i+=' .av-framed-box#top .av-submenu-container{width:'+(n)+'px;}';try{t.text(i)}catch(p){t.remove();var c=e('head').first();t=e('<style type=\'text/css\' id=\'av-browser-width-calc\'>'+i+'</style>').appendTo(c)}};if(e('.avia_mega_div').length>0||e('.av-layout-tab-inner').length>0||e('.av-submenu-container').length>0){var s=e('head').first();t=e('<style type=\'text/css\' id=\'av-browser-width-calc\'></style>').appendTo(s);n.on('debouncedresize',o);o()}};function a(){var t=e('.sidebar_shadow#top #main .sidebar'),i=e('.sidebar_shadow .content');if(t.height()>=i.height()){t.addClass('av-enable-shadow')}else{i.addClass('av-enable-shadow')}};function t(t,a){var i=this,n=i.process.bind(i),o=i.refresh.bind(i),r=e(t).is('body')?e(window):e(t),s;i.$body=e('body');i.$win=e(window);i.options=e.extend({},e.fn.avia_scrollspy.defaults,a);i.selector=(i.options.target||((s=e(t).attr('href'))&&s.replace(/.*(?=#[^\s]+$)/,''))||'');i.activation_true=!1;if(i.$body.find(i.selector+'[href*=\'#\']').length){i.$scrollElement=r.on('scroll.scroll-spy.data-api',n);i.$win.on('av-height-change',o);i.$body.on('av_resize_finished',o);i.activation_true=!0;i.checkFirst();setTimeout(function(){i.refresh();i.process()},100)}};t.prototype={constructor:t,checkFirst:function(){var e=window.location.href.split('#')[0],t=this.$body.find(this.selector+'[href=\''+e+'\']').attr('href',e+'#top')},refresh:function(){if(!this.activation_true)return;var t=this,i;this.offsets=e([]);this.targets=e([]);i=this.$body.find(this.selector).map(function(){var s=e(this),n=s.data('target')||s.attr('href'),i=this.hash,i=i.replace(/\//g,''),a=/^#\w/.test(i)&&e(i),o=t.$scrollElement.get(0),r=o!=null&&o===o.window;return(a&&a.length&&[[a.position().top+(!r&&t.$scrollElement.scrollTop()),n]])||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})},process:function(){if(!this.offsets)return;if(isNaN(this.options.offset))this.options.offset=0;var i=this.$scrollElement.scrollTop()+this.options.offset,s=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=s-this.$scrollElement.height(),t=this.offsets,a=this.targets,o=this.activeTarget,e;if(i>=n){return o!=(e=a.last()[0])&&this.activate(e)};for(e=t.length;e--;){o!=a[e]&&i>=t[e]&&(!t[e+1]||i<=t[e+1])&&this.activate(a[e])}},activate:function(t){var i,a;this.activeTarget=t;e(this.selector).parent('.'+this.options.applyClass).removeClass(this.options.applyClass);a=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]';i=e(a).parent('li').addClass(this.options.applyClass);if(i.parent('.sub-menu').length){i=i.closest('li.dropdown_ul_available').addClass(this.options.applyClass)};i.trigger('activate')}};e.fn.avia_scrollspy=function(i){return this.each(function(){var o=e(this),a=o.data('scrollspy'),s=typeof i=='object'&&i;if(!a)o.data('scrollspy',(a=new t(this,s)));if(typeof i=='string')a[i]()})};e.fn.avia_scrollspy.Constructor=t;e.fn.avia_scrollspy.calc_offset=function(){var t=(parseInt(e('.html_header_sticky #main').data('scroll-offset'),10))||0,i=(e('.html_header_sticky:not(.html_top_nav_header) #header_main_alternate').outerHeight())||0,a=(e('.html_header_sticky.html_header_unstick_top_disabled #header_meta').outerHeight())||0,o=1,s=parseInt(e('html').css('margin-top'),10)||0,n=parseInt(e('.av-frame-top ').outerHeight(),10)||0;return t+i+a+o+s+n};e.fn.avia_scrollspy.defaults={offset:e.fn.avia_scrollspy.calc_offset(),applyClass:'current-menu-item'};function o(t){var i={},n=function(e){e=e.toLowerCase();var t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf('trident')>=0&&/(rv)(?::|)([\w.]+)/.exec(e)||e.indexOf('compatible')<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[5]||t[3]||t[1]||'',version:t[2]||t[4]||'0',versionNumber:t[4]||t[2]||'0'}};var o=n(navigator.userAgent);if(o.browser){i.browser=o.browser;i[o.browser]=!0;i.version=o.version};if(i.chrome){i.webkit=!0}
else if(i.webkit){i.safari=!0};if(typeof(i)!=='undefined'){var a='',s=i.version?parseInt(i.version):'';if(i.msie||i.rv||i.iemobile){a+='avia-msie'}
else if(i.webkit){a+='avia-webkit'}
else if(i.mozilla){a+='avia-mozilla'};if(i.version)a+=' '+a+'-'+s+' ';if(i.browser)a+=' avia-'+i.browser+' avia-'+i.browser+'-'+s+' '};if(t){e(t).addClass(a)};return a};function s(t){var i=[];e.avia_utilities.isTouchDevice='ontouchstart' in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0;i.push(e.avia_utilities.isTouchDevice?'touch-device':'no-touch-device');e.avia_utilities.pointerDevices=[];if(typeof window.matchMedia!='function'){e.avia_utilities.pointerDevices.push('undefined');i.push('pointer-device-undefined')}else{var a=!1;if(window.matchMedia('(any-pointer: fine)')){i.push('pointer-device-fine');e.avia_utilities.pointerDevices.push('fine');a=!0};if(window.matchMedia('(any-pointer: coarse)')){i.push('pointer-device-coarse');e.avia_utilities.pointerDevices.push('coarse');if(!a){i.push('pointer-device-coarse-only')}};if(!e.avia_utilities.pointerDevices.length){i.push('pointer-device-none');e.avia_utilities.pointerDevices.push('none')}};if('undefined'==typeof e.avia_utilities.isMobile){if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&'ontouchstart' in document.documentElement){e.avia_utilities.isMobile=!0}else{e.avia_utilities.isMobile=!1}};e(t).addClass(i.join(' '))};e.fn.avia_html5_activation=function(t){var i={ratio:'16:9'};var t=e.extend(i,t);this.each(function(){var t=e(this),s='#'+t.attr('id'),o=t.attr('poster'),i=['playpause','progress','current','duration','tracks','volume'],a=t.closest('.avia-video');if(a.length>0&&a.hasClass('av-html5-fullscreen-btn')){i.push('fullscreen')};if(!e(this).prop('controls')){i=[]};t.mediaelementplayer({defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,audioWidth:400,audioHeight:30,startVolume:0.8,loop:!1,enableAutosize:!1,features:i,alwaysShowControls:!1,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,enableKeyboard:!0,pauseOtherPlayers:!1,poster:o,success:function(i,a,o){e.AviaVideoAPI.players[t.attr('id').replace(/_html5/,'')]=o;setTimeout(function(){if(i.pluginType=='flash'){i.addEventListener('canplay',function(){t.trigger('av-mediajs-loaded')},!1)}else{t.trigger('av-mediajs-loaded').addClass('av-mediajs-loaded')};i.addEventListener('ended',function(){t.trigger('av-mediajs-ended')},!1);var a=document.getElementById(e(i).attr('id')+'_html5');if(a&&a!==i){i.addEventListener('ended',function(){e(a).trigger('av-mediajs-ended')})}},10)},error:function(){},keyActions:[]})})};function n(t){if(e.avia_utilities.isMobile){return};if(e('body').hasClass('av-disable-avia-hover-effect')){return};var o='',a=e.avia_utilities.supports('transition'),i=[];if(t=='body'){i=e('#main a img').parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .ls-wp-container a, .noHover, .noHover a, .av-logo-container .logo a').add('#main .avia-hover-fx')}else{i=e('a img',t).parents('a').not('.noLightbox, .noLightbox a, .avia-gallery-thumb a, .ls-wp-container a, .noHover, .noHover a, .av-logo-container .logo a').add('.avia-hover-fx',t)};i.each(function(t){var o=e(this),r=o.find('img').first();if(r.hasClass('alignleft')){o.addClass('alignleft').css({float:'left',margin:0,padding:0})};if(r.hasClass('alignright')){o.addClass('alignright').css({float:'right',margin:0,padding:0})};if(r.hasClass('aligncenter')){o.addClass('aligncenter').css({float:'none','text-align':'center',margin:0,padding:0})};if(r.hasClass('alignnone')){o.addClass('alignnone').css({margin:0,padding:0});if(!o.css('display')||o.css('display')=='inline'){o.css({display:'inline-block'})}};if(!o.css('position')||o.css('position')=='static'){o.css({position:'relative',overflow:'hidden'})};var l=o.attr('href'),s='overlay-type-video',p=o.data('opacity')||0.7,c=5,n=o.find('.image-overlay');if(l){if(l.match(/(jpg|gif|jpeg|png|tif)/)){s='overlay-type-image'};if(!l.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/)){s='overlay-type-extern'}};if(!n.length){n=e('<span class=\'image-overlay '+s+'\'><span class=\'image-overlay-inside\'></span></span>').appendTo(o)};o.on('mouseenter',function(t){var i=o.find('img').first(),r=i.get(0),l=i.outerHeight(),f=i.outerWidth(),d=i.position(),h=o.css('display'),n=o.find('.image-overlay');if(l>100){if(!n.length){n=e('<span class=\'image-overlay '+s+'\'><span class=\'image-overlay-inside\'></span></span>').appendTo(o)};if(o.height()==0){o.addClass(r.className);r.className=''};if(!h||h=='inline'){o.css({display:'block'})};n.css({left:(d.left-c)+parseInt(i.css('margin-left'),10),top:d.top+parseInt(i.css('margin-top'),10)}).css({overflow:'hidden',display:'block','height':l,'width':(f+(2*c))});if(a===!1){n.stop().animate({opacity:p},400)}}else{n.css({display:'none'})}}).on('mouseleave',i,function(){if(n.length){if(a===!1){n.stop().animate({opacity:0},400)}}})})}(function(e){e.fn.avia_smoothscroll=function(t){if(!this.length){return};var a=e(window),h=e('#header'),f=e('.html_header_top.html_header_sticky #main').not('.page-template-template-blank-php #main'),u=e('.html_header_top.html_header_unstick_top_disabled #header_meta'),v=e('.html_header_top:not(.html_top_nav_header) #header_main_alternate'),m=e('.html_header_top.html_top_nav_header'),l=e('.html_header_top.html_header_shrinking').length,c=e('.av-frame-top'),i=0,p=e.avia_utilities.isMobile,o=e('.sticky_placeholder').first(),d=function(){if(h.css('position')=='fixed'){var t=parseInt(f.data('scroll-offset'),10)||0,a=parseInt(u.outerHeight(),10)||0,o=parseInt(v.outerHeight(),10)||0;if(t>0&&l){t=(t/2)+a+o}else{t=t+a+o};t+=parseInt(e('html').css('margin-top'),10);i=t}else{i=parseInt(e('html').css('margin-top'),10)};if(c.length){i+=c.height()};if(m.length){i=e('.html_header_sticky #header_main_alternate').height()+parseInt(e('html').css('margin-top'),10)};if(p){i=0}};if(p){l=!1};d();a.on('debouncedresize av-height-change',d);var s=window.location.hash.replace(/\//g,'');if(i>0&&s&&t=='body'&&s.charAt(1)!='!'&&s.indexOf('=')===-1){var n=e(s),r=0;if(n.length){a.on('scroll.avia_first_scroll',function(){setTimeout(function(){if(o.length&&n.offset().top>o.offset().top){r=o.outerHeight()-3};a.off('scroll.avia_first_scroll').scrollTop(n.offset().top-i-r)},10)})}};return this.each(function(){e(this).on('click',function(t){var n=this.hash.replace(/\//g,''),p=e(this),r=p.data(),u=!1,b='undefined'!=typeof r.no_scroll_in_viewport&&r.no_scroll_in_viewport==1,T='undefined'!=typeof r.ignore_hash&&r.ignore_hash==1;if(n!=''&&n!='#'&&n!='#prev'&&n!='#next'&&!p.is('.comment-reply-link, #cancel-comment-reply-link, .no-scroll')){var s='',f='';if('#next-section'==n){f=n;var w=p.parents('.container_wrap').eq(0).nextAll('.container_wrap');w.each(function(){var t=e(this);if(t.css('display')=='none'||t.css('visibility')=='hidden'){return};s=t;return!1});if('object'==typeof s&&s.length>0){n='#'+s.attr('id')}}else{s=e(this.hash.replace(/\//g,''))};if(s.length&&b){const rect=s[0].getBoundingClientRect();if(rect.top>i&&(rect.top<(window.innerHeight||document.documentElement.clientHeight))){u=!0}};if(s.length&&!u){var d=a.scrollTop(),h=s.offset().top,l=h-i,c=window.location.hash,c=c.replace(/\//g,''),v=window.location.href.replace(c,''),m=this,g=r.duration||1200,y=r.easing||'easeInOutQuint';if(o.length&&h>o.offset().top){l-=o.outerHeight()-3};if('undefined'!=typeof r.scroll_top_offset&&Number.isInteger(r.scroll_top_offset)){l-=r.scroll_top_offset};if(v+n==m||f){if(d!=l){if(!(d==0&&l<=0)){a.trigger('avia_smooth_scroll_start');e('html:not(:animated),body:not(:animated)').animate({scrollTop:l},g,y,function(){a.trigger('avia_smooth_scroll_end');if(!T){if(window.history.replaceState){window.history.replaceState('','',n)}}})}};t.preventDefault()}}}})})}})(jQuery);function r(e){var t=jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame)',e),i=jQuery('iframe[src*="youtube.com"]:not(.av_youtube_frame) object, iframe[src*="youtube.com"]:not(.av_youtube_frame) embed',e).attr('wmode','opaque');t.each(function(){var t=jQuery(this),e=t.attr('src');if(e){if(e.indexOf('?')!==-1){e+='&wmode=opaque&rel=0'}else{e+='?wmode=opaque&rel=0'};t.attr('src',e)}})};function l(e){if(!e)e=document;var a=jQuery(window),t=jQuery('.avia-iframe-wrap iframe:not(.avia-slideshow iframe):not(iframe.no_resize):not(.avia-video iframe):not(.wp-embedded-content)',e),i=function(){t.each(function(){var t=jQuery(this),i=t.parent(),e=56.25;if(this.width&&this.height){e=(100/this.width)*this.height;i.css({'padding-bottom':e+'%'})}})};i()};function c(){var i=e(window),o=!1,t=e('#scroll-top-link'),a=function(){var e=i.scrollTop();if(e<500){t.removeClass('avia_pop_class')}
else if(!t.is('.avia_pop_class')){t.addClass('avia_pop_class')}};i.on('scroll',function(){window.requestAnimationFrame(a)});a()};e.AviaAjaxSearch=function(t){var i={delay:300,minChars:3,scope:'body'};this.options=e.extend({},i,t);this.scope=e(this.options.scope);this.timer=!1;this.lastVal='';this.bind_events()};e.AviaAjaxSearch.prototype={bind_events:function(){this.scope.on('keyup','#s:not(".av_disable_ajax_search #s")',this.try_search.bind(this));this.scope.on('click','#s.av-results-parked',this.reset.bind(this))},try_search:function(t){var i=e(t.currentTarget).parents('form').eq(0),a=i.find('.ajax_search_response');clearTimeout(this.timer);if(t.keyCode===27){this.reset(t);return};if(t.currentTarget.value.length>=this.options.minChars&&this.lastVal!=t.currentTarget.value.trim()){this.timer=setTimeout(this.do_search.bind(this,t),this.options.delay)}
else if(t.currentTarget.value.length==0){this.timer=setTimeout(this.reset.bind(this,t),this.options.delay)}},reset:function(t){var i=e(t.currentTarget).parents('form').eq(0),a=i.find('.ajax_search_response'),o=e(i.attr('data-ajaxcontainer')).find('.ajax_search_response'),s=e(t.currentTarget);if(e(t.currentTarget).hasClass('av-results-parked')){a.show();o.show();e('body > .ajax_search_response').show()}else{a.remove();o.remove();s.val('');e('body > .ajax_search_response').remove()}},do_search:function(t){var w=this,l=e(t.currentTarget).attr('autocomplete','off'),c=e(t.currentTarget).parents('.av_searchform_wrapper').eq(0),d=c.offset(),m=c.outerWidth(),g=c.outerHeight(),i=l.parents('form').eq(0),y=i.find('#searchsubmit'),s=i,a=s.find('.ajax_search_response'),h=e('<div class="ajax_load"><span class="ajax_load_inner"></span></div>'),n=i.attr('action'),p=i.serialize(),f=i.data('element_id'),u=i.data('custom_color');p+='&action=avia_ajax_search';if(!a.length){a=e('<div class="ajax_search_response" style="display:none;"></div>')};if('undefined'!=typeof f){a.addClass(f)};if('undefined'!=typeof u&&u!=''){a.addClass('av_has_custom_color')};if(i.attr('id')=='searchform_element'){a.addClass('av_searchform_element_results')};if(n.indexOf('?')!=-1){n=n.split('?');p+='&'+n[1]};if(i.attr('data-ajaxcontainer')){var r=i.attr('data-ajaxcontainer');if(e(r).length){e(r).find('.ajax_search_response').remove();s=e(r)}};o={};if(i.hasClass('av_results_container_fixed')){e('body').find('.ajax_search_response').remove();s=e('body');var o={top:d.top+g,left:d.left,width:m};a.addClass('main_color');e(window).resize(function(){a.remove();this.reset.bind(this);l.val('')})};if(i.attr('data-results_style')){var v=JSON.parse(i.attr('data-results_style'));o=Object.assign(o,v);if('color' in o){a.addClass('av_has_custom_color')}};a.css(o);if(s.hasClass('avia-section')){a.addClass('container')};a.appendTo(s);if(a.find('.ajax_not_found').length&&t.currentTarget.value.indexOf(this.lastVal)!=-1){return};this.lastVal=t.currentTarget.value;e.ajax({url:avia_framework_globals.ajaxurl,type:'POST',data:p,beforeSend:function(){h.insertAfter(y);i.addClass('ajax_loading_now')},success:function(e){if(e==0){e=''};a.html(e).show()},complete:function(){h.remove();i.removeClass('ajax_loading_now')}});e(document).on('click',function(t){if(!e(t.target).closest(i).length){if(e(a).is(':visible')){e(a).hide();l.addClass('av-results-parked')}}})}};e.AviaTooltip=function(t){var a={delay:1500,delayOut:300,delayHide:0,'class':'avia-tooltip',scope:'body',data:'avia-tooltip',attach:'body',event:'mouseenter',position:'top',extraClass:'avia-tooltip-class',permanent:!1,within_screen:!1,close_keys:null};this.options=e.extend({},a,t);var i='';if(this.options.close_keys!=null){if(!Array.isArray(this.options.close_keys)){this.options.close_keys=[this.options.close_keys]};i=' data-close-keys="'+this.options.close_keys.join(',')+'" '};this.body=e('body');this.scope=e(this.options.scope);this.tooltip=e('<div class="'+this.options['class']+' avia-tt"'+i+'><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></div>');this.inner=e('<div class="inner_tooltip"></div>').prependTo(this.tooltip);this.open=!1;this.timer=!1;this.active=!1;this.bind_events()};e.AviaTooltip.openTTs=[];e.AviaTooltip.openTT_Elements=[];e.AviaTooltip.prototype={bind_events:function(){var i='.av-permanent-tooltip [data-'+this.options.data+']',t='[data-'+this.options.data+']:not(.av-permanent-tooltip [data-'+this.options.data+'])';this.scope.on('av_permanent_show',i,this.display_tooltip.bind(this));e(i).addClass('av-perma-tooltip').trigger('av_permanent_show');this.scope.on(this.options.event+' mouseleave',t,this.start_countdown.bind(this));if(this.options.event!='click'){this.scope.on('mouseleave',t,this.hide_tooltip.bind(this));this.scope.on('click',t,this.hide_on_click_tooltip.bind(this))}else{this.body.on('mousedown',this.hide_tooltip.bind(this))};if(this.options.close_keys!=null){this.body.on('keyup',this.close_on_keyup.bind(this))}},start_countdown:function(t){clearTimeout(this.timer);var a=this.options.event=='click'?t.target:t.currentTarget,o=e(a);if(t.type==this.options.event){var i=this.options.event=='click'?0:this.open?0:this.options.delay;this.timer=setTimeout(this.display_tooltip.bind(this,t),i)}
else if(t.type=='mouseleave'){if(!o.hasClass('av-close-on-click-tooltip')){this.timer=setTimeout(this.stop_instant_open.bind(this,t),this.options.delayOut)}};t.preventDefault()},reset_countdown:function(e){clearTimeout(this.timer);this.timer=!1},display_tooltip:function(t){let _self=this,target=this.options.event=='click'?t.target:t.currentTarget,text=e(target).data(this.options.data);text='string'==typeof text?text.trim():'';if(e('header').hasClass('av_header_transparency')){if(text==''){target=t.currentTarget;text=e(target).data(this.options.data);text='string'==typeof text?text.trim():''}};let element=e(target),tip_index=element.data('avia-created-tooltip'),extraClass=element.data('avia-tooltip-class'),attach=this.options.attach=='element'?element:this.body,offset=this.options.attach=='element'?element.position():element.offset(),position=element.data('avia-tooltip-position'),align=element.data('avia-tooltip-alignment'),force_append=!1,newTip=!1,is_new_tip=!1;if(element.is('.av-perma-tooltip')){offset={top:0,left:0};attach=element;force_append=!0};if(text==''){return};if(position==''||typeof position=='undefined'){position=this.options.position};if(align==''||typeof align=='undefined'){align='center'};if(typeof tip_index!='undefined'){newTip=e.AviaTooltip.openTTs[tip_index]}else{this.inner.html(text);newTip=this.tooltip.clone();is_new_tip=!0;if(this.options.attach=='element'&&force_append!==!0){newTip.insertAfter(attach)}else{newTip.appendTo(attach)};if(extraClass!=''){newTip.addClass(extraClass)}};if(this.open&&this.active==newTip){return};if(element.hasClass('av-close-on-click-tooltip')){this.hide_all_tooltips()};this.open=!0;this.active=newTip;if((newTip.is(':animated:visible')&&t.type=='click')||element.is('.'+this.options['class'])||element.parents('.'+this.options['class']).length!=0){return};var o={},s={},a='',i='';if(position=='top'||position=='bottom'){switch(align){case'left':i=offset.left;break;case'right':i=offset.left+element.outerWidth()-newTip.outerWidth();break;default:i=(offset.left+(element.outerWidth()/2))-(newTip.outerWidth()/2);break};if(_self.options.within_screen){var n=element.offset().left+(element.outerWidth()/2)-(newTip.outerWidth()/2)+parseInt(newTip.css('margin-left'),10);if(n<0){i=i-n}}}else{switch(align){case'top':a=offset.top;break;case'bottom':a=offset.top+element.outerHeight()-newTip.outerHeight();break;default:a=(offset.top+(element.outerHeight()/2))-(newTip.outerHeight()/2);break}};switch(position){case'top':a=offset.top-newTip.outerHeight();o={top:a-10,left:i};s={top:a};break;case'bottom':a=offset.top+element.outerHeight();o={top:a+10,left:i};s={top:a};break;case'left':i=offset.left-newTip.outerWidth();o={top:a,left:i-10};s={left:i};break;case'right':i=offset.left+element.outerWidth();o={top:a,left:i+10};s={left:i};break};o['display']='block';o['opacity']=0;s['opacity']=1;newTip.css(o).stop().animate(s,200);newTip.find('input, textarea').trigger('focus');if(is_new_tip){e.AviaTooltip.openTTs.push(newTip);e.AviaTooltip.openTT_Elements.push(element);element.data('avia-created-tooltip',e.AviaTooltip.openTTs.length-1)}},hide_on_click_tooltip:function(t){if(this.options.event=='click'){return};var i=e(t.currentTarget);if(!i.hasClass('av-close-on-click-tooltip')){return};if(!i.find('a')){t.preventDefault()};var o=i.data('avia-created-tooltip');if('undefined'!=typeof o){var a=e.AviaTooltip.openTTs[o];if('undefined'!=typeof a&&a==this.active){this.hide_all_tooltips()}}},close_on_keyup:function(t){if(this.options.close_keys==null){return};if(e.inArray(t.keyCode,this.options.close_keys)<0){return};this.hide_all_tooltips(t.keyCode)},hide_all_tooltips:function(t){var o,s,n,r='undefined'!=typeof t?t+'':null;for(var a=0;a<e.AviaTooltip.openTTs.length;++a){o=e.AviaTooltip.openTTs[a];n=e.AviaTooltip.openTT_Elements[a];s=n.data('avia-tooltip-position');if(r!=null){var i=o.data('close-keys');if('undefined'==typeof i){continue};i=i+'';i=i.split(',');if(e.inArray(r,i)<0){continue}};this.animate_hide_tooltip(o,s)};this.open=!1;this.active=!1},hide_tooltip:function(t){var i=e(t.currentTarget),a,n,o=i.data('avia-tooltip-position'),s=i.data('avia-tooltip-alignment'),a=!1;if(o==''||typeof o=='undefined'){o=this.options.position};if(s==''||typeof s=='undefined'){s='center'};if(this.options.event=='click'){i=e(t.target);if(!i.is('.'+this.options['class'])&&i.parents('.'+this.options['class']).length==0){if(this.active.length){a=this.active;this.active=!1}}}else{if(!i.hasClass('av-close-on-click-tooltip')){a=i.data('avia-created-tooltip');a=typeof a!='undefined'?e.AviaTooltip.openTTs[a]:!1}};this.animate_hide_tooltip(a,o)},animate_hide_tooltip:function(e,t){if(e){var i={opacity:0};switch(t){case'top':i['top']=parseInt(e.css('top'),10)-10;break;case'bottom':i['top']=parseInt(e.css('top'),10)+10;break;case'left':i['left']=parseInt(e.css('left'),10)-10;break;case'right':i['left']=parseInt(e.css('left'),10)+10;break};e.animate(i,200,function(){e.css({display:'none'})})}},stop_instant_open:function(e){this.open=!1}}})(jQuery);(function(e){'use strict';e(function(){e.event.special.touchstart={setup:function(e,t,i){this.addEventListener('touchstart',i,{passive:!t.includes('noPreventDefault')})}};e.event.special.touchmove={setup:function(e,t,i){this.addEventListener('touchmove',i,{passive:!t.includes('noPreventDefault')})}};e.event.special.wheel={setup:function(e,t,i){this.addEventListener('wheel',i,{passive:!0})}};e.event.special.mousewheel={setup:function(e,t,i){this.addEventListener('mousewheel',i,{passive:!0})}}})})(jQuery);(function(){var i=0,t=['ms','moz','webkit','o'];for(var e=0;e<t.length&&!window.requestAnimationFrame;++e){window.requestAnimationFrame=window[t[e]+'RequestAnimationFrame'];window.cancelAnimationFrame=window[t[e]+'CancelAnimationFrame']||window[t[e]+'CancelRequestAnimationFrame']};if(!window.requestAnimationFrame)window.requestAnimationFrame=function(e,t){var a=new Date().getTime(),o=Math.max(0,16-(a-i)),s=window.setTimeout(function(){e(a+o)},o);i=a+o;return s};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=function(e){clearTimeout(e)}}());jQuery.expr.pseudos.regex=function(e,t,i){var a=i[3].split(','),o=/^(data|css):/,s={method:a[0].match(o)?a[0].split(':')[0]:'attr',property:a.shift().replace(o,'')},n='ig',r=new RegExp(a.join('').replace(/^\s+|\s+$/g,''),n);return r.test(jQuery(e)[s.method](s.property))};(function(i){"use strict";i(function(){i.avia_utilities=i.avia_utilities||{};if("undefined"==typeof i.avia_utilities.isMobile){if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&"ontouchstart" in document.documentElement){i.avia_utilities.isMobile=!0}else{i.avia_utilities.isMobile=!1}};if(i.fn.avia_mobile_fixed){i(".avia-bg-style-fixed").avia_mobile_fixed()};if(i.fn.avia_browser_height){i(".av-minimum-height, .avia-fullscreen-slider, .av-cell-min-height").avia_browser_height()};if(i.fn.avia_container_height){i(".av-column-min-height-pc").avia_container_height()};if(i.fn.avia_video_section){i(".av-section-with-video-bg").avia_video_section()};new i.AviaTooltip({"class":"avia-tooltip",data:"avia-tooltip",delay:0,scope:"body"});new i.AviaTooltip({"class":"avia-tooltip avia-icon-tooltip",data:"avia-icon-tooltip",delay:0,scope:"body"});i.avia_utilities.activate_shortcode_scripts();if(i.fn.layer_slider_height_helper){i(".avia-layerslider").layer_slider_height_helper()};if(i.fn.avia_portfolio_preview){i(".grid-links-ajax").avia_portfolio_preview()};if(i.fn.avia_masonry){i(".av-masonry").avia_masonry()};if(i.fn.aviaccordion){i(".aviaccordion").aviaccordion()};if(i.fn.avia_textrotator){i(".av-rotator-container").avia_textrotator()};if(i.fn.avia_sc_tab_section){i(".av-tab-section-container").avia_sc_tab_section()};if(i.fn.avia_hor_gallery){i(".av-horizontal-gallery").avia_hor_gallery()};if(i.fn.avia_link_column){i(".avia-link-column").avia_link_column()};if(i.fn.avia_delayed_animation_in_container){i(".av-animation-delay-container").avia_delayed_animation_in_container()}});i.avia_utilities=i.avia_utilities||{};i.avia_utilities.activate_shortcode_scripts=function(e){if(typeof e=="undefined"){e="body"};if(i.fn.avia_ajax_form){i(".avia_ajax_form:not(.avia-disable-default-ajax)",e).avia_ajax_form()};n(e);if(i.fn.aviaVideoApi){i(".avia-slideshow iframe[src*=\"youtube.com\"], .av_youtube_frame, .av_vimeo_frame, .avia-slideshow video").aviaVideoApi({},"li")};if(i.fn.avia_sc_toggle){i(".togglecontainer",e).avia_sc_toggle()};if(i.fn.avia_sc_tabs){i(".top_tab",e).avia_sc_tabs();i(".sidebar_tab",e).avia_sc_tabs({sidebar:!0})};if(i.fn.avia_sc_gallery){i(".avia-gallery",e).avia_sc_gallery()};if(i.fn.avia_sc_animated_number){i(".avia-animated-number",e).avia_sc_animated_number()};if(i.fn.avia_sc_animation_delayed){i(".av_font_icon",e).avia_sc_animation_delayed({delay:100});i(".avia-image-container",e).avia_sc_animation_delayed({delay:100});i(".av-hotspot-image-container",e).avia_sc_animation_delayed({delay:100});i(".av-animated-generic",e).avia_sc_animation_delayed({delay:100});i(".av-animated-when-visible",e).avia_sc_animation_delayed({delay:100});i(".av-animated-when-almost-visible",e).avia_sc_animation_delayed({delay:100});i(".av-animated-when-visible-95",e).avia_sc_animation_delayed({delay:100})};if(i.fn.avia_sc_iconlist){i(".avia-icon-list.av-iconlist-big.avia-iconlist-animate",e).avia_sc_iconlist()};if(i.fn.avia_sc_progressbar){i(".avia-progress-bar-container",e).avia_sc_progressbar()};if(i.fn.avia_sc_testimonial){i(".avia-testimonial-wrapper",e).avia_sc_testimonial()};if(i.fn.aviaFullscreenSlider){i(".avia-slideshow.av_fullscreen",e).aviaFullscreenSlider()};if(i.fn.aviaSlider){i(".avia-slideshow:not(.av_fullscreen)",e).aviaSlider();i(".avia-content-slider-active",e).aviaSlider({wrapElement:".avia-content-slider-inner",slideElement:".slide-entry-wrap",fullfade:!0});i(".avia-slider-testimonials",e).aviaSlider({wrapElement:".avia-testimonial-row",slideElement:".avia-testimonial",fullfade:!0})};if(i.fn.aviaMagazine){i(".av-magazine-tabs-active",e).aviaMagazine()};if(i.fn.aviaHotspots){i(".av-hotspot-image-container",e).aviaHotspots()};if(i.fn.aviaCountdown){i(".av-countdown-timer",e).aviaCountdown()};if(i.fn.aviaPlayer){i(".av-player",e).aviaPlayer()};if(i.fn.aviaIconCircles){i(".av-icon-circles-container").aviaIconCircles()};if(i.fn.avia_sc_icongrid){i(".avia-icon-grid-container").avia_sc_icongrid()}};function n(e){if(i.fn.avia_waypoints){if(typeof e=="undefined"){e="body"};i(".avia_animate_when_visible",e).avia_waypoints();i(".avia_animate_when_almost_visible",e).avia_waypoints({offset:"80%"});i(".av-animated-when-visible",e).avia_waypoints();i(".av-animated-when-almost-visible",e).avia_waypoints({offset:"80%"});i(".av-animated-when-visible-95",e).avia_waypoints({offset:"95%"});var t=i("*[class*=\"av-custom-animated-top-\"]",e);t.each(function(){var n=i(this),t=n[0].className.split(/\s+/);for(var e=0;e<t.length;e++){if(t[e].indexOf("av-custom-animated-top-")==0){var a=parseInt(t[e].replace("av-custom-animated-top-",""));if(!isNaN(a)&&a<100){n.avia_waypoints({offset:a+"%"})}}}});var a=i("body").hasClass("avia-mobile-no-animations");if(e=="body"&&a){e=".avia_desktop body"};i(".av-animated-generic",e).avia_waypoints({offset:"95%"})}};i.fn.avia_mobile_fixed=function(e){var a=i.avia_utilities.isMobile;if(!a){return};return this.each(function(){var a=i(this).addClass("av-parallax-section"),n=a.attr("style"),e=a.data("section-bg-repeat"),t="";if(e=="stretch"||e=="no-repeat"){e=" avia-full-stretch"}else{e=""};t="<div class='av-parallax "+e+"' data-avia-parallax-ratio='0.0' style='"+n+"' ></div>";a.prepend(t);a.attr("style","")})};i.fn.avia_sc_animation_delayed=function(e){var a=0,n=e.delay||50,t=10,o=setTimeout(function(){t=20},500);return this.each(function(){var e=i(this);e.on("avia_start_animation",function(){var e=i(this);if(a<t){a++};setTimeout(function(){e.addClass("avia_start_delayed_animation");if(a>0){a--}},(a*n))})})};i.fn.avia_delayed_animation_in_container=function(e){return this.each(function(){var e=i(this);e.on("avia_start_animation_if_current_slide_is_active",function(){var e=i(this),a=e.find(".avia_start_animation_when_active");a.addClass("avia_start_animation").trigger("avia_start_animation")});e.on("avia_remove_animation",function(){var e=i(this),a=e.find(".avia_start_animation_when_active, .avia_start_animation");a.removeClass("avia_start_animation avia_start_delayed_animation")})})};i.fn.avia_browser_height=function(){if(!this.length){return this};var e=i(window),c=i("html"),n=i("head").first(),r=i("#wpadminbar, #header.av_header_top:not(.html_header_transparency #header), #main>.title_container"),a=i("<style type='text/css' id='av-browser-height'></style>").appendTo(n),o=i(".html_header_sidebar #top #header_main"),l=i(".html_header_sidebar .avia-fullscreen-slider.avia-builder-el-0.avia-builder-el-no-sibling").addClass("av-solo-full"),t=[25,50,75],s=function(){let css="",wh100=e.height(),ww100=e.width(),wh100_mod=wh100,whCover=(wh100/9)*16,wwCover=(ww100/16)*9,solo=0;if(o.length){solo=o.height()};r.each(function(){wh100_mod-=this.offsetHeight-1});let whCoverMod=(wh100_mod/9)*16;css+=".avia-section.av-minimum-height .container{opacity: 1; }\n";css+=".av-minimum-height-100:not(.av-slideshow-section) .container, .avia-fullscreen-slider .avia-slideshow, #top.avia-blank .av-minimum-height-100 .container, .av-cell-min-height-100 > .flex_cell{height: 100vh;}\n";css+=".av-minimum-height-100vw:not(.av-slideshow-section) .container, #top.avia-blank .av-minimum-height-100vw .container, .av-cell-min-height-100vw > .flex_cell{height: 100vw;}\n";css+=".av-minimum-height-100.av-slideshow-section .container { height:unset; }\n";css+=".av-minimum-height-100vw.av-slideshow-section .container { height:unset; }\n";css+=".av-minimum-height-100.av-slideshow-section {min-height: 100vh;}\n";css+=".av-minimum-height-100vw.av-slideshow-section {min-height: 100vw;}\n";i.each(t,function(i,e){css+=".av-minimum-height-"+e+":not(.av-slideshow-section) .container, .av-cell-min-height-"+e+" > .flex_cell	{height:"+e+"vh;}\n";css+=".av-minimum-height-"+e+".av-slideshow-section {min-height:"+e+"vh;}\n";css+=".av-minimum-height-"+e+"vw:not(.av-slideshow-section) .container, .av-cell-min-height-"+e+"vw > .flex_cell	{height:"+e+"vw;}\n";css+=".av-minimum-height-"+e+"vw.av-slideshow-section {min-height:"+e+"vw;}\n"});css+=".avia-builder-el-0.av-minimum-height-100:not(.av-slideshow-section) .container, .avia-builder-el-0.avia-fullscreen-slider .avia-slideshow, .avia-builder-el-0.av-cell-min-height-100 > .flex_cell{height:"+wh100_mod+"px;}\n";css+="#top .av-solo-full .avia-slideshow {min-height:"+solo+"px;}\n";if(ww100/wh100<16/9){css+="#top .av-element-cover iframe, #top .av-element-cover embed, #top .av-element-cover object, #top .av-element-cover video{width:"+whCover+"px; left: -"+(whCover-ww100)/2+"px;}\n"}else{css+="#top .av-element-cover iframe, #top .av-element-cover embed, #top .av-element-cover object, #top .av-element-cover video{height:"+wwCover+"px; top: -"+(wwCover-wh100)/2+"px;}\n"};if(ww100/wh100_mod<16/9){css+="#top .avia-builder-el-0 .av-element-cover iframe, #top .avia-builder-el-0 .av-element-cover embed, #top .avia-builder-el-0 .av-element-cover object, #top .avia-builder-el-0 .av-element-cover video{width:"+whCoverMod+"px; left: -"+(whCoverMod-ww100)/2+"px;}\n"}else{css+="#top .avia-builder-el-0 .av-element-cover iframe, #top .avia-builder-el-0 .av-element-cover embed, #top .avia-builder-el-0 .av-element-cover object, #top .avia-builder-el-0 .av-element-cover video{height:"+wwCover+"px; top: -"+(wwCover-wh100_mod)/2+"px;}\n"};try{a.text(css)}catch(s){a.remove();a=i("<style type='text/css' id='av-browser-height'>"+css+"</style>").appendTo(n)};setTimeout(function(){e.trigger("av-height-change")},100)};this.each(function(e){let container=i(this),height=container.data("av_minimum_height_pc");if("number"!=typeof height){return this};height=parseInt(height);if((-1==i.inArray(height,t))&&(height!=100)){t.push(height)};return this});e.on("debouncedresize",s);s()};i.fn.avia_container_height=function(){if(!this.length){return this};var e=i(window),a=function(){var a=i(this),s=a.data("av-column-min-height"),n=parseInt(s["column-min-pc"],10),t=null,r=0,o=0;if(isNaN(n)||n==0){return};t=a.closest(".avia-section");if(!t.length){t=a.closest(".av-gridrow-cell")};if(!t.length){t=a.closest(".av-layout-tab")};r=t.length?t.outerHeight():e.height();o=r*(n/100.0);if(!s["column-equal-height"]){a.css("min-height",o+"px");a.css("height","auto")}else{a.css("height",o+"px")};setTimeout(function(){e.trigger("av-height-change")},100)};this.each(function(t){var n=i(this),o=n.data("av-column-min-height");if("object"!=typeof o){return this};e.on("debouncedresize",a.bind(n));a.call(n);return this})};i.fn.avia_video_section=function(){if(!this.length)return;var o=this.length,e="",s=i(window),t=i("head").first(),a=i("<style type='text/css' id='av-section-height'></style>").appendTo(t),n=function(n,s){if(s===0){e=""};var c="",r="#"+n.attr("id"),l=n.height(),u=n.width(),d=n.data("sectionVideoRatio").split(":"),v=d[0],f=d[1],h=(l/f)*v,m=(u/v)*f;if(u/l<v/f){c+="#top "+r+" .av-section-video-bg iframe, #top "+r+" .av-section-video-bg embed, #top "+r+" .av-section-video-bg object, #top "+r+" .av-section-video-bg video{width:"+h+"px; left: -"+(h-u)/2+"px;}\n"}else{c+="#top "+r+" .av-section-video-bg iframe, #top "+r+" .av-section-video-bg embed, #top "+r+" .av-section-video-bg object, #top "+r+" .av-section-video-bg video{height:"+m+"px; top: -"+(m-l)/2+"px;}\n"};e=e+c;if(o==s+1){try{a.text(e)}catch(p){a.remove();a=i("<style type='text/css' id='av-section-height'>"+e+"</style>").appendTo(t)}}};return this.each(function(e){var a=i(this);s.on("debouncedresize",function(){n(a,e)});n(a,e)})};i.fn.avia_link_column=function(){return this.each(function(){i(this).on("click",function(e){if("undefined"!==typeof e.target&&"undefined"!==typeof e.target.href){return};var t=i(this),a=t.data("link-column-url"),o=t.data("link-column-target"),r=window.location.hostname+window.location.pathname;if("undefined"===typeof a||"string"!==typeof a){return};if("undefined"!==typeof o||"_blank"==o){var n=document.createElement("a");n.href=a;n.target="_blank";n.rel="noopener noreferrer";n.click();return!1}else{if(t.hasClass("av-cell-link")||t.hasClass("av-column-link")){var s=t.hasClass("av-cell-link")?t.prev("a.av-screen-reader-only").first():t.find("a.av-screen-reader-only").first();a=a.trim();if((0==a.indexOf("#"))||((a.indexOf(r)>=0)&&(a.indexOf("#")>0))){s.trigger("click");if("undefined"==typeof o||"_blank"!=o){window.location.href=a};return}};window.location.href=a};e.preventDefault();return})})};i.fn.avia_waypoints=function(e){if(!i("html").is(".avia_transform")){return};var a={offset:"bottom-in-view",triggerOnce:!0},t=i.extend({},a,e),n=i.avia_utilities.isMobile;return this.each(function(){var e=i(this),a=e.hasClass("animate-all-devices"),o=i("body").hasClass("avia-mobile-no-animations");setTimeout(function(){if(n&&o&&!a){e.addClass("avia_start_animation").trigger("avia_start_animation")}else{e.waypoint(function(e){var t=i(this.element),a=t.parents(".av-animation-delay-container").eq(0);if(a.length){t.addClass("avia_start_animation_when_active").trigger("avia_start_animation_when_active")};if(!a.length||(a.length&&a.is(".__av_init_open"))||(a.length&&a.is(".av-active-tab-content"))){t.addClass("avia_start_animation").trigger("avia_start_animation")}},t)}},100)})};var t=i.event,e,a;e=t.special.debouncedresize={setup:function(){i(this).on("resize",e.handler)},teardown:function(){i(this).off("resize",e.handler)},handler:function(i,n){var s=this,r=arguments,o=function(){i.type="debouncedresize";t.dispatch.apply(s,r)};if(a){clearTimeout(a)};n?o():a=setTimeout(o,e.threshold)},threshold:150}})(jQuery);(function(i){"use strict";i.avia_utilities=i.avia_utilities||{};i.avia_utilities.loading=function(e,t){var a={active:!1,show:function(){if(a.active===!1){a.active=!0;a.loading_item.css({display:"block",opacity:0})};a.loading_item.stop().animate({opacity:1})},hide:function(){if(typeof t==="undefined"){t=600};a.loading_item.stop().delay(t).animate({opacity:0},function(){a.loading_item.css({display:"none"});a.active=!1})},attach:function(){if(typeof e==="undefined"){e="body"};a.loading_item=i("<div class=\"avia_loading_icon\"><div class=\"av-siteloader\"></div></div>").css({display:"none"}).appendTo(e)}};a.attach();return a};i.avia_utilities.playpause=function(e,t){var a={active:!1,to1:"",to2:"",set:function(i){a.loading_item.removeClass("av-play av-pause");a.to1=setTimeout(function(){a.loading_item.addClass("av-"+i)},10);a.to2=setTimeout(function(){a.loading_item.removeClass("av-"+i)},1500)},attach:function(){if(typeof e==="undefined"){e="body"};a.loading_item=i("<div class=\"avia_playpause_icon\"></div>").css({display:"none"}).appendTo(e)}};a.attach();return a};i.avia_utilities.preload=function(e){new i.AviaPreloader(e)};i.AviaPreloader=function(e){this.win=i(window);this.defaults={container:"body",maxLoops:10,trigger_single:!0,single_callback:function(){},global_callback:function(){}};this.options=i.extend({},this.defaults,e);this.preload_images=0;this.load_images()};i.AviaPreloader.prototype={load_images:function(){var e=this;if(typeof e.options.container==="string"){e.options.container=i(e.options.container)};e.options.container.each(function(){var a=i(this);a.images=a.find("img");a.allImages=a.images;e.preload_images+=a.images.length;setTimeout(function(){e.checkImage(a)},10)})},checkImage:function(i){var e=this;i.images.each(function(){if(this.complete===!0){i.images=i.images.not(this);e.preload_images-=1}});if(i.images.length&&e.options.maxLoops>=0){e.options.maxLoops-=1;setTimeout(function(){e.checkImage(i)},500)}else{e.preload_images=e.preload_images-i.images.length;e.trigger_loaded(i)}},trigger_loaded:function(i){var e=this;if(e.options.trigger_single!==!1){e.win.trigger("avia_images_loaded_single",[i]);e.options.single_callback.call(i)};if(e.preload_images===0){e.win.trigger("avia_images_loaded");e.options.global_callback.call()}}};i.avia_utilities.css_easings={linear:"linear",swing:"ease-in-out",bounce:"cubic-bezier(0.0, 0.35, .5, 1.3)",easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeInExpo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.04)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.55)",easeInOutBounce:"cubic-bezier(0.580, -0.365, 0.490, 1.365)",easeOutBounce:"cubic-bezier(0.760, 0.085, 0.490, 1.365)"};i.avia_utilities.supported={};i.avia_utilities.supports=(function(){var e=document.createElement("div"),i=["Khtml","Ms","Moz","Webkit"];return function(a,t){if(e.style[a]!==undefined){return""};if(t!==undefined){i=t};a=a.replace(/^[a-z]/,function(i){return i.toUpperCase()});var n=i.length;while(n--){if(e.style[i[n]+a]!==undefined){return"-"+i[n].toLowerCase()+"-"}};return!1}}());i.fn.avia_animate=function(e,a,t,n){if(typeof a==="function"){n=a;a=!1};if(typeof t==="function"){n=t;t=!1};if(typeof a==="string"){t=a;a=!1};if(n===undefined||n===!1){n=function(){}};if(t===undefined||t===!1){t="easeInQuad"};if(a===undefined||a===!1){a=400};if(i.avia_utilities.supported.transition===undefined){i.avia_utilities.supported.transition=i.avia_utilities.supports("transition")};if(i.avia_utilities.supported.transition!==!1){var c=i.avia_utilities.supported.transition+"transition",s={},l={},u=document.body.style,o=(u.WebkitTransition!==undefined)?"webkitTransitionEnd":(u.OTransition!==undefined)?"oTransitionEnd":"transitionend";t=i.avia_utilities.css_easings[t];s[c]="all "+(a/1000)+"s "+t;o=o+".avia_animate";for(var r in e){if(e.hasOwnProperty(r)){l[r]=e[r]}};e=l;this.each(function(){var t=i(this),v=!1,r,u;for(r in e){if(e.hasOwnProperty(r)){u=t.css(r);if(e[r]!=u&&e[r]!=u.replace(/px|%/g,"")){v=!0;break}}};if(v){if(!(i.avia_utilities.supported.transition+"transform" in e)){e[i.avia_utilities.supported.transition+"transform"]="translateZ(0)"};var l=!1;t.on(o,function(i){if(i.target!=i.currentTarget)return!1;if(l==!0)return!1;l=!0;s[c]="none";t.off(o);t.css(s);setTimeout(function(){n.call(t)})});setTimeout(function(){if(!l&&!avia_is_mobile&&i("html").is(".avia-safari")){t.trigger(o);i.avia_utilities.log("Safari Fallback "+o+" trigger")}},a+100);setTimeout(function(){t.css(s)},10);setTimeout(function(){t.css(e)},20)}else{setTimeout(function(){n.call(t)})}})}else{this.animate(e,a,t,n)};return this}})(jQuery);(function(i){"use strict";i.fn.avia_keyboard_controls=function(e){var t={37:".prev-slide",39:".next-slide"},a={mousebind:function(i){i.on("mouseenter",function(){i.mouseover=!0}).on("mouseleave",function(){i.mouseover=!1})},keybind:function(e){i(document).on("keydown",function(i){if(e.mouseover&&typeof e.options[i.keyCode]!=="undefined"){var a;if(typeof e.options[i.keyCode]==="string"){a=e.find(e.options[i.keyCode])}else{a=e.options[i.keyCode]};if(a.length){a.trigger("click",["keypress"]);return!1}}})}};return this.each(function(){var n=i(this);n.options=i.extend({},t,e);n.mouseover=!1;a.mousebind(n);a.keybind(n)})};i.fn.avia_swipe_trigger=function(e){var r=i(window),t=i.avia_utilities.isMobile,n=i.avia_utilities.isTouchDevice,a=i("body"),o={prev:".prev-slide",next:".next-slide",delay_trigger:!1,event:{prev:"click",next:"click"},beforeTrigger:null,afterTrigger:null,afterDelayedTrigger:null},s={activate_touch_control:function(i){var e,t,n;i.touchPos={};i.hasMoved=!1;i.on("touchstart",function(e){i.touchPos.X=e.originalEvent.touches[0].clientX;i.touchPos.Y=e.originalEvent.touches[0].clientY});i.on("touchend",function(e){i.touchPos={};if(i.hasMoved){e.preventDefault()};i.hasMoved=!1});i.on("touchmove",function(o){if(a.hasClass("avia-swipe-executed")){return};if(!i.touchPos.X){i.touchPos.X=o.originalEvent.touches[0].clientX;i.touchPos.Y=o.originalEvent.touches[0].clientY}else{t=o.originalEvent.touches[0].clientX-i.touchPos.X;n=o.originalEvent.touches[0].clientY-i.touchPos.Y;if(Math.abs(t)>Math.abs(n)){if(i.touchPos!==o.originalEvent.touches[0].clientX){if(Math.abs(t)>50){e=t>0?"prev":"next";let element=i.options[e];if(element==null){return};if(typeof i.options.beforeTrigger=="function"){i.options.beforeTrigger(i,e)};if(typeof i.options[e]==="string"){i.find(i.options[e]).trigger(i.options.event[e],["swipe"])}else{if(typeof element.jquery=="string"){element.trigger(i.options.event[e],["swipe"])}else{let action=i.options.event[e];if(action.indexOf("native_")<0){element.dispatchEvent(new Event(action))}else{let func_action=action.replace("native_","");if(typeof element[func_action]=="function"){if(i.options.delay_trigger){setTimeout(function(){element[func_action]();if(typeof i.options.afterDelayedTrigger=="function"){i.options.afterDelayedTrigger(i,e)}},50)}else{element[func_action]()}}else{element.dispatchEvent(new Event(action))}}}};if(typeof i.options.afterTrigger=="function"){i.options.afterTrigger(i,e)};o.preventDefault();o.stopImmediatePropagation();a.addClass("avia-swipe-executed");setTimeout(function(){a.removeClass("avia-swipe-executed")},300);i.hasMoved=!0;i.touchPos={};return!1}}}}})}};return this.each(function(){if(t||n){var a=i(this);a.options=i.extend({},o,e);s.activate_touch_control(a)}})}}(jQuery));(function(i){if(typeof i.easing!=="undefined"){i.easing["jswing"]=i.easing["swing"]};var e=Math.pow,n=Math.sqrt,a=Math.sin,c=Math.cos,t=Math.PI,o=1.70158,s=o*1.525,l=o+1,u=(2*t)/3,v=(2*t)/4.5;function r(i){var a=7.5625,e=2.75;if(i<1/e){return a*i*i}
else if(i<2/e){return a*(i-=(1.5/e))*i+.75}
else if(i<2.5/e){return a*(i-=(2.25/e))*i+.9375}else{return a*(i-=(2.625/e))*i+.984375}};i.extend(i.easing,{def:"easeOutQuad",swing:function(e){return i.easing[i.easing.def](e)},easeInQuad:function(i){return i*i},easeOutQuad:function(i){return 1-(1-i)*(1-i)},easeInOutQuad:function(i){return i<0.5?2*i*i:1-e(-2*i+2,2)/2},easeInCubic:function(i){return i*i*i},easeOutCubic:function(i){return 1-e(1-i,3)},easeInOutCubic:function(i){return i<0.5?4*i*i*i:1-e(-2*i+2,3)/2},easeInQuart:function(i){return i*i*i*i},easeOutQuart:function(i){return 1-e(1-i,4)},easeInOutQuart:function(i){return i<0.5?8*i*i*i*i:1-e(-2*i+2,4)/2},easeInQuint:function(i){return i*i*i*i*i},easeOutQuint:function(i){return 1-e(1-i,5)},easeInOutQuint:function(i){return i<0.5?16*i*i*i*i*i:1-e(-2*i+2,5)/2},easeInSine:function(i){return 1-c(i*t/2)},easeOutSine:function(i){return a(i*t/2)},easeInOutSine:function(i){return-(c(t*i)-1)/2},easeInExpo:function(i){return i===0?0:e(2,10*i-10)},easeOutExpo:function(i){return i===1?1:1-e(2,-10*i)},easeInOutExpo:function(i){return i===0?0:i===1?1:i<0.5?e(2,20*i-10)/2:(2-e(2,-20*i+10))/2},easeInCirc:function(i){return 1-n(1-e(i,2))},easeOutCirc:function(i){return n(1-e(i-1,2))},easeInOutCirc:function(i){return i<0.5?(1-n(1-e(2*i,2)))/2:(n(1-e(-2*i+2,2))+1)/2},easeInElastic:function(i){return i===0?0:i===1?1:-e(2,10*i-10)*a((i*10-10.75)*u)},easeOutElastic:function(i){return i===0?0:i===1?1:e(2,-10*i)*a((i*10-0.75)*u)+1},easeInOutElastic:function(i){return i===0?0:i===1?1:i<0.5?-(e(2,20*i-10)*a((20*i-11.125)*v))/2:e(2,-20*i+10)*a((20*i-11.125)*v)/2+1},easeInBack:function(i){return l*i*i*i-o*i*i},easeOutBack:function(i){return 1+l*e(i-1,3)+o*e(i-1,2)},easeInOutBack:function(i){return i<0.5?(e(2*i,2)*((s+1)*2*i-s))/2:(e(2*i-2,2)*((s+1)*(i*2-2)+s)+2)/2},easeInBounce:function(i){return 1-r(1-i)},easeOutBounce:r,easeInOutBounce:function(i){return i<0.5?(1-r(1-2*i))/2:(1+r(2*i-1))/2}})}(jQuery));(function(a){a.fn.avia_ajax_form=function(r){var t={sendPath:'send.php',responseContainer:'.ajaxresponse'};var e=a.extend(t,r);return this.each(function(){var t=a(this),i=!1,o=t.data('fields-with-error'),r={formElements:t.find('textarea, select, input[type=text], input[type=checkbox], input[type=hidden]'),validationError:!1,button:t.find('input:submit'),dataObj:{},withError:[]},s=t.next(e.responseContainer).eq(0);r.button.on('click',l);if(a.avia_utilities.isMobile){r.formElements.each(function(r){var e=a(this),t=e.hasClass('is_email');if(t)e.attr('type','email')})};function l(e){r.validationError=!1;r.datastring='ajax=true';r.formElements=t.find('textarea, select, input[type=text], input[type=checkbox], input[type=hidden], input[type=email]');r.formElements.each(function(n){var d=a(this),e=d.parent(),s=d.val(),l=e.find('label').text().replace(/\*/g,'').trim(),c=d.attr('name'),i=d.attr('class'),o=!0;if(d.is(':checkbox')){if(d.is(':checked')){s=!0}else{s=''}};r.dataObj[c]=encodeURIComponent(s);if(i&&i.match(/is_empty/)){if(s==''||s==null){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/is_email/)){if(!s.match(/^[\w|\.|\-]+@\w[\w|\.|\-]*\.[a-zA-Z]{2,20}$/)){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/is_ext_email/)){if(!s.match(/^[\w\.\-ÄÖÜäöü]+@\w[\w\.\-ÄÖÜäöü]*\.[a-zA-Z]{2,20}$/)){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/is_special_email/)){if(!s.match(/^[a-zA-Z0-9.!#$%&'*+\-\/=?^_`{|}~ÄÖÜäöü]+@\w[\w\.\-ÄÖÜäöü]*\.[a-zA-Z]{2,20}$/)){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/is_phone/)){if(!s.match(/^(\d|\s|\-|\/|\(|\)|\[|\]|e|x|t|ension|\.|\+|\_|\,|\:|\;){3,}$/)){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/is_number/)){if(!s.match(/^-?\s*(0|[1-9]\d*)([\.,]\d+)?$/)){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/is_positiv_number/)){if(!(v(s))||s==''||s<0){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0;r.withError.push(l)}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(i&&i.match(/captcha/)&&!i.match(/recaptcha/)){var f=t.find('#'+c+'_verifier').val(),m=f.charAt(f.length-1),h=f.charAt(m);if(s!=h){e.removeClass('valid error ajax_alert').addClass('error');r.validationError=!0}else{e.removeClass('valid error ajax_alert').addClass('valid')};o=!1};if(o&&s!=''){e.removeClass('valid error ajax_alert').addClass('valid')}});t.find('.av-fields-with-error').remove();if(r.validationError==!1){if(t.data('av-custom-send')){d()}else{n()}}else{if(t.is('.av-show-form-errors')&&r.withError.length>0){var i=r.withError.join(', '),s=a('<p class="av-fields-with-error"></p>').insertAfter(a(r.button).parent());let msg=o?o+' ':'Found errors in the following field(s): ';s.text(msg+i);r.withError=[]}};return!1};function n(){if(i){return!1};if(r.button.hasClass('avia_button_inactive')){return!1};i=!0;r.button.addClass('av-sending-button');r.button.val(r.button.data('sending-label'));var o=t.data('avia-redirect')||!1,l=t.attr('action'),n=t.is('.av-form-labels-style');if(n){return};s.load(l+' '+e.responseContainer,r.dataObj,function(){if(o&&l!=o){t.attr('action',o);location.href=o}else{s.removeClass('hidden').css({display:'block'});t.slideUp(400,function(){s.slideDown(400,function(){a('body').trigger('av_resize_finished')});r.formElements.val('')})}})};function d(){if(i){return!1};i=!0;var v=r.button.val();r.button.addClass('av-sending-button');r.button.val(r.button.data('sending-label'));r.dataObj.ajax_mailchimp=!0;var o=t.data('avia-redirect')||!1,n=t.attr('action'),l=t.find('.av-form-error-container'),d=t.data('avia-form-id');a.ajax({url:n,type:'POST',data:r.dataObj,beforeSend:function(){if(l.length){l.slideUp(400,function(){l.remove();a('body').trigger('av_resize_finished')})}},success:function(l){var c=jQuery('<div>').append(jQuery.parseHTML(l)),f=c.find('.av-form-error-container');if(f.length){i=!1;t.prepend(f);f.css({display:'none'}).slideDown(400,function(){a('body').trigger('av_resize_finished')});r.button.removeClass('av-sending-button');r.button.val(v)}else{if(o&&n!=o){t.attr('action',o);location.href=o}else{var m=c.find(e.responseContainer+'_'+d);s.html(m).removeClass('hidden').css({display:'block'});t.slideUp(400,function(){s.slideDown(400,function(){a('body').trigger('av_resize_finished')});r.formElements.val('')})}}},error:function(){},complete:function(){}})};function v(a){var r=typeof a;return(r==='number'||r==='string')&&!isNaN(a-parseFloat(a))}})}})(jQuery);;var aviaJS=aviaJS||{};(function(e){'use strict';var t=['years','months','weeks','days','hours','minutes','seconds'],r=1000,a=r*60,n=a*60,o=n*24,d=o*7,l=function(t,e){return new Date(e,t,0).getDate()},m=function(t){var e={year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds()};return e},c=function(t,e){var a=e.getFullYear()-t.year;if(a>0){var i=new Date(t.year+a,t.month-1,t.day,t.hours,t.minutes,t.seconds);if(i>e){a--}};return(a>=0)?a:0},f=function(t,e){var i=e.getMonth()+1,a=i-t.month;if(a<0){a=12-t.month+i};if(a>0){var n=new Date(t.year,t.month-1+a,t.day,t.hours,t.minutes,t.seconds);if(n>e){a--}};return(a>=0)?a:0},p=function(t,e){var i=e.getDate(),a=i-t.day;if(a<0){a=l(t.month,t.year)-t.day+i};if(a>0){var n=new Date(t.year,t.month-1,t.day+a,t.hours,t.minutes,t.seconds);if(n>e){a--}};return(a>=0)?a:0},h=function(t,a){var i=m(t),e={years:0,year_months:0,month_months:0,days:0};e.years=c(i,a);i.year+=e.years;e.year_months=f(i,a);i.month+=e.year_months;e.days=p(i,a);i.day+=e.days;e.month_months=e.years*12+e.year_months;return e},u=function(t,e){if(!0===e){for(let i in t.time){if(typeof t.update[i]=='object'&&t.update[i].label_container.length){t.update[i].label_container.css({'min-width':''})}};t.labelMinWidth=0;return};let newMin=t.labelMinWidth;for(let i in t.time){if(typeof t.update[i]=='object'&&t.update[i].label_container.length){let curr=t.update[i].label_container.outerWidth(!0);if(newMin<curr){newMin=curr}}};if(newMin>t.labelMinWidth){for(let i in t.time){if(typeof t.update[i]=='object'&&t.update[i].label_container.length){t.update[i].label_container.css({'min-width':newMin+'px'})}};t.labelMinWidth=newMin}},s=function(t){var m=new Date(),c=new Date(m.getTime()+m.getTimezoneOffset()*60000),s=t.end-c;if(s<=0){if(t.firstrun&&!t.container.hasClass('av-finished-msg')){s=0}else{t.container.addClass('av-countdown-finished');clearInterval(t.countdown);return}};t.time.years=0;t.time.months=0;t.time.weeks=Math.floor(s/d);t.time.days=Math.floor((s%d)/o);t.time.hours=Math.floor((s%o)/n);t.time.minutes=Math.floor((s%n)/a);t.time.seconds=Math.floor((s%a)/r);var l=h(c,t.end);switch(t.data.maximum){case 1:t.time.seconds=Math.floor(s/r);break;case 2:t.time.minutes=Math.floor(s/a);break;case 3:t.time.hours=Math.floor(s/n);break;case 4:t.time.days=Math.floor(s/o);break;case 6:t.time.days=l.days;t.time.months=l.month_months;break;case 7:t.time.days=l.days;t.time.months=l.year_months;t.time.years=l.years;break};for(let i in t.time){if(typeof t.update[i]=='object'&&t.update[i].label_container.length){if(t.firstrun||t.oldtime[i]!=t.time[i]){let labelkey=(t.time[i]===1)?'single':'multi',new_label=t.update[i][labelkey],old_label=t.update[i].label_container.text();if(old_label!=new_label){t.update[i].label_container.text(new_label)};if(t.isFlipNumbers){if(t.update[i].unitContainer.length){if(!t.firstrun){t.update[i].backCard.attr('data-value',t.oldtime[i]);t.update[i].bottomCard.attr('data-value',t.oldtime[i])};t.update[i].topCard.text(t.time[i]);t.update[i].backBottomCard.attr('data-value',t.time[i]);t.update[i].unitContainer.removeClass('flip');void t.update[i].unitContainer[0].offsetWidth;t.update[i].unitContainer.addClass('flip')}}
else if(t.isFlipClock){if(t.update[i].unitContainer.length){if(!t.firstrun){t.update[i].currentTop.text(t.oldtime[i]);t.update[i].currentBottom.text(t.oldtime[i])};t.update[i].nextTop.text(t.time[i]);t.update[i].nextBottom.text(t.time[i]);t.update[i].unitContainer.removeClass('flip');void t.update[i].unitContainer[0].offsetWidth;t.update[i].unitContainer.addClass('flip')}}else{t.update[i].time_container.text(t.time[i])}}}};if(t.firstrun){t.container.addClass('av-countdown-active')};t.oldtime=e.extend({},t.time);t.firstrun=!1;if((t.isFlipNumbers||t.isFlipClock)&&t.number_space){setTimeout(function(){u(t)},50)}};e.fn.aviaCountdown=function(a){if(!this.length){return};return this.each(function(){var a={};a.update={};a.time={};a.oldtime={};a.firstrun=!0;a.container=e(this);a.data=a.container.data();a.end=new Date(a.data.year,a.data.month,a.data.day,a.data.hour,a.data.minute);a.isFlipNumbers=a.container.hasClass('av-flip-numbers');a.isFlipClock=a.container.hasClass('av-flip-clock');a.number_space=a.container.hasClass('av-number-space-equal');a.labelMinWidth=0;var n=function(t){if(a.number_space){u(a,!0)}};if(a.data.timezone!='0'){a.end=new Date(a.end.getTime()-a.data.timezone*60000)};for(var i in t){let unitContainer=a.container.find('.av-countdown-'+t[i]);a.update[t[i]]={unitContainer:unitContainer,time_container:a.container.find('.av-countdown-'+t[i]+' .av-countdown-time'),label_container:a.container.find('.av-countdown-'+t[i]+' .av-countdown-time-label')};if(a.update[t[i]].label_container.length){a.update[t[i]].single=a.update[t[i]].label_container.data('label');a.update[t[i]].multi=a.update[t[i]].label_container.data('label-multi')};if(a.isFlipNumbers){a.update[t[i]].topCard=unitContainer.find('.card__top');a.update[t[i]].bottomCard=unitContainer.find('.card__bottom');a.update[t[i]].backCard=unitContainer.find('.card__back');a.update[t[i]].backBottomCard=unitContainer.find('.card__back .card__bottom')}
else if(a.isFlipClock){a.update[t[i]].currentTop=unitContainer.find('.curr.top');a.update[t[i]].nextTop=unitContainer.find('.next.top');a.update[t[i]].nextBottom=unitContainer.find('.next.bottom');a.update[t[i]].currentBottom=unitContainer.find('.curr.bottom')}};s(a);a.countdown=setInterval(function(){s(a)},1000);window.addEventListener('resize',aviaJS.aviaJSHelpers.debounce(n.bind(this),50))})}}(jQuery));(function(e){'use strict';e.fn.avia_sc_gallery=function(a){return this.each(function(){var t=e(this),r=t.find('img'),a=t.find('.avia-gallery-big'),s=t.find('.avia-slideshow-arrows .prev-slide'),n=t.find('.avia-slideshow-arrows .next-slide'),i=t.find('.avia-gallery-thumb a'),o=t.hasClass('no-hover-effect');if(n.length){t.avia_swipe_trigger({prev:'.prev-slide',next:'.next-slide'})};t.on('avia_start_animation',function(){r.each(function(a){var t=e(this);setTimeout(function(){t.addClass('avia_start_animation')},(a*110))})});if(t.hasClass('deactivate_avia_lazyload')){t.trigger('avia_start_animation')};if(a.length){t.on('mouseenter','.avia-gallery-thumb a',function(){var i=e(this),c=i.attr('data-prev-img'),r=a.find('img'),l=r.attr('src');if(o){if(!t.hasClass('av-force-img-change')){return}};t.removeClass('av-force-img-change');if(c==l){return};a.height(a.height());a.attr('data-onclick',i.attr('data-onclick'));a.attr('href',i.attr('href'));a.attr('title',i.attr('title'));if('undefined'==typeof i.data('srcset')){a.removeAttr('data-srcset');a.removeData('srcset')}else{a.data('srcset',i.data('srcset'));a.attr('data-srcset',i.data('srcset'))};if('undefined'==typeof i.data('sizes')){a.removeAttr('data-sizes');a.removeData('sizes')}else{a.data('sizes',i.data('sizes'));a.attr('data-sizes',i.data('sizes'))};var n=i.find('.big-prev-fake img').clone(!0);if(n.length==0){var s=new Image();s.src=c;n=e(s)};if(a.hasClass('avia-gallery-big-no-crop-thumb')){n.css({'height':'auto','width':'auto','max-height':'100%','max-width':'100%'})};a.stop().animate({opacity:0},function(){n.insertAfter(r);r.remove();a.animate({opacity:1})})});n.on('click',function(n){n.preventDefault();if(!a.length){return};let current=a[0].dataset.onclick,next_index=current;if(next_index>=i.length){next_index=0};t.addClass('av-force-img-change');e(i[next_index]).trigger('mouseenter')});s.on('click',function(n){n.preventDefault();if(!a.length){return};let current=a[0].dataset.onclick,prev_index=current-2;if(prev_index<0){prev_index=i.length-1};t.addClass('av-force-img-change');e(i[prev_index]).trigger('mouseenter')});a.on('click',function(a){a.preventDefault();var e=t.find('.avia-gallery-thumb a').eq(this.getAttribute('data-onclick')-1);if(e&&!e.hasClass('aviaopeninbrowser')){e.trigger('click')}
else if(e){var i=e.attr('href'),n=e.hasClass('custom_link')?'noopener,noreferrer':'';if(e.hasClass('aviablank')&&i!=''){window.open(i,'_blank',n)}
else if(i!=''){window.open(i,'_self',n)}};return!1});e(window).on('debouncedresize',function(){a.height('auto')})}})}}(jQuery));(function(i){'use strict';i.AviaSlider=function(s,t){var e=this;this.$win=i(window);this.$slider=i(t);this.isMobile=i.avia_utilities.isMobile;this.isTouchDevice=i.avia_utilities.isTouchDevice,this._prepareSlides(s);i.avia_utilities.preload({container:this.$slider,single_callback:function(){e._init(s)}})};i.AviaSlider.defaults={interval:5,autoplay:!1,autoplay_stopper:!1,loop_autoplay:'once',loop_manual:'manual-endless',stopinfiniteloop:!1,noNavigation:!1,animation:'slide',transitionSpeed:900,easing:'easeInOutQuart',wrapElement:'>ul',slideElement:'>li',hoverpause:!1,bg_slider:!1,show_slide_delay:0,fullfade:!1,keep_padding:!1,carousel:'no',carouselSlidesToShow:3,carouselSlidesToScroll:1,carouselResponsive:[]};i.AviaSlider.prototype={_init:function(s){this.options=this._setOptions(s);this.$sliderUl=this.$slider.find(this.options.wrapElement);this.$slides=this.$sliderUl.find(this.options.slideElement);this.slide_arrows=this.$slider.find('.avia-slideshow-arrows');this.gotoButtons=this.$slider.find('.avia-slideshow-dots a');this.permaCaption=this.$slider.find('>.av-slideshow-caption');this.itemsCount=this.$slides.length;this.current=0;this.currentCarousel=0;this.slideWidthCarousel='240';this.loopCount=0;this.isAnimating=!1;this.browserPrefix=i.avia_utilities.supports('transition');this.cssActive=this.browserPrefix!==!1?!0:!1;this.css3DActive=document.documentElement.className.indexOf('avia_transform3d')!==-1?!0:!1;if(this.options.bg_slider==!0){this.imageUrls=[];this.loader=i.avia_utilities.loading(this.$slider);this._bgPreloadImages()}else{this._kickOff()};if(this.options.carousel==='yes'){this.options.animation='carouselslide'}},_setOptions:function(s){var o=this.$slider.data('slideshow-options');if('object'==typeof o){var t=i.extend({},i.AviaSlider.defaults,s,o);if('undefined'!=typeof t.transition_speed){t.transitionSpeed=t.transition_speed};return t};var t=i.extend(!0,{},i.AviaSlider.defaults,s),a=this.$slider.data();for(var e in a){var n=('transition_speed'!=e)?e:'transitionSpeed';if(typeof a[e]==='string'||typeof a[e]==='number'||typeof a[e]==='boolean'){t[n]=a[e]};if('undefined'!=typeof t.autoplay_stopper&&t.autoplay_stopper==1){t.autoplay_stopper=!0}};return t},_prepareSlides:function(s){var t=this.$slider.find('.avia-multi-slideshow-button');if(t.length){t.on('click',function(s){s.stopPropagation();var t=i.avia_utilities.loading(i(this));t.show()})};if(this.isMobile){var e=this.$slider.find('.av-mobile-fallback-image');e.each(function(){var t=i(this).removeClass('av-video-slide').data({'avia_video_events':!0,'video-ratio':0}),n=t.data('mobile-img'),e=t.data('fallback-link'),a=t.find('.avia-slide-wrap');t.find('.av-click-overlay, .mejs-mediaelement, .mejs-container').remove();if(!n){i('<p class="av-fallback-message"><span>Please set a mobile device fallback image for this video in your wordpress backend</span></p>').appendTo(a)};if(s&&s.bg_slider){t.data('img-url',n);if(e!=''){if(a.is('a')){a.attr('href',e)}else{a.replaceWith(function(){var s=i(this);return i('<a>').attr({'data-rel':s.data('rel'),'class':s.attr('class'),'href':e}).append(i(this).contents())});a=t.find('.avia-slide-wrap')};if(i.fn.avia_activate_lightbox){t.parents('#main').avia_activate_lightbox()}}}else{var o='<img src="'+n+'" alt="" title="" />',l=!1;if('string'==typeof e&&e.trim()!=''){if(a.is('a')){a.attr('href',e)}else{var r=e.match(/\.(jpg|jpeg|gif|png)$/i)!=null?' rel="lightbox" ':'';o='<a href="'+e.trim()+'"'+r+'>'+o+'</a>'};l=!0};t.find('.avia-slide-wrap').append(o);if(l&&i.fn.avia_activate_lightbox){t.parents('#main').avia_activate_lightbox()}}})};if(i('html').is('.pointer-device-fine')){if(i('body').is('.avia-slider-video-controls-fix-support')){avia_slider_video_controls_fix(this)}}},_bgPreloadImages:function(i){this._getImageURLS();this._preloadSingle(0,function(){this._kickOff();this._preloadNext(1)})},_getImageURLS:function(){var s=this;this.$slides.each(function(t){s.imageUrls[t]=[];s.imageUrls[t]['url']=i(this).data('img-url');if(typeof s.imageUrls[t]['url']=='string'){s.imageUrls[t]['status']=!1}else{s.imageUrls[t]['status']=!0}})},_preloadSingle:function(s,t){var e=this,a=new Image();if(typeof e.imageUrls[s]['url']=='string'){i(a).on('load error',function(){e.imageUrls[s]['status']=!0;e.$slides.eq(s).css('background-image','url('+e.imageUrls[s]['url']+')');if(typeof t=='function'){t.apply(e,[a,s])}});if(e.imageUrls[s]['url']!=''){a.src=e.imageUrls[s]['url']}else{i(a).trigger('error')}}else{if(typeof t=='function'){t.apply(e,[a,s])}}},_preloadNext:function(i){if(typeof this.imageUrls[i]!='undefined'){this._preloadSingle(i,function(){this._preloadNext(i+1)})}},_bindEvents:function(){var t=this,s=i(window);this.$slider.on('click','.next-slide',this.next.bind(this));this.$slider.on('click','.prev-slide',this.previous.bind(this));this.$slider.on('click','.goto-slide',this.go2.bind(this));if(this.options.hoverpause){this.$slider.on('mouseenter',this.pause.bind(this));this.$slider.on('mouseleave',this.resume.bind(this))};if(this.permaCaption.length){this.permaCaption.on('click',this._routePermaCaptionClick);this.$slider.on('avia_slider_first_slide avia_slider_last_slide avia_slider_navigate_slide',this._setPermaCaptionPointer.bind(this))};if(this.options.stopinfiniteloop&&this.options.autoplay){if(this.options.stopinfiniteloop=='last'){this.$slider.on('avia_slider_last_slide',this._stopSlideshow.bind(this))}
else if(this.options.stopinfiniteloop=='first'){this.$slider.on('avia_slider_first_slide',this._stopSlideshow.bind(this))}};if(this.options.carousel==='yes'){if(!this.isMobile){s.on('debouncedresize',this._buildCarousel.bind(this))}}else{s.on('debouncedresize.aviaSlider',this._setSize.bind(this))};if(!this.options.noNavigation){if(!this.isMobile){this.$slider.avia_keyboard_controls()};if(this.isMobile||this.isTouchDevice){this.$slider.avia_swipe_trigger()}};t._attach_video_events()},_kickOff:function(){var s=this,t=s.$slides.eq(0),e=t.data('video-ratio');s._bindEvents();s._set_slide_arrows_visibility();this.$slider.removeClass('av-default-height-applied');if(e){s._setSize(!0)}else{if(this.options.keep_padding!=!0){s.$sliderUl.css('padding',0);s.$win.trigger('av-height-change')}};s._setCenter();if(this.options.carousel==='no'){t.addClass('next-active-slide');t.css({visibility:'visible',opacity:0}).avia_animate({opacity:1},function(){var t=i(this).addClass('active-slide');if(s.permaCaption.length){s.permaCaption.addClass('active-slide')}})};s.$slider.trigger('avia_slider_first_slide');if(s.options.autoplay){s._startSlideshow()};if(s.options.carousel==='yes'){s._buildCarousel()};s.$slider.trigger('_kickOff')},_set_slide_arrows_visibility:function(){if(this.options.carousel=='yes'){if(0==this.currentCarousel){this.slide_arrows.removeClass('av-visible-prev');this.slide_arrows.addClass('av-visible-next')}
else if(this.currentCarousel+this.options.carouselSlidesToShow>=this.itemsCount){this.slide_arrows.addClass('av-visible-prev');this.slide_arrows.removeClass('av-visible-next')}else{this.slide_arrows.addClass('av-visible-prev');this.slide_arrows.addClass('av-visible-next')};return};if('endless'==this.options.loop_autoplay||'manual-endless'==this.options.loop_manual){this.slide_arrows.addClass('av-visible-prev');this.slide_arrows.addClass('av-visible-next')}
else if(0==this.current){this.slide_arrows.removeClass('av-visible-prev');this.slide_arrows.addClass('av-visible-next')}
else if(this.current+1>=this.itemsCount){this.slide_arrows.addClass('av-visible-prev');this.slide_arrows.removeClass('av-visible-next')}else{this.slide_arrows.addClass('av-visible-prev');this.slide_arrows.addClass('av-visible-next')}},_buildCarousel:function(){var r=this,a=this.$slider.outerWidth(),s=parseInt(a/this.options.carouselSlidesToShow),l=window.innerWidth||i(window).width();if(this.options.carouselResponsive&&this.options.carouselResponsive.length&&this.options.carouselResponsive!==null){for(var e in this.options.carouselResponsive){var n=this.options.carouselResponsive[e]['breakpoint'],t=this.options.carouselResponsive[e]['settings']['carouselSlidesToShow'];if(n>=l){s=parseInt(a/t);this.options.carouselSlidesToShow=t}}};this.slideWidthCarousel=s;this.$slides.each(function(t){i(this).width(s)});var o=s*this.itemsCount;this.$sliderUl.width(o).css('transform','translateX(0px)');if(this.options.carouselSlidesToShow>=this.itemsCount){this.$slider.find('.av-timeline-nav').hide()}},_navigate:function(i,s){if(this.isAnimating||this.itemsCount<2 ||!this.$slider.is(':visible')){return!1};this.isAnimating=!0;this.prev=this.current;if(s!==undefined){this.current=s;i=this.current>this.prev?'next':'prev'}
else if(i==='next'){this.current=this.current<this.itemsCount-1?this.current+1:0;if(this.current===0&&this.options.autoplay_stopper&&this.options.autoplay){this.isAnimating=!1;this.current=this.prev;this._stopSlideshow();return!1};if(0===this.current){if('endless'!=this.options.loop_autoplay&&'manual-endless'!=this.options.loop_manual){this.isAnimating=!1;this.current=this.prev;return!1}}}
else if(i==='prev'){this.current=this.current>0?this.current-1:this.itemsCount-1;if(this.itemsCount-1===this.current){if('endless'!=this.options.loop_autoplay&&'manual-endless'!=this.options.loop_manual){this.isAnimating=!1;this.current=this.prev;return!1}}};this.gotoButtons.removeClass('active').eq(this.current).addClass('active');this._set_slide_arrows_visibility();if(this.options.carousel==='no'){this._setSize()};if(this.options.bg_slider==!0){if(this.imageUrls[this.current]['status']==!0){this['_'+this.options.animation].call(this,i)}else{this.loader.show();this._preloadSingle(this.current,function(){this['_'+this.options.animation].call(this,i);this.loader.hide()})}}else{this['_'+this.options.animation].call(this,i)};if(this.current==0){this.loopCount++;this.$slider.trigger('avia_slider_first_slide')}
else if(this.current==this.itemsCount-1){this.$slider.trigger('avia_slider_last_slide')}else{this.$slider.trigger('avia_slider_navigate_slide')}},_setSize:function(i){if(this.options.bg_slider==!0){return};var n=this,s=this.$slides.eq(this.current),r=s.find('img'),a=Math.floor(this.$sliderUl.height()),o=s.data('video-ratio'),t=o?this.$sliderUl.width()/o:Math.floor(s.height()),e=s.data('video-height'),l=s.data('video-toppos');this.$sliderUl.height(a).css('padding',0);if(t!=a){if(i==!0){this.$sliderUl.css({height:t});this.$win.trigger('av-height-change')}else{this.$sliderUl.avia_animate({height:t},function(){n.$win.trigger('av-height-change')})}};this._setCenter();if(e&&e!='set'){s.find('iframe, embed, video, object, .av_youtube_frame').css({height:e+'%',top:l+'%'});s.data('video-height','set')}},_setCenter:function(){var e=this.$slides.eq(this.current),o=e.find('img'),i=parseInt(o.css('min-width'),10),s=e.width(),a=e.find('.av-slideshow-caption'),t=((s-i)/2);if(a.length){if(a.is('.caption_left')){t=((s-i)/1.5)}
else if(a.is('.caption_right')){t=((s-i)/2.5)}};if(s>=i){t=0};o.css({left:t})},_carouselmove:function(){var i=this.slideWidthCarousel*this.currentCarousel;this.$sliderUl.css('transform','translateX(-'+i+'px)')},_carouselslide:function(i){console.log('_carouselslide:',i,this.currentCarousel);if(i==='next'){if(this.options.carouselSlidesToShow+this.currentCarousel<this.itemsCount){this.currentCarousel++;this._carouselmove()}}
else if(i==='prev'){if(this.currentCarousel>0){this.currentCarousel--;this._carouselmove()}};this._set_slide_arrows_visibility();this.isAnimating=!1},_slide:function(i){var l=!1,h=l==!0?2:1,r=this.$slider.width(),d=i==='next'?-1:1,s=this.browserPrefix+'transform',a={},t={},e={},o=(r*d*-1),n=(r*d)/h;if(this.cssActive){s=this.browserPrefix+'transform';if(this.css3DActive){a[s]='translate3d('+o+'px, 0, 0)';t[s]='translate3d('+n+'px, 0, 0)';e[s]='translate3d(0,0,0)'}else{a[s]='translate('+o+'px,0)';t[s]='translate('+n+'px,0)';e[s]='translate(0,0)'}}else{a.left=o;t.left=n;e.left=0};if(l){t['z-index']='1';e['z-index']='2'};this._slide_animate(a,t,e)},_slide_up:function(i){var l=!0,h=l==!0?2:1,r=this.$slider.height(),d=i==='next'?-1:1,s=this.browserPrefix+'transform',a={},t={},e={},o=(r*d*-1),n=(r*d)/h;if(this.cssActive){s=this.browserPrefix+'transform';if(this.css3DActive){a[s]='translate3d(0,'+o+'px, 0)';t[s]='translate3d(0,'+n+'px, 0)';e[s]='translate3d(0,0,0)'}else{a[s]='translate(0,'+o+'px)';t[s]='translate(0,'+n+'px)';e[s]='translate(0,0)'}}else{a.top=o;t.top=n;e.top=0};if(l){t['z-index']='1';e['z-index']='2'};this._slide_animate(a,t,e)},_slide_animate:function(i,e,a){var t=this,s=this.$slides.eq(this.current),o=this.$slides.eq(this.prev);o.trigger('pause');if(!s.data('disableAutoplay')){if(s.hasClass('av-video-lazyload')&&!s.hasClass('av-video-lazyload-complete')){s.find('.av-click-to-play-overlay').trigger('click')}else{s.trigger('play')}};s.css({visibility:'visible',zIndex:4,opacity:1,left:0,top:0});s.css(i);o.avia_animate(e,this.options.transitionSpeed,this.options.easing);var n=function(){t.isAnimating=!1;s.addClass('active-slide');o.css({visibility:'hidden'}).removeClass('active-slide next-active-slide');t.$slider.trigger('avia-transition-done')};if(t.options.show_slide_delay>0){setTimeout(function(){s.addClass('next-active-slide');s.avia_animate(a,t.options.transitionSpeed,t.options.easing,n)},t.options.show_slide_delay)}else{s.addClass('next-active-slide');s.avia_animate(a,t.options.transitionSpeed,t.options.easing,n)}},_fade:function(){var s=this,i=this.$slides.eq(this.current),t=this.$slides.eq(this.prev),e={visibility:'visible',zIndex:3,opacity:0},a=function(){s.isAnimating=!1;i.addClass('active-slide');t.css({visibility:'hidden',zIndex:2}).removeClass('active-slide next-active-slide');s.$slider.trigger('avia-transition-done')};t.trigger('pause');if(!i.data('disableAutoplay')){if(i.hasClass('av-video-lazyload')&&!i.hasClass('av-video-lazyload-complete')){i.find('.av-click-to-play-overlay').trigger('click')}else{i.trigger('play')}};i.addClass('next-active-slide');if(s.options.fullfade==!0){t.avia_animate({opacity:0},200,'linear',function(){i.css(e).avia_animate({opacity:1},s.options.transitionSpeed,'linear',a)})}else{if(s.current===0){t.avia_animate({opacity:0},s.options.transitionSpeed/2,'linear');i.css(e).avia_animate({opacity:1},s.options.transitionSpeed/2,'linear',a)}else{i.css(e).avia_animate({opacity:1},s.options.transitionSpeed/2,'linear',function(){t.avia_animate({opacity:0},200,'linear',a)})}}},_attach_video_events:function(){var s=this,t=i('html');s.$slides.each(function(t){var n=i(this),r=n.find('.caption_fullwidth, .av-click-overlay'),d=n.find('.mejs-mediaelement'),l=n.hasClass('av-video-lazyload')?!0:!1;if(n.data('avia_video_events')!=!0){n.data('avia_video_events',!0);n.on('av-video-events-bound',{slide:n,wrap:d,iteration:t,self:s,lazyload:l},e);n.on('av-video-ended',{slide:n,self:s},a);n.on('av-video-play-executed',function(){setTimeout(function(){s.pause()},100)});r.on('click',{slide:n},o);if(n.is('.av-video-events-bound')){n.trigger('av-video-events-bound')};if(l&&t===0&&!n.data('disableAutoplay')){n.find('.av-click-to-play-overlay').trigger('click')}}});function e(i){if(i.data.iteration===0){i.data.wrap.css('opacity',0);if(!i.data.self.isMobile&&!i.data.slide.data('disableAutoplay')){i.data.slide.trigger('play')}; ;setTimeout(function(){i.data.wrap.avia_animate({opacity:1},400)},50)}
else if(t.is('.avia-msie')&&!i.data.slide.is('.av-video-service-html5')){if(!i.data.slide.data('disableAutoplay')){i.data.slide.trigger('play')}};if(i.data.slide.is('.av-video-service-html5')&&i.data.iteration!==0){i.data.slide.trigger('pause')};if(i.data.lazyload){i.data.slide.addClass('av-video-lazyload-complete');i.data.slide.trigger('play')}};function a(i){if(!i.data.slide.is('.av-single-slide')&&!i.data.slide.is('.av-loop-video')){i.data.slide.trigger('reset');s._navigate('next');s.resume()};if(i.data.slide.is('.av-loop-video')&&i.data.slide.is('.av-video-service-html5')){if(t.is('.avia-safari-8')){setTimeout(function(){i.data.slide.trigger('play')},1)}}};function o(i){if(i.target.tagName!='A'){i.data.slide.trigger('toggle')}}},_timer:function(i,s,o){var t=this,e,a=s;t.timerId=0;this.pause=function(){window.clearTimeout(t.timerId);a-=new Date()-e};this.resume=function(){e=new Date();t.timerId=window.setTimeout(i,a)};this.destroy=function(){window.clearTimeout(t.timerId)};this.resume(!0)},_startSlideshow:function(){var i=this;this.isPlaying=!0;this.slideshow=new this._timer(function(){i._navigate('next');if(i.options.autoplay){i._startSlideshow()}},(this.options.interval*1000))},_stopSlideshow:function(){if(this.options.autoplay){this.slideshow.destroy();this.isPlaying=!1;this.options.autoplay=!1};this.options.autoplay=!1;this.options.loop_autoplay='once';this.$slider.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual');this.$slider.removeClass('av-loop-endless').addClass('av-loop-once')},_setPermaCaptionPointer:function(s){if(!this.permaCaption.length){return};var t=i(this.$slides[this.current]).find('a').length;this.permaCaption.css('cursor',t?'pointer':'default')},_routePermaCaptionClick:function(s){var t=i(this).siblings('.avia-slideshow-inner').find('>.active-slide a');if(t.length){s.preventDefault();t[0].click()}},next:function(i){i.preventDefault();this._stopSlideshow();this._navigate('next')},previous:function(i){i.preventDefault();this._stopSlideshow();this._navigate('prev')},go2:function(i){if(isNaN(i)){i.preventDefault();i=i.currentTarget.hash.replace('#','')};i-=1;if(i===this.current||i>=this.itemsCount||i<0){return!1};this._stopSlideshow();this._navigate(!1,i)},play:function(){if(!this.isPlaying){this.isPlaying=!0;this._navigate('next');this.options.autoplay=!0;this._startSlideshow()}},pause:function(){if(this.isPlaying){this.slideshow.pause()}},resume:function(){if(this.isPlaying){this.slideshow.resume()}},destroy:function(i){this.slideshow.destroy(i)}};i.fn.aviaSlider=function(s){return this.each(function(){var t=i.data(this,'aviaSlider');if(!t){t=i.data(this,'aviaSlider',new i.AviaSlider(s,this))}})}})(jQuery);
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);r=200==Math.round(t(n.width)),s.isBoxSizeOuter=r,i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,I=d&&r,x=t(s.width);x!==!1&&(a.width=x+(I?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(I?0:y+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+z),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var o=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?o.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,o){t=i.makeArray(t);var n=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!o)return void n.push(t);e(t,o)&&n.push(t);for(var i=t.querySelectorAll(o),s=0;s<i.length;s++)n.push(i[s])}}),n},i.debounceMethod=function(t,e,i){i=i||100;var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];clearTimeout(t);var e=arguments,s=this;this[n]=setTimeout(function(){o.apply(s,e),delete s[n]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var n=t.console;return i.htmlInit=function(e,o){i.docReady(function(){var s=i.toDashed(o),r="data-"+s,a=document.querySelectorAll("["+r+"]"),u=document.querySelectorAll(".js-"+s),h=i.makeArray(a).concat(i.makeArray(u)),d=r+"-options",l=t.jQuery;h.forEach(function(t){var i,s=t.getAttribute(r)||t.getAttribute(d);try{i=s&&JSON.parse(s)}catch(a){return void(n&&n.error("Error parsing "+r+" on "+t.className+": "+a))}var u=new e(t,i);l&&l.data(t,o,u)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var s=document.documentElement.style,r="string"==typeof s.transition?"transition":"WebkitTransition",a="string"==typeof s.transform?"transform":"WebkitTransform",u={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],h={transform:a,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"},d=o.prototype=Object.create(t.prototype);d.constructor=o,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var o=h[i]||i;e[o]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=t[e?"left":"right"],n=t[i?"top":"bottom"],s=parseFloat(o),r=parseFloat(n),a=this.layout.size;o.indexOf("%")!=-1&&(s=s/100*a.width),n.indexOf("%")!=-1&&(r=r/100*a.height),s=isNaN(s)?0:s,r=isNaN(r)?0:r,s-=e?a.paddingLeft:a.paddingRight,r-=i?a.paddingTop:a.paddingBottom,this.position.x=s,this.position.y=r},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),n=i?"paddingLeft":"paddingRight",s=i?"left":"right",r=i?"right":"left",a=this.position.x+t[n];e[s]=this.getXValue(a),e[r]="";var u=o?"paddingTop":"paddingBottom",h=o?"top":"bottom",d=o?"bottom":"top",l=this.position.y+t[u];e[h]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),n&&!this.isTransitioning)return void this.layoutPosition();var s=t-i,r=e-o,a={};a.transform=this.getTranslate(s,r),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop");return t=i?t:-t,e=o?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+n(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(u,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=f[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(c)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,o,n,s){return e(t,i,o,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,o,n){"use strict";function s(t,e){var i=o.getQueryElement(t);if(!i)return void(u&&u.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++l;this.element.outlayerGUID=n,f[n]=this,this._create();var s=this._getOption("initLayout");s&&this.layout()}function r(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],o=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var n=m[o]||1;return i*n}var u=t.console,h=t.jQuery,d=function(){},l=0,f={};s.namespace="outlayer",s.Item=n,s.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=s.prototype;o.extend(c,e.prototype),c.option=function(t){o.extend(this.options,t)},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},s.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0;n<e.length;n++){var s=e[n],r=new i(s,this);o.push(r)}return o},c._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map(function(t){return t.element})},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},c._init=c.layout,c._resetLayout=function(){this.getSize()},c.getSize=function(){this.size=i(this.element)},c._getMeasurement=function(t,e){var o,n=this.options[t];n?("string"==typeof n?o=this.element.querySelector(n):n instanceof HTMLElement&&(o=n),this[t]=o?i(o)[e]:n):this[t]=0},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},c._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var o=this._getItemLayoutPosition(t);o.item=t,o.isInstant=e||t.isLayoutInstant,i.push(o)},this),this._processLayoutQueue(i)}},c._getItemLayoutPosition=function(){return{x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},c.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},c._positionItem=function(t,e,i,o,n){o?t.goTo(e,i):(t.stagger(n*this.stagger),t.moveTo(e,i))},c._postLayout=function(){this.resizeContainer()},c.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},c._getContainerSize=d,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},c._emitCompleteOnItems=function(t,e){function i(){n.dispatchEvent(t+"Complete",null,[e])}function o(){r++,r==s&&i()}var n=this,s=e.length;if(!e||!s)return void i();var r=0;e.forEach(function(e){e.once(t,o)})},c.dispatchEvent=function(t,e,i){var o=e?[e].concat(i):i;if(this.emitEvent(t,o),h)if(this.$element=this.$element||h(this.element),e){var n=h.Event(e);n.type=t,this.$element.trigger(n,i)}else this.$element.trigger(t,i)},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},c.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},c.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){o.removeFrom(this.stamps,t),this.unignore(t)},this)},c._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},c._manageStamp=d,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),o=this._boundingRect,n=i(t),s={left:e.left-o.left-n.marginLeft,top:e.top-o.top-n.marginTop,right:o.right-e.right-n.marginRight,bottom:o.bottom-e.bottom-n.marginBottom};return s},c.handleEvent=o.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},c.onresize=function(){this.resize()},o.debounceMethod(s,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},c.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=o.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),o.removeFrom(this.items,t)},this)},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete f[e],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&f[e]},s.create=function(t,e){var i=r(s);return i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.compatOptions=o.extend({},s.compatOptions),i.namespace=t,i.data=s.data,i.Item=r(n),o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i};var m={ms:1,s:1e3};return s.Item=n,s}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/item",["outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,function(t){"use strict";function e(){t.Item.apply(this,arguments)}var i=e.prototype=Object.create(t.Item.prototype),o=i._create;i._create=function(){this.id=this.layout.itemGUID++,o.call(this),this.sortData={}},i.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var n=i.destroy;return i.destroy=function(){n.apply(this,arguments),this.css({display:""})},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,function(t,e){"use strict";function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}var o=i.prototype,n=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout","_getOption"];return n.forEach(function(t){o[t]=function(){return e.prototype[t].apply(this.isotope,arguments)}}),o.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!=this.isotope.size.innerHeight},o._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},o.getColumnWidth=function(){this.getSegmentSize("column","Width")},o.getRowHeight=function(){this.getSegmentSize("row","Height")},o.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},o.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},o.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},o.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function n(){i.apply(this,arguments)}return n.prototype=Object.create(o),n.prototype.constructor=n,e&&(n.options=e),n.prototype.namespace=t,i.modes[t]=n,n},i}),function(t,e){"function"==typeof define&&define.amd?define("masonry-layout/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var o=i.prototype;return o._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},o.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,s=n/o,r=o-n%o,a=r&&r<1?"round":"floor";s=Math[a](s),this.cols=Math.max(s,1)},o.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,o=e(i);this.containerWidth=o&&o.innerWidth},o._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&e<1?"round":"ceil",o=Math[i](t.size.outerWidth/this.columnWidth);o=Math.min(o,this.cols);for(var n=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",s=this[n](o,t),r={x:this.columnWidth*s.col,y:s.y},a=s.y+t.size.outerHeight,u=o+s.col,h=s.col;h<u;h++)this.colYs[h]=a;return r},o._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},o._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;o<i;o++)e[o]=this._getColGroupY(o,t);return e},o._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},o._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,o=t>1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.right,r=s+i.outerWidth,a=Math.floor(s/this.columnWidth);a=Math.max(0,a);var u=Math.floor(r/this.columnWidth);u-=r%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/masonry",["../layout-mode","masonry-layout/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope-layout/js/item","isotope-layout/js/layout-mode","isotope-layout/js/layout-modes/masonry","isotope-layout/js/layout-modes/fit-rows","isotope-layout/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)}):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope-layout/js/item"),require("isotope-layout/js/layout-mode"),require("isotope-layout/js/layout-modes/masonry"),require("isotope-layout/js/layout-modes/fit-rows"),require("isotope-layout/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;n<t.length;n++){var s=t[n],r=i.sortData[s],a=o.sortData[s];if(r>a||r<a){var u=void 0!==e[s]?e[s]:e,h=u?1:-1;return(r>a?1:-1)*h}}return 0}}var u=t.jQuery,h=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=s,d.LayoutMode=r;var l=d.prototype;l._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in r.modes)this._initLayoutMode(t)},l.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},l._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i<t.length;i++){var o=t[i];o.id=this.itemGUID++}return this._updateItemsSortData(t),t},l._initLayoutMode=function(t){var e=r.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},l.layout=function(){return!this._isLayoutInited&&this._getOption("initLayout")?void this.arrange():void this._layout()},l._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},l.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},l._init=l.arrange,l._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},l._getIsInstant=function(){var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},l._bindArrangeComplete=function(){function t(){e&&i&&o&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}var e,i,o,n=this;this.once("layoutComplete",function(){e=!0,t()}),this.once("hideComplete",function(){i=!0,t()}),this.once("revealComplete",function(){o=!0,t()})},l._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],s=this._getFilterTest(e),r=0;r<t.length;r++){var a=t[r];if(!a.isIgnored){var u=s(a);u&&i.push(a),u&&a.isHidden?o.push(a):u||a.isHidden||n.push(a)}}return{matches:i,needReveal:o,needHide:n}},l._getFilterTest=function(t){return u&&this.options.isJQueryFiltering?function(e){return u(e.element).is(t);
}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d});
!function(a,b){"function"==typeof define&&define.amd?define("packery/js/rect",b):"object"==typeof module&&module.exports?module.exports=b():(a.Packery=a.Packery||{},a.Packery.Rect=b())}(window,function(){function a(b){for(var c in a.defaults)this[c]=a.defaults[c];for(c in b)this[c]=b[c]}a.defaults={x:0,y:0,width:0,height:0};var b=a.prototype;return b.contains=function(a){var b=a.width||0,c=a.height||0;return this.x<=a.x&&this.y<=a.y&&this.x+this.width>=a.x+b&&this.y+this.height>=a.y+c},b.overlaps=function(a){var b=this.x+this.width,c=this.y+this.height,d=a.x+a.width,e=a.y+a.height;return this.x<d&&b>a.x&&this.y<e&&c>a.y},b.getMaximalFreeRects=function(b){if(!this.overlaps(b))return!1;var c,d=[],e=this.x+this.width,f=this.y+this.height,g=b.x+b.width,h=b.y+b.height;return this.y<b.y&&(c=new a({x:this.x,y:this.y,width:this.width,height:b.y-this.y}),d.push(c)),e>g&&(c=new a({x:g,y:this.y,width:e-g,height:this.height}),d.push(c)),f>h&&(c=new a({x:this.x,y:h,width:this.width,height:f-h}),d.push(c)),this.x<b.x&&(c=new a({x:this.x,y:this.y,width:b.x-this.x,height:this.height}),d.push(c)),d},b.canFit=function(a){return this.width>=a.width&&this.height>=a.height},a}),function(a,b){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],b);else if("object"==typeof module&&module.exports)module.exports=b(require("./rect"));else{var c=a.Packery=a.Packery||{};c.Packer=b(c.Rect)}}(window,function(a){function b(a,b,c){this.width=a||0,this.height=b||0,this.sortDirection=c||"downwardLeftToRight",this.reset()}var c=b.prototype;c.reset=function(){this.spaces=[];var b=new a({x:0,y:0,width:this.width,height:this.height});this.spaces.push(b),this.sorter=d[this.sortDirection]||d.downwardLeftToRight},c.pack=function(a){for(var b=0;b<this.spaces.length;b++){var c=this.spaces[b];if(c.canFit(a)){this.placeInSpace(a,c);break}}},c.columnPack=function(a){for(var b=0;b<this.spaces.length;b++){var c=this.spaces[b],d=c.x<=a.x&&c.x+c.width>=a.x+a.width&&c.height>=a.height-.01;if(d){a.y=c.y,this.placed(a);break}}},c.rowPack=function(a){for(var b=0;b<this.spaces.length;b++){var c=this.spaces[b],d=c.y<=a.y&&c.y+c.height>=a.y+a.height&&c.width>=a.width-.01;if(d){a.x=c.x,this.placed(a);break}}},c.placeInSpace=function(a,b){a.x=b.x,a.y=b.y,this.placed(a)},c.placed=function(a){for(var b=[],c=0;c<this.spaces.length;c++){var d=this.spaces[c],e=d.getMaximalFreeRects(a);e?b.push.apply(b,e):b.push(d)}this.spaces=b,this.mergeSortSpaces()},c.mergeSortSpaces=function(){b.mergeRects(this.spaces),this.spaces.sort(this.sorter)},c.addSpace=function(a){this.spaces.push(a),this.mergeSortSpaces()},b.mergeRects=function(a){var b=0,c=a[b];a:for(;c;){for(var d=0,e=a[b+d];e;){if(e==c)d++;else{if(e.contains(c)){a.splice(b,1),c=a[b];continue a}c.contains(e)?a.splice(b+d,1):d++}e=a[b+d]}b++,c=a[b]}return a};var d={downwardLeftToRight:function(a,b){return a.y-b.y||a.x-b.x},rightwardTopToBottom:function(a,b){return a.x-b.x||a.y-b.y}};return b}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/item",["outlayer/outlayer","./rect"],b):"object"==typeof module&&module.exports?module.exports=b(require("outlayer"),require("./rect")):a.Packery.Item=b(a.Outlayer,a.Packery.Rect)}(window,function(a,b){var c=document.documentElement.style,d="string"==typeof c.transform?"transform":"WebkitTransform",e=function(){a.Item.apply(this,arguments)},f=e.prototype=Object.create(a.Item.prototype),g=f._create;f._create=function(){g.call(this),this.rect=new b};var h=f.moveTo;return f.moveTo=function(a,b){var c=Math.abs(this.position.x-a),d=Math.abs(this.position.y-b),e=this.layout.dragItemCount&&!this.isPlacing&&!this.isTransitioning&&1>c&&1>d;return e?void this.goTo(a,b):void h.apply(this,arguments)},f.enablePlacing=function(){this.removeTransitionStyles(),this.isTransitioning&&d&&(this.element.style[d]="none"),this.isTransitioning=!1,this.getSize(),this.layout._setRectSize(this.element,this.rect),this.isPlacing=!0},f.disablePlacing=function(){this.isPlacing=!1},f.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},f.showDropPlaceholder=function(){var a=this.dropPlaceholder;a||(a=this.dropPlaceholder=document.createElement("div"),a.className="packery-drop-placeholder",a.style.position="absolute"),a.style.width=this.size.width+"px",a.style.height=this.size.height+"px",this.positionDropPlaceholder(),this.layout.element.appendChild(a)},f.positionDropPlaceholder=function(){this.dropPlaceholder.style[d]="translate("+this.rect.x+"px, "+this.rect.y+"px)"},f.hideDropPlaceholder=function(){this.layout.element.removeChild(this.dropPlaceholder)},e}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/packery",["get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],b):"object"==typeof module&&module.exports?module.exports=b(require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):a.Packery=b(a.getSize,a.Outlayer,a.Packery.Rect,a.Packery.Packer,a.Packery.Item)}(window,function(a,b,c,d,e){function f(a,b){return a.position.y-b.position.y||a.position.x-b.position.x}function g(a,b){return a.position.x-b.position.x||a.position.y-b.position.y}function h(a,b){var c=b.x-a.x,d=b.y-a.y;return Math.sqrt(c*c+d*d)}c.prototype.canFit=function(a){return this.width>=a.width-1&&this.height>=a.height-1};var i=b.create("packery");i.Item=e;var j=i.prototype;j._create=function(){b.prototype._create.call(this),this.packer=new d,this.shiftPacker=new d,this.isEnabled=!0,this.dragItemCount=0;var a=this;this.handleDraggabilly={dragStart:function(){a.itemDragStart(this.element)},dragMove:function(){a.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){a.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(b,c){c&&a.itemDragStart(b.currentTarget)},drag:function(b,c){c&&a.itemDragMove(b.currentTarget,c.position.left,c.position.top)},stop:function(b,c){c&&a.itemDragEnd(b.currentTarget)}}},j._resetLayout=function(){this.getSize(),this._getMeasurements();var a,b,c;this._getOption("horizontal")?(a=1/0,b=this.size.innerHeight+this.gutter,c="rightwardTopToBottom"):(a=this.size.innerWidth+this.gutter,b=1/0,c="downwardLeftToRight"),this.packer.width=this.shiftPacker.width=a,this.packer.height=this.shiftPacker.height=b,this.packer.sortDirection=this.shiftPacker.sortDirection=c,this.packer.reset(),this.maxY=0,this.maxX=0},j._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},j._getItemLayoutPosition=function(a){if(this._setRectSize(a.element,a.rect),this.isShifting||this.dragItemCount>0){var b=this._getPackMethod();this.packer[b](a.rect)}else this.packer.pack(a.rect);return this._setMaxXY(a.rect),a.rect},j.shiftLayout=function(){this.isShifting=!0,this.layout(),delete this.isShifting},j._getPackMethod=function(){return this._getOption("horizontal")?"rowPack":"columnPack"},j._setMaxXY=function(a){this.maxX=Math.max(a.x+a.width,this.maxX),this.maxY=Math.max(a.y+a.height,this.maxY)},j._setRectSize=function(b,c){var d=a(b),e=d.outerWidth,f=d.outerHeight;(e||f)&&(e=this._applyGridGutter(e,this.columnWidth),f=this._applyGridGutter(f,this.rowHeight)),c.width=Math.min(e,this.packer.width),c.height=Math.min(f,this.packer.height)},j._applyGridGutter=function(a,b){if(!b)return a+this.gutter;b+=this.gutter;var c=a%b,d=c&&1>c?"round":"ceil";return a=Math[d](a/b)*b},j._getContainerSize=function(){return this._getOption("horizontal")?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},j._manageStamp=function(a){var b,d=this.getItem(a);if(d&&d.isPlacing)b=d.rect;else{var e=this._getElementOffset(a);b=new c({x:this._getOption("originLeft")?e.left:e.right,y:this._getOption("originTop")?e.top:e.bottom})}this._setRectSize(a,b),this.packer.placed(b),this._setMaxXY(b)},j.sortItemsByPosition=function(){var a=this._getOption("horizontal")?g:f;this.items.sort(a)},j.fit=function(a,b,c){var d=this.getItem(a);d&&(this.stamp(d.element),d.enablePlacing(),this.updateShiftTargets(d),b=void 0===b?d.rect.x:b,c=void 0===c?d.rect.y:c,this.shift(d,b,c),this._bindFitEvents(d),d.moveTo(d.rect.x,d.rect.y),this.shiftLayout(),this.unstamp(d.element),this.sortItemsByPosition(),d.disablePlacing())},j._bindFitEvents=function(a){function b(){d++,2==d&&c.dispatchEvent("fitComplete",null,[a])}var c=this,d=0;a.once("layout",b),this.once("layoutComplete",b)},j.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&(this.options.shiftPercentResize?this.resizeShiftPercentLayout():this.layout())},j.needsResizeLayout=function(){var b=a(this.element),c=this._getOption("horizontal")?"innerHeight":"innerWidth";return b[c]!=this.size[c]},j.resizeShiftPercentLayout=function(){var b=this._getItemsForLayout(this.items),c=this._getOption("horizontal"),d=c?"y":"x",e=c?"height":"width",f=c?"rowHeight":"columnWidth",g=c?"innerHeight":"innerWidth",h=this[f];if(h=h&&h+this.gutter){this._getMeasurements();var i=this[f]+this.gutter;b.forEach(function(a){var b=Math.round(a.rect[d]/h);a.rect[d]=b*i})}else{var j=a(this.element)[g]+this.gutter,k=this.packer[e];b.forEach(function(a){a.rect[d]=a.rect[d]/k*j})}this.shiftLayout()},j.itemDragStart=function(a){if(this.isEnabled){this.stamp(a);var b=this.getItem(a);b&&(b.enablePlacing(),b.showDropPlaceholder(),this.dragItemCount++,this.updateShiftTargets(b))}},j.updateShiftTargets=function(a){this.shiftPacker.reset(),this._getBoundingRect();var b=this._getOption("originLeft"),d=this._getOption("originTop");this.stamps.forEach(function(a){var e=this.getItem(a);if(!e||!e.isPlacing){var f=this._getElementOffset(a),g=new c({x:b?f.left:f.right,y:d?f.top:f.bottom});this._setRectSize(a,g),this.shiftPacker.placed(g)}},this);var e=this._getOption("horizontal"),f=e?"rowHeight":"columnWidth",g=e?"height":"width";this.shiftTargetKeys=[],this.shiftTargets=[];var h,i=this[f];if(i=i&&i+this.gutter){var j=Math.ceil(a.rect[g]/i),k=Math.floor((this.shiftPacker[g]+this.gutter)/i);h=(k-j)*i;for(var l=0;k>l;l++)this._addShiftTarget(l*i,0,h)}else h=this.shiftPacker[g]+this.gutter-a.rect[g],this._addShiftTarget(0,0,h);var m=this._getItemsForLayout(this.items),n=this._getPackMethod();m.forEach(function(a){var b=a.rect;this._setRectSize(a.element,b),this.shiftPacker[n](b),this._addShiftTarget(b.x,b.y,h);var c=e?b.x+b.width:b.x,d=e?b.y:b.y+b.height;if(this._addShiftTarget(c,d,h),i)for(var f=Math.round(b[g]/i),j=1;f>j;j++){var k=e?c:b.x+i*j,l=e?b.y+i*j:d;this._addShiftTarget(k,l,h)}},this)},j._addShiftTarget=function(a,b,c){var d=this._getOption("horizontal")?b:a;if(!(0!==d&&d>c)){var e=a+","+b,f=-1!=this.shiftTargetKeys.indexOf(e);f||(this.shiftTargetKeys.push(e),this.shiftTargets.push({x:a,y:b}))}},j.shift=function(a,b,c){var d,e=1/0,f={x:b,y:c};this.shiftTargets.forEach(function(a){var b=h(a,f);e>b&&(d=a,e=b)}),a.rect.x=d.x,a.rect.y=d.y};var k=120;j.itemDragMove=function(a,b,c){function d(){f.shift(e,b,c),e.positionDropPlaceholder(),f.layout()}var e=this.isEnabled&&this.getItem(a);if(e){b-=this.size.paddingLeft,c-=this.size.paddingTop;var f=this,g=new Date;this._itemDragTime&&g-this._itemDragTime<k?(clearTimeout(this.dragTimeout),this.dragTimeout=setTimeout(d,k)):(d(),this._itemDragTime=g)}},j.itemDragEnd=function(a){function b(){d++,2==d&&(c.element.classList.remove("is-positioning-post-drag"),c.hideDropPlaceholder(),e.dispatchEvent("dragItemPositioned",null,[c]))}var c=this.isEnabled&&this.getItem(a);if(c){clearTimeout(this.dragTimeout),c.element.classList.add("is-positioning-post-drag");var d=0,e=this;c.once("layout",b),this.once("layoutComplete",b),c.moveTo(c.rect.x,c.rect.y),this.layout(),this.dragItemCount=Math.max(0,this.dragItemCount-1),this.sortItemsByPosition(),c.disablePlacing(),this.unstamp(c.element)}},j.bindDraggabillyEvents=function(a){this._bindDraggabillyEvents(a,"on")},j.unbindDraggabillyEvents=function(a){this._bindDraggabillyEvents(a,"off")},j._bindDraggabillyEvents=function(a,b){var c=this.handleDraggabilly;a[b]("dragStart",c.dragStart),a[b]("dragMove",c.dragMove),a[b]("dragEnd",c.dragEnd)},j.bindUIDraggableEvents=function(a){this._bindUIDraggableEvents(a,"on")},j.unbindUIDraggableEvents=function(a){this._bindUIDraggableEvents(a,"off")},j._bindUIDraggableEvents=function(a,b){var c=this.handleUIDraggable;a[b]("dragstart",c.start)[b]("drag",c.drag)[b]("dragstop",c.stop)};var l=j.destroy;return j.destroy=function(){l.apply(this,arguments),this.isEnabled=!1},i.Rect=c,i.Packer=d,i}),function(a,b){"function"==typeof define&&define.amd?define(["isotope-layout/js/layout-mode","packery/js/packery"],b):"object"==typeof module&&module.exports?module.exports=b(require("isotope-layout/js/layout-mode"),require("packery")):b(a.Isotope.LayoutMode,a.Packery)}(window,function(a,b){var c=a.create("packery"),d=c.prototype,e={_getElementOffset:!0,_getMeasurement:!0};for(var f in b.prototype)e[f]||(d[f]=b.prototype[f]);var g=d._resetLayout;d._resetLayout=function(){this.packer=this.packer||new b.Packer,this.shiftPacker=this.shiftPacker||new b.Packer,g.apply(this,arguments)};var h=d._getItemLayoutPosition;d._getItemLayoutPosition=function(a){return a.rect=a.rect||new b.Rect,h.call(this,a)};var i=d.needsResizeLayout;d.needsResizeLayout=function(){return this._getOption("horizontal")?this.needsVerticalResizeLayout():i.call(this)};var j=d._getOption;return d._getOption=function(a){return"horizontal"==a?void 0!==this.options.isHorizontal?this.options.isHorizontal:this.options.horizontal:j.apply(this.isotope,arguments)},c});(function(i){'use strict';i.fn.avia_masonry=function(a){if(!this.length){return this};var s=i('body'),e=i(window),n=i.avia_utilities.isMobile,l=i.avia_utilities.isTouchDevice,r=s.hasClass('avia-mobile-no-animations'),o=!1,t={masonry_filter:function(){var a=i(this),l=a.html(),n=a.data('filter'),o=a.parents('.av-masonry').eq(0),s=o.find('.av-masonry-container').eq(0),d=o.find('.av-masonry-sort a'),r=o.find('.av-current-sort-title');d.removeClass('active_sort');a.addClass('active_sort');s.attr('id','masonry_id_'+n);if(r.length){r.html(l)};t.applyMasonry(s,n,function(){s.css({overflow:'visible'})});setTimeout(function(){e.trigger('debouncedresize')},500);return!1},applyMasonry:function(a,o,s){var t=o?{filter:'.'+o}:{};t['layoutMode']='packery';t['packery']={gutter:0};t['percentPosition']=!0;t['itemSelector']='a.isotope-item, div.isotope-item';t['originLeft']=i('body').hasClass('rtl')?!1:!0;a.isotope(t,function(){e.trigger('av-height-change')});if(typeof s==='function'){setTimeout(s,0)}},show_bricks:function(a,t){var s=i.avia_utilities.supports('transition'),o=n&&r?0:100;a.each(function(n){var r=i(this),l=r.find('.avia-curtain-reveal-overlay');if(l.length>0){o=500;l.on('animationstart',function(i){r.css({visibility:'visible'})});l.on('animationend',function(a){i(this).remove()})};setTimeout(function(){if(s===!1){r.css({visibility:'visible',opacity:0}).animate({opacity:1},1500)}else{r.addClass('av-masonry-item-loaded');l.addClass('avia_start_delayed_animation')};if(n==a.length-1&&typeof t=='function'){t.call();e.trigger('av-height-change')}},(o*n))})},loadMore:function(a){a.preventDefault();if(o){return!1};o=!0;var l=i(this),n=l.data(),r=l.parents('.av-masonry').eq(0),f=r.data('post_id'),c=r.find('.av-masonry-container'),u=r.find('.av-masonry-entry'),d=i.avia_utilities.loading(),v=function(){o=!1;d.hide();s.trigger('av_resize_finished')};if('undefined'!=typeof f){n.post_id=f};if(!n.offset){n.offset=0};n.offset+=n.items;n.action='avia_ajax_masonry_more';n.loaded=[];u.each(function(){var a=i(this).data('av-masonry-item');if(a){n.loaded.push(a)}});i.ajax({url:avia_framework_globals.ajaxurl,type:'POST',data:n,beforeSend:function(){d.show()},success:function(a){if(a.indexOf('{av-masonry-loaded}')!==-1){var a=a.split('{av-masonry-loaded}'),o=i(a.pop()).filter('.isotope-item');if(o.length>n.items){o=o.not(o.last())}else{l.addClass('av-masonry-no-more-items')};o.find('.avia-animate-admin-preview').removeClass('avia-animate-admin-preview');if(o.find('.avia-curtain-reveal-overlay').length>0){o.css({visibility:'hidden'})};var s=i('<div class="loadcontainer"></div>').append(o);i.avia_utilities.preload({container:s,single_callback:function(){var s=r.find('.av-masonry-sort a'),a=r.find('.av-sort-by-term'),n=a.data('av-allowed-sort');a.hide();d.hide();c.isotope('insert',o);i.avia_utilities.avia_ajax_call(r);setTimeout(function(){t.show_bricks(o,v)},150);setTimeout(function(){e.trigger('av-height-change')},550);if(s){i(s).each(function(a){var t=i(this),e=t.data('filter');if(o){i(o).each(function(a){var s=i(this);if(s.hasClass(e)&&n.indexOf(e)!==-1){var o=t.find('.avia-term-count').text();t.find('.avia-term-count').text(' '+(parseInt(o)+1)+' ');if(t.hasClass('avia_hide_sort')){t.removeClass('avia_hide_sort').addClass('avia_show_sort');r.find('.av-masonry-sort .'+e+'_sep').removeClass('avia_hide_sort').addClass('avia_show_sort');r.find('.av-masonry-sort .av-sort-by-term').removeClass('hidden')}}})}})};a.fadeIn()}})}else{v()}},error:v,complete:function(){setTimeout(function(){e.trigger('debouncedresize')},500)}})}};return this.each(function(){var a=i(this),e=a.find('.av-masonry-container'),o=a.find('.isotope-item'),s=a.find('.av-masonry-sort').css({visibility:'visible',opacity:0}).on('click','a',t.masonry_filter),l=a.find('.av-masonry-load-more').css({visibility:'visible',opacity:0});if(o.find('.avia-curtain-reveal-overlay').length>0){o.css({visibility:'hidden'})};i.avia_utilities.preload({container:e,single_callback:function(){var d=function(){s.animate({opacity:1},400);if(e.outerHeight()+e.offset().top+i('#footer').outerHeight()>i(window).height()){i('html').css({'overflow-y':'scroll'})};t.applyMasonry(e,!1,function(){a.addClass('avia_sortable_active');e.removeClass('av-js-disabled')});t.show_bricks(o,function(){l.css({opacity:1}).on('click',t.loadMore)})};if(n&&r){d()}else{a.waypoint(d,{offset:'80%'})};i(window).on('debouncedresize',function(){t.applyMasonry(e,!1,function(){a.addClass('avia_sortable_active')})})}})})}}(jQuery));(function(e){'use strict';e.AviaVideoAPI=function(i,t,o){this.videoElement=t;this.$video=e(t);this.$option_container=o?e(o):this.$video;this.load_btn=this.$option_container.find('.av-click-to-play-overlay');this.video_wrapper=this.$video.parents('ul').eq(0);this.lazy_load=this.video_wrapper.hasClass('av-show-video-on-click')?!0:!1;this.isMobile=e.avia_utilities.isMobile;this.fallback=this.isMobile?this.$option_container.is('.av-mobile-fallback-image'):!1;if(this.fallback){return};this._init(i)};e.AviaVideoAPI.defaults={loop:!1,mute:!1,controls:!1,events:'play pause mute unmute loop toggle reset unload'};e.AviaVideoAPI.apiFiles={youtube:{loaded:!1,src:'https://www.youtube.com/iframe_api'}};e.AviaVideoAPI.players={};e.AviaVideoAPI.prototype={_init:function(i){this.options=this._setOptions(i);this.type=this._getPlayerType();this.player=!1;this._bind_player();this.eventsBound=!1;this.playing=!1;this.$option_container.addClass('av-video-paused');this.pp=e.avia_utilities.playpause(this.$option_container)},_setOptions:function(i){var n=e.extend(!0,{},e.AviaVideoAPI.defaults,i),o=this.$option_container.data(),t='';for(t in o){if(o.hasOwnProperty(t)&&(typeof o[t]==='string'||typeof o[t]==='number'||typeof o[t]==='boolean')){n[t]=o[t]}};return n},_getPlayerType:function(){var e=this.$video.get(0).src||this.$video.data('src');if(this.$video.is('video')){return'html5'};if(this.$video.is('.av_youtube_frame')){return'youtube'};if(e.indexOf('vimeo.com')!=-1){return'vimeo'};if(e.indexOf('youtube.com')!=-1){return'youtube'}},_bind_player:function(){var t=this,o=e('html').hasClass('av-cookies-needs-opt-in')||e('html').hasClass('av-cookies-can-opt-out'),i=!0,n=e('html').hasClass('av-cookies-user-silent-accept'),a='html5'==this.type;if(o&&!n&&!a){if(!document.cookie.match(/aviaCookieConsent/)||e('html').hasClass('av-cookies-session-refused')){i=!1}else{if(!document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){i=!1}
else if(!document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){i=!1}
else if(document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/)){i=!1}}};if(window['wp']&&wp.hooks){i=wp.hooks.applyFilters('aviaCookieConsent_allow_continue',i)};let allow_class=i?'avia-video-cookie-allowed':'avia-video-cookie-not-allowed';e('html').addClass(allow_class);if(!i){this._use_external_link();return};if(this.lazy_load&&this.load_btn.length&&this.type!='html5'){this.$option_container.addClass('av-video-lazyload');this.load_btn.on('click',function(){t.load_btn.remove();t._setPlayer()})}else{this.lazy_load=!1;this._setPlayer()}},_use_external_link:function(){this.$option_container.addClass('av-video-lazyload');this.load_btn.on('click',function(i){if(i.originalEvent===undefined)return;var t=e(this).parents('.avia-slide-wrap').find('div[data-original_url]').data('original_url');if(t)window.open(t,'_blank')})},_setPlayer:function(){var t=this;switch(this.type){case'html5':this.player=this.$video.data('mediaelementplayer');if(!this.player){this.$video.data('mediaelementplayer',e.AviaVideoAPI.players[this.$video.attr('id').replace(/_html5/,'')]);this.player=this.$video.data('mediaelementplayer')};this._playerReady();break;case'vimeo':var i=document.createElement('iframe');var o=e(i);i.onload=function(){t.player=Froogaloop(i);t._playerReady();t.$option_container.trigger('av-video-loaded')};i.setAttribute('src',this.$video.data('src'));o.insertAfter(this.$video);this.$video.remove();this.$video=i;break;case'youtube':this._getAPI(this.type);e('body').on('av-youtube-iframe-api-loaded',function(){t._playerReady()});break}},_getAPI:function(i){if(e.AviaVideoAPI.apiFiles[i].loaded===!1){e.AviaVideoAPI.apiFiles[i].loaded=!0;var t=document.createElement('script'),o=document.getElementsByTagName('script')[0];t.src=e.AviaVideoAPI.apiFiles[i].src;o.parentNode.insertBefore(t,o)}},_playerReady:function(){var i=this;this.$option_container.on('av-video-loaded',function(){i._bindEvents()});switch(this.type){case'html5':this.$video.on('av-mediajs-loaded',function(){i.$option_container.trigger('av-video-loaded')});this.$video.on('av-mediajs-ended',function(){i.$option_container.trigger('av-video-ended')});break;case'vimeo':i.player.addEvent('ready',function(){i.$option_container.trigger('av-video-loaded');i.player.addEvent('finish',function(){i.$option_container.trigger('av-video-ended')})});break;case'youtube':var t=i.$video.data();if(i._supports_video()){t.html5=1};i.player=new YT.Player(i.$video.attr('id'),{videoId:t.videoid,height:i.$video.attr('height'),width:i.$video.attr('width'),playerVars:t,events:{'onReady':function(){i.$option_container.trigger('av-video-loaded')},'onError':function(i){e.avia_utilities.log('YOUTUBE ERROR:','error',i)},'onStateChange':function(e){if(e.data===YT.PlayerState.ENDED){var t=i.options.loop!=!1?'loop':'av-video-ended';i.$option_container.trigger(t)}}}});break};setTimeout(function(){if(i.eventsBound==!0||typeof i.eventsBound=='undefined'||i.type=='youtube'){return};e.avia_utilities.log('Fallback Video Trigger "'+i.type+'":','log',i);i.$option_container.trigger('av-video-loaded')},2000)},_bindEvents:function(){if(this.eventsBound==!0||typeof this.eventsBound=='undefined'){return};var e=this,i='unmute';this.eventsBound=!0;this.$option_container.on(this.options.events,function(i){e.api(i.type)});if(!e.isMobile){if(this.options.mute!=!1){i='mute'};if(this.options.loop!=!1){e.api('loop')};e.api(i)};setTimeout(function(){e.$option_container.trigger('av-video-events-bound').addClass('av-video-events-bound')},50)},_supports_video:function(){return!!document.createElement('video').canPlayType},api:function(e){if(this.isMobile&&!this.was_started())return;if(this.options.events.indexOf(e)===-1)return;this.$option_container.trigger('av-video-'+e+'-executed');if(typeof this['_'+this.type+'_'+e]=='function'){this['_'+this.type+'_'+e].call(this)};if(typeof this['_'+e]=='function'){this['_'+e].call(this)}},was_started:function(){if(!this.player)return!1;switch(this.type){case'html5':if(this.player.getCurrentTime()>0){return!0};break;case'vimeo':if(this.player.api('getCurrentTime')>0){return!0};break;case'youtube':if(this.player.getPlayerState()!==-1){return!0};break};return!1},_play:function(){this.playing=!0;this.$option_container.addClass('av-video-playing').removeClass('av-video-paused')},_pause:function(){this.playing=!1;this.$option_container.removeClass('av-video-playing').addClass('av-video-paused')},_loop:function(){this.options.loop=!0},_toggle:function(){var e=this.playing==!0?'pause':'play';this.api(e);this.pp.set(e)},_vimeo_play:function(){this.player.api('play')},_vimeo_pause:function(){this.player.api('pause')},_vimeo_mute:function(){this.player.api('setVolume',0)},_vimeo_unmute:function(){this.player.api('setVolume',0.7)},_vimeo_loop:function(){},_vimeo_reset:function(){this.player.api('seekTo',0)},_vimeo_unload:function(){this.player.api('unload')},_youtube_play:function(){this.player.playVideo()},_youtube_pause:function(){this.player.pauseVideo()},_youtube_mute:function(){this.player.mute()},_youtube_unmute:function(){this.player.unMute()},_youtube_loop:function(){if(this.playing==!0)this.player.seekTo(0)},_youtube_reset:function(){this.player.stopVideo()},_youtube_unload:function(){this.player.clearVideo()},_html5_play:function(){if(this.player){this.player.options.pauseOtherPlayers=!1;this.player.play()}},_html5_pause:function(){if(this.player)this.player.pause()},_html5_mute:function(){if(this.player)this.player.setMuted(!0)},_html5_unmute:function(){if(this.player)this.player.setVolume(0.7)},_html5_loop:function(){if(this.player)this.player.options.loop=!0},_html5_reset:function(){if(this.player)this.player.setCurrentTime(0)},_html5_unload:function(){this._html5_pause();this._html5_reset()}};e.fn.aviaVideoApi=function(i,t){return this.each(function(){var o=this;if(t){o=e(this).parents(t).get(0)};var n=e.data(o,'aviaVideoApi');if(!n){n=e.data(o,'aviaVideoApi',new e.AviaVideoAPI(i,this,o))}})}})(jQuery);window.onYouTubeIframeAPIReady=function(){jQuery('body').trigger('av-youtube-iframe-api-loaded')};var Froogaloop=(function(){function i(e){return new i.fn.init(e)};var e={},d=!1,t=!1,p=Array.prototype.slice,o='*';i.fn=i.prototype={element:null,init:function(e){if(typeof e==='string'){e=document.getElementById(e)};this.element=e;return this},api:function(e,i){if(!this.element||!e){return!1};var o=this,t=o.element,l=t.id!==''?t.id:null,u=!r(i)?i:null,a=r(i)?i:null;if(a){s(e,a,l)};n(e,u,t);return o},addEvent:function(e,i){if(!this.element){return!1};var a=this,o=a.element,r=o.id!==''?o.id:null;s(e,i,r);if(e!='ready'){n('addEventListener',e,o)}
else if(e=='ready'&&t){i.call(null,r)};return a},removeEvent:function(e){if(!this.element){return!1};var t=this,i=t.element,o=i.id!==''?i.id:null,a=u(e,o);if(e!='ready'&&a){n('removeEventListener',e,i)}}};function n(e,i,t){if(!t.contentWindow.postMessage){return!1};var n=JSON.stringify({method:e,value:i});t.contentWindow.postMessage(n,o)};function a(e){var i,r;try{i=JSON.parse(e.data);r=i.event||i.method}catch(p){};if(r=='ready'&&!t){t=!0};if(!(/^https?:\/\/player.vimeo.com/).test(e.origin)){return!1};if(o==='*'){o=e.origin};var u=i.value,d=i.data,a=a===''?null:i.player_id,s=l(r,a),n=[];if(!s){return!1};if(u!==undefined){n.push(u)};if(d){n.push(d)};if(a){n.push(a)};return n.length>0?s.apply(null,n):s.call()};function s(i,t,o){if(o){if(!e[o]){e[o]={}};e[o][i]=t}else{e[i]=t}};function l(i,t){if(t&&e[t]&&e[t][i]){return e[t][i]}else{return e[i]}};function u(i,t){if(t&&e[t]){if(!e[t][i]){return!1};e[t][i]=null}else{if(!e[i]){return!1};e[i]=null};return!0};function r(e){return!!(e&&e.constructor&&e.call&&e.apply)};function h(e){return toString.call(e)==='[object Array]'};i.fn.init.prototype=i.fn;if(window.addEventListener){window.addEventListener('message',a,!1)}else{window.attachEvent('onmessage',a)};return(window.Froogaloop=window.$f=i)})();(function(a){'use strict';a.fn.avia_sc_tab_section=function(){var t=a(window),v=a.avia_utilities.supports('transition'),n=this.browserPrefix!==!1?!0:!1,i=a.avia_utilities.isMobile,s=a.avia_utilities.isTouchDevice,l=a('body').hasClass('avia-mobile-no-animations'),o=document.documentElement.className.indexOf('avia_transform3d')!==-1?!0:!1,e={},r=['avia_animate_when_visible','avia_animate_when_almost_visible','av-animated-generic','av-animated-when-visible','av-animated-when-almost-visible','av-animated-when-visible-95'];return this.each(function(){var v=a(this),d=v.find('.av-section-tab-title'),b=v.find('.av-tab-section-outer-container'),C=v.find('.av-tab-section-tab-title-container'),oa=v.find('.av_tab_navigation'),x=v.find('.av-tabsection-arrow'),la=x.find('.av-tab-section-slide'),da=v.find('.av-slide-section-container-wrap'),p=v.find('.av-tabsection-slides-arrow'),ra=p.find('.av-tab-section-slide-content'),E=v.find('.av-tabsection-slides-dots'),va=E.find('.goto-slide'),h=v.find('.av-tab-section-inner-container'),ca=v.find('.av-animation-delay-container'),y=v.find('.av-layout-tab'),k=v.find('.av-layout-tab-inner'),I=v.is('.av-tab-content-auto'),N=v.hasClass('av-minimum-height'),f=null,g='1',O=1,u=0,m='none',c={animation:'av-tab-slide-transition',autoplay:!1,loop_autoplay:'once',interval:5,loop_manual:'manual-endless',autoplay_stopper:!1,noNavigation:!1},Q=b.data('slideshow-data'),D={},w=null;if('undefined'!=typeof Q){c=a.extend({},c,Q)};y.each(function(){var e=a(this),t=e.data('av-deeplink-tabs'),i=e.data('av-tab-section-content');if(t){D[t.toLowerCase()]=i}});g=v.find('.av-active-tab-title').data('av-tab-section-title');g='undefined'!=typeof g?g:'1';O=parseInt(g,10);f=v.find('[data-av-tab-section-content="'+g+'"]');f.addClass('__av_init_open av-active-tab-content');if('av-tab-slide-transition'==c.animation){m='slide_sidewards'}
else if('av-tab-slide-up-transition'==c.animation){m='slide_up'}
else if('av-tab-fade-transition'==c.animation){m='fade'};if('slide_up'==m){a.each(r,function(a,e){k.find('.'+e).addClass('avia_start_animation_when_active')})};var j=function(t,p){t.preventDefault();if(v.hasClass('av-is-slideshow')&&t.originalEvent!==undefined){return};var b=a(t.currentTarget),w=b.data('av-tab-section-title'),r=parseInt(w,10),k=f;d.removeClass('av-active-tab-title');k.removeClass('av-active-tab-content');b.removeClass('no-scroll');f=v.find('[data-av-tab-section-content="'+w+'"]');g=w;O=r;b.addClass('av-active-tab-title');f.addClass('av-active-tab-content');var s=((r-1)*-100);if(a('body').hasClass('rtl')){s=((r-1)*100)};T();if(['none','slide_sidewards'].indexOf(m)>=0){if(n){s=s/d.length;e['transform']=o?'translate3d('+s+'%, 0, 0)':'translate('+s+'%,0)';e['left']='0%';h.css(e)}else{h.css('left',s+'%')}}
else if('slide_up'==m){y.css('opacity',1);if(n){var u=f.data('slide-top');if('undefined'==typeof u){u=0};e['transform']=o?'translate3d(0, -'+u+'px, 0)':'translate(0, -'+u+'px ,0)';e['left']='0';h.css(e)}else{h.css('top','-'+s+'px')};y.filter(':not(.av-active-tab-content)').css('opacity',0)};L();ea(r);ta(r);if(!(p||c.autoplay)){var x=b.attr('href'),C=f.data('av-deeplink-tabs');if('undefined'!=typeof(C)&&''!=C){x=C};location.hash=x};setTimeout(function(){f.trigger('avia_start_animation_if_current_slide_is_active');if(!i||(i&&!l)){ca.not(f).trigger('avia_remove_animation')}},600)},aa=function(){u=0;d.each(function(){u+=a(this).outerWidth()});C.css('min-width',u)},T=function(){var d=v.hasClass('av-hide-tabs')?0:C.height(),s=d?C.outerHeight():0,i=0,u=0,l=0,e=0,o=0;if(N){var n=v.hasClass('av-minimum-height-custom')?v.data('av_minimum_height_px'):v.css('min-height');n=parseInt(n,10);if(!isNaN(n)){i=n};if(!i){N=!1}};if(!I){k.css('height','');h.css('min-height','');var c=y.first();u=c.outerHeight()-c.height();y.each(function(){var e=a(this),t=e.find('.av-layout-tab-inner');l=Math.max(l,t.height())});e=l+u;o=e+s;if(N){if(o<i){e=i-s;o=i}};h.css('min-height',e);h.css('height',e)}
else if(I&&N){e=i-s;o=i;h.css('min-height',e);h.css('height',e)};if(['none','slide_sidewards','fade'].indexOf(m)>=0){if(!f.length){return};if(I){k.height('auto');var p=f.find('.av-layout-tab-inner').height(),g=f.outerHeight(),w=g+d+100;b.css('max-height',w);k.height(p);k.css('overflow','hidden')};setTimeout(function(){t.trigger('av-height-change')},600);return};var r=0;y.each(function(){var e=a(this),i=e.find('.av-layout-tab-inner'),n=e.data('av-tab-section-content'),o=parseInt(n,10),t=e.outerHeight();e.data('slide-top',r);r+=t;if(I&&o==O){b.css('max-height',t+s);i.css('overflow','hidden')}})},L=function(){var o=v.find('.av-active-tab-title'),t=v.width(),e=(o.position().left*-1)-(o.outerWidth()/2)+(t/2);if(!a('body').hasClass('rtl')){if(t>=u){e=0};if(e+u<t){e=(u-t)*-1};if(e>0){e=0};C.css('left',e);var n=e!==0,s=e+u>t;M(n,s)}else{var i=0;if(t<u){if(e+u>t){if(e>0){e=0};i=(e+u-t)*-1}};C.css('left','auto');C.css('right',i);var n=i+u>t,s=i!==0;M(n,s)}},M=function(a,e){if(a){x.addClass('av-visible-prev')}else{x.removeClass('av-visible-prev')};if(e){x.addClass('av-visible-next')}else{x.removeClass('av-visible-next')}},ea=function(a){if(a>1){p.addClass('av-visible-prev')}else{p.removeClass('av-visible-prev')};if(a<d.length){p.addClass('av-visible-next')}else{p.removeClass('av-visible-next')}},ta=function(a){E.find('a').removeClass('active');E.find('a').eq(a-1).addClass('active')},ia=function(a){if(c.noNavigation){return};W(a)},W=function(e){e.preventDefault();var i=a(e.currentTarget),t=v.find('.av-active-tab-title');if(v.hasClass('av-slideshow-section')){if(i.hasClass('av_prev_tab_section')){p.find('.av_prev_tab_section').trigger('click')}else{p.find('.av_next_tab_section').trigger('click')};return};if(i.is('.av_prev_tab_section')){if(!a('body').hasClass('rtl')){t.prev('.av-section-tab-title').trigger('click')}else{t.next('.av-section-tab-title').trigger('click')}}else{if(!a('body').hasClass('rtl')){t.next('.av-section-tab-title').trigger('click')}else{t.prev('.av-section-tab-title').trigger('click')}}},na=function(e){e.preventDefault();if(c.noNavigation&&e.originalEvent!==undefined){return};var n=a(e.currentTarget),s=v.find('.av-active-tab-title'),o=s.data('av-tab-section-title'),l=parseInt(o,10),i=0;if(n.hasClass('av_prev_tab_section')){i=!a('body').hasClass('rtl')?-1:1}else{i=!a('body').hasClass('rtl')?1:-1};var t=l+i;if(t<=0||t>d.length){if('endless'!=c.loop_autoplay&&'manual-endless'!=c.loop_manual){return};t=t<=0?d.length:1};H();d.eq(t-1).trigger('click');q()},sa=function(e){e.preventDefault();var i=a(e.currentTarget);if(i.hasClass('active')){return};var n=i.attr('href').replace('#',''),t=parseInt(n,10);if(t>d.length){return};H();d.eq(t-1).trigger('click');q()},z=function(){var t=window.location.hash?window.location.hash:'',e=t.toLowerCase().replace('#',''),a=null;if('undefined'!=typeof(D[e])&&''!=D[e]){var i=D[e];a=d.filter('[data-av-tab-section-title="'+i+'"]')}else{a=d.filter('[href="'+t+'"]')};if(a.length){if(!a.is('.active_tab')){a.trigger('click')}}else{v.find('.av-active-tab-title').trigger('click',!0)}},H=function(){if(typeof w==='number'){clearTimeout(w)};w=null},q=function(){if(!v.hasClass('av-slideshow-section')){return};if(!0!==c.autoplay){b.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual')};if('undefined'==typeof c.loop_autoplay||'endless'!=c.loop_autoplay){c.loop_autoplay='once'};if('undefined'==typeof c.interval){c.interval=5};if('undefined'==typeof c.autoplay||!0!==c.autoplay){c.autoplay=!1;b.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual');return};H();w=setTimeout(function(){P()},c.interval*1000)},P=function(){var n=v.find('.av-active-tab-title'),s=n.data('av-tab-section-title'),e=parseInt(s,10),i=!1,t=0;w=null;if('endless'==c.loop_autoplay){if(!a('body').hasClass('rtl')){t=e<d.length?e+1:1}else{t=e>1?e-1:d.length}}else{if(!a('body').hasClass('rtl')){i=e==d.length;t=e+1}else{i=e==1;t=e-1};if(i){c.autoplay=!1;c.loop_autoplay='manual';b.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual');b.removeClass('av-loop-endless').addClass('av-loop-once');return}};d.eq(t-1).trigger('click');w=setTimeout(function(){P()},c.interval*1000)};a.avia_utilities.preload({container:f,single_callback:function(){d.on('click',j);la.on('click',W);ra.on('click',na);va.on('click',sa);if(i||s){oa.on('click',ia)};t.on('debouncedresize',L);t.on('hashchange',z);t.on('debouncedresize av-content-el-height-changed',T);aa();T();z();q()}});if(i||s){if(!c.noNavigation){h.avia_swipe_trigger({prev:'.av_prev_tab_section',next:'.av_next_tab_section'})}};T()})}}(jQuery));(function(t){'use strict';t.fn.avia_sc_tabs=function(e){var a={heading:'.tab',content:'.tab_content',active:'active_tab',sidebar:!1};var i=t(window),e=t.extend(a,e);return this.each(function(){var a=t(this),c=t('<div class="tab_titles" role="tablist"></div>').prependTo(a),n=t(e.heading,a),r=t(e.content,a),o=!1,d=!1;o=n.clone();d=n.addClass('fullsize-tab').attr({'aria-hidden':!0,'aria-selected':!1,id:'',role:'','aria-controls':'',tabindex:0});n=o;n.prependTo(c).each(function(e){var a=t(this),i=!1;if(o){i=d.eq(e)};a.addClass('tab_counter_'+e).attr({tab_counter:e}).on('click',function(){l(a,e,i);return!1});a.on('keydown',function(t){if(t.keyCode===13){a.trigger('click')}});if(o){i.on('click',function(){l(i,e,a);return!1});i.on('keydown',function(t){if(t.keyCode===13){i.trigger('click')}})}});s();f(!1);i.on('debouncedresize',s);t('a').on('click',function(){var e=t(this).attr('href');if(typeof e!='undefined'&&e){e=e.replace(/^.*?#/,'');f('#'+e)}});function s(){if(!e.sidebar){return};r.css({'min-height':c.outerHeight()+1})};function l(n,l,o){if(!n.is('.'+e.active)){t('.'+e.active,a).removeClass(e.active).attr({'aria-selected':!1,tabindex:0});t('.'+e.active+'_content',a).removeClass(e.active+'_content').attr('aria-hidden',!0);n.addClass(e.active).attr({'aria-selected':!0,tabindex:0});var s=n.data('fake-id');if(typeof s=='string'){window.location.replace(s)};if(o){o.addClass(e.active)};var d=r.eq(l).addClass(e.active+'_content').attr('aria-hidden',!1);if(typeof click_container!='undefined'&&click_container.length){sidebar_shadow.height(d.outerHeight())};var c=d.offset().top,f=c-50-parseInt(t('html').css('margin-top'),10);if(i.scrollTop()>c){t('html:not(:animated),body:not(:animated)').scrollTop(f)}};i.trigger('av-content-el-height-changed',n)};function f(t){if(!t&&window.location.hash){t=window.location.hash};if(!t){return};var e=n.filter('[data-fake-id="'+t+'"]');if(e.length){if(!e.is('.active_tab')){e.trigger('click')};window.scrollTo(0,a.offset().top-70)}}})}}(jQuery));(function(t){'use strict';t.fn.avia_sc_toggle=function(e){var i={single:'.single_toggle',heading:'.toggler',content:'.toggle_wrap',sortContainer:'.taglist'};var a=t(window),e=t.extend(i,e);return this.each(function(){var i=t(this).addClass('enable_toggles'),l=t(e.single,i),n=t(e.heading,i),h=t(e.content,i),s=t(e.sortContainer+' a',i),o=t('#av-admin-preview'),d='',r='';n.each(function(g){var l=t(this),s=l.hasClass('av-title-below')?l.prev(e.content,i):l.next(e.content,i),c=parseInt(l.data('slide-speed'));c=isNaN(c)?200:c;function f(){var e=s.offset().top,i=e-50-parseInt(t('html').css('margin-top'),10);if(a.scrollTop()>e){t('html:not(:animated),body:not(:animated)').animate({scrollTop:i},c)}};if(s.css('visibility')!='hidden'){l.addClass('activeTitle').attr('style',d)};l.on('keydown',function(t){if(t.keyCode===13||t.keyCode===32){l.trigger('click')}});l.on('click',function(){if(s.css('visibility')!='hidden'){s.slideUp(c,function(){s.removeClass('active_tc').attr({style:''});a.trigger('av-height-change');a.trigger('av-content-el-height-changed',this);if(o.length==0){location.replace(l.data('fake-id')+'-closed')}});l.removeClass('activeTitle').attr('style',r)}else{if(i.is('.toggle_close_all')){h.not(s).slideUp(c,function(){t(this).removeClass('active_tc').attr({style:''});f()});n.removeClass('activeTitle').attr('style',r)};s.addClass('active_tc');setTimeout(function(){s.slideDown(c,function(){if(!i.is('.toggle_close_all')){f()};a.trigger('av-height-change');a.trigger('av-content-el-height-changed',this)})},1);l.addClass('activeTitle').attr('style',d);if(o.length==0){location.replace(l.data('fake-id'))}}})});s.on('click',function(e){e.preventDefault();var a=l.filter('[data-tags~="'+t(this).data('tag')+'"]'),i=l.not('[data-tags~="'+t(this).data('tag')+'"]');s.removeClass('activeFilter');t(this).addClass('activeFilter');n.filter('.activeTitle').trigger('click');a.slideDown();i.slideUp()});function c(){n.each(function(a){let $heading=t(this),title_open=$heading.attr('data-title-open'),title=$heading.attr('data-title'),aria_collapsed=$heading.attr('data-aria_collapsed'),aria_expanded=$heading.attr('data-aria_expanded'),content=$heading.hasClass('av-title-below')?$heading.prev(e.content,i):$heading.next(e.content,i),titleHasHtml=!1,currentTitle=$heading.contents()[0].data;if(!title){title='***'};if(!aria_collapsed){aria_collapsed='Expand Toggle'};if(!aria_expanded){aria_expanded='Collapse Toggle'};titleHasHtml=title.indexOf('<')>=0;if(content.css('visibility')!='hidden'){if(title_open&&!titleHasHtml&&currentTitle!=title_open){$heading.contents()[0].data=title_open};$heading.attr('aria-expanded','true');$heading.attr('aria-label',aria_expanded);content.attr({'aria-hidden':'false',tabindex:0})}else{if(title_open&&!titleHasHtml&&currentTitle!=title){$heading.contents()[0].data=title};$heading.attr('aria-expanded','false');$heading.attr('aria-label',aria_collapsed);content.attr({'aria-hidden':'true',tabindex:-1})}});setTimeout(function(){c()},150)};function g(t){if(!t&&window.location.hash){t=window.location.hash};if(!t){return};var e=n.filter('[data-fake-id="'+t+'"]');if(e.length){if(!e.is('.activeTitle')){e.trigger('click')};window.scrollTo(0,i.offset().top-70)}};c();g(!1);t('a').on('click',function(){var e=t(this).attr('href');if(typeof e!='undefined'&&e){e=e.replace(/^.*?#/,'');g('#'+e)}})})}}(jQuery));(function(i){'use strict';i('body').on('click','.av-lazyload-video-embed .av-click-to-play-overlay',function(l){var n=i(this),d=i('html').hasClass('av-cookies-needs-opt-in')||i('html').hasClass('av-cookies-can-opt-out'),e=!0,c=i('html').hasClass('av-cookies-user-silent-accept');if(d&&!c){if(!document.cookie.match(/aviaCookieConsent/)||i('html').hasClass('av-cookies-session-refused')){e=!1}else{if(!document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){e=!1}
else if(!document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){e=!1}
else if(document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/)){e=!1}}};if(window['wp']&&wp.hooks){e=wp.hooks.applyFilters('aviaCookieConsent_allow_continue',e)};var a=n.parents('.av-lazyload-video-embed');if(a.hasClass('avia-video-lightbox')&&a.hasClass('avia-video-standard-html')){e=!0};if(!e){if(typeof l.originalEvent=='undefined'){return};var t=a.data('original_url');if(t)window.open(t,'_blank','noreferrer noopener');return};var s=a.find('.av-video-tmpl').html(),o='';if(a.hasClass('avia-video-lightbox')){o=a.find('a.lightbox-link');if(o.length==0){a.append(s);setTimeout(function(){o=a.find('a.lightbox-link');if(i('html').hasClass('av-default-lightbox')){o.addClass('lightbox-added').magnificPopup(i.avia_utilities.av_popup);o.trigger('click')}else{o.trigger('avia-open-video-in-lightbox')}},100)}else{o.trigger('click')}}else{a.html(s)}});i('.av-lazyload-immediate .av-click-to-play-overlay').trigger('click')}(jQuery));(function(e){'use strict';e(function(){e.avia_utilities=e.avia_utilities||{};if('undefined'==typeof e.avia_utilities.isMobile){if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&'ontouchstart' in document.documentElement){e.avia_utilities.isMobile=!0}else{e.avia_utilities.isMobile=!1}};i();e(window).trigger('resize')});e.avia_utilities=e.avia_utilities||{};function i(){var m=e('#header'),u=e('#main .av-logo-container'),h=e('#avia-menu'),l=e('.av-burger-menu-main a'),a=e('html').eq(0),n=e('<div class="av-burger-overlay" role="menu" aria-orientation="vertical"></div>'),p=e('<div class="av-burger-overlay-scroll"></div>').appendTo(n),g=e('<div class="av-burger-overlay-inner"></div>').appendTo(p),k=e('<div class="av-burger-overlay-bg"></div>').appendTo(n),r=!1,v={},b=e('.av-logo-container .inner-container'),C=b.find('.main_menu'),d=a.is('.html_av-submenu-display-click.html_av-submenu-clone, .html_av-submenu-display-hover.html_av-submenu-clone'),y=!1,T=0;if(!a.hasClass('html_av-submenu-hidden')){a.addClass('html_av-submenu-visible')};var f=e('#avia_alternate_menu');if(f.length>0){h=f};var c=function(){if(e.avia_utilities.isMobile){p.outerHeight(window.innerHeight)}},o=function(i,u){if(!i){return};var c,s,t,r,v,f,m,a,n;i.each(function(){t=e(this);r=t.find(' > .sub-menu > li');if(r.length==0){r=t.find(' > .children > li')};v=t.find('.avia_mega_div > .sub-menu > li.menu-item');var i=t.find('>a'),c=!0;if(i.length){if(i.get(0).hash=='#'||'undefined'==typeof i.attr('href')||i.attr('href')=='#'){if(r.length>0||v.length>0){c=!1}}};s=i.clone(c).attr('style','');if('undefined'==typeof i.attr('href')){s.attr('href','#')};a=e('<li>').append(s);a.attr('role','menuitem');var l=[];if('undefined'!=typeof t.attr('class')){l=t.attr('class').split(/\s+/);e.each(l,function(e,i){if((i.indexOf('menu-item')!=0)&&(i.indexOf('page-item')<0)&&(i.indexOf('page_item')!=0)&&(i.indexOf('dropdown_ul')<0)){a.addClass(i)};return!0})};if('undefined'!=typeof t.attr('id')&&''!=t.attr('id')){a.addClass(t.attr('id'))}else{e.each(l,function(e,i){if(i.indexOf('page-item-')>=0){a.addClass(i);return!1}})};u.append(a);if(r.length){n=e('<ul class="sub-menu">').appendTo(a);if(d&&(s.get(0).hash!='#'&&s.attr('href')!='#')){a.clone(!0).prependTo(n)};a.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');o(r,n)}
else if(v.length){n=e('<ul class="sub-menu">').appendTo(a);if(d&&(s.get(0).hash!='#'&&s.attr('href')!='#')){a.clone(!0).prependTo(n)};v.each(function(i){var v=e(this),t=v.find('> .sub-menu'),s=v.find('> .mega_menu_title'),c=s.find('a').attr('href')||'#',r=t.length>0?t.find('>li'):null,f=!1,l=a.find('>a'),m='';if((r===null)||(r.length==0)){if(c=='#'){m=' style="display: none;"'}};if(i==0)a.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');if(s.length&&s.text()!=''){f=!0;if(i>0){var u=a.parents('li').eq(0);if(u.length)a=u;n=e('<ul class="sub-menu">').appendTo(a)};a=e('<li'+m+'>').appendTo(n);n=e('<ul class="sub-menu">').appendTo(a);e('<a href="'+c+'"><span class="avia-bullet"></span><span class="avia-menu-text">'+s.text()+'</span></a>').insertBefore(n);l=a.find('>a');if(d&&(t.length>0)&&(l.length&&l.get(0).hash!='#'&&l.attr('href')!='#')){a.clone(!0).addClass('av-cloned-title').prependTo(n)}};if(f&&(t.length>0)){a.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">')};o(r,n)})}});l.trigger('avia_burger_list_created');return c},s,i;e('body').on('mousewheel DOMMouseScroll touchmove','.av-burger-overlay-scroll',function(e){var n=this.offsetHeight,i=this.scrollHeight,a=e.originalEvent.wheelDelta;if(i!=this.clientHeight){if((this.scrollTop>=(i-n)&&a<0)||(this.scrollTop<=0&&a>0)){e.preventDefault()}}else{e.preventDefault()}});e(document).on('mousewheel DOMMouseScroll touchmove','.av-burger-overlay-bg, .av-burger-overlay-active .av-burger-menu-main',function(e){e.preventDefault()});var t={};e(document).on('touchstart','.av-burger-overlay-scroll',function(e){t.Y=e.originalEvent.touches[0].clientY});e(document).on('touchend','.av-burger-overlay-scroll',function(e){t={}});e(document).on('touchmove','.av-burger-overlay-scroll',function(i){if(!t.Y){t.Y=i.originalEvent.touches[0].clientY};var l=i.originalEvent.touches[0].clientY-t.Y,a=this,n=a.scrollTop,r=a.scrollHeight,o=n+a.offsetHeight,s=l>0?'up':'down';e('body').get(0).scrollTop=t.body;if(n<=0){if(s=='up'){i.preventDefault()}}
else if(o>=r){if(s=='down'){i.preventDefault()}}});e(window).on('debouncedresize',function(n){var s=!0;if(e.avia_utilities.isMobile&&a.hasClass('av-mobile-menu-switch-portrait')&&a.hasClass('html_text_menu_active')){var t=e(window).height(),o=e(window).width();if(o<=t){a.removeClass('html_burger_menu')}else{var r=a.hasClass('html_mobile_menu_phone')?768:990;if(t<r){a.addClass('html_burger_menu');s=!1}else{a.removeClass('html_burger_menu')}}};if(s&&i&&i.length){if(!l.is(':visible')){i.filter('.is-active').parents('a').eq(0).trigger('click')}};c()});e('.html_av-overlay-side').on('click','.av-burger-overlay-bg',function(e){e.preventDefault();i.parents('a').eq(0).trigger('click')});e(window).on('avia_smooth_scroll_start',function(){if(i&&i.length){i.filter('.is-active').parents('a').eq(0).trigger('click')}});e('.html_av-submenu-display-hover').on('mouseenter','.av-width-submenu',function(i){e(this).children('ul.sub-menu').slideDown('fast')});e('.html_av-submenu-display-hover').on('mouseleave','.av-width-submenu',function(i){e(this).children('ul.sub-menu').slideUp('fast')});e('.html_av-submenu-display-hover').on('click','.av-width-submenu > a',function(e){e.preventDefault();e.stopImmediatePropagation()});e('.html_av-submenu-display-hover').on('touchstart','.av-width-submenu > a',function(i){var a=e(this);w(a,i)});e('.html_av-submenu-display-click').on('click','.av-width-submenu > a',function(i){var a=e(this);w(a,i)});e('.html_av-submenu-display-click, .html_av-submenu-visible').on('click','.av-burger-overlay a',function(a){var n=window.location.href.match(/(^[^#]*)/)[0],t=e(this).attr('href').match(/(^[^#]*)/)[0];if(t==n){a.preventDefault();a.stopImmediatePropagation();i.parents('a').eq(0).trigger('click');return!1};return!0});function w(e,i){i.preventDefault();i.stopImmediatePropagation();var a=e.parents('li').eq(0);a.toggleClass('av-show-submenu');if(a.is('.av-show-submenu')){a.children('ul.sub-menu').slideDown('fast')}else{a.children('ul.sub-menu').slideUp('fast')}};(function(){if(C.length){return};var i=e('#header .main_menu').clone(!0),t=i.find('ul.av-main-nav'),n=t.attr('id');if('string'==typeof n&&''!=n.trim()){t.attr('id',n+'-'+T++)};i.find('.menu-item:not(.menu-item-avia-special)').remove();i.insertAfter(b.find('.logo').first());var a=e('#header .social_bookmarks').clone(!0);if(!a.length){a=e('.av-logo-container .social_bookmarks').clone(!0)};if(a.length){i.find('.avia-menu').addClass('av_menu_icon_beside');i.append(a)};l=e('.av-burger-menu-main a')}());l.on('click',function(t){if(r){return};i=e(this).find('.av-hamburger'),r=!0;if(!y){y=!0;i.addClass('av-inserted-main-menu');s=e('<ul>').attr({id:'av-burger-menu-ul',class:'','aria-haspopup':'true','aria-controls':'menu2'});var d=h.find('> li:not(.menu-item-avia-special)'),f=o(d,s);s.find('.noMobile').remove();s.appendTo(g);v=g.find('#av-burger-menu-ul > li');if(e.fn.avia_smoothscroll){e('a[href*="#"]',n).avia_smoothscroll(n)}};if(i.is('.is-active')){i.removeClass('is-active');a.removeClass('av-burger-overlay-active-delayed');n.animate({opacity:0},function(){n.css({display:'none'});a.removeClass('av-burger-overlay-active');r=!1})}else{c();var l=u.length?u.outerHeight()+u.position().top:m.outerHeight()+m.position().top;n.appendTo(e(t.target).parents('.avia-menu'));s.css({padding:(l)+'px 0px'});v.removeClass('av-active-burger-items');i.addClass('is-active');a.addClass('av-burger-overlay-active');n.css({display:'block'}).animate({opacity:1},function(){r=!1});setTimeout(function(){a.addClass('av-burger-overlay-active-delayed')},100);v.each(function(i){var a=e(this);setTimeout(function(){a.addClass('av-active-burger-items')},(i+1)*125)})};t.preventDefault()})}})(jQuery);(function(t){'use strict';t.avia_utilities=t.avia_utilities||{};t(function(){if(t.fn.avia_parallax){t('.av-parallax,.av-parallax-object').avia_parallax()}});var i=function(i,e){if(!(this.transform||this.transform3d)){return};this.options=t.extend({},i);this.win=t(window);this.body=t('body');this.isMobile=t.avia_utilities.isMobile,this.winHeight=this.win.height();this.winWidth=this.win.width();this.el=t(e).addClass('active-parallax');this.objectType=this.el.hasClass('av-parallax-object')?'object':'background-image';this.elInner=this.el;this.elBackgroundParent=this.el.parent();this.elParallax=this.el.data('parallax')||{};this.direction='';this.speed=0.5;this.elProperty={};this.ticking=!1,this.isTransformed=!1;if(t.avia_utilities.supported.transition===undefined){t.avia_utilities.supported.transition=t.avia_utilities.supports('transition')};this._init(i)};i.prototype={mediaQueries:{'av-mini-':'(max-width: 479px)','av-small-':'(min-width: 480px) and (max-width: 767px)','av-medium-':'(min-width: 768px) and (max-width: 989px)','av-desktop-':'(min-width: 990px)'},transform:document.documentElement.className.indexOf('avia_transform')!==-1,transform3d:document.documentElement.className.indexOf('avia_transform3d')!==-1,mobileNoAnimation:t('body').hasClass('avia-mobile-no-animations'),defaultSpeed:0.5,defaultDirections:['bottom_top','left_right','right_left','no_parallax'],transformCSSProps:['transform','-webkit-transform','-moz-transform','-ms-transform','-o-transform'],matrixDef:[1,0,0,1,0,0],matrix3dDef:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_init:function(){var t=this;if(typeof this.el.data('parallax-selector')!='undefined'&&this.el.data('parallax-selector')!==''){this.elInner=this.el.find(this.el.data('parallax-selector'));if(this.elInner.length==0){this.elInner=this.el}};if('background-image'==this.objectType){if(this.isMobile&&this.mobileNoAnimation){return};this.elParallax.parallax='bottom_top';this.elParallax.parallax_speed=parseFloat(this.el.data('avia-parallax-ratio'))||0.5};setTimeout(function(){t._fetchProperties()},30);this.win.on('debouncedresize av-height-change',t._fetchProperties.bind(t));this.body.on('av_resize_finished',t._fetchProperties.bind(t));setTimeout(function(){t.win.on('scroll',t._onScroll.bind(t))},100)},_setParallaxProps:function(){if('background-image'==this.objectType){this.direction=this.elParallax.parallax;this.speed=this.elParallax.parallax_speed;return};var e=this.elParallax.parallax||'',s=this.elParallax.parallax_speed||'',i='',a='',r='all';if(this.defaultDirections.indexOf(e)<0){e='no_parallax'};if(typeof window.matchMedia=='function'){t.each(this.mediaQueries,function(t,i){var e=window.matchMedia(i);if(e.matches){r=t;return!1}})};if('all'==r){this.direction=e;this.speed=''==s?this.defaultSpeed:parseFloat(s)/100.0;return};i=this.elParallax[r+'parallax']||'';a=this.elParallax[r+'parallax_speed']||'';if('inherit'==i){i=e;a=s};if(this.defaultDirections.indexOf(i)<0){i='no_parallax'};this.direction=i;this.speed=''==a?this.defaultSpeed:parseFloat(a)/100.0},_getTranslateObject:function(e){var i={type:'',matrix:[],x:0,y:0,z:0};t.each(this.transformCSSProps,function(t,s){var r=e.css(s);if('string'!=typeof r||'none'==r){return};if(r.indexOf('matrix')>=0){var a=r.match(/matrix.*\((.+)\)/)[1].split(', ');if(r.indexOf('matrix3d')>=0){i.type='3d';i.matrix=a;i.x=a[12];i.y=a[13];i.z=a[14]}else{i.type='2d';i.matrix=a;i.x=a[4];i.y=a[5]};return!1}else{i.type='';var n=r.match(/translateX\((-?\d+\.?\d*px)\)/);if(n){i.x=parseInt(n[1],10)};var l=r.match(/translateY\((-?\d+\.?\d*px)\)/);if(l){i.y=parseInt(l[1],10)}}});return i},_getTranslateMatrix:function(i,r){var s='';t.each(r,function(t,e){i[t]=e});if(this.transform3d){var e=this.matrix3dDef.slice(0);switch(i.type){case'2d':e[0]=i.matrix[0];e[1]=i.matrix[1];e[4]=i.matrix[2];e[5]=i.matrix[3];e[12]=i.x;e[13]=i.y;break;case'3d':e=i.matrix.slice(0);e[12]=i.x;e[13]=i.y;e[14]=i.z;break;default:e[12]=i.x;e[13]=i.y;break};s='matrix3d('+e.join(', ')+')'}
else if(this.transform){var a=this.matrixDef.slice(0);switch(i.type){case'2d':a=i.matrix.slice(0);a[4]=i.x;a[5]=i.y;break;case'3d':a[0]=i.matrix[0];a[1]=i.matrix[1];a[2]=i.matrix[4];a[3]=i.matrix[5];a[4]=i.x;a[5]=i.y;break;default:a[4]=i.x;a[5]=i.y;break};s='matrix('+a.join(', ')+')'};return s},_fetchProperties:function(){this._setParallaxProps();this.el.css(t.avia_utilities.supported.transition+'transform','');this.winHeight=this.win.height();this.winWidth=this.win.width();if('background-image'==this.objectType){this.elProperty.top=this.elBackgroundParent.offset().top;this.elProperty.height=this.elBackgroundParent.outerHeight();this.el.height(Math.ceil((this.winHeight*Math.abs(this.speed))+this.elProperty.height))}else{this.elProperty.top=this.elInner.offset().top;this.elProperty.left=this.elInner.offset().left;this.elProperty.height=this.elInner.outerHeight();this.elProperty.width=this.elInner.outerWidth();this.elProperty.bottom=this.elProperty.top+this.elProperty.height;this.elProperty.right=this.elProperty.left+this.elProperty.width;this.elProperty.distanceLeft=this.elProperty.right;this.elProperty.distanceRight=this.winWidth-this.elProperty.left};this.elProperty.translateObj=this._getTranslateObject(this.el);this._parallaxScroll()},_onScroll:function(t){var i=this;if(!i.ticking){i.ticking=!0;window.requestAnimationFrame(i._parallaxRequest.bind(i))}},_inViewport:function(t,i,e,a,r,s,l,n){return!(t>s+10||e<r-10||a>n+10||i<l-10)},_parallaxRequest:function(t){var i=this;setTimeout(i._parallaxScroll.bind(i),0)},_parallaxScroll:function(i){if(('no_parallax'==this.direction||''==this.direction)&&!this.isTransformed){this.ticking=!1;return};var l=this.win.scrollTop(),o=this.win.scrollLeft(),d=o+this.winWidth,s=l+this.winHeight,e=0,a='';if('background-image'==this.objectType){if(this.elProperty.top<s&&l<=this.elProperty.top+this.elProperty.height){e=Math.ceil((s-this.elProperty.top)*this.speed);a=this._getTranslateMatrix(this.elProperty.translateObj,{y:e});this.el.css(t.avia_utilities.supported.transition+'transform',a)};this.ticking=!1;return};if(('no_parallax'==this.direction||''==this.direction)){a=this._getTranslateMatrix(this.elProperty.translateObj,{x:0,y:0});this.el.css(t.avia_utilities.supported.transition+'transform',a);this.ticking=!1;this.isTransformed=!1;return};var x=Math.ceil(this.elProperty.top-l),p=Math.ceil(s-this.elProperty.top),n=0,h=0,r={x:0,y:0};if(this.elProperty.top<this.winHeight){h=Math.ceil(this.winHeight-this.elProperty.top)};if(this.elProperty.top>s){n=0;p=0}else{n=1-(x+h)/this.winHeight};switch(this.direction){case'bottom_top':e=Math.ceil((p-h)*this.speed);r.y=-e;a=this._getTranslateMatrix(this.elProperty.translateObj,{y:-e});break;case'left_right':e=Math.ceil(this.elProperty.distanceRight*n*this.speed);r.x=e;a=this._getTranslateMatrix(this.elProperty.translateObj,{x:e});break;case'right_left':e=Math.ceil(this.elProperty.distanceLeft*n*this.speed);r.x=-e;a=this._getTranslateMatrix(this.elProperty.translateObj,{x:-e});break;default:break};var f=this._inViewport(this.elProperty.top,this.elProperty.right,this.elProperty.bottom,this.elProperty.left,l,s,o,d),c=this._inViewport(this.elProperty.top+r.y,this.elProperty.right+r.x,this.elProperty.bottom+r.y,this.elProperty.left+r.x,l,s,o,d);if(f||c){this.el.css(t.avia_utilities.supported.transition+'transform',a)};this.ticking=!1;this.isTransformed=!0}};t.fn.avia_parallax=function(e){return this.each(function(){var a=t(this),r=a.data('aviaParallax');if(!r){r=a.data('aviaParallax',new i(e,this))}})}})(jQuery);'use strict';var avia_js_shortcodes=avia_js_shortcodes||{};var aviaJS=aviaJS||{};(function(){if(!avia_js_shortcodes.aviaFoldUnfoldSection){class avFoldUnfoldSection{container=null;id='';settings={};button=[];foldContainer=[];folded=!1;preview=!1;innerDimension={};textblock=[];multiColumsTextblock=!1;gridRow=[];colorSection=[];column=[];constructor(container){this.container=container;this.container.avFoldUnfoldSection=this;this.id=container.getAttribute('id');this.init()};init(){this.settings=JSON.parse(this.container.dataset.fold_unfold);this.preview=document.getElementById('av-admin-preview')!=null;this.moveIntoFoldContainer();if(!this.button.length||!this.foldContainer.length||this.checkMissingInnerContainers()){return};if(this.isNested()){this.container.classList.remove('avia-fold-init');this.foldContainer[0].classList.remove('unfolded','folded');this.foldContainer[0].style['max-height']='unset';this.button[0].remove();return};this.foldContainer[0].style['max-height']=this.settings.height+'px';this.foldContainer[0].classList.add('folded');this.foldContainer[0].classList.remove('unfolded');this.folded=!0;this.container.classList.add('avia-fold-init-done');this.getMaxHeight();this.foldChanged();this.bindEvents();this.container.classList.remove('avia-fold-init')};moveIntoFoldContainer(){if(this.container.hasChildNodes()){let children=this.container.childNodes;for(const child of children){if(child.classList){if(child.classList.contains('av-fold-unfold-container')){this.foldContainer[0]=child};if(child.classList.contains('av-fold-button-wrapper')){const btn=child.getElementsByClassName('av-fold-button-container');if(btn.length){this.button[0]=btn[0]}}}}};let move=null;if(this.settings.context=='avia_sc_text'){let el=this.foldContainer[0].nextSibling;while(el){if(el.classList&&el.classList.contains('avia_textblock')){move=el;break};el=el.nextSibling}}
else if(this.settings.context=='avia_sc_columns'){let el=this.foldContainer[0].nextSibling;this.column=this.foldContainer[0].getElementsByClassName('av-fold-unfold-inner');if(this.column.length){while(el){if(el.classList&&el.classList.contains('av-fold-button-wrapper')){el=el.nextSibling}else{const next=el.nextSibling;this.column[0].append(el);el=next}}}}else{const el=this.container.nextSibling;if(el){move=el}};if(move){this.foldContainer[0].append(move)}};checkMissingInnerContainers(){let retVal=!1;switch(this.settings.context){case'avia_sc_text':this.textblock=this.container.getElementsByClassName('avia_textblock');if(this.textblock.length==0){retVal=!0}else{this.multiColumsTextblock=this.textblock[0].classList.contains('av_multi_colums')};break;case'avia_sc_grid_row':this.gridRow=this.container.getElementsByClassName('av-layout-grid-container');if(this.gridRow.length==0){retVal=!0};break;case'avia_sc_section':this.colorSection=this.container.getElementsByClassName('avia-section');if(this.colorSection.length==0){retVal=!0};break;case'avia_sc_columns':if(!this.column[0].childNodes.length){retVal=!0};break;default:retVal=!0};return retVal};isNested(){const parent=this.container.parentElement;if(null==parent){return!1};let closest=parent.closest('.avia-fold-unfold-section');if(closest==parent){closest=null};return closest!=null};bindEvents(){this.container.addEventListener('transitionend',this.onTransitionEnd.bind(this));this.container.addEventListener('webkitTransitionEnd',this.onTransitionEnd.bind(this));this.button[0].addEventListener('click',this.onClickFoldUnfold.bind(this));window.addEventListener('avia_fold_unfold_changed',this.onFoldUnfoldChanged.bind(this));window.addEventListener('resize',aviaJS.aviaJSHelpers.debounce(this.onResize.bind(this),200))};getMaxHeight(){switch(this.settings.context){case'avia_sc_text':this.innerDimension=this.textblock[0].getBoundingClientRect();break;case'avia_sc_grid_row':this.innerDimension=this.gridRow[0].getBoundingClientRect();break;case'avia_sc_section':this.innerDimension=this.colorSection[0].getBoundingClientRect();break;case'avia_sc_columns':this.innerDimension=this.column[0].getBoundingClientRect();break}};foldChanged(){let btnText='',btnLink='';if(this.folded){this.foldContainer[0].style['max-height']=this.settings.height+'px';btnText=this.settings.more;btnLink='#'}else{this.getMaxHeight();this.foldContainer[0].style['max-height']=Math.ceil(this.innerDimension.height)+200+'px';btnText=this.settings.less;btnLink+='#'+this.id};this.button[0].setAttribute('href',btnLink);this.button[0].textContent=btnText;this.triggerHeightChange()};onClickFoldUnfold(event){event.preventDefault();event.stopPropagation();if(this.foldContainer[0].classList.contains('folded')){this.foldContainer[0].classList.remove('folded');this.foldContainer[0].classList.add('unfolded');this.folded=!1}else{this.foldContainer[0].classList.remove('unfolded');this.foldContainer[0].classList.add('folded');this.folded=!0};this.foldChanged();let obj=this;setTimeout(function(){const opt={'bubbles':!0,'cancelable':!0,detail:{caller:obj}};const event=new CustomEvent('avia_fold_unfold_changed',opt);obj.container.dispatchEvent(event)},500)};onTransitionEnd(event){this.container.classList.remove('avia-fold-init-done');this.triggerHeightChange()};onResize(event){this.foldChanged()};onFoldUnfoldChanged(event){this.foldChanged()};triggerHeightChange(){const opt={'bubbles':!0,'cancelable':!0};const event=new CustomEvent('avia_height_change',opt);window.dispatchEvent(event)}};avia_js_shortcodes.aviaFoldUnfoldSection=function(t){return new avFoldUnfoldSection(t)};aviaJS.aviaPlugins.register(avia_js_shortcodes.aviaFoldUnfoldSection,'.avia-fold-unfold-section')}})();
!function(e){var t,i,n,o,a,r,s="Close",l="BeforeClose",c="MarkupParse",d="Open",p="Change",u="mfp",f="."+u,m="mfp-ready",g="mfp-removing",v="mfp-prevent-close",h=function(){},y=!!window.jQuery,C=e(window),b=function(e,i){t.ev.on(u+e+f,i)},w=function(t,i,n,o){var a=document.createElement("div");return a.className="mfp-"+t,n&&(a.innerHTML=n),o?i&&i.appendChild(a):(a=e(a),i&&a.appendTo(i)),a},I=function(e,i){t.ev.triggerHandler(u+e,i),t.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),t.st.callbacks[e]&&t.st.callbacks[e].apply(t,Array.isArray(i)?i:[i]))},x=function(i){return i===r&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),r=i),t.currTemplate.closeBtn},k=function(){e.magnificPopup.instance||((t=new h).init(),e.magnificPopup.instance=t)};h.prototype={constructor:h,init:function(){var i=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document),t.popupsCache={}},open:function(i){var o;if(!1===i.isObj){t.items=i.items.toArray(),t.index=0;var r,s=i.items;for(o=0;o<s.length;o++)if((r=s[o]).parsed&&(r=r.el[0]),r===i.el[0]){t.index=o;break}}else t.items=Array.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(!t.isOpen){t.types=[],a="",i.mainEl&&i.mainEl.length?t.ev=i.mainEl.eq(0):t.ev=n,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=w("bg").on("click"+f,(function(){t.close()})),t.wrap=w("wrap").attr("tabindex",-1).on("click"+f,(function(e){t._checkIfClose(e.target)&&t.close()})),t.container=w("container",t.wrap)),t.contentContainer=w("content"),t.st.preloader&&(t.preloader=w("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(o=0;o<l.length;o++){var p=l[o];p=p.charAt(0).toUpperCase()+p.slice(1),t["init"+p].call(t)}I("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(b(c,(function(e,t,i,n){i.close_replaceWith=x(n.type)})),a+=" mfp-close-btn-in"):t.wrap.append(x())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:C.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:n.height(),position:"absolute"}),t.st.enableEscapeKey&&n.on("keyup"+f,(function(e){27===e.keyCode&&t.close()})),C.on("resize"+f,(function(){t.updateSize()})),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=C.height(),g={};if(t.fixedContentPos&&t._hasScrollBar(u)){var v=t._getScrollbarSize();v&&(g.marginRight=v)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):g.overflow="hidden");var h=t.st.mainClass;return t.isIE7&&(h+=" mfp-ie7"),h&&t._addClassToMFP(h),t.updateItemHTML(),I("BuildControls"),e("html").css(g),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout((function(){t.content?(t._addClassToMFP(m),t._setFocus()):t.bgOverlay.addClass(m),n.on("focusin"+f,t._onFocusIn)}),16),t.isOpen=!0,t.updateSize(u),I(d),i}t.updateItemHTML()},close:function(){t.isOpen&&(I(l),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(g),setTimeout((function(){t._close()}),t.st.removalDelay)):t._close())},_close:function(){I(s);var i=g+" "+m+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var o={marginRight:""};t.isIE7?e("body, html").css("overflow",""):o.overflow="",e("html").css(o)}n.off("keyup.mfp focusin"+f),t.ev.off(f),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t.st.autoFocusLast&&t._lastFocusedEl&&e(t._lastFocusedEl).trigger("focus"),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,I("AfterClose")},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||C.height();t.fixedContentPos||t.wrap.css("height",t.wH),I("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(I("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var a=!!t.st[n]&&t.st[n].markup;I("FirstMarkupParse",a),t.currTemplate[n]=!a||e(a)}o&&o!==i.type&&t.container.removeClass("mfp-"+o+"-holder");var r=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(r,n),i.preloaded=!0,I(p,i),o=i.type,t.container.prepend(t.contentContainer),I("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[i]?t.content.find(".mfp-close").length||t.content.append(x()):t.content=e:t.content="",I("BeforeAppend"),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n,o=t.items[i];if(o.tagName?o={el:e(o)}:(n=o.type,o={data:o,src:o.src}),o.el){for(var a=t.types,r=0;r<a.length;r++)if(o.el.hasClass("mfp-"+a[r])){n=a[r];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=n||t.st.type||"inline",o.index=i,o.parsed=!0,t.items[i]=o,I("ElementParse",o),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var o="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(o).on(o,n)):(i.isObj=!1,i.delegate?e.off(o).on(o,i.delegate,n):(i.items=e,e.off(o).on(o,n)))},_openClick:function(i,n,o){if((void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick)||!(2===i.which||i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if("function"==typeof a){if(!a.call(t))return!0}else if(C.width()<a)return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),o.el=e(i.mfpEl),o.delegate&&(o.items=n.find(o.delegate)),t.open(o)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var o={status:e,text:n};I("UpdateStatus",o),e=o.status,n=o.text,t.preloader.html(n),t.preloader.find("a").on("click",(function(e){e.stopImmediatePropagation()})),t.container.addClass("mfp-s-"+e),i=e}},_checkIfClose:function(i){if(!e(i).hasClass(v)){var n=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(n&&o)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(o&&e.contains(document,i))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?n.height():document.body.scrollHeight)>(e||C.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).trigger("focus")},_onFocusIn:function(i){if(i.target!==t.wrap[0]&&!e.contains(t.wrap[0],i.target))return t._setFocus(),!1},_parseMarkup:function(t,i,n){var o;n.data&&(i=e.extend(n.data,i)),I(c,[t,i,n]),e.each(i,(function(i,n){if(void 0===n||!1===n)return!0;if((o=i.split("_")).length>1){var a=t.find(f+"-"+o[0]);if(a.length>0){var r=o[1];"replaceWith"===r?a[0]!==n[0]&&a.replaceWith(n):"img"===r?a.is("img")?a.attr("src",n):a.replaceWith(e("<img>").attr("src",n).attr("class",a.attr("class"))):a.attr(o[1],n)}}else t.find(f+"-"+i).html(n)}))},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:h.prototype,modules:[],open:function(t,i){return k(),(t=t?e.extend(!0,{},t):{}).isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},e.fn.magnificPopup=function(i){k();var n=e(this);if("string"==typeof i)if("open"===i){var o,a=y?n.data("magnificPopup"):n[0].magnificPopup,r=parseInt(arguments[1],10)||0;a.items?o=a.items[r]:(o=n,a.delegate&&(o=o.find(a.delegate)),o=o.eq(r)),t._openClick({mfpEl:o},n,a)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else i=e.extend(!0,{},i),y?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var T,_,z,P="inline",S=function(){z&&(_.after(z.addClass(T)).detach(),z=null)};e.magnificPopup.registerModule(P,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(P),b(s+"."+P,(function(){S()}))},getInline:function(i,n){if(S(),i.src){var o=t.st.inline,a=e(i.src);if(a.length){var r=a[0].parentNode;r&&r.tagName&&(_||(T=o.hiddenClass,_=w(T),T="mfp-"+T),z=a.after(_).detach().removeClass(T)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),a=e("<div>");return i.inlineElement=a,a}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var E,O="ajax",M=function(){E&&e(document.body).removeClass(E)},B=function(){M(),t.req&&t.req.abort()};e.magnificPopup.registerModule(O,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(O),E=t.st.ajax.cursor,b(s+"."+O,B),b("BeforeChange."+O,B)},getAjax:function(i){E&&e(document.body).addClass(E),t.updateStatus("loading");var n=e.extend({url:i.src,success:function(n,o,a){var r={data:n,xhr:a};I("ParseAjax",r),t.appendContent(e(r.data),O),i.finished=!0,M(),t._setFocus(),setTimeout((function(){t.wrap.addClass(m)}),16),t.updateStatus("ready"),I("AjaxContentAdded")},error:function(){M(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(n),""}}});var A,L=function(e){if(e.data&&void 0!==e.data.title)return e.data.title;var i=t.st.image.titleSrc;if(i){if("function"==typeof i)return i.call(t,e);if(e.el)return e.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var i=t.st.image,n=".image";t.types.push("image"),b(d+n,(function(){"image"===t.currItem.type&&i.cursor&&e(document.body).addClass(i.cursor)})),b(s+n,(function(){i.cursor&&e(document.body).removeClass(i.cursor),C.off("resize"+f)})),b("Resize"+n,t.resizeImage),t.isLowIE&&b("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,A&&clearInterval(A),e.isCheckingImgSize=!1,I("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],o=function(a){A&&clearInterval(A),A=setInterval((function(){n.naturalWidth>0?t._onImageHasSize(e):(i>200&&clearInterval(A),3===++i?o(10):40===i?o(50):100===i&&o(500))}),a)};o(1)},getImage:function(i,n){var o=0,a=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,I("ImageLoadComplete")):++o<200?setTimeout(a,100):r())},r=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=document.createElement("img");if(c.className="mfp-img",i.el&&i.el.find("img").length&&(c.alt=i.el.find("img").attr("alt")),i.img=e(c).on("load.mfploader",a).on("error.mfploader",r),c.src=i.src,e("body").hasClass("responsive-images-lightbox-support")){var d=i.el.data("srcset"),p=i.el.data("sizes");void 0!==d?(c.srcset=d,void 0!==p&&(c.sizes=p)):(void 0!==(d=i.el.find("img").attr("srcset"))&&(c.srcset=d),void 0!==(p=i.el.find("img").attr("sizes"))&&(c.sizes=p))}l.is("img")&&(i.img=i.img.clone()),(c=i.img[0]).naturalWidth>0?i.hasSize=!0:c.width||(i.hasSize=!1)}return t._parseMarkup(n,{title:L(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(A&&clearInterval(A),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var H;e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,i=t.st.zoom,n=".zoom";if(i.enabled&&t.supportsTransition){var o,a,r=i.duration,c=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),n="all "+i.duration/1e3+"s "+i.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},a="transition";return o["-webkit-"+a]=o["-moz-"+a]=o["-o-"+a]=o[a]=n,t.css(o),t},d=function(){t.content.css("visibility","visible")};b("BuildControls"+n,(function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void d();(a=c(e)).css(t._getOffset()),t.wrap.append(a),o=setTimeout((function(){a.css(t._getOffset(!0)),o=setTimeout((function(){d(),setTimeout((function(){a.remove(),e=a=null,I("ZoomAnimationEnded")}),16)}),r)}),16)}})),b(l+n,(function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=r,!e){if(!(e=t._getItemToZoom()))return;a=c(e)}a.css(t._getOffset(!0)),t.wrap.append(a),t.content.css("visibility","hidden"),setTimeout((function(){a.css(t._getOffset())}),16)}})),b(s+n,(function(){t._allowZoom()&&(d(),a&&a.remove(),e=null)}))}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(i){var n,o=(n=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem)).offset(),a=parseInt(n.css("padding-top"),10),r=parseInt(n.css("padding-bottom"),10);o.top-=e(window).scrollTop()-a;var s={width:n.width(),height:(y?n.innerHeight():n[0].offsetHeight)-r-a};return void 0===H&&(H=void 0!==document.createElement("p").style.MozTransform),H?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var F="iframe",j=function(e){if(t.currTemplate[F]){var i=t.currTemplate[F].find("iframe");i.length&&(e||(i[0].src="//about:blank"),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(F,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen allow="autoplay; encrypted-media" ></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(F),b("BeforeChange",(function(e,t,i){t!==i&&(t===F?j():i===F&&j(!0))})),b(s+"."+F,(function(){j()}))},getIframe:function(i,n){var o=i.src,a=t.st.iframe;e.each(a.patterns,(function(){if(o.indexOf(this.index)>-1)return this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1}));var r={};return a.srcAction&&(r[a.srcAction]=o),t._parseMarkup(n,r,i),t.updateStatus("ready"),n}}});var N=function(e){var i=t.items.length;return e>i-1?e-i:e<0?i+e:e},W=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,o=".mfp-gallery";if(t.direction=!0,!i||!i.enabled)return!1;a+=" mfp-gallery",b(d+o,(function(){i.navigateByImgClick&&t.wrap.on("click"+o,".mfp-img",(function(){if(t.items.length>1)return t.next(),!1})),n.on("keydown"+o,(function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()}))})),b("UpdateStatus"+o,(function(e,i){i.text&&(i.text=W(i.text,t.currItem.index,t.items.length))})),b(c+o,(function(e,n,o,a){var r=t.items.length;o.counter=r>1?W(i.tCounter,a.index,r):""})),b("BuildControls"+o,(function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(v),a=t.arrowRight=e(n.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(v);o.on("click",(function(){t.prev()})),a.on("click",(function(){t.next()})),t.container.append(o.add(a))}})),b(p+o,(function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout((function(){t.preloadNearbyImages(),t._preloadTimeout=null}),16)})),b(s+o,(function(){n.off(o),t.wrap.off("click"+o),t.arrowRight=t.arrowLeft=null}))},next:function(){t.direction=!0,t.index=N(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=N(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;e<=(t.direction?o:n);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?n:o);e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=N(i),!t.items[i].preloaded){var n=t.items[i];if(n.parsed||(n=t.parseEl(i)),I("LazyLoad",n),"image"===n.type&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",(function(){n.hasSize=!0})).on("error.mfploader",(function(){n.hasSize=!0,n.loadError=!0,I("LazyLoadError",n)})).attr("src",n.src),e("body").hasClass("responsive-images-lightbox-support")&&n.el.length>0)){var o=e(n.el[0]),a=o.data("srcset"),r=o.data("sizes");if(void 0!==a)n.img.attr("srcset",a),void 0!==r&&n.img.attr("sizes",r);else{var s=e(n.el[0]).find("img");void 0!==(a=s.attr("srcset"))&&n.img.attr("srcset",a),void 0!==(r=s.attr("sizes"))&&n.img.attr("sizes",r)}}n.preloaded=!0}}}});var R="retina";e.magnificPopup.registerModule(R,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,(function(e){return"@2x"+e}))},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;(i=isNaN(i)?i():i)>1&&(b("ImageHasSize."+R,(function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})})),b("ElementParse."+R,(function(t,n){n.src=e.replaceSrc(n,i)})))}}}}),k()}(jQuery);(function(e){'use strict';e.avia_utilities=e.avia_utilities||{};e.avia_utilities.av_popup={type:'image',mainClass:'avia-popup mfp-zoom-in',tLoading:'',tClose:'',removalDelay:300,closeBtnInside:!0,closeOnContentClick:!1,midClick:!0,autoFocusLast:!1,fixedContentPos:e('html').hasClass('av-default-lightbox-no-scroll'),iframe:{patterns:{youtube:{index:'youtube.com/watch',id:function(e){let m=e.match(/[\\?\\&]v=([^\\?\\&]+)/),id,params;if(!m||!m[1]){return null};id=m[1];params=e.split('/watch');params=params[1];return id+params},src:'//www.youtube.com/embed/%id%'},youtube_shorts:{index:'youtube.com/shorts',id:function(e){let m=e.match(/(?:youtube\.com\/shorts\/)([a-zA-Z0-9_-]*)/),id,params;if(!m||!m[1]){return null};id=m[1];params=e.split('/shorts');params=params[1];return id+params},src:'//www.youtube.com/embed/%id%'},vimeo:{index:'vimeo.com/',id:function(e){let m=e.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})\/(\w{6,11})[?]?.*/),params,vid;m=m?m:e.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/);if(!m||!m[5]){return null};vid=m[5];params=e.split('?');params=params[1]?'?'+params[1]:'';if(m[6]){vid=vid+(params?params+'&h=':'?h=')+m[6]}else{vid=vid+params};return vid},src:'//player.vimeo.com/video/%id%'}}},image:{titleSrc:function(t){var a=t.el.attr('title');if(!a){a=t.el.find('img').attr('title')};if(!a){a=t.el.parent().next('.wp-caption-text').html()};if(typeof a!='undefined'){return a};if(!e('body').hasClass('avia-mfp-show-alt-text')){return''};var i=t.el.attr('alt');if(typeof i!='undefined'){return i};i=t.el.find('img').attr('alt');if(typeof i!='undefined'){return i};return''}},gallery:{tPrev:'',tNext:'',tCounter:'%curr% / %total%',enabled:!0,preload:[1,1]},callbacks:{beforeOpen:function(){if(this.st.el&&this.st.el.data('fixed-content')){this.fixedContentPos=!0};let elementCustomClass='';if(this.st.el&&this.st.el.data('custom_class')){elementCustomClass=this.st.el.data('custom_class').trim()}
else if(this.st.el){let element=e(this.st.el),href=element.attr('href');if((href.indexOf('youtube.com')>=0)&&(href.indexOf('/shorts/')>=0)){elementCustomClass='avia-mfp-is-video avia-mfp-video-9-16'}};if(elementCustomClass){this.st.mainClass+=' '+elementCustomClass}},open:function(){e.magnificPopup.instance.next=function(){var t=this;t.wrap.removeClass('mfp-image-loaded');setTimeout(function(){e.magnificPopup.proto.next.call(t)},120)};e.magnificPopup.instance.prev=function(){var t=this;t.wrap.removeClass('mfp-image-loaded');setTimeout(function(){e.magnificPopup.proto.prev.call(t)},120)};if(this.st.el&&this.st.el.data('av-extra-class')){this.wrap.addClass(this.currItem.el.data('av-extra-class'))};this.wrap.avia_swipe_trigger({prev:'.mfp-arrow-left',next:'.mfp-arrow-right'})},markupParse:function(t,a,r){if(typeof a.img_replaceWith=='undefined'||typeof a.img_replaceWith.length=='undefined'||a.img_replaceWith.length==0){return};var o=e(a.img_replaceWith[0]);if(typeof o.attr('alt')!='undefined'){return};var i=r.el.attr('alt');if(typeof i=='undefined'){i=r.el.find('img').attr('alt')};if(typeof i!='undefined'){o.attr('alt',i)};return},imageLoadComplete:function(){var e=this;setTimeout(function(){e.wrap.addClass('mfp-image-loaded')},16)},change:function(){if(this.currItem.el){var e=this.currItem.el;this.content.find('.av-extra-modal-content, .av-extra-modal-markup').remove();if(e.data('av-extra-content')){var a=e.data('av-extra-content');this.content.append('<div class=\'av-extra-modal-content\'>'+a+'</div>')};if(e.data('av-extra-markup')){var t=e.data('av-extra-markup');this.wrap.append('<div class=\'av-extra-modal-markup\'>'+t+'</div>')}}}}};e.fn.avia_activate_lightbox=function(t){var i={groups:['.avia-slideshow','.avia-gallery','.av-horizontal-gallery','.av-instagram-pics','.portfolio-preview-image','.portfolio-preview-content','.isotope','.post-entry','.sidebar','#main','.main_menu','.woocommerce-product-gallery'],autolinkElements:'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=webp], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="youtube.com/shorts"] , a[href*="screenr.com"], a[href*="iframe=true"]',videoElements:'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="youtube.com/shorts"] , a[href*="screenr.com"], a[href*="iframe=true"]',exclude:'.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"], .pagination a'},a=e.extend({},i,t),r=!e('html').is('.av-custom-lightbox');if(!r){return this};return this.each(function(){var i=e(this),o=e(a.videoElements,this).not(a.exclude).addClass('mfp-iframe'),r=!i.is('body')&&!i.is('.ajax_slide');for(var t=0;t<a.groups.length;t++){i.find(a.groups[t]).each(function(){var t=e(a.autolinkElements,this);if(r){t.removeClass('lightbox-added')};t.not(a.exclude).addClass('lightbox-added').magnificPopup(e.avia_utilities.av_popup)})}})}})(jQuery);(function(i){'use strict';i(function(){if(i.fn.aviaMegamenu){i('.main_menu .menu').aviaMegamenu({modify_position:!0})}});i.fn.aviaMegamenu=function(n){var e={modify_position:!0,delay:300};var t=i.extend(e,n);return this.each(function(){var f=i('html').first(),g=i('#main .container').first(),l=f.filter('.html_menu_left, .html_logo_center').length,r=i.avia_utilities.isMobile,o=i(this),s=o.find('>li:not(.ignore_menu)'),n=s.find('>div').parent().css({overflow:'hidden'}),d=o.find('>.current-menu-item>a, >.current_page_item>a'),h=s.find('>ul').parent(),p=o.parent(),m=o.parents('.main_menu').eq(0),v=p.width(),e={},a=[];if(!d.length){o.find('.current-menu-ancestor, .current_page_ancestor').eq(0).find('a').eq(0).parent().addClass('active-parent-item')};if(!f.is('.html_header_top')){t.modify_position=!1};s.on('click','a',function(i){if(this.href==window.location.href+'#'||this.href==window.location.href+'/#'){i.preventDefault()}});s.each(function(){var n=i(this),a=n.position(),o=n.find('div').first().css({opacity:0,display:'none'}),s='';if(!o.length){s=n.find('>ul').css({display:'none'})};if(o.length||s.length){var e=n.addClass('dropdown_ul_available').find('>a');e.append('<span class="dropdown_available"></span>');if(typeof e.attr('href')!='string'||e.attr('href')=='#'){e.css('cursor','default').on('click',function(i){i.preventDefault()})}};if(t.modify_position&&o.length){n.on('mouseenter focusin',function(){y(n,a,o,v)})}});function y(i,t,n,e){t=i.position();if(!l){if(t.left+n.width()<e){n.css({right:-n.outerWidth()+i.outerWidth()})}
else if(t.left+n.width()>e){n.css({right:-m.outerWidth()+(t.left+i.outerWidth())})}}else{if(n.width()>t.left+i.outerWidth()){n.css({left:(t.left*-1)})}
else if(t.left+n.width()>e){n.css({left:(n.width()-t.left)*-1})}}};function c(i){if(e[i]==!0){var t=n.eq(i).css({overflow:'visible'}).find('div').first(),o=n.eq(i).find('a').first();a['check'+i]=!0;t.stop().css('display','block').animate({opacity:1},300);if(t.length){o.addClass('open-mega-a')}}};function u(t){if(e[t]==!1){n.eq(t).find('>a').removeClass('open-mega-a');var o=n.eq(t),s=o.find('div').first();s.stop().css('display','block').animate({opacity:0},300,function(){i(this).css('display','none');o.css({overflow:'hidden'});a['check'+t]=!1})}};if(r){n.each(function(n){i(this).on('click',function(){if(a['check'+n]!=!0){return!1}})})};n.each(function(n){i(this).on('mouseenter',function(){e[n]=!0;setTimeout(function(){c(n)},t.delay)}).on('mouseleave',function(){e[n]=!1;setTimeout(function(){u(n)},t.delay)});i(this).find('a').on('focus',function(){e[n]=!0;setTimeout(function(){c(n)},50)}).on('blur',function(){e[n]=!1;setTimeout(function(){u(n)},50)})});h.find('li').addBack().each(function(){var t=i(this),n=t.find('ul').first(),o=!1;if(n.length){n.css({display:'block',opacity:0,visibility:'hidden'});var e=t.find('>a');e.on('mouseenter',function(){n.stop().css({visibility:'visible'}).animate({opacity:1})});e.on('focus',function(){n.stop().css({visibility:'visible'}).animate({opacity:1});n.find('li').on('focusin',function(){n.stop().css({visibility:'visible'}).animate({opacity:1})}).on('focusout',function(){n.stop().animate({opacity:0},function(){n.css({visibility:'hidden'})})})}).on('focusout',function(){i(this).trigger('mouseleave')});t.on('mouseleave',function(){n.stop().animate({opacity:0},function(){n.css({visibility:'hidden'})})})}})})}})(jQuery);(function(e){'use strict';e(function(){i()});function a(e,i,a){if(e[0].classList){if(i=='add'){e[0].classList.add(a)}else{e[0].classList.remove(a)}}else{if(i=='add'){e.addClass(a)}else{e.removeClass(a)}}};function i(){var h=e(window),i=e('.html_header_top.html_header_sticky #header'),r=e('.av_header_unstick_top');if(!i.length&&!r.length){return};var u=e('#header_main .container .logo img, #header_main .container .logo svg, #header_main .container .logo a'),o=e('#header_main .container:not(#header_main_alternate>.container), #header_main .main_menu ul:first-child > li > a:not(.avia_mega_div a, #header_main_alternate a), #header_main #menu-item-shop .cart_dropdown_link'),t=e(o).first().height(),v=e.avia_utilities.isMobile,H=e('#scroll-top-link'),f=i.is('.av_header_transparency'),s=i.is('.av_header_shrinking'),c=i.data('av_shrink_factor'),l=t/2.0,g=t/2.0,p=i.find('#header_meta'),n=p.length?p.outerHeight():0,m=i.find('#header_main_alternate'),y=m.length?m.outerHeight():0,d=function(){var d=h.scrollTop(),c=0,p=d;if(r){d-=n};if(d<0){d=0};if(s&&!v){if(d<l){c=t-d;if(d<=0){c=t};a(i,'remove','header-scrolled')}else{c=g;a(i,'add','header-scrolled')};if(d-30<t){a(i,'remove','header-scrolled-full')}else{a(i,'add','header-scrolled-full')};o.css({'height':c+'px','lineHeight':c+'px'});u.css({'maxHeight':c+'px'});let propHeight=c+y;if(i.length){if(!r.length){propHeight+=n}else{if(d<=n){propHeight=propHeight+n-p}}};e(':root')[0].style.setProperty('--enfold-header-height',Math.round(propHeight)+'px')};if(r.length){if(d<=0){if(p<=0){p=0};r.css({'margin-top':'-'+p+'px'})}else{r.css({'margin-top':'-'+n+'px'})}};if(f){if(d>50){a(i,'remove','av_header_transparency')}else{a(i,'add','av_header_transparency')}}};if(typeof c!='undefined'){const value=parseInt(c);if(!isNaN(value)){l=t*(value/100.0);g=t-l}};if(e('body').is('.avia_deactivate_menu_resize')){s=!1};if(!f&&!s&&!r.length){return};h.on('debouncedresize',function(){t=e(o).attr('style','').first().height();d()});h.on('scroll',function(){window.requestAnimationFrame(d)});d()}})(jQuery);(function(n){'use strict';var r=null,a=null,t=null,i=null,e=null;n(function(){r=n(window);a=n('body');if(a.hasClass('av-curtain-footer')){o();return};return});function o(){i=a.find('.av-curtain-footer-container');if(i.length==0){a.removeClass('av-curtain-footer av-curtain-activated av-curtain-numeric av-curtain-screen');return};t=n('<div id="av-curtain-footer-placeholder"></div>');i.before(t);if(a.hasClass('av-curtain-numeric')){e=i.data('footer_max_height');if('undefined'==typeof e){e=70}else{e=parseInt(e,10);if(isNaN(e)){e=70}}};u();r.on('debouncedresize',u)};function u(){var n=Math.floor(i.outerHeight()),o=r.innerHeight();if(null==e){t.css({height:n+'px'})}else{var u=Math.floor(o*(e/100.0));if(n>u){a.removeClass('av-curtain-activated');t.css({height:''})}else{a.addClass('av-curtain-activated');t.css({height:n+'px'})}}}})(jQuery);(function(t){'use strict';t(function(){t('.avia_auto_toc').each(function(){var s=t(this).attr('id'),n='h1',c=[],a='',r=t(this).find('.avia-toc-container');if(r.length){var i=r.attr('data-level'),o=r.attr('data-exclude');if(typeof i!='undefined'){n=i};if(typeof o!='undefined'){a=o.trim()}};c=n.split(',');t('.entry-content-wrapper').find(n).each(function(){var n=t(this);if(n.hasClass('av-no-toc')){return};if(a!=''&&(n.hasClass(a)||n.parent().hasClass(a))){return};var i=n.attr('id'),l=n.prop('tagName').toLowerCase(),s=n.text(),h=c.indexOf(l);if(typeof i=='undefined'){var o=e(s);n.attr('id',o);i=o};var f='<a href="#'+i+'" class="avia-toc-link avia-toc-level-'+h+'"><span>'+s+'</span></a>';r.append(f)});t('.avia-toc-smoothscroll .avia-toc-link').on('click',function(e){e.preventDefault();var n=t(this).attr('href'),a=50,r=t('.html_header_top.html_header_sticky #header');if(r.length){a=r.outerHeight()+50};t('html,body').animate({scrollTop:t(n).offset().top-a})})})});function e(t){return t.replace(/[ÄÖÜäöüß]/g,function(t){return{'Ä':'Ae','Ö':'Oe','Ü':'Ue','ä':'ae','ö':'oe','ü':'ue','ß':'ss'}[t]}).toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+$/g,'-').replace(/^-+|-+$/g,'')}})(jQuery);'use strict';(function(a){var i=null,s=function(){if('undefined'==typeof window.av_google_map||'undefined'==typeof avia_framework_globals){return};if(i!=null){return};i=this;this.document=a(document);this.script_loading=!1;this.script_loaded=!1;this.script_source=avia_framework_globals.gmap_avia_api;this.maps={};this.loading_icon_html='<div class="ajax_load"><span class="ajax_load_inner"></span></div>';this.LoadAviaMapsAPIScript()};s.prototype={LoadAviaMapsAPIScript:function(){this.maps=a('body').find('.avia-google-map-container');if(this.maps.length==0){return};var o=!1;this.maps.each(function(i){var s=a(this);if(s.hasClass('av_gmaps_show_unconditionally')||s.hasClass('av_gmaps_show_delayed')){o=!0;return!1}});if(!o){return};var e=a('html').hasClass('av-cookies-needs-opt-in')||a('html').hasClass('av-cookies-can-opt-out'),i=!0,t=a('html').hasClass('av-cookies-user-silent-accept');if(e&&!t){if(!document.cookie.match(/aviaCookieConsent/)||a('html').hasClass('av-cookies-session-refused')){i=!1}else{if(!document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){i=!1}
else if(!document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){i=!1}
else if(document.cookie.match(/aviaPrivacyGoogleMapsDisabled/)){i=!1}}};if(window['wp']&&wp.hooks){i=wp.hooks.applyFilters('aviaCookieConsent_allow_continue',i)};if(!i){a('.av_gmaps_main_wrap').addClass('av-maps-user-disabled');return};if(typeof a.AviaMapsAPI!='undefined'){this.AviaMapsScriptLoaded();return};a('body').on('avia-google-maps-api-script-loaded',this.AviaMapsScriptLoaded.bind(this));this.script_loading=!0;var s=document.createElement('script');s.id='avia-gmaps-api-script';s.type='text/javascript';s.src=this.script_source;document.body.appendChild(s)},AviaMapsScriptLoaded:function(){this.script_loading=!1;this.script_loaded=!0;var i=this;this.maps.each(function(o){var s=a(this);if(s.hasClass('av_gmaps_show_page_only')){return};var e=s.data('mapid');if('undefined'==typeof window.av_google_map[e]){console.log('Map cannot be displayed because no info: '+e);return};if(s.hasClass('av_gmaps_show_unconditionally')){s.aviaMaps()}
else if(s.hasClass('av_gmaps_show_delayed')){var t=s.closest('.av_gmaps_main_wrap'),n=t.find('a.av_text_confirm_link');n.on('click',i.AviaMapsLoadConfirmed)}else{console.log('Map cannot be displayed because missing display class: '+e)}})},AviaMapsLoadConfirmed:function(i){i.preventDefault();var s=a(this),o=s.closest('.av_gmaps_main_wrap').find('.avia-google-map-container');o.aviaMaps()}};a(function(){new s()})})(jQuery);(function(a){'use strict';a('form.avia_ajax_form.avia-mailchimp-form').find('.avia-disabled-form').remove();if(a('#avia-google-recaptcha-api-script').length>0){return};if('undefined'==typeof AviaReCAPTCHA_front||'undefined'==typeof AviaReCAPTCHA_front.avia_api_script){return};if(!a('body').hasClass('av-recaptcha-enabled')){return};var c=a('html').hasClass('av-cookies-needs-opt-in')||a('html').hasClass('av-cookies-can-opt-out'),e=!0,n=a('html').hasClass('av-cookies-user-silent-accept');if(c&&!n){if(!document.cookie.match(/aviaCookieConsent/)||a('html').hasClass('av-cookies-session-refused')){e=!1}else{if(!document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){e=!1}
else if(!document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){e=!1}
else if(document.cookie.match(/aviaPrivacyGoogleReCaptchaDisabled/)){e=!1}}};if(!e){var s=a('form.avia_ajax_form').not('.avia-mailchimp-form'),o=s.find('.avia-disabled-form').closest('form.avia_ajax_form');o.addClass('av-form-user-disabled');o.find('input.button').remove();return};var t=AviaReCAPTCHA_front.version,r=a('div.av-recaptcha-area');if(r.length==0&&t!='avia_recaptcha_v3'){return};var i=document.createElement('script');i.id='avia-google-recaptcha-api-script';i.type='text/javascript';i.src=AviaReCAPTCHA_front.avia_api_script;document.body.appendChild(i)})(jQuery);