@streamoid/settings 0.3.2 → 0.3.4

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.
package/dist/index.js CHANGED
@@ -3394,6 +3394,90 @@ var import_react8 = require("react");
3394
3394
  var import_ui5 = require("@streamoid/ui");
3395
3395
  var import_icons5 = require("@streamoid/icons");
3396
3396
 
3397
+ // src/plan-comparison-data.ts
3398
+ var PLAN_COMPARISON_COLUMNS = ["Free", "Pro", "Enterprise"];
3399
+ var PLAN_COMPARISON_NOTE = "Credits roll over monthly and only expire if your plan is no longer active";
3400
+ var PLAN_COMPARISON_SECTIONS = [
3401
+ {
3402
+ rows: [{ label: "Usage volume", values: ["Limited", "Higher limits", "Unlimited"] }]
3403
+ },
3404
+ {
3405
+ header: "Artifax (Design & Insights)",
3406
+ rows: [
3407
+ { label: "Priority processing", values: ["Low", "Medium", "High"] },
3408
+ { label: "Tracked Brands", values: ["3 brands included", "5 brands included", "Unlimited"] },
3409
+ { label: "Custom brand scraping", values: ["-", "Included", "Included"] },
3410
+ { label: "Tracked news terms", values: ["-", "Up to 5 news terms", "Unlimited"] },
3411
+ { label: "Pattern, design & graphic generation", values: ["Up to 60 images", "Up to 200 images", "Unlimited"] },
3412
+ { label: "Vectorization & colorways", values: ["Up to 60 images", "Up to 200 images", "Unlimited"] },
3413
+ { label: "Background removal", values: ["Up to 300 images", "Up to 1,000 images", "Unlimited"] },
3414
+ { label: "Range planning", values: ["Up to 3 plans", "Up to 10 plans", "Unlimited"] },
3415
+ { label: "Tech packs", values: ["Manual fill", "Up to 5 tech packs", "Unlimited"] },
3416
+ { label: "Automated moodboards", values: ["Up to 20 moodboards", "Up to 66 moodboards", "Unlimited"] },
3417
+ { label: "Export & download vector assets", values: ["Free", "Free", "Free"] }
3418
+ ]
3419
+ },
3420
+ {
3421
+ header: "Photogenix (Imagery & Video)",
3422
+ rows: [
3423
+ { label: "Priority processing", values: ["Low", "Medium", "High"] },
3424
+ { label: "Image generation", values: ["Up to 60 images", "Up to 200 images", "Unlimited"] },
3425
+ { label: "Image watermarks", values: ["Watermarked", "No watermark", "No watermark"] },
3426
+ { label: "Image editing", values: ["Up to 300 edits", "Up to 1,000 edits", "Unlimited"] },
3427
+ { label: "Video generation from image", values: ["Up to 20 videos", "Up to 66 videos", "Unlimited"] },
3428
+ { label: "Video with background changes", values: ["Up to 15 videos", "Up to 50 videos", "Unlimited"] },
3429
+ { label: "Video Advertisement generation", values: ["-", "Included", "Included"] },
3430
+ { label: "Automated shoot configuration", values: ["Up to 300 products", "Up to 1,000 products", "Unlimited"] },
3431
+ { label: "UGC content creation", values: ["Up to 15 outputs", "Up to 50 outputs", "Unlimited"] },
3432
+ { label: "Marketplace exports", values: ["Up to 300 exports", "Up to 1,000 exports", "Unlimited"] }
3433
+ ]
3434
+ },
3435
+ {
3436
+ header: "Catalogix (Cataloging & Listing)",
3437
+ rows: [
3438
+ { label: "Priority processing", values: ["Low", "Medium", "High"] },
3439
+ { label: "Data import & mapping", values: ["Free", "Free", "Free"] },
3440
+ { label: "Attributes from images (express)", values: ["Up to 100 styles", "Up to 333 styles", "Unlimited"] },
3441
+ { label: "Attributes from images (precise)", values: ["Up to 42 styles", "Up to 142 styles", "Unlimited"] },
3442
+ // Blank-label sub-row per the design export (values present, no label).
3443
+ { label: "", values: ["Up to 100 styles", "Up to 333 styles", "Unlimited"] },
3444
+ { label: "Background removal", values: ["Up to 60 styles", "Up to 200 styles", "Unlimited"] },
3445
+ { label: "Identify image type (pose)", values: ["Up to 100 styles", "Up to 333 styles", "Unlimited"] },
3446
+ { label: "Extra images (detail shots)", values: ["Up to 150 styles", "Up to 500 styles", "Unlimited"] },
3447
+ // Blank-label sub-row per the design export.
3448
+ { label: "", values: ["Up to 150 styles", "Up to 500 styles", "Unlimited"] },
3449
+ { label: "Product titles & descriptions", values: ["Up to 150 styles", "Up to 500 styles", "Unlimited"] },
3450
+ { label: "SEO content", values: ["Up to 150 styles", "Up to 500 styles", "Unlimited"] },
3451
+ { label: "Size charts", values: ["Up to 150 styles", "Up to 500 styles", "Unlimited"] },
3452
+ { label: "Translation (data & images)", values: ["Up to 100 styles", "Up to 333 styles", "Unlimited"] },
3453
+ { label: "Automated quality checks", values: ["Up to 150 styles", "Up to 500 styles", "Unlimited"] }
3454
+ ]
3455
+ },
3456
+ {
3457
+ header: "Security & Compliance",
3458
+ rows: [
3459
+ { label: "SSO / SAML", values: ["-", "-", "Included"] },
3460
+ { label: "Role-based access control", values: ["-", "-", "Included"] },
3461
+ { label: "Audit logs", values: ["-", "-", "Included"] },
3462
+ { label: "Data residency / region controls", values: ["-", "-", "Included"] },
3463
+ { label: "Custom data retention & DPA", values: ["-", "-", "Included"] }
3464
+ ]
3465
+ },
3466
+ {
3467
+ header: "Support",
3468
+ rows: [
3469
+ { label: "Support level", values: ["Community / docs", "Standard support", "Dedicated support + customer success manager"] },
3470
+ { label: "SLA", values: ["-", "-", "Custom SLA"] },
3471
+ { label: "Onboarding", values: ["Self-serve", "Self-serve", "Guided onboarding & training"] }
3472
+ ]
3473
+ }
3474
+ ];
3475
+ var PLAN_TAGLINES = {
3476
+ free: "Try the AI agents and automate your first workflows",
3477
+ pro: "Scale your team's output and get to market faster",
3478
+ enterprise: "For high-volume brands, agencies, and marketplaces that need custom scale, integrations, and support"
3479
+ };
3480
+
3397
3481
  // src/export-date-modal.tsx
3398
3482
  var import_react6 = require("react");
3399
3483
  var import_icons3 = require("@streamoid/icons");
@@ -4235,232 +4319,6 @@ function getCurrencySymbolByCountry(country) {
4235
4319
  function formatCredits(n) {
4236
4320
  return n.toLocaleString("en-US");
4237
4321
  }
4238
- var SECTION_ICON_PROPS = {
4239
- color: "var(--alias-text---icons-tertiary)",
4240
- size: 24,
4241
- strokeWidth: 1.5
4242
- };
4243
- var PLAN_FEATURES_BY_AMOUNT = {
4244
- // Free — 300 credits
4245
- 0: [
4246
- {
4247
- section: "Artifax",
4248
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4249
- features: [
4250
- "Generate up to 60 images",
4251
- "Fill techpacks manually",
4252
- "Monitor up to 3 essential brands"
4253
- ]
4254
- },
4255
- {
4256
- section: "Photogenix",
4257
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4258
- features: [
4259
- "Generate up to 60 images",
4260
- "Generate up to 18 videos (8s)",
4261
- "Retouch up to 300 images"
4262
- ]
4263
- },
4264
- {
4265
- section: "Catalogix",
4266
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4267
- features: [
4268
- "Upload 50 products per store",
4269
- "Catalog up to 75 products",
4270
- "List up to 30 template files"
4271
- ]
4272
- }
4273
- ],
4274
- // PRO $49.99 — 1,000 credits
4275
- 4999: [
4276
- {
4277
- section: "Artifax",
4278
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4279
- features: [
4280
- "Generate up to 200 images",
4281
- "Autofill up to 5 techpacks",
4282
- "Monitor up to 10 custom brands"
4283
- ]
4284
- },
4285
- {
4286
- section: "Photogenix",
4287
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4288
- features: [
4289
- "Generate up to 200 images",
4290
- "Generate up to 60 videos (8s)",
4291
- "Retouch up to 1,000 images"
4292
- ]
4293
- },
4294
- {
4295
- section: "Catalogix",
4296
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4297
- features: [
4298
- "Upload 100k products per store",
4299
- "Catalog up to 250 products",
4300
- "List up to 100 template files"
4301
- ]
4302
- }
4303
- ],
4304
- // PRO $149.99 — 3,000 credits
4305
- 14999: [
4306
- {
4307
- section: "Artifax",
4308
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4309
- features: [
4310
- "Generate up to 600 images",
4311
- "Autofill up to 15 techpacks",
4312
- "Monitor up to 30 custom brands"
4313
- ]
4314
- },
4315
- {
4316
- section: "Photogenix",
4317
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4318
- features: [
4319
- "Generate up to 600 images",
4320
- "Generate up to 180 videos (8s)",
4321
- "Retouch up to 3,000 images"
4322
- ]
4323
- },
4324
- {
4325
- section: "Catalogix",
4326
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4327
- features: [
4328
- "Upload 100k products per store",
4329
- "Catalog up to 750 products",
4330
- "List up to 300 template files"
4331
- ]
4332
- }
4333
- ],
4334
- // PRO $349.99 — 8,000 credits
4335
- 34999: [
4336
- {
4337
- section: "Artifax",
4338
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4339
- features: [
4340
- "Generate up to 1,600 images",
4341
- "Autofill up to 40 techpacks",
4342
- "Monitor up to 80 custom brands"
4343
- ]
4344
- },
4345
- {
4346
- section: "Photogenix",
4347
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4348
- features: [
4349
- "Generate up to 1,600 images",
4350
- "Generate up to 480 videos (8s)",
4351
- "Retouch up to 8,000 images"
4352
- ]
4353
- },
4354
- {
4355
- section: "Catalogix",
4356
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4357
- features: [
4358
- "Upload 100k products per store",
4359
- "Catalog up to 2,000 products",
4360
- "List up to 800 template files"
4361
- ]
4362
- }
4363
- ],
4364
- // PRO $549.99 — 15,000 credits
4365
- 54999: [
4366
- {
4367
- section: "Artifax",
4368
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4369
- features: [
4370
- "Generate up to 3,000 images",
4371
- "Autofill up to 75 techpacks",
4372
- "Monitor up to 150 custom brands"
4373
- ]
4374
- },
4375
- {
4376
- section: "Photogenix",
4377
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4378
- features: [
4379
- "Generate up to 3,000 images",
4380
- "Generate up to 900 videos (8s)",
4381
- "Retouch up to 15,000 images"
4382
- ]
4383
- },
4384
- {
4385
- section: "Catalogix",
4386
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4387
- features: [
4388
- "Upload 100k products per store",
4389
- "Catalog up to 3,750 products",
4390
- "List up to 1,500 template files"
4391
- ]
4392
- }
4393
- ],
4394
- // PRO $1,049.99 — 30,000 credits
4395
- 104999: [
4396
- {
4397
- section: "Artifax",
4398
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4399
- features: [
4400
- "Generate up to 6,000 images",
4401
- "Autofill up to 150 techpacks",
4402
- "Monitor up to 300 custom brands"
4403
- ]
4404
- },
4405
- {
4406
- section: "Photogenix",
4407
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4408
- features: [
4409
- "Generate up to 6,000 images",
4410
- "Generate up to 1,800 videos (8s)",
4411
- "Retouch up to 30,000 images"
4412
- ]
4413
- },
4414
- {
4415
- section: "Catalogix",
4416
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4417
- features: [
4418
- "Upload 100k products per store",
4419
- "Catalog up to 7,500 products",
4420
- "List up to 3,000 template files"
4421
- ]
4422
- }
4423
- ]
4424
- };
4425
- var ENTERPRISE_FEATURES = [
4426
- {
4427
- section: "Artifax",
4428
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconArtifacts, { ...SECTION_ICON_PROPS }),
4429
- features: [
4430
- "Custom image generations",
4431
- "Custom techpack autofilled",
4432
- "Custom number of brands"
4433
- ]
4434
- },
4435
- {
4436
- section: "Photogenix",
4437
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconPhotogenix, { ...SECTION_ICON_PROPS }),
4438
- features: [
4439
- "Custom image generations",
4440
- "Custom video generations",
4441
- "Custom image retouches"
4442
- ]
4443
- },
4444
- {
4445
- section: "Catalogix",
4446
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconCatalogix, { ...SECTION_ICON_PROPS }),
4447
- features: [
4448
- "Custom product uploads",
4449
- "Custom product cataloging",
4450
- "Custom template file listings"
4451
- ]
4452
- }
4453
- ];
4454
- function getPlanFeatures(amount) {
4455
- if (PLAN_FEATURES_BY_AMOUNT[amount]) return PLAN_FEATURES_BY_AMOUNT[amount];
4456
- const tiers = Object.keys(PLAN_FEATURES_BY_AMOUNT).map(Number).sort((a, b) => a - b);
4457
- let best = tiers[0];
4458
- for (const t of tiers) {
4459
- if (t <= amount) best = t;
4460
- else break;
4461
- }
4462
- return PLAN_FEATURES_BY_AMOUNT[best] ?? [];
4463
- }
4464
4322
  function formatNextBillingDateLabel(iso) {
4465
4323
  if (iso) {
4466
4324
  const parsed = new Date(iso);
@@ -4480,6 +4338,16 @@ function formatNextBillingDateLabel(iso) {
4480
4338
  year: "numeric"
4481
4339
  });
4482
4340
  }
