[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\n    \"env\",\n    \"react\",\n    \"stage-1\"\n  ],\n  \"plugins\": [\n    \"transform-decorators-legacy\"\n  ],\n  \"env\": {\n    \"production\": {\n      \"plugins\": [\n        \"transform-react-constant-elements\",\n        \"transform-react-remove-prop-types\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": ".circleci/config.yml",
    "content": "version: 2.1\nexecutors:\n  node-executor:\n    docker:\n      - image: circleci/node:14.4.0\n    working_directory: ~/app\n\njobs:\n  check_branch_name:\n    docker:\n      - image: circleci/node:14.4.0\n    working_directory: ~/app\n    steps:\n      - run:\n          name: fail if the branch name does not start with a valid prefix\n          command: |\n            branch=$CIRCLE_BRANCH\n            if [[ \"$branch\" =~ ^(dependabot|fix|feature|breaking)/ || \"$branch\" == 'master' ]]\n            then\n              echo $branch is a valid name\n            else\n              echo $branch is not valid because the branch name must match '^(dependabot|fix|feature|breaking)/' or be master\n              exit 1\n            fi\n  build:\n    working_directory: ~/app\n    docker:\n      - image: circleci/node:14.4.0\n    steps:\n      - checkout\n      - restore_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n      - run:\n          name: Install npm dependencies\n          command: npm install --production=false\n      - save_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n          paths:\n            - node_modules\n  test:\n    executor: node-executor\n    steps:\n      - checkout\n      - restore_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n      - run:\n          name: Install npm dependencies\n          command: npm install --production=false\n      - save_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n          paths:\n            - node_modules\n      - run:\n          name: Test\n          command: npm run test:coverage:ci\n      - persist_to_workspace:\n          root: ~/app\n          paths:\n            - .git\n            - node_modules\n            - coverage\n  lint:\n    docker:\n      - image: circleci/node:14.4.0\n    steps:\n      - checkout\n      - restore_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n      - run:\n          name: Install npm dependencies\n          command: npm install --production=false\n      - save_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n          paths:\n            - node_modules\n      - run:\n          name: Lint\n          command: npm run lint\n  compile:\n    docker:\n      - image: circleci/node:14.4.0\n    steps:\n      - checkout\n      - restore_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n      - run:\n          name: Install npm dependencies\n          command: npm install --production=false\n      - save_cache:\n          key: dependency-cache-{{ checksum \"package.json\" }}\n          paths:\n            - node_modules\n      - run:\n          name: Compile\n          command: npm run build\n  publish_package:\n    executor: node-executor\n    steps:\n      - attach_workspace:\n          at: ~/app\n      - run: git checkout .\n      - run:\n          name: Generate coveralls config\n          command: \"echo repo_token: $REPO_TOKEN > ./.coveralls.yml\"\n      - run:\n          name: Upload coverage to coveralls\n          command: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\n      - run:\n          name: configure GitHub user\n          command: |\n            git config --global user.email \"devops@brainhub.pl\"\n            git config --global user.name \"DevOps Brainhub\"\n            git remote -v\n            git remote remove origin\n            git remote add origin https://$GIT_TOKEN@github.com/brainhubeu/react-permissible\n            git remote -v\n      - run:\n          name: bump NPM version\n          command: |\n            branch=`git log --oneline | grep '[0-9a-f]\\{6,40\\} Merge pull request #[0-9]\\+ from brainhubeu/' | head -1 | sed 's@.* from brainhubeu/@@g' || true`\n            echo branch=$branch\n            if [[ \"$branch\" =~ ^(dependabot)/ ]]; then\n              npm version patch -m \"%s [ci skip]\"\n            elif [[ \"$branch\" =~ ^(fix)/ ]]; then\n              npm version patch -m \"%s [ci skip]\"\n            elif [[ \"$branch\" =~ ^(feature)/ ]]; then\n              npm version minor -m \"%s [ci skip]\"\n            elif [[ \"$branch\" =~ ^(breaking)/ ]]; then\n              npm version major -m \"%s [ci skip]\"\n            else\n              echo $branch is not valid because the branch name must match '^(dependabot|fix|feature|breaking)/'\n              exit 1\n            fi\n      - run: git pull --no-edit origin $CIRCLE_BRANCH\n      - run: git push origin $CIRCLE_BRANCH\n      - run:\n          name: npm publish\n          command: |\n            echo \"//registry.npmjs.org/:_authToken=${NPM_TOKEN}\" > .npmrc\n            npm publish\nworkflows:\n  version: 2\n  build_and_test:\n    jobs:\n      - check_branch_name\n      - build:\n          requires:\n            - check_branch_name\n      - test:\n          requires:\n            - build\n      - lint:\n          requires:\n            - build\n      - compile:\n          requires:\n            - build\n      - publish_package:\n          requires:\n            - test\n            - lint\n            - compile\n          filters:\n            branches:\n              only:\n                - master\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".eslintignore",
    "content": "/lib/**/*.js\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"root\": true,\n  \"extends\": [\n    \"brainhub\"\n  ],\n  \"settings\": {\n    \"import/resolve\": {\n      \"moduleDirectory\": [\"node_modules\", \"src\"]\n    }\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "dist\n\n# Logs\nlogs\n*.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\nreports\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directory\n# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git\nnode_modules\n\n# IDEA/Webstorm project files\n.idea\n*.iml\n\n#VSCode metadata\n.vscode\n\n# Mac files\n.DS_Store\n\n# Debug files\nselenium-debug.log\n.npm.debug\n\n# Merge conflicts\n*.orig\n"
  },
  {
    "path": ".npmignore",
    "content": ".babelrc\n.circleci/\n.coveralls.yml\n.dockerignore\n.editorconfig\n.eslintignore\n.eslintrc\n.git/\n.github/\n.gitignore\n.istanbul.yml\n.npmignore\n.npmrc\n.nvmrc\nDockerfile.e2e\ncoverage/\ncypress.json\ndocker-compose.e2e.yml\ndocs-www/\ndocs/\njest.config.js\njest.setup.js\nrenovate.json\ntest/\ntools/\ntypes/\nwebpack.config.prod.js\n"
  },
  {
    "path": ".npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2017-2020 [Brainhub](https://brainhub.eu/?utm_source=github)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "<br/>\n<h1 align=\"center\">\n  react-permissible\n</h1>\n\n<p align=\"center\">\n  Making the permission management for React components easier.\n</p>\n\n<p align=\"center\">\n  <strong>\n    <a href=\"https://brainhubeu.github.io/react-permissible/\">Live code demo</a> | \n    <a href=\"https://brainhub.eu/contact/\">Hire us</a>\n  </strong>\n</p>\n\n<div align=\"center\">\n\n  [![CircleCI](https://circleci.com/gh/brainhubeu/react-permissible.svg?style=svg)](https://circleci.com/gh/brainhubeu/react-permissible)\n  [![Last commit](https://img.shields.io/github/last-commit/brainhubeu/react-permissible.svg)](https://github.com/brainhubeu/react-permissible/commits/master)\n  [![license](https://img.shields.io/npm/l/@brainhubeu/react-permissible.svg)](https://github.com/brainhubeu/react-permissible/blob/master/LICENSE.md)\n  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n  [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)\n\n  [![Coveralls github](https://img.shields.io/coveralls/github/brainhubeu/react-permissible.svg)](https://coveralls.io/github/brainhubeu/react-permissible?branch=master)\n  [![Downloads](https://img.shields.io/npm/dm/@brainhubeu/react-permissible?color=blue)](https://www.npmjs.com/package/@brainhubeu/react-permissible)\n  [![Minified](https://img.shields.io/bundlephobia/min/@brainhubeu/react-permissible?label=minified)](https://www.npmjs.com/package/@brainhubeu/react-permissible)\n  [![npm](https://img.shields.io/npm/v/@brainhubeu/react-permissible.svg)](https://www.npmjs.com/package/@brainhubeu/react-permissible)\n  [![Contributors](https://img.shields.io/github/contributors/brainhubeu/react-permissible?color=blue)](https://github.com/brainhubeu/react-permissible/graphs/contributors)\n</div>\n\n\n`react-permissible` is a React Component allowing to:\n* manage visibility of particular components depending on users permissions\n* replace particular component when the user isn't permitted to see it\n* manage accessability to particular view depending on users permissions\n* fire a callback when the user isn't allowed to go to access the component/route\n\n## Why?\nCurrently there's no permission management in React. The existing components are either over-engineered (full ACL support etc.), or limited to role-based management. `react-permissible` is simple at its core and solves only one problem. Access the Component if the permissions match, do something otherwise.\n\n## Live demo/ docs\nYou can access live demo/ docs at https://brainhubeu.github.io/react-permissible/.\n\n## Installation\n```\nnpm i @brainhubeu/react-permissible\n```\n\n## Usage\n```javascript\nimport { PermissibleRender } from '@brainhubeu/react-permissible';\n\n...\n\nrender() {\n  return (\n    <PermissibleRender\n      userPermissions={permissions}\n      requiredPermissions={requiredPermissions}\n    >\n      <RestrictedComponent/>\n    </PermissibleRender>\n  );\n}\n```\n\nWhere:\n* `userPermissions` is an **array** of permissions set for current user\n* `requiredPermissions` is an **array** of required permissions\n\nMore detailed documentation with several use cases covered is available [here](http://brainhubeu.github.io/react-permissible).\n\n## Running tests\n```\nnpm test\n```\n\n## Roadmap\n* Passing a callback function as a prop for `PermissibleRender` component\n\n## License\n\nReact-permissible is copyright © 2017-2020 [Brainhub](https://brainhub.eu/?utm_source=github) It is free software, and may be redistributed under the terms specified in the [license](LICENSE.md).\n\n## About\n\n`react-permissible` is maintained by [@kkoscielniak](https://github.com/kkoscielniak), [@adam-golab](https://github.com/adam-golab), [@Lukasz-pluszczewski](https://github.com/Lukasz-pluszczewski/) and the Brainhub development team. It is funded by Brainhub and the names and logos for Brainhub are trademarks of Brainhub Sp. z o.o.. You can check other open-source projects supported/developed by our teammates [here](https://brainhub.eu/?utm_source=github). \n\n[![Brainhub](https://brainhub.eu/brainhub.svg)](https://brainhub.eu/?utm_source=github)\n\nWe love open-source JavaScript software! See our other projects or hire us to build your next web, desktop and mobile application with JavaScript.\n"
  },
  {
    "path": "docs/examples/callback.md",
    "content": "# Callback function\n\nCallback function passed to a `Permissible` Higher Order Component will be called whenever the permissions do not match. This might be combined with the `oneperm` parameter. **Open the Console** to see a callback message. \n\n```javascript\nimport { Permissible } from '@brainhubeu/react-permissible';\n\nconst callbackFunction = ({ userPermissions, requiredPermissions }) => {\n  console.log(`\n    react-permissible: Access Denied\n    userPermissions: ${userPermissions}\n    requiredPermissions: ${requiredPermissions}\n  `);\n};\n\nconst CallbackComponent = Permissible(\n  AccessGranted,\n  ['ACCESS_DASHBOARD'], // userPermissions\n  ['ACCESS_ADMIN'], // requiredPermissions\n  callbackFunction,\n);\n```\n\n```jsx render\n<CallbackComponent />\n```\n"
  },
  {
    "path": "docs/examples/oneMatch.md",
    "content": "# Render a component when one of the permissions matches\n\nIf at least one permission from the `userPermissions` array exists in the `requiredPermissions` array, the component is rendered.\n\n```jsx render\n<PermissibleRender\n  userPermissions={['ACCESS_ADMIN']}\n  requiredPermissions={['ACCESS_DASHBOARD', 'ACCESS_ADMIN']}\n  oneperm\n>\n  <AccessGranted/>\n</PermissibleRender>\n```\n"
  },
  {
    "path": "docs/examples/permissionsMatch.md",
    "content": "# Render a component when all the permissions match\n\nIf all the permissions in the `userPermissions` array match the `requiredPermissions`, the component is rendered.\n\n```jsx render\n<PermissibleRender\n  userPermissions={['ACCESS_DASHBOARD', 'ACCESS_ADMIN']}\n  requiredPermissions={['ACCESS_DASHBOARD', 'ACCESS_ADMIN']}\n>\n  <AccessGranted/>\n</PermissibleRender>\n```\n"
  },
  {
    "path": "docs/examples/renderOtherwise.md",
    "content": "# Render another component if the permissions do not match\n\nIf permissions in the `userPermissions` do not match the `requiredPermissions`, the component is not rendered, and another one is rendered instead. \n\n```jsx render\n<PermissibleRender\n  userPermissions={['ACCESS_DASHBOARD']}\n  requiredPermissions={['ACCESS_ADMIN']}\n  renderOtherwise={<AccessDenied/>}\n>\n  <AccessGranted/>\n</PermissibleRender>\n```\n"
  },
  {
    "path": "docs/getting-started/installation.md",
    "content": "# Installation\n\n**react-permissible** is designed as an npm package. Installation is as simple as with every package out there:  \n\n`npm i @brainhubeu/react-permissible`\n\nor if you use Yarn:\n\n`yarn add @brainhubeu/react-permissible`.\n"
  },
  {
    "path": "docs/getting-started/overview.md",
    "content": "# react-permissible\n\n#### Making the permission management for components easier.\n\n**react-permissible** is a React Component allowing you to:\n* manage visibility of particular components depending on user's permissions.\n* replacing a particular component when the user isn't permitted to see it.\n* manage access to particular view depending on user's permissions.\n* firing a callback when the user isn't allowed to access the component/route.\n\n## Why\nCurrently there's a lack of simple permission management components for React. The existing components are either over-engineered (full ACL support etc.), or limited to role-based management. **react-permissible** is simple at it's core and solves only one problem - accessing the particular component if the necessary permissions are met, hide or render another component otherwise.\n"
  },
  {
    "path": "docs/usage/basic.md",
    "content": "# Usage\n\nYou can use react-permissible in two ways: as an ordinary component or as a Higher Order Component. Each approach allows you to solve the permission-based rendering a little bit differently.\n\n## Use as an ordinary component with props:\n```javascript\nimport { PermissibleRender } from '@brainhubeu/react-permissible';\n\n...\n\nrender() {\n  return (\n    <PermissibleRender\n      userPermissions={permissions}\n      requiredPermissions={requiredPermissions}\n      renderOtherwise={AnotherComponent} // optional\n      oneperm // optional\n    >\n      <RestrictedComponent/>\n    </PermissibleRender>\n  );\n}\n```\n\nWhere:\n\n* `userPermissions`: array of permissions set for current user\n* `requiredPermissions`: array of required permissions  \n* `RestrictedComponent`: component to render  \n\nThere are also optional props available:\n\n* `oneperm`: boolean determining that only one of required permissions will be necessary (boolean)\n* `renderOtherwise`: another component to be rendered if the permissions do not match (the user isn't permitted).\n"
  },
  {
    "path": "docs/usage/hoc.md",
    "content": "# Usage\n\nYou can use react-permissible in two ways: as an ordinary component or as a Higher Order Component. Each approach allows you to solve the permission-based rendering a little bit differently.\n\n\n## Usage as a Higher Order Component:\n```javascript\nimport { Permissible } from '@brainhubeu/react-permissible';\n\n...\n\nfunction callbackFunction({ userPermissions, requiredPermissions }) {\n  // do something\n}\n\nconst RestrictedComponent = (\n  <p>Restricted component</p>\n);\n\nconst PermissibleComponent = Permissible(\n  RestrictedComponent,\n  userPermissions,\n  requiredPermissions,\n  callbackFunction,\n  oneperm,\n);\n\nrender() {\n  <PermissibleComponent />\n}\n```\n\nWhere:\n\n* `RestrictedComponent`: a component to render\n* `userPermissions`: an array of permissions set for current user\n* `requiredPermissions`: an array of required permissions\n* `oneperm`: boolean determining that only one of required permissions will be necessary instead of requiring all passed permissions (optional)\n"
  },
  {
    "path": "docs-www/.gitignore",
    "content": "# Logs\nlogs\n*.log*\n\n# node-waf configuration\n.lock-wscript\n\n# Dependency directory\nnode_modules\n\n# IDEA/Webstorm project files\n.idea\n*.iml\n\n#VSCode metadata\n.vscode\n\n# Mac files\n.DS_Store\n\n# Gatsby\n.cache\npublic\n"
  },
  {
    "path": "docs-www/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2017-2020 Brainhub\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "docs-www/README.md",
    "content": "# Gatsby Docs Kit Starter\nThe default Brainhub static docs starter.\n\n## Try it out\n\nEnsure you have the latest version of [Node](https://nodejs.org/en/download/) installed. We also recommend you install [Yarn](https://yarnpkg.com/en/docs/install) as well.\nThen run:\n\n```bash\nyarn install\n```\n\nSeed documentation (if you don't have any yet): \n\n```bash\nyarn seed\n```\n\nRun the local webserver via `yarn develop`;\n\nThe example site is available at http://localhost:8000. You should see the example site loaded in your web browser.\nAlso visit http://localhost:8000/___graphql to explore your site's GraphiQL data and schema.\n\nThen go to `../docs` to edit and write awesome docs!.\n\n## Deploy\n\nReady to go? Want to deploy documentation to github pages? Run:\n\n```bash\nyarn deploy:gh\n```"
  },
  {
    "path": "docs-www/gatsby-config.js",
    "content": "'use strict';\n\nconst path = require('path');\nconst pluginConfigFactory = require('@brainhubeu/gatsby-docs-kit/plugins');\n\nmodule.exports = {\n  siteMetadata: {\n    title: 'react-permissible Docs',\n    description: 'Making the permission management for React components easier',\n    image: 'https://cdn-images-1.medium.com/max/1200/1*CLUFZFaXF6NG27NA3d_JkQ.jpeg',\n    url: 'https://brainhubeu.github.io/react-permissible',\n    type: 'article',\n    siteName: 'react-permissible Docs',\n    githubUrl: 'https://github.com/brainhubeu',\n  },\n\n  // URL prefix on production environment. For more info see https://www.gatsbyjs.org/docs/path-prefix/\n  pathPrefix: process.env.PATH_PREFIX || ' ',\n\n  plugins: [\n    ...pluginConfigFactory({\n      config: `${__dirname}/gatsby-docs-kit.yml`,\n      resources: path.resolve(__dirname, '../docs'),\n    }),\n    {\n      resolve: `gatsby-plugin-google-analytics`,\n      options: {\n        trackingId: 'UA-62818184-6',\n        head: false,\n        anonymize: true,\n        respectDNT: true,\n        pageTransitionDelay: 0,\n        cookieDomain: 'brainhubeu.github.io',\n      },\n  ],\n};\n"
  },
  {
    "path": "docs-www/gatsby-docs-kit.yml",
    "content": "- title: Home\n  dir: ./src\n  url: /\n  file: pages/landing.js\n\n- title: Docs\n  dir: ../docs\n  url: docs\n  sidemenu:\n    - title: Getting Started\n      dir: getting-started\n      items:\n        - title: Overview\n          file: overview.md\n        - title: Installation\n          file: installation.md\n    - title: Usage\n      dir: usage\n      items:\n        - title: As an ordinary component\n          file: basic.md\n        - title: As Higher Order Component\n          file: hoc.md\n    - title: Examples\n      dir: examples\n      items:\n        - title: Render component when all the permissions match\n          file: permissionsMatch.md\n        - title: Render component when one of the permissions match\n          file: oneMatch.md\n        - title: Render another component if the permissions do not match\n          file: renderOtherwise.md\n        - title: Callback function\n          file: callback.md\n"
  },
  {
    "path": "docs-www/package.json",
    "content": "{\n  \"name\": \"@brainhubeu/gatsby-docs-kit-start\",\n  \"description\": \"Gatsby-Docs-Kit starter repository\",\n  \"version\": \"0.0.32\",\n  \"author\": \"Brainhub\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"build\": \"rm -rf .cache && rm -rf public && gatsby build --prefix-paths\",\n    \"deploy:gh\": \"bash tools/deploy-github.sh\",\n    \"develop\": \"rm -rf .cache && gatsby develop\",\n    \"seed\": \"bash tools/seed.sh\",\n    \"serve\": \"gatsby serve\",\n    \"lint\": \"eslint --ext .jsx,.js .\",\n    \"lint:autofix\": \"eslint --ext .jsx,.js . --fix\"\n  },\n  \"dependencies\": {\n    \"@brainhubeu/gatsby-docs-kit\": \"1.0.10\",\n    \"@brainhubeu/react-permissible\": \"^1.9.13\",\n    \"gatsby\": \"1.9.279\"\n  },\n  \"devDependencies\": {\n    \"eslint\": \"^7.3.1\",\n    \"eslint-config-brainhub\": \"^1.13.0\",\n    \"gh-pages\": \"^3.1.0\",\n    \"react\": \"^16.13.1\",\n    \"react-dom\": \"^16.13.1\"\n  }\n}\n"
  },
  {
    "path": "docs-www/src/globalReferences.js",
    "content": "import React from 'react';\nimport { Permissible, PermissibleRender } from '@brainhubeu/react-permissible';\n\nconst boxStyle = {\n  height: 130,\n  width: 130,\n  display: 'flex',\n  margin: '0 auto',\n  textAlign: 'center',\n  backgroundColor: '#b5ffb5',\n  justifyContent: 'center',\n  flexDirection: 'column',\n};\n\nconst notAllowedBoxStyle = {\n  ...boxStyle,\n  backgroundColor: '#ffb5b5',\n};\n\nconst AccessGranted = () => (\n  <div style={boxStyle}>\n    Access Granted\n  </div>\n);\n\nconst AccessDenied = () => (\n  <div style={notAllowedBoxStyle}>\n    Access Denied\n  </div>\n);\n\nconst callbackFunction = ({ userPermissions, requiredPermissions }) => {\n  console.log(`\nreact-permissible: Access Denied;\nuserPermissions: ${userPermissions}\nrequiredPermissions: ${requiredPermissions}\n  `);\n};\n\nconst CallbackComponent = Permissible(\n  AccessGranted,\n  ['ACCESS_DASHBOARD'], // userPermissions\n  ['ACCESS_ADMIN'], // requiredPermissions\n  callbackFunction, // no callback\n  false, // all permissions have to match\n);\n\nexport {\n  Permissible,\n  PermissibleRender,\n  AccessGranted,\n  AccessDenied,\n  CallbackComponent,\n};\n"
  },
  {
    "path": "docs-www/src/layouts/.gitkeep",
    "content": ""
  },
  {
    "path": "docs-www/src/pages/404.js",
    "content": "import React from 'react';\n\nconst NotFoundPage = () => (\n  <div>\n    <h1>NOT FOUND</h1>\n    <p>You just hit a route that doesn&#39;t exist... the sadness.</p>\n  </div>\n);\n\nexport default NotFoundPage;\n"
  },
  {
    "path": "docs-www/src/pages/landing.js",
    "content": "import React from 'react';\nimport Link from 'gatsby-link';\n\nimport styles from './landing.module.scss';\n\nconst LandingPage = () => (\n  <div className={styles.landing}>\n    <div>\n      <h1 className={styles.landing__header}>react-permissible</h1>\n      <p className={styles.landing__subheader}>Making the permission management for components easier.</p>\n      <div className={styles.btn__wrapper}>\n        <Link to=\"/docs/getting-started/overview\" className={styles.landing__btn}>\n          <span>Get started!</span>\n        </Link>\n      </div>\n    </div>\n  </div>\n);\n\nexport default LandingPage;\n"
  },
  {
    "path": "docs-www/src/pages/landing.module.scss",
    "content": "@import './variables.scss';\n\n.landing {\n  text-align: center;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  min-height: calc(100vh - 2*#{$mainNavHeight} - 64px);\n}\n\n.landing__header {\n  text-transform: uppercase;\n  font-size: 3rem;\n  letter-spacing: 2px;\n  margin-bottom: 1rem;\n  margin-top: 0;\n}\n\n.btn__wrapper {\n  display: flex;\n  justify-content: center;\n}\n\n.landing__btn {\n  display: inline-block;\n  background-color: $colorBHBg;\n  text-decoration: none;\n  color: $white;\n  padding: 1rem 2rem;\n  margin: 2rem;\n  position: relative;\n  overflow: hidden;\n\n  span {\n    position: relative;\n    z-index: 1;\n  }\n\n  &:after,\n  &:before {\n    content: '';\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    width: 50%;\n    background-color: $colorBHMain;\n    transition: width .3s ease-out;\n  }\n\n  &:after {\n    left: 0;\n  }\n\n  &:before {\n    right: 0;\n  }\n\n  &:hover {\n    color: $white;\n\n    &:after,\n    &:before {\n      width: 0;\n    }\n  }\n}\n\n.landing__btn--alt {\n  composes: landing__btn;\n  background-color: transparent;\n  color: rgba($colorBHBg, .7);\n  transition: color .3s;\n\n  &:after,\n  &:before {\n    background-color: transparent;\n    border-style: solid;\n    border-color: $colorBHMain;\n  }\n\n  &:after {\n    border-width: 1px 0 1px 1px;\n  }\n\n  &:before {\n    border-width: 1px 1px 1px 0;\n  }\n\n  &:hover {\n    color: $colorBHMain;\n  }\n}\n"
  },
  {
    "path": "docs-www/src/pages/variables.scss",
    "content": "$colorBHBg: #150940;\n$colorBHMain: #7b59ff;\n$white: #ffffff;\n\n$mainNavHeight: 80px;\n"
  },
  {
    "path": "docs-www/src/templates/.gitkeep",
    "content": ""
  },
  {
    "path": "docs-www/tools/deploy-github.sh",
    "content": "#!/bin/bash\n\nGITHUB_REPO_NAME=$(basename -s .git `git config --get remote.origin.url`);\n\nPATH_PREFIX=\"/$GITHUB_REPO_NAME\" npm run build\n\n# deploy to github pags\nnode ./node_modules/.bin/gh-pages -d public\n"
  },
  {
    "path": "docs-www/tools/seed/example.md",
    "content": "# CLI Commands\n\n### Running an app\n1. running an application on locally\n    ```bash\n    npm run develop # or yarn develop\n    ```\n\n    Gatsby will start a hot-reloading development environment accessible at [http://localhost:8000](http://localhost:8000)\n\n2. preparing optimized production build\n    ```bash\n    npm run build\n    ```\n\n3. serving locally production build\n    ```bash\n    npm run serve\n    ```\n\n    > Note that your site by default will be available on [http://localhost:9000](http://localhost:9000)\n\n4. deploying to github pages\n    ```bash\n    npm run deploy:gh\n    ```\n\n    > See more [HERE](../getting-started/publishing.md)\n\n"
  },
  {
    "path": "docs-www/tools/seed.sh",
    "content": "#!/bin/bash\n\nCONFIG_FILE=\"gatsby-docs-kit.yml\"\nDIR_NAME=\"docs\"\n\n# Create docs directory\nif [ -d \"../${DIR_NAME}\" ]; then\n  echo '\"docs\" directory already exists. Can not seed it. Remove it and try again.'\n  exit 1;\nfi\n\nmkdir -p \"../${DIR_NAME}\"\n\n# Create gastsby docs kit config file if do not exists\nif [ ! -f \"./${CONFIG_FILE}\" ]; then\n  echo \"\" > $CONFIG_FILE;\nfi\n\n# Create example Mk\ncp ./tools/seed/example.md ../${DIR_NAME}/example.md\n\n# Seeding gastsby docs kit config file\necho \"- title: Home\n  dir: ../docs\n  url: docs\n  file: example.md\" >> $CONFIG_FILE;\n\n# Done\necho \"Done!\""
  },
  {
    "path": "lib/react-permissible.js",
    "content": "!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e(require(\"react\")):\"function\"==typeof define&&define.amd?define(\"react-permissible\",[\"react\"],e):\"object\"==typeof exports?exports[\"react-permissible\"]=e(require(\"react\")):t[\"react-permissible\"]=e(t.React)}(\"undefined\"!=typeof self?self:this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,\"a\",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p=\"\",e(e.s=8)}([function(t,e){function r(){throw new Error(\"setTimeout has not been defined\")}function n(){throw new Error(\"clearTimeout has not been defined\")}function o(t){if(s===setTimeout)return setTimeout(t,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(t,0);try{return s(t,0)}catch(e){try{return s.call(null,t,0)}catch(e){return s.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){h&&y&&(h=!1,y.length?d=y.concat(d):v=-1,d.length&&a())}function a(){if(!h){var t=o(u);h=!0;for(var e=d.length;e;){for(y=d,d=[];++v<e;)y&&y[v].run();v=-1,e=d.length}y=null,h=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var s,l,p=t.exports={};!function(){try{s=\"function\"==typeof setTimeout?setTimeout:r}catch(t){s=r}try{l=\"function\"==typeof clearTimeout?clearTimeout:n}catch(t){l=n}}();var y,d=[],h=!1,v=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new c(t,e)),1!==d.length||h||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title=\"browser\",p.browser=!0,p.env={},p.argv=[],p.version=\"\",p.versions={},p.on=f,p.addListener=f,p.once=f,p.off=f,p.removeListener=f,p.removeAllListeners=f,p.emit=f,p.prependListener=f,p.prependOnceListener=f,p.listeners=function(t){return[]},p.binding=function(t){throw new Error(\"process.binding is not supported\")},p.cwd=function(){return\"/\"},p.chdir=function(t){throw new Error(\"process.chdir is not supported\")},p.umask=function(){return 0}},function(t,e,r){\"use strict\";t.exports=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\"},function(e,r){e.exports=t},function(t,e,r){(function(e){if(\"production\"!==e.env.NODE_ENV){var n=r(4);t.exports=r(12)(n.isElement,!0)}else t.exports=r(15)()}).call(e,r(0))},function(t,e,r){\"use strict\";(function(e){\"production\"===e.env.NODE_ENV?t.exports=r(10):t.exports=r(11)}).call(e,r(0))},function(t,e,r){(function(e){function r(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function n(t,e){return!!(t?t.length:0)&&a(t,e,0)>-1}function o(t,e,r){for(var n=-1,o=t?t.length:0;++n<o;)if(r(e,t[n]))return!0;return!1}function i(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function u(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function a(t,e,r){if(e!==e)return u(t,c,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function c(t){return t!==t}function f(t){return function(e){return t(e)}}function s(t,e){return t.has(e)}function l(t,e){return null==t?void 0:t[e]}function p(t){var e=!1;if(null!=t&&\"function\"!=typeof t.toString)try{e=!!(t+\"\")}catch(t){}return e}function y(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function d(){this.__data__=_t?_t(null):{}}function h(t){return this.has(t)&&delete this.__data__[t]}function v(t){var e=this.__data__;if(_t){var r=e[t];return r===K?void 0:r}return lt.call(e,t)?e[t]:void 0}function b(t){var e=this.__data__;return _t?void 0!==e[t]:lt.call(e,t)}function _(t,e){return this.__data__[t]=_t&&void 0===e?K:e,this}function m(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function g(){this.__data__=[]}function w(t){var e=this.__data__,r=M(e,t);return!(r<0)&&(r==e.length-1?e.pop():dt.call(e,r,1),!0)}function O(t){var e=this.__data__,r=M(e,t);return r<0?void 0:e[r][1]}function j(t){return M(this.__data__,t)>-1}function P(t,e){var r=this.__data__,n=M(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function E(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function S(){this.__data__={hash:new y,map:new(bt||m),string:new y}}function x(t){return V(this,t).delete(t)}function T(t){return V(this,t).get(t)}function $(t){return V(this,t).has(t)}function k(t,e){return V(this,t).set(t,e),this}function C(t){var e=-1,r=t?t.length:0;for(this.__data__=new E;++e<r;)this.add(t[e])}function A(t){return this.__data__.set(t,K),this}function R(t){return this.__data__.has(t)}function M(t,e){for(var r=t.length;r--;)if(z(t[r][0],e))return r;return-1}function I(t,e,r){for(var u=r?o:n,a=t[0].length,c=t.length,l=c,p=Array(c),y=1/0,d=[];l--;){var h=t[l];l&&e&&(h=i(h,f(e))),y=vt(h.length,y),p[l]=!r&&(e||a>=120&&h.length>=120)?new C(l&&h):void 0}h=t[0];var v=-1,b=p[0];t:for(;++v<a&&d.length<y;){var _=h[v],m=e?e(_):_;if(_=r||0!==_?_:0,!(b?s(b,m):u(d,m,r))){for(l=c;--l;){var g=p[l];if(!(g?s(g,m):u(t[l],m,r)))continue t}b&&b.push(m),d.push(_)}}return d}function N(t){return!(!G(t)||L(t))&&(J(t)||p(t)?yt:et).test(W(t))}function F(t){return Y(t)?t:[]}function V(t,e){var r=t.__data__;return q(e)?r[\"string\"==typeof e?\"string\":\"hash\"]:r.map}function D(t,e){var r=l(t,e);return N(r)?r:void 0}function q(t){var e=typeof t;return\"string\"==e||\"number\"==e||\"symbol\"==e||\"boolean\"==e?\"__proto__\"!==t:null===t}function L(t){return!!ft&&ft in t}function W(t){if(null!=t){try{return st.call(t)}catch(t){}try{return t+\"\"}catch(t){}}return\"\"}function z(t,e){return t===e||t!==t&&e!==e}function U(t){return null!=t&&B(t.length)&&!J(t)}function Y(t){return H(t)&&U(t)}function J(t){var e=G(t)?pt.call(t):\"\";return e==X||e==Z}function B(t){return\"number\"==typeof t&&t>-1&&t%1==0&&t<=Q}function G(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function H(t){return!!t&&\"object\"==typeof t}var K=\"__lodash_hash_undefined__\",Q=9007199254740991,X=\"[object Function]\",Z=\"[object GeneratorFunction]\",tt=/[\\\\^$.*+?()[\\]{}|]/g,et=/^\\[object .+?Constructor\\]$/,rt=\"object\"==typeof e&&e&&e.Object===Object&&e,nt=\"object\"==typeof self&&self&&self.Object===Object&&self,ot=rt||nt||Function(\"return this\")(),it=Array.prototype,ut=Function.prototype,at=Object.prototype,ct=ot[\"__core-js_shared__\"],ft=function(){var t=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||\"\");return t?\"Symbol(src)_1.\"+t:\"\"}(),st=ut.toString,lt=at.hasOwnProperty,pt=at.toString,yt=RegExp(\"^\"+st.call(lt).replace(tt,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),dt=it.splice,ht=Math.max,vt=Math.min,bt=D(ot,\"Map\"),_t=D(Object,\"create\");y.prototype.clear=d,y.prototype.delete=h,y.prototype.get=v,y.prototype.has=b,y.prototype.set=_,m.prototype.clear=g,m.prototype.delete=w,m.prototype.get=O,m.prototype.has=j,m.prototype.set=P,E.prototype.clear=S,E.prototype.delete=x,E.prototype.get=T,E.prototype.has=$,E.prototype.set=k,C.prototype.add=C.prototype.push=A,C.prototype.has=R;var mt=function(t,e){return e=ht(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=ht(n.length-e,0),u=Array(i);++o<i;)u[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=u,r(t,this,a)}}(function(t){var e=i(t,F);return e.length&&e[0]===t[0]?I(e):[]});t.exports=mt}).call(e,r(6))},function(t,e){var r;r=function(){return this}();try{r=r||Function(\"return this\")()||(0,eval)(\"this\")}catch(t){\"object\"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(e){function r(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function n(t,e){return!!(t?t.length:0)&&c(t,e,0)>-1}function o(t,e,r){for(var n=-1,o=t?t.length:0;++n<o;)if(r(e,t[n]))return!0;return!1}function i(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function u(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function a(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function c(t,e,r){if(e!==e)return a(t,f,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function f(t){return t!==t}function s(t){return function(e){return t(e)}}function l(t,e){return t.has(e)}function p(t,e){return null==t?void 0:t[e]}function y(t){var e=!1;if(null!=t&&\"function\"!=typeof t.toString)try{e=!!(t+\"\")}catch(t){}return e}function d(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function h(){this.__data__=Et?Et(null):{}}function v(t){return this.has(t)&&delete this.__data__[t]}function b(t){var e=this.__data__;if(Et){var r=e[t];return r===tt?void 0:r}return vt.call(e,t)?e[t]:void 0}function _(t){var e=this.__data__;return Et?void 0!==e[t]:vt.call(e,t)}function m(t,e){return this.__data__[t]=Et&&void 0===e?tt:e,this}function g(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function w(){this.__data__=[]}function O(t){var e=this.__data__,r=I(e,t);return!(r<0)&&(r==e.length-1?e.pop():wt.call(e,r,1),!0)}function j(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]}function P(t){return I(this.__data__,t)>-1}function E(t,e){var r=this.__data__,n=I(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function S(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function x(){this.__data__={hash:new d,map:new(Pt||g),string:new d}}function T(t){return D(this,t).delete(t)}function $(t){return D(this,t).get(t)}function k(t){return D(this,t).has(t)}function C(t,e){return D(this,t).set(t,e),this}function A(t){var e=-1,r=t?t.length:0;for(this.__data__=new S;++e<r;)this.add(t[e])}function R(t){return this.__data__.set(t,tt),this}function M(t){return this.__data__.has(t)}function I(t,e){for(var r=t.length;r--;)if(Y(t[r][0],e))return r;return-1}function N(t,e,r,u){var a=-1,c=n,f=!0,p=t.length,y=[],d=e.length;if(!p)return y;r&&(e=i(e,s(r))),u?(c=o,f=!1):e.length>=Z&&(c=l,f=!1,e=new A(e));t:for(;++a<p;){var h=t[a],v=r?r(h):h;if(h=u||0!==h?h:0,f&&v===v){for(var b=d;b--;)if(e[b]===v)continue t;y.push(h)}else c(e,v,u)||y.push(h)}return y}function F(t,e,r,n,o){var i=-1,a=t.length;for(r||(r=L),o||(o=[]);++i<a;){var c=t[i];e>0&&r(c)?e>1?F(c,e-1,r,n,o):u(o,c):n||(o[o.length]=c)}return o}function V(t){return!(!Q(t)||z(t))&&(H(t)||y(t)?_t:ut).test(U(t))}function D(t,e){var r=t.__data__;return W(e)?r[\"string\"==typeof e?\"string\":\"hash\"]:r.map}function q(t,e){var r=p(t,e);return V(r)?r:void 0}function L(t){return xt(t)||J(t)||!!(Ot&&t&&t[Ot])}function W(t){var e=typeof t;return\"string\"==e||\"number\"==e||\"symbol\"==e||\"boolean\"==e?\"__proto__\"!==t:null===t}function z(t){return!!dt&&dt in t}function U(t){if(null!=t){try{return ht.call(t)}catch(t){}try{return t+\"\"}catch(t){}}return\"\"}function Y(t,e){return t===e||t!==t&&e!==e}function J(t){return G(t)&&vt.call(t,\"callee\")&&(!gt.call(t,\"callee\")||bt.call(t)==rt)}function B(t){return null!=t&&K(t.length)&&!H(t)}function G(t){return X(t)&&B(t)}function H(t){var e=Q(t)?bt.call(t):\"\";return e==nt||e==ot}function K(t){return\"number\"==typeof t&&t>-1&&t%1==0&&t<=et}function Q(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function X(t){return!!t&&\"object\"==typeof t}var Z=200,tt=\"__lodash_hash_undefined__\",et=9007199254740991,rt=\"[object Arguments]\",nt=\"[object Function]\",ot=\"[object GeneratorFunction]\",it=/[\\\\^$.*+?()[\\]{}|]/g,ut=/^\\[object .+?Constructor\\]$/,at=\"object\"==typeof e&&e&&e.Object===Object&&e,ct=\"object\"==typeof self&&self&&self.Object===Object&&self,ft=at||ct||Function(\"return this\")(),st=Array.prototype,lt=Function.prototype,pt=Object.prototype,yt=ft[\"__core-js_shared__\"],dt=function(){var t=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||\"\");return t?\"Symbol(src)_1.\"+t:\"\"}(),ht=lt.toString,vt=pt.hasOwnProperty,bt=pt.toString,_t=RegExp(\"^\"+ht.call(vt).replace(it,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),mt=ft.Symbol,gt=pt.propertyIsEnumerable,wt=st.splice,Ot=mt?mt.isConcatSpreadable:void 0,jt=Math.max,Pt=q(ft,\"Map\"),Et=q(Object,\"create\");d.prototype.clear=h,d.prototype.delete=v,d.prototype.get=b,d.prototype.has=_,d.prototype.set=m,g.prototype.clear=w,g.prototype.delete=O,g.prototype.get=j,g.prototype.has=P,g.prototype.set=E,S.prototype.clear=x,S.prototype.delete=T,S.prototype.get=$,S.prototype.has=k,S.prototype.set=C,A.prototype.add=A.prototype.push=R,A.prototype.has=M;var St=function(t,e){return e=jt(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=jt(n.length-e,0),u=Array(i);++o<i;)u[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=u,r(t,this,a)}}(function(t,e){return G(t)?N(t,F(e,1,G,!0)):[]}),xt=Array.isArray;t.exports=St}).call(e,r(6))},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.PermissibleRender=e.Permissible=void 0;var n=r(9),o=r(16);e.Permissible=n.Permissible,e.PermissibleRender=o.PermissibleRender},function(t,e,r){\"use strict\";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function i(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function u(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e,r,n,a){var l=a?(0,y.default)(e,r).length:0===(0,h.default)(r,e).length;return function(a){function f(t){o(this,f);var e=i(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,t));return l||e.runCallback(),e}return u(f,a),c(f,[{key:\"runCallback\",value:function(){if(n)return n({userPermissions:e,requiredPermissions:r},this.props.history)}},{key:\"render\",value:function(){return l?s.default.createElement(t,this.props):null}}]),f}(f.Component)}Object.defineProperty(e,\"__esModule\",{value:!0});var c=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.Permissible=a;var f=r(2),s=n(f),l=r(3),p=(n(l),r(5)),y=n(p),d=r(7),h=n(d)},function(t,e,r){\"use strict\";function n(t){if(\"object\"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case u:switch(t=t.type){case y:case d:case c:case s:case f:case v:return t;default:switch(t=t&&t.$$typeof){case p:case h:case l:return t;default:return e}}case _:case b:case a:return e}}}function o(t){return n(t)===d}/** @license React v16.8.6\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nObject.defineProperty(e,\"__esModule\",{value:!0});var i=\"function\"==typeof Symbol&&Symbol.for,u=i?Symbol.for(\"react.element\"):60103,a=i?Symbol.for(\"react.portal\"):60106,c=i?Symbol.for(\"react.fragment\"):60107,f=i?Symbol.for(\"react.strict_mode\"):60108,s=i?Symbol.for(\"react.profiler\"):60114,l=i?Symbol.for(\"react.provider\"):60109,p=i?Symbol.for(\"react.context\"):60110,y=i?Symbol.for(\"react.async_mode\"):60111,d=i?Symbol.for(\"react.concurrent_mode\"):60111,h=i?Symbol.for(\"react.forward_ref\"):60112,v=i?Symbol.for(\"react.suspense\"):60113,b=i?Symbol.for(\"react.memo\"):60115,_=i?Symbol.for(\"react.lazy\"):60116;e.typeOf=n,e.AsyncMode=y,e.ConcurrentMode=d,e.ContextConsumer=p,e.ContextProvider=l,e.Element=u,e.ForwardRef=h,e.Fragment=c,e.Lazy=_,e.Memo=b,e.Portal=a,e.Profiler=s,e.StrictMode=f,e.Suspense=v,e.isValidElementType=function(t){return\"string\"==typeof t||\"function\"==typeof t||t===c||t===d||t===s||t===f||t===v||\"object\"==typeof t&&null!==t&&(t.$$typeof===_||t.$$typeof===b||t.$$typeof===l||t.$$typeof===p||t.$$typeof===h)},e.isAsyncMode=function(t){return o(t)||n(t)===y},e.isConcurrentMode=o,e.isContextConsumer=function(t){return n(t)===p},e.isContextProvider=function(t){return n(t)===l},e.isElement=function(t){return\"object\"==typeof t&&null!==t&&t.$$typeof===u},e.isForwardRef=function(t){return n(t)===h},e.isFragment=function(t){return n(t)===c},e.isLazy=function(t){return n(t)===_},e.isMemo=function(t){return n(t)===b},e.isPortal=function(t){return n(t)===a},e.isProfiler=function(t){return n(t)===s},e.isStrictMode=function(t){return n(t)===f},e.isSuspense=function(t){return n(t)===v}},function(t,e,r){\"use strict\";(function(t){/** @license React v16.8.6\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"production\"!==t.env.NODE_ENV&&function(){function t(t){return\"string\"==typeof t||\"function\"==typeof t||t===m||t===E||t===w||t===g||t===x||\"object\"==typeof t&&null!==t&&(t.$$typeof===$||t.$$typeof===T||t.$$typeof===O||t.$$typeof===j||t.$$typeof===S)}function r(t){if(\"object\"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case b:var r=t.type;switch(r){case P:case E:case m:case w:case g:case x:return r;default:var n=r&&r.$$typeof;switch(n){case j:case S:case O:return n;default:return e}}case $:case T:case _:return e}}}function n(t){return J||(J=!0,A(!1,\"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.\")),o(t)||r(t)===P}function o(t){return r(t)===E}function i(t){return r(t)===j}function u(t){return r(t)===O}function a(t){return\"object\"==typeof t&&null!==t&&t.$$typeof===b}function c(t){return r(t)===S}function f(t){return r(t)===m}function s(t){return r(t)===$}function l(t){return r(t)===T}function p(t){return r(t)===_}function y(t){return r(t)===w}function d(t){return r(t)===g}function h(t){return r(t)===x}Object.defineProperty(e,\"__esModule\",{value:!0});var v=\"function\"==typeof Symbol&&Symbol.for,b=v?Symbol.for(\"react.element\"):60103,_=v?Symbol.for(\"react.portal\"):60106,m=v?Symbol.for(\"react.fragment\"):60107,g=v?Symbol.for(\"react.strict_mode\"):60108,w=v?Symbol.for(\"react.profiler\"):60114,O=v?Symbol.for(\"react.provider\"):60109,j=v?Symbol.for(\"react.context\"):60110,P=v?Symbol.for(\"react.async_mode\"):60111,E=v?Symbol.for(\"react.concurrent_mode\"):60111,S=v?Symbol.for(\"react.forward_ref\"):60112,x=v?Symbol.for(\"react.suspense\"):60113,T=v?Symbol.for(\"react.memo\"):60115,$=v?Symbol.for(\"react.lazy\"):60116,k=function(){},C=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=0,i=\"Warning: \"+t.replace(/%s/g,function(){return r[o++]});\"undefined\"!=typeof console&&console.warn(i);try{throw new Error(i)}catch(t){}};k=function(t,e){if(void 0===e)throw new Error(\"`lowPriorityWarning(condition, format, ...args)` requires a warning message argument\");if(!t){for(var r=arguments.length,n=Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];C.apply(void 0,[e].concat(n))}};var A=k,R=P,M=E,I=j,N=O,F=b,V=S,D=m,q=$,L=T,W=_,z=w,U=g,Y=x,J=!1;e.typeOf=r,e.AsyncMode=R,e.ConcurrentMode=M,e.ContextConsumer=I,e.ContextProvider=N,e.Element=F,e.ForwardRef=V,e.Fragment=D,e.Lazy=q,e.Memo=L,e.Portal=W,e.Profiler=z,e.StrictMode=U,e.Suspense=Y,e.isValidElementType=t,e.isAsyncMode=n,e.isConcurrentMode=o,e.isContextConsumer=i,e.isContextProvider=u,e.isElement=a,e.isForwardRef=c,e.isFragment=f,e.isLazy=s,e.isMemo=l,e.isPortal=p,e.isProfiler=y,e.isStrictMode=d,e.isSuspense=h}()}).call(e,r(0))},function(t,e,r){\"use strict\";(function(e){function n(){return null}var o=r(4),i=r(13),u=r(1),a=r(14),c=Function.call.bind(Object.prototype.hasOwnProperty),f=function(){};\"production\"!==e.env.NODE_ENV&&(f=function(t){var e=\"Warning: \"+t;\"undefined\"!=typeof console&&console.error(e);try{throw new Error(e)}catch(t){}}),t.exports=function(t,r){function s(t){var e=t&&(T&&t[T]||t[$]);if(\"function\"==typeof e)return e}function l(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}function p(t){this.message=t,this.stack=\"\"}function y(t){function n(n,a,c,s,l,y,d){if(s=s||k,y=y||c,d!==u){if(r){var h=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types\");throw h.name=\"Invariant Violation\",h}if(\"production\"!==e.env.NODE_ENV&&\"undefined\"!=typeof console){var v=s+\":\"+c;!o[v]&&i<3&&(f(\"You are manually calling a React.PropTypes validation function for the `\"+y+\"` prop on `\"+s+\"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.\"),o[v]=!0,i++)}}return null==a[c]?n?new p(null===a[c]?\"The \"+l+\" `\"+y+\"` is marked as required in `\"+s+\"`, but its value is `null`.\":\"The \"+l+\" `\"+y+\"` is marked as required in `\"+s+\"`, but its value is `undefined`.\"):null:t(a,c,s,l,y)}if(\"production\"!==e.env.NODE_ENV)var o={},i=0;var a=n.bind(null,!1);return a.isRequired=n.bind(null,!0),a}function d(t){function e(e,r,n,o,i,u){var a=e[r];if(P(a)!==t)return new p(\"Invalid \"+o+\" `\"+i+\"` of type `\"+E(a)+\"` supplied to `\"+n+\"`, expected `\"+t+\"`.\");return null}return y(e)}function h(t){function e(e,r,n,o,i){if(\"function\"!=typeof t)return new p(\"Property `\"+i+\"` of component `\"+n+\"` has invalid PropType notation inside arrayOf.\");var a=e[r];if(!Array.isArray(a)){return new p(\"Invalid \"+o+\" `\"+i+\"` of type `\"+P(a)+\"` supplied to `\"+n+\"`, expected an array.\")}for(var c=0;c<a.length;c++){var f=t(a,c,n,o,i+\"[\"+c+\"]\",u);if(f instanceof Error)return f}return null}return y(e)}function v(t){function e(e,r,n,o,i){if(!(e[r]instanceof t)){var u=t.name||k;return new p(\"Invalid \"+o+\" `\"+i+\"` of type `\"+x(e[r])+\"` supplied to `\"+n+\"`, expected instance of `\"+u+\"`.\")}return null}return y(e)}function b(t){function r(e,r,n,o,i){for(var u=e[r],a=0;a<t.length;a++)if(l(u,t[a]))return null;var c=JSON.stringify(t,function(t,e){return\"symbol\"===E(e)?String(e):e});return new p(\"Invalid \"+o+\" `\"+i+\"` of value `\"+String(u)+\"` supplied to `\"+n+\"`, expected one of \"+c+\".\")}return Array.isArray(t)?y(r):(\"production\"!==e.env.NODE_ENV&&f(arguments.length>1?\"Invalid arguments supplied to oneOf, expected an array, got \"+arguments.length+\" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).\":\"Invalid argument supplied to oneOf, expected an array.\"),n)}function _(t){function e(e,r,n,o,i){if(\"function\"!=typeof t)return new p(\"Property `\"+i+\"` of component `\"+n+\"` has invalid PropType notation inside objectOf.\");var a=e[r],f=P(a);if(\"object\"!==f)return new p(\"Invalid \"+o+\" `\"+i+\"` of type `\"+f+\"` supplied to `\"+n+\"`, expected an object.\");for(var s in a)if(c(a,s)){var l=t(a,s,n,o,i+\".\"+s,u);if(l instanceof Error)return l}return null}return y(e)}function m(t){function r(e,r,n,o,i){for(var a=0;a<t.length;a++){if(null==(0,t[a])(e,r,n,o,i,u))return null}return new p(\"Invalid \"+o+\" `\"+i+\"` supplied to `\"+n+\"`.\")}if(!Array.isArray(t))return\"production\"!==e.env.NODE_ENV&&f(\"Invalid argument supplied to oneOfType, expected an instance of array.\"),n;for(var o=0;o<t.length;o++){var i=t[o];if(\"function\"!=typeof i)return f(\"Invalid argument supplied to oneOfType. Expected an array of check functions, but received \"+S(i)+\" at index \"+o+\".\"),n}return y(r)}function g(t){function e(e,r,n,o,i){var a=e[r],c=P(a);if(\"object\"!==c)return new p(\"Invalid \"+o+\" `\"+i+\"` of type `\"+c+\"` supplied to `\"+n+\"`, expected `object`.\");for(var f in t){var s=t[f];if(s){var l=s(a,f,n,o,i+\".\"+f,u);if(l)return l}}return null}return y(e)}function w(t){function e(e,r,n,o,a){var c=e[r],f=P(c);if(\"object\"!==f)return new p(\"Invalid \"+o+\" `\"+a+\"` of type `\"+f+\"` supplied to `\"+n+\"`, expected `object`.\");var s=i({},e[r],t);for(var l in s){var y=t[l];if(!y)return new p(\"Invalid \"+o+\" `\"+a+\"` key `\"+l+\"` supplied to `\"+n+\"`.\\nBad object: \"+JSON.stringify(e[r],null,\"  \")+\"\\nValid keys: \"+JSON.stringify(Object.keys(t),null,\"  \"));var d=y(c,l,n,o,a+\".\"+l,u);if(d)return d}return null}return y(e)}function O(e){switch(typeof e){case\"number\":case\"string\":case\"undefined\":return!0;case\"boolean\":return!e;case\"object\":if(Array.isArray(e))return e.every(O);if(null===e||t(e))return!0;var r=s(e);if(!r)return!1;var n,o=r.call(e);if(r!==e.entries){for(;!(n=o.next()).done;)if(!O(n.value))return!1}else for(;!(n=o.next()).done;){var i=n.value;if(i&&!O(i[1]))return!1}return!0;default:return!1}}function j(t,e){return\"symbol\"===t||!!e&&(\"Symbol\"===e[\"@@toStringTag\"]||\"function\"==typeof Symbol&&e instanceof Symbol)}function P(t){var e=typeof t;return Array.isArray(t)?\"array\":t instanceof RegExp?\"object\":j(e,t)?\"symbol\":e}function E(t){if(void 0===t||null===t)return\"\"+t;var e=P(t);if(\"object\"===e){if(t instanceof Date)return\"date\";if(t instanceof RegExp)return\"regexp\"}return e}function S(t){var e=E(t);switch(e){case\"array\":case\"object\":return\"an \"+e;case\"boolean\":case\"date\":case\"regexp\":return\"a \"+e;default:return e}}function x(t){return t.constructor&&t.constructor.name?t.constructor.name:k}var T=\"function\"==typeof Symbol&&Symbol.iterator,$=\"@@iterator\",k=\"<<anonymous>>\",C={array:d(\"array\"),bool:d(\"boolean\"),func:d(\"function\"),number:d(\"number\"),object:d(\"object\"),string:d(\"string\"),symbol:d(\"symbol\"),any:function(){return y(n)}(),arrayOf:h,element:function(){function e(e,r,n,o,i){var u=e[r];if(!t(u)){return new p(\"Invalid \"+o+\" `\"+i+\"` of type `\"+P(u)+\"` supplied to `\"+n+\"`, expected a single ReactElement.\")}return null}return y(e)}(),elementType:function(){function t(t,e,r,n,i){var u=t[e];if(!o.isValidElementType(u)){return new p(\"Invalid \"+n+\" `\"+i+\"` of type `\"+P(u)+\"` supplied to `\"+r+\"`, expected a single ReactElement type.\")}return null}return y(t)}(),instanceOf:v,node:function(){function t(t,e,r,n,o){return O(t[e])?null:new p(\"Invalid \"+n+\" `\"+o+\"` supplied to `\"+r+\"`, expected a ReactNode.\")}return y(t)}(),objectOf:_,oneOf:b,oneOfType:m,shape:g,exact:w};return p.prototype=Error.prototype,C.checkPropTypes=a,C.resetWarningCache=a.resetWarningCache,C.PropTypes=C,C}}).call(e,r(0))},function(t,e,r){\"use strict\";function n(t){if(null===t||void 0===t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\nvar o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String(\"abc\");if(t[5]=\"de\",\"5\"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e[\"_\"+String.fromCharCode(r)]=r;if(\"0123456789\"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(\"\"))return!1;var n={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(t){n[t]=t}),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},n)).join(\"\")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,c=n(t),f=1;f<arguments.length;f++){r=Object(arguments[f]);for(var s in r)i.call(r,s)&&(c[s]=r[s]);if(o){a=o(r);for(var l=0;l<a.length;l++)u.call(r,a[l])&&(c[a[l]]=r[a[l]])}}return c}},function(t,e,r){\"use strict\";(function(e){function n(t,r,n,c,f){if(\"production\"!==e.env.NODE_ENV)for(var s in t)if(a(t,s)){var l;try{if(\"function\"!=typeof t[s]){var p=Error((c||\"React class\")+\": \"+n+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof t[s]+\"`.\");throw p.name=\"Invariant Violation\",p}l=t[s](r,s,c,n,null,i)}catch(t){l=t}if(!l||l instanceof Error||o((c||\"React class\")+\": type specification of \"+n+\" `\"+s+\"` is invalid; the type checker function must return `null` or an `Error` but returned a \"+typeof l+\". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\"),l instanceof Error&&!(l.message in u)){u[l.message]=!0;var y=f?f():\"\";o(\"Failed \"+n+\" type: \"+l.message+(null!=y?y:\"\"))}}}var o=function(){};if(\"production\"!==e.env.NODE_ENV){var i=r(1),u={},a=Function.call.bind(Object.prototype.hasOwnProperty);o=function(t){var e=\"Warning: \"+t;\"undefined\"!=typeof console&&console.error(e);try{throw new Error(e)}catch(t){}}}n.resetWarningCache=function(){\"production\"!==e.env.NODE_ENV&&(u={})},t.exports=n}).call(e,r(0))},function(t,e,r){\"use strict\";function n(){}function o(){}var i=r(1);o.resetWarningCache=n,t.exports=function(){function t(t,e,r,n,o,u){if(u!==i){var a=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\");throw a.name=\"Invariant Violation\",a}}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:n};return r.PropTypes=r,r}},function(t,e,r){\"use strict\";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function i(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function u(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,\"__esModule\",{value:!0}),e.PermissibleRender=void 0;var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=r(2),f=r(3),s=(n(f),r(5)),l=n(s),p=r(7),y=n(p);e.PermissibleRender=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:\"checkPermissions\",value:function(){var t=this.props,e=t.userPermissions,r=t.requiredPermissions;return t.oneperm?(0,l.default)(e,r).length:0===(0,y.default)(r,e).length}},{key:\"render\",value:function(){var t=this.props,e=t.children,r=t.userPermissions,n=t.requiredPermissions,o=t.renderOtherwise;return e&&r&&n?this.checkPermissions()?e:o||null:null}}]),e}(c.Component)}])});"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"@brainhubeu/react-permissible\",\n  \"version\": \"1.9.16\",\n  \"description\": \"Permission management component for React\",\n  \"engines\": {\n    \"npm\": \">=6.14.5\"\n  },\n  \"scripts\": {\n    \"lint\": \"esw webpack.config.* src tools test --color\",\n    \"lint:types\": \"esw 'types/*.{ts,tsx}' 'types/tests/*.{ts,tsx}' --ext ts,tsx --color --format codeframe --config ./types/.eslintrc\",\n    \"lint:types:watch\": \"npm run --silent lint:types -- --watch\",\n    \"lint:types:fix\": \"npm run --silent lint:types -- --fix\",\n    \"clean-dist\": \"rm -rf ./lib && mkdir lib\",\n    \"prebuild\": \"npm run clean-dist\",\n    \"build\": \"node tools/build.js\",\n    \"test\": \"mocha tools/testSetup.js \\\"./test/**/*.js\\\"\",\n    \"test:coverage\": \"NODE_PATH=example babel-node ./node_modules/.bin/isparta cover _mocha -- --require ./tools/testSetup.js \\\"./test/**/*.js\\\" && open coverage/lcov-report/index.html\",\n    \"test:coverage:ci\": \"NODE_PATH=example babel-node ./node_modules/.bin/isparta cover _mocha --report lcovonly -- --require ./tools/testSetup.js \\\"./test/**/*.js\\\"\",\n    \"test:typescript\": \"cd ./types/tests && npm install-test --no-audit\",\n    \"precommit\": \"npm run lint && npm run lint:types\"\n  },\n  \"author\": \"Krystian Kościelniak\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"gatsby-plugin-google-analytics\": \"2.3.2\",\n    \"lodash.difference\": \"^4.5.0\",\n    \"lodash.intersection\": \"^4.4.0\"\n  },\n  \"devDependencies\": {\n    \"autoprefixer\": \"^9.8.4\",\n    \"babel-cli\": \"^6.26.0\",\n    \"babel-core\": \"^6.26.3\",\n    \"babel-eslint\": \"^10.1.0\",\n    \"babel-loader\": \"^8.1.0\",\n    \"babel-plugin-react-display-name\": \"^2.0.0\",\n    \"babel-plugin-transform-decorators-legacy\": \"^1.3.5\",\n    \"babel-plugin-transform-react-constant-elements\": \"^6.23.0\",\n    \"babel-plugin-transform-react-remove-prop-types\": \"^0.4.24\",\n    \"babel-polyfill\": \"^6.26.0\",\n    \"babel-preset-env\": \"^1.7.0\",\n    \"babel-preset-es2015\": \"^6.24.1\",\n    \"babel-preset-latest\": \"^6.24.1\",\n    \"babel-preset-react\": \"^6.24.1\",\n    \"babel-preset-react-hmre\": \"^1.1.1\",\n    \"babel-preset-stage-1\": \"^6.24.1\",\n    \"babel-register\": \"^6.26.0\",\n    \"chai\": \"^4.2.0\",\n    \"chai-as-promised\": \"^7.1.1\",\n    \"chai-enzyme\": \"^1.0.0-beta.1\",\n    \"chalk\": \"^4.1.0\",\n    \"coveralls\": \"^3.1.0\",\n    \"enzyme\": \"^3.11.0\",\n    \"enzyme-adapter-react-16\": \"^1.15.2\",\n    \"eslint\": \"^7.3.1\",\n    \"eslint-config-brainhub\": \"^1.13.0\",\n    \"eslint-plugin-typescript\": \"^0.14.0\",\n    \"eslint-watch\": \"^7.0.0\",\n    \"html-webpack-plugin\": \"^4.3.0\",\n    \"husky\": \"^4.2.5\",\n    \"isparta\": \"^4.1.1\",\n    \"jsdom\": \"^16.2.2\",\n    \"mocha\": \"^8.0.1\",\n    \"prop-types\": \"^15.7.2\",\n    \"react\": \"^16.13.1\",\n    \"react-dom\": \"^16.13.1\",\n    \"react-test-renderer\": \"^16.13.1\",\n    \"sinon\": \"^9.0.2\",\n    \"sinon-chai\": \"^3.5.0\",\n    \"typescript\": \"^3.9.6\",\n    \"typescript-eslint-parser\": \"^21.0.2\",\n    \"uglifyjs-webpack-plugin\": \"^2.2.0\",\n    \"webpack\": \"^4.43.0\"\n  },\n  \"peerDependencies\": {\n    \"react\": \">0.14.0 || >15.0.0\",\n    \"react-dom\": \">0.14.0 || >15.0.0\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"react-permissions\",\n    \"permissions\",\n    \"permission-manager\",\n    \"props\",\n    \"callback\",\n    \"users\",\n    \"authentication\",\n    \"optional-props\",\n    \"authorization\",\n    \"access-control\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/brainhubeu/react-permissible\"\n  },\n  \"main\": \"./lib/react-permissible.js\",\n  \"types\": \"./types/react-permissible.d.ts\"\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"bumpVersion\": \"patch\",\n  \"commitMessagePrefix\": \"[renovate] \",\n  \"groupName\": \"NPM dependencies\",\n  \"labels\": [\"renovate\"],\n  \"rangeStrategy\": \"bump\",\n  \"branchPrefix\": \"fix/renovate/\",\n  \"docker\": {\n    \"major\": {\n      \"enabled\": true\n    }\n  },\n  \"packageRules\": [\n    {\n      \"groupName\": \"Docker dependencies\",\n      \"managers\": [\n        \"circleci\"\n      ]\n    },\n    {\n      \"groupName\": \"gatsby\",\n      \"managerBranchPrefix\": \"gatsby\",\n      \"packagePatterns\": [\n        \"gatsby\"\n      ],\n      \"rangeStrategy\": \"pin\"\n    }\n  ],\n  \"schedule\": [\n    \"before 3am on the first day of the month\"\n  ]\n}\n"
  },
  {
    "path": "src/components/permissible.js",
    "content": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport intersection from 'lodash.intersection';\nimport difference from 'lodash.difference';\n\nexport function Permissible(\n  RestrictedComponent,\n  userPermissions,\n  requiredPermissions,\n  callbackFunction,\n  oneperm,\n) {\n  const permissionsStatus = oneperm\n    ? intersection(userPermissions, requiredPermissions).length\n    : difference(requiredPermissions, userPermissions).length === 0;\n\n  class PermissibleHOC extends Component {\n    static propTypes = {\n      oneperm: PropTypes.bool,\n      history: PropTypes.object, // eslint-disable-line react/forbid-prop-types\n    };\n\n    constructor(props) {\n      super(props);\n\n      if (!permissionsStatus) {\n        this.runCallback();\n      }\n    }\n\n    runCallback() {\n      if (callbackFunction) {\n        return callbackFunction({\n          userPermissions,\n          requiredPermissions,\n        },\n        this.props.history);\n      }\n      return;\n    }\n\n    render() {\n      if (permissionsStatus) {\n        return <RestrictedComponent {...this.props}/>;\n      }\n      return null;\n    }\n  }\n  return PermissibleHOC;\n}\n"
  },
  {
    "path": "src/components/permissibleRender.js",
    "content": "import { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport intersection from 'lodash.intersection';\nimport difference from 'lodash.difference';\n\nexport class PermissibleRender extends Component {\n  static propTypes = {\n    oneperm: PropTypes.bool,\n    userPermissions: PropTypes.arrayOf(PropTypes.string).isRequired,\n    requiredPermissions: PropTypes.arrayOf(PropTypes.string).isRequired,\n    children: PropTypes.element.isRequired,\n    renderOtherwise: PropTypes.element,\n  };\n\n  checkPermissions() {\n    const { userPermissions, requiredPermissions, oneperm } = this.props;\n\n    if (oneperm) {\n      return intersection(userPermissions, requiredPermissions).length;\n    }\n\n    return difference(requiredPermissions, userPermissions).length === 0;\n  }\n\n  render() {\n    const { children, userPermissions, requiredPermissions, renderOtherwise } = this.props;\n\n    if (!children || !userPermissions || !requiredPermissions) {\n      return null;\n    }\n\n    if (this.checkPermissions()) {\n      return children;\n    } else if (renderOtherwise) {\n      return renderOtherwise;\n    }\n    return null;\n  }\n}\n"
  },
  {
    "path": "src/index.js",
    "content": "import { Permissible } from './components/permissible';\nimport { PermissibleRender } from './components/permissibleRender';\n\nexport {\n  Permissible,\n  PermissibleRender,\n};\n"
  },
  {
    "path": "test/.eslintrc",
    "content": "{\n  env: {\n    es6: true,\n    browser: true,\n    node: true,\n    mocha: true,\n  },\n}\n"
  },
  {
    "path": "test/accessible.component.js",
    "content": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Accessible = ({ permission, oneperm }) => (\n  <div className=\"accessible-component\">\n    <p>\n      {oneperm ? 'One of' : 'Whole set of'} <code>{permission}</code> is necessary to see this component.\n    </p>\n  </div>\n);\n\nAccessible.propTypes = {\n  permission: PropTypes.string,\n  oneperm: PropTypes.bool,\n};\n\nexport default Accessible;\n"
  },
  {
    "path": "test/permissible.test.js",
    "content": "import React from 'react';\nimport { shallow } from 'enzyme';\nimport chai from 'chai';\nimport chaiEnzyme from 'chai-enzyme';\nimport { JSDOM } from 'jsdom';\n\nimport { Permissible } from '../src/components/permissible';\n\nimport AccessedComponent from './accessible.component';\n\nconst { document } = (new JSDOM('')).window;\nglobal.document = document;\nglobal.window = document.defaultView;\n\nchai.use(chaiEnzyme());\nchai.should();\n\ndescribe('Permissible HOC', () => {\n  it('doesn\\'t run a callback function if the permissions are right', done => {\n    let err = null;\n\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent />,\n      ['MATCHING_PERMISSIONS'],\n      ['MATCHING_PERMISSIONS'],\n      () => {\n        err = new Error('Callback function called.');\n      },\n    );\n\n    shallow(\n      <AccessibleRoute />,\n    );\n\n    done(err);\n  });\n\n  it('doesn\\'t run a callback function if `requiredPermissions` and `userPermissions` are both empty', done => {\n    let err = null;\n\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent />,\n      [],\n      [],\n      () => {\n        err = new Error('Callback function called.');\n      },\n    );\n\n    shallow(\n      <AccessibleRoute />,\n    );\n\n    done(err);\n  });\n\n  it('doesn\\'t run a callback function if only `requiredPermissions` are empty', done => {\n    let err = null;\n\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent />,\n      ['SOME_PERMISSION'],\n      [],\n      () => {\n        err = new Error('Callback function called.');\n      },\n    );\n\n    shallow(\n      <AccessibleRoute />,\n    );\n\n    done(err);\n  });\n\n  it('runs a callback function if the permissions don\\'t match', done => {\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent />,\n      ['MATCHING_PERMISSIONS'],\n      ['UNMATCHING_PERMISSIONS'],\n      () => {\n        done();\n      },\n    );\n\n    shallow(\n      <AccessibleRoute/>,\n    );\n  });\n\n  it('doesn\\'t run a callback function if the user has one of necessary permissions and `oneperm` is `true`', done => {\n    let err = null;\n\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent/>,\n      ['REQUIRED_PERMISSION'],\n      ['REQUIRED_PERMISSION', 'ANOTHER_PERMISSION'],\n      () => {\n        err = new Error('Callback function called.');\n      },\n      true,\n    );\n\n    shallow(\n      <AccessibleRoute />,\n    );\n\n    done(err);\n  });\n\n  it('runs a callback function if the user has one of necessary permissions and `oneperm` is `false`', done => {\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent />,\n      ['REQUIRED_PERMISSION'],\n      ['REQUIRED_PERMISSION', 'ANOTHER_PERMISSION'],\n      () => {\n        done();\n      },\n      false,\n    );\n\n    shallow(\n      <AccessibleRoute />,\n    );\n  });\n\n  it('doesn\\'t run a callback function if it is not defined', done => {\n    const AccessibleRoute = Permissible(\n      () => <AccessedComponent />,\n      ['REQUIRED_PERMISSION'],\n      ['REQUIRED_PERMISSION', 'ANOTHER_PERMISSION'],\n      null,\n      false,\n    );\n\n    shallow(\n      <AccessibleRoute />,\n    );\n\n    done();\n  });\n});\n"
  },
  {
    "path": "test/permissibleRender.test.js",
    "content": "import React from 'react';\nimport { mount } from 'enzyme';\nimport chai from 'chai';\nimport chaiEnzyme from 'chai-enzyme';\nimport { JSDOM } from 'jsdom';\n\nimport { PermissibleRender } from '../src/components/permissibleRender';\n\nconst should = chai.should();\n\nconst { document } = (new JSDOM('')).window;\nglobal.document = document;\nglobal.window = document.defaultView;\n\nchai.use(chaiEnzyme());\nchai.should();\n\ndescribe('PermissibleRender', () => {\n  const ChildComponent = () => (\n    <div>\n      Child component\n    </div>\n  );\n\n  const NotAllowedComponent = () => (\n    <div>\n      Not allowed component\n    </div>\n  );\n\n  it('doesn\\'t render a <ChildComponent /> if `userPermissions` prop is not set', () => {\n    const props = {\n      requiredPermissions: [],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.equal(0);\n  });\n\n  it('doesn\\'t render a <ChildComponent /> if `requiredPermissions` prop is not set', () => {\n    const props = {\n      userPermissions: [],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.equal(0);\n  });\n\n  it('renders nothing if `children` prop is not set', () => {\n    const props = {\n      userPermissions: [],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props} />,\n    );\n\n    should.not.exist(mountedComponent.find('PermissibleRender').html());\n  });\n\n  it('renders a <ChildComponent /> if user permissions and required permissions are both empty', () => {\n    const props = {\n      userPermissions: [],\n      requiredPermissions: [],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.equal(1);\n  });\n\n  it('renders a <ChildComponent /> if only required permissions are empty', () => {\n    const props = {\n      userPermissions: ['SOME_PERMISSION'],\n      requiredPermissions: [],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.equal(1);\n  });\n\n  it('doesn\\'t render a <ChildComponent /> if there is a permission mismatch', () => {\n    const props = {\n      userPermissions: ['REQUIRED_PERMISSION'],\n      requiredPermissions: ['ANOTHER_PERMISSION'],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.equal(0);\n  });\n\n  it('renders a <ChildComponent /> if the user has required permission', () => {\n    const props = {\n      userPermissions: ['REQUIRED_PERMISSION'],\n      requiredPermissions: ['REQUIRED_PERMISSION'],\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.greaterThan(0);\n  });\n\n  it('renders a <NotAllowedComponent /> if the user doesn\\'t have required permissions and renderOtherwise is given', () => {\n    const props = {\n      userPermissions: ['REQUIRED_PERMISSION'],\n      requiredPermissions: ['NOT_REQUIRED_PERMISSION'],\n      renderOtherwise: <NotAllowedComponent />,\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <NotAllowedComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('NotAllowedComponent');\n    searchedElement.length.should.be.greaterThan(0);\n  });\n\n  it('renders a <ChildComponent /> if the user has one of necessary conditions when `oneperm` prop is defined', () => {\n    const props = {\n      userPermissions: ['ANOTHER_PERMISSION'],\n      requiredPermissions: ['REQUIRED_PERMISSION', 'ANOTHER_PERMISSION'],\n      oneperm: true,\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.greaterThan(0);\n  });\n\n  it('doesn\\'t render a <ChildComponent /> if the user doesn\\'t have all of necessary permissions when `oneperm` prop is explicitly set to false', () => {\n    const props = {\n      userPermissions: ['REQUIRED_PERMISSION'],\n      requiredPermissions: ['REQUIRED_PERMISSION', 'ANOTHER_PERMISSION'],\n      oneperm: false,\n    };\n\n    const mountedComponent = mount(\n      <PermissibleRender {...props}>\n        <ChildComponent />\n      </PermissibleRender>,\n    );\n\n    const searchedElement = mountedComponent.find('ChildComponent');\n    searchedElement.length.should.be.equal(0);\n  });\n});\n"
  },
  {
    "path": "tools/build.js",
    "content": "// More info on Webpack's Node API here: https://webpack.github.io/docs/node.js-api.html\n// Allowing console calls below since this is a build file.\n/* eslint-disable no-console */\nconst chalk = require('chalk');\nconst webpack = require('webpack');\n\nconst config = require('../webpack.config.prod');\n\nconst chalkConfig = {\n  chalkError: chalk.red,\n  chalkSuccess: chalk.green,\n  chalkWarning: chalk.yellow,\n  chalkProcessing: chalk.blue,\n};\n\nconst { chalkError, chalkSuccess, chalkWarning, chalkProcessing } = chalkConfig;\n\nprocess.env.NODE_ENV = 'production'; // this assures React is built in prod mode and that the Babel dev config doesn't apply.\n\nconsole.log(chalkProcessing('Generating minified bundle. This will take a moment...'));\n\nwebpack(config).run((error, stats) => {\n  if (error) { // so a fatal error occurred. Stop here.\n    console.log(chalkError(error));\n    return 1;\n  }\n\n  const jsonStats = stats.toJson();\n\n  if (jsonStats.hasErrors) {\n    return jsonStats.errors.map(error => console.log(chalkError(error)));\n  }\n\n  if (jsonStats.hasWarnings) {\n    console.log(chalkWarning('Webpack generated the following warnings: '));\n    jsonStats.warnings.map(warning => console.log(chalkWarning(warning)));\n  }\n\n  console.log(`Webpack stats: ${stats}`);\n\n  // if we got this far, the build succeeded.\n  console.log(chalkSuccess('Your app is compiled in production mode in /dist. It\\'s ready to roll!'));\n\n  return 0;\n});\n"
  },
  {
    "path": "tools/testSetup.js",
    "content": "process.env.NODE_ENV = 'test';\n\n// Disable webpack-specific features for tests since\n// Mocha doesn't know what to do with them.\n/* istanbul ignore next */\n['.css', '.scss', '.png', '.jpg'].forEach(ext => {\n  require.extensions[ext] = () => null;\n});\n\n// add required globals\n/* eslint-disable no-empty-function */\n/* istanbul ignore next */\nglobal.logger = function() {};\n/* istanbul ignore next */\nglobal.logger.info = function() {};\n/* istanbul ignore next */\nglobal.logger.apiSuccess = function() {};\n/* istanbul ignore next */\nglobal.logger.apiError = function() {};\n/* istanbul ignore next */\nglobal.logger.warn = function() {};\n/* eslint-enable */\n\n// Register babel so that it will transpile ES6 to ES5\n// before our tests run.\nrequire('babel-register')();\nrequire('babel-polyfill');\n\nconst chai = require('chai');\nconst sinonChai = require('sinon-chai');\nconst chaiAsPromised = require('chai-as-promised');\nconst enzyme = require('enzyme');\nconst Adapter = require('enzyme-adapter-react-16');\n\nenzyme.configure({ adapter: new Adapter() });\n\nchai.use(sinonChai);\nchai.use(chaiAsPromised);\n"
  },
  {
    "path": "types/.eslintrc",
    "content": "{\n  \"parser\": \"typescript-eslint-parser\",\n  \"plugins\": [\"eslint-plugin-typescript\"],\n  \"extends\": \"../.eslintrc\",\n  \"rules\": {\n    \"comma-dangle\":\"off\",\n    \"no-unused-vars\": \"off\",\n    \"import/no-namespace\": \"off\",\n    \"typescript/no-unused-vars\": \"error\"\n  }\n}\n"
  },
  {
    "path": "types/react-permissible.d.ts",
    "content": "import { Component, ComponentState, ComponentType, ReactNode, ReactNodeArray, StaticLifecycle, ValidationMap, } from 'react';\n\ndeclare module '@brainhubeu/react-permissible' {\n  type Permissions = string[];\n\n  type Children = ReactNode | ReactNodeArray;\n\n  export interface UserAndRequiredPermissions {\n    userPermissions: Permissions\n    requiredPermissions: Permissions\n  }\n\n  export interface PermissibleRenderProps extends UserAndRequiredPermissions {\n    oneperm?: boolean\n    children: Children\n    renderOtherwise?: Children\n  }\n\n  export class PermissibleRender extends Component<PermissibleRenderProps> {\n    checkPermissions(): boolean\n  }\n\n  export function Permissible<Props extends object, State extends object>(\n    RestrictedComponent: ComponentType<Props>,\n    userPermissions: Permissions,\n    requiredPermissions: Permissions,\n    callbackFunction?: ({ userPermissions, requiredPermissions, }: UserAndRequiredPermissions) => void,\n    oneperm?: boolean,\n  ): PermissibleHOC<Props, State, { runCallback(): void }>\n\n  interface PermissibleHOC<Props = object, State = ComponentState, TE = object> extends StaticLifecycle<Props, State> {\n    new (props: Props, context?: any): Component<Props, State> & TE\n    propTypes?: ValidationMap<Props>\n    contextTypes?: ValidationMap<any>\n    childContextTypes?: ValidationMap<any>\n    defaultProps?: Partial<Props>\n    displayName?: string\n  }\n}\n"
  },
  {
    "path": "types/tests/.gitignore",
    "content": "brainhubeu-react-permissible-*.tgz\nnode_modules/\n"
  },
  {
    "path": "types/tests/.npmrc",
    "content": "update-notifier=false\naudit=false\nprefer-offline=true\n"
  },
  {
    "path": "types/tests/Permissible.test.tsx",
    "content": "import * as React from 'react';\nimport { render } from 'react-dom';\n// eslint-disable-next-line import/no-unresolved, import/no-extraneous-dependencies, /* this is what we're testing */\nimport { Permissible, UserAndRequiredPermissions } from '@brainhubeu/react-permissible';\n\nfunction callbackFunction({ userPermissions, requiredPermissions }: UserAndRequiredPermissions) {\n  // eslint-disable-next-line no-console\n  console.info(`\n    react-permissible: Access Denied\n    userPermissions: ${userPermissions}\n    requiredPermissions: ${requiredPermissions}\n  `);\n}\n\nconst AccessGranted = ({ message }: { message: string, }) => <>AccessGranted {message}</>;\n\nconst RestrictedComponentWithCallback = Permissible(\n  AccessGranted,\n  ['ACCESS_DASHBOARD'], // userPermissions\n  ['ACCESS_ADMIN'], // requiredPermissions\n  callbackFunction,\n);\n\nrender(<RestrictedComponentWithCallback {...{ message: 'test' }} />, document.createElement('div'));\n"
  },
  {
    "path": "types/tests/PermissibleRender.test.tsx",
    "content": "import * as React from 'react';\nimport { render } from 'react-dom';\n// eslint-disable-next-line import/no-unresolved, import/no-extraneous-dependencies, /* this is what we're testing */\nimport { PermissibleRender, PermissibleRenderProps } from '@brainhubeu/react-permissible';\n\nconst VIEW_PERMISSION = 'VIEW';\n\nconst permissibleRenderTestProps: PermissibleRenderProps = {\n  oneperm: false,\n  children: 'restricted content',\n  userPermissions: [VIEW_PERMISSION],\n  requiredPermissions: [VIEW_PERMISSION],\n  renderOtherwise: 'ACCESS DENIED',\n};\n\nrender(<PermissibleRender {...permissibleRenderTestProps} />, document.createElement('div'));\n"
  },
  {
    "path": "types/tests/package.json",
    "content": "{\n  \"name\": \"react-permissible-typescript-tests\",\n  \"version\": \"1.0.27\",\n  \"description\": \"Test publishing the typings of react-permissible package\",\n  \"scripts\": {\n    \"clean:packed-package\": \"rm ./brainhubeu-react-permissible-*.tgz\",\n    \"clean:node-modules\": \"rm -rf ./node_modules/\",\n    \"preinstall\": \"npm run clean:packed-package && npm run clean:node-modules\",\n    \"pack-parent-package-get-filename\": \"npm pack ../.. | grep \\\\.tgz\",\n    \"postinstall\": \"npm install --no-save --no-audit `npm run --silent pack-parent-package-get-filename`\",\n    \"test\": \"tsc --project .\",\n    \"posttest\": \"echo 'TypeScript typings successfuly compiled!'\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/brainhubeu/react-permissible\"\n  },\n  \"author\": \"Nick Ribal <elektronik2k5@gmail.com> (https://about.me/nickribal)\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"@types/react\": \"^16.9.41\",\n    \"@types/react-dom\": \"^16.9.8\",\n    \"react\": \"^16.13.1\",\n    \"react-dom\": \"^16.13.1\",\n    \"typescript\": \"^3.9.6\"\n  }\n}\n"
  },
  {
    "path": "types/tests/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"es2015\",\n    \"noEmit\": true,\n    \"jsx\": \"react\",\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"noImplicitReturns\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"moduleResolution\": \"node\"\n  }\n}\n"
  },
  {
    "path": "webpack.config.prod.js",
    "content": "const path = require('path');\n\nconst UglifyJsPlugin = require('uglifyjs-webpack-plugin');\n\nmodule.exports = {\n  externals: [\n    {\n      'react-dom': {\n        root: 'ReactDOM',\n        commonjs2: 'react-dom',\n        commonjs: 'react-dom',\n        amd: 'react-dom',\n      },\n    },\n    {\n      react: {\n        root: 'React',\n        commonjs2: 'react',\n        commonjs: 'react',\n        amd: 'react',\n      },\n    },\n  ],\n  resolve: {\n    extensions: ['.js', '.jsx', '.json'],\n    modules: [\n      'node_modules',\n      path.join(__dirname, 'src'),\n    ],\n  },\n  devtool: 'source-map',\n  entry: './src/index.js',\n  output: {\n    filename: 'react-permissible.js',\n    library: 'react-permissible',\n    libraryTarget: 'umd',\n    path: path.resolve(__dirname, 'lib'),\n    umdNamedDefine: true,\n  },\n  optimization: {\n    minimizer: [\n      new UglifyJsPlugin({\n        sourceMap: false,\n      }),\n    ],\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.jsx?$/,\n        exclude: /node_modules/,\n        use: ['babel-loader'],\n      },\n    ],\n  },\n};\n"
  }
]