mediacms/static/js/manage-users.js

1 line
17 KiB
JavaScript
Raw Permalink Normal View History

!function(){"use strict";var e,t={37839:function(e,t,n){var r=n(92541),o=(n(67441),n(25101),n(13080),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(35466)),i=n(3074),a=n.n(i),l=n(43613),u=n(20541),s=n(84234),c=n(25910),f=(n(20288),n(54458),n(23675),n(98578));function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m={role:[{id:"all",title:"All"},{id:"editor",title:"Editor"},{id:"manager",title:"Manager"}]};function g(e){var t=d((0,o.useState)(e.hidden),2),n=t[0],r=t[1],i=d((0,o.useState)("all"),2),a=i[0],l=i[1],u=(0,o.useRef)(null),c=(0,o.useRef)(null);function p(){n||(u.current.style.height=24+c.current.offsetHeight+"px")}return(0,o.useEffect)((function(){r(e.hidden),p()}),[e.hidden]),(0,o.useEffect)((function(){return f.PageStore.on("window_resize",p),function(){return f.PageStore.removeListener("window_resize",p)}}),[]),o.createElement("div",{ref:u,className:"mi-filters-row"+(n?" hidden":"")},o.createElement("div",{ref:c,className:"mi-filters-row-inner"},o.createElement("div",{className:"mi-filter"},o.createElement("div",{className:"mi-filter-title"},"ROLE"),o.createElement("div",{className:"mi-filter-options"},o.createElement(s.FilterOptions,{id:"role",options:m.role,selected:a,onSelect:function(t){var n={role:a};switch(t.currentTarget.getAttribute("filter")){case"role":n.role=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(n),l(n.role)}}})))))}g.propTypes={hidden:a().bool},g.defaultProps={hidden:!1};var v=n(9700);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?k(e):t}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t,n,r){return e+"?"+t+(""===t?"":"&")+n+(""===n?"":"&")+"page="+r}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(f,e);var t,n,r,i,a=(r=f,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(r);if(i){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return C(this,e)});function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=a.call(this,e,"manage-users")).st