distraction.party/priv/static/packs/common.js

3 lines
1.1 MiB
JavaScript
Raw Normal View History

2020-05-20 05:55:14 +00:00
/*! For license information please see common.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{1048:function(e,t,a){"use strict";a.d(t,"a",(function(){return B}));var i,r=a(0),n=a(2),o=(a(9),a(6),a(8)),s=a(1),u=a(54),l=a.n(u),g=a(3),c=a.n(g),_=a(472),f=a(5),d=a.n(f),h=a(15),m=a(772);var p=function(e){if("boolean"!=typeof i){var t=e.target.getBoundingClientRect(),a=e.boundingClientRect;i=t.height!==a.height||t.top!==a.top||t.width!==a.width||t.bottom!==a.bottom||t.left!==a.left||t.right!==a.right}return i?e.target.getBoundingClientRect():e.boundingClientRect};var F=["id","index","listLength","cachedHeight"],b=function(e){Object(o.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return t=e.call.apply(e,[this].concat(i))||this,Object(s.a)(Object(n.a)(t),"state",{isHidden:!1}),Object(s.a)(Object(n.a)(t),"handleIntersection",(function(e){t.entry=e,Object(m.a)(t.calculateHeight),t.setState(t.updateStateAfterIntersection)})),Object(s.a)(Object(n.a)(t),"updateStateAfterIntersection",(function(e){return!1===e.isIntersecting||t.entry.isIntersecting||Object(m.a)(t.hideIfNotIntersecting),{isIntersecting:t.entry.isIntersecting,isHidden:!1}})),Object(s.a)(Object(n.a)(t),"calculateHeight",(function(){var e=t.props,a=e.onHeightChange,i=e.saveHeightKey,r=e.id;t.height=p(t.entry).height,a&&i&&a(i,r,t.height)})),Object(s.a)(Object(n.a)(t),"hideIfNotIntersecting",(function(){t.componentMounted&&t.setState((function(e){return{isHidden:!e.isIntersecting}}))})),Object(s.a)(Object(n.a)(t),"handleRef",(function(e){t.node=e})),t}var i=a.prototype;return i.shouldComponentUpdate=function(e,t){var a=this,i=!this.state.isIntersecting&&(this.state.isHidden||this.props.cachedHeight);return!!i!=!!(!t.isIntersecting&&(t.isHidden||e.cachedHeight))||(!i||!F.every((function(t){return e[t]===a.props[t]})))},i.componentDidMount=function(){var e=this.props,t=e.intersectionObserverWrapper,a=e.id;t.observe(a,this.node,this.handleIntersection),this.componentMounted=!0},i.componentWillUnmount=function(){var e=this.props,t=e.intersectionObserverWrapper,a=e.id;t.unobserve(a,this.node),this.componentMounted=!1},i.render=function(){var e=this.props,t=e.children,a=e.id,i=e.index,r=e.listLength,n=e.cachedHeight,o=this.state,s=o.isIntersecting,u=o.isHidden,l={};return s||!u&&!n||(l.height=(this.height||n||150)+"px",l.opacity=0,l.overflow="hidden"),c.a.createElement("article",{ref:this.handleRef,"aria-posinset":i+1,"aria-setsize":r,"data-id":a,tabIndex:"0",style:l},t&&c.a.cloneElement(t,{hidden:!s&&(u||!!n)}))},a}(c.a.Component),v=a(303),y=Object(h.connect)((function(e,t){return{cachedHeight:e.getIn(["height_cache",t.saveHeightKey,t.id])}}),(function(e){return{onHeightChange:function(t,a,i){e(Object(v.d)(t,a,i))}}}))(b),k=a(1078),j=a(7);var w=function(e){Object(o.a)(a,e);var t;t=a;function a(){return e.apply(this,arguments)||this}return a.prototype.render=function(){var e=this.props.count;return(Object(r.a)("button",{className:"load-more load-gap",onClick:this.props.onClick},void 0,Object(r.a)(j.b,{id:"load_pending",defaultMessage:"{count, plural, one {# new item} other {# new items}}",values:{count:e}})))},a}(c.a.PureComponent),O=function(){function e(){Object(s.a)(this,"callbacks",{}),Object(s.a)(this,"observerBacklog",[]),Object(s.a)(this,"observer",null)}var t=e.prototype;return t.connect=function(e){var t=this;this.observer=new IntersectionObserver((function(e){e.forEach((function(e){var a=e.target.getAttribute("data-id");t.callbacks[a]&&t.callbacks[a](e)}))}),e),this.observerBacklog.forEach((function(e){var a=e[0],i=e[1],r=e[2];t.observe(a,i,r)})),this.observerBacklog=null},t.observe=function(e,t,a){this.observer?(this.callbacks[e]=a,this.observer.observe(t)):this.observerBacklog.push([e,t,a])},t.unobserve=function(e,t){this.observer&&(delete this.callbacks[e],this.observer.unobserve(t))},t.disconnect=function(){this.observer&&(this.callbacks={},this.observer.disconnect(),this.observer=null)},e}(),D=a(4),E=a(14),C=a.n(E),x=a(260),M=a(305);var S=300,B=function(e){Object(o.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,i=new Array(a),r=
//# sourceMappingURL=common.js.map