All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.HoneybadgerErrorBoundary.FallbackComponent.js Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireWildcard(require("react"));
var _dompurify = require("dompurify");
var _Button = _interopRequireDefault(require("@bigbinary/neetoui/Button"));
var _Typography = _interopRequireDefault(require("@bigbinary/neetoui/Typography"));
var _ramda = require("ramda");
var _reactI18next = require("react-i18next");
var _jsxRuntime = require("react/jsx-runtime");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var FallbackComponentImage = function FallbackComponentImage(props) {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", _objectSpread(_objectSpread({}, props), {}, {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
      d: "M271.071 28.008c-8.563-12.544-25.317-10.81-38.577-10.717-30.899.206-159.103.047-168.105.497-13.866.713-27.79 6.33-30.041 20.132-1.216 7.456-.14 15.427.139 22.94 1.118 30.417 1.953 68.044 5.7 95.148 1.016 7.372 2.35 14.761 6.936 20.853 7.238 9.618 21.581 12.998 33.616 13.2.141.236 110.261 2.828 150.068-.154 11.579-.87 25.682-1.74 33.488-11.652 3.913-4.971 4.246-12.136 5.028-18.171 2.816-21.653 4.695-58.296 7.156-97.59.703-11.222 1.25-24.736-5.408-34.486Zm3.044 27.34c-.082 4.493-3.429 57.629-3.648 60.853-.746 10.901-3.144 45.195-6.244 55.905-3.064 10.571-16.833 13.173-26.189 14.167-7.926.857-15.906 1.35-23.877 1.608-40.911 1.322-129.772 1.044-133.332.949-14.415-.663-30.588-4.888-36.021-19.843a81.026 81.026 0 0 1-3.298-20.918c-2.712-32.616-2.294-42.461-4.372-92.667-.293-7.188-1.76-15.638 1.536-22.356C45.898 18.356 67.727 20.417 81.1 20.27c15.73-.172 149.231-.271 157.495-.338 7.347-.06 15.278-.433 22.12 2.756 12.343 5.744 13.613 20.671 13.399 32.649v.01Z",
      fill: "#2F3941"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
      d: "M220.642 50.4a1.586 1.586 0 0 0-.415-1.21 1.607 1.607 0 0 0-1.177-.52c-35.537-.183-99.035-.669-135.303-.466a1.056 1.056 0 0 0-.76.238 1.044 1.044 0 0 0-.373.699c-.43 34.284-.24 68.58-.24 102.862 0 1.636.685 2.122 1.643 2.162 45.113 2.049 92.2.763 137.476.91a2.342 2.342 0 0 0 1.518-.675c.405-.403.648-.94.68-1.509-.443-33.909-1.227-68.635-3.049-102.49Zm-2.277.78c1.187 24.763 1.712 49.901 2.264 74.806-45.853 1.664-90.202.658-135.787.522 0-24.642-.313-50.868 0-76.093 43.482.375 89.992.537 133.523.764ZM91.463 151.855l16.27-22.423 18.964.294c-3.709 5.108-12.138 17.321-14.959 22.512-6.749-.114-20.275-.383-20.275-.383Zm42.769.671 15.24-22.699c6.347 0 12.699-.04 19.055-.12-3.627 6.705-10.492 16.8-14.739 22.976-6.51-.007-13.028-.059-19.556-.157Zm42.469.228c5.503-8.232 10.238-15.419 16.186-23.434 6.993-.163 13.993-.365 20.998-.605-4.761 6.22-12.597 17.04-15.361 23.986-7.274.037-14.548.054-21.823.053Z",
      fill: "#2F3941"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
      d: "M153.904 69.903c-3.722-.185-22.748 30.824-20.049 34.788 2.493 3.664 37.821 2.965 39.914 0 2.39-3.436-16.031-34.596-19.865-34.788Zm.745 10.224c.19 2.645.576 11.328.205 13.546-.27 1.633-1.778.747-1.796-.113-.065-4.437-.177-8.883-.27-13.32a.957.957 0 0 1 .224-.699.925.925 0 0 1 1.551.221.973.973 0 0 1 .086.365Zm.707 18.984c-.727 2.011-2.791 1.389-2.791-.259-.057-3.119 3.572-1.901 2.791.26v-.001ZM155.392 199.891c1.926 4.35 9.139 2.15 6.621-3.658a3.653 3.653 0 0 0-2.338-2.083 3.669 3.669 0 0 0-3.092.487c-1.534 1.051-2.876 3.875-1.144 5.376a.499.499 0 0 0 .85-.353c.107-1.148-.119-2.371.838-3.231a2.288 2.288 0 0 1 3.549.378 2.661 2.661 0 0 1-.467 3.601 3.032 3.032 0 0 1-4.019-.994c-.313-.517-1.037-.06-.798.477ZM145.571 226.664c3.876.66 7.809.928 11.739.798 4.292.127 8.604.273 12.894.248a1.103 1.103 0 0 0 0-2.204c-4.29-.174-8.602-.186-12.894-.206a57.817 57.817 0 0 0-11.739.39.508.508 0 0 0 0 .974Z",
      fill: "#2F3941"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
      d: "M290.099 17.651a26.343 26.343 0 0 0-14.443-13.727c-8.184-3.209-17.301-2.702-25.923-2.622-36.725.338-187.491.226-197.868.656a46.93 46.93 0 0 0-23.035 6.39c-15.658 9.89-12.084 26.386-11.458 44.885 1.203 35.566 2.12 79.713 6.107 111.322 1.049 8.324 2.204 16.755 6.676 24.05 7.983 13.016 24.148 17.93 39.357 17.867.586 0 34.396.811 73.168 1.099.06 2.045.465 4.305.694 6.462-.845-.102-23.612.467-30.303 1.419a.956.956 0 0 0-.771.893.982.982 0 0 0 .07.415c-3.429 2.898-6.462 6.492-9.588 9.661-3.848 3.879-7.906 7.645-11.5 11.758a.822.822 0 0 0 1.163 1.163c4.026-3.696 7.685-7.846 11.473-11.786 3.151-3.283 6.762-6.462 9.603-10.051a284.168 284.168 0 0 1 30.012-1.086c.02 1.633-.067 3.567 1.553 4.394.249.132.684.04.731-.3.119-2.158.03-4.322-.266-6.463a20.308 20.308 0 0 0-1.205-6.462c9.037.065 18.32.097 27.494.082a22.04 22.04 0 0 0-.498 11.488.589.589 0 0 0 .558.411.583.583 0 0 0 .558-.411c.323-1.081.516-2.196.575-3.323 5.085.679 9.298.204 22.997 1.059 2.081.132 5.048.161 6.8.151a49.891 49.891 0 0 0 9.03 9.507 126.265 126.265 0 0 0 10.551 9.276c.89.671 1.988-.798 1.188-1.541-3.547-3.244-7.275-6.278-10.814-9.542a93.19 93.19 0 0 0-8.62-8.122.687.687 0 0 0-.296-.8 16.466 16.466 0 0 0-6.571-1.034 303.46 303.46 0 0 0-8.896-.433 119.194 119.194 0 0 0-15.245-.532c.139-2.202.522-4.237.539-6.156 26.179-.057 51.28-.512 67.03-1.762 13.367-1.064 29.723-1.842 38.877-13.173 4.737-5.858 5.182-13.963 6.112-21.166 3.929-30.407 5.575-77.387 8.06-112.188.997-13.655 2.17-28.933-3.676-41.728Zm1.613 31.317c-.146 4.2-3.837 64.939-4.225 70.999-.84 12.757-3.594 52.564-7.069 65.039-3.355 12.052-18.191 15.578-28.953 16.886-9.22 1.123-18.553 1.715-27.836 2.028-47.201 1.6-152.146 1.016-154.02.947-17.12-.746-35.33-6.288-41.204-24.174-2.597-7.906-2.91-16.548-3.567-24.799-2.594-32.741-2.42-43.205-4.722-107.053-.313-8.463-1.814-17.863.596-26.12C26.38 3.355 51.897 4.623 67.642 4.416c18.621-.248 177.824-.437 187.33-.497 8.565-.045 17.791.174 25.046 5.349 12.02 8.565 12.159 26.432 11.694 39.692v.008ZM2.113 306.233c1.504-2.13 36.665-41.756 38.413-43.727a10.606 10.606 0 0 1 9.066-3.728c23.95-.139 47.907-.29 71.857.095 44.688.73 142.992-1.775 146.288-1.74 3.231.032 7.399-.711 9.864 1.66 2.352 2.264 26.674 35.343 35.177 44.204 1.322 1.374 3.407-.716 2.093-2.093-8.324-8.682-29.105-36.658-32.5-40.888a17.18 17.18 0 0 0-4.722-5.016c-4.243-2.115-53.46.465-74.499.942-24.904.57-18.499.127-150.918.092-5.858 0-10.004.249-13.864 5.043-4.439 5.52-35.989 42.114-37.403 44.477-.44.751.663 1.365 1.148.679ZM310.594 315.641c2.172-3.694 6.668-9.738 4.511-10.439-3.336-1.064-312.387 1.784-312.387 1.784s-5.946.154-.249 5.456c5.697 5.301 5.965 6.656 16.25 6.258 10.284-.397 262.609-1.203 269.642-1.091 7.034.112 20.856.37 22.233-1.968Z",
      fill: "#2F3941"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
      d: "M34.938 281.227c-2.187 2.709-11.898 12.69-12.29 15.161a1.074 1.074 0 0 0 .471 1.163c1.328.85 41.622 0 50.602-.032 18.968-.08 153.463.745 156.865.79 2.603.032 4.444-.519 3.169-3.435-4.347-9.942-8.664-19.883-13.081-29.795-1.123-2.513-2.02-2.851-4.722-2.839 0 0-161.347 0-166.45-.059a.918.918 0 0 0-.874.921.92.92 0 0 0 .874.92c31.896.311 159.016-.087 167.966.445.724.045-.248-1.638 13.958 30.395.199.445.147 1.242-2.207 1.3-1.633.034-157.686-.624-193.429-.358-1.899 0-9.956.338-9.897-.14.2-1.6 12.619-14.798 23.217-31.038.365-.559-.497-1.016-.875-.512-.02-.007-8.443 11.098-13.297 17.113ZM238.084 290.689a39.103 39.103 0 0 0 3.124 6.895c.746 1.022 1.243 1.009 2.486 1.049 6.929.216 26.206-.664 45.483-.286 1.275.027 6.532.83 6.463-1.243-.102-3.042-9.343-13.789-22.084-33.67-1.454-2.272-2.08-2.411-4.956-2.284-4.702.199-32.4 1.195-41.541 1.491-1.216.04-1.223 1.934 0 1.894 47.176-1.491 43.545-1.605 43.833-1.422.93.592 1.862 2.879 2.458 3.793 1.33 2.021 17.513 26.115 18.981 28.222.878 1.256.02 1.183-1.739 1.149-1.989-.045-45.168.233-46.573.221-1.739-.022-2.589-3.415-3.3-4.931-9.112-19.476-10.563-22.476-13.054-26.54-.392-.638-1.409-.445-1.131.207 4.36 10.205 7.591 16.5 11.55 25.455ZM285.242 112.053v.445c0 .04.067.04.067 0 0-.147 0-.298.02-.445-.002-.047-.087-.052-.087 0ZM91.163 240.165s131.381-1.695 132.656-1.416c1.275.278-.313 8.776-4.226 8.751-3.912-.025-121.276.922-123.175.171-1.9-.75-7.28-7.478-5.255-7.506Z",
      fill: "#2F3941"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
      d: "M45.82 293.676a.023.023 0 0 0 .014-.01.025.025 0 0 0 .005-.016.027.027 0 0 0-.019-.026.027.027 0 0 0-.014.042.023.023 0 0 0 .014.01ZM220.834 284.323c-2.237-.034-6-.062-10.973-.082-1.198-2.995.522 1.459-4.325-10.759 4.354 0 7.692 0 9.735.025a.767.767 0 0 0 .545-.226.767.767 0 0 0 0-1.09.77.77 0 0 0-.545-.225c-2.09-.03-5.666-.057-10.376-.077-1.134-2.734-1.506-3.154-2.411-3.637a.552.552 0 0 0-.798.319c-.291.832-.328 1.339.355 3.308-8.714-.03-20.504-.047-33.677-.05a23.38 23.38 0 0 0-2.021-4.446.51.51 0 0 0-.566-.224.509.509 0 0 0-.383.472c.033 1.409.199 2.811.497 4.188-11.212 0-23.326 0-35.336.027a706.988 706.988 0 0 0-.186-3.171.582.582 0 0 0-1.161 0 442.255 442.255 0 0 0-.313 3.174c-12.514.017-24.854.045-35.902.079a6.379 6.379 0 0 0-.378-2.835c-.107-.266-.457-.443-.676-.187a6.309 6.309 0 0 0-1.322 3.03c-12.572.042-23.276.094-30.335.154a18.732 18.732 0 0 0 1.8-3.577c.372-1.061-1.22-2.03-1.954-1.128-1.223 1.511-2.374 3.112-3.495 4.742-2.634.03-4.386.062-5.067.095a.503.503 0 0 0-.357.861.503.503 0 0 0 .357.148c1.155.087 2.55.164 4.158.236-5.903 8.771-5.418 7.829-7.526 11.008-3.607.032-5.985.067-6.83.104a.503.503 0 0 0-.505.505.505.505 0 0 0 .505.504c1.39.1 3.4.184 5.94.249a48.466 48.466 0 0 0-3.343 6.094.431.431 0 0 0 .746.433c1.491-2.168 3.149-4.337 4.859-6.462 8.45.191 21.417.268 36.556.28a22.934 22.934 0 0 0-1.295 5.891c-.048.723.89.823 1.242.338a22.61 22.61 0 0 0 2.963-6.214c12.082 0 25.401-.03 38.835-.079a13.904 13.904 0 0 0 .698 6.238.857.857 0 0 0 .746.429.857.857 0 0 0 .746-.429 13.875 13.875 0 0 0 .952-6.251c13.227-.052 26.474-.116 38.666-.171a25.556 25.556 0 0 0 2.281 5.572.781.781 0 0 0 1.442-.392 24.472 24.472 0 0 0-.816-5.193c13.586-.062 25.705-.111 34.797-.114a27.226 27.226 0 0 0 3.362 6.462c.353.47 1.362.41 1.283-.345a25.886 25.886 0 0 0-1.554-6.119c4.439 0 7.974.022 10.37.059a.761.761 0 0 0 .543-.229.766.766 0 0 0 .222-.546.77.77 0 0 0-.775-.766Zm-170.101.139c3.142-3.859 6.303-7.563 8.562-10.853 7.58.248 18.36.358 30.772.4a97.23 97.23 0 0 1-3.278 10.287c-15.024.045-27.84.102-36.056.166Zm38.892-.173c2.341-7.884 2.585-7.954 3.072-10.273 11.167.028 23.527 0 35.999-.057-.562 6.246-.38 6.529-.691 10.247-13.287.02-26.457.048-38.38.083Zm41.303-.087c-.144-3.319.03-4.226-.263-10.253 12.178-.057 24.392-.142 35.668-.221.621 2.423-.107-.639 2.838 10.439-12.059.01-25.167.017-38.243.035Zm41.164-.023c-.072-.248-3.022-10.14-3.122-10.471 13.235-.094 25.019-.181 33.668-.216 1.941 5.087 1.325 3.139 4.136 10.737-9.003-.032-21.099-.047-34.682-.05ZM281.202 286.259c-1.339-.479-2.53-.671-8.326-.591a140.94 140.94 0 0 0-7.491-12.89 25.902 25.902 0 0 0 7.379-.656.778.778 0 0 0 .398-1.209.778.778 0 0 0-.398-.282c-2.98-.66-6.05-.813-9.081-.452a201.697 201.697 0 0 0-2.486-3.634.674.674 0 0 0-1.163.679l1.695 3.022c-4.143.151-10.849.437-15.243.636a24.566 24.566 0 0 0-3.679-4.576.437.437 0 0 0-.251-.114.444.444 0 0 0-.479.539 25.034 25.034 0 0 0 1.613 4.28 45.342 45.342 0 0 0-8.833.763.515.515 0 0 0-.365.489.511.511 0 0 0 .365.488c3.286.677 6.655.86 9.996.542 1.327 2.443 2.833 4.824 4.079 7.126 1.006 1.854 1.953 3.842 2.965 5.798a40.865 40.865 0 0 0-9.527.716.499.499 0 0 0-.405.488.496.496 0 0 0 .405.489c3.549.665 7.169.868 10.769.604a28.675 28.675 0 0 0 3.542 5.078c.37.412.962-.035.868-.498a23.462 23.462 0 0 0-1.452-4.583 1830.64 1830.64 0 0 0 15.658-.134 30.665 30.665 0 0 0 2.662 4.012c.378.497 1.283.248 1.076-.45a29.948 29.948 0 0 0-1.337-3.587 23.018 23.018 0 0 0 7.071-.599.775.775 0 0 0 .542-.756.78.78 0 0 0-.567-.738Zm-26.223-.126c-1.213-2.414-2.63-4.75-3.865-6.989-1.029-1.859-2.068-3.91-3.211-5.911 3.728-.082 8.656-.218 15.263-.4 3.599 6.462 5.696 10.337 7.091 12.882-3.291.047-6.51.157-15.278.408v.01Z",
      fill: "#2F3941"
    })]
  }));
};
FallbackComponentImage.defaultProps = {
  width: "230",
  height: "230",
  viewBox: "0 0 317 320",
  fill: "none",
  "'data-testid'": "fallback-svg",
  xmlns: "http://www.w3.org/2000/svg"
};
var FallbackComponent = function FallbackComponent() {
  var _useTranslation = (0, _reactI18next.useTranslation)(),
    t = _useTranslation.t;
  (0, _react.useEffect)(function () {
    var listener = function listener(e) {
      var _e$target;
      if ((0, _ramda.isNil)(e.state)) return;
      window.location.href = (0, _dompurify.sanitize)((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.location.href);
    };
    window.addEventListener("popstate", listener);
    return function () {
      return window.removeEventListener("popstate", listener);
    };
  }, []);
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "flex h-screen w-full flex-row items-start justify-start",
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "m-auto text-center",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "m-auto mb-8 flex items-center justify-center",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(FallbackComponentImage, {})
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography["default"], {
        className: "mb-4",
        component: "h2",
        style: "h2",
        weight: "semibold",
        children: t("neetoCommons.fallbackComponent.somethingWentWrong")
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography["default"], {
        className: "neeto-ui-text-gray-600 mb-8",
        component: "p",
        style: "body1",
        weight: "normal",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactI18next.Trans, {
          i18nKey: "neetoCommons.fallbackComponent.description",
          components: {
            reloading: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
              style: "link",
              onClick: function onClick() {
                return window.location.reload();
              }
            }),
            contactus: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
              style: "link",
              onClick: function onClick() {
                var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
                (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
                (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
              }
            })
          }
        })
      })]
    })
  });
};
var _default = exports["default"] = FallbackComponent;
//# sourceMappingURL=FallbackComponent.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy