@buildbase/sdk 0.0.75 → 0.0.77

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.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";var e=require("./chunks/react-DTOi9eck.cjs");require("react/jsx-runtime"),require("react"),require("clsx"),require("tailwind-merge"),require("intl-messageformat"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("lucide-react"),require("@radix-ui/react-dialog"),require("@radix-ui/react-icons"),require("@hookform/resolvers/zod"),require("react-hook-form"),require("@radix-ui/react-label"),require("zod"),require("@radix-ui/react-avatar"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-separator"),require("@radix-ui/react-accordion"),require("@radix-ui/react-alert-dialog"),require("@radix-ui/react-popover"),exports.APP_PERMISSION_FALLBACK_GROUP=e.APP_PERMISSION_FALLBACK_GROUP,Object.defineProperty(exports,"ApiVersion",{enumerable:!0,get:function(){return e.ApiVersion}}),exports.AuthApi=e.AuthApi,Object.defineProperty(exports,"AuthStatus",{enumerable:!0,get:function(){return e.AuthStatus}}),exports.BBAction=e.BBAction,exports.BBScreen=e.BBScreen,exports.BBStatus=e.BBStatus,exports.BB_PARAM=e.BB_PARAM,exports.BaseApi=e.BaseApi,exports.BetaForm=e.BetaForm,exports.BillingIntervals=e.BillingIntervals,exports.BuildBaseBadge=e.BuildBaseBadge,exports.BuildBaseProvider=e.SaaSOSProvider,exports.CURRENCY_DISPLAY=e.CURRENCY_DISPLAY,exports.CURRENCY_FLAG=e.CURRENCY_FLAG,exports.ConnectMcpGuide=e.ConnectMcpGuide,exports.ConnectedAgents=e.ConnectedAgents,exports.ConnectedAgentsApi=e.ConnectedAgentsApi,exports.CreditActionsProvider=e.CreditActionsProvider,exports.CreditBalance=e.CreditBalance,exports.CreditBalanceContextProvider=e.CreditBalanceContextProvider,exports.CreditBucketSource=e.CreditBucketSource,exports.CreditBucketStatus=e.CreditBucketStatus,exports.CreditStorePage=e.CreditStorePage,exports.CreditTransactionType=e.CreditTransactionType,exports.DEFAULT_ROLE_PERMISSIONS=e.DEFAULT_ROLE_PERMISSIONS,exports.Devices=e.Devices,exports.DevicesApi=e.DevicesApi,exports.DunningState=e.DunningState,exports.EmptyState=e.EmptyState,exports.EventEmitter=e.EventEmitter,exports.FALLBACK_WORKSPACE_ROLE=e.FALLBACK_WORKSPACE_ROLE,exports.FullScreenLoader=e.FullScreenLoader,exports.INVITATION_ERROR_CODE=e.INVITATION_ERROR_CODE,exports.InvoiceStatuses=e.InvoiceStatuses,exports.LoadingState=e.LoadingState,exports.NotificationBell=e.NotificationBell,exports.NotificationInbox=e.NotificationInbox,exports.NotificationsApi=e.NotificationsApi,exports.PLAN_CURRENCY_CODES=e.PLAN_CURRENCY_CODES,exports.PLAN_CURRENCY_OPTIONS=e.PLAN_CURRENCY_OPTIONS,exports.PUSH_SERVICE_WORKER_SCRIPT=e.PUSH_SERVICE_WORKER_SCRIPT,exports.PendingInvitations=e.PendingInvitations,exports.Permission=e.Permission,exports.PricingPage=e.PricingPage,exports.PushApi=e.PushApi,exports.PushNotificationProvider=e.PushNotificationProvider,exports.QuotaUsageContextProvider=e.QuotaUsageContextProvider,exports.SDKEvent=e.SDKEvent,exports.SETTINGS_SCREENS=e.SETTINGS_SCREENS,exports.SUPPORTED_LOCALES=e.SUPPORTED_LOCALES,exports.SaaSOSProvider=e.SaaSOSProvider,exports.SectionHeader=e.SectionHeader,exports.Sessions=e.Sessions,exports.SessionsApi=e.SessionsApi,exports.SettingsApi=e.SettingsApi,exports.SettingsScreen=e.SettingsScreen,exports.SidebarNavItem=e.SidebarNavItem,exports.SidebarNavSection=e.SidebarNavSection,exports.StatusBanner=e.StatusBanner,exports.SubscriptionContextProvider=e.SubscriptionContextProvider,exports.SubscriptionItemType=e.SubscriptionItemType,exports.SubscriptionStatus=e.SubscriptionStatus,exports.UserApi=e.UserApi,exports.WhenAuthenticated=e.WhenAuthenticated,exports.WhenCreditsAvailable=e.WhenCreditsAvailable,exports.WhenCreditsExhausted=e.WhenCreditsExhausted,exports.WhenCreditsLow=e.WhenCreditsLow,exports.WhenNoSubscription=e.WhenNoSubscription,exports.WhenNotTrialing=e.WhenNotTrialing,exports.WhenPendingInvitations=e.WhenPendingInvitations,exports.WhenPermission=e.WhenPermission,exports.WhenQuotaAvailable=e.WhenQuotaAvailable,exports.WhenQuotaExhausted=e.WhenQuotaExhausted,exports.WhenQuotaOverage=e.WhenQuotaOverage,exports.WhenQuotaThreshold=e.WhenQuotaThreshold,exports.WhenRoles=e.WhenRoles,exports.WhenSubscription=e.WhenSubscription,exports.WhenSubscriptionToPlans=e.WhenSubscriptionToPlans,exports.WhenTrialEnding=e.WhenTrialEnding,exports.WhenTrialing=e.WhenTrialing,exports.WhenUnauthenticated=e.WhenUnauthenticated,exports.WhenUserFeatureDisabled=e.WhenUserFeatureDisabled,exports.WhenUserFeatureEnabled=e.WhenUserFeatureEnabled,exports.WhenWorkspaceFeatureDisabled=e.WhenWorkspaceFeatureDisabled,exports.WhenWorkspaceFeatureEnabled=e.WhenWorkspaceFeatureEnabled,exports.WhenWorkspaceRoles=e.WhenWorkspaceRoles,exports.WorkspaceApi=e.WorkspaceApi,exports.WorkspaceSwitcher=e.WorkspaceSwitcher,exports.actionableInvitations=e.actionableInvitations,exports.appPermissionCatalogue=e.appPermissionCatalogue,exports.calculateBillableSeats=e.calculateBillableSeats,exports.calculateSeatOverageCents=e.calculateSeatOverageCents,exports.calculateTotalSubscriptionCents=e.calculateTotalSubscriptionCents,exports.cleanBBParams=e.cleanBBParams,exports.clearAuthIntent=e.clearAuthIntent,exports.clearPendingInvite=e.clearPendingInvite,exports.coerceBadgeRef=e.coerceBadgeRef,exports.consumeAuthIntent=e.consumeAuthIntent,exports.createBBUrl=e.createBBUrl,exports.createCheckoutRedirectUrls=e.createCheckoutRedirectUrls,exports.createCreditPurchaseRedirectUrls=e.createCreditPurchaseRedirectUrls,exports.eventEmitter=e.eventEmitter,exports.fillMcpTemplate=e.fillMcpTemplate,exports.formatCents=e.formatCents,exports.formatMinorAmountIntl=e.formatMinorAmountIntl,exports.formatOverageRate=e.formatOverageRate,exports.formatOverageRateWithLabel=e.formatOverageRateWithLabel,exports.formatQuotaIncludedOverage=e.formatQuotaIncludedOverage,exports.formatQuotaWithPrice=e.formatQuotaWithPrice,exports.getAvailableCurrenciesFromPlans=e.getAvailableCurrenciesFromPlans,exports.getBasePriceCents=e.getBasePriceCents,exports.getBillingIntervalAndCurrencyFromPriceId=e.getBillingIntervalAndCurrencyFromPriceId,exports.getCurrencyDecimals=e.getCurrencyDecimals,exports.getCurrencyFlag=e.getCurrencyFlag,exports.getCurrencySymbol=e.getCurrencySymbol,exports.getDisplayCurrency=e.getDisplayCurrency,exports.getPerSeatPriceCents=e.getPerSeatPriceCents,exports.getPricingVariant=e.getPricingVariant,exports.getQuotaDisplayValue=e.getQuotaDisplayValue,exports.getQuotaDisplayWithVariant=e.getQuotaDisplayWithVariant,exports.getQuotaOverageCents=e.getQuotaOverageCents,exports.getQuotaUnitLabelFromName=e.getQuotaUnitLabelFromName,exports.getSeatPricing=e.getSeatPricing,exports.getStripePriceIdForInterval=e.getStripePriceIdForInterval,exports.hasPermission=e.hasPermission,exports.invalidateCreditBalance=e.invalidateCreditBalance,exports.invalidateQuotaUsage=e.invalidateQuotaUsage,exports.invalidateSubscription=e.invalidateSubscription,exports.inviterNameOf=e.inviterNameOf,exports.isInvitationActionable=e.isInvitationActionable,exports.isInvitationError=e.isInvitationError,exports.isInvitationLapsed=e.isInvitationLapsed,exports.isZeroDecimalCurrency=e.isZeroDecimalCurrency,exports.mcpServerKey=e.mcpServerKey,exports.mergeUIConfig=e.mergeUIConfig,exports.minorAmountToDisplay=e.minorAmountToDisplay,exports.parkPendingInvite=e.parkPendingInvite,exports.pickDefaultRole=e.pickDefaultRole,exports.readBBParams=e.readBBParams,exports.readPendingInvite=e.readPendingInvite,exports.resendCooldownSeconds=e.resendCooldownSeconds,exports.resolveMaxUsers=e.resolveMaxUsers,exports.resolvePermissions=e.resolvePermissions,exports.resolveRolePermissions=e.resolveRolePermissions,exports.safeRedirect=e.safeRedirect,exports.saveAuthIntent=e.saveAuthIntent,exports.sortInvitations=e.sortInvitations,exports.useAllQuotaUsage=e.useAllQuotaUsage,exports.useBillingPortal=e.useBillingPortal,exports.useCancelSubscription=e.useCancelSubscription,exports.useConnectedAgents=e.useConnectedAgents,exports.useConnectedAgentsApi=e.useConnectedAgentsApi,exports.useConsumeCredits=e.useConsumeCredits,exports.useCreateCheckoutSession=e.useCreateCheckoutSession,exports.useCreditBalance=e.useCreditBalance,exports.useCreditBalanceContext=e.useCreditBalanceContext,exports.useCreditPackages=e.useCreditPackages,exports.useCreditTransactions=e.useCreditTransactions,exports.useDevices=e.useDevices,exports.useDevicesApi=e.useDevicesApi,exports.useExpiringCredits=e.useExpiringCredits,exports.useFullScreenLoader=e.useFullScreenLoader,exports.useInvoice=e.useInvoice,exports.useInvoices=e.useInvoices,exports.useMcpConnection=e.useMcpConnection,exports.useMyInvitations=e.useMyInvitations,exports.useNotifications=e.useNotifications,exports.useNotificationsApi=e.useNotificationsApi,exports.usePermissions=e.usePermissions,exports.usePlanGroup=e.usePlanGroup,exports.usePlanGroupVersions=e.usePlanGroupVersions,exports.usePublicCreditPackages=e.usePublicCreditPackages,exports.usePublicPlanGroupVersion=e.usePublicPlanGroupVersion,exports.usePublicPlans=e.usePublicPlans,exports.usePurchaseCredits=e.usePurchaseCredits,exports.usePushNotifications=e.usePushNotifications,exports.useQuotaUsageContext=e.useQuotaUsageContext,exports.useQuotaUsageStatus=e.useQuotaUsageStatus,exports.useRecordUsage=e.useRecordUsage,exports.useResumeSubscription=e.useResumeSubscription,exports.useSaaSAuth=e.useSaaSAuth,exports.useSaaSOs=e.useSaaSOs,exports.useSaaSSettings=e.useSaaSSettings,exports.useSaaSWorkspaces=e.useSaaSWorkspaces,exports.useSeatStatus=e.useSeatStatus,exports.useSessions=e.useSessions,exports.useSessionsApi=e.useSessionsApi,exports.useSubscription=e.useSubscription,exports.useSubscriptionContext=e.useSubscriptionContext,exports.useSubscriptionManagement=e.useSubscriptionManagement,exports.useTranslation=e.useTranslation,exports.useTrialStatus=e.useTrialStatus,exports.useUIConfig=e.useUIConfig,exports.useUIVisibility=e.useUIVisibility,exports.useUpdateSubscription=e.useUpdateSubscription,exports.useUsageLogs=e.useUsageLogs,exports.useUserAttributes=e.useUserAttributes,exports.useUserFeatures=e.useUserFeatures,exports.useWorkspaceInvitations=e.useWorkspaceInvitations,exports.validateInvite=e.validateInvite,exports.validateRedirectUrl=e.validateRedirectUrl,exports.workspaceIdOf=e.workspaceIdOf,exports.workspaceNameOf=e.workspaceNameOf,exports.workspaceSettingsManager=e.workspaceSettingsManager;
2
+ "use strict";var e=require("./chunks/react-6MIS8oUC.cjs");require("react/jsx-runtime"),require("react"),require("clsx"),require("tailwind-merge"),require("intl-messageformat"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("lucide-react"),require("@radix-ui/react-dialog"),require("@radix-ui/react-icons"),require("@hookform/resolvers/zod"),require("react-hook-form"),require("@radix-ui/react-label"),require("zod"),require("@radix-ui/react-avatar"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-separator"),require("@radix-ui/react-accordion"),require("@radix-ui/react-alert-dialog"),require("@radix-ui/react-popover"),exports.APP_PERMISSION_FALLBACK_GROUP=e.APP_PERMISSION_FALLBACK_GROUP,Object.defineProperty(exports,"ApiVersion",{enumerable:!0,get:function(){return e.ApiVersion}}),exports.AuthApi=e.AuthApi,Object.defineProperty(exports,"AuthStatus",{enumerable:!0,get:function(){return e.AuthStatus}}),exports.BBAction=e.BBAction,exports.BBScreen=e.BBScreen,exports.BBStatus=e.BBStatus,exports.BB_PARAM=e.BB_PARAM,exports.BaseApi=e.BaseApi,exports.BetaForm=e.BetaForm,exports.BillingIntervals=e.BillingIntervals,exports.BuildBaseBadge=e.BuildBaseBadge,exports.BuildBaseProvider=e.SaaSOSProvider,exports.CURRENCY_DISPLAY=e.CURRENCY_DISPLAY,exports.CURRENCY_FLAG=e.CURRENCY_FLAG,exports.ConnectMcpGuide=e.ConnectMcpGuide,exports.ConnectedAgents=e.ConnectedAgents,exports.ConnectedAgentsApi=e.ConnectedAgentsApi,exports.CreditActionsProvider=e.CreditActionsProvider,exports.CreditBalance=e.CreditBalance,exports.CreditBalanceContextProvider=e.CreditBalanceContextProvider,exports.CreditBucketSource=e.CreditBucketSource,exports.CreditBucketStatus=e.CreditBucketStatus,exports.CreditStorePage=e.CreditStorePage,exports.CreditTransactionType=e.CreditTransactionType,exports.DEFAULT_ROLE_PERMISSIONS=e.DEFAULT_ROLE_PERMISSIONS,exports.Devices=e.Devices,exports.DevicesApi=e.DevicesApi,exports.DunningState=e.DunningState,exports.EmptyState=e.EmptyState,exports.EventEmitter=e.EventEmitter,exports.FALLBACK_WORKSPACE_ROLE=e.FALLBACK_WORKSPACE_ROLE,exports.FullScreenLoader=e.FullScreenLoader,exports.INVITATION_ERROR_CODE=e.INVITATION_ERROR_CODE,exports.InvoiceStatuses=e.InvoiceStatuses,exports.LoadingState=e.LoadingState,exports.NotificationBell=e.NotificationBell,exports.NotificationInbox=e.NotificationInbox,exports.NotificationsApi=e.NotificationsApi,exports.PLAN_CURRENCY_CODES=e.PLAN_CURRENCY_CODES,exports.PLAN_CURRENCY_OPTIONS=e.PLAN_CURRENCY_OPTIONS,exports.PUSH_SERVICE_WORKER_SCRIPT=e.PUSH_SERVICE_WORKER_SCRIPT,exports.PendingInvitations=e.PendingInvitations,exports.Permission=e.Permission,exports.PricingPage=e.PricingPage,exports.PushApi=e.PushApi,exports.PushNotificationProvider=e.PushNotificationProvider,exports.QuotaUsageContextProvider=e.QuotaUsageContextProvider,exports.SDKEvent=e.SDKEvent,exports.SETTINGS_SCREENS=e.SETTINGS_SCREENS,exports.SUPPORTED_LOCALES=e.SUPPORTED_LOCALES,exports.SaaSOSProvider=e.SaaSOSProvider,exports.SectionHeader=e.SectionHeader,exports.Sessions=e.Sessions,exports.SessionsApi=e.SessionsApi,exports.SettingsApi=e.SettingsApi,exports.SettingsScreen=e.SettingsScreen,exports.SidebarNavItem=e.SidebarNavItem,exports.SidebarNavSection=e.SidebarNavSection,exports.StatusBanner=e.StatusBanner,exports.SubscriptionContextProvider=e.SubscriptionContextProvider,exports.SubscriptionItemType=e.SubscriptionItemType,exports.SubscriptionStatus=e.SubscriptionStatus,exports.UserApi=e.UserApi,exports.WhenAuthenticated=e.WhenAuthenticated,exports.WhenCreditsAvailable=e.WhenCreditsAvailable,exports.WhenCreditsExhausted=e.WhenCreditsExhausted,exports.WhenCreditsLow=e.WhenCreditsLow,exports.WhenNoSubscription=e.WhenNoSubscription,exports.WhenNotTrialing=e.WhenNotTrialing,exports.WhenPendingInvitations=e.WhenPendingInvitations,exports.WhenPermission=e.WhenPermission,exports.WhenQuotaAvailable=e.WhenQuotaAvailable,exports.WhenQuotaExhausted=e.WhenQuotaExhausted,exports.WhenQuotaOverage=e.WhenQuotaOverage,exports.WhenQuotaThreshold=e.WhenQuotaThreshold,exports.WhenRoles=e.WhenRoles,exports.WhenSubscription=e.WhenSubscription,exports.WhenSubscriptionToPlans=e.WhenSubscriptionToPlans,exports.WhenTrialEnding=e.WhenTrialEnding,exports.WhenTrialing=e.WhenTrialing,exports.WhenUnauthenticated=e.WhenUnauthenticated,exports.WhenUserFeatureDisabled=e.WhenUserFeatureDisabled,exports.WhenUserFeatureEnabled=e.WhenUserFeatureEnabled,exports.WhenWorkspaceFeatureDisabled=e.WhenWorkspaceFeatureDisabled,exports.WhenWorkspaceFeatureEnabled=e.WhenWorkspaceFeatureEnabled,exports.WhenWorkspaceRoles=e.WhenWorkspaceRoles,exports.WorkspaceApi=e.WorkspaceApi,exports.WorkspaceSwitcher=e.WorkspaceSwitcher,exports.actionableInvitations=e.actionableInvitations,exports.appPermissionCatalogue=e.appPermissionCatalogue,exports.calculateBillableSeats=e.calculateBillableSeats,exports.calculateSeatOverageCents=e.calculateSeatOverageCents,exports.calculateTotalSubscriptionCents=e.calculateTotalSubscriptionCents,exports.cleanBBParams=e.cleanBBParams,exports.clearAuthIntent=e.clearAuthIntent,exports.clearPendingInvite=e.clearPendingInvite,exports.coerceBadgeRef=e.coerceBadgeRef,exports.consumeAuthIntent=e.consumeAuthIntent,exports.createBBUrl=e.createBBUrl,exports.createCheckoutRedirectUrls=e.createCheckoutRedirectUrls,exports.createCreditPurchaseRedirectUrls=e.createCreditPurchaseRedirectUrls,exports.eventEmitter=e.eventEmitter,exports.fillMcpTemplate=e.fillMcpTemplate,exports.formatCents=e.formatCents,exports.formatMinorAmountIntl=e.formatMinorAmountIntl,exports.formatOverageRate=e.formatOverageRate,exports.formatOverageRateWithLabel=e.formatOverageRateWithLabel,exports.formatQuotaIncludedOverage=e.formatQuotaIncludedOverage,exports.formatQuotaWithPrice=e.formatQuotaWithPrice,exports.getAvailableBillingIntervals=e.getAvailableBillingIntervals,exports.getAvailableCurrenciesFromPlans=e.getAvailableCurrenciesFromPlans,exports.getBasePriceCents=e.getBasePriceCents,exports.getBillingIntervalAndCurrencyFromPriceId=e.getBillingIntervalAndCurrencyFromPriceId,exports.getCurrencyDecimals=e.getCurrencyDecimals,exports.getCurrencyFlag=e.getCurrencyFlag,exports.getCurrencySymbol=e.getCurrencySymbol,exports.getDisplayCurrency=e.getDisplayCurrency,exports.getPerSeatPriceCents=e.getPerSeatPriceCents,exports.getPricingVariant=e.getPricingVariant,exports.getQuotaDisplayValue=e.getQuotaDisplayValue,exports.getQuotaDisplayWithVariant=e.getQuotaDisplayWithVariant,exports.getQuotaOverageCents=e.getQuotaOverageCents,exports.getQuotaUnitLabelFromName=e.getQuotaUnitLabelFromName,exports.getSeatPricing=e.getSeatPricing,exports.getStripePriceIdForInterval=e.getStripePriceIdForInterval,exports.hasPermission=e.hasPermission,exports.invalidateCreditBalance=e.invalidateCreditBalance,exports.invalidateQuotaUsage=e.invalidateQuotaUsage,exports.invalidateSubscription=e.invalidateSubscription,exports.inviterNameOf=e.inviterNameOf,exports.isInvitationActionable=e.isInvitationActionable,exports.isInvitationError=e.isInvitationError,exports.isInvitationLapsed=e.isInvitationLapsed,exports.isZeroDecimalCurrency=e.isZeroDecimalCurrency,exports.mcpServerKey=e.mcpServerKey,exports.mergeUIConfig=e.mergeUIConfig,exports.minorAmountToDisplay=e.minorAmountToDisplay,exports.parkPendingInvite=e.parkPendingInvite,exports.pickDefaultRole=e.pickDefaultRole,exports.readBBParams=e.readBBParams,exports.readPendingInvite=e.readPendingInvite,exports.resendCooldownSeconds=e.resendCooldownSeconds,exports.resolveMaxUsers=e.resolveMaxUsers,exports.resolvePermissions=e.resolvePermissions,exports.resolveRolePermissions=e.resolveRolePermissions,exports.safeRedirect=e.safeRedirect,exports.saveAuthIntent=e.saveAuthIntent,exports.sortInvitations=e.sortInvitations,exports.useAllQuotaUsage=e.useAllQuotaUsage,exports.useBillingPortal=e.useBillingPortal,exports.useCancelSubscription=e.useCancelSubscription,exports.useConnectedAgents=e.useConnectedAgents,exports.useConnectedAgentsApi=e.useConnectedAgentsApi,exports.useConsumeCredits=e.useConsumeCredits,exports.useCreateCheckoutSession=e.useCreateCheckoutSession,exports.useCreditBalance=e.useCreditBalance,exports.useCreditBalanceContext=e.useCreditBalanceContext,exports.useCreditPackages=e.useCreditPackages,exports.useCreditTransactions=e.useCreditTransactions,exports.useDevices=e.useDevices,exports.useDevicesApi=e.useDevicesApi,exports.useExpiringCredits=e.useExpiringCredits,exports.useFullScreenLoader=e.useFullScreenLoader,exports.useInvoice=e.useInvoice,exports.useInvoices=e.useInvoices,exports.useMcpConnection=e.useMcpConnection,exports.useMyInvitations=e.useMyInvitations,exports.useNotifications=e.useNotifications,exports.useNotificationsApi=e.useNotificationsApi,exports.usePermissions=e.usePermissions,exports.usePlanGroup=e.usePlanGroup,exports.usePlanGroupVersions=e.usePlanGroupVersions,exports.usePublicCreditPackages=e.usePublicCreditPackages,exports.usePublicPlanGroupVersion=e.usePublicPlanGroupVersion,exports.usePublicPlans=e.usePublicPlans,exports.usePurchaseCredits=e.usePurchaseCredits,exports.usePushNotifications=e.usePushNotifications,exports.useQuotaUsageContext=e.useQuotaUsageContext,exports.useQuotaUsageStatus=e.useQuotaUsageStatus,exports.useRecordUsage=e.useRecordUsage,exports.useResumeSubscription=e.useResumeSubscription,exports.useSaaSAuth=e.useSaaSAuth,exports.useSaaSOs=e.useSaaSOs,exports.useSaaSSettings=e.useSaaSSettings,exports.useSaaSWorkspaces=e.useSaaSWorkspaces,exports.useSeatStatus=e.useSeatStatus,exports.useSessions=e.useSessions,exports.useSessionsApi=e.useSessionsApi,exports.useSubscription=e.useSubscription,exports.useSubscriptionContext=e.useSubscriptionContext,exports.useSubscriptionManagement=e.useSubscriptionManagement,exports.useTranslation=e.useTranslation,exports.useTrialStatus=e.useTrialStatus,exports.useUIConfig=e.useUIConfig,exports.useUIVisibility=e.useUIVisibility,exports.useUpdateSubscription=e.useUpdateSubscription,exports.useUsageLogs=e.useUsageLogs,exports.useUserAttributes=e.useUserAttributes,exports.useUserFeatures=e.useUserFeatures,exports.useWorkspaceInvitations=e.useWorkspaceInvitations,exports.validateInvite=e.validateInvite,exports.validateRedirectUrl=e.validateRedirectUrl,exports.workspaceIdOf=e.workspaceIdOf,exports.workspaceNameOf=e.workspaceNameOf,exports.workspaceSettingsManager=e.workspaceSettingsManager;
@@ -2754,6 +2754,16 @@ declare function validateInvite(opts: {
2754
2754
  hasSubscription?: boolean;
2755
2755
  requireSubscription?: boolean;
2756
2756
  }): InviteValidation;
2757
+ /**
2758
+ * The billing intervals a group of plans actually prices in a currency.
2759
+ *
2760
+ * The subscription dialog used to offer Monthly, Quarterly and Yearly always,
2761
+ * so an organization that prices monthly only showed two tabs that priced
2762
+ * nothing - and the yearly one even carried a "Save" badge. An interval is
2763
+ * offered when at least one of these plan versions has a base price for it.
2764
+ * Monthly is always included, so the selector never empties; order is stable.
2765
+ */
2766
+ declare function getAvailableBillingIntervals(planVersions: IPlanVersion[], currency: string): BillingInterval[];
2757
2767
 
2758
2768
  /** Minimal workspace shape needed for ownership/role checks. Extended by `permissions.WorkspaceLike`. */
2759
2769
  interface WorkspaceLike$1 {
@@ -7633,5 +7643,5 @@ declare class WorkspaceSettingsManager {
7633
7643
  }
7634
7644
  declare const workspaceSettingsManager: WorkspaceSettingsManager;
7635
7645
 
7636
- export { APP_PERMISSION_FALLBACK_GROUP, ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, BuildBaseBadge, SaaSOSProvider as BuildBaseProvider, CURRENCY_DISPLAY, CURRENCY_FLAG, ConnectMcpGuide, ConnectedAgents, ConnectedAgentsApi, CreditActionsProvider, CreditBalance, CreditBalanceContextProvider, CreditBucketSource, CreditBucketStatus, CreditStorePage, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, Devices, DevicesApi, DunningState, EmptyState, EventEmitter, FALLBACK_WORKSPACE_ROLE, FullScreenLoader, INVITATION_ERROR_CODE, InvoiceStatuses, LoadingState, NotificationBell, NotificationInbox, NotificationsApi, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, PendingInvitations, Permission, PricingPage, PushApi, PushNotificationProvider, QuotaUsageContextProvider, SDKEvent, SETTINGS_SCREENS, SUPPORTED_LOCALES, SaaSOSProvider, SectionHeader, Sessions, SessionsApi, SettingsApi, SettingsScreen, SidebarNavItem, SidebarNavSection, StatusBanner, SubscriptionContextProvider, SubscriptionItemType, SubscriptionStatus, UserApi, WhenAuthenticated, WhenCreditsAvailable, WhenCreditsExhausted, WhenCreditsLow, WhenNoSubscription, WhenNotTrialing, WhenPendingInvitations, WhenPermission, WhenQuotaAvailable, WhenQuotaExhausted, WhenQuotaOverage, WhenQuotaThreshold, WhenRoles, WhenSubscription, WhenSubscriptionToPlans, WhenTrialEnding, WhenTrialing, WhenUnauthenticated, WhenUserFeatureDisabled, WhenUserFeatureEnabled, WhenWorkspaceFeatureDisabled, WhenWorkspaceFeatureEnabled, WhenWorkspaceRoles, WorkspaceApi, WorkspaceSwitcher, actionableInvitations, appPermissionCatalogue, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, clearPendingInvite, coerceBadgeRef, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, eventEmitter, fillMcpTemplate, formatCents, formatMinorAmountIntl, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyDecimals, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, inviterNameOf, isInvitationActionable, isInvitationError, isInvitationLapsed, isZeroDecimalCurrency, mcpServerKey, mergeUIConfig, minorAmountToDisplay, parkPendingInvite, pickDefaultRole, readBBParams, readPendingInvite, resendCooldownSeconds, resolveMaxUsers, resolvePermissions, resolveRolePermissions, safeRedirect, saveAuthIntent, sortInvitations, useAllQuotaUsage, useBillingPortal, useCancelSubscription, useConnectedAgents, useConnectedAgentsApi, useConsumeCredits, useCreateCheckoutSession, useCreditBalance, useCreditBalanceContext, useCreditPackages, useCreditTransactions, useDevices, useDevicesApi, useExpiringCredits, useFullScreenLoader, useInvoice, useInvoices, useMcpConnection, useMyInvitations, useNotifications, useNotificationsApi, usePermissions, usePlanGroup, usePlanGroupVersions, usePublicCreditPackages, usePublicPlanGroupVersion, usePublicPlans, usePurchaseCredits, usePushNotifications, useQuotaUsageContext, useQuotaUsageStatus, useRecordUsage, useResumeSubscription, useSaaSAuth, useSaaSOs, useSaaSSettings, useSaaSWorkspaces, useSeatStatus, useSessions, useSessionsApi, useSubscription, useSubscriptionContext, useSubscriptionManagement, useTranslation, useTrialStatus, useUIConfig, useUIVisibility, useUpdateSubscription, useUsageLogs, useUserAttributes, useUserFeatures, useWorkspaceInvitations, validateInvite, validateRedirectUrl, workspaceIdOf, workspaceNameOf, workspaceSettingsManager };
7646
+ export { APP_PERMISSION_FALLBACK_GROUP, ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, BuildBaseBadge, SaaSOSProvider as BuildBaseProvider, CURRENCY_DISPLAY, CURRENCY_FLAG, ConnectMcpGuide, ConnectedAgents, ConnectedAgentsApi, CreditActionsProvider, CreditBalance, CreditBalanceContextProvider, CreditBucketSource, CreditBucketStatus, CreditStorePage, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, Devices, DevicesApi, DunningState, EmptyState, EventEmitter, FALLBACK_WORKSPACE_ROLE, FullScreenLoader, INVITATION_ERROR_CODE, InvoiceStatuses, LoadingState, NotificationBell, NotificationInbox, NotificationsApi, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, PendingInvitations, Permission, PricingPage, PushApi, PushNotificationProvider, QuotaUsageContextProvider, SDKEvent, SETTINGS_SCREENS, SUPPORTED_LOCALES, SaaSOSProvider, SectionHeader, Sessions, SessionsApi, SettingsApi, SettingsScreen, SidebarNavItem, SidebarNavSection, StatusBanner, SubscriptionContextProvider, SubscriptionItemType, SubscriptionStatus, UserApi, WhenAuthenticated, WhenCreditsAvailable, WhenCreditsExhausted, WhenCreditsLow, WhenNoSubscription, WhenNotTrialing, WhenPendingInvitations, WhenPermission, WhenQuotaAvailable, WhenQuotaExhausted, WhenQuotaOverage, WhenQuotaThreshold, WhenRoles, WhenSubscription, WhenSubscriptionToPlans, WhenTrialEnding, WhenTrialing, WhenUnauthenticated, WhenUserFeatureDisabled, WhenUserFeatureEnabled, WhenWorkspaceFeatureDisabled, WhenWorkspaceFeatureEnabled, WhenWorkspaceRoles, WorkspaceApi, WorkspaceSwitcher, actionableInvitations, appPermissionCatalogue, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, clearPendingInvite, coerceBadgeRef, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, eventEmitter, fillMcpTemplate, formatCents, formatMinorAmountIntl, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, getAvailableBillingIntervals, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyDecimals, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, inviterNameOf, isInvitationActionable, isInvitationError, isInvitationLapsed, isZeroDecimalCurrency, mcpServerKey, mergeUIConfig, minorAmountToDisplay, parkPendingInvite, pickDefaultRole, readBBParams, readPendingInvite, resendCooldownSeconds, resolveMaxUsers, resolvePermissions, resolveRolePermissions, safeRedirect, saveAuthIntent, sortInvitations, useAllQuotaUsage, useBillingPortal, useCancelSubscription, useConnectedAgents, useConnectedAgentsApi, useConsumeCredits, useCreateCheckoutSession, useCreditBalance, useCreditBalanceContext, useCreditPackages, useCreditTransactions, useDevices, useDevicesApi, useExpiringCredits, useFullScreenLoader, useInvoice, useInvoices, useMcpConnection, useMyInvitations, useNotifications, useNotificationsApi, usePermissions, usePlanGroup, usePlanGroupVersions, usePublicCreditPackages, usePublicPlanGroupVersion, usePublicPlans, usePurchaseCredits, usePushNotifications, useQuotaUsageContext, useQuotaUsageStatus, useRecordUsage, useResumeSubscription, useSaaSAuth, useSaaSOs, useSaaSSettings, useSaaSWorkspaces, useSeatStatus, useSessions, useSessionsApi, useSubscription, useSubscriptionContext, useSubscriptionManagement, useTranslation, useTrialStatus, useUIConfig, useUIVisibility, useUpdateSubscription, useUsageLogs, useUserAttributes, useUserFeatures, useWorkspaceInvitations, validateInvite, validateRedirectUrl, workspaceIdOf, workspaceNameOf, workspaceSettingsManager };
7637
7647
  export type { BBActionType, BBScreenType, BBStatusType, BadgeHrefOptions, BetaFormData, BetaFormResponse, BillingInterval, BuildBaseBadgeProps, BuildBaseBadgeSize, BuildBaseBadgeTheme, BuildBaseBadgeVariant, SaaSOSProviderProps as BuildBaseProviderProps, CheckoutResult, ConnectMcpGuideProps, ConnectedAgentsProps, CreditActionsDetails, CreditBalanceContextValue, CreditBalanceDetails, CreditBucketSourceType, CreditBucketStatusType, CreditStorePageDetails, CreditTransactionTypeValue, DevicesProps, DunningStateType, EmptyStateProps, EventData, EventType, FormatQuotaWithPriceOptions, FullScreenLoaderProps, GetCheckoutStripeParams, IAllQuotaUsageResponse, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IConnectedAgent, IConsumeCreditsRequest, IConsumeCreditsResponse, ICreditBalance, ICreditBucket, ICreditBucketsQuery, ICreditBucketsResponse, ICreditPackage, ICreditPackagePricingVariant, ICreditPurchaseRequest, ICreditPurchaseResponse, ICreditTransaction, ICreditTransactionsQuery, ICreditTransactionsResponse, IDeviceView, IEventCallbacks, IExpiringCreditsResponse, IInvoice, IInvoiceListResponse, IInvoiceResponse, IIpInfoLite, INotificationItem, IOsConfig, IOsState, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicCreditPackage, IPublicCreditPackagesResponse, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, ISessionView, ISettings, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, IUser, IWorkspace, IWorkspaceInvitation, IWorkspaceInvitationPreview, IWorkspaceInvitationStatus, InvitationError, InvitationErrorCode, InvitationErrorFields, InviteBlockReason, InviteValidation, InvoiceStatus, InvoiceStatusType, LoadingProps, LoadingStateProps, MaxUsersConfig, McpClientGuide, McpConnectionConfig, MyNotificationPreferences, NotificationBellProps, NotificationChannelPreference, NotificationCounts, NotificationData, NotificationEvent, NotificationInboxProps, NotificationListParams, NotificationPage, NotificationResult, NotificationScope, OnWorkspaceChangeParams, PartialSDKMessages, PendingInvitationsProps, PermissionContext, PermissionKey, PlanVersionWithPricingVariants, PricingPageDetails, PricingPageProps, QuotaDisplayValue, QuotaDisplayWithOverage, QuotaUsageContextValue, RedirectValidationOptions, RolePermissionMap, SDKLocale, SDKMessages, SDKUIConfig, SaaSOSProviderProps, SeatStatus, SectionHeaderProps, SessionsProps, SettingsManagerState, SidebarNavItemProps, SidebarNavSectionProps, SignOutOptions, StatusBannerProps, StatusBannerVariant, SubscriptionContextValue, SubscriptionItemTypeValue, SubscriptionStatusType, TranslationKey, TrialStatus, UseConnectedAgents, UseDevices, UseMyInvitations, UseNotifications, UseNotificationsOptions, UseSessions, UseWorkspaceInvitations, UserCreatedEventData, UserUpdatedEventData, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceInvitationAcceptedEventData, WorkspaceInvitationDeclinedEventData, WorkspaceInvitationRevokedEventData, WorkspaceInvitationSentEventData, WorkspaceMemberPermissions, WorkspaceNotificationDefault, WorkspacePermissionDefinition, WorkspaceSettingsSection, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{b2 as APP_PERMISSION_FALLBACK_GROUP,b3 as ApiVersion,b4 as AuthApi,b5 as AuthStatus,o as BBAction,b6 as BBScreen,p as BBStatus,b7 as BB_PARAM,b8 as BaseApi,b9 as BetaForm,ak as BillingIntervals,ba as BuildBaseBadge,bb as BuildBaseProvider,bc as CURRENCY_DISPLAY,bd as CURRENCY_FLAG,be as ConnectMcpGuide,C as ConnectedAgents,bf as ConnectedAgentsApi,bg as CreditActionsProvider,bh as CreditBalance,bi as CreditBalanceContextProvider,bj as CreditBucketSource,bk as CreditBucketStatus,bl as CreditStorePage,y as CreditTransactionType,bm as DEFAULT_ROLE_PERMISSIONS,R as Devices,bn as DevicesApi,aB as DunningState,E as EmptyState,bo as EventEmitter,bp as FALLBACK_WORKSPACE_ROLE,bq as FullScreenLoader,br as INVITATION_ERROR_CODE,ai as InvoiceStatuses,L as LoadingState,bs as NotificationBell,bt as NotificationInbox,bu as NotificationsApi,bv as PLAN_CURRENCY_CODES,bw as PLAN_CURRENCY_OPTIONS,bx as PUSH_SERVICE_WORKER_SCRIPT,by as PendingInvitations,P as Permission,bz as PricingPage,bA as PushApi,bB as PushNotificationProvider,bC as QuotaUsageContextProvider,bD as SDKEvent,a_ as SETTINGS_SCREENS,bE as SUPPORTED_LOCALES,bb as SaaSOSProvider,s as SectionHeader,T as Sessions,bF as SessionsApi,bG as SettingsApi,aU as SettingsScreen,aW as SidebarNavItem,aV as SidebarNavSection,r as StatusBanner,bH as SubscriptionContextProvider,al as SubscriptionItemType,ao as SubscriptionStatus,bI as UserApi,bJ as WhenAuthenticated,bK as WhenCreditsAvailable,bL as WhenCreditsExhausted,bM as WhenCreditsLow,bN as WhenNoSubscription,bO as WhenNotTrialing,bP as WhenPendingInvitations,bQ as WhenPermission,bR as WhenQuotaAvailable,bS as WhenQuotaExhausted,bT as WhenQuotaOverage,bU as WhenQuotaThreshold,bV as WhenRoles,bW as WhenSubscription,bX as WhenSubscriptionToPlans,bY as WhenTrialEnding,bZ as WhenTrialing,b_ as WhenUnauthenticated,b$ as WhenUserFeatureDisabled,c0 as WhenUserFeatureEnabled,c1 as WhenWorkspaceFeatureDisabled,c2 as WhenWorkspaceFeatureEnabled,c3 as WhenWorkspaceRoles,c4 as WorkspaceApi,c5 as WorkspaceSwitcher,c6 as actionableInvitations,aa as appPermissionCatalogue,c7 as calculateBillableSeats,c8 as calculateSeatOverageCents,c9 as calculateTotalSubscriptionCents,ca as cleanBBParams,cb as clearAuthIntent,cc as clearPendingInvite,cd as coerceBadgeRef,ce as consumeAuthIntent,cf as createBBUrl,aD as createCheckoutRedirectUrls,v as createCreditPurchaseRedirectUrls,cg as eventEmitter,ch as fillMcpTemplate,ci as formatCents,f as formatMinorAmountIntl,cj as formatOverageRate,ck as formatOverageRateWithLabel,cl as formatQuotaIncludedOverage,cm as formatQuotaWithPrice,b0 as getAvailableCurrenciesFromPlans,ay as getBasePriceCents,ax as getBillingIntervalAndCurrencyFromPriceId,e as getCurrencyDecimals,a0 as getCurrencyFlag,g as getCurrencySymbol,cn as getDisplayCurrency,aA as getPerSeatPriceCents,a$ as getPricingVariant,an as getQuotaDisplayValue,am as getQuotaDisplayWithVariant,aH as getQuotaOverageCents,co as getQuotaUnitLabelFromName,az as getSeatPricing,aC as getStripePriceIdForInterval,cp as hasPermission,q as invalidateCreditBalance,cq as invalidateQuotaUsage,aE as invalidateSubscription,cr as inviterNameOf,cs as isInvitationActionable,ct as isInvitationError,aR as isInvitationLapsed,cu as isZeroDecimalCurrency,cv as mcpServerKey,aX as mergeUIConfig,cw as minorAmountToDisplay,cx as parkPendingInvite,aO as pickDefaultRole,cy as readBBParams,cz as readPendingInvite,aQ as resendCooldownSeconds,cA as resolveMaxUsers,cB as resolvePermissions,ab as resolveRolePermissions,x as safeRedirect,cC as saveAuthIntent,cD as sortInvitations,cE as useAllQuotaUsage,au as useBillingPortal,as as useCancelSubscription,cF as useConnectedAgents,cG as useConnectedAgentsApi,cH as useConsumeCredits,ar as useCreateCheckoutSession,cI as useCreditBalance,j as useCreditBalanceContext,k as useCreditPackages,m as useCreditTransactions,cJ as useDevices,cK as useDevicesApi,l as useExpiringCredits,cL as useFullScreenLoader,cM as useInvoice,ag as useInvoices,cN as useMcpConnection,cO as useMyInvitations,cP as useNotifications,cQ as useNotificationsApi,h as usePermissions,cR as usePlanGroup,av as usePlanGroupVersions,cS as usePublicCreditPackages,cT as usePublicPlanGroupVersion,cU as usePublicPlans,n as usePurchaseCredits,a7 as usePushNotifications,aF as useQuotaUsageContext,cV as useQuotaUsageStatus,cW as useRecordUsage,at as useResumeSubscription,aJ as useSaaSAuth,cX as useSaaSOs,A as useSaaSSettings,z as useSaaSWorkspaces,aN as useSeatStatus,cY as useSessions,cZ as useSessionsApi,c_ as useSubscription,aG as useSubscriptionContext,aq as useSubscriptionManagement,u as useTranslation,c$ as useTrialStatus,aP as useUIConfig,i as useUIVisibility,d0 as useUpdateSubscription,d1 as useUsageLogs,d2 as useUserAttributes,d3 as useUserFeatures,aL as useWorkspaceInvitations,d4 as validateInvite,d5 as validateRedirectUrl,d6 as workspaceIdOf,d7 as workspaceNameOf,w as workspaceSettingsManager}from"./chunks/react-DkhpyQTr.mjs";import"react/jsx-runtime";import"react";import"clsx";import"tailwind-merge";import"intl-messageformat";import"@radix-ui/react-slot";import"class-variance-authority";import"lucide-react";import"@radix-ui/react-dialog";import"@radix-ui/react-icons";import"@hookform/resolvers/zod";import"react-hook-form";import"@radix-ui/react-label";import"zod";import"@radix-ui/react-avatar";import"@radix-ui/react-radio-group";import"@radix-ui/react-scroll-area";import"@radix-ui/react-separator";import"@radix-ui/react-accordion";import"@radix-ui/react-alert-dialog";import"@radix-ui/react-popover";
2
+ export{b3 as APP_PERMISSION_FALLBACK_GROUP,b4 as ApiVersion,b5 as AuthApi,b6 as AuthStatus,o as BBAction,b7 as BBScreen,p as BBStatus,b8 as BB_PARAM,b9 as BaseApi,ba as BetaForm,ak as BillingIntervals,bb as BuildBaseBadge,bc as BuildBaseProvider,bd as CURRENCY_DISPLAY,be as CURRENCY_FLAG,bf as ConnectMcpGuide,C as ConnectedAgents,bg as ConnectedAgentsApi,bh as CreditActionsProvider,bi as CreditBalance,bj as CreditBalanceContextProvider,bk as CreditBucketSource,bl as CreditBucketStatus,bm as CreditStorePage,y as CreditTransactionType,bn as DEFAULT_ROLE_PERMISSIONS,R as Devices,bo as DevicesApi,aB as DunningState,E as EmptyState,bp as EventEmitter,bq as FALLBACK_WORKSPACE_ROLE,br as FullScreenLoader,bs as INVITATION_ERROR_CODE,ai as InvoiceStatuses,L as LoadingState,bt as NotificationBell,bu as NotificationInbox,bv as NotificationsApi,bw as PLAN_CURRENCY_CODES,bx as PLAN_CURRENCY_OPTIONS,by as PUSH_SERVICE_WORKER_SCRIPT,bz as PendingInvitations,P as Permission,bA as PricingPage,bB as PushApi,bC as PushNotificationProvider,bD as QuotaUsageContextProvider,bE as SDKEvent,a_ as SETTINGS_SCREENS,bF as SUPPORTED_LOCALES,bc as SaaSOSProvider,s as SectionHeader,T as Sessions,bG as SessionsApi,bH as SettingsApi,aU as SettingsScreen,aW as SidebarNavItem,aV as SidebarNavSection,r as StatusBanner,bI as SubscriptionContextProvider,al as SubscriptionItemType,ao as SubscriptionStatus,bJ as UserApi,bK as WhenAuthenticated,bL as WhenCreditsAvailable,bM as WhenCreditsExhausted,bN as WhenCreditsLow,bO as WhenNoSubscription,bP as WhenNotTrialing,bQ as WhenPendingInvitations,bR as WhenPermission,bS as WhenQuotaAvailable,bT as WhenQuotaExhausted,bU as WhenQuotaOverage,bV as WhenQuotaThreshold,bW as WhenRoles,bX as WhenSubscription,bY as WhenSubscriptionToPlans,bZ as WhenTrialEnding,b_ as WhenTrialing,b$ as WhenUnauthenticated,c0 as WhenUserFeatureDisabled,c1 as WhenUserFeatureEnabled,c2 as WhenWorkspaceFeatureDisabled,c3 as WhenWorkspaceFeatureEnabled,c4 as WhenWorkspaceRoles,c5 as WorkspaceApi,c6 as WorkspaceSwitcher,c7 as actionableInvitations,aa as appPermissionCatalogue,c8 as calculateBillableSeats,c9 as calculateSeatOverageCents,ca as calculateTotalSubscriptionCents,cb as cleanBBParams,cc as clearAuthIntent,cd as clearPendingInvite,ce as coerceBadgeRef,cf as consumeAuthIntent,cg as createBBUrl,aD as createCheckoutRedirectUrls,v as createCreditPurchaseRedirectUrls,ch as eventEmitter,ci as fillMcpTemplate,cj as formatCents,f as formatMinorAmountIntl,ck as formatOverageRate,cl as formatOverageRateWithLabel,cm as formatQuotaIncludedOverage,cn as formatQuotaWithPrice,b1 as getAvailableBillingIntervals,b0 as getAvailableCurrenciesFromPlans,ay as getBasePriceCents,ax as getBillingIntervalAndCurrencyFromPriceId,e as getCurrencyDecimals,a0 as getCurrencyFlag,g as getCurrencySymbol,co as getDisplayCurrency,aA as getPerSeatPriceCents,a$ as getPricingVariant,an as getQuotaDisplayValue,am as getQuotaDisplayWithVariant,aH as getQuotaOverageCents,cp as getQuotaUnitLabelFromName,az as getSeatPricing,aC as getStripePriceIdForInterval,cq as hasPermission,q as invalidateCreditBalance,cr as invalidateQuotaUsage,aE as invalidateSubscription,cs as inviterNameOf,ct as isInvitationActionable,cu as isInvitationError,aR as isInvitationLapsed,cv as isZeroDecimalCurrency,cw as mcpServerKey,aX as mergeUIConfig,cx as minorAmountToDisplay,cy as parkPendingInvite,aO as pickDefaultRole,cz as readBBParams,cA as readPendingInvite,aQ as resendCooldownSeconds,cB as resolveMaxUsers,cC as resolvePermissions,ab as resolveRolePermissions,x as safeRedirect,cD as saveAuthIntent,cE as sortInvitations,cF as useAllQuotaUsage,au as useBillingPortal,as as useCancelSubscription,cG as useConnectedAgents,cH as useConnectedAgentsApi,cI as useConsumeCredits,ar as useCreateCheckoutSession,cJ as useCreditBalance,j as useCreditBalanceContext,k as useCreditPackages,m as useCreditTransactions,cK as useDevices,cL as useDevicesApi,l as useExpiringCredits,cM as useFullScreenLoader,cN as useInvoice,ag as useInvoices,cO as useMcpConnection,cP as useMyInvitations,cQ as useNotifications,cR as useNotificationsApi,h as usePermissions,cS as usePlanGroup,av as usePlanGroupVersions,cT as usePublicCreditPackages,cU as usePublicPlanGroupVersion,cV as usePublicPlans,n as usePurchaseCredits,a7 as usePushNotifications,aF as useQuotaUsageContext,cW as useQuotaUsageStatus,cX as useRecordUsage,at as useResumeSubscription,aJ as useSaaSAuth,cY as useSaaSOs,A as useSaaSSettings,z as useSaaSWorkspaces,aN as useSeatStatus,cZ as useSessions,c_ as useSessionsApi,c$ as useSubscription,aG as useSubscriptionContext,aq as useSubscriptionManagement,u as useTranslation,d0 as useTrialStatus,aP as useUIConfig,i as useUIVisibility,d1 as useUpdateSubscription,d2 as useUsageLogs,d3 as useUserAttributes,d4 as useUserFeatures,aL as useWorkspaceInvitations,d5 as validateInvite,d6 as validateRedirectUrl,d7 as workspaceIdOf,d8 as workspaceNameOf,w as workspaceSettingsManager}from"./chunks/react-4qMM6kB7.mjs";import"react/jsx-runtime";import"react";import"clsx";import"tailwind-merge";import"intl-messageformat";import"@radix-ui/react-slot";import"class-variance-authority";import"lucide-react";import"@radix-ui/react-dialog";import"@radix-ui/react-icons";import"@hookform/resolvers/zod";import"react-hook-form";import"@radix-ui/react-label";import"zod";import"@radix-ui/react-avatar";import"@radix-ui/react-radio-group";import"@radix-ui/react-scroll-area";import"@radix-ui/react-separator";import"@radix-ui/react-accordion";import"@radix-ui/react-alert-dialog";import"@radix-ui/react-popover";
@@ -1 +1 @@
1
- "use strict";const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e=(t,e)=>t>>>e|t<<32-e;function n(n){let r=1779033703,o=3144134277,i=1013904242,a=2773480762,s=1359893119,c=2600822924,l=528734635,u=1541459225;const d=n.length,f=d+1,h=f+(56-f%64+64)%64+8,g=new Uint8Array(h);g.set(n,0),g[d]=128;const p=8*d,b=Math.floor(p/4294967296),w=p>>>0;g[h-8]=b>>>24&255,g[h-7]=b>>>16&255,g[h-6]=b>>>8&255,g[h-5]=255&b,g[h-4]=w>>>24&255,g[h-3]=w>>>16&255,g[h-2]=w>>>8&255,g[h-1]=255&w;const y=new Uint32Array(64);for(let n=0;n<h;n+=64){for(let t=0;t<16;t++){const e=n+4*t;y[t]=g[e]<<24|g[e+1]<<16|g[e+2]<<8|g[e+3]}for(let t=16;t<64;t++){const n=e(y[t-15],7)^e(y[t-15],18)^y[t-15]>>>3,r=e(y[t-2],17)^e(y[t-2],19)^y[t-2]>>>10;y[t]=y[t-16]+n+y[t-7]+r>>>0}let d=r,f=o,h=i,p=a,b=s,w=c,m=l,v=u;for(let n=0;n<64;n++){const r=v+(e(b,6)^e(b,11)^e(b,25))+(b&w^~b&m)+t[n]+y[n]>>>0,o=d&f^d&h^f&h;v=m,m=w,w=b,b=p+r>>>0,p=h,h=f,f=d,d=r+((e(d,2)^e(d,13)^e(d,22))+o>>>0)>>>0}r=r+d>>>0,o=o+f>>>0,i=i+h>>>0,a=a+p>>>0,s=s+b>>>0,c=c+w>>>0,l=l+m>>>0,u=u+v>>>0}const m=new Uint8Array(32),v=[r,o,i,a,s,c,l,u];for(let t=0;t<8;t++)m[4*t]=v[t]>>>24&255,m[4*t+1]=v[t]>>>16&255,m[4*t+2]=v[t]>>>8&255,m[4*t+3]=255&v[t];return m}function r(t){return(new TextEncoder).encode(t)}function o(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function i(t){const{body:e,signature:i,timestamp:a,secret:s,maxAgeSeconds:c=300}=t;if(!(i&&a&&s&&e))return!1;const l="sha256=";if(!i.startsWith(l))return!1;const u=i.slice(7);if(c>0){const t=parseInt(a,10);if(isNaN(t))return!1;if(Math.abs(Math.floor(Date.now()/1e3)-t)>c)return!1}const d=function(t){if(t.length%2!=0)return null;const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=parseInt(t.slice(2*n,2*n+2),16);if(Number.isNaN(r))return null;e[n]=r}return e}(u);if(!d)return!1;const f=function(t,e){let r=t;r.length>64&&(r=n(r));const i=new Uint8Array(64),a=new Uint8Array(64);for(let t=0;t<64;t++){const e=t<r.length?r[t]:0;i[t]=54^e,a[t]=92^e}const s=n(o(i,e));return n(o(a,s))}(r(s),r(`${a}.${e}`));return d.length===f.length&&function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(d,f)}const a=["blog","doc","faq","faq_collection","testimonial","rich_content","collection"],s=t=>`buildbase:${t}`,c=(t,e)=>`buildbase:${t}:${e}`,l=(t,e)=>`buildbase:${t}:id:${e}`,u=new Set(["blog.published","blog.updated","blog.unpublished","blog.deleted","doc.published","doc.updated","doc.unpublished","doc.deleted","faq.updated","faq_collection.updated","testimonial.updated","testimonial.deleted","rich_content.updated","rich_content.deleted","collection.version_published","collection.record_created","collection.record_updated","collection.record_deleted"]);const d=(t,e)=>new Response(JSON.stringify(e),{status:t,headers:{"Content-Type":"application/json"}});async function f(t,e){if("POST"!==t.method)return d(405,{error:"method_not_allowed"});const n=function(t){if(!i(t))return null;try{return JSON.parse(t.body)}catch{return null}}({body:await t.text(),signature:t.headers.get("x-buildbase-signature"),timestamp:t.headers.get("x-buildbase-timestamp"),secret:e.secret,maxAgeSeconds:e.maxAgeSeconds??300});if(!n)return d(401,{error:"invalid_signature"});if(!function(t){return u.has(t)}(n.event))return d(200,{ignored:!0,event:n.event});const r=function(t,e){if(e&&Array.isArray(e.tags)&&e.tags.length>0)return[...new Set(e.tags.filter(t=>"string"==typeof t))];const n=e?.module??t.split(".")[0];if(!a.includes(n))return[];const r=[s(n)];return e?.slug&&r.push(c(n,e.slug)),e?.id&&r.push(l(n,e.id)),"faq.updated"===t&&r.push(s("faq_collection")),r}(n.event,n.data);return e.cache&&await Promise.all(r.map(t=>e.cache.deleteByTag(t))),e.revalidate&&await e.revalidate(r),e.onEvent&&await e.onEvent(n,r),d(200,{revalidated:r})}function h(t,e){return{next:void 0===e?{tags:t}:{tags:t,revalidate:e}}}exports.createNextWebhookHandler=function(t){return e=>f(e,{...t,async revalidate(t){const{revalidateTag:e}=await import("next/cache");for(const n of t)e(n)}})},exports.nextFetchOptions=h,exports.withNextCache=function(t={}){const e=t.revalidate??300;return{cache:!1,requestInit:t=>h(t.tags,e)}};
1
+ "use strict";const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e=(t,e)=>t>>>e|t<<32-e;function n(n){let r=1779033703,o=3144134277,a=1013904242,i=2773480762,s=1359893119,c=2600822924,l=528734635,u=1541459225;const d=n.length,f=d+1,h=f+(56-f%64+64)%64+8,g=new Uint8Array(h);g.set(n,0),g[d]=128;const p=8*d,b=Math.floor(p/4294967296),m=p>>>0;g[h-8]=b>>>24&255,g[h-7]=b>>>16&255,g[h-6]=b>>>8&255,g[h-5]=255&b,g[h-4]=m>>>24&255,g[h-3]=m>>>16&255,g[h-2]=m>>>8&255,g[h-1]=255&m;const w=new Uint32Array(64);for(let n=0;n<h;n+=64){for(let t=0;t<16;t++){const e=n+4*t;w[t]=g[e]<<24|g[e+1]<<16|g[e+2]<<8|g[e+3]}for(let t=16;t<64;t++){const n=e(w[t-15],7)^e(w[t-15],18)^w[t-15]>>>3,r=e(w[t-2],17)^e(w[t-2],19)^w[t-2]>>>10;w[t]=w[t-16]+n+w[t-7]+r>>>0}let d=r,f=o,h=a,p=i,b=s,m=c,y=l,v=u;for(let n=0;n<64;n++){const r=v+(e(b,6)^e(b,11)^e(b,25))+(b&m^~b&y)+t[n]+w[n]>>>0,o=d&f^d&h^f&h;v=y,y=m,m=b,b=p+r>>>0,p=h,h=f,f=d,d=r+((e(d,2)^e(d,13)^e(d,22))+o>>>0)>>>0}r=r+d>>>0,o=o+f>>>0,a=a+h>>>0,i=i+p>>>0,s=s+b>>>0,c=c+m>>>0,l=l+y>>>0,u=u+v>>>0}const y=new Uint8Array(32),v=[r,o,a,i,s,c,l,u];for(let t=0;t<8;t++)y[4*t]=v[t]>>>24&255,y[4*t+1]=v[t]>>>16&255,y[4*t+2]=v[t]>>>8&255,y[4*t+3]=255&v[t];return y}function r(t){return(new TextEncoder).encode(t)}function o(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function a(t){const{body:e,signature:a,timestamp:i,secret:s,maxAgeSeconds:c=300}=t;if(!(a&&i&&s&&e))return!1;const l="sha256=";if(!a.startsWith(l))return!1;const u=a.slice(7);if(c>0){const t=parseInt(i,10);if(isNaN(t))return!1;if(Math.abs(Math.floor(Date.now()/1e3)-t)>c)return!1}const d=function(t){if(t.length%2!=0)return null;const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=parseInt(t.slice(2*n,2*n+2),16);if(Number.isNaN(r))return null;e[n]=r}return e}(u);if(!d)return!1;const f=function(t,e){let r=t;r.length>64&&(r=n(r));const a=new Uint8Array(64),i=new Uint8Array(64);for(let t=0;t<64;t++){const e=t<r.length?r[t]:0;a[t]=54^e,i[t]=92^e}const s=n(o(a,e));return n(o(i,s))}(r(s),r(`${i}.${e}`));return d.length===f.length&&function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(d,f)}const i=["blog","doc","faq","faq_collection","testimonial","rich_content","collection"],s=t=>`buildbase:${t}`,c=(t,e)=>`buildbase:${t}:${e}`,l=(t,e)=>`buildbase:${t}:id:${e}`,u=new Set(["blog.published","blog.updated","blog.unpublished","blog.deleted","doc.published","doc.updated","doc.unpublished","doc.deleted","faq.updated","faq_collection.updated","testimonial.updated","testimonial.deleted","rich_content.updated","rich_content.deleted","collection.version_published","collection.record_created","collection.record_updated","collection.record_deleted"]);const d=(t,e)=>new Response(JSON.stringify(e),{status:t,headers:{"Content-Type":"application/json"}});async function f(t,e){if("POST"!==t.method)return d(405,{error:"method_not_allowed"});const n=function(t){if(!a(t))return null;try{return JSON.parse(t.body)}catch{return null}}({body:await t.text(),signature:t.headers.get("x-buildbase-signature"),timestamp:t.headers.get("x-buildbase-timestamp"),secret:e.secret,maxAgeSeconds:e.maxAgeSeconds??300});if(!n)return d(401,{error:"invalid_signature"});if(!function(t){return u.has(t)}(n.event))return d(200,{ignored:!0,event:n.event});const r=function(t,e){if(e&&Array.isArray(e.tags)&&e.tags.length>0)return[...new Set(e.tags.filter(t=>"string"==typeof t))];const n=e?.module??t.split(".")[0];if(!i.includes(n))return[];const r=[s(n)];return e?.slug&&r.push(c(n,e.slug)),e?.id&&r.push(l(n,e.id)),"faq.updated"===t&&r.push(s("faq_collection")),r}(n.event,n.data);return e.cache&&await Promise.all(r.map(t=>e.cache.deleteByTag(t))),e.revalidate&&await e.revalidate(r),e.onEvent&&await e.onEvent(n,r),d(200,{revalidated:r})}function h(t,e){return{next:void 0===e?{tags:t}:{tags:t,revalidate:e}}}exports.createNextWebhookHandler=function(t){return e=>f(e,{...t,async revalidate(t){const e=await import("next/cache");for(const n of t)e.revalidateTag(n,"max")}})},exports.nextFetchOptions=h,exports.withNextCache=function(t={}){const e=t.revalidate??300;return{cache:!1,requestInit:t=>h(t.tags,e)}};
@@ -1 +1 @@
1
- const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e=(t,e)=>t>>>e|t<<32-e;function n(n){let r=1779033703,o=3144134277,i=1013904242,a=2773480762,s=1359893119,c=2600822924,l=528734635,u=1541459225;const d=n.length,f=d+1,g=f+(56-f%64+64)%64+8,h=new Uint8Array(g);h.set(n,0),h[d]=128;const p=8*d,b=Math.floor(p/4294967296),y=p>>>0;h[g-8]=b>>>24&255,h[g-7]=b>>>16&255,h[g-6]=b>>>8&255,h[g-5]=255&b,h[g-4]=y>>>24&255,h[g-3]=y>>>16&255,h[g-2]=y>>>8&255,h[g-1]=255&y;const m=new Uint32Array(64);for(let n=0;n<g;n+=64){for(let t=0;t<16;t++){const e=n+4*t;m[t]=h[e]<<24|h[e+1]<<16|h[e+2]<<8|h[e+3]}for(let t=16;t<64;t++){const n=e(m[t-15],7)^e(m[t-15],18)^m[t-15]>>>3,r=e(m[t-2],17)^e(m[t-2],19)^m[t-2]>>>10;m[t]=m[t-16]+n+m[t-7]+r>>>0}let d=r,f=o,g=i,p=a,b=s,y=c,w=l,v=u;for(let n=0;n<64;n++){const r=v+(e(b,6)^e(b,11)^e(b,25))+(b&y^~b&w)+t[n]+m[n]>>>0,o=d&f^d&g^f&g;v=w,w=y,y=b,b=p+r>>>0,p=g,g=f,f=d,d=r+((e(d,2)^e(d,13)^e(d,22))+o>>>0)>>>0}r=r+d>>>0,o=o+f>>>0,i=i+g>>>0,a=a+p>>>0,s=s+b>>>0,c=c+y>>>0,l=l+w>>>0,u=u+v>>>0}const w=new Uint8Array(32),v=[r,o,i,a,s,c,l,u];for(let t=0;t<8;t++)w[4*t]=v[t]>>>24&255,w[4*t+1]=v[t]>>>16&255,w[4*t+2]=v[t]>>>8&255,w[4*t+3]=255&v[t];return w}function r(t){return(new TextEncoder).encode(t)}function o(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function i(t){const{body:e,signature:i,timestamp:a,secret:s,maxAgeSeconds:c=300}=t;if(!(i&&a&&s&&e))return!1;const l="sha256=";if(!i.startsWith(l))return!1;const u=i.slice(7);if(c>0){const t=parseInt(a,10);if(isNaN(t))return!1;if(Math.abs(Math.floor(Date.now()/1e3)-t)>c)return!1}const d=function(t){if(t.length%2!=0)return null;const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=parseInt(t.slice(2*n,2*n+2),16);if(Number.isNaN(r))return null;e[n]=r}return e}(u);if(!d)return!1;const f=function(t,e){let r=t;r.length>64&&(r=n(r));const i=new Uint8Array(64),a=new Uint8Array(64);for(let t=0;t<64;t++){const e=t<r.length?r[t]:0;i[t]=54^e,a[t]=92^e}const s=n(o(i,e));return n(o(a,s))}(r(s),r(`${a}.${e}`));return d.length===f.length&&function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(d,f)}const a=["blog","doc","faq","faq_collection","testimonial","rich_content","collection"],s=t=>`buildbase:${t}`,c=(t,e)=>`buildbase:${t}:${e}`,l=(t,e)=>`buildbase:${t}:id:${e}`,u=new Set(["blog.published","blog.updated","blog.unpublished","blog.deleted","doc.published","doc.updated","doc.unpublished","doc.deleted","faq.updated","faq_collection.updated","testimonial.updated","testimonial.deleted","rich_content.updated","rich_content.deleted","collection.version_published","collection.record_created","collection.record_updated","collection.record_deleted"]);const d=(t,e)=>new Response(JSON.stringify(e),{status:t,headers:{"Content-Type":"application/json"}});async function f(t,e){if("POST"!==t.method)return d(405,{error:"method_not_allowed"});const n=function(t){if(!i(t))return null;try{return JSON.parse(t.body)}catch{return null}}({body:await t.text(),signature:t.headers.get("x-buildbase-signature"),timestamp:t.headers.get("x-buildbase-timestamp"),secret:e.secret,maxAgeSeconds:e.maxAgeSeconds??300});if(!n)return d(401,{error:"invalid_signature"});if(!function(t){return u.has(t)}(n.event))return d(200,{ignored:!0,event:n.event});const r=function(t,e){if(e&&Array.isArray(e.tags)&&e.tags.length>0)return[...new Set(e.tags.filter(t=>"string"==typeof t))];const n=e?.module??t.split(".")[0];if(!a.includes(n))return[];const r=[s(n)];return e?.slug&&r.push(c(n,e.slug)),e?.id&&r.push(l(n,e.id)),"faq.updated"===t&&r.push(s("faq_collection")),r}(n.event,n.data);return e.cache&&await Promise.all(r.map(t=>e.cache.deleteByTag(t))),e.revalidate&&await e.revalidate(r),e.onEvent&&await e.onEvent(n,r),d(200,{revalidated:r})}function g(t,e){return{next:void 0===e?{tags:t}:{tags:t,revalidate:e}}}function h(t={}){const e=t.revalidate??300;return{cache:!1,requestInit:t=>g(t.tags,e)}}function p(t){return e=>f(e,{...t,async revalidate(t){const{revalidateTag:e}=await import("next/cache");for(const n of t)e(n)}})}export{p as createNextWebhookHandler,g as nextFetchOptions,h as withNextCache};
1
+ const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e=(t,e)=>t>>>e|t<<32-e;function n(n){let r=1779033703,o=3144134277,a=1013904242,i=2773480762,s=1359893119,c=2600822924,l=528734635,u=1541459225;const d=n.length,f=d+1,g=f+(56-f%64+64)%64+8,h=new Uint8Array(g);h.set(n,0),h[d]=128;const p=8*d,b=Math.floor(p/4294967296),m=p>>>0;h[g-8]=b>>>24&255,h[g-7]=b>>>16&255,h[g-6]=b>>>8&255,h[g-5]=255&b,h[g-4]=m>>>24&255,h[g-3]=m>>>16&255,h[g-2]=m>>>8&255,h[g-1]=255&m;const y=new Uint32Array(64);for(let n=0;n<g;n+=64){for(let t=0;t<16;t++){const e=n+4*t;y[t]=h[e]<<24|h[e+1]<<16|h[e+2]<<8|h[e+3]}for(let t=16;t<64;t++){const n=e(y[t-15],7)^e(y[t-15],18)^y[t-15]>>>3,r=e(y[t-2],17)^e(y[t-2],19)^y[t-2]>>>10;y[t]=y[t-16]+n+y[t-7]+r>>>0}let d=r,f=o,g=a,p=i,b=s,m=c,w=l,v=u;for(let n=0;n<64;n++){const r=v+(e(b,6)^e(b,11)^e(b,25))+(b&m^~b&w)+t[n]+y[n]>>>0,o=d&f^d&g^f&g;v=w,w=m,m=b,b=p+r>>>0,p=g,g=f,f=d,d=r+((e(d,2)^e(d,13)^e(d,22))+o>>>0)>>>0}r=r+d>>>0,o=o+f>>>0,a=a+g>>>0,i=i+p>>>0,s=s+b>>>0,c=c+m>>>0,l=l+w>>>0,u=u+v>>>0}const w=new Uint8Array(32),v=[r,o,a,i,s,c,l,u];for(let t=0;t<8;t++)w[4*t]=v[t]>>>24&255,w[4*t+1]=v[t]>>>16&255,w[4*t+2]=v[t]>>>8&255,w[4*t+3]=255&v[t];return w}function r(t){return(new TextEncoder).encode(t)}function o(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function a(t){const{body:e,signature:a,timestamp:i,secret:s,maxAgeSeconds:c=300}=t;if(!(a&&i&&s&&e))return!1;const l="sha256=";if(!a.startsWith(l))return!1;const u=a.slice(7);if(c>0){const t=parseInt(i,10);if(isNaN(t))return!1;if(Math.abs(Math.floor(Date.now()/1e3)-t)>c)return!1}const d=function(t){if(t.length%2!=0)return null;const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=parseInt(t.slice(2*n,2*n+2),16);if(Number.isNaN(r))return null;e[n]=r}return e}(u);if(!d)return!1;const f=function(t,e){let r=t;r.length>64&&(r=n(r));const a=new Uint8Array(64),i=new Uint8Array(64);for(let t=0;t<64;t++){const e=t<r.length?r[t]:0;a[t]=54^e,i[t]=92^e}const s=n(o(a,e));return n(o(i,s))}(r(s),r(`${i}.${e}`));return d.length===f.length&&function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(d,f)}const i=["blog","doc","faq","faq_collection","testimonial","rich_content","collection"],s=t=>`buildbase:${t}`,c=(t,e)=>`buildbase:${t}:${e}`,l=(t,e)=>`buildbase:${t}:id:${e}`,u=new Set(["blog.published","blog.updated","blog.unpublished","blog.deleted","doc.published","doc.updated","doc.unpublished","doc.deleted","faq.updated","faq_collection.updated","testimonial.updated","testimonial.deleted","rich_content.updated","rich_content.deleted","collection.version_published","collection.record_created","collection.record_updated","collection.record_deleted"]);const d=(t,e)=>new Response(JSON.stringify(e),{status:t,headers:{"Content-Type":"application/json"}});async function f(t,e){if("POST"!==t.method)return d(405,{error:"method_not_allowed"});const n=function(t){if(!a(t))return null;try{return JSON.parse(t.body)}catch{return null}}({body:await t.text(),signature:t.headers.get("x-buildbase-signature"),timestamp:t.headers.get("x-buildbase-timestamp"),secret:e.secret,maxAgeSeconds:e.maxAgeSeconds??300});if(!n)return d(401,{error:"invalid_signature"});if(!function(t){return u.has(t)}(n.event))return d(200,{ignored:!0,event:n.event});const r=function(t,e){if(e&&Array.isArray(e.tags)&&e.tags.length>0)return[...new Set(e.tags.filter(t=>"string"==typeof t))];const n=e?.module??t.split(".")[0];if(!i.includes(n))return[];const r=[s(n)];return e?.slug&&r.push(c(n,e.slug)),e?.id&&r.push(l(n,e.id)),"faq.updated"===t&&r.push(s("faq_collection")),r}(n.event,n.data);return e.cache&&await Promise.all(r.map(t=>e.cache.deleteByTag(t))),e.revalidate&&await e.revalidate(r),e.onEvent&&await e.onEvent(n,r),d(200,{revalidated:r})}function g(t,e){return{next:void 0===e?{tags:t}:{tags:t,revalidate:e}}}function h(t={}){const e=t.revalidate??300;return{cache:!1,requestInit:t=>g(t.tags,e)}}function p(t){return e=>f(e,{...t,async revalidate(t){const e=await import("next/cache");for(const n of t)e.revalidateTag(n,"max")}})}export{p as createNextWebhookHandler,g as nextFetchOptions,h as withNextCache};
@@ -1,103 +1,66 @@
1
1
  # Error Codes Reference
2
2
 
3
- This document lists error codes used in the BuildBase SDK and their meanings. These codes can be used with `createSDKError()` and may be set on `SDKError.code` when the SDK throws. Not every code is used in every release; this doc serves as the canonical reference.
4
-
5
- ## SDK Error Codes
6
-
7
- ### Authentication Errors
8
-
9
- | Code | Description | When It Occurs |
10
- | ----------------- | ----------------------- | ----------------------------------------------------------------------- |
11
- | `AUTH_FAILED` | Authentication failed | When OAuth flow fails or user cannot be authenticated |
12
- | `AUTH_REQUIRED` | Authentication required | When an operation requires authentication but user is not authenticated |
13
- | `SESSION_EXPIRED` | Session expired | When user session has expired and needs to be refreshed |
14
- | `INVALID_SESSION` | Invalid session | When session data is corrupted or invalid |
15
-
16
- ### Network Errors
17
-
18
- | Code | Description | When It Occurs |
19
- | ----------------- | ------------------------- | ----------------------------------------------------------- |
20
- | `NETWORK_ERROR` | Network connection failed | When fetch fails due to network issues (offline, DNS, CORS) |
21
- | `REQUEST_TIMEOUT` | Request timeout | When request exceeds timeout duration |
22
- | `ABORT_ERROR` | Request aborted | When request is cancelled via AbortController |
23
-
24
- ### API Errors
25
-
26
- | Code | Description | When It Occurs |
27
- | -------------- | ------------------- | ------------------------------------------ |
28
- | `API_ERROR` | Generic API error | When API returns an error response |
29
- | `BAD_REQUEST` | Bad request (400) | When request is malformed or invalid |
30
- | `UNAUTHORIZED` | Unauthorized (401) | When authentication is required or invalid |
31
- | `FORBIDDEN` | Forbidden (403) | When user doesn't have permission |
32
- | `NOT_FOUND` | Not found (404) | When resource doesn't exist |
33
- | `SERVER_ERROR` | Server error (500+) | When server encounters an error |
34
-
35
- ### Workspace Errors
36
-
37
- | Code | Description | When It Occurs |
38
- | -------------------------- | ------------------------ | -------------------------------------------------------- |
39
- | `WORKSPACE_NOT_FOUND` | Workspace not found | When workspace doesn't exist or user doesn't have access |
40
- | `WORKSPACE_ACCESS_DENIED` | Workspace access denied | When user doesn't have permission to access workspace |
41
- | `WORKSPACE_OWNER_REQUIRED` | Workspace owner required | When operation requires workspace owner (e.g., delete) |
42
- | `INVALID_WORKSPACE_ID` | Invalid workspace ID | When workspace ID format is invalid |
43
-
44
- ### Workspace Invitation Errors
45
-
46
- Thrown by `inviteMember`, `resendInvitation`, `revokeInvitation`, `acceptInvitation`, `declineInvitation` and `previewInvitation`. The error is a plain `Error` with `status` and `code` properties, plus the fields listed; check with `isInvitationError(err)`.
47
-
48
- | Code | HTTP | When It Occurs | Extra fields |
49
- | ---------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
50
- | `SEAT_LIMIT_REACHED` | 402 | Members plus pending invitations fill the plan's seats or `maxWorkspaceUsers` | `currentUserCount`, `limit` |
51
- | `INVITATION_NOT_FOUND` | 404 | Unknown id, or a revoked link | |
52
- | `INVITATION_ALREADY_HANDLED` | 409 | Already accepted, declined, or already a live invitation for that address | `invitationStatus`, `invitationId` |
53
- | `INVITATION_EXPIRED` | 410 | Past its 14 days, or the workspace no longer exists | |
54
- | `INVITATION_EMAIL_MISMATCH` | 403 | The signed-in account is not the invited address | `invitedEmail` (scrambled) |
55
- | `EMAIL_NOT_VERIFIED` | 403 | Accepting from the list needs a verified email. An accept carrying the link's `token` proves the address instead | |
56
- | `WORKSPACE_INVITES_DISABLED` | 403 | The organization's workspace mode does not allow invitations | |
57
- | `INVITATION_RATE_LIMITED` | 429 | Resend inside the cooldown, or the hourly/daily send budget | `retryAfterSeconds` (resend only) |
58
- | `INVITATION_EMAIL_FAILED` | 502 | The invitation email could not be sent; nothing was created | |
59
- | `USER_BLOCKED` | 403 | The invited or accepting account is blocked | |
60
-
61
- ### Notification Send Errors
62
-
63
- | Code | HTTP | When It Occurs | Extra fields |
64
- | ------------------------------- | ---- | -------------------------------------------------------------------------------------------------------------------------- | ------------ |
65
- | `NOTIFICATION_EVENT_NOT_SET_UP` | 403 | `notification.send()` named a slug the org has not set up and the plan's custom-event limit is reached (server release 22) | |
66
- | `NO_SENDER_CONFIGURED` | 503 | The organization has no usable email sender, so nothing can be sent | |
67
-
68
- ### User Management Errors
69
-
70
- | Code | Description | When It Occurs |
71
- | -------------------------- | ------------------------ | -------------------------------------------- |
72
- | `USER_NOT_FOUND` | User not found | When user doesn't exist |
73
- | `USER_ALREADY_EXISTS` | User already exists | When trying to add user that already exists |
74
- | `CANNOT_REMOVE_OWNER` | Cannot remove owner | When trying to remove workspace owner |
75
- | `CANNOT_CHANGE_OWNER_ROLE` | Cannot change owner role | When trying to change workspace owner's role |
76
-
77
- ### Subscription Errors
78
-
79
- | Code | Description | When It Occurs |
80
- | ------------------------ | ---------------------- | ------------------------------------ |
81
- | `SUBSCRIPTION_NOT_FOUND` | Subscription not found | When workspace has no subscription |
82
- | `SUBSCRIPTION_ERROR` | Subscription error | When subscription operation fails |
83
- | `CHECKOUT_ERROR` | Checkout error | When checkout session creation fails |
84
- | `PLAN_NOT_FOUND` | Plan not found | When plan doesn't exist |
85
-
86
- ### Configuration Errors
87
-
88
- | Code | Description | When It Occurs |
89
- | -------------------- | ----------------------- | ------------------------------------------ |
90
- | `INVALID_CONFIG` | Invalid configuration | When SDK configuration is invalid |
91
- | `INVALID_SERVER_URL` | Invalid server URL | When serverUrl is not a valid URL |
92
- | `INVALID_ORG_ID` | Invalid organization ID | When orgId is not a valid MongoDB ObjectId |
93
- | `INVALID_VERSION` | Invalid API version | When API version is not supported |
94
-
95
- ### Generic Errors
96
-
97
- | Code | Description | When It Occurs |
98
- | ------------------ | ---------------- | ------------------------------------ |
99
- | `UNKNOWN_ERROR` | Unknown error | When error type cannot be determined |
100
- | `VALIDATION_ERROR` | Validation error | When input validation fails |
3
+ The `code` values the SDK actually sets on a thrown error, and where each one
4
+ comes from. Match on these; an error with no `code` is matched by its
5
+ situation, not by its message.
6
+
7
+ Earlier revisions of this page listed forty-three codes covering authentication,
8
+ network, API, workspace and validation failures. Those names come from a JSDoc
9
+ example on `createSDKError()` and nothing throws them, so code written against
10
+ them never matched. They are gone rather than marked, because a reference whose
11
+ rows have to be checked against the source is doing the opposite of its job.
12
+
13
+ ## Invitation codes
14
+
15
+ `InvitationError`, thrown by the invitation calls on `bb.workspaces`. The full
16
+ list lives in `INVITATION_ERROR_CODE`, and each carries the HTTP `status` the
17
+ server answered with.
18
+
19
+ | Code | When it occurs |
20
+ | ---------------------------- | ------------------------------------------------------------------- |
21
+ | `INVITATION_NOT_FOUND` | No invitation matches the token |
22
+ | `INVITATION_EXPIRED` | The invitation is past its expiry |
23
+ | `INVITATION_ALREADY_HANDLED` | Already accepted, declined or revoked |
24
+ | `INVITATION_EMAIL_MISMATCH` | The signed-in address is not the one invited |
25
+ | `EMAIL_NOT_VERIFIED` | The accepting account has not verified its address |
26
+ | `WORKSPACE_INVITES_DISABLED` | The workspace does not allow invitations |
27
+ | `INVITATION_RATE_LIMITED` | Too many invitations in the window |
28
+ | `INVITATION_EMAIL_FAILED` | The invitation was created but its mail could not be sent |
29
+ | `SEAT_LIMIT_REACHED` | The plan has no seat for another member |
30
+ | `USER_BLOCKED` | The invited or accepting account is blocked |
31
+ | `NO_SENDER_CONFIGURED` | The organization has no usable email sender, so nothing can be sent |
32
+
33
+ ## Credit codes
34
+
35
+ | Code | When it occurs |
36
+ | ---------------------- | ----------------------------------------------------------------------------------------------- |
37
+ | `INSUFFICIENT_CREDITS` | A spend exceeds the balance. Carries `available` and `requested`, and the server answered `402` |
38
+
39
+ ## App bridge codes
40
+
41
+ `AppBridgeError`, from `verifyClientJwt()` and the app-token helpers. Lower case,
42
+ because they are the values the OAuth error responses carry.
43
+
44
+ | Code | When it occurs |
45
+ | --------------------- | ------------------------------------------------ |
46
+ | `invalid_token` | The token is malformed or cannot be parsed |
47
+ | `invalid_signature` | The signature does not verify |
48
+ | `invalid_algorithm` | The token is signed with an unexpected algorithm |
49
+ | `invalid_issuer` | `iss` is not the expected issuer |
50
+ | `invalid_audience` | `aud` does not contain the audience you passed |
51
+ | `invalid_secret` | The verifying secret is missing or unusable |
52
+ | `token_expired` | `exp` is in the past |
53
+ | `token_not_yet_valid` | `nbf` is in the future |
54
+
55
+ `handleAppTokenRequest()` and `handleAppRevokeRequest()` catch these and answer
56
+ `401` with the code as the body's `message`, so you handle `AppBridgeError`
57
+ yourself only when you call the verify functions directly.
58
+
59
+ ## Tracking codes
60
+
61
+ The `code` on an `sdk_error` tracking event is `SDK_ERROR` when the operation
62
+ threw an `Error`, and `UNKNOWN_ERROR` when it threw something that was not one.
63
+ `component` and `action` on the same event say which operation failed.
101
64
 
102
65
  ## HTTP Status Code Mappings
103
66
 
package/docs/THEMING.md CHANGED
@@ -4,16 +4,26 @@ All SDK components — settings screens, dialogs, banners, empty states, sidebar
4
4
 
5
5
  ## How it works
6
6
 
7
- The SDK stylesheet (`@buildbase/sdk/css/styles.css`) defines a default light theme on `:root` and a dark theme on `.dark`. Every color in the UI resolves from these variables, so overriding them re-skins everything at once.
7
+ The SDK stylesheet (`@buildbase/sdk/css/styles.css`) declares its variables on
8
+ `.saas-os-ui`, the class the SDK puts on its own container, and its dark values
9
+ on `.dark .saas-os-ui, .saas-os-ui .dark, .saas-os-ui.dark`. Every color in the
10
+ UI resolves from these variables, so overriding them re-skins everything at
11
+ once.
12
+
13
+ Scoped to that class rather than `:root` so the SDK cannot restyle your app:
14
+ variables with these names in your own design system keep their values
15
+ everywhere outside SDK UI. It also means an override on `:root` alone is
16
+ shadowed by the SDK's own, more specific rule, so write yours against the same
17
+ selector.
8
18
 
9
19
  Values are **HSL triplets without the `hsl()` wrapper** (shadcn/ui convention), which lets the SDK derive tints — e.g. success banners use `hsl(var(--success) / 0.1)` for their background automatically.
10
20
 
11
21
  ## Override example
12
22
 
13
- Load your overrides after the SDK stylesheet:
23
+ Load your overrides after the SDK stylesheet, against the SDK's own selector:
14
24
 
15
25
  ```css
16
- :root {
26
+ .saas-os-ui {
17
27
  /* Brand */
18
28
  --primary: 262 83% 58%; /* your brand color — buttons, active nav, focus */
19
29
  --primary-foreground: 0 0% 100%;
@@ -54,7 +64,28 @@ Load your overrides after the SDK stylesheet:
54
64
 
55
65
  ## Dark mode
56
66
 
57
- Add the `.dark` class to a root element and override the same variables under `.dark { … }`. The SDK ships dark defaults for every variable.
67
+ The SDK ships dark values for every variable, and its selectors match a `dark`
68
+ class **on any ancestor** as well as on the container itself. So a `dark` class
69
+ on `<html>`, which is what next-themes and Tailwind's `darkMode: 'class'`
70
+ write, switches SDK UI with no CSS of your own (SDK 0.0.71 or later; before
71
+ that only `.saas-os-ui .dark` matched, so a class on `<html>` did nothing).
72
+
73
+ To change the dark palette, override the same variables under
74
+ `.dark .saas-os-ui`:
75
+
76
+ ```css
77
+ .dark .saas-os-ui {
78
+ --primary: 263 70% 65%;
79
+ --primary-foreground: 0 0% 100%;
80
+ }
81
+ ```
82
+
83
+ That has the same specificity as the SDK's own dark rule, so load your
84
+ stylesheet after it.
85
+
86
+ To follow the operating system instead of a class, put the full dark palette
87
+ inside `@media (prefers-color-scheme: dark) { .saas-os-ui { … } }`. The shipped
88
+ CSS has no media query of its own, so nothing competes with it.
58
89
 
59
90
  ## Components that work without the stylesheet
60
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildbase/sdk",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "type": "module",
5
5
  "description": "A SDK for Buildbase",
6
6
  "main": "dist/index.cjs",
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import i,{useState as s,useMemo as n,useEffect as a}from"react";import{a$ as d,ak as l,u as c,ax as o,b0 as u,al as m,aw as p,D as b,a as g,b as h,c as x,a0 as f,ay as y,az as N,aA as v,B as k,am as w,an as _,b1 as C,aj as I}from"./react-DkhpyQTr.mjs";import"clsx";import"tailwind-merge";import"intl-messageformat";import"@radix-ui/react-slot";import"class-variance-authority";import"lucide-react";import"@radix-ui/react-dialog";import"@radix-ui/react-icons";import"@hookform/resolvers/zod";import"react-hook-form";import"@radix-ui/react-label";import"zod";import"@radix-ui/react-avatar";import"@radix-ui/react-radio-group";import"@radix-ui/react-scroll-area";import"@radix-ui/react-separator";import"@radix-ui/react-accordion";import"@radix-ui/react-alert-dialog";import"@radix-ui/react-popover";const P={[l.Monthly]:"subscription.billingInterval.perMonth",[l.Quarterly]:"subscription.billingInterval.perQuarter",[l.Yearly]:"subscription.billingInterval.perYear"},S=(e,r,t)=>{if(!e||0===e)return null;let i;switch(t){case l.Yearly:i=r/12;break;case l.Quarterly:i=r/3;break;default:return null}const s=(e-i)/e*100;return s>0?Math.round(s):null},M=(e,r)=>d(e,r)?r:e.plan?.currency??r??"",L=e=>e.renewOnPeriod?"reset"===e.mode?"subscription.items.creditModeReset":"subscription.items.creditModeTopup":"subscription.items.creditModeLifetime",z=({planVersion:t})=>{const{t:i,fmtNum:s}=c(),n=t.creditGrant;return n?.enabled&&"object"==typeof n.creditPackage&&null!==n.creditPackage?e("div",{className:"mb-3",children:[r("div",{className:"text-xs font-semibold text-info uppercase tracking-wider mb-1.5",children:i("subscription.items.credits")}),e("div",{className:"space-y-1 text-sm",children:[e("div",{className:"flex justify-between",children:[r("span",{className:"text-muted-foreground",children:n.renewOnPeriod?i("subscription.items.creditsPerMonth"):i("subscription.items.creditsOneTime")}),r("span",{className:"font-semibold text-info",children:s(n.creditPackage.creditAmount)})]}),e("div",{className:"flex justify-between",children:[r("span",{className:"text-muted-foreground",children:i("subscription.items.creditRenewal")}),r("span",{className:"font-medium text-foreground",children:i(L(n))})]})]})]}):null},j=({hasVariant:i,price:s,displayCurrency:n,selectedInterval:a,getIntervalLabel:d})=>{const{t:l,fmtCents:o}=c();return e(t,{children:[r("span",{className:"text-2xl font-bold text-foreground",children:i&&null!==s?(u=s,m=n,(null==u||0===u?"":o(u,m))||l("pricing.free")):"—"}),null!==s&&s>0&&i&&r("span",{className:"text-sm text-muted-foreground",children:d(a)})]});var u,m},D=({planVersion:e,isCurrent:t,trialUsedAt:i,currentStripePriceId:s})=>{const{t:n}=c(),a=e.trial;return a?.enabled&&a.durationDays>0&&!t&&!i&&!s?r("span",{className:"shrink-0 rounded-md bg-success/15 text-success px-2 py-0.5 text-xs font-semibold uppercase tracking-wider",children:n("subscription.trialBadge",{days:a.durationDays})}):null},K=({open:d,onOpenChange:K,source:O,planVersions:V,currentPlanVersionId:Q,currentStripePriceId:U,billingCurrency:A,currentMemberCount:F,trialUsedAt:G,workspaceName:q,initialInterval:T,initialCurrency:W,onSelectPlan:Y,loading:$=!1})=>{const[R,H]=s(!1),{t:B,formattingLocale:E,dir:J,fmtNum:X,fmtCents:Z}=c(),ee=e=>B(P[e]??P[l.Monthly]),[re,te]=s(null),ie=i.useRef(!1),se=n(()=>o(U,V),[U,V]),ne=se?.interval??null,ae=se?.currency??null,de=n(()=>u(V),[V]),le=n(()=>{const e=A?.trim().toLowerCase();return e?de.includes(e)?[e]:[]:de},[A,de]),[ce,oe]=s(T||ne||l.Monthly),[ue,me]=s(()=>W&&le.includes(W)?W:ae&&le.includes(ae)?ae:le.length>0?le[0]:""),pe=A?.trim()||ue;a(()=>{if(d){oe(T||ne||l.Monthly);const e=W||ae;e&&le.includes(e)?me(e):le.length>0&&!le.includes(ue)&&me(le[0])}},[d,T,W,ne,ae,le]);const be=V,ge=n(()=>(e=>{const r=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{r.has(e._id)||r.set(e._id,e)})}),Array.from(r.values())})(be),[be]),he=ge.filter(e=>e.type===m.Feature),xe=ge.filter(e=>e.type===m.Limit),fe=ge.filter(e=>e.type===m.Quota),{emit:ye,ready:Ne}=p(),ve=i.useRef(!1),ke=i.useRef(!1);a(()=>{if(!d)return ve.current&&!ke.current&&ye("plan_picker_dismissed",{source:O,billing_interval:ce}),ve.current=!1,void(ke.current=!1);!ve.current&&Ne&&(ve.current=!0,ye("plan_picker_opened",{source:O,plan_count:V.length,has_subscription:!!Q,current_plan_version_id:Q,billing_interval:ce,currency:pe?pe.toUpperCase():void 0}))},[d,Ne]);const we=e=>{if(!Q)return"new";if(e._id===Q)return"interval_change";const r=V.find(e=>e._id===Q),t=r?y(r,pe,ce):null,i=y(e,pe,ce);return null==t||null==i?"change":i>=t?"upgrade":"downgrade"},_e=async e=>{if(e===Q&&ne===ce||$||R||ie.current)return;const r=V.find(r=>r._id===e);if(r){const t=y(r,pe,ce);ke.current=!0,ye("plan_selected",{source:O,plan_version_id:e,plan_slug:r.plan?.slug,billing_interval:ce,currency:pe?pe.toUpperCase():void 0,value:null==t?void 0:C(t,pe),change:we(r),is_free:!!r.plan?.isFreemium})}ie.current=!0,H(!0),te(e);try{await Y(e,ce,pe),K(!1)}catch(e){}finally{ie.current=!1,H(!1),te(null)}},Ce=e=>y(e,pe,ce),Ie=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===pe.toLowerCase()),Pe=$||R,Se=e=>{switch(e){case l.Monthly:return B("subscription.billingInterval.monthly");case l.Quarterly:return B("subscription.billingInterval.quarterly");case l.Yearly:return B("subscription.billingInterval.yearly");default:return B("subscription.billingInterval.monthly")}},Me=e=>{const r=e._id===Q,t=ne===ce;if(r&&t)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(r&&!t)return e.plan?.isFreemium?{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0}:{labelKey:"_dynamic",dynamicLabel:B("subscription.switchToInterval",{interval:Se(ce)}),variant:"default",disabled:!1};const i=e.trial?.enabled&&e.trial.durationDays>0&&!G&&!U;if(!Q)return i?{labelKey:"_dynamic",dynamicLabel:B("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const s=be.findIndex(e=>e._id===Q),n=be.findIndex(r=>r._id===e._id);return-1===s||-1===n?i?{labelKey:"_dynamic",dynamicLabel:B("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:n<s?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:n>s?i?{labelKey:"_dynamic",dynamicLabel:B("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},Le=(e,r,t=l.Monthly)=>{if(r.type===m.Feature)return e.features?.[r.slug]??!1;if(r.type===m.Limit)return e.limits?.[r.slug]??null;if(r.type===m.Quota){const i=w(e,pe,r.slug,t);return i||_(e.quotas?.[r.slug],t)}return null},ze=(e,r,t)=>{if(r.type===m.Feature)return!0===e?"✓":"—";if(r.type===m.Limit)return null!=e&&"number"==typeof e?X(e):"—";if(r.type===m.Quota){const i=I("object"==typeof e&&null!==e&&"included"in e?e:null,r.name.toLowerCase(),{currency:t,locale:E});return i?i.allowOverage?i.hasOverage?B("quota.includedWithOverage",{count:i.included,price:i.price,unit:i.unit}):B("quota.includedOnly",{count:i.included}):B("quota.includedHardLimit",{count:i.included}):"—"}return"—"};return r(b,{open:d,onOpenChange:K,children:e(g,{dir:J,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e("div",{children:[r(h,{className:"text-xl font-semibold",children:B("pricing.title")}),e(x,{className:"mt-1 text-sm",children:[B("subscription.choosePlanDescription"),q&&r("span",{className:"ml-1 font-medium text-foreground",children:B("subscription.forWorkspace",{name:q})})]})]}),e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e("div",{className:"flex items-center gap-2",children:[!A?.trim()&&le.length>1&&e(t,{children:[r("span",{className:"text-sm text-muted-foreground",children:B("pricing.currency")}),r("select",{"aria-label":B("pricing.selectCurrency"),value:ue,onChange:e=>me(e.target.value),className:"rounded-md border border-border bg-background px-3 py-2 text-sm font-medium text-foreground shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:le.map(e=>{const t=f(e);return r("option",{value:e,children:t?`${t} ${e.toUpperCase()}`:e.toUpperCase()},e)})})]}),A?.trim()&&r("span",{className:"text-xs text-muted-foreground",children:B("subscription.billingInCurrency",{currency:A.toUpperCase()})})]}),r("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-muted rounded-lg w-full sm:w-auto",role:"group","aria-label":B("pricing.billingInterval"),children:[l.Monthly,l.Quarterly,l.Yearly].map(t=>{const i=ne===t;return r("button",{onClick:()=>(e=>{e!==ce&&ye("billing_interval_changed",{from:ce,to:e}),oe(e)})(t),"aria-pressed":ce===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(ce===t?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===l.Monthly&&B("subscription.billingInterval.monthly"),t===l.Quarterly&&B("subscription.billingInterval.quarterly"),t===l.Yearly&&B("subscription.billingInterval.yearly"),t===l.Yearly&&r("span",{className:"text-xs px-1 sm:px-1.5 py-0.5 bg-success/15 text-success rounded-full font-semibold",children:B("pricing.save")}),i&&Q&&r("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-info/15 text-info rounded-full font-semibold",children:B("pricing.current")})]})},t)})})]})]}),r("div",{className:"flex-1 min-h-0 flex flex-col",children:A?.trim()&&0===le.length?e("div",{className:"text-center py-12 px-4",children:[r("p",{className:"text-muted-foreground font-medium",children:B("pricing.noPlansCurrency")}),r("p",{className:"text-muted-foreground text-sm mt-2",children:B("pricing.noPlansCurrencyHint")})]}):0===be.length?r("div",{className:"text-center py-12 text-muted-foreground",children:r("p",{children:B("pricing.noPlans")})}):e("div",{className:"flex-1 min-h-0 overflow-hidden bg-background",children:[r("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:r("div",{className:"p-4 space-y-4",children:be.map(t=>{const i=t._id===Q,s=Me(t),n=Pe&&t._id===re,a=Ce(t),d=Ie(t),c=M(t,pe),o=y(t,pe,l.Monthly)??0,u=ce!==l.Monthly&&null!==a?S(o,a,ce):null,p=N(t,pe),b=p?v(t,pe,ce):null;return e("div",{className:"rounded-xl border-2 p-4 "+(i?"border-info bg-info/5":"border-border bg-background"),children:[e("div",{className:"flex items-start justify-between mb-3",children:[e("div",{children:[e("div",{className:"flex items-center gap-2",children:[r("h3",{className:"text-lg font-bold text-foreground",children:t.plan.name}),r(D,{planVersion:t,isCurrent:i,trialUsedAt:G,currentStripePriceId:U})]}),t.plan.description&&r("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:t.plan.description})]}),i&&r("span",{className:"shrink-0 rounded-md bg-info px-2 py-0.5 text-xs font-semibold uppercase tracking-wider text-info-foreground",children:B("pricing.current")})]}),e("div",{className:"mb-4",children:[r("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:r(j,{hasVariant:d,price:a,displayCurrency:c,selectedInterval:ce,getIntervalLabel:ee})}),null!==u&&u>0&&d&&r("span",{className:"text-xs text-success font-medium",children:B("subscription.savingsPercent",{percent:u})}),p?.enabled&&b&&b>0&&r("div",{className:"text-xs text-muted-foreground mt-1",children:B("subscription.seatPriceDisplay",{price:Z(b,c),interval:ee(ce),included:X(p.includedSeats),includedLabel:B("pricing.included")})})]}),he.length>0&&e("div",{className:"mb-3",children:[r("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:B("subscription.items.features")}),r("div",{className:"space-y-1",children:he.map(i=>{const s=Le(t,i,ce),n=i.type===m.Feature&&!0===s;return e("div",{className:"flex items-center gap-2 text-sm",children:[i.type===m.Feature?r("span",n?{className:"text-success text-xs",children:"✓"}:{className:"text-muted-foreground/50 text-xs",children:"✕"}):null,r("span",{className:n?"text-foreground":"text-muted-foreground/70",children:i.name})]},i._id)})})]}),xe.length>0&&e("div",{className:"mb-3",children:[r("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:B("subscription.items.limits")}),r("div",{className:"space-y-1",children:xe.map(i=>{const s=Le(t,i,ce);return e("div",{className:"flex items-center justify-between text-sm",children:[r("span",{className:"text-muted-foreground",children:i.name}),r("span",{className:"font-medium text-foreground",children:"number"==typeof s?X(s):"—"})]},i._id)})})]}),p?.enabled&&e("div",{className:"mb-3",children:[r("div",{className:"text-xs font-semibold text-success uppercase tracking-wider mb-1.5",children:B("subscription.seats.title")}),e("div",{className:"space-y-1 text-sm",children:[e("div",{className:"flex justify-between",children:[r("span",{className:"text-muted-foreground",children:B("subscription.seats.included")}),r("span",{className:"font-medium",children:X(p.includedSeats||0)})]}),e("div",{className:"flex justify-between",children:[r("span",{className:"text-muted-foreground",children:B("subscription.seats.maxSeats")}),r("span",{className:"font-medium",children:(p?.maxSeats??0)>0?X(p.maxSeats):B("subscription.seats.unlimited")})]}),null!=F&&F>0&&(()=>{const t=Math.max(0,F-(p.includedSeats||0));return e("div",{className:"flex justify-between",children:[r("span",{className:"text-muted-foreground",children:B("subscription.seats.billable")}),r("span",{className:"font-medium "+(0===t?"text-success":"text-warning"),children:0===t?B("subscription.seats.allIncluded"):`${X(t)} ${B("subscription.seats.extra")}`})]})})()]})]}),r(z,{planVersion:t}),r(k,{className:"w-full mt-2",variant:s.variant,disabled:s.disabled||Pe||!d,progress:n,onClick:()=>_e(t._id),children:n?B("pricing.processing"):d?s.dynamicLabel??B(s.labelKey):B("pricing.unavailable")})]},t._id)})})}),r("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e("table",{"aria-label":B("subscription.choosePlan"),className:"w-full border-separate border-spacing-0",style:{minWidth:260+220*be.length+"px",borderCollapse:"separate"},children:[e("colgroup",{children:[r("col",{style:{width:260,minWidth:260}}),be.map(e=>r("col",{style:{width:220,minWidth:220}},e._id))]}),r("thead",{children:e("tr",{className:"align-top",children:[r("th",{className:"sticky top-0 start-0 z-30 p-0 bg-background text-start"}),be.map(t=>{const i=t._id===Q,s=Me(t),n=Pe&&t._id===re,a=Ce(t),d=y(t,pe,l.Monthly)??0,c=ce!==l.Monthly&&null!==a?S(d,a,ce):null,o=Ie(t),u=M(t,pe);return r("th",{className:"sticky top-0 z-20 border-b border-border p-3 shadow-sticky-row "+(t._id===Q?"bg-info/10":"bg-background"),children:e("div",{className:"flex h-full flex-col gap-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[r("h3",{className:"text-base font-bold text-foreground truncate",children:t.plan.name}),r(D,{planVersion:t,isCurrent:i,trialUsedAt:G,currentStripePriceId:U})]}),i&&r("span",{className:"shrink-0 rounded-md bg-info px-2 py-0.5 text-xs font-semibold uppercase tracking-wider text-info-foreground",children:B("pricing.current")})]}),e("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e("div",{className:"flex items-baseline gap-1 flex-wrap",children:[r(j,{hasVariant:o,price:a,displayCurrency:u,selectedInterval:ce,getIntervalLabel:ee}),null!==c&&c>0&&o&&r("span",{className:"text-xs px-1.5 py-0.5 bg-success/15 text-success rounded-full font-semibold whitespace-nowrap",children:B("subscription.savingsPercent",{percent:c})})]}),(()=>{const e=N(t,pe);if(!e)return null;const i=v(t,pe,ce);return!i||i<=0?null:r("div",{className:"text-xs text-muted-foreground mt-1.5 border-t border-border/60 pt-1 leading-tight",children:r("div",{children:B("subscription.seatPriceDisplay",{price:Z(i,u),interval:ee(ce),included:X(e.includedSeats),includedLabel:B("pricing.included")})})})})()]}),t.plan.description&&r("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed text-start",children:t.plan.description}),r(k,{className:"mt-auto w-full",variant:s.variant,disabled:s.disabled||Pe||!o,progress:n,onClick:()=>_e(t._id),children:n?B("pricing.processing"):o?s.dynamicLabel??B(s.labelKey):B("pricing.unavailable")})]})},t._id)})]})}),e("tbody",{children:[he.length>0&&e(t,{children:[e("tr",{children:[r("td",{className:"sticky start-0 z-10 border-t border-border bg-muted px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-muted-foreground shadow-sticky-col",children:B("subscription.items.features")}),r("td",{colSpan:be.length,className:"border-t border-border bg-muted"})]}),he.map(t=>e("tr",{className:"group hover:bg-muted/30",children:[e("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:[r("div",{className:"font-medium text-sm text-foreground",children:t.name}),t.description&&r("div",{className:"text-xs text-muted-foreground mt-0.5",children:t.description})]}),be.map(e=>{const i=Le(e,t,ce),s=M(e,pe),n=ze(i,t,s),a=t.type===m.Feature&&!0===i;return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm font-medium "+(a?"text-success":"—"===n?"text-muted-foreground/70":"text-foreground"),children:n})},e._id)})]},t._id))]}),xe.length>0&&e(t,{children:[e("tr",{children:[r("td",{className:"sticky start-0 z-10 border-t border-border bg-muted px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-muted-foreground shadow-sticky-col",children:B("subscription.items.limits")}),r("td",{colSpan:be.length,className:"border-t border-border bg-muted"})]}),xe.map(t=>e("tr",{className:"group hover:bg-muted/30",children:[e("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:[r("div",{className:"font-medium text-sm text-foreground",children:t.name}),t.description&&r("div",{className:"text-xs text-muted-foreground mt-0.5",children:t.description})]}),be.map(e=>{const i=Le(e,t,ce),s=M(e,pe),n=ze(i,t,s);return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm font-medium "+("—"===n?"text-muted-foreground/70":"text-foreground"),children:n})},e._id)})]},t._id))]}),fe.length>0&&e(t,{children:[e("tr",{children:[r("td",{className:"sticky start-0 z-10 border-t border-border bg-muted px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-muted-foreground shadow-sticky-col",children:B("subscription.items.quotas")}),r("td",{colSpan:be.length,className:"border-t border-border bg-muted"})]}),fe.map(t=>e("tr",{className:"group hover:bg-muted/30",children:[e("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:[r("div",{className:"font-medium text-sm text-foreground",children:t.name}),t.description&&r("div",{className:"text-xs text-muted-foreground mt-0.5",children:t.description})]}),be.map(e=>{const i=Le(e,t,ce),s=M(e,pe),n=ze(i,t,s);return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm font-medium "+("—"===n?"text-muted-foreground/70":"text-foreground"),children:n})},e._id)})]},t._id))]}),be.some(e=>{const r=N(e,pe);return r?.enabled})&&e(t,{children:[e("tr",{children:[r("td",{className:"sticky start-0 z-10 border-t border-success/20 bg-success/10 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-success shadow-sticky-col",children:B("subscription.seats.title")}),r("td",{colSpan:be.length,className:"border-t border-success/20 bg-success/10"})]}),e("tr",{className:"group hover:bg-muted/30",children:[e("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:[r("div",{className:"font-medium text-sm text-foreground",children:B("subscription.seats.includedSeats")}),r("div",{className:"text-xs text-muted-foreground mt-0.5",children:B("subscription.seats.freeWithBase")})]}),be.map(e=>{const t=N(e,pe);return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm font-medium text-foreground",children:t?.enabled?X(t.includedSeats||0):"—"})},e._id)})]}),e("tr",{className:"group hover:bg-muted/30",children:[r("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:r("div",{className:"font-medium text-sm text-foreground",children:B("subscription.seats.maxSeats")})}),be.map(e=>{const t=N(e,pe);return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm font-medium text-foreground",children:t?.enabled?(t?.maxSeats??0)>0?X(t.maxSeats):B("subscription.seats.unlimited"):"—"})},e._id)})]}),e("tr",{className:"group hover:bg-muted/30",children:[r("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:r("div",{className:"font-medium text-sm text-foreground",children:B("subscription.seats.perExtraSeat")})}),be.map(e=>{const t=v(e,pe,ce),i=M(e,pe);return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm font-medium text-foreground",children:t&&t>0?`${Z(t,i)}${ee(ce)}`:"—"})},e._id)})]}),null!=F&&F>0&&e("tr",{className:"group hover:bg-muted/30",children:[e("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:[r("div",{className:"font-medium text-sm text-foreground",children:B("subscription.seats.billable")}),r("div",{className:"text-xs text-muted-foreground mt-0.5",children:B("subscription.membersInWorkspace",{count:F})})]}),be.map(t=>{const i=N(t,pe);if(!i?.enabled)return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(t._id===Q?"bg-info/5":"bg-background"),children:r("span",{className:"text-sm text-muted-foreground/70",children:"—"})},t._id);const s=i.includedSeats||0,n=Math.max(0,F-s);return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(t._id===Q?"bg-info/5":"bg-background"),children:0===n?r("span",{className:"text-sm font-medium text-success",children:B("subscription.seats.allIncluded")}):e("span",{className:"text-sm font-medium text-warning",children:[X(n)," ",B("subscription.seats.extra")]})},t._id)})]})]}),be.some(e=>e.creditGrant?.enabled&&"object"==typeof e.creditGrant.creditPackage&&null!==e.creditGrant.creditPackage)&&e(t,{children:[e("tr",{children:[r("td",{className:"sticky start-0 z-10 border-t border-info/20 bg-info/10 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-info shadow-sticky-col",children:B("subscription.items.credits")}),r("td",{colSpan:be.length,className:"border-t border-info/20 bg-info/10"})]}),e("tr",{className:"group hover:bg-muted/30",children:[r("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:r("div",{className:"font-medium text-sm text-foreground",children:be.every(e=>!e.creditGrant?.enabled||!e.creditGrant.renewOnPeriod)?B("subscription.items.creditsOneTime"):B("subscription.items.creditsPerMonth")})}),be.map(e=>{const t=e.creditGrant,i=t?.enabled&&"object"==typeof t.creditPackage&&null!==t.creditPackage?t.creditPackage:null;return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",i?{className:"text-sm font-semibold text-info",children:X(i.creditAmount)}:{className:"text-sm text-muted-foreground/70",children:"—"})},e._id)})]}),e("tr",{className:"group hover:bg-muted/30",children:[r("td",{className:"sticky start-0 z-10 border-t border-border/60 bg-background p-4 shadow-sticky-col group-hover:bg-muted/50",children:r("div",{className:"font-medium text-sm text-foreground",children:B("subscription.items.creditRenewal")})}),be.map(e=>{const t=e.creditGrant;return r("td",{className:"border-t border-border/60 p-4 text-center align-middle "+(e._id===Q?"bg-info/5":"bg-background"),children:r("span",t?.enabled?{className:"text-sm font-medium text-foreground",children:B(L(t))}:{className:"text-sm text-muted-foreground/70",children:"—"})},e._id)})]})]})]})]})})]})})]})})};export{K as default};