@burdenoff/microfe-store 2026.830.1 → 2026.830.2

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 +1 @@
1
- {"version":3,"file":"ProductDetailPage.js","names":[],"sources":["../../src/pages/ProductDetailPage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState, useCallback, useEffect, useRef, useMemo } from 'react';\nimport { useParams, useNavigate, useLocation } from 'react-router';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport {\n ArrowLeft,\n Star,\n ShieldCheck,\n Check,\n ThumbsUp,\n Package,\n AlertCircle,\n ShoppingCart,\n Loader2,\n} from 'lucide-react';\nimport { useStore } from '../providers/StoreProvider';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../utils/nativeBridge';\nimport {\n useCreateReview,\n useDeleteReview,\n useMarkReviewHelpful,\n useStoreProductDetails,\n useUpdateReview,\n} from '../hooks/useStoreGraphQL';\nimport { useCart } from '../hooks/useCart';\nimport { useInstallations } from '../hooks/useInstallations';\nimport { formatNumber, formatPrice } from '../utils';\nimport { InstallAppModal } from '../components/InstallAppModal';\nimport {\n GlassCard,\n EmphasisPanel,\n PagePurpose,\n NextSteps,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport Markdown from 'react-markdown';\nimport type {\n Product,\n ItemType,\n ProductType,\n PricingModel as CartPricingModel,\n ProductStatus,\n} from '../types';\n\n// ============================================================================\n// Type Definitions for GraphQL Response\n// ============================================================================\n\ninterface Publisher {\n id: string;\n userId?: string;\n name: string;\n email?: string;\n websiteUrl?: string;\n logoUrl?: string;\n bio?: string;\n isVerified: boolean;\n totalSales?: number;\n totalEarnings?: number;\n createdAt?: string;\n organizationId?: string | null;\n developerOrganization?: {\n id: string;\n name: string;\n logoUrl?: string | null;\n isVerified: boolean;\n description?: string | null;\n } | null;\n}\n\ninterface ProductReview {\n id: string;\n productId: string;\n userId: string;\n rating: number;\n title?: string;\n comment?: string;\n status: string;\n helpful: number;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface RelatedProduct {\n id: string;\n name: string;\n slug?: string;\n icon?: string;\n type: string;\n price: number;\n pricingModel: string;\n rating?: number;\n reviewCount?: number;\n downloads: number;\n publisher?: {\n id: string;\n name: string;\n isVerified: boolean;\n };\n}\n\ninterface RatingDistribution {\n fiveStars: number;\n fourStars: number;\n threeStars: number;\n twoStars: number;\n oneStar: number;\n}\n\ninterface UserEntitlement {\n id: string;\n status: string;\n licenseKey?: string;\n expiresAt?: string;\n}\n\ninterface StoreProduct {\n id: string;\n name: string;\n slug?: string;\n type: string;\n nature: string;\n status: string;\n description?: string;\n longDescription?: string;\n pricingModel: string;\n price: number;\n currency: string;\n icon?: string;\n bannerUrl?: string;\n screenshots: string[];\n videoUrls?: string[];\n documentationUrl?: string;\n repositoryUrl?: string;\n category?: string;\n tags?: string[];\n featured: boolean;\n zipFileUrl?: string;\n downloads: number;\n viewCount?: number;\n rating?: number;\n reviewCount: number;\n publishedAt?: string;\n createdAt: string;\n updatedAt: string;\n // Devportal application ID (productId in store maps to devportal Application.id)\n productId?: string;\n // Manifest fields\n subType?: string;\n manifestVersion?: string;\n authorName?: string;\n license?: string;\n minPlatformVersion?: string;\n compatibleProducts?: string[];\n requiredPermissions?: string[];\n integrationDeps?: string[];\n // Physical product fields\n sku?: string;\n stockQuantity?: number;\n trackInventory?: boolean;\n requiresShipping?: boolean;\n weight?: number;\n weightUnit?: string;\n brand?: string;\n manifest?: Record<string, unknown>;\n publisher?: Publisher;\n}\n\ninterface StoreProductDetailsResponse {\n product: StoreProduct;\n publisher: Publisher;\n reviews: ProductReview[];\n reviewsCount: number;\n relatedProducts: RelatedProduct[];\n userReview?: ProductReview;\n isPurchased: boolean;\n userEntitlement?: UserEntitlement;\n ratingDistribution?: RatingDistribution;\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Convert StoreProduct (GraphQL) to Product (Cart) type\n */\nconst convertToCartProduct = (storeProduct: StoreProduct, publisher?: Publisher): Product => {\n // Map GraphQL pricing model to cart pricing model\n const mapPricingModel = (model: string): CartPricingModel => {\n const mapping: Record<string, CartPricingModel> = {\n FREE: 'FREE',\n PAID_ONETIME: 'ONE_TIME',\n SUBSCRIPTION: 'SUBSCRIPTION',\n USAGE_BASED: 'USAGE_BASED',\n FREEMIUM: 'FREEMIUM',\n };\n return mapping[model] || 'ONE_TIME';\n };\n\n // Map product type\n const mapProductType = (type: string): ProductType => {\n const mapping: Record<string, ProductType> = {\n APP: 'STANDALONE_APP',\n BOTAPP: 'STANDALONE_APP',\n AGENT: 'STANDALONE_APP',\n WORKFLOW: 'WORKFLOW_TEMPLATE',\n TEMPLATE: 'WORKFLOW_TEMPLATE',\n INTEGRATION: 'API_INTEGRATION',\n EXTENSION: 'BROWSER_EXTENSION',\n THEME: 'UI_THEME',\n PLUGIN: 'WORKSPACE_MODULE',\n COMPONENT: 'WORKSPACE_MODULE',\n WIDGET: 'WORKSPACE_MODULE',\n VIBEMODULE: 'WORKSPACE_MODULE',\n CONSOLE: 'STANDALONE_APP',\n NODE: 'WORKSPACE_MODULE',\n PARSER: 'WORKSPACE_MODULE',\n DASHBOARD: 'WORKFLOW_TEMPLATE',\n };\n return mapping[type] || 'STANDALONE_APP';\n };\n\n // Map item type\n const mapItemType = (nature: string, type: string): ItemType => {\n if (nature === 'PHYSICAL') return 'PHYSICAL';\n const typeMapping: Record<string, ItemType> = {\n APP: 'APP',\n BOTAPP: 'APP',\n AGENT: 'APP',\n WORKFLOW: 'WORKFLOW',\n TEMPLATE: 'TEMPLATE',\n INTEGRATION: 'INTEGRATION',\n EXTENSION: 'EXTENSION',\n THEME: 'THEME',\n DASHBOARD: 'TEMPLATE',\n };\n return typeMapping[type] || 'APP';\n };\n\n return {\n id: storeProduct.id,\n publisherId: publisher?.id || '',\n publisher: {\n id: publisher?.id || '',\n name: publisher?.name || storeProduct.authorName || 'Unknown',\n displayName: publisher?.name || storeProduct.authorName || 'Unknown',\n email: publisher?.email || '',\n verified: publisher?.isVerified || false,\n totalProducts: 0,\n totalDownloads: 0,\n averageRating: 0,\n joinedAt: publisher?.createdAt || storeProduct.createdAt,\n website: publisher?.websiteUrl,\n logoUrl: publisher?.logoUrl,\n },\n name: storeProduct.name,\n slug: storeProduct.slug || storeProduct.id,\n displayName: storeProduct.name,\n description: storeProduct.longDescription || storeProduct.description || '',\n shortDescription: storeProduct.description || '',\n iconUrl: storeProduct.icon,\n screenshotUrls: storeProduct.screenshots || [],\n videoUrls: storeProduct.videoUrls || [],\n itemType: mapItemType(storeProduct.nature, storeProduct.type),\n type: mapProductType(storeProduct.type),\n tags: storeProduct.tags || [],\n pricingModel: mapPricingModel(storeProduct.pricingModel),\n basePrice: storeProduct.price,\n currency: storeProduct.currency || 'USD',\n variants: [],\n status: (storeProduct.status as ProductStatus) || 'PUBLISHED',\n featured: storeProduct.featured,\n verified: publisher?.isVerified || false,\n downloadCount: storeProduct.downloads,\n installCount: storeProduct.downloads,\n orderCount: 0,\n averageRating: storeProduct.rating || 0,\n reviewCount: storeProduct.reviewCount,\n createdAt: storeProduct.createdAt,\n updatedAt: storeProduct.updatedAt,\n publishedAt: storeProduct.publishedAt,\n };\n};\n\n// ============================================================================\n// Helper Components\n// ============================================================================\n\n/**\n * Rating bar component for rating distribution\n */\nconst RatingBar: FC<{ stars: number; percentage: number; count: number }> = ({\n stars,\n percentage,\n count,\n}) => (\n <div className=\"flex items-center gap-2\">\n <span className=\"w-3 text-xs text-text-muted\">{stars}</span>\n <div className=\"h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className=\"h-full rounded-full bg-status-warning-bg-subtle\"\n style={{ width: `${percentage}%` }}\n />\n </div>\n <span className=\"w-12 text-right text-xs text-text-muted\">{formatNumber(count)}</span>\n </div>\n);\n\n/**\n * Review card component\n */\nconst ReviewCard: FC<{\n review: ProductReview;\n onMarkHelpful: (reviewId: string) => void;\n markingHelpful: boolean;\n}> = ({ review, onMarkHelpful, markingHelpful }) => {\n const formatDate = (dateString: string) => {\n try {\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n } catch {\n return dateString;\n }\n };\n\n return (\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 transition-[box-shadow,border-color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]\">\n <div className=\"mb-3 flex items-start justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex size-10 items-center justify-center rounded-full bg-bg-sunken text-text-muted\">\n <Star className=\"size-4 fill-current\" />\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">Verified Buyer</p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex gap-0.5\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Star\n key={star}\n className={`size-3 ${\n star <= review.rating\n ? 'fill-current text-status-warning-text'\n : 'text-text-muted'\n }`}\n />\n ))}\n </div>\n <span className=\"text-xs text-text-muted\">{formatDate(review.createdAt)}</span>\n </div>\n </div>\n </div>\n </div>\n {review.title && <h4 className=\"mb-2 font-medium text-text-primary\">{review.title}</h4>}\n {review.comment && <p className=\"mb-3 text-sm text-text-muted\">{review.comment}</p>}\n <div className=\"flex items-center justify-between\">\n <button\n type=\"button\"\n onClick={() => onMarkHelpful(review.id)}\n disabled={markingHelpful}\n aria-label=\"Mark this review as helpful\"\n className=\"flex items-center gap-1 text-xs text-text-muted transition-colors hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-60\"\n >\n <ThumbsUp className=\"size-3.5\" />\n <span>{markingHelpful ? 'Updating…' : `Helpful (${review.helpful})`}</span>\n </button>\n </div>\n </div>\n );\n};\n\n/**\n * Loading skeleton component - comprehensive skeleton matching full page layout\n */\nconst LoadingSkeleton: FC = () => (\n <div className=\"h-full overflow-y-auto\">\n {/* Header Skeleton */}\n <div className=\"sticky top-0 z-10 border-b border-border-default bg-bg-surface px-6 py-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-10 animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"h-6 w-48 flex-1 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"flex gap-2\">\n <div className=\"size-10 animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"size-10 animate-pulse rounded-lg bg-bg-sunken\" />\n </div>\n </div>\n </div>\n\n <div className=\"mx-auto max-w-6xl p-6\">\n {/* App Header Section Skeleton */}\n <div className=\"mb-8 flex flex-col gap-6 md:flex-row\">\n {/* App Icon & Basic Info */}\n <div className=\"flex gap-4 md:w-1/2\">\n <div className=\"size-28 animate-pulse rounded-2xl bg-bg-sunken\" />\n <div className=\"flex flex-1 flex-col justify-center gap-2\">\n <div className=\"h-8 w-3/4 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"flex items-center gap-2\">\n <div className=\"h-4 w-32 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"size-4 animate-pulse rounded-full bg-bg-sunken\" />\n </div>\n <div className=\"flex gap-3\">\n <div className=\"h-5 w-16 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-5 w-24 animate-pulse rounded bg-bg-sunken\" />\n </div>\n </div>\n </div>\n\n {/* Rating & Install Skeleton */}\n <div className=\"flex flex-col gap-4 md:w-1/2 md:items-end\">\n <div className=\"flex items-center gap-4\">\n <div className=\"text-center\">\n <div className=\"h-10 w-16 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-20 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-12 w-px bg-border-default\" />\n <div className=\"text-center\">\n <div className=\"h-8 w-16 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-12 w-px bg-border-default\" />\n <div className=\"text-center\">\n <div className=\"h-8 w-20 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-12 animate-pulse rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"flex gap-3\">\n <div className=\"h-12 w-40 animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"size-12 animate-pulse rounded-lg bg-bg-sunken\" />\n </div>\n </div>\n </div>\n\n {/* Screenshots Skeleton */}\n <section className=\"mb-8\">\n <div className=\"aspect-video animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"mt-4 flex gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"h-20 w-36 animate-pulse rounded-lg bg-bg-sunken\" />\n ))}\n </div>\n </section>\n\n {/* About Section Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-32 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-4 w-5/6 rounded bg-bg-sunken\" />\n </div>\n <div className=\"mt-4 flex gap-2\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"h-6 w-16 rounded-full bg-bg-sunken\" />\n ))}\n </div>\n </div>\n </section>\n\n {/* Ratings & Reviews Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-40 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-4 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"mb-6 flex flex-col gap-6 md:flex-row\">\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4 md:w-64\">\n <div className=\"flex items-center gap-6\">\n <div className=\"text-center\">\n <div className=\"h-12 w-16 rounded bg-bg-sunken\" />\n <div className=\"my-1 flex justify-center gap-0.5\">\n {[...Array(5)].map((_, i) => (\n <div key={i} className=\"size-4 rounded bg-bg-sunken\" />\n ))}\n </div>\n <div className=\"h-3 w-20 rounded bg-bg-sunken\" />\n </div>\n <div className=\"flex-1 space-y-1\">\n {[...Array(5)].map((_, i) => (\n <div key={i} className=\"flex items-center gap-2\">\n <div className=\"h-2 w-3 rounded bg-bg-sunken\" />\n <div className=\"h-2 flex-1 rounded-full bg-bg-sunken\" />\n <div className=\"h-2 w-8 rounded bg-bg-sunken\" />\n </div>\n ))}\n </div>\n </div>\n </div>\n <div className=\"h-12 w-32 animate-pulse rounded-lg bg-bg-sunken\" />\n </div>\n {/* Review Cards Skeleton */}\n <div className=\"space-y-4\">\n {[...Array(2)].map((_, i) => (\n <div\n key={i}\n className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\"\n >\n <div className=\"mb-3 flex items-start gap-3\">\n <div className=\"size-10 rounded-full bg-bg-sunken\" />\n <div className=\"flex-1\">\n <div className=\"h-4 w-32 rounded bg-bg-sunken\" />\n <div className=\"mt-1 flex items-center gap-2\">\n <div className=\"flex gap-0.5\">\n {[...Array(5)].map((_, j) => (\n <div key={j} className=\"size-3 rounded bg-bg-sunken\" />\n ))}\n </div>\n <div className=\"h-3 w-20 rounded bg-bg-sunken\" />\n </div>\n </div>\n </div>\n <div className=\"space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n ))}\n </div>\n </section>\n\n {/* Additional Info Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-48 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"grid gap-4 md:grid-cols-2\">\n {[...Array(6)].map((_, i) => (\n <div key={i}>\n <div className=\"h-3 w-16 rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-5 w-24 rounded bg-bg-sunken\" />\n </div>\n ))}\n </div>\n </div>\n </section>\n\n {/* Related Products Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-40 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-4 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"grid gap-4 md:grid-cols-4\">\n {[...Array(4)].map((_, i) => (\n <div\n key={i}\n className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-3\"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"size-14 rounded-xl bg-bg-sunken\" />\n <div className=\"flex-1\">\n <div className=\"h-4 w-24 rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-16 rounded bg-bg-sunken\" />\n <div className=\"mt-1 flex items-center gap-2\">\n <div className=\"h-3 w-8 rounded bg-bg-sunken\" />\n <div className=\"h-3 w-12 rounded bg-bg-sunken\" />\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n\n {/* Publisher Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 h-6 w-36 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-12 rounded-lg bg-bg-sunken\" />\n <div>\n <div className=\"flex items-center gap-2\">\n <div className=\"h-5 w-32 rounded bg-bg-sunken\" />\n <div className=\"size-4 rounded-full bg-bg-sunken\" />\n </div>\n <div className=\"mt-1 h-4 w-40 rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"mt-3 space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n </section>\n </div>\n </div>\n);\n\n/**\n * Error display component\n */\nconst ErrorDisplay: FC<{ error: Error; onRetry: () => void; onBack: () => void }> = ({\n error,\n onRetry,\n onBack,\n}) => (\n <div className=\"flex h-full items-center justify-center\">\n <div className=\"text-center\">\n <AlertCircle className=\"mx-auto mb-4 size-12 text-status-error-text\" />\n <h2 className=\"mb-2 text-xl font-semibold text-text-primary\">Failed to load product</h2>\n <p className=\"mb-4 text-text-muted\">\n {error.message || 'An error occurred while loading the product details.'}\n </p>\n <div className=\"flex justify-center gap-3\">\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-action-primary-text transition-opacity hover:opacity-90\"\n >\n Try Again\n </button>\n <button\n type=\"button\"\n onClick={onBack}\n className=\"rounded-lg border border-border-default px-4 py-2 text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n Go Back\n </button>\n </div>\n </div>\n </div>\n);\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\n/**\n * Product Detail Page Component\n *\n * Displays comprehensive product details using real GraphQL data\n */\nexport const ProductDetailPage: FC = () => {\n const { productId } = useParams<{ productId: string }>();\n const navigate = useNavigate();\n const location = useLocation();\n const { basePath, workspaceId } = useStore();\n const { addProduct, cartItems, addingToCart, createOrder, checkingOut } = useCart();\n const installationsFilter = useMemo(\n () => (productId && workspaceId ? { productId, workspaceId } : undefined),\n [productId, workspaceId]\n );\n const { installations: myInstallations, refetch: refetchInstallations } = useInstallations({\n filter: installationsFilter,\n limit: 1,\n });\n const activeInstallation = myInstallations.find(\n (i) => i.productId === productId && i.workspaceId === workspaceId && i.status === 'ACTIVE'\n );\n const isInstalledInCurrentWorkspace = Boolean(activeInstallation);\n const installedVersion = activeInstallation?.version ?? null;\n\n const { createReview, loading: creatingReview } = useCreateReview();\n const { updateReview, loading: updatingReview } = useUpdateReview();\n const { deleteReview, loading: deletingReview } = useDeleteReview();\n const { markHelpful, loading: markingHelpful } = useMarkReviewHelpful();\n const bus = useEventBus();\n\n const [showFullDescription, setShowFullDescription] = useState(false);\n const [showAllReviews, setShowAllReviews] = useState(false);\n const [buyingNow, setBuyingNow] = useState(false);\n const [quantity, setQuantity] = useState(1);\n const [actionError, setActionError] = useState<string | null>(null);\n const [reviewNotice, setReviewNotice] = useState<string | null>(null);\n const [reviewNoticeTone, setReviewNoticeTone] = useState<'success' | 'error'>('success');\n const [isReviewFormOpen, setIsReviewFormOpen] = useState(false);\n const [reviewTitle, setReviewTitle] = useState('');\n const [reviewComment, setReviewComment] = useState('');\n const [reviewRating, setReviewRating] = useState(5);\n const [helpfulReviewId, setHelpfulReviewId] = useState<string | null>(null);\n\n // Install modal state\n const [isInstallModalOpen, setIsInstallModalOpen] = useState(false);\n\n // Fetch product details using GraphQL\n const { data, loading, error, refetch } = useStoreProductDetails({\n id: productId,\n slug: productId, // Also try as slug\n includeReviews: true,\n reviewsLimit: 10,\n includeRelated: true,\n relatedLimit: 4,\n includeVersions: true,\n });\n\n // Cast data to typed response\n const productDetails = data as StoreProductDetailsResponse | null;\n const product = productDetails?.product;\n const publisher = productDetails?.publisher;\n\n // Check if product is already in cart (must be before any early returns)\n const isInCart = cartItems.some((item) => item.productId === product?.id);\n\n // Pad short version strings (\"1.0\" → \"1.0.0\") so they compare equal to \"1.0.0\"\n const padVer = (v: string) => {\n const p = v.split('.');\n while (p.length < 3) p.push('0');\n return p.join('.');\n };\n const latestVersion = product?.manifestVersion ?? null;\n const hasUpdateAvailable = Boolean(\n isInstalledInCurrentWorkspace &&\n installedVersion &&\n latestVersion &&\n padVer(installedVersion) !== padVer(latestVersion)\n );\n\n // Handle Add to Cart (must be before any early returns)\n const handleAddToCart = useCallback(async () => {\n if (!product) return;\n\n setActionError(null);\n\n if (isInCart) {\n navigate(`${basePath}/cart`);\n return;\n }\n\n try {\n const cartProduct = convertToCartProduct(product, publisher);\n // Add to backend cart via GraphQL API call\n // This will make a mutation to global-public-gateway:4004 → tenantmodule-store-svc:4017\n await addProduct(cartProduct, undefined, quantity);\n // Cart drawer will open automatically after adding\n } catch (error) {\n console.error('Failed to add product to cart:', error);\n setActionError('Failed to add this product to cart. Please try again.');\n }\n }, [product, publisher, addProduct, isInCart, navigate, basePath, quantity]);\n\n // Handle Buy Now - creates an order and immediately proceeds to checkout\n const handleBuyNow = useCallback(async () => {\n if (!product) return;\n\n setActionError(null);\n setBuyingNow(true);\n\n try {\n // Get product price\n const price = product.price || 0;\n\n // Build line item for this product\n const lineItem = {\n productId: product.id,\n name: product.name,\n quantity,\n unitPrice: price,\n subtotal: price * quantity,\n itemType: product.nature?.toLowerCase() || 'digital',\n pricingModel: product.pricingModel || 'PAID_ONETIME',\n };\n\n // Create order input\n const orderInput = {\n total: price * quantity,\n lineItems: [lineItem],\n billingAccountId: '', // Will be set on billing page\n };\n\n // Call createStoreOrder mutation to create PENDING order\n const order = await createOrder(orderInput);\n\n if (order?.id) {\n // Navigate to billing page, preserving org/workspace/tenant context params\n navigate(`/billing/checkout/store/${order.id}${location.search}`);\n } else {\n console.error('Failed to create order');\n setActionError('Failed to create order. Please try again.');\n setBuyingNow(false);\n }\n } catch (error) {\n console.error('Buy Now error:', error);\n const message = error instanceof Error ? error.message : 'Failed to start checkout';\n setActionError(message);\n setBuyingNow(false);\n }\n }, [product, quantity, createOrder, navigate]);\n\n // Handle Install Free - Open modal for workspace selection (must be before any early returns)\n const handleInstallFree = useCallback(() => {\n if (!product) return;\n setIsInstallModalOpen(true);\n }, [product]);\n\n // Emit product.viewed event once product data loads. Read product via ref so\n // we only emit on id transitions, not on every field change.\n const productRef = useRef(product);\n productRef.current = product;\n const busRef = useRef(bus);\n busRef.current = bus;\n useEffect(() => {\n const p = productRef.current;\n if (!p) return;\n (busRef.current as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.product.viewed',\n {\n productId: p.id,\n productSlug: p.slug,\n productType: p.type,\n pricingModel: p.pricingModel,\n }\n );\n }, [product?.id]);\n\n // Handle successful installation (must be before any early returns)\n const handleInstallSuccess = useCallback(\n (workspaceId: string, workspaceName: string) => {\n if (!product) return;\n (bus as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.product.installed',\n {\n productId: product.id,\n workspaceId,\n }\n );\n console.log(\n `Successfully installed ${product.name} to workspace ${workspaceName} (${workspaceId})`\n );\n void refetchInstallations();\n },\n [product, bus, refetchInstallations]\n );\n\n // Handle installation error (must be before any early returns)\n const handleInstallError = useCallback((error: Error) => {\n console.error('Installation failed:', error.message);\n // Error is shown in the modal\n }, []);\n\n const openReviewForm = useCallback(() => {\n setReviewTitle(productDetails?.userReview?.title ?? '');\n setReviewComment(productDetails?.userReview?.comment ?? '');\n setReviewRating(productDetails?.userReview?.rating ?? 5);\n setReviewNotice(null);\n setReviewNoticeTone('success');\n setIsReviewFormOpen(true);\n }, [productDetails?.userReview]);\n\n const handleSubmitReview = useCallback(async () => {\n if (!product) {\n return;\n }\n\n if (reviewRating < 1 || reviewRating > 5) {\n setReviewNoticeTone('error');\n setReviewNotice('Choose a rating from 1 to 5 stars.');\n return;\n }\n\n const payload = {\n productId: product.id,\n rating: reviewRating,\n title: reviewTitle.trim() || undefined,\n comment: reviewComment.trim() || undefined,\n };\n\n const reviewResult = productDetails?.userReview\n ? {\n data: await updateReview(productDetails.userReview.id, {\n rating: payload.rating,\n title: payload.title,\n comment: payload.comment,\n }),\n errorMessage: null,\n }\n : await createReview(payload);\n\n if (!reviewResult?.data) {\n setReviewNoticeTone('error');\n setReviewNotice(\n reviewResult?.errorMessage ?? 'We could not save your review. Please try again.'\n );\n return;\n }\n\n setReviewNoticeTone('success');\n setReviewNotice(\n productDetails?.userReview ? 'Your review was updated.' : 'Your review was submitted.'\n );\n setIsReviewFormOpen(false);\n (bus as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.review.submitted',\n {\n productId: product.id,\n rating: reviewRating,\n }\n );\n await refetch();\n }, [\n bus,\n createReview,\n product,\n productDetails?.userReview,\n refetch,\n reviewComment,\n reviewRating,\n reviewTitle,\n updateReview,\n ]);\n\n const handleDeleteReview = useCallback(async () => {\n if (!productDetails?.userReview) {\n return;\n }\n void nativeImpact('medium');\n const confirmed = await nativeConfirm({\n title: 'Delete review',\n message: 'Are you sure you want to remove your review?',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (confirmed === false) {\n return;\n }\n\n const deleted = await deleteReview(productDetails.userReview.id);\n if (!deleted) {\n setReviewNoticeTone('error');\n setReviewNotice('We could not remove your review. Please try again.');\n void nativeNotify('error');\n return;\n }\n\n setReviewNoticeTone('success');\n setReviewNotice('Your review was removed.');\n setIsReviewFormOpen(false);\n setReviewTitle('');\n setReviewComment('');\n setReviewRating(5);\n void nativeNotify('success');\n await refetch();\n }, [deleteReview, productDetails?.userReview, refetch]);\n\n const handleMarkHelpful = useCallback(\n async (reviewId: string) => {\n setHelpfulReviewId(reviewId);\n const result = await markHelpful(reviewId);\n if (result) {\n await refetch();\n }\n setHelpfulReviewId(null);\n },\n [markHelpful, refetch]\n );\n\n // Handle loading state\n if (loading) {\n return <LoadingSkeleton />;\n }\n\n // Handle error state\n if (error) {\n return (\n <ErrorDisplay\n error={error}\n onRetry={refetch}\n onBack={() => navigate(`${basePath}/marketplace`)}\n />\n );\n }\n\n // Handle not found state\n if (!productDetails?.product) {\n return (\n <div className=\"flex h-full items-center justify-center p-6\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"Product not found\"\n description=\"The product you are looking for does not exist or has been removed.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/marketplace`)}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-action-primary-text transition-opacity hover:opacity-90\"\n >\n Back to Marketplace\n </button>\n }\n />\n </div>\n );\n }\n\n const {\n reviews,\n reviewsCount,\n relatedProducts,\n ratingDistribution,\n isPurchased,\n userEntitlement,\n } = productDetails;\n\n // Type assertion: we know product is defined because we checked !productDetails?.product above\n const safeProduct = product!;\n\n // Calculate rating distribution percentages\n const totalRatings = ratingDistribution\n ? ratingDistribution.fiveStars +\n ratingDistribution.fourStars +\n ratingDistribution.threeStars +\n ratingDistribution.twoStars +\n ratingDistribution.oneStar\n : 0;\n\n const ratingDistributionData = ratingDistribution\n ? [\n {\n stars: 5,\n count: ratingDistribution.fiveStars,\n percentage: totalRatings > 0 ? (ratingDistribution.fiveStars / totalRatings) * 100 : 0,\n },\n {\n stars: 4,\n count: ratingDistribution.fourStars,\n percentage: totalRatings > 0 ? (ratingDistribution.fourStars / totalRatings) * 100 : 0,\n },\n {\n stars: 3,\n count: ratingDistribution.threeStars,\n percentage: totalRatings > 0 ? (ratingDistribution.threeStars / totalRatings) * 100 : 0,\n },\n {\n stars: 2,\n count: ratingDistribution.twoStars,\n percentage: totalRatings > 0 ? (ratingDistribution.twoStars / totalRatings) * 100 : 0,\n },\n {\n stars: 1,\n count: ratingDistribution.oneStar,\n percentage: totalRatings > 0 ? (ratingDistribution.oneStar / totalRatings) * 100 : 0,\n },\n ]\n : [];\n\n // Parse permissions from manifest or requiredPermissions\n const permissions = safeProduct.requiredPermissions || [];\n\n // Parse integrations from integrationDeps\n const integrations = safeProduct.integrationDeps || [];\n\n // Pricing display\n const getPriceDisplay = () => {\n if (safeProduct.pricingModel === 'FREE') return 'Free';\n if (safeProduct.pricingModel === 'SUBSCRIPTION') {\n return `${formatPrice(safeProduct.price, safeProduct.currency)}/mo`;\n }\n return formatPrice(safeProduct.price, safeProduct.currency);\n };\n\n // Check if product is free\n const isFree = safeProduct.pricingModel === 'FREE' || safeProduct.price === 0;\n\n // Physical (produce) product inventory\n const isPhysical = safeProduct.nature === 'PHYSICAL';\n const tracksInventory = isPhysical && safeProduct.trackInventory === true;\n const stockQuantity = safeProduct.stockQuantity ?? 0;\n const isOutOfStock = tracksInventory && stockQuantity <= 0;\n\n return (\n <div className=\"h-full overflow-y-auto bg-bg-base\">\n {/* Hero Section - Two Column Layout */}\n <div className=\"bg-bg-surface\">\n <div className=\"mx-auto max-w-7xl\">\n <div className=\"flex flex-col lg:flex-row\">\n {/* Left Column - Product Info */}\n <div className=\"flex-1 px-6 py-8 lg:max-w-xl lg:py-12\">\n {/* Back Button */}\n <button\n type=\"button\"\n onClick={() => navigate(-1)}\n className=\"mb-6 cursor-pointer inline-flex items-center gap-2 text-sm text-text-muted transition-colors hover:text-text-primary\"\n >\n <ArrowLeft className=\"size-4\" />\n Back\n </button>\n\n {/* App Title - Large Typography */}\n <h1 className=\"mb-3 text-4xl font-normal leading-tight text-text-primary lg:text-5xl\">\n {safeProduct.name}\n </h1>\n\n {/* Installed badge — always above the fold */}\n {isInstalledInCurrentWorkspace && (\n <div className=\"mb-4 inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text\">\n <svg\n className=\"size-3.5\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"2,8 6,12 14,4\" />\n </svg>\n Installed{installedVersion ? ` v${installedVersion}` : ''}\n </div>\n )}\n\n {/* Publisher / org */}\n <div className=\"mb-2\">\n {(() => {\n const org = publisher?.developerOrganization;\n const displayName =\n org?.name || publisher?.name || safeProduct.authorName || 'Unknown Publisher';\n const displayLogo = org?.logoUrl || publisher?.logoUrl;\n const isVerified = org?.isVerified || publisher?.isVerified;\n const linkUrl = publisher?.websiteUrl;\n return (\n <div className=\"flex items-center gap-2\">\n {displayLogo && (\n <img\n src={displayLogo}\n alt={displayName}\n className=\"size-5 rounded object-cover\"\n />\n )}\n {linkUrl ? (\n <a\n href={linkUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-base font-medium text-text-link hover:underline\"\n >\n {displayName}\n </a>\n ) : (\n <span className=\"text-base font-medium text-text-primary\">\n {displayName}\n </span>\n )}\n {isVerified && <ShieldCheck className=\"size-4 text-status-success-text\" />}\n </div>\n );\n })()}\n </div>\n\n {/* Metadata */}\n <p className=\"mb-6 text-sm text-text-muted\">\n {safeProduct.category && <span>{safeProduct.category}</span>}\n {safeProduct.category && ' · '}\n {formatNumber(safeProduct.downloads)}+ downloads\n </p>\n\n {/* Stats + primary action — the single emphasis zone for this page */}\n <EmphasisPanel className=\"mb-6 p-5\">\n {/* Stats Row */}\n <div className=\"mb-6 flex items-center gap-4\">\n {/* App Icon Badge */}\n <div className=\"flex size-12 items-center justify-center overflow-hidden rounded-xl bg-bg-sunken\">\n {safeProduct.icon ? (\n <img src={safeProduct.icon} alt=\"\" className=\"size-full object-cover\" />\n ) : (\n <span className=\"text-lg font-bold text-text-muted\">\n {safeProduct.name.charAt(0)}\n </span>\n )}\n </div>\n\n {/* Rating */}\n <div className=\"flex items-center gap-1 border-l border-border-default pl-4\">\n <span className=\"text-sm font-medium text-text-primary\">\n {(safeProduct.rating || 0).toFixed(1)}\n </span>\n <Star className=\"size-4 fill-current text-status-warning-text\" />\n <span className=\"ml-1 text-xs text-text-muted\">\n {formatNumber(reviewsCount || safeProduct.reviewCount)} reviews\n </span>\n </div>\n\n {/* Downloads */}\n <div className=\"border-l border-border-default pl-4\">\n <span className=\"text-sm font-medium text-text-primary\">\n {formatNumber(safeProduct.downloads)}+\n </span>\n <p className=\"text-xs text-text-muted\">Downloads</p>\n </div>\n\n {/* Type Badge */}\n <div className=\"border-l border-border-default pl-4\">\n <span className=\"rounded bg-bg-sunken px-2 py-1 text-xs font-medium text-text-primary\">\n {safeProduct.type}\n </span>\n <p className=\"mt-0.5 text-xs text-text-muted\">Type</p>\n </div>\n </div>\n\n {/* Action Buttons Row */}\n {actionError && (\n <div\n role=\"alert\"\n className=\"mb-4 rounded-lg border border-status-error-bg bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\"\n >\n {actionError}\n </div>\n )}\n\n {isPhysical && (\n <div className=\"mb-4 flex flex-wrap items-center gap-4\">\n {tracksInventory &&\n (isOutOfStock ? (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-error-bg-subtle px-3 py-1 text-sm font-medium text-status-error-text\">\n <Package className=\"size-4\" />\n Out of stock\n </span>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text\">\n <Package className=\"size-4\" />\n {formatNumber(stockQuantity)} in stock\n </span>\n ))}\n {!isOutOfStock && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-text-muted\">Qty</span>\n <div className=\"flex items-center rounded-full border border-border-default\">\n <button\n type=\"button\"\n onClick={() => setQuantity((q) => Math.max(1, q - 1))}\n disabled={quantity <= 1}\n aria-label=\"Decrease quantity\"\n className=\"cursor-pointer px-3 py-1.5 text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40\"\n >\n −\n </button>\n <span className=\"min-w-8 px-2 text-center text-sm font-medium tabular-nums text-text-primary\">\n {quantity}\n </span>\n <button\n type=\"button\"\n onClick={() =>\n setQuantity((q) =>\n tracksInventory ? Math.min(stockQuantity, q + 1) : q + 1\n )\n }\n disabled={tracksInventory && quantity >= stockQuantity}\n aria-label=\"Increase quantity\"\n className=\"cursor-pointer px-3 py-1.5 text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40\"\n >\n +\n </button>\n </div>\n </div>\n )}\n </div>\n )}\n\n <div className=\"mb-6 flex items-center gap-3\">\n {isInstalledInCurrentWorkspace ? (\n <>\n <button\n type=\"button\"\n disabled\n className=\"flex items-center gap-2 rounded-full bg-status-success-bg-subtle px-8 py-3 font-medium text-status-success-text cursor-default\"\n >\n <svg\n className=\"size-4\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"2,8 6,12 14,4\" />\n </svg>\n Installed\n </button>\n {hasUpdateAvailable && (\n <button\n type=\"button\"\n onClick={handleInstallFree}\n className=\"cursor-pointer rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n Update to v{safeProduct.manifestVersion}\n </button>\n )}\n </>\n ) : !isPhysical && isPurchased && !isFree ? (\n <button\n type=\"button\"\n onClick={handleInstallFree}\n className=\"cursor-pointer rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n Install to Workspace\n </button>\n ) : !isPhysical && isFree ? (\n <button\n type=\"button\"\n onClick={handleInstallFree}\n className=\"cursor-pointer rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n Install\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={handleBuyNow}\n disabled={buyingNow || checkingOut || isOutOfStock}\n className=\"cursor-pointer flex items-center gap-2 rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-70\"\n >\n {buyingNow || checkingOut ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n Processing…\n </>\n ) : isOutOfStock ? (\n 'Out of stock'\n ) : (\n `Buy ${getPriceDisplay()}`\n )}\n </button>\n )}\n\n {/* Add to Cart / Wishlist */}\n {!isFree && (!isPurchased || isPhysical) && (\n <button\n type=\"button\"\n onClick={handleAddToCart}\n disabled={addingToCart || isOutOfStock}\n className=\"cursor-pointer flex items-center gap-2 rounded-full border border-border-default px-4 py-3 text-sm text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\"\n >\n {addingToCart ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : isInCart ? (\n <Check className=\"size-4 text-status-success-text\" />\n ) : (\n <ShoppingCart className=\"size-4\" />\n )}\n {isInCart ? 'In Cart' : 'Add to Cart'}\n </button>\n )}\n </div>\n\n {/* Info Text */}\n {isPhysical ? (\n <>\n <p className=\"flex items-center gap-2 text-xs text-text-muted\">\n <Package className=\"size-4\" />\n {safeProduct.requiresShipping === false\n ? 'Available for pickup — no shipping required'\n : 'Ships to your delivery address'}\n </p>\n {!isFree && (\n <p className=\"text-xs text-text-tertiary\">\n Returns and refunds are handled by {publisher?.name || 'the seller'} per\n their store policy.\n </p>\n )}\n </>\n ) : (\n <>\n <p className=\"flex items-center gap-2 text-xs text-text-muted\">\n <Package className=\"size-4\" />\n This app is available for your workspace\n </p>\n {!isFree && !isPurchased && (\n <p className=\"text-xs text-text-tertiary\">\n All purchases are final. Digital app orders cannot be cancelled or refunded\n once completed.\n </p>\n )}\n\n {/* License Status */}\n {userEntitlement && (\n <p className=\"mt-2 flex items-center gap-2 text-xs text-text-muted\">\n <ShieldCheck className=\"size-4 text-status-success-text\" />\n License: {userEntitlement.status}\n {userEntitlement.expiresAt &&\n ` (Expires: ${new Date(userEntitlement.expiresAt).toLocaleDateString()})`}\n </p>\n )}\n </>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Right Column - Banner or first screenshot */}\n <div className=\"relative flex-1 overflow-hidden bg-bg-sunken lg:min-h-[500px]\">\n {safeProduct.type === 'WORKFLOW' ? (\n /* Live read-only canvas preview served by the app shell's\n public /embed/workflow route (same origin, no auth). */\n <iframe\n src={`${window.location.origin}/embed/workflow?productId=${encodeURIComponent(\n safeProduct.id\n )}&cta=false&theme=${\n document.documentElement.classList.contains('dark') ? 'dark' : 'light'\n }`}\n title={`${safeProduct.name} workflow preview`}\n loading=\"lazy\"\n className=\"size-full min-h-[300px] border-0 lg:min-h-[500px]\"\n />\n ) : safeProduct.bannerUrl ? (\n <img\n src={safeProduct.bannerUrl}\n alt={`${safeProduct.name} banner`}\n className=\"size-full object-cover\"\n />\n ) : safeProduct.screenshots && safeProduct.screenshots.length > 0 ? (\n <img\n src={safeProduct.screenshots[0]}\n alt={`${safeProduct.name} preview`}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"flex h-full min-h-[300px] flex-col items-center justify-center gap-3 p-8 text-center\">\n <div className=\"flex size-20 items-center justify-center rounded-2xl bg-bg-surface text-3xl font-bold text-text-muted\">\n {safeProduct.name.charAt(0)}\n </div>\n <p className=\"text-sm text-text-muted\">No preview available</p>\n <p className=\"max-w-[200px] text-xs text-text-muted opacity-60\">\n Upload screenshots in the Store Listing tab to show a preview here\n </p>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n\n {/* Apple App Store-style Screenshot Strip */}\n {safeProduct.screenshots && safeProduct.screenshots.length > 0 && (\n <div className=\"border-y border-border-default bg-bg-base\">\n <div className=\"px-6 py-6\">\n <h2 className=\"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted\">\n Preview\n </h2>\n <div\n className=\"flex gap-4 overflow-x-auto pb-2\"\n style={{ scrollSnapType: 'x mandatory' }}\n >\n {safeProduct.screenshots.map((src, i) => (\n <div\n key={i}\n className=\"relative flex-shrink-0 overflow-hidden rounded-2xl shadow-lg\"\n style={{\n width: '72vw',\n maxWidth: 680,\n minWidth: 260,\n aspectRatio: '16/9',\n scrollSnapAlign: 'start',\n }}\n >\n <img src={src} alt={`Screenshot ${i + 1}`} className=\"size-full object-cover\" />\n </div>\n ))}\n {/* Spacer so last item doesn't stick to edge */}\n <div className=\"flex-shrink-0 w-2\" />\n </div>\n </div>\n </div>\n )}\n\n {/* Main Content Area */}\n <main className=\"mx-auto max-w-7xl px-6 py-8\">\n <PagePurpose className=\"mb-6\">\n Everything you need to decide whether to install {safeProduct.name}: what it does,\n screenshots, pricing, the permissions and integrations it needs, and real customer\n reviews. When you're ready, install it (free apps) or buy it, then add it to a workspace —\n and leave a review once you've used it.\n </PagePurpose>\n\n <NextSteps\n className=\"mb-8\"\n storageKey=\"store-product-detail\"\n steps={[\n isFree\n ? {\n id: 'install',\n label: 'Install this app',\n description: 'It’s free — add it to a workspace in a couple of clicks.',\n onClick: handleInstallFree,\n done: isInstalledInCurrentWorkspace,\n }\n : {\n id: 'buy',\n label: isPurchased ? 'Install to a workspace' : 'Buy or add to cart',\n description: isPurchased\n ? 'You already own this — install it where you need it.'\n : 'Purchase now, or add it to your cart to check out later.',\n onClick: isPurchased ? handleInstallFree : handleBuyNow,\n done: isInstalledInCurrentWorkspace,\n },\n ...(permissions.length > 0\n ? [\n {\n id: 'permissions',\n label: 'Review what it can access',\n description: 'Check the permissions this app requires before installing.',\n href: '#about-permissions',\n },\n ]\n : []),\n {\n id: 'reviews',\n label: 'Read the reviews',\n description: 'See what other customers think before committing.',\n href: '#ratings-reviews',\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-8 lg:flex-row\">\n {/* Left Content */}\n <div className=\"flex-1 lg:max-w-3xl\">\n {/* About this app */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center justify-between text-left\">\n <h2 className=\"text-lg font-medium text-text-primary\">About this app</h2>\n </div>\n <div className=\"text-sm leading-relaxed text-text-secondary\">\n <div className={!showFullDescription ? 'line-clamp-4' : ''}>\n <Markdown>\n {safeProduct.longDescription ||\n safeProduct.description ||\n 'No description available.'}\n </Markdown>\n </div>\n {((safeProduct.longDescription || safeProduct.description)?.length ?? 0) > 200 && (\n <button\n type=\"button\"\n onClick={() => setShowFullDescription(!showFullDescription)}\n className=\"cursor-pointer mt-3 text-sm font-medium text-text-link\"\n >\n {showFullDescription ? 'Show less' : 'Show more'}\n </button>\n )}\n </div>\n {/* Tags */}\n {safeProduct.tags && safeProduct.tags.length > 0 && (\n <div className=\"mt-4 flex flex-wrap gap-2\">\n {safeProduct.tags.map((tag) => (\n <span\n key={tag}\n className=\"rounded-full border border-border-seam px-3 py-1.5 text-xs text-text-muted transition-colors hover:bg-bg-sunken\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </section>\n\n {/* Ratings & Reviews */}\n <section id=\"ratings-reviews\" className=\"mb-8 scroll-mt-6\">\n <div className=\"mb-4 flex items-center justify-between text-left\">\n <h2 className=\"text-lg font-medium text-text-primary\">Ratings & Reviews</h2>\n </div>\n\n <GlassCard treatment=\"insight\" className=\"p-5\">\n {reviews && reviews.length > 0 ? (\n <div className=\"flex items-start gap-8\">\n {/* Rating Score */}\n <div className=\"text-center\">\n <p className=\"text-5xl font-light tabular-nums text-text-primary\">\n {(safeProduct.rating || 0).toFixed(1)}\n </p>\n <div className=\"my-2 flex justify-center gap-0.5\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Star\n key={star}\n className={`size-4 ${\n star <= Math.round(safeProduct.rating || 0)\n ? 'fill-current text-status-warning-text'\n : 'text-text-muted'\n }`}\n />\n ))}\n </div>\n <p className=\"text-sm text-text-muted\">\n {formatNumber(reviewsCount || safeProduct.reviewCount)} reviews\n </p>\n </div>\n\n {/* Rating Distribution */}\n {ratingDistributionData.length > 0 && (\n <div className=\"flex-1 space-y-1.5\">\n {ratingDistributionData.map((item) => (\n <RatingBar key={item.stars} {...item} />\n ))}\n </div>\n )}\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center py-6 text-center\">\n <div className=\"mb-3 flex gap-0.5\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Star key={star} className=\"size-5 text-border-default\" />\n ))}\n </div>\n <p className=\"font-medium text-text-primary\">No reviews yet</p>\n <p className=\"mt-1 text-sm text-text-muted\">\n Be the first to share your experience with this app.\n </p>\n </div>\n )}\n\n {/* Write Review */}\n <div className=\"mt-6 border-t border-border-seam pt-4\">\n {reviewNotice && (\n <p\n role={reviewNoticeTone === 'success' ? 'status' : 'alert'}\n className={`mb-3 rounded-lg px-3 py-2 text-sm ${\n reviewNoticeTone === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : 'bg-status-error-bg-subtle text-status-error-text'\n }`}\n >\n {reviewNotice}\n </p>\n )}\n {isInstalledInCurrentWorkspace || productDetails?.userReview ? (\n <div className=\"space-y-4\">\n <button\n type=\"button\"\n onClick={() =>\n isReviewFormOpen ? setIsReviewFormOpen(false) : openReviewForm()\n }\n className=\"w-full cursor-pointer py-2 text-center text-sm font-medium text-text-primary transition-colors hover:text-text-link\"\n >\n {productDetails?.userReview\n ? isReviewFormOpen\n ? 'Cancel review editing'\n : 'Edit your review'\n : isReviewFormOpen\n ? 'Cancel review'\n : 'Write a Review'}\n </button>\n\n {isReviewFormOpen && (\n <div className=\"rounded-xl border border-border-seam bg-bg-sunken p-4\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">Your rating</p>\n <div className=\"mt-2 flex flex-wrap gap-2\">\n {[1, 2, 3, 4, 5].map((star) => (\n <button\n key={star}\n type=\"button\"\n onClick={() => setReviewRating(star)}\n className={`cursor-pointer rounded-full border px-3 py-1.5 text-sm transition-colors ${\n reviewRating === star\n ? 'border-action-primary-border bg-action-primary-bg text-action-primary-text'\n : 'border-border-default bg-bg-surface text-text-primary hover:bg-bg-surface'\n }`}\n >\n {star} ★\n </button>\n ))}\n </div>\n </div>\n\n <label className=\"mt-4 block text-sm font-medium text-text-primary\">\n Title\n <input\n aria-label=\"Review title\"\n value={reviewTitle}\n onChange={(event) => setReviewTitle(event.target.value)}\n className=\"mt-2 w-full rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary outline-none focus:border-action-primary-border\"\n placeholder=\"Summarize your experience\"\n />\n </label>\n\n <label className=\"mt-4 block text-sm font-medium text-text-primary\">\n Review\n <textarea\n aria-label=\"Review body\"\n value={reviewComment}\n onChange={(event) => setReviewComment(event.target.value)}\n rows={4}\n required\n aria-required=\"true\"\n className=\"mt-2 w-full rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary outline-none focus:border-action-primary-border\"\n placeholder=\"What worked well? What should improve?\"\n />\n </label>\n\n <div className=\"mt-4 flex flex-wrap gap-3\">\n <button\n type=\"button\"\n onClick={handleSubmitReview}\n disabled={creatingReview || updatingReview}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {creatingReview || updatingReview\n ? 'Saving...'\n : productDetails?.userReview\n ? 'Update Review'\n : 'Submit Review'}\n </button>\n {productDetails?.userReview && (\n <button\n type=\"button\"\n onClick={handleDeleteReview}\n disabled={deletingReview}\n className=\"cursor-pointer rounded-lg border border-status-error-border px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {deletingReview ? 'Removing...' : 'Delete Review'}\n </button>\n )}\n </div>\n </div>\n )}\n </div>\n ) : (\n <p className=\"text-center text-sm text-text-muted\">\n Install this app to leave a review.\n </p>\n )}\n </div>\n </GlassCard>\n\n {/* Reviews List */}\n {reviews && reviews.length > 0 && (\n <div className=\"mt-4 space-y-3\">\n <ul className=\"space-y-3\">\n {(showAllReviews ? reviews : reviews.slice(0, 2)).map((review) => (\n <li key={review.id}>\n <ReviewCard\n review={review}\n onMarkHelpful={handleMarkHelpful}\n markingHelpful={markingHelpful && helpfulReviewId === review.id}\n />\n </li>\n ))}\n </ul>\n {reviews.length > 2 && (\n <button\n type=\"button\"\n onClick={() => setShowAllReviews(!showAllReviews)}\n className=\"cursor-pointer text-sm font-medium text-text-link\"\n >\n {showAllReviews ? 'Show less' : `Show all ${reviews.length} reviews`}\n </button>\n )}\n </div>\n )}\n {(!reviews || reviews.length === 0) && (\n <p className=\"mt-4 text-sm text-text-muted\">\n No reviews yet. Be the first to review!\n </p>\n )}\n </section>\n\n {/* Permissions */}\n {permissions.length > 0 && (\n <section id=\"about-permissions\" className=\"mb-8 scroll-mt-6\">\n <h2 className=\"mb-4 text-lg font-medium text-text-primary\">Required Permissions</h2>\n <div className=\"space-y-2\">\n {permissions.map((permission) => (\n <div\n key={permission}\n className=\"flex items-center gap-3 rounded-lg bg-bg-surface px-4 py-3\"\n >\n <ShieldCheck className=\"size-5 text-status-success-text\" />\n <span className=\"text-sm text-text-primary\">{permission}</span>\n </div>\n ))}\n </div>\n </section>\n )}\n\n {/* Integrations */}\n {integrations.length > 0 && (\n <section className=\"mb-8\">\n <h2 className=\"mb-4 text-lg font-medium text-text-primary\">Integrations</h2>\n <div className=\"flex flex-wrap gap-2\">\n {integrations.map((integration) => (\n <span\n key={integration}\n className=\"rounded-lg bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary\"\n >\n {integration}\n </span>\n ))}\n </div>\n </section>\n )}\n\n {/* Additional Information */}\n <section className=\"mb-8\">\n <h2 className=\"mb-4 text-lg font-medium text-text-primary\">Additional Information</h2>\n <GlassCard treatment=\"metric\" className=\"grid grid-cols-2 gap-6 p-5 md:grid-cols-3\">\n {safeProduct.manifestVersion && (\n <div>\n <p className=\"text-xs text-text-muted\">Version</p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {safeProduct.manifestVersion}\n </p>\n </div>\n )}\n <div>\n <p className=\"text-xs text-text-muted\">Type</p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">{safeProduct.type}</p>\n </div>\n {safeProduct.publishedAt && (\n <div>\n <p className=\"text-xs text-text-muted\">Published</p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {new Date(safeProduct.publishedAt).toLocaleDateString()}\n </p>\n </div>\n )}\n <div>\n <p className=\"text-xs text-text-muted\">Updated</p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {new Date(safeProduct.updatedAt).toLocaleDateString()}\n </p>\n </div>\n {safeProduct.license && (\n <div>\n <p className=\"text-xs text-text-muted\">License</p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {safeProduct.license}\n </p>\n </div>\n )}\n {safeProduct.minPlatformVersion && (\n <div>\n <p className=\"text-xs text-text-muted\">Min Platform Version</p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {safeProduct.minPlatformVersion}\n </p>\n </div>\n )}\n </GlassCard>\n </section>\n </div>\n\n {/* Right Sidebar */}\n <div className=\"w-full lg:w-80\">\n {/* App Support */}\n {(safeProduct.documentationUrl || safeProduct.repositoryUrl || publisher?.email) && (\n <GlassCard className=\"mb-6 p-4\">\n <h3 className=\"font-medium text-text-primary\">App support</h3>\n <div className=\"mt-3 space-y-2 text-sm\">\n {safeProduct.documentationUrl && (\n <a\n href={safeProduct.documentationUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"block text-text-link hover:underline\"\n >\n Documentation\n </a>\n )}\n {safeProduct.repositoryUrl && (\n <a\n href={safeProduct.repositoryUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"block text-text-link hover:underline\"\n >\n Source repository\n </a>\n )}\n {publisher?.email && (\n <a\n href={`mailto:${publisher.email}`}\n className=\"block text-text-link hover:underline\"\n >\n Contact publisher\n </a>\n )}\n </div>\n </GlassCard>\n )}\n\n {/* Publisher / org card */}\n {publisher && (\n <GlassCard className=\"mb-6 p-4\">\n {(() => {\n const org = publisher.developerOrganization;\n const displayName = org?.name || publisher.name;\n const displayLogo = org?.logoUrl || publisher.logoUrl;\n const displayBio = org?.description || publisher.bio;\n const isVerified = org?.isVerified || publisher.isVerified;\n return (\n <>\n <div className=\"flex items-center gap-2.5\">\n {displayLogo ? (\n <img\n src={displayLogo}\n alt={displayName}\n className=\"size-8 rounded-lg object-cover\"\n />\n ) : (\n <div className=\"flex size-8 items-center justify-center rounded-lg bg-bg-sunken text-sm font-bold text-text-muted\">\n {displayName.charAt(0)}\n </div>\n )}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"font-medium text-text-primary truncate\">\n {displayName}\n </span>\n {isVerified && (\n <ShieldCheck className=\"size-3.5 text-status-success-text shrink-0\" />\n )}\n </div>\n </div>\n </div>\n {displayBio && <p className=\"mt-2 text-sm text-text-muted\">{displayBio}</p>}\n {publisher.websiteUrl && (\n <a\n href={publisher.websiteUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"mt-3 inline-block text-sm text-text-link hover:underline\"\n >\n Visit website\n </a>\n )}\n </>\n );\n })()}\n </GlassCard>\n )}\n\n {/* Similar Apps */}\n {relatedProducts && relatedProducts.length > 0 && (\n <div>\n <div className=\"mb-4 flex items-center justify-between text-left\">\n <span className=\"font-medium text-text-primary\">Similar apps</span>\n </div>\n <div className=\"space-y-3\">\n {relatedProducts.slice(0, 4).map((related) => (\n <button\n type=\"button\"\n key={related.id}\n onClick={() => navigate(`${basePath}/marketplace/product/${related.id}`)}\n className=\"flex w-full cursor-pointer items-center gap-3 rounded-lg p-2 text-left transition-colors hover:bg-bg-sunken\"\n >\n {related.icon ? (\n <img\n src={related.icon}\n alt={related.name}\n className=\"size-12 rounded-xl object-cover\"\n />\n ) : (\n <div className=\"flex size-12 items-center justify-center rounded-xl bg-bg-sunken text-lg font-bold text-text-muted\">\n {related.name.charAt(0)}\n </div>\n )}\n <div className=\"flex-1 overflow-hidden\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {related.name}\n </p>\n <p className=\"text-xs text-text-muted\">{publisher?.name || 'Unknown'}</p>\n {(related.reviewCount ?? 0) > 0 && (\n <div className=\"flex items-center gap-1\">\n <span className=\"text-xs text-text-muted\">\n {(related.rating || 0).toFixed(1)}\n </span>\n <Star className=\"size-3 fill-current text-status-warning-text\" />\n </div>\n )}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n </main>\n\n {/* Install App Modal */}\n {safeProduct && (\n <InstallAppModal\n isOpen={isInstallModalOpen}\n onClose={() => setIsInstallModalOpen(false)}\n app={{\n id: safeProduct.id,\n applicationId: safeProduct.productId,\n name: safeProduct.name,\n slug: safeProduct.slug,\n icon: safeProduct.icon,\n type: safeProduct.type,\n version: safeProduct.manifestVersion,\n permissions: permissions.length > 0 ? permissions : undefined,\n }}\n purchaseState={isPurchased && !isFree ? 'purchased' : 'free'}\n onInstallSuccess={handleInstallSuccess}\n onInstallError={handleInstallError}\n />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2LA,IAAM,MAAwB,GAA4B,OAqDjD;CACL,IAAI,EAAa;CACjB,aAAa,GAAW,MAAM;CAC9B,WAAW;EACT,IAAI,GAAW,MAAM;EACrB,MAAM,GAAW,QAAQ,EAAa,cAAc;EACpD,aAAa,GAAW,QAAQ,EAAa,cAAc;EAC3D,OAAO,GAAW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WAAU;qBAAf;YACE,kBAAC,KAAD;aAAG,WAAU;uBACV,EAAQ;aACP,CAAA;YACJ,kBAAC,KAAD;aAAG,WAAU;uBAA2B,GAAW,QAAQ;aAAc,CAAA;aACvE,EAAQ,eAAe,KAAK,KAC5B,kBAAC,OAAD;aAAK,WAAU;uBAAf,CACE,kBAAC,QAAD;cAAM,WAAU;yBACZ,EAAQ,UAAU,GAAG,QAAQ,EAAE;cAC5B,CAAA,EACP,kBAAC,GAAD,EAAM,WAAU,gDAAiD,CAAA,CAC7D;;YAEJ;aACC;YA7BF,EAAQ,GA6BN,CACT;SACE,CAAA,CACF,EAAA,CAAA;QAEJ;SACF;;KACD;;GAGN,KACC,kBAAC,IAAD;IACE,QAAQ;IACR,eAAe,GAAsB,GAAM;IAC3C,KAAK;KACH,IAAI,EAAY;KAChB,eAAe,EAAY;KAC3B,MAAM,EAAY;KAClB,MAAM,EAAY;KAClB,MAAM,EAAY;KAClB,MAAM,EAAY;KAClB,SAAS,EAAY;KACrB,aAAa,EAAY,SAAS,IAAI,IAAc,KAAA;KACrD;IACD,eAAe,KAAe,CAAC,IAAS,cAAc;IACtD,kBAAkB;IAClB,gBAAgB;IAChB,CAAA;GAEA"}
1
+ {"version":3,"file":"ProductDetailPage.js","names":[],"sources":["../../src/pages/ProductDetailPage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState, useCallback, useEffect, useRef, useMemo } from 'react';\nimport { useParams, useNavigate, useLocation } from 'react-router';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport {\n ArrowLeft,\n Star,\n ShieldCheck,\n Check,\n ThumbsUp,\n Package,\n AlertCircle,\n ShoppingCart,\n Loader2,\n} from 'lucide-react';\nimport { useStore } from '../providers/StoreProvider';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../utils/nativeBridge';\nimport {\n useCreateReview,\n useDeleteReview,\n useMarkReviewHelpful,\n useStoreProductDetails,\n useUpdateReview,\n} from '../hooks/useStoreGraphQL';\nimport { useCart } from '../hooks/useCart';\nimport { useInstallations } from '../hooks/useInstallations';\nimport { formatNumber, formatPrice } from '../utils';\nimport { useTr } from '../shared/hooks/useTr';\nimport { InstallAppModal } from '../components/InstallAppModal';\nimport {\n GlassCard,\n EmphasisPanel,\n PagePurpose,\n NextSteps,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport Markdown from 'react-markdown';\nimport type {\n Product,\n ItemType,\n ProductType,\n PricingModel as CartPricingModel,\n ProductStatus,\n} from '../types';\n\n// ============================================================================\n// Type Definitions for GraphQL Response\n// ============================================================================\n\ninterface Publisher {\n id: string;\n userId?: string;\n name: string;\n email?: string;\n websiteUrl?: string;\n logoUrl?: string;\n bio?: string;\n isVerified: boolean;\n totalSales?: number;\n totalEarnings?: number;\n createdAt?: string;\n organizationId?: string | null;\n developerOrganization?: {\n id: string;\n name: string;\n logoUrl?: string | null;\n isVerified: boolean;\n description?: string | null;\n } | null;\n}\n\ninterface ProductReview {\n id: string;\n productId: string;\n userId: string;\n rating: number;\n title?: string;\n comment?: string;\n status: string;\n helpful: number;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface RelatedProduct {\n id: string;\n name: string;\n slug?: string;\n icon?: string;\n type: string;\n price: number;\n pricingModel: string;\n rating?: number;\n reviewCount?: number;\n downloads: number;\n publisher?: {\n id: string;\n name: string;\n isVerified: boolean;\n };\n}\n\ninterface RatingDistribution {\n fiveStars: number;\n fourStars: number;\n threeStars: number;\n twoStars: number;\n oneStar: number;\n}\n\ninterface UserEntitlement {\n id: string;\n status: string;\n licenseKey?: string;\n expiresAt?: string;\n}\n\ninterface StoreProduct {\n id: string;\n name: string;\n slug?: string;\n type: string;\n nature: string;\n status: string;\n description?: string;\n longDescription?: string;\n pricingModel: string;\n price: number;\n currency: string;\n icon?: string;\n bannerUrl?: string;\n screenshots: string[];\n videoUrls?: string[];\n documentationUrl?: string;\n repositoryUrl?: string;\n category?: string;\n tags?: string[];\n featured: boolean;\n zipFileUrl?: string;\n downloads: number;\n viewCount?: number;\n rating?: number;\n reviewCount: number;\n publishedAt?: string;\n createdAt: string;\n updatedAt: string;\n // Devportal application ID (productId in store maps to devportal Application.id)\n productId?: string;\n // Manifest fields\n subType?: string;\n manifestVersion?: string;\n authorName?: string;\n license?: string;\n minPlatformVersion?: string;\n compatibleProducts?: string[];\n requiredPermissions?: string[];\n integrationDeps?: string[];\n // Physical product fields\n sku?: string;\n stockQuantity?: number;\n trackInventory?: boolean;\n requiresShipping?: boolean;\n weight?: number;\n weightUnit?: string;\n brand?: string;\n manifest?: Record<string, unknown>;\n publisher?: Publisher;\n}\n\ninterface StoreProductDetailsResponse {\n product: StoreProduct;\n publisher: Publisher;\n reviews: ProductReview[];\n reviewsCount: number;\n relatedProducts: RelatedProduct[];\n userReview?: ProductReview;\n isPurchased: boolean;\n userEntitlement?: UserEntitlement;\n ratingDistribution?: RatingDistribution;\n}\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Convert StoreProduct (GraphQL) to Product (Cart) type\n */\nconst convertToCartProduct = (\n storeProduct: StoreProduct,\n publisher?: Publisher,\n tr?: (key: string, fallback: string) => string\n): Product => {\n // Map GraphQL pricing model to cart pricing model\n const mapPricingModel = (model: string): CartPricingModel => {\n const mapping: Record<string, CartPricingModel> = {\n FREE: 'FREE',\n PAID_ONETIME: 'ONE_TIME',\n SUBSCRIPTION: 'SUBSCRIPTION',\n USAGE_BASED: 'USAGE_BASED',\n FREEMIUM: 'FREEMIUM',\n };\n return mapping[model] || 'ONE_TIME';\n };\n\n // Map product type\n const mapProductType = (type: string): ProductType => {\n const mapping: Record<string, ProductType> = {\n APP: 'STANDALONE_APP',\n BOTAPP: 'STANDALONE_APP',\n AGENT: 'STANDALONE_APP',\n WORKFLOW: 'WORKFLOW_TEMPLATE',\n TEMPLATE: 'WORKFLOW_TEMPLATE',\n INTEGRATION: 'API_INTEGRATION',\n EXTENSION: 'BROWSER_EXTENSION',\n THEME: 'UI_THEME',\n PLUGIN: 'WORKSPACE_MODULE',\n COMPONENT: 'WORKSPACE_MODULE',\n WIDGET: 'WORKSPACE_MODULE',\n VIBEMODULE: 'WORKSPACE_MODULE',\n CONSOLE: 'STANDALONE_APP',\n NODE: 'WORKSPACE_MODULE',\n PARSER: 'WORKSPACE_MODULE',\n DASHBOARD: 'WORKFLOW_TEMPLATE',\n };\n return mapping[type] || 'STANDALONE_APP';\n };\n\n // Map item type\n const mapItemType = (nature: string, type: string): ItemType => {\n if (nature === 'PHYSICAL') return 'PHYSICAL';\n const typeMapping: Record<string, ItemType> = {\n APP: 'APP',\n BOTAPP: 'APP',\n AGENT: 'APP',\n WORKFLOW: 'WORKFLOW',\n TEMPLATE: 'TEMPLATE',\n INTEGRATION: 'INTEGRATION',\n EXTENSION: 'EXTENSION',\n THEME: 'THEME',\n DASHBOARD: 'TEMPLATE',\n };\n return typeMapping[type] || 'APP';\n };\n\n return {\n id: storeProduct.id,\n publisherId: publisher?.id || '',\n publisher: {\n id: publisher?.id || '',\n name:\n publisher?.name ||\n storeProduct.authorName ||\n tr?.('common.unknown', 'Unknown') ||\n 'Unknown',\n displayName:\n publisher?.name ||\n storeProduct.authorName ||\n tr?.('common.unknown', 'Unknown') ||\n 'Unknown',\n email: publisher?.email || '',\n verified: publisher?.isVerified || false,\n totalProducts: 0,\n totalDownloads: 0,\n averageRating: 0,\n joinedAt: publisher?.createdAt || storeProduct.createdAt,\n website: publisher?.websiteUrl,\n logoUrl: publisher?.logoUrl,\n },\n name: storeProduct.name,\n slug: storeProduct.slug || storeProduct.id,\n displayName: storeProduct.name,\n description: storeProduct.longDescription || storeProduct.description || '',\n shortDescription: storeProduct.description || '',\n iconUrl: storeProduct.icon,\n screenshotUrls: storeProduct.screenshots || [],\n videoUrls: storeProduct.videoUrls || [],\n itemType: mapItemType(storeProduct.nature, storeProduct.type),\n type: mapProductType(storeProduct.type),\n tags: storeProduct.tags || [],\n pricingModel: mapPricingModel(storeProduct.pricingModel),\n basePrice: storeProduct.price,\n currency: storeProduct.currency || 'USD',\n variants: [],\n status: (storeProduct.status as ProductStatus) || 'PUBLISHED',\n featured: storeProduct.featured,\n verified: publisher?.isVerified || false,\n downloadCount: storeProduct.downloads,\n installCount: storeProduct.downloads,\n orderCount: 0,\n averageRating: storeProduct.rating || 0,\n reviewCount: storeProduct.reviewCount,\n createdAt: storeProduct.createdAt,\n updatedAt: storeProduct.updatedAt,\n publishedAt: storeProduct.publishedAt,\n };\n};\n\n// ============================================================================\n// Helper Components\n// ============================================================================\n\n/**\n * Rating bar component for rating distribution\n */\nconst RatingBar: FC<{ stars: number; percentage: number; count: number }> = ({\n stars,\n percentage,\n count,\n}) => (\n <div className=\"flex items-center gap-2\">\n <span className=\"w-3 text-xs text-text-muted\">{stars}</span>\n <div className=\"h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className=\"h-full rounded-full bg-status-warning-bg-subtle\"\n style={{ width: `${percentage}%` }}\n />\n </div>\n <span className=\"w-12 text-right text-xs text-text-muted\">{formatNumber(count)}</span>\n </div>\n);\n\n/**\n * Review card component\n */\nconst ReviewCard: FC<{\n review: ProductReview;\n onMarkHelpful: (reviewId: string) => void;\n markingHelpful: boolean;\n}> = ({ review, onMarkHelpful, markingHelpful }) => {\n const tr = useTr();\n const formatDate = (dateString: string) => {\n try {\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n } catch {\n return dateString;\n }\n };\n\n return (\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 transition-[box-shadow,border-color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]\">\n <div className=\"mb-3 flex items-start justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex size-10 items-center justify-center rounded-full bg-bg-sunken text-text-muted\">\n <Star className=\"size-4 fill-current\" />\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">\n {tr('pages.productDetail.verifiedBuyer', 'Verified Buyer')}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex gap-0.5\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Star\n key={star}\n className={`size-3 ${\n star <= review.rating\n ? 'fill-current text-status-warning-text'\n : 'text-text-muted'\n }`}\n />\n ))}\n </div>\n <span className=\"text-xs text-text-muted\">{formatDate(review.createdAt)}</span>\n </div>\n </div>\n </div>\n </div>\n {review.title && <h4 className=\"mb-2 font-medium text-text-primary\">{review.title}</h4>}\n {review.comment && <p className=\"mb-3 text-sm text-text-muted\">{review.comment}</p>}\n <div className=\"flex items-center justify-between\">\n <button\n type=\"button\"\n onClick={() => onMarkHelpful(review.id)}\n disabled={markingHelpful}\n aria-label={tr('pages.productDetail.markHelpful', 'Mark this review as helpful')}\n className=\"flex items-center gap-1 text-xs text-text-muted transition-colors hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-60\"\n >\n <ThumbsUp className=\"size-3.5\" />\n <span>\n {markingHelpful\n ? tr('pages.productDetail.updatingHelpful', 'Updating…')\n : tr('pages.productDetail.helpful', 'Helpful ({{count}})', { count: review.helpful })}\n </span>\n </button>\n </div>\n </div>\n );\n};\n\n/**\n * Loading skeleton component - comprehensive skeleton matching full page layout\n */\nconst LoadingSkeleton: FC = () => (\n <div className=\"h-full overflow-y-auto\">\n {/* Header Skeleton */}\n <div className=\"sticky top-0 z-10 border-b border-border-default bg-bg-surface px-6 py-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-10 animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"h-6 w-48 flex-1 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"flex gap-2\">\n <div className=\"size-10 animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"size-10 animate-pulse rounded-lg bg-bg-sunken\" />\n </div>\n </div>\n </div>\n\n <div className=\"mx-auto max-w-6xl p-6\">\n {/* App Header Section Skeleton */}\n <div className=\"mb-8 flex flex-col gap-6 md:flex-row\">\n {/* App Icon & Basic Info */}\n <div className=\"flex gap-4 md:w-1/2\">\n <div className=\"size-28 animate-pulse rounded-2xl bg-bg-sunken\" />\n <div className=\"flex flex-1 flex-col justify-center gap-2\">\n <div className=\"h-8 w-3/4 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"flex items-center gap-2\">\n <div className=\"h-4 w-32 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"size-4 animate-pulse rounded-full bg-bg-sunken\" />\n </div>\n <div className=\"flex gap-3\">\n <div className=\"h-5 w-16 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-5 w-24 animate-pulse rounded bg-bg-sunken\" />\n </div>\n </div>\n </div>\n\n {/* Rating & Install Skeleton */}\n <div className=\"flex flex-col gap-4 md:w-1/2 md:items-end\">\n <div className=\"flex items-center gap-4\">\n <div className=\"text-center\">\n <div className=\"h-10 w-16 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-20 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-12 w-px bg-border-default\" />\n <div className=\"text-center\">\n <div className=\"h-8 w-16 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-12 w-px bg-border-default\" />\n <div className=\"text-center\">\n <div className=\"h-8 w-20 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-12 animate-pulse rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"flex gap-3\">\n <div className=\"h-12 w-40 animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"size-12 animate-pulse rounded-lg bg-bg-sunken\" />\n </div>\n </div>\n </div>\n\n {/* Screenshots Skeleton */}\n <section className=\"mb-8\">\n <div className=\"aspect-video animate-pulse rounded-lg bg-bg-sunken\" />\n <div className=\"mt-4 flex gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"h-20 w-36 animate-pulse rounded-lg bg-bg-sunken\" />\n ))}\n </div>\n </section>\n\n {/* About Section Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-32 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-4 w-5/6 rounded bg-bg-sunken\" />\n </div>\n <div className=\"mt-4 flex gap-2\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"h-6 w-16 rounded-full bg-bg-sunken\" />\n ))}\n </div>\n </div>\n </section>\n\n {/* Ratings & Reviews Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-40 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-4 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"mb-6 flex flex-col gap-6 md:flex-row\">\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4 md:w-64\">\n <div className=\"flex items-center gap-6\">\n <div className=\"text-center\">\n <div className=\"h-12 w-16 rounded bg-bg-sunken\" />\n <div className=\"my-1 flex justify-center gap-0.5\">\n {[...Array(5)].map((_, i) => (\n <div key={i} className=\"size-4 rounded bg-bg-sunken\" />\n ))}\n </div>\n <div className=\"h-3 w-20 rounded bg-bg-sunken\" />\n </div>\n <div className=\"flex-1 space-y-1\">\n {[...Array(5)].map((_, i) => (\n <div key={i} className=\"flex items-center gap-2\">\n <div className=\"h-2 w-3 rounded bg-bg-sunken\" />\n <div className=\"h-2 flex-1 rounded-full bg-bg-sunken\" />\n <div className=\"h-2 w-8 rounded bg-bg-sunken\" />\n </div>\n ))}\n </div>\n </div>\n </div>\n <div className=\"h-12 w-32 animate-pulse rounded-lg bg-bg-sunken\" />\n </div>\n {/* Review Cards Skeleton */}\n <div className=\"space-y-4\">\n {[...Array(2)].map((_, i) => (\n <div\n key={i}\n className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\"\n >\n <div className=\"mb-3 flex items-start gap-3\">\n <div className=\"size-10 rounded-full bg-bg-sunken\" />\n <div className=\"flex-1\">\n <div className=\"h-4 w-32 rounded bg-bg-sunken\" />\n <div className=\"mt-1 flex items-center gap-2\">\n <div className=\"flex gap-0.5\">\n {[...Array(5)].map((_, j) => (\n <div key={j} className=\"size-3 rounded bg-bg-sunken\" />\n ))}\n </div>\n <div className=\"h-3 w-20 rounded bg-bg-sunken\" />\n </div>\n </div>\n </div>\n <div className=\"space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n ))}\n </div>\n </section>\n\n {/* Additional Info Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-48 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"grid gap-4 md:grid-cols-2\">\n {[...Array(6)].map((_, i) => (\n <div key={i}>\n <div className=\"h-3 w-16 rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-5 w-24 rounded bg-bg-sunken\" />\n </div>\n ))}\n </div>\n </div>\n </section>\n\n {/* Related Products Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <div className=\"size-5 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-6 w-40 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-4 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n <div className=\"grid gap-4 md:grid-cols-4\">\n {[...Array(4)].map((_, i) => (\n <div\n key={i}\n className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-3\"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"size-14 rounded-xl bg-bg-sunken\" />\n <div className=\"flex-1\">\n <div className=\"h-4 w-24 rounded bg-bg-sunken\" />\n <div className=\"mt-1 h-3 w-16 rounded bg-bg-sunken\" />\n <div className=\"mt-1 flex items-center gap-2\">\n <div className=\"h-3 w-8 rounded bg-bg-sunken\" />\n <div className=\"h-3 w-12 rounded bg-bg-sunken\" />\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n\n {/* Publisher Skeleton */}\n <section className=\"mb-8\">\n <div className=\"mb-4 h-6 w-36 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"animate-pulse rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-12 rounded-lg bg-bg-sunken\" />\n <div>\n <div className=\"flex items-center gap-2\">\n <div className=\"h-5 w-32 rounded bg-bg-sunken\" />\n <div className=\"size-4 rounded-full bg-bg-sunken\" />\n </div>\n <div className=\"mt-1 h-4 w-40 rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"mt-3 space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n </section>\n </div>\n </div>\n);\n\n/**\n * Error display component\n */\nconst ErrorDisplay: FC<{ error: Error; onRetry: () => void; onBack: () => void }> = ({\n error,\n onRetry,\n onBack,\n}) => {\n const tr = useTr();\n return (\n <div className=\"flex h-full items-center justify-center\">\n <div className=\"text-center\">\n <AlertCircle className=\"mx-auto mb-4 size-12 text-status-error-text\" />\n <h2 className=\"mb-2 text-xl font-semibold text-text-primary\">\n {tr('pages.productDetail.errorTitle', 'Failed to load product')}\n </h2>\n <p className=\"mb-4 text-text-muted\">\n {error.message ||\n tr(\n 'pages.productDetail.errorDescription',\n 'An error occurred while loading the product details.'\n )}\n </p>\n <div className=\"flex justify-center gap-3\">\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('common.tryAgain', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={onBack}\n className=\"rounded-lg border border-border-default px-4 py-2 text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n {tr('common.goBack', 'Go Back')}\n </button>\n </div>\n </div>\n </div>\n );\n};\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\n/**\n * Product Detail Page Component\n *\n * Displays comprehensive product details using real GraphQL data\n */\nexport const ProductDetailPage: FC = () => {\n const { productId } = useParams<{ productId: string }>();\n const navigate = useNavigate();\n const location = useLocation();\n const { basePath, workspaceId } = useStore();\n const tr = useTr();\n const { addProduct, cartItems, addingToCart, createOrder, checkingOut } = useCart();\n const installationsFilter = useMemo(\n () => (productId && workspaceId ? { productId, workspaceId } : undefined),\n [productId, workspaceId]\n );\n const { installations: myInstallations, refetch: refetchInstallations } = useInstallations({\n filter: installationsFilter,\n limit: 1,\n });\n const activeInstallation = myInstallations.find(\n (i) => i.productId === productId && i.workspaceId === workspaceId && i.status === 'ACTIVE'\n );\n const isInstalledInCurrentWorkspace = Boolean(activeInstallation);\n const installedVersion = activeInstallation?.version ?? null;\n\n const { createReview, loading: creatingReview } = useCreateReview();\n const { updateReview, loading: updatingReview } = useUpdateReview();\n const { deleteReview, loading: deletingReview } = useDeleteReview();\n const { markHelpful, loading: markingHelpful } = useMarkReviewHelpful();\n const bus = useEventBus();\n\n const [showFullDescription, setShowFullDescription] = useState(false);\n const [showAllReviews, setShowAllReviews] = useState(false);\n const [buyingNow, setBuyingNow] = useState(false);\n const [quantity, setQuantity] = useState(1);\n const [actionError, setActionError] = useState<string | null>(null);\n const [reviewNotice, setReviewNotice] = useState<string | null>(null);\n const [reviewNoticeTone, setReviewNoticeTone] = useState<'success' | 'error'>('success');\n const [isReviewFormOpen, setIsReviewFormOpen] = useState(false);\n const [reviewTitle, setReviewTitle] = useState('');\n const [reviewComment, setReviewComment] = useState('');\n const [reviewRating, setReviewRating] = useState(5);\n const [helpfulReviewId, setHelpfulReviewId] = useState<string | null>(null);\n\n // Install modal state\n const [isInstallModalOpen, setIsInstallModalOpen] = useState(false);\n\n // Fetch product details using GraphQL\n const { data, loading, error, refetch } = useStoreProductDetails({\n id: productId,\n slug: productId, // Also try as slug\n includeReviews: true,\n reviewsLimit: 10,\n includeRelated: true,\n relatedLimit: 4,\n includeVersions: true,\n });\n\n // Cast data to typed response\n const productDetails = data as StoreProductDetailsResponse | null;\n const product = productDetails?.product;\n const publisher = productDetails?.publisher;\n\n // Check if product is already in cart (must be before any early returns)\n const isInCart = cartItems.some((item) => item.productId === product?.id);\n\n // Pad short version strings (\"1.0\" → \"1.0.0\") so they compare equal to \"1.0.0\"\n const padVer = (v: string) => {\n const p = v.split('.');\n while (p.length < 3) p.push('0');\n return p.join('.');\n };\n const latestVersion = product?.manifestVersion ?? null;\n const hasUpdateAvailable = Boolean(\n isInstalledInCurrentWorkspace &&\n installedVersion &&\n latestVersion &&\n padVer(installedVersion) !== padVer(latestVersion)\n );\n\n // Handle Add to Cart (must be before any early returns)\n const handleAddToCart = useCallback(async () => {\n if (!product) return;\n\n setActionError(null);\n\n if (isInCart) {\n navigate(`${basePath}/cart`);\n return;\n }\n\n try {\n const cartProduct = convertToCartProduct(product, publisher, tr);\n // Add to backend cart via GraphQL API call\n // This will make a mutation to global-public-gateway:4004 → tenantmodule-store-svc:4017\n await addProduct(cartProduct, undefined, quantity);\n // Cart drawer will open automatically after adding\n } catch (error) {\n console.error('Failed to add product to cart:', error);\n setActionError(\n tr(\n 'pages.productDetail.addToCartError',\n 'Failed to add this product to cart. Please try again.'\n )\n );\n }\n }, [product, publisher, addProduct, isInCart, navigate, basePath, quantity, tr]);\n\n // Handle Buy Now - creates an order and immediately proceeds to checkout\n const handleBuyNow = useCallback(async () => {\n if (!product) return;\n\n setActionError(null);\n setBuyingNow(true);\n\n try {\n // Get product price\n const price = product.price || 0;\n\n // Build line item for this product\n const lineItem = {\n productId: product.id,\n name: product.name,\n quantity,\n unitPrice: price,\n subtotal: price * quantity,\n itemType: product.nature?.toLowerCase() || 'digital',\n pricingModel: product.pricingModel || 'PAID_ONETIME',\n };\n\n // Create order input\n const orderInput = {\n total: price * quantity,\n lineItems: [lineItem],\n billingAccountId: '', // Will be set on billing page\n };\n\n // Call createStoreOrder mutation to create PENDING order\n const order = await createOrder(orderInput);\n\n if (order?.id) {\n // Navigate to billing page, preserving org/workspace/tenant context params\n navigate(`/billing/checkout/store/${order.id}${location.search}`);\n } else {\n console.error('Failed to create order');\n setActionError(\n tr('pages.productDetail.createOrderError', 'Failed to create order. Please try again.')\n );\n setBuyingNow(false);\n }\n } catch (error) {\n console.error('Buy Now error:', error);\n const message =\n error instanceof Error\n ? error.message\n : tr('pages.productDetail.checkoutError', 'Failed to start checkout');\n setActionError(message);\n setBuyingNow(false);\n }\n }, [product, quantity, createOrder, navigate, location.search, tr]);\n\n // Handle Install Free - Open modal for workspace selection (must be before any early returns)\n const handleInstallFree = useCallback(() => {\n if (!product) return;\n setIsInstallModalOpen(true);\n }, [product]);\n\n // Emit product.viewed event once product data loads. Read product via ref so\n // we only emit on id transitions, not on every field change.\n const productRef = useRef(product);\n productRef.current = product;\n const busRef = useRef(bus);\n busRef.current = bus;\n useEffect(() => {\n const p = productRef.current;\n if (!p) return;\n (busRef.current as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.product.viewed',\n {\n productId: p.id,\n productSlug: p.slug,\n productType: p.type,\n pricingModel: p.pricingModel,\n }\n );\n }, [product?.id]);\n\n // Handle successful installation (must be before any early returns)\n const handleInstallSuccess = useCallback(\n (workspaceId: string, workspaceName: string) => {\n if (!product) return;\n (bus as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.product.installed',\n {\n productId: product.id,\n workspaceId,\n }\n );\n console.log(\n `Successfully installed ${product.name} to workspace ${workspaceName} (${workspaceId})`\n );\n void refetchInstallations();\n },\n [product, bus, refetchInstallations]\n );\n\n // Handle installation error (must be before any early returns)\n const handleInstallError = useCallback((error: Error) => {\n console.error('Installation failed:', error.message);\n // Error is shown in the modal\n }, []);\n\n const openReviewForm = useCallback(() => {\n setReviewTitle(productDetails?.userReview?.title ?? '');\n setReviewComment(productDetails?.userReview?.comment ?? '');\n setReviewRating(productDetails?.userReview?.rating ?? 5);\n setReviewNotice(null);\n setReviewNoticeTone('success');\n setIsReviewFormOpen(true);\n }, [productDetails?.userReview]);\n\n const handleSubmitReview = useCallback(async () => {\n if (!product) {\n return;\n }\n\n if (reviewRating < 1 || reviewRating > 5) {\n setReviewNoticeTone('error');\n setReviewNotice(\n tr('pages.productDetail.ratingRequired', 'Choose a rating from 1 to 5 stars.')\n );\n return;\n }\n\n const payload = {\n productId: product.id,\n rating: reviewRating,\n title: reviewTitle.trim() || undefined,\n comment: reviewComment.trim() || undefined,\n };\n\n const reviewResult = productDetails?.userReview\n ? {\n data: await updateReview(productDetails.userReview.id, {\n rating: payload.rating,\n title: payload.title,\n comment: payload.comment,\n }),\n errorMessage: null,\n }\n : await createReview(payload);\n\n if (!reviewResult?.data) {\n setReviewNoticeTone('error');\n setReviewNotice(\n reviewResult?.errorMessage ??\n tr(\n 'pages.productDetail.reviewSaveError',\n 'We could not save your review. Please try again.'\n )\n );\n return;\n }\n\n setReviewNoticeTone('success');\n setReviewNotice(\n productDetails?.userReview\n ? tr('pages.productDetail.reviewUpdated', 'Your review was updated.')\n : tr('pages.productDetail.reviewSubmitted', 'Your review was submitted.')\n );\n setIsReviewFormOpen(false);\n (bus as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.review.submitted',\n {\n productId: product.id,\n rating: reviewRating,\n }\n );\n await refetch();\n }, [\n bus,\n createReview,\n product,\n productDetails?.userReview,\n refetch,\n reviewComment,\n reviewRating,\n reviewTitle,\n updateReview,\n tr,\n ]);\n\n const handleDeleteReview = useCallback(async () => {\n if (!productDetails?.userReview) {\n return;\n }\n void nativeImpact('medium');\n const confirmed = await nativeConfirm({\n title: tr('pages.productDetail.deleteReviewTitle', 'Delete review'),\n message: tr(\n 'pages.productDetail.deleteReviewMessage',\n 'Are you sure you want to remove your review?'\n ),\n okButtonTitle: tr('common.delete', 'Delete'),\n cancelButtonTitle: tr('common.cancel', 'Cancel'),\n });\n if (confirmed === false) {\n return;\n }\n\n const deleted = await deleteReview(productDetails.userReview.id);\n if (!deleted) {\n setReviewNoticeTone('error');\n setReviewNotice(\n tr(\n 'pages.productDetail.reviewDeleteError',\n 'We could not remove your review. Please try again.'\n )\n );\n void nativeNotify('error');\n return;\n }\n\n setReviewNoticeTone('success');\n setReviewNotice(tr('pages.productDetail.reviewRemoved', 'Your review was removed.'));\n setIsReviewFormOpen(false);\n setReviewTitle('');\n setReviewComment('');\n setReviewRating(5);\n void nativeNotify('success');\n await refetch();\n }, [deleteReview, productDetails?.userReview, refetch, tr]);\n\n const handleMarkHelpful = useCallback(\n async (reviewId: string) => {\n setHelpfulReviewId(reviewId);\n const result = await markHelpful(reviewId);\n if (result) {\n await refetch();\n }\n setHelpfulReviewId(null);\n },\n [markHelpful, refetch]\n );\n\n // Handle loading state\n if (loading) {\n return <LoadingSkeleton />;\n }\n\n // Handle error state\n if (error) {\n return (\n <ErrorDisplay\n error={error}\n onRetry={refetch}\n onBack={() => navigate(`${basePath}/marketplace`)}\n />\n );\n }\n\n // Handle not found state\n if (!productDetails?.product) {\n return (\n <div className=\"flex h-full items-center justify-center p-6\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('pages.productDetail.notFoundTitle', 'Product not found')}\n description={tr(\n 'pages.productDetail.notFoundDetail',\n 'The product you are looking for does not exist or has been removed.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/marketplace`)}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('pages.productDetail.backToMarketplace', 'Back to Marketplace')}\n </button>\n }\n />\n </div>\n );\n }\n\n const {\n reviews,\n reviewsCount,\n relatedProducts,\n ratingDistribution,\n isPurchased,\n userEntitlement,\n } = productDetails;\n\n // Type assertion: we know product is defined because we checked !productDetails?.product above\n const safeProduct = product!;\n\n // Calculate rating distribution percentages\n const totalRatings = ratingDistribution\n ? ratingDistribution.fiveStars +\n ratingDistribution.fourStars +\n ratingDistribution.threeStars +\n ratingDistribution.twoStars +\n ratingDistribution.oneStar\n : 0;\n\n const ratingDistributionData = ratingDistribution\n ? [\n {\n stars: 5,\n count: ratingDistribution.fiveStars,\n percentage: totalRatings > 0 ? (ratingDistribution.fiveStars / totalRatings) * 100 : 0,\n },\n {\n stars: 4,\n count: ratingDistribution.fourStars,\n percentage: totalRatings > 0 ? (ratingDistribution.fourStars / totalRatings) * 100 : 0,\n },\n {\n stars: 3,\n count: ratingDistribution.threeStars,\n percentage: totalRatings > 0 ? (ratingDistribution.threeStars / totalRatings) * 100 : 0,\n },\n {\n stars: 2,\n count: ratingDistribution.twoStars,\n percentage: totalRatings > 0 ? (ratingDistribution.twoStars / totalRatings) * 100 : 0,\n },\n {\n stars: 1,\n count: ratingDistribution.oneStar,\n percentage: totalRatings > 0 ? (ratingDistribution.oneStar / totalRatings) * 100 : 0,\n },\n ]\n : [];\n\n // Parse permissions from manifest or requiredPermissions\n const permissions = safeProduct.requiredPermissions || [];\n\n // Parse integrations from integrationDeps\n const integrations = safeProduct.integrationDeps || [];\n\n // Pricing display\n const getPriceDisplay = () => {\n if (safeProduct.pricingModel === 'FREE') return tr('pages.marketplace.free', 'Free');\n if (safeProduct.pricingModel === 'SUBSCRIPTION') {\n return tr('pages.productDetail.subscriptionPrice', '{{price}}/mo', {\n price: formatPrice(safeProduct.price, safeProduct.currency),\n });\n }\n return formatPrice(safeProduct.price, safeProduct.currency);\n };\n\n // Check if product is free\n const isFree = safeProduct.pricingModel === 'FREE' || safeProduct.price === 0;\n\n // Physical (produce) product inventory\n const isPhysical = safeProduct.nature === 'PHYSICAL';\n const tracksInventory = isPhysical && safeProduct.trackInventory === true;\n const stockQuantity = safeProduct.stockQuantity ?? 0;\n const isOutOfStock = tracksInventory && stockQuantity <= 0;\n\n return (\n <div className=\"h-full overflow-y-auto bg-bg-base\">\n {/* Hero Section - Two Column Layout */}\n <div className=\"bg-bg-surface\">\n <div className=\"mx-auto max-w-7xl\">\n <div className=\"flex flex-col lg:flex-row\">\n {/* Left Column - Product Info */}\n <div className=\"flex-1 px-6 py-8 lg:max-w-xl lg:py-12\">\n {/* Back Button */}\n <button\n type=\"button\"\n onClick={() => navigate(-1)}\n className=\"mb-6 cursor-pointer inline-flex items-center gap-2 text-sm text-text-muted transition-colors hover:text-text-primary\"\n >\n <ArrowLeft className=\"size-4\" />\n {tr('common.back', 'Back')}\n </button>\n\n {/* App Title - Large Typography */}\n <h1 className=\"mb-3 text-4xl font-normal leading-tight text-text-primary lg:text-5xl\">\n {safeProduct.name}\n </h1>\n\n {/* Installed badge — always above the fold */}\n {isInstalledInCurrentWorkspace && (\n <div className=\"mb-4 inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text\">\n <svg\n className=\"size-3.5\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"2,8 6,12 14,4\" />\n </svg>\n {installedVersion\n ? tr('pages.productDetail.installedVersion', 'Installed v{{version}}', {\n version: installedVersion,\n })\n : tr('pages.productDetail.installed', 'Installed')}\n </div>\n )}\n\n {/* Publisher / org */}\n <div className=\"mb-2\">\n {(() => {\n const org = publisher?.developerOrganization;\n const displayName =\n org?.name ||\n publisher?.name ||\n safeProduct.authorName ||\n tr('common.unknownPublisher', 'Unknown Publisher');\n const displayLogo = org?.logoUrl || publisher?.logoUrl;\n const isVerified = org?.isVerified || publisher?.isVerified;\n const linkUrl = publisher?.websiteUrl;\n return (\n <div className=\"flex items-center gap-2\">\n {displayLogo && (\n <img\n src={displayLogo}\n alt={displayName}\n className=\"size-5 rounded object-cover\"\n />\n )}\n {linkUrl ? (\n <a\n href={linkUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-base font-medium text-text-link hover:underline\"\n >\n {displayName}\n </a>\n ) : (\n <span className=\"text-base font-medium text-text-primary\">\n {displayName}\n </span>\n )}\n {isVerified && <ShieldCheck className=\"size-4 text-status-success-text\" />}\n </div>\n );\n })()}\n </div>\n\n {/* Metadata */}\n <p className=\"mb-6 text-sm text-text-muted\">\n {safeProduct.category && <span>{safeProduct.category}</span>}\n {safeProduct.category && ' · '}\n {tr('pages.productDetail.downloadsCount', '{{count}}+ downloads', {\n count: formatNumber(safeProduct.downloads),\n })}\n </p>\n\n {/* Stats + primary action — the single emphasis zone for this page */}\n <EmphasisPanel className=\"mb-6 p-5\">\n {/* Stats Row */}\n <div className=\"mb-6 flex items-center gap-4\">\n {/* App Icon Badge */}\n <div className=\"flex size-12 items-center justify-center overflow-hidden rounded-xl bg-bg-sunken\">\n {safeProduct.icon ? (\n <img src={safeProduct.icon} alt=\"\" className=\"size-full object-cover\" />\n ) : (\n <span className=\"text-lg font-bold text-text-muted\">\n {safeProduct.name.charAt(0)}\n </span>\n )}\n </div>\n\n {/* Rating */}\n <div className=\"flex items-center gap-1 border-l border-border-default pl-4\">\n <span className=\"text-sm font-medium text-text-primary\">\n {(safeProduct.rating || 0).toFixed(1)}\n </span>\n <Star className=\"size-4 fill-current text-status-warning-text\" />\n <span className=\"ml-1 text-xs text-text-muted\">\n {tr('pages.productDetail.reviews_count', '{{count}} reviews', {\n count: formatNumber(reviewsCount || safeProduct.reviewCount),\n })}\n </span>\n </div>\n\n {/* Downloads */}\n <div className=\"border-l border-border-default pl-4\">\n <span className=\"text-sm font-medium text-text-primary\">\n {formatNumber(safeProduct.downloads)}+\n </span>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.downloadsLabel', 'Downloads')}\n </p>\n </div>\n\n {/* Type Badge */}\n <div className=\"border-l border-border-default pl-4\">\n <span className=\"rounded bg-bg-sunken px-2 py-1 text-xs font-medium text-text-primary\">\n {safeProduct.type}\n </span>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n {tr('pages.productDetail.typeLabel', 'Type')}\n </p>\n </div>\n </div>\n\n {/* Action Buttons Row */}\n {actionError && (\n <div\n role=\"alert\"\n className=\"mb-4 rounded-lg border border-status-error-bg bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\"\n >\n {actionError}\n </div>\n )}\n\n {isPhysical && (\n <div className=\"mb-4 flex flex-wrap items-center gap-4\">\n {tracksInventory &&\n (isOutOfStock ? (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-error-bg-subtle px-3 py-1 text-sm font-medium text-status-error-text\">\n <Package className=\"size-4\" />\n {tr('pages.productDetail.outOfStock', 'Out of stock')}\n </span>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text\">\n <Package className=\"size-4\" />\n {tr('pages.productDetail.inStock', '{{count}} in stock', {\n count: formatNumber(stockQuantity),\n })}\n </span>\n ))}\n {!isOutOfStock && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-text-muted\">\n {tr('pages.productDetail.quantity', 'Qty')}\n </span>\n <div className=\"flex items-center rounded-full border border-border-default\">\n <button\n type=\"button\"\n onClick={() => setQuantity((q) => Math.max(1, q - 1))}\n disabled={quantity <= 1}\n aria-label={tr(\n 'pages.productDetail.decreaseQuantity',\n 'Decrease quantity'\n )}\n className=\"cursor-pointer px-3 py-1.5 text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40\"\n >\n −\n </button>\n <span className=\"min-w-8 px-2 text-center text-sm font-medium tabular-nums text-text-primary\">\n {quantity}\n </span>\n <button\n type=\"button\"\n onClick={() =>\n setQuantity((q) =>\n tracksInventory ? Math.min(stockQuantity, q + 1) : q + 1\n )\n }\n disabled={tracksInventory && quantity >= stockQuantity}\n aria-label={tr(\n 'pages.productDetail.increaseQuantity',\n 'Increase quantity'\n )}\n className=\"cursor-pointer px-3 py-1.5 text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40\"\n >\n +\n </button>\n </div>\n </div>\n )}\n </div>\n )}\n\n <div className=\"mb-6 flex items-center gap-3\">\n {isInstalledInCurrentWorkspace ? (\n <>\n <button\n type=\"button\"\n disabled\n className=\"flex items-center gap-2 rounded-full bg-status-success-bg-subtle px-8 py-3 font-medium text-status-success-text cursor-default\"\n >\n <svg\n className=\"size-4\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"2,8 6,12 14,4\" />\n </svg>\n {tr('pages.productDetail.installed', 'Installed')}\n </button>\n {hasUpdateAvailable && (\n <button\n type=\"button\"\n onClick={handleInstallFree}\n className=\"cursor-pointer rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('pages.productDetail.updateToVersion', 'Update to v{{version}}', {\n version: safeProduct.manifestVersion ?? '',\n })}\n </button>\n )}\n </>\n ) : !isPhysical && isPurchased && !isFree ? (\n <button\n type=\"button\"\n onClick={handleInstallFree}\n className=\"cursor-pointer rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('pages.productDetail.installToWorkspace', 'Install to Workspace')}\n </button>\n ) : !isPhysical && isFree ? (\n <button\n type=\"button\"\n onClick={handleInstallFree}\n className=\"cursor-pointer rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('pages.productDetail.install', 'Install')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={handleBuyNow}\n disabled={buyingNow || checkingOut || isOutOfStock}\n className=\"cursor-pointer flex items-center gap-2 rounded-full bg-action-primary-bg px-8 py-3 font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-70\"\n >\n {buyingNow || checkingOut ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n {tr('pages.productDetail.processing', 'Processing…')}\n </>\n ) : isOutOfStock ? (\n tr('pages.productDetail.outOfStock', 'Out of stock')\n ) : (\n tr('pages.productDetail.buyNow', 'Buy {{price}}', {\n price: getPriceDisplay(),\n })\n )}\n </button>\n )}\n\n {/* Add to Cart / Wishlist */}\n {!isFree && (!isPurchased || isPhysical) && (\n <button\n type=\"button\"\n onClick={handleAddToCart}\n disabled={addingToCart || isOutOfStock}\n className=\"cursor-pointer flex items-center gap-2 rounded-full border border-border-default px-4 py-3 text-sm text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\"\n >\n {addingToCart ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : isInCart ? (\n <Check className=\"size-4 text-status-success-text\" />\n ) : (\n <ShoppingCart className=\"size-4\" />\n )}\n {isInCart\n ? tr('pages.productDetail.inCart', 'In Cart')\n : tr('pages.productDetail.addToCart', 'Add to Cart')}\n </button>\n )}\n </div>\n\n {/* Info Text */}\n {isPhysical ? (\n <>\n <p className=\"flex items-center gap-2 text-xs text-text-muted\">\n <Package className=\"size-4\" />\n {safeProduct.requiresShipping === false\n ? tr(\n 'pages.productDetail.pickupAvailable',\n 'Available for pickup — no shipping required'\n )\n : tr(\n 'pages.productDetail.shipsToAddress',\n 'Ships to your delivery address'\n )}\n </p>\n {!isFree && (\n <p className=\"text-xs text-text-tertiary\">\n {tr(\n 'pages.productDetail.sellerReturnsPolicy',\n 'Returns and refunds are handled by {{seller}} per their store policy.',\n {\n seller:\n publisher?.name || tr('pages.productDetail.theSeller', 'the seller'),\n }\n )}\n </p>\n )}\n </>\n ) : (\n <>\n <p className=\"flex items-center gap-2 text-xs text-text-muted\">\n <Package className=\"size-4\" />\n {tr(\n 'pages.productDetail.availableForWorkspace',\n 'This app is available for your workspace'\n )}\n </p>\n {!isFree && !isPurchased && (\n <p className=\"text-xs text-text-tertiary\">\n {tr(\n 'pages.productDetail.purchaseFinalNotice',\n 'All purchases are final. Digital app orders cannot be cancelled or refunded once completed.'\n )}\n </p>\n )}\n\n {/* License Status */}\n {userEntitlement && (\n <p className=\"mt-2 flex items-center gap-2 text-xs text-text-muted\">\n <ShieldCheck className=\"size-4 text-status-success-text\" />\n {tr('pages.productDetail.licenseStatus', 'License: {{status}}', {\n status: userEntitlement.status,\n })}\n {userEntitlement.expiresAt &&\n tr('pages.productDetail.licenseExpires', ' (Expires: {{date}})', {\n date: new Date(userEntitlement.expiresAt).toLocaleDateString(),\n })}\n </p>\n )}\n </>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Right Column - Banner or first screenshot */}\n <div className=\"relative flex-1 overflow-hidden bg-bg-sunken lg:min-h-[500px]\">\n {safeProduct.type === 'WORKFLOW' ? (\n /* Live read-only canvas preview served by the app shell's\n public /embed/workflow route (same origin, no auth). */\n <iframe\n src={`${window.location.origin}/embed/workflow?productId=${encodeURIComponent(\n safeProduct.id\n )}&cta=false&theme=${\n document.documentElement.classList.contains('dark') ? 'dark' : 'light'\n }`}\n title={`${safeProduct.name} workflow preview`}\n loading=\"lazy\"\n className=\"size-full min-h-[300px] border-0 lg:min-h-[500px]\"\n />\n ) : safeProduct.bannerUrl ? (\n <img\n src={safeProduct.bannerUrl}\n alt={`${safeProduct.name} banner`}\n className=\"size-full object-cover\"\n />\n ) : safeProduct.screenshots && safeProduct.screenshots.length > 0 ? (\n <img\n src={safeProduct.screenshots[0]}\n alt={`${safeProduct.name} preview`}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"flex h-full min-h-[300px] flex-col items-center justify-center gap-3 p-8 text-center\">\n <div className=\"flex size-20 items-center justify-center rounded-2xl bg-bg-surface text-3xl font-bold text-text-muted\">\n {safeProduct.name.charAt(0)}\n </div>\n <p className=\"text-sm text-text-muted\">\n {tr('pages.productDetail.noPreview', 'No preview available')}\n </p>\n <p className=\"max-w-[200px] text-xs text-text-muted opacity-60\">\n {tr(\n 'pages.productDetail.noPreviewHint',\n 'Upload screenshots in the Store Listing tab to show a preview here'\n )}\n </p>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n\n {/* Apple App Store-style Screenshot Strip */}\n {safeProduct.screenshots && safeProduct.screenshots.length > 0 && (\n <div className=\"border-y border-border-default bg-bg-base\">\n <div className=\"px-6 py-6\">\n <h2 className=\"mb-4 text-sm font-semibold uppercase tracking-wider text-text-muted\">\n {tr('pages.productDetail.previewTitle', 'Preview')}\n </h2>\n <div\n className=\"flex gap-4 overflow-x-auto pb-2\"\n style={{ scrollSnapType: 'x mandatory' }}\n >\n {safeProduct.screenshots.map((src, i) => (\n <div\n key={i}\n className=\"relative flex-shrink-0 overflow-hidden rounded-2xl shadow-lg\"\n style={{\n width: '72vw',\n maxWidth: 680,\n minWidth: 260,\n aspectRatio: '16/9',\n scrollSnapAlign: 'start',\n }}\n >\n <img src={src} alt={`Screenshot ${i + 1}`} className=\"size-full object-cover\" />\n </div>\n ))}\n {/* Spacer so last item doesn't stick to edge */}\n <div className=\"flex-shrink-0 w-2\" />\n </div>\n </div>\n </div>\n )}\n\n {/* Main Content Area */}\n <main className=\"mx-auto max-w-7xl px-6 py-8\">\n <PagePurpose className=\"mb-6\">\n {tr(\n 'pages.productDetail.pagePurpose',\n 'Everything you need to decide whether to install {{name}}: what it does, screenshots, pricing, the permissions and integrations it needs, and real customer reviews. When you are ready, install it (free apps) or buy it, then add it to a workspace — and leave a review once you have used it.',\n { name: safeProduct.name }\n )}\n </PagePurpose>\n\n <NextSteps\n className=\"mb-8\"\n storageKey=\"store-product-detail\"\n steps={[\n isFree\n ? {\n id: 'install',\n label: tr('pages.productDetail.nextStepInstallLabel', 'Install this app'),\n description: tr(\n 'pages.productDetail.nextStepInstallDescription',\n 'It’s free — add it to a workspace in a couple of clicks.'\n ),\n onClick: handleInstallFree,\n done: isInstalledInCurrentWorkspace,\n }\n : {\n id: 'buy',\n label: isPurchased\n ? tr('pages.productDetail.nextStepInstallLabel', 'Install to a workspace')\n : tr('pages.productDetail.nextStepBuyLabel', 'Buy or add to cart'),\n description: isPurchased\n ? tr(\n 'pages.productDetail.nextStepOwnedDescription',\n 'You already own this — install it where you need it.'\n )\n : tr(\n 'pages.productDetail.nextStepBuyDescription',\n 'Purchase now, or add it to your cart to check out later.'\n ),\n onClick: isPurchased ? handleInstallFree : handleBuyNow,\n done: isInstalledInCurrentWorkspace,\n },\n ...(permissions.length > 0\n ? [\n {\n id: 'permissions',\n label: tr(\n 'pages.productDetail.nextStepPermissionsLabel',\n 'Review what it can access'\n ),\n description: tr(\n 'pages.productDetail.nextStepPermissionsDescription',\n 'Check the permissions this app requires before installing.'\n ),\n href: '#about-permissions',\n },\n ]\n : []),\n {\n id: 'reviews',\n label: tr('pages.productDetail.nextStepReviewsLabel', 'Read the reviews'),\n description: tr(\n 'pages.productDetail.nextStepReviewsDescription',\n 'See what other customers think before committing.'\n ),\n href: '#ratings-reviews',\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-8 lg:flex-row\">\n {/* Left Content */}\n <div className=\"flex-1 lg:max-w-3xl\">\n {/* About this app */}\n <section className=\"mb-8\">\n <div className=\"mb-4 flex items-center justify-between text-left\">\n <h2 className=\"text-lg font-medium text-text-primary\">\n {tr('pages.productDetail.aboutThisApp', 'About this app')}\n </h2>\n </div>\n <div className=\"text-sm leading-relaxed text-text-secondary\">\n <div className={!showFullDescription ? 'line-clamp-4' : ''}>\n <Markdown>\n {safeProduct.longDescription ||\n safeProduct.description ||\n tr('pages.productDetail.noDescription', 'No description available.')}\n </Markdown>\n </div>\n {((safeProduct.longDescription || safeProduct.description)?.length ?? 0) > 200 && (\n <button\n type=\"button\"\n onClick={() => setShowFullDescription(!showFullDescription)}\n className=\"cursor-pointer mt-3 text-sm font-medium text-text-link\"\n >\n {showFullDescription\n ? tr('pages.productDetail.showLess', 'Show less')\n : tr('pages.productDetail.showMore', 'Show more')}\n </button>\n )}\n </div>\n {/* Tags */}\n {safeProduct.tags && safeProduct.tags.length > 0 && (\n <div className=\"mt-4 flex flex-wrap gap-2\">\n {safeProduct.tags.map((tag) => (\n <span\n key={tag}\n className=\"rounded-full border border-border-seam px-3 py-1.5 text-xs text-text-muted transition-colors hover:bg-bg-sunken\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </section>\n\n {/* Ratings & Reviews */}\n <section id=\"ratings-reviews\" className=\"mb-8 scroll-mt-6\">\n <div className=\"mb-4 flex items-center justify-between text-left\">\n <h2 className=\"text-lg font-medium text-text-primary\">\n {tr('pages.productDetail.ratingsAndReviews', 'Ratings & Reviews')}\n </h2>\n </div>\n\n <GlassCard treatment=\"insight\" className=\"p-5\">\n {reviews && reviews.length > 0 ? (\n <div className=\"flex items-start gap-8\">\n {/* Rating Score */}\n <div className=\"text-center\">\n <p className=\"text-5xl font-light tabular-nums text-text-primary\">\n {(safeProduct.rating || 0).toFixed(1)}\n </p>\n <div className=\"my-2 flex justify-center gap-0.5\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Star\n key={star}\n className={`size-4 ${\n star <= Math.round(safeProduct.rating || 0)\n ? 'fill-current text-status-warning-text'\n : 'text-text-muted'\n }`}\n />\n ))}\n </div>\n <p className=\"text-sm text-text-muted\">\n {tr('pages.productDetail.reviews_count', '{{count}} reviews', {\n count: formatNumber(reviewsCount || safeProduct.reviewCount),\n })}\n </p>\n </div>\n\n {/* Rating Distribution */}\n {ratingDistributionData.length > 0 && (\n <div className=\"flex-1 space-y-1.5\">\n {ratingDistributionData.map((item) => (\n <RatingBar key={item.stars} {...item} />\n ))}\n </div>\n )}\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center py-6 text-center\">\n <div className=\"mb-3 flex gap-0.5\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Star key={star} className=\"size-5 text-border-default\" />\n ))}\n </div>\n <p className=\"font-medium text-text-primary\">\n {tr('pages.productDetail.noReviews', 'No reviews yet')}\n </p>\n <p className=\"mt-1 text-sm text-text-muted\">\n {tr(\n 'pages.productDetail.beFirstToReview',\n 'Be the first to share your experience with this app.'\n )}\n </p>\n </div>\n )}\n\n {/* Write Review */}\n <div className=\"mt-6 border-t border-border-seam pt-4\">\n {reviewNotice && (\n <p\n role={reviewNoticeTone === 'success' ? 'status' : 'alert'}\n className={`mb-3 rounded-lg px-3 py-2 text-sm ${\n reviewNoticeTone === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : 'bg-status-error-bg-subtle text-status-error-text'\n }`}\n >\n {reviewNotice}\n </p>\n )}\n {isInstalledInCurrentWorkspace || productDetails?.userReview ? (\n <div className=\"space-y-4\">\n <button\n type=\"button\"\n onClick={() =>\n isReviewFormOpen ? setIsReviewFormOpen(false) : openReviewForm()\n }\n className=\"w-full cursor-pointer py-2 text-center text-sm font-medium text-text-primary transition-colors hover:text-text-link\"\n >\n {productDetails?.userReview\n ? isReviewFormOpen\n ? tr('pages.productDetail.cancelReviewEditing', 'Cancel review editing')\n : tr('pages.productDetail.editYourReview', 'Edit your review')\n : isReviewFormOpen\n ? tr('pages.productDetail.cancelReview', 'Cancel review')\n : tr('pages.productDetail.writeReview', 'Write a Review')}\n </button>\n\n {isReviewFormOpen && (\n <div className=\"rounded-xl border border-border-seam bg-bg-sunken p-4\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('pages.productDetail.yourRatingLabel', 'Your rating')}\n </p>\n <div className=\"mt-2 flex flex-wrap gap-2\">\n {[1, 2, 3, 4, 5].map((star) => (\n <button\n key={star}\n type=\"button\"\n onClick={() => setReviewRating(star)}\n className={`cursor-pointer rounded-full border px-3 py-1.5 text-sm transition-colors ${\n reviewRating === star\n ? 'border-action-primary-border bg-action-primary-bg text-action-primary-text'\n : 'border-border-default bg-bg-surface text-text-primary hover:bg-bg-surface'\n }`}\n >\n {star} ★\n </button>\n ))}\n </div>\n </div>\n\n <label className=\"mt-4 block text-sm font-medium text-text-primary\">\n {tr('pages.productDetail.reviewTitleLabel', 'Title')}\n <input\n aria-label={tr(\n 'pages.productDetail.reviewTitleLabel',\n 'Review title'\n )}\n value={reviewTitle}\n onChange={(event) => setReviewTitle(event.target.value)}\n className=\"mt-2 w-full rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary outline-none focus:border-action-primary-border\"\n placeholder={tr(\n 'pages.productDetail.reviewTitlePlaceholder',\n 'Summarize your experience'\n )}\n />\n </label>\n\n <label className=\"mt-4 block text-sm font-medium text-text-primary\">\n {tr('pages.productDetail.reviewBodyLabel', 'Review')}\n <textarea\n aria-label={tr('pages.productDetail.reviewBodyLabel', 'Review body')}\n value={reviewComment}\n onChange={(event) => setReviewComment(event.target.value)}\n rows={4}\n required\n aria-required=\"true\"\n className=\"mt-2 w-full rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary outline-none focus:border-action-primary-border\"\n placeholder={tr(\n 'pages.productDetail.reviewBodyPlaceholder',\n 'What worked well? What should improve?'\n )}\n />\n </label>\n\n <div className=\"mt-4 flex flex-wrap gap-3\">\n <button\n type=\"button\"\n onClick={handleSubmitReview}\n disabled={creatingReview || updatingReview}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {creatingReview || updatingReview\n ? tr('pages.productDetail.savingReview', 'Saving...')\n : productDetails?.userReview\n ? tr('pages.productDetail.updateReview', 'Update Review')\n : tr('pages.productDetail.submitReview', 'Submit Review')}\n </button>\n {productDetails?.userReview && (\n <button\n type=\"button\"\n onClick={handleDeleteReview}\n disabled={deletingReview}\n className=\"cursor-pointer rounded-lg border border-status-error-border px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {deletingReview\n ? tr('pages.productDetail.removingReview', 'Removing...')\n : tr('pages.productDetail.deleteReview', 'Delete Review')}\n </button>\n )}\n </div>\n </div>\n )}\n </div>\n ) : (\n <p className=\"text-center text-sm text-text-muted\">\n {tr(\n 'pages.productDetail.installToReview',\n 'Install this app to leave a review.'\n )}\n </p>\n )}\n </div>\n </GlassCard>\n\n {/* Reviews List */}\n {reviews && reviews.length > 0 && (\n <div className=\"mt-4 space-y-3\">\n <ul className=\"space-y-3\">\n {(showAllReviews ? reviews : reviews.slice(0, 2)).map((review) => (\n <li key={review.id}>\n <ReviewCard\n review={review}\n onMarkHelpful={handleMarkHelpful}\n markingHelpful={markingHelpful && helpfulReviewId === review.id}\n />\n </li>\n ))}\n </ul>\n {reviews.length > 2 && (\n <button\n type=\"button\"\n onClick={() => setShowAllReviews(!showAllReviews)}\n className=\"cursor-pointer text-sm font-medium text-text-link\"\n >\n {showAllReviews\n ? tr('pages.productDetail.showLess', 'Show less')\n : tr('pages.productDetail.showAllReviews', 'Show all {{count}} reviews', {\n count: reviews.length,\n })}\n </button>\n )}\n </div>\n )}\n {(!reviews || reviews.length === 0) && (\n <p className=\"mt-4 text-sm text-text-muted\">\n {tr(\n 'pages.productDetail.beFirstToReviewShort',\n 'No reviews yet. Be the first to review!'\n )}\n </p>\n )}\n </section>\n\n {/* Permissions */}\n {permissions.length > 0 && (\n <section id=\"about-permissions\" className=\"mb-8 scroll-mt-6\">\n <h2 className=\"mb-4 text-lg font-medium text-text-primary\">\n {tr('pages.productDetail.requiredPermissions', 'Required Permissions')}\n </h2>\n <div className=\"space-y-2\">\n {permissions.map((permission) => (\n <div\n key={permission}\n className=\"flex items-center gap-3 rounded-lg bg-bg-surface px-4 py-3\"\n >\n <ShieldCheck className=\"size-5 text-status-success-text\" />\n <span className=\"text-sm text-text-primary\">{permission}</span>\n </div>\n ))}\n </div>\n </section>\n )}\n\n {/* Integrations */}\n {integrations.length > 0 && (\n <section className=\"mb-8\">\n <h2 className=\"mb-4 text-lg font-medium text-text-primary\">\n {tr('pages.productDetail.integrations', 'Integrations')}\n </h2>\n <div className=\"flex flex-wrap gap-2\">\n {integrations.map((integration) => (\n <span\n key={integration}\n className=\"rounded-lg bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary\"\n >\n {integration}\n </span>\n ))}\n </div>\n </section>\n )}\n\n {/* Additional Information */}\n <section className=\"mb-8\">\n <h2 className=\"mb-4 text-lg font-medium text-text-primary\">\n {tr('pages.productDetail.additionalInformation', 'Additional Information')}\n </h2>\n <GlassCard treatment=\"metric\" className=\"grid grid-cols-2 gap-6 p-5 md:grid-cols-3\">\n {safeProduct.manifestVersion && (\n <div>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.versionLabel', 'Version')}\n </p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {safeProduct.manifestVersion}\n </p>\n </div>\n )}\n <div>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.typeLabel', 'Type')}\n </p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">{safeProduct.type}</p>\n </div>\n {safeProduct.publishedAt && (\n <div>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.publishedLabel', 'Published')}\n </p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {new Date(safeProduct.publishedAt).toLocaleDateString()}\n </p>\n </div>\n )}\n <div>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.updatedLabel', 'Updated')}\n </p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {new Date(safeProduct.updatedAt).toLocaleDateString()}\n </p>\n </div>\n {safeProduct.license && (\n <div>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.licenseLabel', 'License')}\n </p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {safeProduct.license}\n </p>\n </div>\n )}\n {safeProduct.minPlatformVersion && (\n <div>\n <p className=\"text-xs text-text-muted\">\n {tr('pages.productDetail.minPlatformVersionLabel', 'Min Platform Version')}\n </p>\n <p className=\"mt-1 text-sm font-medium text-text-primary\">\n {safeProduct.minPlatformVersion}\n </p>\n </div>\n )}\n </GlassCard>\n </section>\n </div>\n\n {/* Right Sidebar */}\n <div className=\"w-full lg:w-80\">\n {/* App Support */}\n {(safeProduct.documentationUrl || safeProduct.repositoryUrl || publisher?.email) && (\n <GlassCard className=\"mb-6 p-4\">\n <h3 className=\"font-medium text-text-primary\">\n {tr('pages.productDetail.appSupport', 'App support')}\n </h3>\n <div className=\"mt-3 space-y-2 text-sm\">\n {safeProduct.documentationUrl && (\n <a\n href={safeProduct.documentationUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"block text-text-link hover:underline\"\n >\n {tr('pages.productDetail.documentation', 'Documentation')}\n </a>\n )}\n {safeProduct.repositoryUrl && (\n <a\n href={safeProduct.repositoryUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"block text-text-link hover:underline\"\n >\n {tr('pages.productDetail.sourceRepository', 'Source repository')}\n </a>\n )}\n {publisher?.email && (\n <a\n href={`mailto:${publisher.email}`}\n className=\"block text-text-link hover:underline\"\n >\n {tr('pages.productDetail.contactPublisher', 'Contact publisher')}\n </a>\n )}\n </div>\n </GlassCard>\n )}\n\n {/* Publisher / org card */}\n {publisher && (\n <GlassCard className=\"mb-6 p-4\">\n {(() => {\n const org = publisher.developerOrganization;\n const displayName = org?.name || publisher.name;\n const displayLogo = org?.logoUrl || publisher.logoUrl;\n const displayBio = org?.description || publisher.bio;\n const isVerified = org?.isVerified || publisher.isVerified;\n return (\n <>\n <div className=\"flex items-center gap-2.5\">\n {displayLogo ? (\n <img\n src={displayLogo}\n alt={displayName}\n className=\"size-8 rounded-lg object-cover\"\n />\n ) : (\n <div className=\"flex size-8 items-center justify-center rounded-lg bg-bg-sunken text-sm font-bold text-text-muted\">\n {displayName.charAt(0)}\n </div>\n )}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"font-medium text-text-primary truncate\">\n {displayName}\n </span>\n {isVerified && (\n <ShieldCheck className=\"size-3.5 text-status-success-text shrink-0\" />\n )}\n </div>\n </div>\n </div>\n {displayBio && <p className=\"mt-2 text-sm text-text-muted\">{displayBio}</p>}\n {publisher.websiteUrl && (\n <a\n href={publisher.websiteUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"mt-3 inline-block text-sm text-text-link hover:underline\"\n >\n {tr('pages.productDetail.visitWebsite', 'Visit website')}\n </a>\n )}\n </>\n );\n })()}\n </GlassCard>\n )}\n\n {/* Similar Apps */}\n {relatedProducts && relatedProducts.length > 0 && (\n <div>\n <div className=\"mb-4 flex items-center justify-between text-left\">\n <span className=\"font-medium text-text-primary\">\n {tr('pages.productDetail.similarApps', 'Similar apps')}\n </span>\n </div>\n <div className=\"space-y-3\">\n {relatedProducts.slice(0, 4).map((related) => (\n <button\n type=\"button\"\n key={related.id}\n onClick={() => navigate(`${basePath}/marketplace/product/${related.id}`)}\n className=\"flex w-full cursor-pointer items-center gap-3 rounded-lg p-2 text-left transition-colors hover:bg-bg-sunken\"\n >\n {related.icon ? (\n <img\n src={related.icon}\n alt={related.name}\n className=\"size-12 rounded-xl object-cover\"\n />\n ) : (\n <div className=\"flex size-12 items-center justify-center rounded-xl bg-bg-sunken text-lg font-bold text-text-muted\">\n {related.name.charAt(0)}\n </div>\n )}\n <div className=\"flex-1 overflow-hidden\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {related.name}\n </p>\n <p className=\"text-xs text-text-muted\">\n {publisher?.name || tr('common.unknown', 'Unknown')}\n </p>\n {(related.reviewCount ?? 0) > 0 && (\n <div className=\"flex items-center gap-1\">\n <span className=\"text-xs text-text-muted\">\n {(related.rating || 0).toFixed(1)}\n </span>\n <Star className=\"size-3 fill-current text-status-warning-text\" />\n </div>\n )}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n </main>\n\n {/* Install App Modal */}\n {safeProduct && (\n <InstallAppModal\n isOpen={isInstallModalOpen}\n onClose={() => setIsInstallModalOpen(false)}\n app={{\n id: safeProduct.id,\n applicationId: safeProduct.productId,\n name: safeProduct.name,\n slug: safeProduct.slug,\n icon: safeProduct.icon,\n type: safeProduct.type,\n version: safeProduct.manifestVersion,\n permissions: permissions.length > 0 ? permissions : undefined,\n }}\n purchaseState={isPurchased && !isFree ? 'purchased' : 'free'}\n onInstallSuccess={handleInstallSuccess}\n onInstallError={handleInstallError}\n />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA4LA,IAAM,MACJ,GACA,GACA,OAsDO;CACL,IAAI,EAAa;CACjB,aAAa,GAAW,MAAM;CAC9B,WAAW;EACT,IAAI,GAAW,MAAM;EACrB,MACE,GAAW,QACX,EAAa,cACb,IAAK,kBAAkB,UAAU,IACjC;EACF,aACE,GAAW,QACX,EAAa,cACb,IAAK,kBAAkB,UAAU,IACjC;EACF,OAAO,GAAW,SAAS;EAC3B,UAAU,GAAW,cAAc;EACnC,eAAe;EACf,gBAAgB;EAChB,eAAe;EACf,UAAU,GAAW,aAAa,EAAa;EAC/C,SAAS,GAAW;EACpB,SAAS,GAAW;EACrB;CACD,MAAM,EAAa;CACnB,MAAM,EAAa,QAAQ,EAAa;CACxC,aAAa,EAAa;CAC1B,aAAa,EAAa,mBAAmB,EAAa,eAAe;CACzE,kBAAkB,EAAa,eAAe;CAC9C,SAAS,EAAa;CACtB,gBAAgB,EAAa,eAAe,EAAE;CAC9C,WAAW,EAAa,aAAa,EAAE;CACvC,YAhDmB,GAAgB,MAC/B,MAAW,aAAmB,aACY;EAC5C,KAAK;EACL,QAAQ;EACR,OAAO;EACP,UAAU;EACV,UAAU;EACV,aAAa;EACb,WAAW;EACX,OAAO;EACP,WAAW;EACZ,CACkB,MAAS,OAmCN,EAAa,QAAQ,EAAa,KAAK;CAC7D,QAxEsB,OACuB;EAC3C,KAAK;EACL,QAAQ;EACR,OAAO;EACP,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