/*! * copyright 2016 google inc. all rights reserved. * licensed under the w3c software and document notice and license. * https://www.w3.org/consortium/legal/2015/copyright-software-and-document */ !function(){'use strict';if('object'==typeof window)if('intersectionobserver'in window&&'intersectionobserverentry'in window&&'intersectionratio'in window.intersectionobserverentry.prototype)'isintersecting'in window.intersectionobserverentry.prototype||object.defineproperty(window.intersectionobserverentry.prototype,'isintersecting',{get:function(){return this.intersectionratio>0}});else{var t=function(t){for(var e=window.document,n=i(e);n;)n=i(e=n.ownerdocument);return e}(),e=[],n=null,o=null;s.prototype.throttle_timeout=100,s.prototype.poll_interval=null,s.prototype.use_mutation_observer=!0,s._setupcrossoriginupdater=function(){return n||(n=function(t,n){o=t&&n?l(t,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.foreach(function(t){t._checkforintersections()})}),n},s._resetcrossoriginupdater=function(){n=null,o=null},s.prototype.observe=function(t){if(!this._observationtargets.some(function(e){return e.element==t})){if(!t||1!=t.nodetype)throw new error('target must be an element');this._registerinstance(),this._observationtargets.push({element:t,entry:null}),this._monitorintersections(t.ownerdocument),this._checkforintersections()}},s.prototype.unobserve=function(t){this._observationtargets=this._observationtargets.filter(function(e){return e.element!=t}),this._unmonitorintersections(t.ownerdocument),0==this._observationtargets.length&&this._unregisterinstance()},s.prototype.disconnect=function(){this._observationtargets=[],this._unmonitorallintersections(),this._unregisterinstance()},s.prototype.takerecords=function(){var t=this._queuedentries.slice();return this._queuedentries=[],t},s.prototype._initthresholds=function(t){var e=t||[0];return array.isarray(e)||(e=[e]),e.sort().filter(function(t,e,n){if('number'!=typeof t||isnan(t)||t<0||t>1)throw new error('threshold must be a number between 0 and 1 inclusively');return t!==n[e-1]})},s.prototype._parserootmargin=function(t){var e=(t||'0px').split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new error('rootmargin must be specified in pixels or percent');return{value:parsefloat(e[1]),unit:e[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},s.prototype._monitorintersections=function(e){var n=e.defaultview;if(n&&-1==this._monitoringdocuments.indexof(e)){var o=this._checkforintersections,r=null,s=null;if(this.poll_interval?r=n.setinterval(o,this.poll_interval):(h(n,'resize',o,!0),h(e,'scroll',o,!0),this.use_mutation_observer&&'mutationobserver'in n&&(s=new n.mutationobserver(o)).observe(e,{attributes:!0,childlist:!0,characterdata:!0,subtree:!0})),this._monitoringdocuments.push(e),this._monitoringunsubscribes.push(function(){var t=e.defaultview;t&&(r&&t.clearinterval(r),c(t,'resize',o,!0)),c(e,'scroll',o,!0),s&&s.disconnect()}),e!=(this.root&&this.root.ownerdocument||t)){var u=i(e);u&&this._monitorintersections(u.ownerdocument)}}},s.prototype._unmonitorintersections=function(e){var n=this._monitoringdocuments.indexof(e);if(-1!=n){var o=this.root&&this.root.ownerdocument||t;if(!this._observationtargets.some(function(t){var n=t.element.ownerdocument;if(n==e)return!0;for(;n&&n!=o;){var r=i(n);if((n=r&&r.ownerdocument)==e)return!0}return!1})){var r=this._monitoringunsubscribes[n];if(this._monitoringdocuments.splice(n,1),this._monitoringunsubscribes.splice(n,1),r(),e!=o){var s=i(e);s&&this._unmonitorintersections(s.ownerdocument)}}}},s.prototype._unmonitorallintersections=function(){var t=this._monitoringunsubscribes.slice(0);this._monitoringdocuments.length=0,this._monitoringunsubscribes.length=0;for(var e=0;e=0&&m>=0&&{top:c,bottom:a,left:f,right:d,width:g,height:m}||null),!v)break;_=_&&p(_)}return v}},s.prototype._getrootrect=function(){var e;if(this.root)e=u(this.root);else{var n=t.documentelement,o=t.body;e={top:0,left:0,right:n.clientwidth||o.clientwidth,width:n.clientwidth||o.clientwidth,bottom:n.clientheight||o.clientheight,height:n.clientheight||o.clientheight}}return this._expandrectbyrootmargin(e)},s.prototype._expandrectbyrootmargin=function(t){var e=this._rootmarginvalues.map(function(e,n){return'px'==e.unit?e.value:e.value*(n%2?t.width:t.height)/100}),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},s.prototype._hascrossedthreshold=function(t,e){var n=t&&t.isintersecting?t.intersectionratio||0:-1,o=e.isintersecting?e.intersectionratio||0:-1;if(n!==o)for(var i=0;i