@burdenoff/microfe-store 2026.625.5 → 2026.626.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StoreRoutes.js +3 -3
- package/dist/StoreRoutes.js.map +1 -1
- package/dist/components/AccessDenied.js +3 -3
- package/dist/components/AccessDenied.js.map +1 -1
- package/dist/components/InstallAppModal.js +175 -255
- package/dist/components/InstallAppModal.js.map +1 -1
- package/dist/components/cart/CartDrawer.js +10 -10
- package/dist/components/cart/CartDrawer.js.map +1 -1
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/errors/CombinedGraphQLErrors.js +1 -1
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/errors/utils.js +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/link/core/ApolloLink.js +2 -2
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/link/subscriptions/index.js +2 -2
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/link/utils/createOperation.js +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/graphql/print.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/caches.js +2 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/checkDocument.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/getMainDefinition.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +9 -0
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/getOperationDefinition.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +8 -0
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/globals/global.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +10 -0
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +8 -0
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/makeUniqueId.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/memoize.js +2 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/stringifyForDisplay.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -0
- package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/invariant/index.js +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -0
- package/dist/node_modules/@apollo/client/version.js +6 -0
- package/dist/node_modules/@apollo/client/version.js.map +1 -0
- package/dist/node_modules/{.bun/@wry_caches@1.0.1/node_modules/@wry → @wry}/caches/lib/weak.js +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -0
- package/dist/node_modules/{.bun/@wry_trie@0.5.0/node_modules/@wry → @wry}/trie/lib/index.js +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -0
- package/dist/node_modules/{.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws → graphql-ws}/dist/client.js +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -0
- package/dist/node_modules/{.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws → graphql-ws}/dist/common-CGW11Fyb.js +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/NotificationFactories.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/Observable.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/Subscriber.js +2 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/Subscription.js +2 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/config.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/observable/empty.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/scheduler/timeoutProvider.js +2 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/symbol/observable.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/UnsubscriptionError.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/createErrorClass.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/errorContext.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/pipe.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
- package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/reportUnhandledError.js +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
- package/dist/node_modules/{.bun/tslib@2.8.1 → rxjs}/node_modules/tslib/tslib.es6.js +1 -1
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/pages/AdminDashboardPage.js +118 -91
- package/dist/pages/AdminDashboardPage.js.map +1 -1
- package/dist/pages/AdminReviewModerationPage.js +67 -61
- package/dist/pages/AdminReviewModerationPage.js.map +1 -1
- package/dist/pages/AdminStoresPage.js +424 -371
- package/dist/pages/AdminStoresPage.js.map +1 -1
- package/dist/pages/AdminSubmissionsQueuePage.js +303 -286
- package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -1
- package/dist/pages/AppDetailPage.js +172 -135
- package/dist/pages/AppDetailPage.js.map +1 -1
- package/dist/pages/AppSettingsPage.js +83 -300
- package/dist/pages/AppSettingsPage.js.map +1 -1
- package/dist/pages/CartPage.js +71 -79
- package/dist/pages/CartPage.js.map +1 -1
- package/dist/pages/InstalledAppsPage.js +120 -337
- package/dist/pages/InstalledAppsPage.js.map +1 -1
- package/dist/pages/MarketplaceHomePage.js +196 -205
- package/dist/pages/MarketplaceHomePage.js.map +1 -1
- package/dist/pages/MyLicensesPage.js +70 -75
- package/dist/pages/MyLicensesPage.js.map +1 -1
- package/dist/pages/OrderConfirmationPage.js +70 -37
- package/dist/pages/OrderConfirmationPage.js.map +1 -1
- package/dist/pages/OrdersPage.js +60 -68
- package/dist/pages/OrdersPage.js.map +1 -1
- package/dist/pages/ProductDetailPage.js +794 -752
- package/dist/pages/ProductDetailPage.js.map +1 -1
- package/dist/pages/ProductReviewsPage.js +24 -19
- package/dist/pages/ProductReviewsPage.js.map +1 -1
- package/dist/pages/PublisherDashboardPage.js +134 -99
- package/dist/pages/PublisherDashboardPage.js.map +1 -1
- package/dist/pages/PublisherRevenuePage.js +65 -63
- package/dist/pages/PublisherRevenuePage.js.map +1 -1
- package/dist/pages/PublisherSubmissionsPage.js +120 -111
- package/dist/pages/PublisherSubmissionsPage.js.map +1 -1
- package/dist/pages/PublisherSubmitPage.js +197 -184
- package/dist/pages/PublisherSubmitPage.js.map +1 -1
- package/dist/providers/StoreProvider.js +3 -3
- package/package.json +2 -2
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/errors/utils.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -9
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -8
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -10
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -8
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/version.js +0 -6
- package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/version.js.map +0 -1
- package/dist/node_modules/.bun/@wry_caches@1.0.1/node_modules/@wry/caches/lib/weak.js.map +0 -1
- package/dist/node_modules/.bun/@wry_trie@0.5.0/node_modules/@wry/trie/lib/index.js.map +0 -1
- package/dist/node_modules/.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws/dist/client.js.map +0 -1
- package/dist/node_modules/.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -11
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -8
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -8
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -6
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
- package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
- package/dist/node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.js.map +0 -1
- /package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/caching/sizes.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstallAppModal.js","names":[],"sources":["../../src/components/InstallAppModal.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState, useEffect, useCallback, useReducer } from 'react';\nimport { X, Loader2, Building2, CheckCircle, AlertCircle, Info, ShieldCheck } from 'lucide-react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\nimport { useStore } from '../providers/StoreProvider';\n\n// Local type definitions for workspace operations\ninterface Workspace {\n id: string;\n name: string;\n slug: string;\n type?: string;\n status?: string;\n organizationId?: string;\n}\n\ninterface WorkspaceList {\n items: Workspace[];\n total: number;\n}\n\ninterface InstallWorkspaceAppsResult {\n successCount: number;\n failedCount: number;\n results: Array<{\n success: boolean;\n workspaceId: string;\n app?: unknown;\n error?: string;\n }>;\n}\n\n// String queries for graphqlFetch\nconst MY_WORKSPACES_STRING = `query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }`;\nconst INSTALL_WORKSPACE_APPS_STRING = `mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }`;\nconst RECORD_APP_INSTALLATION_STRING = `mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }`;\nconst INSTALL_PURCHASED_APP_STRING = `mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String!) { installPurchasedApp(orderId: $orderId, productId: $productId, workspaceId: $workspaceId) { success alreadyInstalled installation { id productId workspaceId status version } error message } }`;\nconst CREATE_PRODUCT_ENTITLEMENT_STRING = `mutation CreateProductEntitlement($input: CreateProductEntitlementInput!) { createProductEntitlement(input: $input) { id status productId workspaceId } }`;\nconst STORE_DISTRIBUTED_TYPES = new Set([\n 'VIBEMODULE',\n 'NODE',\n 'CONSOLE',\n 'DASHBOARD',\n 'PARSER',\n 'DATASINK',\n]);\n\nconst INSTALL_ERROR_MESSAGES: Record<string, string> = {\n ALREADY_INSTALLED: 'This app is already installed in the selected workspace.',\n QUOTA_EXCEEDED: 'Installation limit reached. Please upgrade your plan or contact support.',\n PERMISSION_DENIED: 'You do not have permission to install apps in this workspace.',\n NOT_FOUND: 'The app or workspace could not be found.',\n WORKSPACE_INACTIVE: 'The selected workspace is inactive.',\n ENTITLEMENT_EXPIRED: 'Your license for this app has expired.',\n UNSUPPORTED_TYPE: 'This product type cannot be installed in the selected workspace.',\n};\n\nfunction mapInstallError(raw: string): string {\n for (const [code, message] of Object.entries(INSTALL_ERROR_MESSAGES)) {\n if (raw.toUpperCase().includes(code)) return message;\n }\n return 'Installation failed. Please try again or contact support.';\n}\n\ninterface InstallState {\n selectedWorkspace: string | null;\n installing: boolean;\n installError: string | null;\n installInfo: string | null;\n}\n\ntype InstallAction =\n | { type: 'reset' }\n | { type: 'selectWorkspace'; workspaceId: string }\n | { type: 'startInstall' }\n | { type: 'finishInstall' }\n | { type: 'setError'; error: string }\n | { type: 'setInfo'; info: string };\n\nconst initialInstallState: InstallState = {\n selectedWorkspace: null,\n installing: false,\n installError: null,\n installInfo: null,\n};\n\nfunction installReducer(state: InstallState, action: InstallAction): InstallState {\n switch (action.type) {\n case 'reset':\n return initialInstallState;\n case 'selectWorkspace':\n return { ...state, selectedWorkspace: action.workspaceId };\n case 'startInstall':\n return { ...state, installing: true, installError: null, installInfo: null };\n case 'finishInstall':\n return { ...state, installing: false };\n case 'setError':\n return { ...state, installError: action.error };\n case 'setInfo':\n return { ...state, installInfo: action.info };\n default:\n return state;\n }\n}\n\nexport interface AppInfo {\n id: string;\n name: string;\n slug?: string;\n icon?: string;\n type?: string;\n version?: string;\n requiredPermissions?: string[];\n}\n\ninterface InstallAppModalProps {\n isOpen: boolean;\n onClose: () => void;\n app: AppInfo;\n orderId?: string | null; // For purchased apps from orders page\n purchaseState?: 'free' | 'purchased';\n onInstallSuccess?: (workspaceId: string, workspaceName: string) => void;\n onInstallError?: (error: Error) => void;\n}\n\ntype ModalStep = 'permissions' | 'workspace';\n\ninterface UseWorkspacesResult {\n workspaces: Workspace[];\n loading: boolean;\n error: Error | null;\n refetch: () => void;\n}\n\n// NOTE: Inline Apollo clients removed. All GraphQL calls now use graphqlFetch\n// from fe-libs which automatically resolves gateway URLs and injects auth + locale headers.\n\n/**\n * Hook to fetch user's workspaces using graphqlFetch from fe-libs\n */\nfunction useWorkspaces(skip: boolean): UseWorkspacesResult {\n const { authToken } = useStore();\n const [workspaces, setWorkspaces] = useState<Workspace[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchWorkspaces = useCallback(async () => {\n if (skip) return;\n\n setLoading(true);\n setError(null);\n\n try {\n const result = await graphqlFetch<{ myWorkspaces: WorkspaceList }>({\n gateway: 'global',\n query: MY_WORKSPACES_STRING,\n authToken: authToken || undefined,\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message ?? 'GraphQL error');\n }\n\n setWorkspaces(result.data?.myWorkspaces?.items || []);\n } catch (err) {\n setError(err instanceof Error ? err : new Error('Failed to fetch workspaces'));\n } finally {\n setLoading(false);\n }\n }, [authToken, skip]);\n\n useEffect(() => {\n fetchWorkspaces();\n }, [fetchWorkspaces]);\n\n return {\n workspaces,\n loading,\n error,\n refetch: fetchWorkspaces,\n };\n}\n\n/**\n * InstallAppModal component\n *\n * Modal for selecting a workspace to install an app into\n */\nexport const InstallAppModal: FC<InstallAppModalProps> = ({\n isOpen,\n onClose,\n app,\n orderId,\n purchaseState = 'free',\n onInstallSuccess,\n onInstallError,\n}) => {\n const { authToken, user } = useStore();\n const [installState, dispatchInstall] = useReducer(installReducer, initialInstallState);\n const { selectedWorkspace, installing, installError, installInfo } = installState;\n\n // Two-step flow: show permissions first if any exist, then workspace selection\n const permissions = app.requiredPermissions ?? [];\n const [step, setStep] = useState<ModalStep>(permissions.length > 0 ? 'permissions' : 'workspace');\n\n // Reset step when modal opens\n useEffect(() => {\n if (isOpen) {\n setStep(permissions.length > 0 ? 'permissions' : 'workspace');\n dispatchInstall({ type: 'reset' });\n }\n }, [isOpen, permissions.length]);\n\n const { workspaces, loading, error } = useWorkspaces(!isOpen || step === 'permissions');\n\n // Filter workspaces by status (only show active)\n const filteredWorkspaces = workspaces.filter((ws) => ws.status === 'ACTIVE');\n\n /**\n * Install purchased app via Store Service (NEW FLOW)\n * Used when installing from orders page or any already-purchased product\n */\n const handleInstallFromStore = async () => {\n if (!selectedWorkspace) return;\n\n const workspace = filteredWorkspaces.find((ws) => ws.id === selectedWorkspace);\n if (!workspace) return;\n const purchasedBy = user?.id;\n\n dispatchInstall({ type: 'startInstall' });\n\n try {\n if (!orderId && purchaseState !== 'purchased') {\n if (!purchasedBy) {\n throw new Error('Unable to identify the current user for license creation');\n }\n\n await graphqlFetch({\n gateway: 'global',\n query: CREATE_PRODUCT_ENTITLEMENT_STRING,\n variables: {\n input: {\n productId: app.id,\n purchasedBy,\n workspaceId: workspace.id,\n metadata: {\n source: 'store-ui',\n productType: app.type,\n },\n },\n },\n authToken: authToken || undefined,\n });\n }\n\n // Call Store Service to install the purchased app\n const result = await graphqlFetch<{\n installPurchasedApp: {\n success: boolean;\n alreadyInstalled?: boolean;\n installation?: {\n id: string;\n productId: string;\n workspaceId: string;\n status: string;\n version: string;\n };\n error?: string;\n message?: string;\n };\n }>({\n gateway: 'global', // Store Service\n query: INSTALL_PURCHASED_APP_STRING,\n variables: {\n orderId: orderId ?? null,\n productId: app.id,\n workspaceId: workspace.id,\n },\n authToken: authToken || undefined,\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message ?? 'Installation failed');\n }\n\n const installResult = result.data?.installPurchasedApp;\n\n if (installResult?.success) {\n if (installResult.alreadyInstalled) {\n dispatchInstall({\n type: 'setInfo',\n info: installResult.message || 'Already installed on this workspace',\n });\n } else {\n onInstallSuccess?.(workspace.id, workspace.name);\n onClose();\n }\n } else {\n const rawMsg = installResult?.error || 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n }\n } catch (err) {\n const rawMsg = err instanceof Error ? err.message : 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n } finally {\n dispatchInstall({ type: 'finishInstall' });\n }\n };\n\n /**\n * Install app via Workspace Service (LEGACY FLOW)\n * Used for free apps or when installing without order\n */\n const handleInstallViaWorkspace = async () => {\n if (!selectedWorkspace) return;\n\n const workspace = filteredWorkspaces.find((ws) => ws.id === selectedWorkspace);\n if (!workspace) return;\n\n dispatchInstall({ type: 'startInstall' });\n\n try {\n // Step 1: Install to workspace service via graphqlFetch\n const installVars = {\n workspaceIds: [workspace.id],\n input: {\n appName: app.slug || app.name.toLowerCase().replace(/\\s+/g, '-'),\n displayName: app.name,\n version: app.version || '1.0.0',\n type: app.type || 'app',\n manifest: {\n productId: app.id,\n icon: app.icon,\n },\n },\n };\n\n const result = await graphqlFetch<{\n installWorkspaceApps: InstallWorkspaceAppsResult;\n }>({\n gateway: 'workspace',\n query: INSTALL_WORKSPACE_APPS_STRING,\n variables: installVars,\n authToken: authToken || undefined,\n workspaceId: workspace.id,\n workspaceToken: true,\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message ?? 'Installation failed');\n }\n\n const installResult = result.data?.installWorkspaceApps;\n if (installResult?.successCount && installResult.successCount > 0) {\n // Step 2: Record installation in store service (for tracking)\n try {\n await graphqlFetch({\n gateway: 'global',\n query: RECORD_APP_INSTALLATION_STRING,\n variables: {\n input: {\n productId: app.id,\n workspaceId: workspace.id,\n workspaceName: workspace.name,\n workspaceType: workspace.type,\n organizationId: workspace.organizationId,\n version: app.version || '1.0.0',\n manifest: {\n productId: app.id,\n icon: app.icon,\n slug: app.slug,\n type: app.type,\n },\n },\n },\n authToken: authToken || undefined,\n });\n } catch {\n // Non-fatal: workspace installation succeeded; store record will sync later.\n }\n\n onInstallSuccess?.(workspace.id, workspace.name);\n onClose();\n } else {\n const rawMsg = installResult?.results?.[0]?.error || 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n }\n } catch (err) {\n const rawMsg = err instanceof Error ? err.message : 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n } finally {\n dispatchInstall({ type: 'finishInstall' });\n }\n };\n\n /**\n * Main install handler - routes to appropriate install function\n */\n const handleInstall = async () => {\n const appType = app.type?.toUpperCase() ?? '';\n\n if (purchaseState === 'purchased' || orderId || STORE_DISTRIBUTED_TYPES.has(appType)) {\n // Purchased products install through the store service.\n await handleInstallFromStore();\n } else {\n // Free products install through the workspace service.\n await handleInstallViaWorkspace();\n }\n };\n\n if (!isOpen) return null;\n\n const modalTitle = step === 'permissions' ? 'Review Permissions' : 'Install App';\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n {/* Backdrop */}\n <button\n type=\"button\"\n aria-label=\"Close modal\"\n className=\"absolute inset-0 bg-bg-overlay/50 backdrop-blur-sm\"\n onClick={onClose}\n />\n\n {/* Modal */}\n <dialog\n open\n aria-modal=\"true\"\n aria-labelledby=\"install-app-modal-title\"\n className=\"relative z-10 mx-4 w-full max-w-lg rounded-2xl border border-border-default bg-bg-surface shadow-2xl\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-border-default px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n {app.icon ? (\n <img src={app.icon} alt={app.name} className=\"size-10 rounded-lg object-cover\" />\n ) : (\n <div className=\"flex size-10 items-center justify-center rounded-lg bg-bg-sunken text-lg font-bold text-text-muted\">\n {app.name.charAt(0)}\n </div>\n )}\n <div>\n <h2 id=\"install-app-modal-title\" className=\"text-lg font-semibold text-text-primary\">\n {modalTitle}\n </h2>\n <p className=\"text-sm text-text-muted\">{app.name}</p>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close install dialog\"\n className=\"cursor-pointer rounded-lg p-2 text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Step 1: Permissions consent */}\n {step === 'permissions' && (\n <>\n <div className=\"px-6 py-4\">\n <p className=\"mb-1 text-sm text-text-secondary\">\n <span className=\"font-medium text-text-primary\">{app.name}</span> requests access to the following data in your workspace. You must accept to continue.\n </p>\n <div className=\"mt-4 max-h-72 overflow-y-auto space-y-2\">\n {permissions.map((perm) => (\n <div\n key={perm}\n className=\"flex items-center gap-3 rounded-lg bg-bg-sunken px-4 py-3\"\n >\n <ShieldCheck className=\"size-5 flex-shrink-0 text-status-success-text\" />\n <span className=\"text-sm text-text-primary\">{perm}</span>\n </div>\n ))}\n </div>\n <p className=\"mt-3 text-xs text-text-muted\">\n These permissions will be recorded. You will be notified if they change in a future version.\n </p>\n </div>\n <div className=\"border-t border-border-default px-6 py-4 flex items-center justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={() => setStep('workspace')}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 inline-flex items-center gap-2\"\n >\n <CheckCircle className=\"size-4\" />\n Accept & Continue\n </button>\n </div>\n </>\n )}\n\n {/* Step 2: Workspace selection */}\n {step === 'workspace' && (\n <>\n <div className=\"px-6 py-4\">\n {permissions.length > 0 && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-status-success-bg-subtle px-3 py-2 text-sm text-status-success-text\">\n <CheckCircle className=\"size-4 flex-shrink-0\" />\n <span>Permissions accepted ({permissions.length} permission{permissions.length !== 1 ? 's' : ''})</span>\n </div>\n )}\n <p className=\"mb-4 text-text-secondary\">\n Select the workspace where you want to install this app:\n </p>\n\n {/* Workspace List */}\n <div className=\"max-h-64 overflow-y-auto rounded-lg border border-border-default\">\n {loading ? (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 className=\"size-8 animate-spin text-text-muted\" />\n </div>\n ) : error ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <AlertCircle className=\"mb-2 size-8 text-status-error-text\" />\n <p className=\"text-sm text-status-error-text\">Failed to load workspaces</p>\n <p className=\"text-xs text-text-muted mt-1\">{error.message}</p>\n </div>\n ) : filteredWorkspaces.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <Building2 className=\"mb-2 size-8 text-text-muted\" />\n <p className=\"text-sm text-text-muted\">No workspaces available</p>\n </div>\n ) : (\n <div className=\"divide-y divide-border-default\">\n {filteredWorkspaces.map((workspace) => (\n <button\n type=\"button\"\n key={workspace.id}\n onClick={() =>\n dispatchInstall({ type: 'selectWorkspace', workspaceId: workspace.id })\n }\n className={`w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${\n selectedWorkspace === workspace.id\n ? 'bg-action-primary-bg/10'\n : 'transition-colors hover:bg-bg-sunken'\n }`}\n >\n <div className=\"flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10 text-text-link\">\n <Building2 className=\"size-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"font-medium text-text-primary truncate\">{workspace.name}</p>\n {workspace.slug ? (\n <p className=\"text-xs text-text-muted truncate\">/{workspace.slug}</p>\n ) : null}\n </div>\n {selectedWorkspace === workspace.id && (\n <CheckCircle className=\"size-5 flex-shrink-0 text-action-primary-bg\" />\n )}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n\n {/* Footer */}\n <div className=\"border-t border-border-default px-6 py-4\">\n {installInfo && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text\">\n <Info className=\"size-4 flex-shrink-0\" />\n <span>{installInfo}</span>\n </div>\n )}\n {installError && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-status-error-bg-subtle/10 px-3 py-2 text-sm text-status-error-text\">\n <AlertCircle className=\"size-4 flex-shrink-0\" />\n <span>{installError}</span>\n </div>\n )}\n <div className=\"flex items-center justify-end gap-3\">\n {permissions.length > 0 && (\n <button\n type=\"button\"\n onClick={() => setStep('permissions')}\n disabled={installing}\n className=\"cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\"\n >\n Back\n </button>\n )}\n <button\n type=\"button\"\n onClick={onClose}\n disabled={installing}\n className=\"cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleInstall}\n disabled={!selectedWorkspace || installing}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2\"\n >\n {installing ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n Installing…\n </>\n ) : (\n 'Install App'\n )}\n </button>\n </div>\n </div>\n </>\n )}\n </dialog>\n </div>\n );\n};\n"],"mappings":";;;;;;AAiCA,IAAM,IAAuB,mGACvB,IAAgC,mOAChC,IAAiC,kJACjC,IAA+B,2RAC/B,IAAoC,6JACpC,IAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,EAEI,IAAiD;CACrD,mBAAmB;CACnB,gBAAgB;CAChB,mBAAmB;CACnB,WAAW;CACX,oBAAoB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N,kBAAC,OAAD;WAAK,WAAU;qBAAf,CACE,kBAAC,KAAD;YAAG,WAAU;sBAA0C,EAAU;YAAS,CAAA,EACzE,EAAU,OACT,kBAAC,KAAD;YAAG,WAAU;sBAAb,CAAgD,KAAE,EAAU,KAAS;gBACnE,KACA;;UACL,MAAsB,EAAU,MAC/B,kBAAC,GAAD,EAAa,WAAU,+CAAgD,CAAA;UAElE;WAtBF,EAAU,GAsBR,CACT;QACE,CAAA;OAEJ,CAAA;MACF;QAGN,kBAAC,OAAD;KAAK,WAAU;eAAf;MACG,KACC,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD,EAAM,WAAU,wBAAyB,CAAA,EACzC,kBAAC,QAAD,EAAA,UAAO,GAAmB,CAAA,CACtB;;MAEP,KACC,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD,EAAa,WAAU,wBAAyB,CAAA,EAChD,kBAAC,QAAD,EAAA,UAAO,GAAoB,CAAA,CACvB;;MAER,kBAAC,OAAD;OAAK,WAAU;iBAAf;QACG,EAAY,SAAS,KACpB,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAQ,cAAc;SACrC,UAAU;SACV,WAAU;mBACX;SAEQ,CAAA;QAEX,kBAAC,UAAD;SACE,MAAK;SACL,SAAS;SACT,UAAU;SACV,WAAU;mBACX;SAEQ,CAAA;QACT,kBAAC,UAAD;SACE,MAAK;SACL,SAAS;SACT,UAAU,CAAC,KAAqB;SAChC,WAAU;mBAET,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,EAAA,cAE1C,EAAA,CAAA,GAEH;SAEK,CAAA;QACL;;MACF;OACL,EAAA,CAAA;IAEE;KACL"}
|
|
1
|
+
{"version":3,"file":"InstallAppModal.js","names":[],"sources":["../../src/components/InstallAppModal.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState, useEffect, useCallback, useReducer } from 'react';\nimport { Loader2, Building2, CheckCircle, AlertCircle, Info } from 'lucide-react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n} from '@burdenoff/fe-libs/ui';\nimport { useStore } from '../providers/StoreProvider';\n\n// Local type definitions for workspace operations\ninterface Workspace {\n id: string;\n name: string;\n slug: string;\n type?: string;\n status?: string;\n organizationId?: string;\n}\n\ninterface WorkspaceList {\n items: Workspace[];\n total: number;\n}\n\ninterface InstallWorkspaceAppsResult {\n successCount: number;\n failedCount: number;\n results: Array<{\n success: boolean;\n workspaceId: string;\n app?: unknown;\n error?: string;\n }>;\n}\n\n// String queries for graphqlFetch\nconst MY_WORKSPACES_STRING = `query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }`;\nconst INSTALL_WORKSPACE_APPS_STRING = `mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }`;\nconst RECORD_APP_INSTALLATION_STRING = `mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }`;\nconst INSTALL_PURCHASED_APP_STRING = `mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String!) { installPurchasedApp(orderId: $orderId, productId: $productId, workspaceId: $workspaceId) { success alreadyInstalled installation { id productId workspaceId status version } error message } }`;\nconst CREATE_PRODUCT_ENTITLEMENT_STRING = `mutation CreateProductEntitlement($input: CreateProductEntitlementInput!) { createProductEntitlement(input: $input) { id status productId workspaceId } }`;\nconst STORE_DISTRIBUTED_TYPES = new Set([\n 'VIBEMODULE',\n 'NODE',\n 'CONSOLE',\n 'DASHBOARD',\n 'PARSER',\n 'DATASINK',\n]);\n\nconst INSTALL_ERROR_MESSAGES: Record<string, string> = {\n ALREADY_INSTALLED: 'This app is already installed in the selected workspace.',\n QUOTA_EXCEEDED: 'Installation limit reached. Please upgrade your plan or contact support.',\n PERMISSION_DENIED: 'You do not have permission to install apps in this workspace.',\n NOT_FOUND: 'The app or workspace could not be found.',\n WORKSPACE_INACTIVE: 'The selected workspace is inactive.',\n ENTITLEMENT_EXPIRED: 'Your license for this app has expired.',\n UNSUPPORTED_TYPE: 'This product type cannot be installed in the selected workspace.',\n};\n\nfunction mapInstallError(raw: string): string {\n for (const [code, message] of Object.entries(INSTALL_ERROR_MESSAGES)) {\n if (raw.toUpperCase().includes(code)) return message;\n }\n return 'Installation failed. Please try again or contact support.';\n}\n\ninterface InstallState {\n selectedWorkspace: string | null;\n installing: boolean;\n installError: string | null;\n installInfo: string | null;\n}\n\ntype InstallAction =\n | { type: 'reset' }\n | { type: 'selectWorkspace'; workspaceId: string }\n | { type: 'startInstall' }\n | { type: 'finishInstall' }\n | { type: 'setError'; error: string }\n | { type: 'setInfo'; info: string };\n\nconst initialInstallState: InstallState = {\n selectedWorkspace: null,\n installing: false,\n installError: null,\n installInfo: null,\n};\n\nfunction installReducer(state: InstallState, action: InstallAction): InstallState {\n switch (action.type) {\n case 'reset':\n return initialInstallState;\n case 'selectWorkspace':\n return { ...state, selectedWorkspace: action.workspaceId };\n case 'startInstall':\n return { ...state, installing: true, installError: null, installInfo: null };\n case 'finishInstall':\n return { ...state, installing: false };\n case 'setError':\n return { ...state, installError: action.error };\n case 'setInfo':\n return { ...state, installInfo: action.info };\n default:\n return state;\n }\n}\n\nexport interface AppInfo {\n id: string;\n name: string;\n slug?: string;\n icon?: string;\n type?: string;\n version?: string;\n}\n\ninterface InstallAppModalProps {\n isOpen: boolean;\n onClose: () => void;\n app: AppInfo;\n orderId?: string | null; // For purchased apps from orders page\n purchaseState?: 'free' | 'purchased';\n onInstallSuccess?: (workspaceId: string, workspaceName: string) => void;\n onInstallError?: (error: Error) => void;\n}\n\ninterface UseWorkspacesResult {\n workspaces: Workspace[];\n loading: boolean;\n error: Error | null;\n refetch: () => void;\n}\n\n// NOTE: Inline Apollo clients removed. All GraphQL calls now use graphqlFetch\n// from fe-libs which automatically resolves gateway URLs and injects auth + locale headers.\n\n/**\n * Hook to fetch user's workspaces using graphqlFetch from fe-libs\n */\nfunction useWorkspaces(skip: boolean): UseWorkspacesResult {\n const { authToken } = useStore();\n const [workspaces, setWorkspaces] = useState<Workspace[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchWorkspaces = useCallback(async () => {\n if (skip) return;\n\n setLoading(true);\n setError(null);\n\n try {\n const result = await graphqlFetch<{ myWorkspaces: WorkspaceList }>({\n gateway: 'global',\n query: MY_WORKSPACES_STRING,\n authToken: authToken || undefined,\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message ?? 'GraphQL error');\n }\n\n setWorkspaces(result.data?.myWorkspaces?.items || []);\n } catch (err) {\n setError(err instanceof Error ? err : new Error('Failed to fetch workspaces'));\n } finally {\n setLoading(false);\n }\n }, [authToken, skip]);\n\n useEffect(() => {\n fetchWorkspaces();\n }, [fetchWorkspaces]);\n\n return {\n workspaces,\n loading,\n error,\n refetch: fetchWorkspaces,\n };\n}\n\n/**\n * InstallAppModal component\n *\n * Modal for selecting a workspace to install an app into\n */\nexport const InstallAppModal: FC<InstallAppModalProps> = ({\n isOpen,\n onClose,\n app,\n orderId,\n purchaseState = 'free',\n onInstallSuccess,\n onInstallError,\n}) => {\n const { authToken, user } = useStore();\n const [installState, dispatchInstall] = useReducer(installReducer, initialInstallState);\n const { selectedWorkspace, installing, installError, installInfo } = installState;\n\n const { workspaces, loading, error } = useWorkspaces(!isOpen);\n\n // Filter workspaces by status (only show active)\n const filteredWorkspaces = workspaces.filter((ws) => ws.status === 'ACTIVE');\n\n /**\n * Install purchased app via Store Service (NEW FLOW)\n * Used when installing from orders page or any already-purchased product\n */\n const handleInstallFromStore = async () => {\n if (!selectedWorkspace) return;\n\n const workspace = filteredWorkspaces.find((ws) => ws.id === selectedWorkspace);\n if (!workspace) return;\n const purchasedBy = user?.id;\n\n dispatchInstall({ type: 'startInstall' });\n\n try {\n if (!orderId && purchaseState !== 'purchased') {\n if (!purchasedBy) {\n throw new Error('Unable to identify the current user for license creation');\n }\n\n await graphqlFetch({\n gateway: 'global',\n query: CREATE_PRODUCT_ENTITLEMENT_STRING,\n variables: {\n input: {\n productId: app.id,\n purchasedBy,\n workspaceId: workspace.id,\n metadata: {\n source: 'store-ui',\n productType: app.type,\n },\n },\n },\n authToken: authToken || undefined,\n });\n }\n\n // Call Store Service to install the purchased app\n const result = await graphqlFetch<{\n installPurchasedApp: {\n success: boolean;\n alreadyInstalled?: boolean;\n installation?: {\n id: string;\n productId: string;\n workspaceId: string;\n status: string;\n version: string;\n };\n error?: string;\n message?: string;\n };\n }>({\n gateway: 'global', // Store Service\n query: INSTALL_PURCHASED_APP_STRING,\n variables: {\n orderId: orderId ?? null,\n productId: app.id,\n workspaceId: workspace.id,\n },\n authToken: authToken || undefined,\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message ?? 'Installation failed');\n }\n\n const installResult = result.data?.installPurchasedApp;\n\n if (installResult?.success) {\n if (installResult.alreadyInstalled) {\n dispatchInstall({\n type: 'setInfo',\n info: installResult.message || 'Already installed on this workspace',\n });\n } else {\n onInstallSuccess?.(workspace.id, workspace.name);\n onClose();\n }\n } else {\n const rawMsg = installResult?.error || 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n }\n } catch (err) {\n const rawMsg = err instanceof Error ? err.message : 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n } finally {\n dispatchInstall({ type: 'finishInstall' });\n }\n };\n\n /**\n * Install app via Workspace Service (LEGACY FLOW)\n * Used for free apps or when installing without order\n */\n const handleInstallViaWorkspace = async () => {\n if (!selectedWorkspace) return;\n\n const workspace = filteredWorkspaces.find((ws) => ws.id === selectedWorkspace);\n if (!workspace) return;\n\n dispatchInstall({ type: 'startInstall' });\n\n try {\n // Step 1: Install to workspace service via graphqlFetch\n const installVars = {\n workspaceIds: [workspace.id],\n input: {\n appName: app.slug || app.name.toLowerCase().replace(/\\s+/g, '-'),\n displayName: app.name,\n version: app.version || '1.0.0',\n type: app.type || 'app',\n manifest: {\n productId: app.id,\n icon: app.icon,\n },\n },\n };\n\n const result = await graphqlFetch<{\n installWorkspaceApps: InstallWorkspaceAppsResult;\n }>({\n gateway: 'workspace',\n query: INSTALL_WORKSPACE_APPS_STRING,\n variables: installVars,\n authToken: authToken || undefined,\n workspaceId: workspace.id,\n workspaceToken: true,\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message ?? 'Installation failed');\n }\n\n const installResult = result.data?.installWorkspaceApps;\n if (installResult?.successCount && installResult.successCount > 0) {\n // Step 2: Record installation in store service (for tracking)\n try {\n await graphqlFetch({\n gateway: 'global',\n query: RECORD_APP_INSTALLATION_STRING,\n variables: {\n input: {\n productId: app.id,\n workspaceId: workspace.id,\n workspaceName: workspace.name,\n workspaceType: workspace.type,\n organizationId: workspace.organizationId,\n version: app.version || '1.0.0',\n manifest: {\n productId: app.id,\n icon: app.icon,\n slug: app.slug,\n type: app.type,\n },\n },\n },\n authToken: authToken || undefined,\n });\n } catch {\n // Non-fatal: workspace installation succeeded; store record will sync later.\n }\n\n onInstallSuccess?.(workspace.id, workspace.name);\n onClose();\n } else {\n const rawMsg = installResult?.results?.[0]?.error || 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n }\n } catch (err) {\n const rawMsg = err instanceof Error ? err.message : 'Installation failed';\n const errorMsg = mapInstallError(rawMsg);\n dispatchInstall({ type: 'setError', error: errorMsg });\n onInstallError?.(new Error(rawMsg));\n } finally {\n dispatchInstall({ type: 'finishInstall' });\n }\n };\n\n /**\n * Main install handler - routes to appropriate install function\n */\n const handleInstall = async () => {\n const appType = app.type?.toUpperCase() ?? '';\n\n if (purchaseState === 'purchased' || orderId || STORE_DISTRIBUTED_TYPES.has(appType)) {\n // Purchased products install through the store service.\n await handleInstallFromStore();\n } else {\n // Free products install through the workspace service.\n await handleInstallViaWorkspace();\n }\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>\n <DialogContent className=\"mx-4 w-full max-w-lg gap-0 p-0\">\n {/* Header */}\n <DialogHeader className=\"flex flex-row items-center justify-between space-y-0 border-b border-border-default px-6 py-4 text-left\">\n <div className=\"flex items-center gap-3\">\n {app.icon ? (\n <img src={app.icon} alt={app.name} className=\"size-10 rounded-lg object-cover\" />\n ) : (\n <div className=\"flex size-10 items-center justify-center rounded-lg bg-bg-sunken text-lg font-bold text-text-muted\">\n {app.name.charAt(0)}\n </div>\n )}\n <div>\n <DialogTitle className=\"text-lg font-semibold text-text-primary\">\n Install App\n </DialogTitle>\n <DialogDescription className=\"text-sm text-text-muted\">{app.name}</DialogDescription>\n </div>\n </div>\n </DialogHeader>\n\n {/* Content */}\n <div className=\"px-6 py-4\">\n <p className=\"mb-4 text-text-secondary\">\n Select the workspace where you want to install this app:\n </p>\n\n {/* Workspace List */}\n <div className=\"max-h-72 overflow-y-auto rounded-lg border border-border-seam\">\n {loading ? (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 className=\"size-8 animate-spin text-text-muted\" />\n </div>\n ) : error ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <AlertCircle className=\"mb-2 size-8 text-status-error-text\" />\n <p className=\"text-sm text-status-error-text\">Failed to load workspaces</p>\n <p className=\"text-xs text-text-muted mt-1\">{error.message}</p>\n </div>\n ) : filteredWorkspaces.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <Building2 className=\"mb-2 size-8 text-text-muted\" />\n <p className=\"text-sm text-text-muted\">No workspaces available</p>\n </div>\n ) : (\n <div className=\"divide-y divide-border-default\">\n {filteredWorkspaces.map((workspace) => (\n <button\n type=\"button\"\n key={workspace.id}\n onClick={() =>\n dispatchInstall({ type: 'selectWorkspace', workspaceId: workspace.id })\n }\n className={`w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${\n selectedWorkspace === workspace.id\n ? 'bg-action-primary-bg/10'\n : 'transition-colors hover:bg-bg-sunken'\n }`}\n >\n {/* Workspace Icon */}\n <div className=\"flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10 text-text-link\">\n <Building2 className=\"size-5\" />\n </div>\n\n {/* Workspace Info */}\n <div className=\"flex-1 min-w-0\">\n <p className=\"font-medium text-text-primary truncate\">{workspace.name}</p>\n {workspace.slug ? (\n <p className=\"text-xs text-text-muted truncate\">/{workspace.slug}</p>\n ) : null}\n </div>\n\n {/* Selection Indicator */}\n {selectedWorkspace === workspace.id && (\n <CheckCircle className=\"size-5 flex-shrink-0 text-action-primary-bg\" />\n )}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n\n {/* Footer */}\n <DialogFooter className=\"block border-t border-border-default px-6 py-4 sm:flex-col sm:items-stretch sm:space-x-0\">\n {/* Already-installed info */}\n {installInfo && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text\">\n <Info className=\"size-4 flex-shrink-0\" />\n <span>{installInfo}</span>\n </div>\n )}\n {/* Error message */}\n {installError && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-status-error-bg-subtle/10 px-3 py-2 text-sm text-status-error-text\">\n <AlertCircle className=\"size-4 flex-shrink-0\" />\n <span>{installError}</span>\n </div>\n )}\n <div className=\"flex items-center justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n disabled={installing}\n className=\"cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleInstall}\n disabled={!selectedWorkspace || installing}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2\"\n >\n {installing ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n Installing…\n </>\n ) : (\n 'Install App'\n )}\n </button>\n </div>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n};\n"],"mappings":";;;;;;;AAyCA,IAAM,IAAuB,mGACvB,IAAgC,mOAChC,IAAiC,kJACjC,IAA+B,2RAC/B,IAAoC,6JACpC,IAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,EAEI,IAAiD;CACrD,mBAAmB;CACnB,gBAAgB;CAChB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CACnB;AAED,SAAS,EAAgB,GAAqB;AAC5C,MAAK,IAAM,CAAC,GAAM,MAAY,OAAO,QAAQ,EAAuB,CAClE,KAAI,EAAI,aAAa,CAAC,SAAS,EAAK,CAAE,QAAO;AAE/C,QAAO;;AAkBT,IAAM,IAAoC;CACxC,mBAAmB;CACnB,YAAY;CACZ,cAAc;CACd,aAAa;CACd;AAED,SAAS,EAAe,GAAqB,GAAqC;AAChF,SAAQ,EAAO,MAAf;EACE,KAAK,QACH,QAAO;EACT,KAAK,kBACH,QAAO;GAAE,GAAG;GAAO,mBAAmB,EAAO;GAAa;EAC5D,KAAK,eACH,QAAO;GAAE,GAAG;GAAO,YAAY;GAAM,cAAc;GAAM,aAAa;GAAM;EAC9E,KAAK,gBACH,QAAO;GAAE,GAAG;GAAO,YAAY;GAAO;EACxC,KAAK,WACH,QAAO;GAAE,GAAG;GAAO,cAAc,EAAO;GAAO;EACjD,KAAK,UACH,QAAO;GAAE,GAAG;GAAO,aAAa,EAAO;GAAM;EAC/C,QACE,QAAO;;;AAoCb,SAAS,EAAc,GAAoC;CACzD,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({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
13
13
|
className: "flex h-full flex-col",
|
|
14
14
|
children: [
|
|
15
15
|
/* @__PURE__ */ c("div", {
|
|
16
|
-
className: "flex items-center justify-between border-b border-border-
|
|
16
|
+
className: "flex items-center justify-between border-b border-border-seam px-4 sm:px-6 py-4",
|
|
17
17
|
children: [/* @__PURE__ */ c("div", {
|
|
18
18
|
className: "flex items-center gap-2",
|
|
19
19
|
children: [
|
|
@@ -23,7 +23,7 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
23
23
|
children: "Shopping Cart"
|
|
24
24
|
}),
|
|
25
25
|
p > 0 && /* @__PURE__ */ s("span", {
|
|
26
|
-
className: "rounded-full bg-bg-accent px-2 py-0.5 text-xs font-medium text-text-link",
|
|
26
|
+
className: "rounded-full bg-bg-accent px-2 py-0.5 text-xs font-medium tabular-nums text-text-link",
|
|
27
27
|
children: p
|
|
28
28
|
})
|
|
29
29
|
]
|
|
@@ -57,7 +57,7 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
57
57
|
}) : /* @__PURE__ */ s("div", {
|
|
58
58
|
className: "space-y-4",
|
|
59
59
|
children: f.map((a) => /* @__PURE__ */ c("div", {
|
|
60
|
-
className: "flex gap-4 rounded-lg border border-border-
|
|
60
|
+
className: "flex gap-4 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)]",
|
|
61
61
|
children: [/* @__PURE__ */ s("div", {
|
|
62
62
|
className: "size-20 flex-shrink-0 overflow-hidden rounded bg-bg-sunken",
|
|
63
63
|
children: a.productIcon || a.product?.icon ? /* @__PURE__ */ s("img", {
|
|
@@ -125,7 +125,7 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
125
125
|
/* @__PURE__ */ s("div", {
|
|
126
126
|
className: "mt-2 text-right",
|
|
127
127
|
children: /* @__PURE__ */ s("span", {
|
|
128
|
-
className: "font-semibold text-text-primary",
|
|
128
|
+
className: "font-semibold tabular-nums text-text-primary",
|
|
129
129
|
children: e(a.subtotal)
|
|
130
130
|
})
|
|
131
131
|
})
|
|
@@ -135,7 +135,7 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
135
135
|
})
|
|
136
136
|
}),
|
|
137
137
|
f.length > 0 && /* @__PURE__ */ c("div", {
|
|
138
|
-
className: "border-t border-border-
|
|
138
|
+
className: "border-t border-border-seam bg-accent-wash px-4 sm:px-6 py-4",
|
|
139
139
|
children: [/* @__PURE__ */ c("div", {
|
|
140
140
|
className: "space-y-2",
|
|
141
141
|
children: [
|
|
@@ -145,7 +145,7 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
145
145
|
className: "text-text-muted",
|
|
146
146
|
children: "Subtotal"
|
|
147
147
|
}), /* @__PURE__ */ s("span", {
|
|
148
|
-
className: "font-medium text-text-primary",
|
|
148
|
+
className: "font-medium tabular-nums text-text-primary",
|
|
149
149
|
children: e(m)
|
|
150
150
|
})]
|
|
151
151
|
}),
|
|
@@ -155,17 +155,17 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
155
155
|
className: "text-text-muted",
|
|
156
156
|
children: "Tax"
|
|
157
157
|
}), /* @__PURE__ */ s("span", {
|
|
158
|
-
className: "font-medium text-text-primary",
|
|
158
|
+
className: "font-medium tabular-nums text-text-primary",
|
|
159
159
|
children: e(h)
|
|
160
160
|
})]
|
|
161
161
|
}),
|
|
162
162
|
/* @__PURE__ */ c("div", {
|
|
163
|
-
className: "flex justify-between border-t border-border-
|
|
163
|
+
className: "flex justify-between border-t border-border-seam pt-2",
|
|
164
164
|
children: [/* @__PURE__ */ s("span", {
|
|
165
165
|
className: "font-semibold text-text-primary",
|
|
166
166
|
children: "Total"
|
|
167
167
|
}), /* @__PURE__ */ s("span", {
|
|
168
|
-
className: "text-lg font-bold text-text-primary",
|
|
168
|
+
className: "text-lg font-bold tabular-nums text-text-primary",
|
|
169
169
|
children: e(g)
|
|
170
170
|
})]
|
|
171
171
|
})
|
|
@@ -173,7 +173,7 @@ var l = ({ isOpen: l, onClose: u, onCheckout: d, cartItems: f, itemCount: p, sub
|
|
|
173
173
|
}), /* @__PURE__ */ s("button", {
|
|
174
174
|
type: "button",
|
|
175
175
|
onClick: d,
|
|
176
|
-
className: "cursor-pointer mt-4 w-full rounded-lg bg-action-primary-bg py-3 font-bold text-action-primary-text shadow-
|
|
176
|
+
className: "cursor-pointer mt-4 w-full rounded-lg bg-action-primary-bg py-3 font-bold text-action-primary-text shadow-elevation-1 transition-[opacity,box-shadow] hover:opacity-90 hover:shadow-[var(--shadow-pop)]",
|
|
177
177
|
children: "Proceed to Checkout"
|
|
178
178
|
})]
|
|
179
179
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartDrawer.js","names":[],"sources":["../../../src/components/cart/CartDrawer.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { X, ShoppingCart, Trash2, Plus, Minus } from 'lucide-react';\nimport { formatPrice } from '../../utils';\n\n/**\n * Props for CartDrawer\n */\ninterface CartDrawerProps {\n isOpen: boolean;\n onClose: () => void;\n onCheckout: () => void;\n cartItems: Array<{\n id: string;\n quantity: number;\n subtotal: number;\n productName?: string;\n productIcon?: string;\n variantName?: string;\n product?: { icon?: string; name?: string };\n }>;\n itemCount: number;\n subtotal: number;\n tax: number;\n total: number;\n updateQuantity: (cartItemId: string, quantity: number) => Promise<void>;\n removeProduct: (cartItemId: string) => Promise<void>;\n}\n\n/**\n * CartDrawer component\n *\n * Sliding drawer for cart management\n */\nexport const CartDrawer: FC<CartDrawerProps> = ({\n isOpen,\n onClose,\n onCheckout,\n cartItems,\n itemCount,\n subtotal,\n tax,\n total,\n updateQuantity,\n removeProduct,\n}) => {\n if (!isOpen) return null;\n\n return (\n <>\n {/* Backdrop */}\n <button\n type=\"button\"\n aria-label=\"Close cart\"\n className=\"fixed inset-0 z-40 bg-bg-overlay/50 transition-opacity\"\n onClick={onClose}\n />\n\n {/* Drawer */}\n <div className=\"fixed right-0 top-0 z-50 size-full sm:max-w-md bg-bg-surface shadow-xl\">\n <div className=\"flex h-full flex-col\">\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-border-default px-4 sm:px-6 py-4\">\n <div className=\"flex items-center gap-2\">\n <ShoppingCart className=\"size-5 text-text-primary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">Shopping Cart</h2>\n {itemCount > 0 && (\n <span className=\"rounded-full bg-bg-accent px-2 py-0.5 text-xs font-medium text-text-link\">\n {itemCount}\n </span>\n )}\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close cart\"\n className=\"cursor-pointer rounded-lg p-2 text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Cart Items */}\n <div className=\"flex-1 overflow-y-auto px-4 sm:px-6 py-4\">\n {cartItems.length === 0 ? (\n <output\n aria-label=\"Your cart is empty\"\n className=\"flex h-full flex-col items-center justify-center text-center\"\n >\n <ShoppingCart className=\"mb-4 size-16 text-text-muted\" aria-hidden=\"true\" />\n <h3 className=\"mb-2 text-lg font-semibold text-text-primary\">Your cart is empty</h3>\n <p className=\"text-sm text-text-muted\">Start shopping to add items to your cart</p>\n </output>\n ) : (\n <div className=\"space-y-4\">\n {cartItems.map((item) => (\n <div\n key={item.id}\n className=\"flex gap-4 rounded-lg border border-border-default p-4\"\n >\n {/* Product Image */}\n <div className=\"size-20 flex-shrink-0 overflow-hidden rounded bg-bg-sunken\">\n {item.productIcon || item.product?.icon ? (\n <img\n src={item.productIcon || item.product?.icon}\n alt={item.productName || item.product?.name}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"flex size-full items-center justify-center\">\n <ShoppingCart className=\"size-8 text-text-muted\" />\n </div>\n )}\n </div>\n\n {/* Product Info */}\n <div className=\"flex flex-1 flex-col\">\n <h4 className=\"mb-1 font-semibold text-text-primary\">\n {item.productName || item.product?.name || 'Product'}\n </h4>\n {item.variantName && (\n <p className=\"mb-2 text-xs text-text-muted\">{item.variantName}</p>\n )}\n\n {/* Quantity Controls */}\n <div className=\"flex items-center gap-3\">\n <div className=\"flex items-center rounded border border-border-default\">\n <button\n type=\"button\"\n onClick={() => updateQuantity(item.id, item.quantity - 1)}\n aria-label={`Decrease quantity of ${item.productName || item.product?.name || 'item'}`}\n className=\"cursor-pointer p-1.5 transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n disabled={item.quantity <= 1}\n >\n <Minus className=\"size-4\" aria-hidden=\"true\" />\n </button>\n <span\n className=\"min-w-[2rem] text-center text-sm font-medium\"\n aria-label={`Quantity: ${item.quantity}`}\n >\n {item.quantity}\n </span>\n <button\n type=\"button\"\n onClick={() => updateQuantity(item.id, item.quantity + 1)}\n aria-label={`Increase quantity of ${item.productName || item.product?.name || 'item'}`}\n className=\"cursor-pointer p-1.5 transition-colors hover:bg-bg-sunken\"\n >\n <Plus className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <button\n type=\"button\"\n onClick={() => removeProduct(item.id)}\n aria-label={`Remove ${item.productName || item.product?.name || 'item'} from cart`}\n className=\"cursor-pointer ml-auto text-status-error-text transition-colors hover:text-status-error-text-emphasis\"\n >\n <Trash2 className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </div>\n\n {/* Price */}\n <div className=\"mt-2 text-right\">\n <span className=\"font-semibold text-text-primary\">\n {formatPrice(item.subtotal)}\n </span>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer with Summary */}\n {cartItems.length > 0 && (\n <div className=\"border-t border-border-default bg-bg-sunken px-4 sm:px-6 py-4\">\n <div className=\"space-y-2\">\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-text-muted\">Subtotal</span>\n <span className=\"font-medium text-text-primary\">{formatPrice(subtotal)}</span>\n </div>\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-text-muted\">Tax</span>\n <span className=\"font-medium text-text-primary\">{formatPrice(tax)}</span>\n </div>\n <div className=\"flex justify-between border-t border-border-default pt-2\">\n <span className=\"font-semibold text-text-primary\">Total</span>\n <span className=\"text-lg font-bold text-text-primary\">{formatPrice(total)}</span>\n </div>\n </div>\n\n <button\n type=\"button\"\n onClick={onCheckout}\n className=\"cursor-pointer mt-4 w-full rounded-lg bg-action-primary-bg py-3 font-bold text-action-primary-text shadow-lg transition-all hover:opacity-90 hover:shadow-xl active:scale-[0.98]\"\n >\n Proceed to Checkout\n </button>\n </div>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;AAiCA,IAAa,KAAmC,EAC9C,WACA,YACA,eACA,cACA,cACA,aACA,QACA,UACA,mBACA,uBAEK,IAGH,kBAAA,GAAA,EAAA,UAAA,CAEE,kBAAC,UAAD;CACE,MAAK;CACL,cAAW;CACX,WAAU;CACV,SAAS;CACT,CAAA,EAGF,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,OAAD;EAAK,WAAU;YAAf;GAEE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD,EAAc,WAAU,4BAA6B,CAAA;MACrD,kBAAC,MAAD;OAAI,WAAU;iBAA0C;OAAkB,CAAA;MACzE,IAAY,KACX,kBAAC,QAAD;OAAM,WAAU;iBACb;OACI,CAAA;MAEL;QACN,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,cAAW;KACX,WAAU;eAEV,kBAAC,GAAD,EAAG,WAAU,UAAW,CAAA;KACjB,CAAA,CACL;;GAGN,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAU,WAAW,IACpB,kBAAC,UAAD;KACE,cAAW;KACX,WAAU;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/CartDrawer.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { X, ShoppingCart, Trash2, Plus, Minus } from 'lucide-react';\nimport { formatPrice } from '../../utils';\n\n/**\n * Props for CartDrawer\n */\ninterface CartDrawerProps {\n isOpen: boolean;\n onClose: () => void;\n onCheckout: () => void;\n cartItems: Array<{\n id: string;\n quantity: number;\n subtotal: number;\n productName?: string;\n productIcon?: string;\n variantName?: string;\n product?: { icon?: string; name?: string };\n }>;\n itemCount: number;\n subtotal: number;\n tax: number;\n total: number;\n updateQuantity: (cartItemId: string, quantity: number) => Promise<void>;\n removeProduct: (cartItemId: string) => Promise<void>;\n}\n\n/**\n * CartDrawer component\n *\n * Sliding drawer for cart management\n */\nexport const CartDrawer: FC<CartDrawerProps> = ({\n isOpen,\n onClose,\n onCheckout,\n cartItems,\n itemCount,\n subtotal,\n tax,\n total,\n updateQuantity,\n removeProduct,\n}) => {\n if (!isOpen) return null;\n\n return (\n <>\n {/* Backdrop */}\n <button\n type=\"button\"\n aria-label=\"Close cart\"\n className=\"fixed inset-0 z-40 bg-bg-overlay/50 transition-opacity\"\n onClick={onClose}\n />\n\n {/* Drawer */}\n <div className=\"fixed right-0 top-0 z-50 size-full sm:max-w-md bg-bg-surface shadow-xl\">\n <div className=\"flex h-full flex-col\">\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-border-seam px-4 sm:px-6 py-4\">\n <div className=\"flex items-center gap-2\">\n <ShoppingCart className=\"size-5 text-text-primary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">Shopping Cart</h2>\n {itemCount > 0 && (\n <span className=\"rounded-full bg-bg-accent px-2 py-0.5 text-xs font-medium tabular-nums text-text-link\">\n {itemCount}\n </span>\n )}\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close cart\"\n className=\"cursor-pointer rounded-lg p-2 text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Cart Items */}\n <div className=\"flex-1 overflow-y-auto px-4 sm:px-6 py-4\">\n {cartItems.length === 0 ? (\n <output\n aria-label=\"Your cart is empty\"\n className=\"flex h-full flex-col items-center justify-center text-center\"\n >\n <ShoppingCart className=\"mb-4 size-16 text-text-muted\" aria-hidden=\"true\" />\n <h3 className=\"mb-2 text-lg font-semibold text-text-primary\">Your cart is empty</h3>\n <p className=\"text-sm text-text-muted\">Start shopping to add items to your cart</p>\n </output>\n ) : (\n <div className=\"space-y-4\">\n {cartItems.map((item) => (\n <div\n key={item.id}\n className=\"flex gap-4 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 >\n {/* Product Image */}\n <div className=\"size-20 flex-shrink-0 overflow-hidden rounded bg-bg-sunken\">\n {item.productIcon || item.product?.icon ? (\n <img\n src={item.productIcon || item.product?.icon}\n alt={item.productName || item.product?.name}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"flex size-full items-center justify-center\">\n <ShoppingCart className=\"size-8 text-text-muted\" />\n </div>\n )}\n </div>\n\n {/* Product Info */}\n <div className=\"flex flex-1 flex-col\">\n <h4 className=\"mb-1 font-semibold text-text-primary\">\n {item.productName || item.product?.name || 'Product'}\n </h4>\n {item.variantName && (\n <p className=\"mb-2 text-xs text-text-muted\">{item.variantName}</p>\n )}\n\n {/* Quantity Controls */}\n <div className=\"flex items-center gap-3\">\n <div className=\"flex items-center rounded border border-border-default\">\n <button\n type=\"button\"\n onClick={() => updateQuantity(item.id, item.quantity - 1)}\n aria-label={`Decrease quantity of ${item.productName || item.product?.name || 'item'}`}\n className=\"cursor-pointer p-1.5 transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n disabled={item.quantity <= 1}\n >\n <Minus className=\"size-4\" aria-hidden=\"true\" />\n </button>\n <span\n className=\"min-w-[2rem] text-center text-sm font-medium\"\n aria-label={`Quantity: ${item.quantity}`}\n >\n {item.quantity}\n </span>\n <button\n type=\"button\"\n onClick={() => updateQuantity(item.id, item.quantity + 1)}\n aria-label={`Increase quantity of ${item.productName || item.product?.name || 'item'}`}\n className=\"cursor-pointer p-1.5 transition-colors hover:bg-bg-sunken\"\n >\n <Plus className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <button\n type=\"button\"\n onClick={() => removeProduct(item.id)}\n aria-label={`Remove ${item.productName || item.product?.name || 'item'} from cart`}\n className=\"cursor-pointer ml-auto text-status-error-text transition-colors hover:text-status-error-text-emphasis\"\n >\n <Trash2 className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </div>\n\n {/* Price */}\n <div className=\"mt-2 text-right\">\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {formatPrice(item.subtotal)}\n </span>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer with Summary */}\n {cartItems.length > 0 && (\n <div className=\"border-t border-border-seam bg-accent-wash px-4 sm:px-6 py-4\">\n <div className=\"space-y-2\">\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-text-muted\">Subtotal</span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatPrice(subtotal)}\n </span>\n </div>\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-text-muted\">Tax</span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatPrice(tax)}\n </span>\n </div>\n <div className=\"flex justify-between border-t border-border-seam pt-2\">\n <span className=\"font-semibold text-text-primary\">Total</span>\n <span className=\"text-lg font-bold tabular-nums text-text-primary\">\n {formatPrice(total)}\n </span>\n </div>\n </div>\n\n <button\n type=\"button\"\n onClick={onCheckout}\n className=\"cursor-pointer mt-4 w-full rounded-lg bg-action-primary-bg py-3 font-bold text-action-primary-text shadow-elevation-1 transition-[opacity,box-shadow] hover:opacity-90 hover:shadow-[var(--shadow-pop)]\"\n >\n Proceed to Checkout\n </button>\n </div>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;AAiCA,IAAa,KAAmC,EA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AU;eAAf;MACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD;QAAM,WAAU;kBAAkB;QAAe,CAAA,EACjD,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAY,EAAS;QACjB,CAAA,CACH;;MACN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD;QAAM,WAAU;kBAAkB;QAAU,CAAA,EAC5C,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAY,EAAI;QACZ,CAAA,CACH;;MACN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD;QAAM,WAAU;kBAAkC;QAAY,CAAA,EAC9D,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAY,EAAM;QACd,CAAA,CACH;;MACF;QAEN,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eACX;KAEQ,CAAA,CACL;;GAEJ;;CACF,CAAA,CACL,EAAA,CAAA,GApKe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brand as e, isBranded as t } from "./utils.js";
|
|
2
|
-
//#region
|
|
2
|
+
//#region node_modules/@apollo/client/errors/CombinedGraphQLErrors.js
|
|
3
3
|
function n(e) {
|
|
4
4
|
return e.filter((e) => e).map((e) => e.message || "Error message not found.").join("\n");
|
|
5
5
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CombinedGraphQLErrors.js","names":[],"sources":["../../../../../node_modules/@apollo/client/errors/CombinedGraphQLErrors.js"],"sourcesContent":["import { brand, isBranded } from \"./utils.js\";\nfunction defaultFormatMessage(errors) {\n return (errors\n // Handle non-spec-compliant servers: See #1185\n .filter((e) => e)\n .map((e) => e.message || \"Error message not found.\")\n .join(\"\\n\"));\n}\n/**\n * Represents the combined list of GraphQL errors returned from the server in a\n * GraphQL response. This error type is used when your GraphQL operation returns\n * errors in the `errors` field of the response.\n *\n * @remarks\n *\n * When your GraphQL operation encounters errors on the server side (such as\n * resolver errors, validation errors, or syntax errors), the server returns\n * these errors in the `errors` array of the GraphQL response. Apollo Client\n * wraps these errors in a `CombinedGraphQLErrors` object, which provides access\n * to the individual errors while maintaining additional context about the\n * response.\n *\n * @example\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedGraphQLErrors object\n * if (CombinedGraphQLErrors.is(error)) {\n * // Access individual GraphQL errors\n * error.errors.forEach((graphQLError) => {\n * console.log(graphQLError.message);\n * console.log(graphQLError.path);\n * console.log(graphQLError.locations);\n * });\n *\n * // Access the original GraphQL result\n * console.log(error.result);\n * }\n * ```\n */\nexport class CombinedGraphQLErrors extends Error {\n /**\n * A method that determines whether an error is a `CombinedGraphQLErrors`\n * object. This method enables TypeScript to narrow the error type.\n * \n * @example\n * \n * ```ts\n * if (CombinedGraphQLErrors.is(error)) {\n * // TypeScript now knows `error` is a `CombinedGraphQLErrors` object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error) {\n return isBranded(error, \"CombinedGraphQLErrors\");\n }\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n * \n * @remarks\n * \n * The `formatMessage` function is called by the `CombinedGraphQLErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedGraphQLErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n * \n * @param errors - The array of GraphQL errors returned from the server in\n * the `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n static formatMessage = defaultFormatMessage;\n /**\n * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.\n */\n errors;\n /**\n * Partial data returned in the `data` field of the GraphQL response.\n */\n data;\n /**\n * Extensions returned by the `extensions` field in the GraphQL response.\n */\n extensions;\n constructor(result, errors = result.errors || []) {\n super(CombinedGraphQLErrors.formatMessage(errors, {\n result,\n defaultFormatMessage,\n }));\n this.errors = errors;\n this.data = result.data;\n this.extensions = result.extensions;\n this.name = \"CombinedGraphQLErrors\";\n brand(this);\n Object.setPrototypeOf(this, CombinedGraphQLErrors.prototype);\n }\n}\n//# sourceMappingURL=CombinedGraphQLErrors.js.map\n"],"x_google_ignoreList":[0],"mappings":";;AACA,SAAS,EAAqB,GAAQ;AAClC,QAAQ,EAEH,QAAQ,MAAM,EAAE,CAChB,KAAK,MAAM,EAAE,WAAW,2BAA2B,CACnD,KAAK,KAAK;;AAmCnB,IAAa,IAAb,MAAa,UAA8B,MAAM;CAc7C,OAAO,GAAG,GAAO;AACb,SAAO,EAAU,GAAO,wBAAwB;;CAkBpD,OAAO,gBAAgB;CAIvB;CAIA;CAIA;CACA,YAAY,GAAQ,IAAS,EAAO,UAAU,EAAE,EAAE;AAU9C,EATA,MAAM,EAAsB,cAAc,GAAQ;GAC9C;GACA;GACH,CAAC,CAAC,EACH,KAAK,SAAS,GACd,KAAK,OAAO,EAAO,MACnB,KAAK,aAAa,EAAO,YACzB,KAAK,OAAO,yBACZ,EAAM,KAAK,EACX,OAAO,eAAe,MAAM,EAAsB,UAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region node_modules/@apollo/client/errors/utils.js
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
return typeof e == "object" && !!e && e[Symbol.for("apollo.error")] === t;
|
|
4
4
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../../../node_modules/@apollo/client/errors/utils.js"],"sourcesContent":["export function isBranded(error, name) {\n return (typeof error === \"object\" &&\n error !== null &&\n error[Symbol.for(\"apollo.error\")] === name);\n}\nexport function brand(error) {\n Object.defineProperty(error, Symbol.for(\"apollo.error\"), {\n value: error.name,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n}\n//# sourceMappingURL=utils.js.map"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAU,GAAO,GAAM;AACnC,QAAQ,OAAO,KAAU,cACrB,KACA,EAAM,OAAO,IAAI,eAAe,MAAM;;AAE9C,SAAgB,EAAM,GAAO;AACzB,QAAO,eAAe,GAAO,OAAO,IAAI,eAAe,EAAE;EACrD,OAAO,EAAM;EACb,YAAY;EACZ,UAAU;EACV,cAAc;EACjB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EMPTY as e } from "
|
|
1
|
+
import { EMPTY as e } from "../../../../rxjs/dist/esm5/internal/observable/empty.js";
|
|
2
2
|
import { newInvariantError as t } from "../../utilities/invariant/index.js";
|
|
3
3
|
import { createOperation as n } from "../utils/createOperation.js";
|
|
4
|
-
//#region
|
|
4
|
+
//#region node_modules/@apollo/client/link/core/ApolloLink.js
|
|
5
5
|
var r = class r {
|
|
6
6
|
static empty() {
|
|
7
7
|
return new r(() => e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApolloLink.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/link/core/ApolloLink.js"],"sourcesContent":["import { EMPTY } from \"rxjs\";\nimport { createOperation } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant, newInvariantError, } from \"@apollo/client/utilities/invariant\";\n/**\n * The base class for all links in Apollo Client. A link represents either a\n * self-contained modification to a GraphQL operation or a side effect (such as\n * logging).\n *\n * @remarks\n *\n * Links enable you to customize Apollo Client's request flow by composing\n * together different pieces of functionality into a chain of links. Each\n * link represents a specific capability, such as adding authentication headers,\n * retrying failed requests, batching operations, or sending requests to a\n * GraphQL server.\n *\n * Every link must define a request handler via its constructor or by extending\n * this class and implementing the `request` method.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink } from \"@apollo/client\";\n *\n * const link = new ApolloLink((operation, forward) => {\n * console.log(\"Operation:\", operation.operationName);\n * return forward(operation);\n * });\n * ```\n */\nexport class ApolloLink {\n /**\n * Creates a link that completes immediately and does not emit a result.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.empty();\n * ```\n */\n static empty() {\n return new ApolloLink(() => EMPTY);\n }\n /**\n * Composes multiple links into a single composed link that executes each\n * provided link in serial order.\n *\n * @example\n *\n * ```ts\n * import { from, HttpLink, ApolloLink } from \"@apollo/client\";\n * import { RetryLink } from \"@apollo/client/link/retry\";\n * import MyAuthLink from \"../auth\";\n *\n * const link = ApolloLink.from([\n * new RetryLink(),\n * new MyAuthLink(),\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" }),\n * ]);\n * ```\n *\n * @param links - An array of `ApolloLink` instances or request handlers that\n * are executed in serial order.\n */\n static from(links) {\n if (links.length === 0)\n return ApolloLink.empty();\n const [first, ...rest] = links;\n return first.concat(...rest);\n }\n /**\n * Creates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const link = ApolloLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n static split(test, left, right = new ApolloLink((op, forward) => forward(op))) {\n const link = new ApolloLink((operation, forward) => {\n const result = test(operation);\n if (__DEV__) {\n if (typeof result !== \"boolean\") {\n __DEV__ && invariant.warn(63, result);\n }\n }\n return result ?\n left.request(operation, forward)\n : right.request(operation, forward);\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Executes a GraphQL request against a link. The `execute` function begins\n * the request by calling the request handler of the link.\n *\n * @example\n *\n * ```ts\n * const observable = ApolloLink.execute(link, { query, variables }, { client });\n *\n * observable.subscribe({\n * next(value) {\n * console.log(\"Received\", value);\n * },\n * error(error) {\n * console.error(\"Oops got error\", error);\n * },\n * complete() {\n * console.log(\"Request complete\");\n * },\n * });\n * ```\n *\n * @param link - The `ApolloLink` instance to execute the request.\n *\n * @param request - The GraphQL request details, such as the `query` and\n * `variables`.\n *\n * @param context - The execution context for the request, such as the\n * `client` making the request.\n */\n static execute(link, request, context) {\n return link.request(createOperation(request, context), () => {\n if (__DEV__) {\n __DEV__ && invariant.warn(64);\n }\n return EMPTY;\n });\n }\n /**\n * Combines multiple links into a single composed link.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);\n * ```\n *\n * @param links - The links to concatenate into a single link. Each link will\n * execute in serial order.\n *\n * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be\n * removed in a future major version.\n */\n static concat(...links) {\n return ApolloLink.from(links);\n }\n constructor(request) {\n if (request)\n this.request = request;\n }\n /**\n * Concatenates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n split(test, left, right) {\n return this.concat(ApolloLink.split(test, left, right));\n }\n /**\n * Combines the link with other links into a single composed link.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.concat(\n * link1,\n * link2,\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" })\n * );\n * ```\n */\n concat(...links) {\n if (links.length === 0) {\n return this;\n }\n return links.reduce(this.combine.bind(this), this);\n }\n combine(left, right) {\n const link = new ApolloLink((operation, forward) => {\n return left.request(operation, (op) => right.request(op, forward));\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Runs the request handler for the provided operation.\n *\n * > [!NOTE]\n * > This is called by the `ApolloLink.execute` function for you and should\n * > not be called directly. Prefer using `ApolloLink.execute` to make the\n * > request instead.\n */\n request(operation, forward) {\n throw newInvariantError(65);\n }\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n left;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n right;\n}\n//# sourceMappingURL=ApolloLink.js.map\n"],"x_google_ignoreList":[0],"mappings":";;;;AA+BA,IAAa,IAAb,MAAa,EAAW;CAUpB,OAAO,QAAQ;AACX,SAAO,IAAI,QAAiB,EAAM;;CAuBtC,OAAO,KAAK,GAAO;AACf,MAAI,EAAM,WAAW,EACjB,QAAO,EAAW,OAAO;EAC7B,IAAM,CAAC,GAAO,GAAG,KAAQ;AACzB,SAAO,EAAM,OAAO,GAAG,EAAK;;CA4BhC,OAAO,MAAM,GAAM,GAAM,IAAQ,IAAI,GAAY,GAAI,MAAY,EAAQ,EAAG,CAAC,EAAE;EAC3E,IAAM,IAAO,IAAI,GAAY,GAAW,MACrB,EAAK,EAAU,GAO1B,EAAK,QAAQ,GAAW,EAAQ,GAC9B,EAAM,QAAQ,GAAW,EAAQ,CACzC;AACF,SAAO,OAAO,OAAO,GAAM;GAAE;GAAM;GAAO,CAAC;;CAgC/C,OAAO,QAAQ,GAAM,GAAS,GAAS;AACnC,SAAO,EAAK,QAAQ,EAAgB,GAAS,EAAQ,QAI1C,EACT;;CAiBN,OAAO,OAAO,GAAG,GAAO;AACpB,SAAO,EAAW,KAAK,EAAM;;CAEjC,YAAY,GAAS;AACjB,EAAI,MACA,KAAK,UAAU;;CAkCvB,MAAM,GAAM,GAAM,GAAO;AACrB,SAAO,KAAK,OAAO,EAAW,MAAM,GAAM,GAAM,EAAM,CAAC;;CAuB3D,OAAO,GAAG,GAAO;AAIb,SAHI,EAAM,WAAW,IACV,OAEJ,EAAM,OAAO,KAAK,QAAQ,KAAK,KAAK,EAAE,KAAK;;CAEtD,QAAQ,GAAM,GAAO;EACjB,IAAM,IAAO,IAAI,GAAY,GAAW,MAC7B,EAAK,QAAQ,IAAY,MAAO,EAAM,QAAQ,GAAI,EAAQ,CAAC,CACpE;AACF,SAAO,OAAO,OAAO,GAAM;GAAE;GAAM;GAAO,CAAC;;CAU/C,QAAQ,GAAW,GAAS;AACxB,QAAM,EAAkB,GAAG;;CAQ/B;CAOA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Observable as e } from "
|
|
1
|
+
import { Observable as e } from "../../../../rxjs/dist/esm5/internal/Observable.js";
|
|
2
2
|
import { CombinedGraphQLErrors as t } from "../../errors/CombinedGraphQLErrors.js";
|
|
3
3
|
import { isNonNullObject as n } from "../../utilities/internal/isNonNullObject.js";
|
|
4
4
|
import { ApolloLink as r } from "../core/ApolloLink.js";
|
|
5
5
|
import { print as i } from "../../utilities/graphql/print.js";
|
|
6
|
-
//#region
|
|
6
|
+
//#region node_modules/@apollo/client/link/subscriptions/index.js
|
|
7
7
|
function a(e) {
|
|
8
8
|
return n(e) && "code" in e && "reason" in e;
|
|
9
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/link/subscriptions/index.js"],"sourcesContent":["// This file is adapted from the graphql-ws npm package:\n// https://github.com/enisdenjo/graphql-ws\n//\n// Most of the file comes from that package's README; some other parts (such as\n// isLikeCloseEvent) come from its source.\n//\n// Here's the license of the original code:\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2020-2021 Denis Badurina\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport { Observable } from \"rxjs\";\nimport { CombinedGraphQLErrors } from \"@apollo/client/errors\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { print } from \"@apollo/client/utilities\";\nimport { isNonNullObject } from \"@apollo/client/utilities/internal\";\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event\nfunction isLikeCloseEvent(val) {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event\nfunction isLikeErrorEvent(err) {\n return isNonNullObject(err) && err.target?.readyState === WebSocket.CLOSED;\n}\n/**\n * The `GraphQLWsLink` is a terminating link sends GraphQL operations over a\n * WebSocket connection using the [`graphql-ws`](https://www.npmjs.com/package/graphql-ws) library. It's used most\n * commonly with GraphQL [subscriptions](https://apollographql.com/docs/react/data/subscriptions/),\n *\n * > [!NOTE]\n * > This link works with the `graphql-ws` library. If your server uses\n * > the deprecated `subscriptions-transport-ws` library, use the deprecated\n * > [`WebSocketLink`](https://apollographql.com/docs/react/api/link/apollo-link-ws) link instead.\n *\n * @example\n *\n * ```ts\n * import { GraphQLWsLink } from \"@apollo/client/link/subscriptions\";\n * import { createClient } from \"graphql-ws\";\n *\n * const link = new GraphQLWsLink(\n * createClient({\n * url: \"ws://localhost:3000/subscriptions\",\n * })\n * );\n * ```\n */\nexport class GraphQLWsLink extends ApolloLink {\n client;\n constructor(client) {\n super();\n this.client = client;\n }\n request(operation) {\n return new Observable((observer) => {\n const { query, variables, operationName, extensions } = operation;\n return this.client.subscribe({ variables, operationName, extensions, query: print(query) }, {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: (err) => {\n if (err instanceof Error) {\n return observer.error(err);\n }\n const likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(\n // reason will be available on clean closes\n new Error(`Socket closed${likeClose ? ` with event ${err.code}` : \"\"}${likeClose ? ` ${err.reason}` : \"\"}`));\n }\n return observer.error(new CombinedGraphQLErrors({\n errors: Array.isArray(err) ? err : [err],\n }));\n },\n // casting around a wrong type in graphql-ws, which incorrectly expects `Sink<ExecutionResult>`\n });\n });\n }\n}\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AAmCA,SAAS,EAAiB,GAAK;AAC3B,QAAO,EAAgB,EAAI,IAAI,UAAU,KAAO,YAAY;;AAGhE,SAAS,EAAiB,GAAK;AAC3B,QAAO,EAAgB,EAAI,IAAI,EAAI,QAAQ,eAAe,UAAU;;AAyBxE,IAAa,IAAb,cAAmC,EAAW;CAC1C;CACA,YAAY,GAAQ;AAEhB,EADA,OAAO,EACP,KAAK,SAAS;;CAElB,QAAQ,GAAW;AACf,SAAO,IAAI,GAAY,MAAa;GAChC,IAAM,EAAE,UAAO,cAAW,kBAAe,kBAAe;AACxD,UAAO,KAAK,OAAO,UAAU;IAAE;IAAW;IAAe;IAAY,OAAO,EAAM,EAAM;IAAE,EAAE;IACxF,MAAM,EAAS,KAAK,KAAK,EAAS;IAClC,UAAU,EAAS,SAAS,KAAK,EAAS;IAC1C,QAAQ,MAAQ;AACZ,SAAI,aAAe,MACf,QAAO,EAAS,MAAM,EAAI;KAE9B,IAAM,IAAY,EAAiB,EAAI;AAMvC,YALI,KAAa,EAAiB,EAAI,GAC3B,EAAS,MAEhB,gBAAI,MAAM,gBAAgB,IAAY,eAAe,EAAI,SAAS,KAAK,IAAY,IAAI,EAAI,WAAW,KAAK,CAAC,GAEzG,EAAS,MAAM,IAAI,EAAsB,EAC5C,QAAQ,MAAM,QAAQ,EAAI,GAAG,IAAM,CAAC,EAAI,EAC3C,CAAC,CAAC;;IAGV,CAAC;IACJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getOperationName as e } from "../../utilities/internal/getOperationName.js";
|
|
2
2
|
import { getOperationDefinition as t } from "../../utilities/internal/getOperationDefinition.js";
|
|
3
|
-
//#region
|
|
3
|
+
//#region node_modules/@apollo/client/link/utils/createOperation.js
|
|
4
4
|
function n(n, { client: r }) {
|
|
5
5
|
let i = {
|
|
6
6
|
query: n.query,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOperation.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/link/utils/createOperation.js"],"sourcesContent":["import { getOperationDefinition, getOperationName, } from \"@apollo/client/utilities/internal\";\nexport function createOperation(request, { client }) {\n const operation = {\n query: request.query,\n variables: request.variables || {},\n extensions: request.extensions || {},\n operationName: getOperationName(request.query),\n operationType: getOperationDefinition(request.query).operation,\n };\n let context = { ...request.context };\n const setContext = (next) => {\n if (typeof next === \"function\") {\n context = { ...context, ...next(getContext()) };\n }\n else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => Object.freeze({ ...context });\n Object.defineProperty(operation, \"setContext\", {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, \"getContext\", {\n enumerable: false,\n value: getContext,\n });\n Object.defineProperty(operation, \"client\", {\n enumerable: false,\n value: client,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map"],"x_google_ignoreList":[0],"mappings":";;;AACA,SAAgB,EAAgB,GAAS,EAAE,aAAU;CACjD,IAAM,IAAY;EACd,OAAO,EAAQ;EACf,WAAW,EAAQ,aAAa,EAAE;EAClC,YAAY,EAAQ,cAAc,EAAE;EACpC,eAAe,EAAiB,EAAQ,MAAM;EAC9C,eAAe,EAAuB,EAAQ,MAAM,CAAC;EACxD,EACG,IAAU,EAAE,GAAG,EAAQ,SAAS,EAC9B,KAAc,MAAS;AACzB,EAII,IAJA,OAAO,KAAS,aACN;GAAE,GAAG;GAAS,GAAG,EAAK,GAAY,CAAC;GAAE,GAGrC;GAAE,GAAG;GAAS,GAAG;GAAM;IAGnC,UAAmB,OAAO,OAAO,EAAE,GAAG,GAAS,CAAC;AAatD,QAZA,OAAO,eAAe,GAAW,cAAc;EAC3C,YAAY;EACZ,OAAO;EACV,CAAC,EACF,OAAO,eAAe,GAAW,cAAc;EAC3C,YAAY;EACZ,OAAO;EACV,CAAC,EACF,OAAO,eAAe,GAAW,UAAU;EACvC,YAAY;EACZ,OAAO;EACV,CAAC,EACK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.js","names":["global"],"sources":["../../../../../../node_modules/@apollo/client/utilities/caching/sizes.js"],"sourcesContent":["import { global } from \"@apollo/client/utilities/internal/globals\";\nconst cacheSizeSymbol = Symbol.for(\"apollo.cacheSize\");\n/**\n * The global cache size configuration for Apollo Client.\n *\n * @remarks\n *\n * You can directly modify this object, but any modification will\n * only have an effect on caches that are created after the modification.\n *\n * So for global caches, such as `canonicalStringify` and `print`,\n * you might need to call `.reset` on them, which will essentially re-create them.\n *\n * Alternatively, you can set `globalThis[Symbol.for(\"apollo.cacheSize\")]` before\n * you load the Apollo Client package:\n *\n * @example\n *\n * ```ts\n * globalThis[Symbol.for(\"apollo.cacheSize\")] = {\n * print: 100,\n * } satisfies Partial<CacheSizes>; // the `satisfies` is optional if using TypeScript\n * ```\n */\nexport const cacheSizes = { ...global[cacheSizeSymbol] };\n//# sourceMappingURL=sizes.js.map"],"x_google_ignoreList":[0],"mappings":";AAwBA,IAAa,IAAa,EAAE,GAAGA,EAvBP,OAAO,IAAI,mBAAmB,GAuBE"}
|
|
@@ -2,7 +2,7 @@ import { cacheSizes as e } from "../caching/sizes.js";
|
|
|
2
2
|
import { AutoCleanedWeakCache as t } from "../internal/caches.js";
|
|
3
3
|
import "../internal/getMemoryInternals.js";
|
|
4
4
|
import { print as n } from "graphql";
|
|
5
|
-
//#region
|
|
5
|
+
//#region node_modules/@apollo/client/utilities/graphql/print.js
|
|
6
6
|
var r, i = Object.assign((e) => {
|
|
7
7
|
let t = r.get(e);
|
|
8
8
|
return t || (t = n(e), r.set(e, t)), t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print.js","names":["print","origPrint"],"sources":["../../../../../../node_modules/@apollo/client/utilities/graphql/print.js"],"sourcesContent":["import { print as origPrint } from \"graphql\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { AutoCleanedWeakCache, registerGlobalCache, } from \"@apollo/client/utilities/internal\";\nimport { cacheSizes } from \"../caching/index.js\";\nlet printCache;\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n *\n * @remarks This is the same function as the GraphQL.js `print` function but\n * with an added cache to avoid recomputation when encountering the same\n * `ASTNode` more than once.\n */\nexport const print = Object.assign((ast) => {\n let result = printCache.get(ast);\n if (!result) {\n result = origPrint(ast);\n printCache.set(ast, result);\n }\n return result;\n}, {\n reset() {\n printCache = new AutoCleanedWeakCache(cacheSizes.print || 2000 /* defaultCacheSizes.print */);\n },\n});\nprint.reset();\nif (__DEV__) {\n registerGlobalCache(\"print\", () => (printCache ? printCache.size : 0));\n}\n//# sourceMappingURL=print.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAIA,IAAI,GASSA,IAAQ,OAAO,QAAQ,MAAQ;CACxC,IAAI,IAAS,EAAW,IAAI,EAAI;AAKhC,QAJK,MACD,IAASC,EAAU,EAAI,EACvB,EAAW,IAAI,GAAK,EAAO,GAExB;GACR,EACC,QAAQ;AACJ,KAAa,IAAI,EAAqB,EAAW,SAAS,IAAmC;GAEpG,CAAC;AACFD,EAAM,OAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WeakCache as e } from "
|
|
2
|
-
//#region
|
|
1
|
+
import { WeakCache as e } from "../../../../@wry/caches/lib/weak.js";
|
|
2
|
+
//#region node_modules/@apollo/client/utilities/internal/caches.js
|
|
3
3
|
var t = /* @__PURE__ */ new WeakSet();
|
|
4
4
|
function n(e) {
|
|
5
5
|
e.size <= (e.max || -1) || t.has(e) || (t.add(e), setTimeout(() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caches.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/caches.js"],"sourcesContent":["import { StrongCache, WeakCache } from \"@wry/caches\";\nconst scheduledCleanup = new WeakSet();\nfunction schedule(cache) {\n if (cache.size <= (cache.max || -1)) {\n return;\n }\n if (!scheduledCleanup.has(cache)) {\n scheduledCleanup.add(cache);\n setTimeout(() => {\n cache.clean();\n scheduledCleanup.delete(cache);\n }, 100);\n }\n}\n/**\n* @internal\n* A version of WeakCache that will auto-schedule a cleanup of the cache when\n* a new item is added and the cache reached maximum size.\n* Throttled to once per 100ms.\n*\n* @privateRemarks\n* Should be used throughout the rest of the codebase instead of WeakCache,\n* with the notable exception of usage in `wrap` from `optimism` - that one\n* already handles cleanup and should remain a `WeakCache`.\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const AutoCleanedWeakCache = function (max, dispose) {\n /*\n Some builds of `WeakCache` are function prototypes, some are classes.\n This library still builds with an ES5 target, so we can't extend the\n real classes.\n Instead, we have to use this workaround until we switch to a newer build\n target.\n */\n const cache = new WeakCache(max, dispose);\n cache.set = function (key, value) {\n const ret = WeakCache.prototype.set.call(this, key, value);\n schedule(this);\n return ret;\n };\n return cache;\n};\n/**\n* @internal\n* A version of StrongCache that will auto-schedule a cleanup of the cache when\n* a new item is added and the cache reached maximum size.\n* Throttled to once per 100ms.\n*\n* @privateRemarks\n* Should be used throughout the rest of the codebase instead of StrongCache,\n* with the notable exception of usage in `wrap` from `optimism` - that one\n* already handles cleanup and should remain a `StrongCache`.\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const AutoCleanedStrongCache = function (max, dispose) {\n /*\n Some builds of `StrongCache` are function prototypes, some are classes.\n This library still builds with an ES5 target, so we can't extend the\n real classes.\n Instead, we have to use this workaround until we switch to a newer build\n target.\n */\n const cache = new StrongCache(max, dispose);\n cache.set = function (key, value) {\n const ret = StrongCache.prototype.set.call(this, key, value);\n schedule(this);\n return ret;\n };\n return cache;\n};\n//# sourceMappingURL=caches.js.map\n"],"x_google_ignoreList":[0],"mappings":";;AACA,IAAM,oBAAmB,IAAI,SAAS;AACtC,SAAS,EAAS,GAAO;AACjB,GAAM,SAAS,EAAM,OAAO,OAG3B,EAAiB,IAAI,EAAM,KAC5B,EAAiB,IAAI,EAAM,EAC3B,iBAAiB;AAEb,EADA,EAAM,OAAO,EACb,EAAiB,OAAO,EAAM;IAC/B,IAAI;;AAgBf,IAAa,IAAuB,SAAU,GAAK,GAAS;CAQxD,IAAM,IAAQ,IAAI,EAAU,GAAK,EAAQ;AAMzC,QALA,EAAM,MAAM,SAAU,GAAK,GAAO;EAC9B,IAAM,IAAM,EAAU,UAAU,IAAI,KAAK,MAAM,GAAK,EAAM;AAE1D,SADA,EAAS,KAAK,EACP;IAEJ"}
|
|
@@ -3,7 +3,7 @@ import { cacheSizes as n } from "../caching/sizes.js";
|
|
|
3
3
|
import { getOperationName as r } from "./getOperationName.js";
|
|
4
4
|
import { memoize as i } from "./memoize.js";
|
|
5
5
|
import { Kind as a, visit as o } from "graphql";
|
|
6
|
-
//#region
|
|
6
|
+
//#region node_modules/@apollo/client/utilities/internal/checkDocument.js
|
|
7
7
|
var s = i((n, i) => {
|
|
8
8
|
e(n && n.kind === "Document", 1);
|
|
9
9
|
let s = n.definitions.filter((e) => e.kind === "OperationDefinition");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkDocument.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/checkDocument.js"],"sourcesContent":["// Checks the document for errors and throws an exception if there is an error.\nimport { Kind, visit } from \"graphql\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant, newInvariantError, } from \"@apollo/client/utilities/invariant\";\nimport { cacheSizes } from \"../caching/sizes.js\";\nimport { getOperationName } from \"./getOperationName.js\";\nimport { memoize } from \"./memoize.js\";\n/**\n* Checks the document for errors and throws an exception if there is an error.\n*\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const checkDocument = memoize((doc, expectedType) => {\n invariant(doc && doc.kind === \"Document\", 1);\n const operations = doc.definitions.filter((d) => d.kind === \"OperationDefinition\");\n if (__DEV__) {\n doc.definitions.forEach((definition) => {\n if (definition.kind !== \"OperationDefinition\" &&\n definition.kind !== \"FragmentDefinition\") {\n throw newInvariantError(2, definition.kind);\n }\n });\n invariant(operations.length <= 1, 3, operations.length);\n }\n if (expectedType) {\n invariant(\n operations.length == 1 && operations[0].operation === expectedType,\n 4,\n expectedType,\n expectedType,\n operations[0].operation\n );\n }\n visit(doc, {\n Field(field, _, __, path) {\n if (field.alias &&\n (field.alias.value === \"__typename\" ||\n field.alias.value.startsWith(\"__ac_\")) &&\n field.alias.value !== field.name.value) {\n // not using `invariant` so path calculation only happens in error case\n let current = doc, fieldPath = [];\n for (const key of path) {\n current = current[key];\n if (current.kind === Kind.FIELD) {\n fieldPath.push(current.alias?.value || current.name.value);\n }\n }\n fieldPath.splice(-1, 1, field.name.value);\n throw newInvariantError(\n 5,\n field.alias.value,\n fieldPath.join(\".\"),\n operations[0].operation,\n getOperationName(doc, \"(anonymous)\")\n );\n }\n },\n });\n}, {\n max: cacheSizes[\"checkDocument\"] || 2000 /* defaultCacheSizes[\"checkDocument\"] */,\n});\n//# sourceMappingURL=checkDocument.js.map\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAcA,IAAa,IAAgB,GAAS,GAAK,MAAiB;AACxD,GAAU,KAAO,EAAI,SAAS,YAAY,EAAE;CAC5C,IAAM,IAAa,EAAI,YAAY,QAAQ,MAAM,EAAE,SAAS,sBAAsB;AAmBlF,CATI,KACA,EACI,EAAW,UAAU,KAAK,EAAW,GAAG,cAAc,GACtD,GACA,GACA,GACA,EAAW,GAAG,UACjB,EAEL,EAAM,GAAK,EACP,MAAM,GAAO,GAAG,GAAI,GAAM;AACtB,MAAI,EAAM,UACL,EAAM,MAAM,UAAU,gBACnB,EAAM,MAAM,MAAM,WAAW,QAAQ,KACzC,EAAM,MAAM,UAAU,EAAM,KAAK,OAAO;GAExC,IAAI,IAAU,GAAK,IAAY,EAAE;AACjC,QAAK,IAAM,KAAO,EAEd,CADA,IAAU,EAAQ,IACd,EAAQ,SAAS,EAAK,SACtB,EAAU,KAAK,EAAQ,OAAO,SAAS,EAAQ,KAAK,MAAM;AAIlE,SADA,EAAU,OAAO,IAAI,GAAG,EAAM,KAAK,MAAM,EACnC,EACF,GACA,EAAM,MAAM,OACZ,EAAU,KAAK,IAAI,EACnB,EAAW,GAAG,WACd,EAAiB,GAAK,cAAc,CACvC;;IAGZ,CAAC;GACH,EACC,KAAK,EAAW,iBAAoB,KACvC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { newInvariantError as e } from "../invariant/index.js";
|
|
2
2
|
import { checkDocument as t } from "./checkDocument.js";
|
|
3
|
-
//#region
|
|
3
|
+
//#region node_modules/@apollo/client/utilities/internal/getMainDefinition.js
|
|
4
4
|
function n(n) {
|
|
5
5
|
t(n);
|
|
6
6
|
let r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMainDefinition.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/getMainDefinition.js"],"sourcesContent":["import { newInvariantError } from \"@apollo/client/utilities/invariant\";\nimport { checkDocument } from \"./checkDocument.js\";\n/**\n * Returns the first operation definition from a GraphQL document. The function\n * prioritizes operation definitions over fragment definitions, which makes it\n * suitable for documents that may contain both. If no operation definition is\n * found, the first fragment definition will be returned. If no definitions are\n * found, an error is thrown.\n *\n * @remarks\n *\n * Use this function when you need to perform more advanced tasks with the main\n * definition AST node. If you want to determine when a document is a specific\n * operation type, prefer the `isQueryOperation`, `isMutationOperation`, and\n * `isSubscriptionOperation` utility functions instead.\n *\n * @param queryDoc - The GraphQL document to extract the definition from\n * @returns The main operation or fragment definition AST node\n *\n * @example\n *\n * ```ts\n * import { gql } from \"@apollo/client\";\n * import { getMainDefinition } from \"@apollo/client/utilities\";\n *\n * const query = gql`\n * query GetUser($id: ID!) {\n * user(id: $id) {\n * name\n * email\n * }\n * }\n * `;\n *\n * const definition = getMainDefinition(query);\n * ```\n *\n * @throws When the document contains no operation or fragment definitions\n */\nexport function getMainDefinition(queryDoc) {\n checkDocument(queryDoc);\n let fragmentDefinition;\n for (let definition of queryDoc.definitions) {\n if (definition.kind === \"OperationDefinition\") {\n return definition;\n }\n if (definition.kind === \"FragmentDefinition\" && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition;\n }\n }\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n throw newInvariantError(12);\n}\n//# sourceMappingURL=getMainDefinition.js.map\n"],"x_google_ignoreList":[0],"mappings":";;;AAuCA,SAAgB,EAAkB,GAAU;AACxC,GAAc,EAAS;CACvB,IAAI;AACJ,MAAK,IAAI,KAAc,EAAS,aAAa;AACzC,MAAI,EAAW,SAAS,sBACpB,QAAO;AAEX,EAAI,EAAW,SAAS,wBAAwB,CAAC,MAG7C,IAAqB;;AAG7B,KAAI,EACA,QAAO;AAEX,OAAM,EAAkB,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMemoryInternals.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/getMemoryInternals.js"],"sourcesContent":["import { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { cacheSizes } from \"../caching/sizes.js\";\nconst globalCaches = {};\nexport function registerGlobalCache(name, getSize) {\n globalCaches[name] = getSize;\n}\n/**\n* For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const getApolloClientMemoryInternals = __DEV__ ?\n _getApolloClientMemoryInternals\n : undefined;\n/**\n* For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const getInMemoryCacheMemoryInternals = __DEV__ ?\n _getInMemoryCacheMemoryInternals\n : undefined;\n/**\n* For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const getApolloCacheMemoryInternals = __DEV__ ?\n _getApolloCacheMemoryInternals\n : undefined;\nfunction getCurrentCacheSizes() {\n // `defaultCacheSizes` is a `const enum` that will be inlined during build, so we have to reconstruct it's shape here\n const defaults = {\n canonicalStringify: 1000 /* defaultCacheSizes[\"canonicalStringify\"] */,\n checkDocument: 2000 /* defaultCacheSizes[\"checkDocument\"] */,\n print: 2000 /* defaultCacheSizes[\"print\"] */,\n \"documentTransform.cache\": 2000 /* defaultCacheSizes[\"documentTransform.cache\"] */,\n \"queryManager.getDocumentInfo\": 2000 /* defaultCacheSizes[\"queryManager.getDocumentInfo\"] */,\n \"PersistedQueryLink.persistedQueryHashes\": 2000 /* defaultCacheSizes[\"PersistedQueryLink.persistedQueryHashes\"] */,\n \"fragmentRegistry.transform\": 2000 /* defaultCacheSizes[\"fragmentRegistry.transform\"] */,\n \"fragmentRegistry.lookup\": 1000 /* defaultCacheSizes[\"fragmentRegistry.lookup\"] */,\n \"fragmentRegistry.findFragmentSpreads\": 4000 /* defaultCacheSizes[\"fragmentRegistry.findFragmentSpreads\"] */,\n \"cache.fragmentQueryDocuments\": 1000 /* defaultCacheSizes[\"cache.fragmentQueryDocuments\"] */,\n \"removeTypenameFromVariables.getVariableDefinitions\": 2000 /* defaultCacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"] */,\n \"inMemoryCache.maybeBroadcastWatch\": 5000 /* defaultCacheSizes[\"inMemoryCache.maybeBroadcastWatch\"] */,\n \"inMemoryCache.executeSelectionSet\": 50000 /* defaultCacheSizes[\"inMemoryCache.executeSelectionSet\"] */,\n \"inMemoryCache.executeSubSelectedArray\": 10000 /* defaultCacheSizes[\"inMemoryCache.executeSubSelectedArray\"] */,\n };\n return Object.fromEntries(Object.entries(defaults).map(([k, v]) => [\n k,\n cacheSizes[k] || v,\n ]));\n}\nfunction _getApolloClientMemoryInternals() {\n if (!__DEV__)\n throw new Error(\"only supported in development mode\");\n return {\n limits: getCurrentCacheSizes(),\n sizes: {\n print: globalCaches.print?.(),\n canonicalStringify: globalCaches.canonicalStringify?.(),\n links: linkInfo(this.link),\n queryManager: {\n getDocumentInfo: this[\"queryManager\"][\"transformCache\"].size,\n documentTransforms: transformInfo(this[\"queryManager\"].documentTransform),\n },\n ...this.cache.getMemoryInternals?.(),\n },\n };\n}\nfunction _getApolloCacheMemoryInternals() {\n return {\n cache: {\n fragmentQueryDocuments: getWrapperInformation(this[\"getFragmentDoc\"]),\n },\n };\n}\nfunction _getInMemoryCacheMemoryInternals() {\n const fragments = this.config.fragments;\n return {\n ..._getApolloCacheMemoryInternals.apply(this),\n addTypenameDocumentTransform: transformInfo(this[\"addTypenameTransform\"]),\n inMemoryCache: {\n executeSelectionSet: getWrapperInformation(this[\"storeReader\"][\"executeSelectionSet\"]),\n executeSubSelectedArray: getWrapperInformation(this[\"storeReader\"][\"executeSubSelectedArray\"]),\n maybeBroadcastWatch: getWrapperInformation(this[\"maybeBroadcastWatch\"]),\n },\n fragmentRegistry: {\n findFragmentSpreads: getWrapperInformation(fragments?.findFragmentSpreads),\n lookup: getWrapperInformation(fragments?.lookup),\n transform: getWrapperInformation(fragments?.transform),\n },\n };\n}\nfunction isWrapper(f) {\n return !!f && \"dirtyKey\" in f;\n}\nfunction getWrapperInformation(f) {\n return isWrapper(f) ? f.size : undefined;\n}\nfunction isDefined(value) {\n return value != null;\n}\nfunction transformInfo(transform) {\n return recurseTransformInfo(transform).map((cache) => ({ cache }));\n}\nfunction recurseTransformInfo(transform) {\n return transform ?\n [\n getWrapperInformation(transform?.[\"performWork\"]),\n ...recurseTransformInfo(transform?.[\"left\"]),\n ...recurseTransformInfo(transform?.[\"right\"]),\n ].filter(isDefined)\n : [];\n}\nfunction linkInfo(link) {\n return link ?\n [\n link?.getMemoryInternals?.(),\n ...linkInfo(link?.left),\n ...linkInfo(link?.right),\n ].filter(isDefined)\n : [];\n}\n//# sourceMappingURL=getMemoryInternals.js.map\n"],"x_google_ignoreList":[0],"mappings":";AAEA,IAAM,IAAe,EAAE;AACvB,SAAgB,EAAoB,GAAM,GAAS;AAC/C,GAAa,KAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { checkDocument as e } from "./checkDocument.js";
|
|
2
|
-
//#region
|
|
2
|
+
//#region node_modules/@apollo/client/utilities/internal/getOperationDefinition.js
|
|
3
3
|
function t(t) {
|
|
4
4
|
return e(t), t.definitions.filter((e) => e.kind === "OperationDefinition")[0];
|
|
5
5
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOperationDefinition.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/getOperationDefinition.js"],"sourcesContent":["import { checkDocument } from \"./checkDocument.js\";\n/**\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport function getOperationDefinition(doc) {\n checkDocument(doc);\n return doc.definitions.filter((definition) => definition.kind === \"OperationDefinition\")[0];\n}\n//# sourceMappingURL=getOperationDefinition.js.map\n"],"x_google_ignoreList":[0],"mappings":";;AAMA,SAAgB,EAAuB,GAAK;AAExC,QADA,EAAc,EAAI,EACX,EAAI,YAAY,QAAQ,MAAe,EAAW,SAAS,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region node_modules/@apollo/client/utilities/internal/getOperationName.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return e.definitions.find((e) => e.kind === "OperationDefinition" && !!e.name)?.name.value ?? t;
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as getOperationName };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=getOperationName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOperationName.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/getOperationName.js"],"sourcesContent":["/**\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport function getOperationName(doc, fallback) {\n return (doc.definitions.find((definition) => definition.kind === \"OperationDefinition\" && !!definition.name)?.name.value ?? fallback);\n}\n//# sourceMappingURL=getOperationName.js.map\n"],"x_google_ignoreList":[0],"mappings":";AAKA,SAAgB,EAAiB,GAAK,GAAU;AAC5C,QAAQ,EAAI,YAAY,MAAM,MAAe,EAAW,SAAS,yBAAyB,CAAC,CAAC,EAAW,KAAK,EAAE,KAAK,SAAS"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { maybe as e } from "./maybe.js";
|
|
2
|
-
//#region
|
|
2
|
+
//#region node_modules/@apollo/client/utilities/internal/globals/global.js
|
|
3
3
|
var t = e(() => globalThis) || e(() => window) || e(() => self) || e(() => global) || e(function() {
|
|
4
4
|
return e.constructor("return this")();
|
|
5
5
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","names":[],"sources":["../../../../../../../node_modules/@apollo/client/utilities/internal/globals/global.js"],"sourcesContent":["import { maybe } from \"./maybe.js\";\nexport default (// We don't expect the Function constructor ever to be invoked at runtime, as\n// long as at least one of globalThis, window, self, or global is defined, so\n// we are under no obligation to make it easy for static analysis tools to\n// detect syntactic usage of the Function constructor. If you think you can\nmaybe(() => globalThis) ||\n maybe(() => window) ||\n maybe(() => self) ||\n maybe(() => global) || // improve your static analysis to detect this obfuscation, think again. This\n// is an arms race you cannot win, at least not in JavaScript.\nmaybe(function () {\n return maybe.constructor(\"return this\")();\n}));\n//# sourceMappingURL=global.js.map\n"],"x_google_ignoreList":[0],"mappings":";;AACA,IAAA,IAIA,QAAY,WAAW,IACnB,QAAY,OAAO,IACnB,QAAY,KAAK,IACjB,QAAY,OAAO,IAEvB,EAAM,WAAY;AACd,QAAO,EAAM,YAAY,cAAc,EAAE;EAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maybe.js","names":[],"sources":["../../../../../../../node_modules/@apollo/client/utilities/internal/globals/maybe.js"],"sourcesContent":["export function maybe(thunk) {\n try {\n return thunk();\n }\n catch { }\n}\n//# sourceMappingURL=maybe.js.map"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAM,GAAO;AACzB,KAAI;AACA,SAAO,GAAO;SAEZ"}
|