"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("lodash"),t=require("./usePermissions.js"),n=require("../components/LoadingIndicator/LoadingIndicator.js"),o=require("react/jsx-runtime");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=i(e);function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?c(Object(t),!0).forEach((function(r){u.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var a=o.jsx(n,{});exports.withPermissionsHOC=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(i){return function(u){var c=n.loader,f=void 0===c?a:c,p=n.skipLoading,d=void 0!==p&&p,O=Object.keys(e),b=t(O.map((function(r){var t=e[r];return"function"==typeof t?t(u):t})));if(!d&&r.some(b,"loading"))return f;var j=O.reduce((function(e,r,t){return e[r]=b[t].active,e}),{});return o.jsx(i,s(s({},u),j))}}};
//# sourceMappingURL=withPermissionsHOC.js.map