4341
+ function formatEffectiveDateLabel(value) {
4342
+ if (value == null) return "";
4343
+ const parsed = typeof value === "number" ? new Date(value < 1e10 ? value * 1e3 : value) : new Date(value);
4344
+ if (Number.isNaN(parsed.getTime())) return "";
4345
+ return parsed.toLocaleDateString("en-US", {
4346
+ month: "short",
4347
+ day: "numeric",
4348
+ year: "numeric"
4349
+ });
4350
+ }
4483
4351
  function UpdateSubscriptionModal({
4484
4352
  open,
4485
4353
  currentPlanName,
@@ -4785,8 +4653,10 @@ function UpdateSubscriptionModal({
4785
4653
  }
4786
4654
  );
4787
4655
  }
4656
+ var stripMonthly = (price) => price.replace(/\s*\/\s*month\s*$/i, "");
4788
4657
  function PlansView({
4789
4658
  onBack,
4659
+ hideHeader,
4790
4660
  products,
4791
4661
  currentPlanId,
4792
4662
  currentPlanEndDate,
@@ -4884,80 +4754,42 @@ function PlansView({
4884
4754
  backgroundSize: "24px 24px"
4885
4755
  },
4886
4756
  children: [
4887
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4757
+ !hideHeader && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4888
4758
  "div",
4889
4759
  {
4890
- className: "flex items-center shrink-0 w-full",
4760
+ className: "flex items-center justify-end shrink-0 w-full",
4891
4761
  style: { gap: "var(--spacing-lg)" },
4892
- children: [
4893
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4894
- "div",
4895
- {
4896
- className: "flex flex-col",
4897
- style: { gap: "var(--spacing-xs)", flex: 1, minWidth: 0 },
4898
- children: [
4899
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4900
- "p",
4901
- {
4902
- className: "min-w-0 truncate",
4903
- style: {
4904
- fontFamily: "var(--font-family-font-family-display)",
4905
- fontSize: "var(--font-size-font-size-xxl)",
4906
- fontWeight: 700,
4907
- lineHeight: "var(--line-height-line-height-xxl)",
4908
- color: "var(--alias-text---icons-primary)"
4909
- },
4910
- children: "Upgrade Plans"
4911
- }
4912
- ),
4913
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4914
- "p",
4915
- {
4916
- style: {
4917
- fontFamily: "var(--font-family-font-family-body)",
4918
- fontSize: "var(--font-size-font-size-sm)",
4919
- fontWeight: 400,
4920
- lineHeight: "var(--line-height-line-height-sm)",
4921
- color: "var(--alias-text---icons-muted)"
4922
- },
4923
- children: "Pick a plan based on your monthly usage and credit needs."
4924
- }
4925
- )
4926
- ]
4927
- }
4928
- ),
4929
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4930
- "div",
4931
- {
4932
- className: "flex items-center shrink-0 cursor-pointer",
4933
- style: {
4934
- gap: "var(--spacing-sm)",
4935
- padding: "var(--spacing-xs) var(--spacing-lg)",
4936
- borderRadius: "var(--radius-xl)",
4937
- height: 32,
4938
- border: "1px solid var(--alias-border-subtle)",
4939
- backgroundColor: "var(--alias-surface-base)"
4940
- },
4941
- onClick: onBack,
4942
- children: [
4943
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconLeft, { className: "w-4 h-4", color: MUTED_COLOR }),
4944
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4945
- "span",
4946
- {
4947
- style: {
4948
- fontFamily: "var(--font-family-font-family-body)",
4949
- fontSize: "var(--font-size-font-size-sm)",
4950
- fontWeight: 500,
4951
- lineHeight: "var(--line-height-line-height-sm)",
4952
- color: "var(--alias-text---icons-muted)"
4953
- },
4954
- children: "Back to billing"
4955
- }
4956
- )
4957
- ]
4958
- }
4959
- )
4960
- ]
4762
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4763
+ "div",
4764
+ {
4765
+ className: "flex items-center shrink-0 cursor-pointer",
4766
+ style: {
4767
+ gap: "var(--spacing-sm)",
4768
+ padding: "var(--spacing-xs) var(--spacing-lg)",
4769
+ borderRadius: "var(--radius-xl)",
4770
+ height: 32,
4771
+ border: "1px solid var(--alias-border-subtle)",
4772
+ backgroundColor: "var(--alias-surface-base)"
4773
+ },
4774
+ onClick: onBack,
4775
+ children: [
4776
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons5.SiconLeft, { className: "w-4 h-4", color: MUTED_COLOR }),
4777
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4778
+ "span",
4779
+ {
4780
+ style: {
4781
+ fontFamily: "var(--font-family-font-family-body)",
4782
+ fontSize: "var(--font-size-font-size-sm)",
4783
+ fontWeight: 500,
4784
+ lineHeight: "var(--line-height-line-height-sm)",
4785
+ color: "var(--alias-text---icons-muted)"
4786
+ },
4787
+ children: "Back to billing"
4788
+ }
4789
+ )
4790
+ ]
4791
+ }
4792
+ )
4961
4793
  }
