instruction
stringlengths
0
1k
input
stringlengths
1
1k
output
stringlengths
10
6.51k
from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.button import button def glow() -> rx.Component: return rx.box( class_name="absolute flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[-1] top-[-1.25rem] pointer-events-none w-[20rem] h-[5rem] dark:[background-image:radial...
import reflex as rx
import reflex as rx
from pcweb.components.button import button def glow() -> rx.Component: return rx.box( class_name="absolute flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[-1] top-[-1.25rem] pointer-events-none w-[20rem] h-[5rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,0.207...
from reflex_ui.blocks.lemcal import lemcal_dialog
import reflex as rx from reflex_ui.blocks.lemcal import lemcal_dialog
def glow() -> rx.Component: return rx.box( class_name="absolute flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[-1] top-[-1.25rem] pointer-events-none w-[20rem] h-[5rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,0.207)_0%,_rgba(21,22,24,0.00)_100%)] [background...
from pcweb.components.button import button
import reflex as rx from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.button import button
def header() -> rx.Component: return rx.box( rx.el.h3( "Have questions?", class_name="text-slate-12 text-3xl font-semibold", ), rx.el.p( "Check FAQ", class_name="text-slate-9 text-3xl font-semibold", ), class_name="flex items...
def glow() -> rx.Component: return rx.box( class_name="absolute flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[-1] top-[-1.25rem] pointer-events-none w-[20rem] h-[5rem] dark:[background-image:radial-gradient(50%_50%_at_50%_50%,_rgba(58,45,118,0.207)_0%,_rgba(21,22,24,0.00)_100%)] [background-im...
import reflex as rx from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.button import button def glow() -> rx.Component: return rx.box( class_name="absolute flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[-1] top-[-1.25rem] pointer-events-none w-[20rem] h-[5rem] dark:[back...
def sales_button() -> rx.Component: return rx.el.div( lemcal_dialog( rx.el.div( glow(), button( "Need more help? Contact sales", variant="secondary", class_name="!text-slate-11 !font-semibold !text-sm ...
def header() -> rx.Component: return rx.box( rx.el.h3( "Have questions?", class_name="text-slate-12 text-3xl font-semibold", ), rx.el.p( "Check FAQ", class_name="text-slate-9 text-3xl font-semibold", ), class_name="flex items-ce...
import reflex as rx from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.button import button def glow() -> rx.Component: return rx.box( class_name="absolute flex-shrink-0 rounded-[120rem] left-1/2 -translate-x-1/2 z-[-1] top-[-1.25rem] pointer-events-none w-[20rem] h-[5rem] dark:[back...
def accordion(title: str, content: rx.Component) -> rx.Component: """The accordion component. Args: title (str): The title of the accordion. content (rx.Component): The content of the accordion. Returns: The accordion component. """ return rx.accordion.root( rx....
def sales_button() -> rx.Component: return rx.el.div( lemcal_dialog( rx.el.div( glow(), button( "Need more help? Contact sales", variant="secondary", class_name="!text-slate-11 !font-semibold !text-sm w-f...
ent): The content of the accordion. Returns: The accordion component. """ return rx.accordion.root( rx.accordion.item( rx.accordion.trigger( rx.el.h3( title, class_name="font-semibold text-base text-slate-12 text-start" ), ...
faq_items = [ ( "Can I use Reflex for free?", "Yes! Reflex is open source and free to use. You can self-host your apps or use our hosting platform which has a generous free tier.", ), ( "What is the difference between Reflex and Reflex Cloud?", "Reflex is our open-source f...
def accordion_text(text: str) -> rx.Component: return rx.el.p(text, class_name="text-slate-9 text-sm font-medium")
without interruption.", ), ( "What are credits?", "Credits can be used for both hosting and building. In hosting, credits are used for compute resources. In building, credits are consumed per message sent.", ), ( "What happens if I cancel the plan?", "If you cancel, you'...
def faq() -> rx.Component: return rx.el.section( header(), rx.box( *[ accordion(title, accordion_text(content)) for title, content in faq_items ], class_name="max-w-[40rem] flex justify-center items-center flex-col mx-auto w-full ga...
from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.c...
from typing import NamedTuple, TypedDict
from typing import NamedTuple, TypedDict
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REF...
from urllib.parse import quote_plus
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus
import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX...
import reflex as rx
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx
from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONT...
import reflex_ui as ui
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui
from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (1...
from reflex.experimental.client_state import ClientStateVar
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar
from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle...
from reflex_ui.blocks.lemcal import lemcal_dialog
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog
from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", ...
from pcweb.components.hosting_banner import HostingBannerState
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState
from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly", ) class SelectedTier(TypedDi...
from pcweb.components.number_flow import number_flow
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly", ) class SelectedTier(TypedDict): tier: str price: int class ProTierState(rx.State): credits: r...
from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
# 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly", ) class SelectedTier(TypedDict): tier: str price: int class ProTierState(rx.State): credits: rx.Field[int] = rx.field(...
YEARLY_MONTHS_FREE = 2
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly", ) class SelectedTier(TypedDict): tier: str price: int class ProTierState(rx.State): credits: rx.Field[int] = rx.field(default=PRO_TIERS_TABLE["Pro 25"]["credits"]) @rx.event def redirect...
YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
class SelectedTier(TypedDict): tier: str price: int class ProTierState(rx.State): credits: rx.Field[int] = rx.field(default=PRO_TIERS_TABLE["Pro 25"]["credits"]) @rx.event def redirect_to_billing(self, yearly: bool = False): return rx.redirect( f"{REFLEX_CLOUD_URL.rstrip('/...
monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly", )
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
class ProTierState(rx.State): credits: rx.Field[int] = rx.field(default=PRO_TIERS_TABLE["Pro 25"]["credits"]) @rx.event def redirect_to_billing(self, yearly: bool = False): return rx.redirect( f"{REFLEX_CLOUD_URL.rstrip('/')}/?redirect_url={REFLEX_CLOUD_URL.rstrip('/')}/billing/?tier...
class SelectedTier(TypedDict): tier: str price: int
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
class Feature(NamedTuple): icon: str text: str component: rx.Component | None = None def radial_circle(violet: bool = False) -> rx.Component: """Create a radial circle background image component. Args: violet: Whether to use the violet variant. Defaults to False. Returns: ...
class ProTierState(rx.State): credits: rx.Field[int] = rx.field(default=PRO_TIERS_TABLE["Pro 25"]["credits"]) @rx.event def redirect_to_billing(self, yearly: bool = False): return rx.redirect( f"{REFLEX_CLOUD_URL.rstrip('/')}/?redirect_url={REFLEX_CLOUD_URL.rstrip('/')}/billing/?tier={q...
from typing import NamedTuple, TypedDict from urllib.parse import quote_plus import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.num...
@rx.event def update_credits(self, credits: str): self.credits = int(credits.replace(",", "")) @rx.var def selected_tier(self) -> SelectedTier: for tier_name, tier_data in PRO_TIERS_TABLE.items(): if tier_data["credits"] == self.credits: return SelectedTier...
def redirect_to_billing(self, yearly: bool = False): return rx.redirect( f"{REFLEX_CLOUD_URL.rstrip('/')}/?redirect_url={REFLEX_CLOUD_URL.rstrip('/')}/billing/?tier={quote_plus(self.selected_tier['tier'])}{'&yearly=true' if yearly else ''}", is_external=True, )
e import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_D...
@rx.var def selected_tier(self) -> SelectedTier: for tier_name, tier_data in PRO_TIERS_TABLE.items(): if tier_data["credits"] == self.credits: return SelectedTier(tier=tier_name, price=tier_data["price"]) return SelectedTier(tier="Pro 25", price=PRO_TIERS_TABLE["Pro...
def update_credits(self, credits: str): self.credits = int(credits.replace(",", ""))
mcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) /...
@rx.var def selected_tier(self) -> SelectedTier: for tier_name, tier_data in PRO_TIERS_TABLE.items(): if tier_data["credits"] == self.credits: return SelectedTier(tier=tier_name, price=tier_data["price"]) return SelectedTier(tier="Pro 25", price=PRO_TIERS_TABLE["Pro...
self.credits = int(credits.replace(",", ""))
r import HostingBannerState from pcweb.components.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "mon...
class Feature(NamedTuple): icon: str text: str component: rx.Component | None = None def radial_circle(violet: bool = False) -> rx.Component: """Create a radial circle background image component. Args: violet: Whether to use the violet variant. Defaults to False. Returns: ...
def selected_tier(self) -> SelectedTier: for tier_name, tier_data in PRO_TIERS_TABLE.items(): if tier_data["credits"] == self.credits: return SelectedTier(tier=tier_name, price=tier_data["price"]) return SelectedTier(tier="Pro 25", price=PRO_TIERS_TABLE["Pro 25"]["price"])
.number_flow import number_flow from pcweb.constants import PRO_TIERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly",...
return SelectedTier(tier="Pro 25", price=PRO_TIERS_TABLE["Pro 25"]["price"]) class Feature(NamedTuple): icon: str text: str component: rx.Component | None = None def radial_circle(violet: bool = False) -> rx.Component: """Create a radial circle background image component. Args: ...
for tier_name, tier_data in PRO_TIERS_TABLE.items(): if tier_data["credits"] == self.credits: return SelectedTier(tier=tier_name, price=tier_data["price"])
IERS_TABLE, REFLEX_BUILD_URL, REFLEX_CLOUD_URL YEARLY_MONTHS_FREE = 2 # 2 months free YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE) / 12 monthly_yearly_toggle_cs = ClientStateVar.create( "monthly_yearly_toggle_value", default="monthly", ) class SelectedTier(TypedDict): tier: str price: int ...
return SelectedTier(tier="Pro 25", price=PRO_TIERS_TABLE["Pro 25"]["price"]) class Feature(NamedTuple): icon: str text: str component: rx.Component | None = None def radial_circle(violet: bool = False) -> rx.Component: """Create a radial circle background image component. Args: ...
if tier_data["credits"] == self.credits: return SelectedTier(tier=tier_name, price=tier_data["price"])
thly_yearly_toggle_value", default="monthly", ) class SelectedTier(TypedDict): tier: str price: int class ProTierState(rx.State): credits: rx.Field[int] = rx.field(default=PRO_TIERS_TABLE["Pro 25"]["credits"]) @rx.event def redirect_to_billing(self, yearly: bool = False): return rx....
def radial_circle(violet: bool = False) -> rx.Component: """Create a radial circle background image component. Args: violet: Whether to use the violet variant. Defaults to False. Returns: A Reflex image component configured as a radial circle background. """ theme = "violet" if...
class Feature(NamedTuple): icon: str text: str component: rx.Component | None = None
price: int class ProTierState(rx.State): credits: rx.Field[int] = rx.field(default=PRO_TIERS_TABLE["Pro 25"]["credits"]) @rx.event def redirect_to_billing(self, yearly: bool = False): return rx.redirect( f"{REFLEX_CLOUD_URL.rstrip('/')}/?redirect_url={REFLEX_CLOUD_URL.rstrip('/')}...
def card( title: str, price: str | rx.Component, description: str | rx.Component, features: list[Feature], cta_button: rx.Component, ) -> rx.Component: return rx.box( rx.el.h3(title, class_name="font-medium text-secondary-12 text-2xl mb-1.5"), ( rx.el.span( ...
def radial_circle(violet: bool = False) -> rx.Component: """Create a radial circle background image component. Args: violet: Whether to use the violet variant. Defaults to False. Returns: A Reflex image component configured as a radial circle background. """ theme = "violet" if vi...
CLOUD_URL.rstrip('/')}/billing/?tier={quote_plus(self.selected_tier['tier'])}{'&yearly=true' if yearly else ''}", is_external=True, ) @rx.event def update_credits(self, credits: str): self.credits = int(credits.replace(",", "")) @rx.var def selected_tier(self) -> SelectedTi...
return rx.image( src=rx.color_mode_cond( light=f"/logos/light/radial_circle{theme}.svg", dark=f"/logos/dark/radial_circle{theme}.svg", ), alt="Radial circle", loading="lazy", class_name="top-0 right-0 absolute pointer-events-none z-[-1]", ) def ...
theme = "violet" if violet else ""
mb-1.5"), rx.el.p(description, class_name="text-sm font-medium text-secondary-11"), ( rx.el.span( price, class_name="text-3xl text-secondary-12 font-semibold py-4", ) if isinstance(price, str) else price ), r...
def pricing_cards() -> rx.Component: return rx.el.div( card( "Hobby", "Free", "Perfect for getting started and trying out Reflex.", [ Feature( "TokenCircleIcon", "50 daily credits (up to 150/month)", ...
def pro_tiers_select() -> rx.Component: return rx.el.div( ui.select( items=[f"{int(tier['credits']):,}" for tier in PRO_TIERS_TABLE.values()], value=f"{ProTierState.credits:,}", on_value_change=ProTierState.update_credits, size="xs", ), rx.el.s...
s.", [ Feature( "UserMultipleIcon", "Role based access: Collaborators/Editors/Viewers", ), Feature("PlugSocketIcon", "Enterprise Integrations"), Feature("GithubIcon", "Enterprise Repo Sync"), ...
def monthly_yearly_toggle(): return rx.el.div( ui.tabs( ui.tabs.list( ui.tabs.tab( "Monthly", value="monthly", class_name="text-base h-9 px-4" ), ui.tabs.tab( "Yearly (2 months free)", ...
def header(): return rx.box( rx.el.h3( "Choose the perfect plan for your needs", class_name="text-slate-12 text-3xl font-semibold text-center", ), rx.el.p( "Start free, scale as you grow, or go enterprise for maximum power", class_name="text-sl...
rt Channel"), Feature("CustomerSupportIcon", "Onboarding support"), ], lemcal_dialog( ui.button( "Contact sales", variant="primary", size="lg", class_name="w-full font-semibold", ...
def plan_cards(): return rx.box( header(), # monthly_yearly_toggle(), rx.el.style( """ number-flow-react::part(suffix) { color: var(--secondary-10); font-weight: 450; font-size: large; letter-spacing: ...
def monthly_yearly_toggle(): return rx.el.div( ui.tabs( ui.tabs.list( ui.tabs.tab( "Monthly", value="monthly", class_name="text-base h-9 px-4" ), ui.tabs.tab( "Yearly (2 months free)", val...
nter", ), class_name="flex items-center justify-between text-slate-11 flex-col lg:pt-[4.5rem] pt-[2.5rem] pb-[3.5rem] 2xl:border-x border-slate-4 max-w-[64.19rem] mx-auto w-full gap-1", ) def monthly_yearly_toggle(): return rx.el.div( ui.tabs( ui.tabs.list( ...
def plan_cards(): return rx.box( header(), # monthly_yearly_toggle(), rx.el.style( """ number-flow-react::part(suffix) { color: var(--secondary-10); font-weight: 450; font-size: large; letter-spacing: -0....
from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing.plan_cards import p...
import reflex as rx
import reflex as rx
from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing.plan_cards import plan_cards from pcweb.pages.pricing.slider_calcu...
from pcweb.meta.meta import hosting_meta_tags
import reflex as rx from pcweb.meta.meta import hosting_meta_tags
from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing.plan_cards import plan_cards from pcweb.pages.pricing.slider_calculator import MachineState, slider_calculator from pcweb.page...
from pcweb.pages.framework.index_colors import index_colors
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors
from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing.plan_cards import plan_cards from pcweb.pages.pricing.slider_calculator import MachineState, slider_calculator from pcweb.pages.pricing.table import tiers_tables pricing_path = "/pricing" @...
from pcweb.pages.framework.views.footer_index import footer_index
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index
from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing.plan_cards import plan_cards from pcweb.pages.pricing.slider_calculator import MachineState, slider_calculator from pcweb.pages.pricing.table import tiers_tables pricing_path = "/pricing" @rx.page( route=pricing_path, title="Reflex · Pricing",...
from pcweb.pages.pricing.calculator import calculator_section
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section
from pcweb.pages.pricing.plan_cards import plan_cards from pcweb.pages.pricing.slider_calculator import MachineState, slider_calculator from pcweb.pages.pricing.table import tiers_tables pricing_path = "/pricing" @rx.page( route=pricing_path, title="Reflex · Pricing", meta=hosting_meta_tags, on_load...
from pcweb.pages.pricing.faq import faq
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq
from pcweb.pages.pricing.slider_calculator import MachineState, slider_calculator from pcweb.pages.pricing.table import tiers_tables pricing_path = "/pricing" @rx.page( route=pricing_path, title="Reflex · Pricing", meta=hosting_meta_tags, on_load=MachineState.reset_machines, ) def pricing() -> rx.Co...
from pcweb.pages.pricing.plan_cards import plan_cards
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing....
from pcweb.pages.pricing.table import tiers_tables pricing_path = "/pricing" @rx.page( route=pricing_path, title="Reflex · Pricing", meta=hosting_meta_tags, on_load=MachineState.reset_machines, ) def pricing() -> rx.Component: """Get the Pricing landing page.""" from pcweb.components.docpage...
from pcweb.pages.pricing.slider_calculator import MachineState, slider_calculator
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing....
pricing_path = "/pricing" @rx.page( route=pricing_path, title="Reflex · Pricing", meta=hosting_meta_tags, on_load=MachineState.reset_machines, ) def pricing() -> rx.Component: """Get the Pricing landing page.""" from pcweb.components.docpage.navbar import navbar return rx.box( i...
from pcweb.pages.pricing.table import tiers_tables
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing....
@rx.page( route=pricing_path, title="Reflex · Pricing", meta=hosting_meta_tags, on_load=MachineState.reset_machines, ) def pricing() -> rx.Component: """Get the Pricing landing page.""" from pcweb.components.docpage.navbar import navbar return rx.box( index_colors(), navb...
pricing_path = "/pricing"
import reflex as rx from pcweb.meta.meta import hosting_meta_tags from pcweb.pages.framework.index_colors import index_colors from pcweb.pages.framework.views.footer_index import footer_index from pcweb.pages.pricing.calculator import calculator_section from pcweb.pages.pricing.faq import faq from pcweb.pages.pricing....
return rx.box( index_colors(), navbar(), rx.el.main( rx.box( plan_cards(), tiers_tables(), slider_calculator(), calculator_section(), faq(), class_name="flex flex-col relative justif...
from pcweb.components.docpage.navbar import navbar
import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_...
from dataclasses import dataclass
from dataclasses import dataclass
import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORT...
import reflex as rx
from dataclasses import dataclass import reflex as rx
from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORTED_TIERS = sorted( ...
import reflex_ui as ui
from dataclasses import dataclass import reflex as rx import reflex_ui as ui
from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORTED_TIERS = sorted( [{"key": k, **v} for k, v in PRO_TIERS_TABLE.items()], key=l...
from reflex.experimental.client_state import ClientStateVar
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar
from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORTED_TIERS = sorted( [{"key": k, **v} for k, v in PRO_TIERS_TABLE.items()], key=lambda x: x["credits"] ) machine_keys = list(COMPU...
from reflex_ui.blocks.lemcal import lemcal_dialog
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog
from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORTED_TIERS = sorted( [{"key": k, **v} for k, v in PRO_TIERS_TABLE.items()], key=lambda x: x["credits"] ) machine_keys = list(COMPUTE_TABLE.keys()) def format_number(number: int | float) -> st...
from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL
_SORTED_TIERS = sorted( [{"key": k, **v} for k, v in PRO_TIERS_TABLE.items()], key=lambda x: x["credits"] ) machine_keys = list(COMPUTE_TABLE.keys()) def format_number(number: int | float) -> str: """Format number with locale string, handling non-numeric values.""" return rx.Var( f"(typeof {num...
from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, )
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, C...
machine_keys = list(COMPUTE_TABLE.keys()) def format_number(number: int | float) -> str: """Format number with locale string, handling non-numeric values.""" return rx.Var( f"(typeof {number} === 'number' ? {number} : 0).toLocaleString('en-US')" ).to(str) @dataclass class Machine: vcpu: in...
_SORTED_TIERS = sorted( [{"key": k, **v} for k, v in PRO_TIERS_TABLE.items()], key=lambda x: x["credits"] )
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, C...
def format_number(number: int | float) -> str: """Format number with locale string, handling non-numeric values.""" return rx.Var( f"(typeof {number} === 'number' ? {number} : 0).toLocaleString('en-US')" ).to(str) @dataclass class Machine: vcpu: int ram: float index: int weekly_...
machine_keys = list(COMPUTE_TABLE.keys())
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, C...
@dataclass class Machine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_key = machine_keys[index] specs = COMPUTE_TABLE[machine_key] ...
def format_number(number: int | float) -> str: """Format number with locale string, handling non-numeric values.""" return rx.Var( f"(typeof {number} === 'number' ? {number} : 0).toLocaleString('en-US')" ).to(str)
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, C...
def calculate_weekly_credits(vcpu: int, ram: float) -> float: """Calculate weekly credits for a machine.""" credits_per_hour = vcpu * CREDITS_PER_HOUR_CPU + ram * CREDITS_PER_HOUR_GB return round(credits_per_hour * 24 * 7, 2) message_tooltip_open_cs = ClientStateVar.create("message_tooltip_open", defau...
class Machine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_key = machine_keys[index] specs = COMPUTE_TABLE[machine_key] weekly_credit...
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, C...
def calculate_weekly_credits(vcpu: int, ram: float) -> float: """Calculate weekly credits for a machine.""" credits_per_hour = vcpu * CREDITS_PER_HOUR_CPU + ram * CREDITS_PER_HOUR_GB return round(credits_per_hour * 24 * 7, 2) message_tooltip_open_cs = ClientStateVar.create("message_tooltip_open", defau...
def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_key = machine_keys[index] specs = COMPUTE_TABLE[machine_key] weekly_credits = calculate_weekly_credits(specs["vcpu"], specs["ram"]) return cls( vcpu=specs["vcpu"], ...
from dataclasses import dataclass import reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, C...
specs = COMPUTE_TABLE[machine_key] weekly_credits = calculate_weekly_credits(specs["vcpu"], specs["ram"]) return cls( vcpu=specs["vcpu"], ram=specs["ram"], index=index, weekly_credits=weekly_credits, ) def calculate_weekly_credits(vcpu: ...
machine_key = machine_keys[index]
port reflex as rx import reflex_ui as ui from reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_...
weekly_credits = calculate_weekly_credits(specs["vcpu"], specs["ram"]) return cls( vcpu=specs["vcpu"], ram=specs["ram"], index=index, weekly_credits=weekly_credits, ) def calculate_weekly_credits(vcpu: int, ram: float) -> float: """Calculate...
specs = COMPUTE_TABLE[machine_key]
om reflex.experimental.client_state import ClientStateVar from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.constants import PRO_TIERS_TABLE, REFLEX_CLOUD_URL from pcweb.pages.pricing.calculator import ( COMPUTE_TABLE, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORTED_TIERS = sorted( [{"...
return cls( vcpu=specs["vcpu"], ram=specs["ram"], index=index, weekly_credits=weekly_credits, ) def calculate_weekly_credits(vcpu: int, ram: float) -> float: """Calculate weekly credits for a machine.""" credits_per_hour = vcpu * CREDITS_PER_HOU...
weekly_credits = calculate_weekly_credits(specs["vcpu"], specs["ram"])
, CREDITS_PER_HOUR_CPU, CREDITS_PER_HOUR_GB, ) _SORTED_TIERS = sorted( [{"key": k, **v} for k, v in PRO_TIERS_TABLE.items()], key=lambda x: x["credits"] ) machine_keys = list(COMPUTE_TABLE.keys()) def format_number(number: int | float) -> str: """Format number with locale string, handling non-numeri...
message_tooltip_open_cs = ClientStateVar.create("message_tooltip_open", default=False) pro_tier_keys = list(PRO_TIERS_TABLE.keys()) COMPUTE_TABLE_KEYS = rx.Var.create(machine_keys) PRO_TIER_KEYS = rx.Var.create(pro_tier_keys) MESSAGES_VALUES = [0] + [50 * (2**i) for i in range(9)] + [20000, 0] def get_is_enterpri...
def calculate_weekly_credits(vcpu: int, ram: float) -> float: """Calculate weekly credits for a machine.""" credits_per_hour = vcpu * CREDITS_PER_HOUR_CPU + ram * CREDITS_PER_HOUR_GB return round(credits_per_hour * 24 * 7, 2)
_TIERS_TABLE.items()], key=lambda x: x["credits"] ) machine_keys = list(COMPUTE_TABLE.keys()) def format_number(number: int | float) -> str: """Format number with locale string, handling non-numeric values.""" return rx.Var( f"(typeof {number} === 'number' ? {number} : 0).toLocaleString('en-US')" ...
return round(credits_per_hour * 24 * 7, 2) message_tooltip_open_cs = ClientStateVar.create("message_tooltip_open", default=False) pro_tier_keys = list(PRO_TIERS_TABLE.keys()) COMPUTE_TABLE_KEYS = rx.Var.create(machine_keys) PRO_TIER_KEYS = rx.Var.create(pro_tier_keys) MESSAGES_VALUES = [0] + [50 * (2**i) for i ...
credits_per_hour = vcpu * CREDITS_PER_HOUR_CPU + ram * CREDITS_PER_HOUR_GB
nt | float) -> str: """Format number with locale string, handling non-numeric values.""" return rx.Var( f"(typeof {number} === 'number' ? {number} : 0).toLocaleString('en-US')" ).to(str) @dataclass class Machine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @cla...
pro_tier_keys = list(PRO_TIERS_TABLE.keys()) COMPUTE_TABLE_KEYS = rx.Var.create(machine_keys) PRO_TIER_KEYS = rx.Var.create(pro_tier_keys) MESSAGES_VALUES = [0] + [50 * (2**i) for i in range(9)] + [20000, 0] def get_is_enterprise_tier(messages_tier_index: int) -> bool: """Check if slider is at Enterprise positi...
message_tooltip_open_cs = ClientStateVar.create("message_tooltip_open", default=False)
s.""" return rx.Var( f"(typeof {number} === 'number' ? {number} : 0).toLocaleString('en-US')" ).to(str) @dataclass class Machine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine fr...
COMPUTE_TABLE_KEYS = rx.Var.create(machine_keys) PRO_TIER_KEYS = rx.Var.create(pro_tier_keys) MESSAGES_VALUES = [0] + [50 * (2**i) for i in range(9)] + [20000, 0] def get_is_enterprise_tier(messages_tier_index: int) -> bool: """Check if slider is at Enterprise position.""" return messages_tier_index == len(...
pro_tier_keys = list(PRO_TIERS_TABLE.keys())
umber} === 'number' ? {number} : 0).toLocaleString('en-US')" ).to(str) @dataclass class Machine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_ke...
PRO_TIER_KEYS = rx.Var.create(pro_tier_keys) MESSAGES_VALUES = [0] + [50 * (2**i) for i in range(9)] + [20000, 0] def get_is_enterprise_tier(messages_tier_index: int) -> bool: """Check if slider is at Enterprise position.""" return messages_tier_index == len(MESSAGES_VALUES) - 1 def get_message_credits(me...
COMPUTE_TABLE_KEYS = rx.Var.create(machine_keys)
g('en-US')" ).to(str) @dataclass class Machine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_key = machine_keys[index] specs = COMPUTE_T...
MESSAGES_VALUES = [0] + [50 * (2**i) for i in range(9)] + [20000, 0] def get_is_enterprise_tier(messages_tier_index: int) -> bool: """Check if slider is at Enterprise position.""" return messages_tier_index == len(MESSAGES_VALUES) - 1 def get_message_credits(messages_tier_index: int) -> int: """Get cr...
PRO_TIER_KEYS = rx.Var.create(pro_tier_keys)
achine: vcpu: int ram: float index: int weekly_credits: float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_key = machine_keys[index] specs = COMPUTE_TABLE[machine_key] weekly_credits = cal...
def get_is_enterprise_tier(messages_tier_index: int) -> bool: """Check if slider is at Enterprise position.""" return messages_tier_index == len(MESSAGES_VALUES) - 1 def get_message_credits(messages_tier_index: int) -> int: """Get credits from message tier slider.""" return MESSAGES_VALUES[messages...
MESSAGES_VALUES = [0] + [50 * (2**i) for i in range(9)] + [20000, 0]
float = 0.0 @classmethod def from_index(cls, index: int) -> "Machine": """Create Machine from COMPUTE_TABLE index.""" machine_key = machine_keys[index] specs = COMPUTE_TABLE[machine_key] weekly_credits = calculate_weekly_credits(specs["vcpu"], specs["ram"]) return cls( ...
def get_message_credits(messages_tier_index: int) -> int: """Get credits from message tier slider.""" return MESSAGES_VALUES[messages_tier_index] class MachineState(rx.State): machines: rx.Field[list[Machine]] = rx.field(default_factory=list) messages_tier_index: rx.Field[int] = rx.field(default=0)...
def get_is_enterprise_tier(messages_tier_index: int) -> bool: """Check if slider is at Enterprise position.""" return messages_tier_index == len(MESSAGES_VALUES) - 1
] specs = COMPUTE_TABLE[machine_key] weekly_credits = calculate_weekly_credits(specs["vcpu"], specs["ram"]) return cls( vcpu=specs["vcpu"], ram=specs["ram"], index=index, weekly_credits=weekly_credits, ) def calculate_weekly_credits(vcpu:...
class MachineState(rx.State): machines: rx.Field[list[Machine]] = rx.field(default_factory=list) messages_tier_index: rx.Field[int] = rx.field(default=0) machines_weekly_credits: rx.Field[float] = rx.field(default=0.0) current_tier: rx.Field[dict] = rx.field( default_factory=lambda: {"key": ...
def get_message_credits(messages_tier_index: int) -> int: """Get credits from message tier slider.""" return MESSAGES_VALUES[messages_tier_index]
== len(MESSAGES_VALUES) - 1 def get_message_credits(messages_tier_index: int) -> int: """Get credits from message tier slider.""" return MESSAGES_VALUES[messages_tier_index] class MachineState(rx.State): machines: rx.Field[list[Machine]] = rx.field(default_factory=list) messages_tier_index: rx.Field...
self.machines_weekly_credits = machines_credits # Calculate current tier based on message credits msg_credits = get_message_credits(self.messages_tier_index) is_enterprise = get_is_enterprise_tier(self.messages_tier_index) # Early return path for enterprise tier if is_...
machines_credits = sum(m.weekly_credits for m in self.machines)
x: int) -> int: """Get credits from message tier slider.""" return MESSAGES_VALUES[messages_tier_index] class MachineState(rx.State): machines: rx.Field[list[Machine]] = rx.field(default_factory=list) messages_tier_index: rx.Field[int] = rx.field(default=0) machines_weekly_credits: rx.Field[float...
# Calculate current tier based on message credits msg_credits = get_message_credits(self.messages_tier_index) is_enterprise = get_is_enterprise_tier(self.messages_tier_index) # Early return path for enterprise tier if is_enterprise: self.current_tier = { ...
self.machines_weekly_credits = machines_credits
lass MachineState(rx.State): machines: rx.Field[list[Machine]] = rx.field(default_factory=list) messages_tier_index: rx.Field[int] = rx.field(default=0) machines_weekly_credits: rx.Field[float] = rx.field(default=0.0) current_tier: rx.Field[dict] = rx.field( default_factory=lambda: {"key": "Pro...
is_enterprise = get_is_enterprise_tier(self.messages_tier_index) # Early return path for enterprise tier if is_enterprise: self.current_tier = { "key": "Enterprise", "credits": msg_credits, "price": "custom", } ...
msg_credits = get_message_credits(self.messages_tier_index)
rx.field(default_factory=list) messages_tier_index: rx.Field[int] = rx.field(default=0) machines_weekly_credits: rx.Field[float] = rx.field(default=0.0) current_tier: rx.Field[dict] = rx.field( default_factory=lambda: {"key": "Pro", "credits": 0, "price": 0} ) total_credits: rx.Field[str] ...
# Early return path for enterprise tier if is_enterprise: self.current_tier = { "key": "Enterprise", "credits": msg_credits, "price": "custom", } self.total_credits = "Custom" self.recommended_tier_info = {...
is_enterprise = get_is_enterprise_tier(self.messages_tier_index)
rx.Field[float] = rx.field(default=0.0) current_tier: rx.Field[dict] = rx.field( default_factory=lambda: {"key": "Pro", "credits": 0, "price": 0} ) total_credits: rx.Field[str] = rx.field(default="0") recommended_tier_info: rx.Field[dict] = rx.field( default_factory=lambda: { ...
# Non-enterprise path - find tiers once current_tier = self._find_tier_for_credits(msg_credits) total = msg_credits + machines_credits total_tier = self._find_tier_for_credits(total) # Set current tier self.current_tier = { "key": current_tier["key"] if cur...
if is_enterprise: self.current_tier = { "key": "Enterprise", "credits": msg_credits, "price": "custom", } self.total_credits = "Custom" self.recommended_tier_info = { "price": "Custom", "needs...
fault=0.0) current_tier: rx.Field[dict] = rx.field( default_factory=lambda: {"key": "Pro", "credits": 0, "price": 0} ) total_credits: rx.Field[str] = rx.field(default="0") recommended_tier_info: rx.Field[dict] = rx.field( default_factory=lambda: { "price": "$0/mo", ...
self.total_credits = "Custom" self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", } return # Non-enterprise path - find tiers once ...
self.current_tier = { "key": "Enterprise", "credits": msg_credits, "price": "custom", }
ld[str] = rx.field(default="0") recommended_tier_info: rx.Field[dict] = rx.field( default_factory=lambda: { "price": "$0/mo", "needs_enterprise": False, "name": "Pro Plan", "credits": 0, } ) def _recalculate_all(self): """Recalculate a...
self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", } return # Non-enterprise path - find tiers once current_tier = self._find_tier_for...
self.total_credits = "Custom"
ended_tier_info: rx.Field[dict] = rx.field( default_factory=lambda: { "price": "$0/mo", "needs_enterprise": False, "name": "Pro Plan", "credits": 0, } ) def _recalculate_all(self): """Recalculate all derived values when state changes.""" ...
return # Non-enterprise path - find tiers once current_tier = self._find_tier_for_credits(msg_credits) total = msg_credits + machines_credits total_tier = self._find_tier_for_credits(total) # Set current tier self.current_tier = { "key": current...
self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", }
ate all derived values when state changes.""" # Calculate machines weekly credits using cached values machines_credits = sum(m.weekly_credits for m in self.machines) self.machines_weekly_credits = machines_credits # Calculate current tier based on message credits msg_credits = g...
total = msg_credits + machines_credits total_tier = self._find_tier_for_credits(total) # Set current tier self.current_tier = { "key": current_tier["key"] if current_tier else "Enterprise", "credits": msg_credits, "price": current_tier["price"] if cu...
current_tier = self._find_tier_for_credits(msg_credits)
e machines weekly credits using cached values machines_credits = sum(m.weekly_credits for m in self.machines) self.machines_weekly_credits = machines_credits # Calculate current tier based on message credits msg_credits = get_message_credits(self.messages_tier_index) is_enterpri...
total_tier = self._find_tier_for_credits(total) # Set current tier self.current_tier = { "key": current_tier["key"] if current_tier else "Enterprise", "credits": msg_credits, "price": current_tier["price"] if current_tier else "custom", } # ...
total = msg_credits + machines_credits
machines_credits = sum(m.weekly_credits for m in self.machines) self.machines_weekly_credits = machines_credits # Calculate current tier based on message credits msg_credits = get_message_credits(self.messages_tier_index) is_enterprise = get_is_enterprise_tier(self.messages_tier_...
# Set current tier self.current_tier = { "key": current_tier["key"] if current_tier else "Enterprise", "credits": msg_credits, "price": current_tier["price"] if current_tier else "custom", } # Set total credits display self.total_credits = f...
total_tier = self._find_tier_for_credits(total)
machines_weekly_credits = machines_credits # Calculate current tier based on message credits msg_credits = get_message_credits(self.messages_tier_index) is_enterprise = get_is_enterprise_tier(self.messages_tier_index) # Early return path for enterprise tier if is_enterprise: ...
# Set total credits display self.total_credits = f"{total:,}" if total_tier else "Custom" # Set recommended tier info if total_tier: self.recommended_tier_info = { "price": f"${total_tier['price']}/mo", "needs_enterprise": False, ...
self.current_tier = { "key": current_tier["key"] if current_tier else "Enterprise", "credits": msg_credits, "price": current_tier["price"] if current_tier else "custom", }
eturn path for enterprise tier if is_enterprise: self.current_tier = { "key": "Enterprise", "credits": msg_credits, "price": "custom", } self.total_credits = "Custom" self.recommended_tier_info = { "p...
# Set recommended tier info if total_tier: self.recommended_tier_info = { "price": f"${total_tier['price']}/mo", "needs_enterprise": False, "name": f"{total_tier['key']} Plan", "credits": total_tier["credits"], } ...
self.total_credits = f"{total:,}" if total_tier else "Custom"
"key": "Enterprise", "credits": msg_credits, "price": "custom", } self.total_credits = "Custom" self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", ...
@rx.event(temporal=True) def add_machine(self): self.machines.append(Machine.from_index(0)) self._recalculate_all() @rx.event(temporal=True) def remove_machine(self, index: int): self.machines = self.machines[:index] + self.machines[index + 1 :] self._recalculate_all()...
if total_tier: self.recommended_tier_info = { "price": f"${total_tier['price']}/mo", "needs_enterprise": False, "name": f"{total_tier['key']} Plan", "credits": total_tier["credits"], } else: self.recommended_tier...
"credits": msg_credits, "price": "custom", } self.total_credits = "Custom" self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", ...
else: self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", } @rx.event(temporal=True) def add_machine(self): self.machines.append(Machine.fr...
self.recommended_tier_info = { "price": f"${total_tier['price']}/mo", "needs_enterprise": False, "name": f"{total_tier['key']} Plan", "credits": total_tier["credits"], }
terprise", "credits": "Custom", } return # Non-enterprise path - find tiers once current_tier = self._find_tier_for_credits(msg_credits) total = msg_credits + machines_credits total_tier = self._find_tier_for_credits(total) # Set current ...
@rx.event(temporal=True) def add_machine(self): self.machines.append(Machine.from_index(0)) self._recalculate_all() @rx.event(temporal=True) def remove_machine(self, index: int): self.machines = self.machines[:index] + self.machines[index + 1 :] self._recalculate_all()...
self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", }
s_credits total_tier = self._find_tier_for_credits(total) # Set current tier self.current_tier = { "key": current_tier["key"] if current_tier else "Enterprise", "credits": msg_credits, "price": current_tier["price"] if current_tier else "custom", } ...
@rx.event(temporal=True) def remove_machine(self, index: int): self.machines = self.machines[:index] + self.machines[index + 1 :] self._recalculate_all() @rx.event(temporal=True) def update_machine(self, index: int, new_machine_index: int): self.machines[index] = Machine.from_...
def add_machine(self): self.machines.append(Machine.from_index(0)) self._recalculate_all()
: current_tier["key"] if current_tier else "Enterprise", "credits": msg_credits, "price": current_tier["price"] if current_tier else "custom", } # Set total credits display self.total_credits = f"{total:,}" if total_tier else "Custom" # Set recommended tier info...
@rx.event(temporal=True) def update_machine(self, index: int, new_machine_index: int): self.machines[index] = Machine.from_index(new_machine_index) yield self._recalculate_all() @rx.event(temporal=True) def update_messages_tier(self, new_tier_index: int): if new_tier_i...
def remove_machine(self, index: int): self.machines = self.machines[:index] + self.machines[index + 1 :] self._recalculate_all()
terprise", "credits": msg_credits, "price": current_tier["price"] if current_tier else "custom", } # Set total credits display self.total_credits = f"{total:,}" if total_tier else "Custom" # Set recommended tier info if total_tier: self.recom...
self._recalculate_all() @rx.event(temporal=True) def update_machine(self, index: int, new_machine_index: int): self.machines[index] = Machine.from_index(new_machine_index) yield self._recalculate_all() @rx.event(temporal=True) def update_messages_tier(self, new_tier_in...
self.machines = self.machines[:index] + self.machines[index + 1 :]
# Set total credits display self.total_credits = f"{total:,}" if total_tier else "Custom" # Set recommended tier info if total_tier: self.recommended_tier_info = { "price": f"${total_tier['price']}/mo", "needs_enterprise": False, ...
@rx.event(temporal=True) def update_messages_tier(self, new_tier_index: int): if new_tier_index == self.messages_tier_index: return self.messages_tier_index = new_tier_index yield self._recalculate_all() def _find_tier_for_credits(self, credits: float) -> dict ...
def update_machine(self, index: int, new_machine_index: int): self.machines[index] = Machine.from_index(new_machine_index) yield self._recalculate_all()
al:,}" if total_tier else "Custom" # Set recommended tier info if total_tier: self.recommended_tier_info = { "price": f"${total_tier['price']}/mo", "needs_enterprise": False, "name": f"{total_tier['key']} Plan", "credits": tota...
yield self._recalculate_all() @rx.event(temporal=True) def update_messages_tier(self, new_tier_index: int): if new_tier_index == self.messages_tier_index: return self.messages_tier_index = new_tier_index yield self._recalculate_all() def _find_t...
self.machines[index] = Machine.from_index(new_machine_index)
"price": f"${total_tier['price']}/mo", "needs_enterprise": False, "name": f"{total_tier['key']} Plan", "credits": total_tier["credits"], } else: self.recommended_tier_info = { "price": "Custom", ...
def _find_tier_for_credits(self, credits: float) -> dict | None: """Find Pro tier that fits the given credits using binary search.""" for tier in _SORTED_TIERS: if credits <= tier["credits"]: return tier return None @rx.event(temporal=True) def reset_ma...
def update_messages_tier(self, new_tier_index: int): if new_tier_index == self.messages_tier_index: return self.messages_tier_index = new_tier_index yield self._recalculate_all()
"needs_enterprise": False, "name": f"{total_tier['key']} Plan", "credits": total_tier["credits"], } else: self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise...
self.messages_tier_index = new_tier_index yield self._recalculate_all() def _find_tier_for_credits(self, credits: float) -> dict | None: """Find Pro tier that fits the given credits using binary search.""" for tier in _SORTED_TIERS: if credits <= tier["credits"]...
if new_tier_index == self.messages_tier_index: return
ey']} Plan", "credits": total_tier["credits"], } else: self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", } @rx.event(tempo...
yield self._recalculate_all() def _find_tier_for_credits(self, credits: float) -> dict | None: """Find Pro tier that fits the given credits using binary search.""" for tier in _SORTED_TIERS: if credits <= tier["credits"]: return tier return None ...
self.messages_tier_index = new_tier_index
self.recommended_tier_info = { "price": "Custom", "needs_enterprise": True, "name": "Enterprise", "credits": "Custom", } @rx.event(temporal=True) def add_machine(self): self.machines.append(Machine.from_index(0)) ...
@rx.event(temporal=True) def reset_machines(self): self.reset() self._recalculate_all() def total_credits_card() -> rx.Component: return rx.el.div( rx.el.span( "Estimated Credits (Monthly)", class_name="text-secondary-12 text-sm font-medium mb-2", ...
def _find_tier_for_credits(self, credits: float) -> dict | None: """Find Pro tier that fits the given credits using binary search.""" for tier in _SORTED_TIERS: if credits <= tier["credits"]: return tier return None
ise", "credits": "Custom", } @rx.event(temporal=True) def add_machine(self): self.machines.append(Machine.from_index(0)) self._recalculate_all() @rx.event(temporal=True) def remove_machine(self, index: int): self.machines = self.machines[:index] + se...
return None @rx.event(temporal=True) def reset_machines(self): self.reset() self._recalculate_all() def total_credits_card() -> rx.Component: return rx.el.div( rx.el.span( "Estimated Credits (Monthly)", class_name="text-secondary-12 text-sm font-me...
for tier in _SORTED_TIERS: if credits <= tier["credits"]: return tier
m", } @rx.event(temporal=True) def add_machine(self): self.machines.append(Machine.from_index(0)) self._recalculate_all() @rx.event(temporal=True) def remove_machine(self, index: int): self.machines = self.machines[:index] + self.machines[index + 1 :] self._...
return None @rx.event(temporal=True) def reset_machines(self): self.reset() self._recalculate_all() def total_credits_card() -> rx.Component: return rx.el.div( rx.el.span( "Estimated Credits (Monthly)", class_name="text-secondary-12 text-sm font-me...
if credits <= tier["credits"]: return tier
rom_index(0)) self._recalculate_all() @rx.event(temporal=True) def remove_machine(self, index: int): self.machines = self.machines[:index] + self.machines[index + 1 :] self._recalculate_all() @rx.event(temporal=True) def update_machine(self, index: int, new_machine_index: int):...
def total_credits_card() -> rx.Component: return rx.el.div( rx.el.span( "Estimated Credits (Monthly)", class_name="text-secondary-12 text-sm font-medium mb-2", ), rx.el.div( rx.el.div( rx.cond( get_is_enterprise_tier(...
def reset_machines(self): self.reset() self._recalculate_all()
open=message_tooltip_open_cs.value, side="bottom", ), ), ), min=0, max=len(MESSAGES_VALUES) - 1, step=1, on_value_change=lambda new_tier_index: rx.cond( MachineState....
machine_name = COMPUTE_TABLE_KEYS[machine.index] return rx.el.div( rx.el.button( ui.icon("MultiplicationSignIcon", class_name="text-secondary-1 size-4"), on_click=MachineState.remove_machine(index), class_name="absolute -top-1 -right-1 z-10 size-5 flex items-center ...
machine_tooltip_open_cs = ClientStateVar.create( "machine_tooltip_open", default=False, global_ref=False )
), ), min=0, max=len(MESSAGES_VALUES) - 1, step=1, on_value_change=lambda new_tier_index: rx.cond( MachineState.messages_tier_index != new_tier_index, MachineState.update_messages_tier(new_tier_index).throttle(150), ...
return rx.el.div( rx.el.button( ui.icon("MultiplicationSignIcon", class_name="text-secondary-1 size-4"), on_click=MachineState.remove_machine(index), class_name="absolute -top-1 -right-1 z-10 size-5 flex items-center justify-center rounded-full bg-secondary-12 hover:bg-...
machine_name = COMPUTE_TABLE_KEYS[machine.index]