@bigbinary/neeto-molecules 5.3.18 → 5.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls-DtjJggEY.js","sources":["../../src/utils/urls.js"],"sourcesContent":["import { isPresent } from \"neetocist\";\nimport { toLower } from \"ramda\";\n\nexport const getNeetoUrl = subdomain =>\n `https://${subdomain}.${toLower(globalProps?.appName || \"\")}.com`;\n\nexport const getProductBillingUrl = () => {\n const billingOverviewUrl = `${globalProps.organization?.authAppUrl}/admin/billing/overview`;\n const productSlug = toLower(globalProps.appName || \"\");\n\n return isPresent(productSlug)\n ? `${billingOverviewUrl}/products/${productSlug}`\n : billingOverviewUrl;\n};\n"],"names":["getNeetoUrl","subdomain","_globalProps","concat","toLower","globalProps","appName","getProductBillingUrl","_globalProps$organiza","billingOverviewUrl","organization","authAppUrl","productSlug","isPresent"],"mappings":";;;;;IAGaA,WAAW,GAAG,SAAdA,WAAWA,CAAGC,SAAS,EAAA;AAAA,EAAA,IAAAC,YAAA;EAAA,OAAA,UAAA,CAAAC,MAAA,CACvBF,SAAS,EAAA,GAAA,CAAA,CAAAE,MAAA,CAAIC,aAAO,CAAC,CAAA,CAAAF,YAAA,GAAAG,WAAW,MAAA,IAAA,IAAAH,YAAA,KAAA,MAAA,GAAA,MAAA,GAAXA,YAAA,CAAaI,OAAO,KAAI,EAAE,CAAC,EAAA,MAAA,CAAA;AAAA;IAEhDC,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAS;AAAA,EAAA,IAAAC,qBAAA;AACxC,EAAA,IAAMC,kBAAkB,GAAA,EAAA,CAAAN,MAAA,CAAA,CAAAK,qBAAA,GAAMH,WAAW,CAACK,YAAY,cAAAF,qBAAA,KAAA,MAAA,GAAA,MAAA,GAAxBA,qBAAA,CAA0BG,UAAU,EAAA,yBAAA,CAAyB;EAC3F,IAAMC,WAAW,GAAGR,aAAO,CAACC,WAAW,CAACC,OAAO,IAAI,EAAE,CAAC;AAEtD,EAAA,OAAOO,mBAAS,CAACD,WAAW,CAAC,GAAA,EAAA,CAAAT,MAAA,CACtBM,kBAAkB,EAAA,YAAA,CAAA,CAAAN,MAAA,CAAaS,WAAW,IAC7CH,kBAAkB;AACxB;;;;;"}
@@ -23,8 +23,8 @@ var jsxRuntime = require('react/jsx-runtime');
23
23
  var reactQuery = require('@tanstack/react-query');
24
24
  var axios = require('axios');
25
25
  var search = require('../search-DoXqXFel.js');
26
+ var urls = require('../urls-DtjJggEY.js');
26
27
  var useBreakpoints = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints');
27
- var urls = require('../urls-CC4qs7hW.js');
28
28
  var i18next = require('i18next');
29
29
  var createLucideIcon = require('../createLucideIcon-BbuuRL2u.js');
30
30
  var circleQuestionMark = require('../circle-question-mark-BijjM_4y.js');
@@ -1354,29 +1354,30 @@ var ProfileMenu = function ProfileMenu(_ref) {
1354
1354
  var isAuthenticated = profileInfo.isAuthenticated;
1355
1355
  var _useTranslation = reactI18next.useTranslation(),
1356
1356
  t = _useTranslation.t;
1357
- var normalizedPlan = (((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.subscriptionPlan) || "").toLowerCase();
1358
- var isFreePlan = normalizedPlan === "free";
1357
+
1358
+ // A paid plan can be named more than one thing, so the badge follows the
1359
+ // isPro flag the backend sends alongside the plan; the plan name is display
1360
+ // text only.
1361
+ var isPro = Boolean((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.isPro);
1359
1362
  var isOwner = (_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.isOwner;
1360
- var showUpgradeModal = isFreePlan && enableSubscriptionUpgradeRequest && !isOwner;
1363
+ var showUpgradeModal = !isPro && enableSubscriptionUpgradeRequest && !isOwner;
1361
1364
  var getSubscriptionPlanAction = function getSubscriptionPlanAction() {
1362
1365
  if (showUpgradeModal) return {
1363
1366
  onClick: openUpgradeModal
1364
1367
  };
1365
- if (isFreePlan && isOwner && enableSubscriptionUpgradeRequest) {
1366
- var _globalProps$organiza;
1368
+ if (!isPro && isOwner && enableSubscriptionUpgradeRequest) {
1367
1369
  return {
1368
- href: "".concat((_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.authAppUrl, "/admin/billing/overview")
1370
+ href: urls.getProductBillingUrl()
1369
1371
  };
1370
1372
  }
1371
1373
  return {
1372
1374
  href: NEETO_AUTH_BILLING_INFO_URL
1373
1375
  };
1374
1376
  };
1375
- var isProPlan = normalizedPlan === "pro";
1376
1377
  var subscriptionPlanLink = _objectSpread$2({
1377
1378
  label: /*#__PURE__*/jsxRuntime.jsxs("span", {
1378
1379
  className: "flex items-center gap-2",
1379
- children: [globalProps.appName, isProPlan ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
1380
+ children: [globalProps.appName, isPro ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
1380
1381
  label: neetoCist.humanize((_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.subscriptionPlan),
1381
1382
  style: {
1382
1383
  "--accent-foreground": "var(--color-amber-950)"