4962
4794
  ),
4963
4795
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
@@ -4970,10 +4802,10 @@ function PlansView({
4970
4802
  import_ui5.ScPlanCard,
4971
4803
  {
4972
4804
  planName: freePlan?.planName || "Free",
4973
- price: freePlan?.price || `${workspaceCurrencySymbol}0`,
4805
+ price: stripMonthly(freePlan?.price || `${workspaceCurrencySymbol}0`),
4974
4806
  credits: freePlan?.credits || "3,000 credits",
4975
4807
  type: "free",
4976
- features: getPlanFeatures(freePlan?.amount ?? 0),
4808
+ tagline: PLAN_TAGLINES.free,
4977
4809
  buttonText: isFreeActionLoading ? "Processing..." : freePlan?.isCurrent ? "Current plan" : "Downgrade to free",
4978
4810
  buttonState: freePlan?.isCurrent || isFreeActionLoading ? "disabled" : "default",
4979
4811
  buttonVariant: "secondary",
@@ -5000,12 +4832,10 @@ function PlansView({
5000
4832
  import_ui5.ScPlanCard,
5001
4833
  {
5002
4834
  planName: "Pro",
5003
- price: selectedMiddlePlan?.price || "\u2014",
4835
+ price: stripMonthly(selectedMiddlePlan?.price || "\u2014"),
5004
4836
  credits: selectedMiddlePlan?.credits || "\u2014",
5005
4837
  type: "popular",
5006
- features: getPlanFeatures(
5007
- selectedMiddlePlan?.amount ?? middlePlans[0]?.amount ?? 4999
5008
- ),
4838
+ tagline: PLAN_TAGLINES.pro,
5009
4839
  buttonText: isMiddleActionLoading ? "Processing..." : !selectedMiddlePlan ? "Select a plan" : selectedMiddlePlan.isCurrent ? "Current plan" : selectedMiddlePlan.amount > currentPlanAmount ? "Upgrade" : "Downgrade",
5010
4840
  buttonState: selectedMiddlePlan?.isCurrent || isMiddleActionLoading || !selectedMiddlePlan ? "disabled" : "default",
5011
4841
  buttonVariant: selectedMiddlePlan?.isCurrent ? "outline" : selectedMiddlePlan && selectedMiddlePlan.amount > currentPlanAmount ? "primary" : "secondary",
@@ -5096,12 +4926,8 @@ function PlansView({
5096
4926
  {
5097
4927
  planName: "Enterprise",
5098
4928
  type: "custom",
5099
- description: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5100
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { marginBottom: 0 }, children: "The Enterprise plan is for teams operating at scale." }),
5101
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
5102
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { marginBottom: 0 }, children: "Get expanded capacity, flexible usage options, and dedicated support to manage large production volumes and complex catalogs with confidence." })
5103
- ] }),
5104
- buttonText: "Contact us",
4929
+ tagline: PLAN_TAGLINES.enterprise,
4930
+ buttonText: "Contact Sales",
5105
4931
  buttonVariant: "secondary",
5106
4932
  onUpgrade: () => {
5107
4933
  window.open("https://cal.com/streamoid/30min", "_blank");
@@ -5113,17 +4939,13 @@ function PlansView({
5113
4939
  }
5114
4940
  ),
5115
4941
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5116
- "p",
4942
+ import_ui5.ScPlanComparison,
5117
4943
  {
5118
- className: "w-full text-center",
5119
- style: {
5120
- fontFamily: "var(--font-family-font-family-body)",
5121
- fontSize: "var(--font-size-font-size-sm)",
5122
- fontWeight: 400,
5123
- lineHeight: "var(--line-height-line-height-sm)",
5124
- color: "var(--alias-text---icons-muted)"
5125
- },
5126
- children: "Credits expire monthly"
4944
+ layout: "table",
4945
+ columns: [...PLAN_COMPARISON_COLUMNS],
4946
+ note: PLAN_COMPARISON_NOTE,
4947
+ sections: PLAN_COMPARISON_SECTIONS,
4948
+ highlightColumnIndex: 1
5127
4949
  }
5128
4950
  ),
5129
4951
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
@@ -5513,7 +5335,9 @@ function UsageLogsTable({
5513
5335
  );
5514
5336
  }
5515
5337
  function BillingContent({
5516
- embedded = false
5338
+ embedded = false,
5339
+ showPlans: showPlansProp,
5340
+ onShowPlansChange
5517
5341
  } = {}) {
5518
5342
  const { auth, workspace, api, toast, navigation } = useSettingsAdapters();
5519
5343
  const user = auth.user;
@@ -5526,14 +5350,19 @@ function BillingContent({
5526
5350
  return `${window.location.origin}${window.location.pathname}`;
5527
5351
  };
5528
5352
  const [activeTab, setActiveTab] = (0, import_react8.useState)("invoice");
5529
- const [showPlans, setShowPlans] = (0, import_react8.useState)(false);
5353
+ const [showPlansInternal, setShowPlansInternal] = (0, import_react8.useState)(false);
5354
+ const showPlans = showPlansProp ?? showPlansInternal;
5355
+ const setShowPlans = (next) => {
5356
+ if (onShowPlansChange) onShowPlansChange(next);
5357
+ else setShowPlansInternal(next);
5358
+ };
5530
5359
  const [showExportModal, setShowExportModal] = (0, import_react8.useState)(false);
5531
5360
  const [showBuyCreditsModal, setShowBuyCreditsModal] = (0, import_react8.useState)(false);
5532
5361
  const [subscription, setSubscription] = (0, import_react8.useState)(null);
5533
5362
  const [availableCredits, setAvailableCredits] = (0, import_react8.useState)(null);
5534
5363
  const [products, setProducts] = (0, import_react8.useState)([]);
5535
5364
  const [invoices, setInvoices] = (0, import_react8.useState)([]);
5536
- const [totalCredits, setTotalCredits] = (0, import_react8.useState)(0);
5365
+ const [totalCredits, setTotalCredits] = (0, import_react8.useState)(null);
5537
5366
  const [usageLogs, setUsageLogs] = (0, import_react8.useState)([]);
5538
5367
  const [userMap, setUserMap] = (0, import_react8.useState)({});
5539
5368
  const [customPlanCredits, setCustomPlanCredits] = (0, import_react8.useState)(
@@ -5544,6 +5373,7 @@ function BillingContent({
5544
5373
  );
5545
5374
  const [buyCreditsInFlight, setBuyCreditsInFlight] = (0, import_react8.useState)(false);
5546
5375
  const [loadingBilling, setLoadingBilling] = (0, import_react8.useState)(false);
5376
+ const [billingOverviewLoaded, setBillingOverviewLoaded] = (0, import_react8.useState)(false);
5547
5377
  const [loadingTable, setLoadingTable] = (0, import_react8.useState)(false);
5548
5378
  const [showInitialLoader, setShowInitialLoader] = (0, import_react8.useState)(true);
5549
5379
  const [initialFetchTriggered, setInitialFetchTriggered] = (0, import_react8.useState)(false);
@@ -5568,6 +5398,7 @@ function BillingContent({
5568
5398
  }, [api]);
5569
5399
  const fetchBillingOverview = (0, import_react8.useCallback)(async () => {
5570
5400
  setLoadingBilling(true);
5401
+ setBillingOverviewLoaded(false);
5571
5402
  try {
5572
5403
  console.log("calling Billing apis");
5573
5404
  const [subRes, creditsRes, productsRes, customRes] = await Promise.all([
@@ -5596,6 +5427,7 @@ function BillingContent({
5596
5427
  } catch {
5597
5428
  } finally {
5598
5429
  setLoadingBilling(false);
5430
+ setBillingOverviewLoaded(true);
5599
5431
  }
5600
5432
  }, [api, workspace.current?.country]);
5601
5433
  const fetchUserMap = (0, import_react8.useCallback)(async () => {
@@ -5737,6 +5569,12 @@ function BillingContent({
5737
5569
  (0, import_react8.useEffect)(() => {
5738
5570
  setShowInitialLoader(true);
5739
5571
  setInitialFetchTriggered(false);
5572
+ setBillingOverviewLoaded(false);
5573
+ setSubscription(null);
5574
+ setAvailableCredits(null);
5575
+ setProducts([]);
5576
+ setTotalCredits(null);
5577
+ setCustomPlanCredits(null);
5740
5578
  }, [workspaceId]);
5741
5579
  (0, import_react8.useEffect)(() => {
5742
5580
  setInitialFetchTriggered(true);
@@ -5755,17 +5593,39 @@ function BillingContent({
5755
5593
  (0, import_react8.useEffect)(() => {
5756
5594
  if (!showInitialLoader) return;
5757
5595
  if (!initialFetchTriggered) return;
5758
- if (loadingBilling) return;
5596
+ if (!billingOverviewLoaded) return;
5759
5597
  setShowInitialLoader(false);
5760
- }, [showInitialLoader, initialFetchTriggered, loadingBilling]);
5598
+ }, [showInitialLoader, initialFetchTriggered, billingOverviewLoaded]);
5761
5599
  console.log("subscription", subscription);
5762
5600
  const isProPlan = products.some(
5763
5601
  (product) => product.id == subscription?.stripeProductId && product.name == "Paid"
5764
5602
  );
5765
5603
  console.log("isProPlan", isProPlan);
5766
- const planName = isProPlan ? "Pro" : subscription?.plan?.name?.trim() || (subscription?.plan?.amount ? subscription.plan.amount > 0 ? "Pro" : "Free" : "-");
5604
+ const currentPlanPrice = (() => {
5605
+ if (products.length > 0 && subscription?.plan?.id) {
5606
+ for (const product of products) {
5607
+ const price = product.prices.find((p) => p.id === subscription.plan.id);
5608
+ if (price) return price;
5609
+ }
5610
+ }
5611
+ return null;
5612
+ })();
5613
+ const preDowngradePlan = subscription?.downgradeScheduled && subscription.preDowngradeStripePriceData ? subscription.preDowngradeStripePriceData : null;
5614
+ const resolvedPlanName = (preDowngradePlan?.name?.trim() || currentPlanPrice?.metadata?.name?.trim() || subscription?.plan?.name?.trim() || (subscription?.plan?.amount != null ? subscription.plan.amount > 0 ? "Pro" : "Free" : "")).trim();
5615
+ const planName = isProPlan && resolvedPlanName !== "-" ? "Pro" : resolvedPlanName;
5767
5616
  const isFreePlan = subscription?.plan?.amount == null || subscription.plan.amount === 0;
5768
- const planAmount = subscription?.plan?.amount != null ? `${subscription?.plan?.currency == "inr" ? "\u20B9" : "$"}${(subscription.plan.amount / 100).toFixed(2)} / ${subscription?.plan?.interval}` : `${getCurrencySymbolByCountry(workspace.current?.country)}0`;
5617
+ const hasResolvedPlanAmount = (preDowngradePlan?.amount ?? subscription?.plan?.amount) != null && Boolean(preDowngradePlan?.currency ?? subscription?.plan?.currency) && Boolean(preDowngradePlan?.interval ?? subscription?.plan?.interval);
5618
+ const planAmount = hasResolvedPlanAmount ? `${(preDowngradePlan?.currency ?? subscription?.plan?.currency) == "inr" ? "\u20B9" : "$"}${((preDowngradePlan?.amount ?? subscription.plan.amount) / 100).toFixed(2)} / ${preDowngradePlan?.interval ?? subscription?.plan?.interval}` : "";
5619
+ const planCreditsFromPrice = Number(
5620
+ preDowngradePlan?.credits ?? currentPlanPrice?.metadata?.credits
5621
+ );
5622
+ const currentPlanCredits = Number.isFinite(planCreditsFromPrice) ? planCreditsFromPrice : customPlanCredits;
5623
+ const planCreditsText = currentPlanCredits != null ? `${formatCredits(currentPlanCredits)} credits` : "";
5624
+ const scheduledDowngradeDateLabel = formatEffectiveDateLabel(
5625
+ subscription?.scheduledDowngradeEffectiveDate
5626
+ );
5627
+ const scheduledDowngradeText = subscription?.downgradeScheduled && subscription.plan?.name ? `Downgrades to ${subscription.plan.name}${scheduledDowngradeDateLabel ? ` ${scheduledDowngradeDateLabel}` : ""}` : void 0;
5628
+ const isPlanDetailsLoading = !billingOverviewLoaded || loadingBilling || subscription?.plan == null || !planName || planName === "-" || !planAmount || currentPlanCredits == null;
5769
5629
  const usedCredits = availableCredits != null && totalCredits != null ? Math.max(0, totalCredits - availableCredits) : null;
5770
5630
  const progressPct = usedCredits != null && totalCredits != null && totalCredits > 0 ? Math.min(100, Math.round(usedCredits / totalCredits * 100)) : 0;
5771
5631
  const remainingPct = 100 - progressPct;
@@ -5958,6 +5818,7 @@ function BillingContent({
5958
5818
  PlansView,
5959
5819
  {
5960
5820
  onBack: () => setShowPlans(false),
5821
+ hideHeader: Boolean(onShowPlansChange),
5961
5822
  products,
5962
5823
  currentPlanId: subscription?.plan?.id,
5963
5824
  currentPlanEndDate: subscription?.plan?.subscriptionEndDate,
@@ -5983,11 +5844,13 @@ function BillingContent({
5983
5844
  import_ui5.ScPlanDetailsCard,
5984
5845
  {
5985
5846
  planName,
5986
- planCredits: totalCredits != null ? `${formatCredits(totalCredits)} credits` : "\u2014",
5847
+ planCredits: planCreditsText,
5987
5848
  planPrice: planAmount,
5988
5849
  badgeText: "Active",
5850
+ badgeSubText: scheduledDowngradeText,
5989
5851
  currentPlanLabel: "Current plan",
5990
- upgradeButtonText: subscription?.downgradeScheduled ? "Cancel downgrade" : "Upgrade",
5852
+ upgradeButtonText: subscription?.downgradeScheduled ? "Cancel downgrade" : "Manage Plan",
5853
+ isLoading: isPlanDetailsLoading,
5991
5854
  className: "flex-1 min-w-0",
5992
5855
  onUpgrade: () => {
5993
5856
  void logBillingEvent("billing_plans_opened", "Plans opened", {
@@ -6084,7 +5947,9 @@ function BillingContent({
6084
5947
  BuyCreditsModal,
6085
5948
  {
6086
5949
  country: workspace.current?.country,
6087
- currencySymbol: getCurrencySymbolByCountry(workspace.current?.country),
5950
+ currencySymbol: getCurrencySymbolByCountry(
5951
+ workspace.current?.country
5952
+ ),
6088
5953
  onClose: () => setShowBuyCreditsModal(false),
6089
5954
  onBuy: (credits, price) => {
6090
5955
  handleBuyCredits(credits, price);
@@ -7798,6 +7663,11 @@ function SettingsContentInner({ activeTab }) {
7798
7663
  const [teamInviteOpen, setTeamInviteOpen] = (0, import_react10.useState)(false);
7799
7664
  const [tokenShowRevoked, setTokenShowRevoked] = (0, import_react10.useState)(false);
7800
7665
  const [tokenCreateOpen, setTokenCreateOpen] = (0, import_react10.useState)(false);
7666
+ const [billingShowPlans, setBillingShowPlans] = (0, import_react10.useState)(false);
7667
+ const isBillingPlans = activeTab === "billing" && billingShowPlans;
7668
+ (0, import_react10.useEffect)(() => {
7669
+ if (activeTab !== "billing") setBillingShowPlans(false);
7670
+ }, [activeTab]);
7801
7671
  const [localWorkspaces, setLocalWorkspaces] = (0, import_react10.useState)(null);
7802
7672
  const [wsModalOpen, setWsModalOpen] = (0, import_react10.useState)(false);
7803
7673
  const [wsModalMode, setWsModalMode] = (0, import_react10.useState)("create");
@@ -8090,8 +7960,55 @@ function SettingsContentInner({ activeTab }) {
8090
7960
  },
8091
7961
  children: TAB_LABELS[activeTab]
8092
7962
  }
8093
- )
7963
+ ),
7964
+ isBillingPlans && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7965
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons7.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
7966
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7967
+ "span",
7968
+ {
7969
+ style: {
7970
+ fontFamily: "var(--font-family-font-family-body)",
7971
+ fontSize: "var(--font-size-font-size-xl)",
7972
+ fontWeight: 500,
7973
+ lineHeight: "var(--line-height-line-height-xl)",
7974
+ color: "var(--alias-text---icons-primary)"
7975
+ },
7976
+ children: "Plans"
7977
+ }
7978
+ )
7979
+ ] })
8094
7980
  ] }),
7981
+ isBillingPlans && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7982
+ "div",
7983
+ {
7984
+ className: "flex items-center shrink-0 cursor-pointer",
7985
+ style: {
7986
+ gap: "var(--spacing-sm)",
7987
+ padding: "var(--spacing-xs) var(--spacing-lg)",
7988
+ borderRadius: "var(--radius-xl)",
7989
+ height: 32,
7990
+ border: "1px solid var(--alias-border-subtle)",
7991
+ backgroundColor: "var(--alias-surface-base)"
7992
+ },
7993
+ onClick: () => setBillingShowPlans(false),
7994
+ children: [
7995
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons7.SiconLeft, { className: "w-4 h-4", color: "var(--alias-text---icons-muted)" }),
7996
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7997
+ "span",
7998
+ {
7999
+ style: {
8000
+ fontFamily: "var(--font-family-font-family-body)",
8001
+ fontSize: "var(--font-size-font-size-sm)",
8002
+ fontWeight: 500,
8003
+ lineHeight: "var(--line-height-line-height-sm)",
8004
+ color: "var(--alias-text---icons-muted)"
8005
+ },
8006
+ children: "Back to billing"
8007
+ }
8008
+ )
8009
+ ]
8010
+ }
8011
+ ),
8095
8012
  activeTab === "workspace" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8096
8013
  import_ui9.ScButton,
8097
8014
  {
@@ -8163,7 +8080,7 @@ function SettingsContentInner({ activeTab }) {
8163
8080
  className: "flex items-start flex-1 min-h-0 w-full overflow-hidden",
8164
8081
  style: { gap: 20 },
8165
8082
  children: [
8166
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingsNav, { activeTab, onTabChange: setActiveTab }),
8083
+ !isBillingPlans && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingsNav, { activeTab, onTabChange: setActiveTab }),
8167
8084
  activeTab === "profile" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ProfileTab, {}),
8168
8085
  activeTab === "workspace" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8169
8086
  WorkspaceTab,
@@ -8188,7 +8105,14 @@ function SettingsContentInner({ activeTab }) {
8188
8105
  ),
8189
8106
  activeTab === "referral" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ReferralTab, {}),
8190
8107
  activeTab === "team" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TeamsContent, { embedded: true, onInviteOpen: teamInviteOpen, onInviteOpenChange: setTeamInviteOpen }) }),
8191
- activeTab === "billing" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BillingContent, { embedded: true }) }),
8108
+ activeTab === "billing" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8109
+ BillingContent,
8110
+ {
8111
+ embedded: true,
8112
+ showPlans: billingShowPlans,
8113
+ onShowPlansChange: setBillingShowPlans
8114
+ }
8115
+ ) }),
8192
8116
  activeTab === "apikey" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
8193
8117
  TokensContent,
8194
8118
  {