mediacms/static/js/members.js

1 wiersz
12 KiB
JavaScript

!function(){"use strict";var t={4675:function(t,e,n){var r=n(2667),o=(n(5101),n(2322),n(3296),n(3233),n(5466)),i=n(3074),c=n.n(i),u=n(1346),l=n(8204),s=(n(4426),n(9174)),a=n(5261);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(l,t);var e,n,r,i,c=(r=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=h(r);if(i){var n=h(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return m(this,t)});function l(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),e=c.call(this,t,"members");var n,r=(n={},window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(t,e,r){n[e]=r})),n),o=void 0!==r.location?r.location.trim():null;return e.state={title:t.title,api_url:u.Z._currentValue.users},null!==o&&""!==o&&(e.state.title="International"===o?o+" members":"Members from "+o,e.state.api_url=e.state.api_url+"?location="+o),e}return e=l,(n=[{key:"pageContent",value:function(){return o.createElement(s._,{title:this.state.title,className:"items-list-ver"},o.createElement(a.J,{requestUrl:this.state.api_url}))}}])&&p(e.prototype,n),l}(l.T);b.propTypes={title:c().string.isRequired},b.defaultProps={title:"Members"},(0,r.X)("page-members",b)},5261:function(t,e,n){n.d(e,{J:function(){return g}}),n(5101),n(5466),n(6116);var r=n(4426),o=n(8421);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=n(5953);function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){h(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=w(e);if(n){var o=w(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return d(this,t)});function o(){return b(this,o),r.apply(this,arguments)}return o}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(y,t);var e,n,i,f,p=(i=y,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(i);if(f){var n=a(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return l(this,t)});function y(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y),(e=p.call(this,t)).onWindowScroll=e.onWindowScroll.bind(s(e)),e.onDocumentVisibilityChange=e.onDocumentVisibilityChange.bind(s(e)),e}return e=y,(n=[{key:"componentDidMount",value:function(){this.listHandler=new o.g(this.props.pageItems,this.props.maxItems,this.props.firstItemRequestUrl,this.props.requestUrl,this.onItemsCount,this.onItemsLoad),r.Z.on("window_scroll",this.onWindowScroll),r.Z.on("document_visibility_change",this.onDocumentVisibilityChange)}},{key:"componentWillUnmount",value:function(){this.listHandler.cancelAll(),this.listHandler=null,r.Z.removeListener("window_scroll",this.onWindowScroll),r.Z.removeListener("document_visibility_change",this.onDocumentVisibilityChange)}},{key:"onWindowScroll",value:function(){void 0!==this.refs.ItemsList&&window.scrollY+2*window.outerHeight>=this.refs.ItemsList.offsetTop+this.refs.ItemsList.offsetHeight&&this.listHandler.loadItems()}},{key:"onDocumentVisibilityChange",value:function(){document.hidden||setTimeout(this.onWindowScroll,10)}},{key:"afterItemsLoad",value:function(){this.onWindowScroll(),this.listHandler.loadedAllItems()&&r.Z.removeListener("window_scroll",this.onWindowScroll)}}])&&c(e.prototype,n),y}(f.g));g.defaultProps=m(m({},f.g.defaultProps),{},{pageItems:2})},1346:function(t,e,n){var r=n(5466),o=n(4547),i=r.createContext((0,o.v)(window.MediaCMS).api);i.Consumer,e.Z=i},2880:function(t,e,n){var r=n(5466),o=n(4547),i=r.createContext((0,o.v)(window.MediaCMS).member);i.Consumer,e.Z=i},9009:function(t,e,n){n(6394),n(5334),n(7588),n(4559),n(6028)},6203:function(t,e,n){n(2322),n(9268),n(3233),e.Z=function(){var t,e,n,r=null;if(document.cookie&&""!==document.cookie)for(e=document.cookie.split(";"),t=0;t<e.length;){if("csrftoken="===(n=e[t].trim()).substring(0,10)){r=decodeURIComponent(n.substring(10));break}t+=1}return r}},1712:function(t,e,n){n(6394),n(5334),n(7588);var r=n(4559);function o(t,e,n,r,o,i,c){try{var u=t[i](c),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var c=t.apply(e,n);function u(t){o(c,r,i,u,l,"next",t)}function l(t){o(c,r,i,u,l,"throw",t)}u(void 0)}))}}function c(){return(c=i(regeneratorRuntime.mark((function t(e,n,o,i){var c,u,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=function(t){if(i instanceof Function){var e=t;if(void 0===t.response)e={type:"network",error:t};else if(void 0!==t.response.status)switch(t.response.status){case 401:e={type:"private",error:t,message:"Media is private"};break;case 400:e={type:"unavailable",error:t,message:"Media is unavailable"}}i(e)}},u=function(t){o instanceof Function&&o(t)},c={timeout:null,maxContentLength:null},!n){t.next=8;break}return t.next=6,(0,r.get)(e,c).then(u).catch(l||null);case 6:t.next=9;break;case 8:(0,r.get)(e,c).then(u).catch(l||null);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}n(6028),e.Z=function(t,e,n,r){return c.apply(this,arguments)}},8420:function(t,e,n){n.d(e,{A_:function(){return r.Z},GH:function(){return o.Z},v$:function(){return i.Z},uf:function(){return c.Z},$4:function(){return u.Z},m5:function(){return l.Z}});var r=n(1712),o=(n(9752),n(84)),i=(n(9009),n(1438)),c=n(4135),u=n(3140),l=(n(1752),n(7514),n(1569),n(6203));n(7188)},9752:function(t,e,n){n(6394),n(5334),n(7588),n(4559),n(6028)},2701:function(t,e,n){n.d(e,{s:function(){return c}});var r=n(5466),o=n(3074),i=n.n(o);function c(t){return r.createElement("div",{className:(void 0===t.className||null===t.className?"":t.className+" ")+"media-list-header",style:t.style},r.createElement("h2",null,t.title),void 0===t.viewAllLink||null===t.viewAllLink?null:r.createElement("h3",null,r.createElement("a",{href:t.viewAllLink,title:t.viewAllText||t.viewAllLink},t.viewAllText||t.viewAllLink)))}c.propTypes={style:i().object,className:i().string,title:i().string.isRequired,viewAllLink:i().string,viewAllText:i().string},c.defaultProps={viewAllText:"VIEW ALL"}},3085:function(t,e,n){n.d(e,{G:function(){return u}});var r=n(5466),o=n(3074),i=n.n(o),c=n(2701);function u(t){return r.createElement("div",{className:(void 0===t.className||null===t.className?"":t.className+" ")+"media-list-row",style:t.style},void 0===t.title||null===t.title?null:r.createElement(c.s,{title:t.title,viewAllLink:t.viewAllLink,viewAllText:t.viewAllText}),t.children||null)}u.propTypes={style:i().object,className:i().string,title:i().string,viewAllLink:i().string,viewAllText:i().string}},9174:function(t,e,n){n.d(e,{_:function(){return u}});var r=n(5466),o=n(3074),i=n.n(o),c=n(3085);function u(t){return r.createElement("div",{className:(void 0===t.className||null===t.className?"":t.className+" ")+"media-list-wrapper",style:t.style},r.createElement(c.G,{title:t.title,viewAllLink:t.viewAllLink,viewAllText:t.viewAllText},t.children||null))}u.propTypes={style:i().object,className:i().string}}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.m=t,n.x=function(){},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.j=21,function(){var t={21:0},e=[[4675,431]],r=function(){},o=function(o,i){for(var c,u,l=i[0],s=i[1],a=i[2],f=i[3],p=0,y=[];p<l.length;p++)u=l[p],n.o(t,u)&&t[u]&&y.push(t[u][0]),t[u]=0;for(c in s)n.o(s,c)&&(n.m[c]=s[c]);for(a&&a(n),o&&o(i);y.length;)y.shift()();return f&&e.push.apply(e,f),r()},i=self.webpackChunk_mediacms_frontend=self.webpackChunk_mediacms_frontend||[];function c(){for(var r,o=0;o<e.length;o++){for(var i=e[o],c=!0,u=1;u<i.length;u++){var l=i[u];0!==t[l]&&(c=!1)}c&&(e.splice(o--,1),r=n(n.s=i[0]))}return 0===e.length&&(n.x(),n.x=function(){}),r}i.forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var u=n.x;n.x=function(){return n.x=u||function(){},(r=c)()}}(),n.x()}();