@burdenoff/microfe-store 2026.625.5 → 2026.626.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/StoreRoot.js +47 -90
  2. package/dist/StoreRoot.js.map +1 -1
  3. package/dist/StoreRoutes.js +93 -158
  4. package/dist/StoreRoutes.js.map +1 -1
  5. package/dist/components/AccessDenied.js +3 -3
  6. package/dist/components/AccessDenied.js.map +1 -1
  7. package/dist/components/InstallAppModal.js +175 -255
  8. package/dist/components/InstallAppModal.js.map +1 -1
  9. package/dist/components/cart/CartDrawer.js +10 -10
  10. package/dist/components/cart/CartDrawer.js.map +1 -1
  11. package/dist/hooks/useStoreGraphQL.js +107 -177
  12. package/dist/hooks/useStoreGraphQL.js.map +1 -1
  13. package/dist/index.js +3 -3
  14. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/errors/CombinedGraphQLErrors.js +1 -1
  15. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -0
  16. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/errors/utils.js +1 -1
  17. package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -0
  18. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/link/core/ApolloLink.js +2 -2
  19. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
  20. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/link/subscriptions/index.js +2 -2
  21. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -0
  22. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/link/utils/createOperation.js +1 -1
  23. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
  24. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
  25. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/graphql/print.js +1 -1
  26. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
  27. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/caches.js +2 -2
  28. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -0
  29. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/checkDocument.js +1 -1
  30. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -0
  31. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/getMainDefinition.js +1 -1
  32. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -0
  33. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +9 -0
  34. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -0
  35. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/getOperationDefinition.js +1 -1
  36. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -0
  37. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +8 -0
  38. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -0
  39. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/globals/global.js +1 -1
  40. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -0
  41. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +10 -0
  42. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -0
  43. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +8 -0
  44. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -0
  45. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/makeUniqueId.js +1 -1
  46. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -0
  47. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/memoize.js +2 -2
  48. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -0
  49. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/internal/stringifyForDisplay.js +1 -1
  50. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -0
  51. package/dist/node_modules/{.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo → @apollo}/client/utilities/invariant/index.js +1 -1
  52. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -0
  53. package/dist/node_modules/@apollo/client/version.js +6 -0
  54. package/dist/node_modules/@apollo/client/version.js.map +1 -0
  55. package/dist/node_modules/{.bun/@wry_caches@1.0.1/node_modules/@wry → @wry}/caches/lib/weak.js +1 -1
  56. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -0
  57. package/dist/node_modules/{.bun/@wry_trie@0.5.0/node_modules/@wry → @wry}/trie/lib/index.js +1 -1
  58. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -0
  59. package/dist/node_modules/{.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws → graphql-ws}/dist/client.js +1 -1
  60. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -0
  61. package/dist/node_modules/{.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws → graphql-ws}/dist/common-CGW11Fyb.js +1 -1
  62. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -0
  63. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/NotificationFactories.js +1 -1
  64. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -0
  65. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/Observable.js +1 -1
  66. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -0
  67. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/Subscriber.js +2 -2
  68. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
  69. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/Subscription.js +2 -2
  70. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
  71. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/config.js +1 -1
  72. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -0
  73. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/observable/empty.js +1 -1
  74. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -0
  75. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/scheduler/timeoutProvider.js +2 -2
  76. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
  77. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/symbol/observable.js +1 -1
  78. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
  79. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/UnsubscriptionError.js +1 -1
  80. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
  81. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
  82. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
  83. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/createErrorClass.js +1 -1
  84. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
  85. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/errorContext.js +1 -1
  86. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
  87. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +8 -0
  88. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
  89. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
  90. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
  91. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +6 -0
  92. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
  93. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/pipe.js +1 -1
  94. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
  95. package/dist/node_modules/{.bun/rxjs@7.8.2/node_modules/rxjs → rxjs}/dist/esm5/internal/util/reportUnhandledError.js +1 -1
  96. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
  97. package/dist/node_modules/{.bun/tslib@2.8.1 → rxjs}/node_modules/tslib/tslib.es6.js +1 -1
  98. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +1 -0
  99. package/dist/pages/AdminDashboardPage.js +118 -91
  100. package/dist/pages/AdminDashboardPage.js.map +1 -1
  101. package/dist/pages/AdminReviewModerationPage.js +67 -61
  102. package/dist/pages/AdminReviewModerationPage.js.map +1 -1
  103. package/dist/pages/AdminStoresPage.js +424 -371
  104. package/dist/pages/AdminStoresPage.js.map +1 -1
  105. package/dist/pages/AdminSubmissionsQueuePage.js +303 -286
  106. package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -1
  107. package/dist/pages/AppDetailPage.js +172 -135
  108. package/dist/pages/AppDetailPage.js.map +1 -1
  109. package/dist/pages/AppSettingsPage.js +83 -300
  110. package/dist/pages/AppSettingsPage.js.map +1 -1
  111. package/dist/pages/CartPage.js +71 -79
  112. package/dist/pages/CartPage.js.map +1 -1
  113. package/dist/pages/InstalledAppsPage.js +120 -337
  114. package/dist/pages/InstalledAppsPage.js.map +1 -1
  115. package/dist/pages/MarketplaceHomePage.js +196 -205
  116. package/dist/pages/MarketplaceHomePage.js.map +1 -1
  117. package/dist/pages/MyLicensesPage.js +70 -75
  118. package/dist/pages/MyLicensesPage.js.map +1 -1
  119. package/dist/pages/OrderConfirmationPage.js +70 -37
  120. package/dist/pages/OrderConfirmationPage.js.map +1 -1
  121. package/dist/pages/OrdersPage.js +60 -68
  122. package/dist/pages/OrdersPage.js.map +1 -1
  123. package/dist/pages/ProductDetailPage.js +794 -752
  124. package/dist/pages/ProductDetailPage.js.map +1 -1
  125. package/dist/providers/StoreProvider.js +3 -3
  126. package/package.json +2 -2
  127. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
  128. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/errors/utils.js.map +0 -1
  129. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
  130. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
  131. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
  132. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
  133. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
  134. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
  135. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
  136. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
  137. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -9
  138. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
  139. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
  140. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -8
  141. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
  142. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
  143. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -10
  144. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
  145. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -8
  146. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
  147. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
  148. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
  149. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
  150. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
  151. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/version.js +0 -6
  152. package/dist/node_modules/.bun/@apollo_client@4.1.9_e571b0b00fd00a97/node_modules/@apollo/client/version.js.map +0 -1
  153. package/dist/node_modules/.bun/@wry_caches@1.0.1/node_modules/@wry/caches/lib/weak.js.map +0 -1
  154. package/dist/node_modules/.bun/@wry_trie@0.5.0/node_modules/@wry/trie/lib/index.js.map +0 -1
  155. package/dist/node_modules/.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws/dist/client.js.map +0 -1
  156. package/dist/node_modules/.bun/graphql-ws@6.0.8_796ebe57c2b0ffe0/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
  157. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
  158. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
  159. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
  160. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
  161. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
  162. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
  163. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
  164. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
  165. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
  166. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -11
  167. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
  168. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
  169. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
  170. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -8
  171. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
  172. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -8
  173. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
  174. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -6
  175. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
  176. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
  177. package/dist/node_modules/.bun/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
  178. package/dist/node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.js.map +0 -1
  179. package/dist/pages/ProductReviewsPage.js +0 -87
  180. package/dist/pages/ProductReviewsPage.js.map +0 -1
  181. package/dist/pages/PublisherDashboardPage.js +0 -160
  182. package/dist/pages/PublisherDashboardPage.js.map +0 -1
  183. package/dist/pages/PublisherRevenuePage.js +0 -140
  184. package/dist/pages/PublisherRevenuePage.js.map +0 -1
  185. package/dist/pages/PublisherSubmissionsPage.js +0 -179
  186. package/dist/pages/PublisherSubmissionsPage.js.map +0 -1
  187. package/dist/pages/PublisherSubmitPage.js +0 -230
  188. package/dist/pages/PublisherSubmitPage.js.map +0 -1
  189. /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":"useStoreGraphQL.js","names":[],"sources":["../../src/hooks/useStoreGraphQL.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useStore } from '../providers/StoreProvider';\nimport { useStoreGraphQLWithContext } from './useStoreGraphQLWithContext';\nimport {\n BrowseStoreDocument,\n StoreProductDetailsDocument,\n HomeGroupedProductsDocument,\n} from '../generated/global-operations';\nimport { type BrowseStoreInput, type StoreProductDetailsInput } from '../generated/global-types';\n\n// Local type definitions until schema is fully defined\ntype ProductType = 'APP' | 'TEMPLATE' | 'THEME' | 'INTEGRATION' | 'WIDGET' | 'DATASET';\ntype CreateReviewInput = { productId: string; rating: number; title?: string; comment?: string };\ntype UpdateReviewInput = { rating?: number; title?: string; comment?: string };\n\n// Import generated document nodes for operations extracted to .graphql files\nimport {\n FeaturedProductsDocument,\n SearchSuggestionsDocument,\n TrendingSearchesDocument,\n FilterOptionsDocument,\n CategoriesDocument,\n ProductReviewsDocument,\n UserReviewForProductDocument,\n MyEntitlementsDocument,\n CheckEntitlementDocument,\n WorkspaceStoreOrdersDocument,\n MyPublishedProductsDocument,\n DeveloperEarningsDocument,\n CreateReviewDocument,\n UpdateReviewDocument,\n DeleteReviewDocument,\n MarkReviewHelpfulDocument,\n} from '../generated/global-operations';\n\n// ============================================================================\n// Helper to get Apollo Client\n// ============================================================================\n\n/**\n * Hook to get the store Apollo client from the shell's GatewayRoute context.\n * The Store route is wrapped with <GatewayRoute gateway=\"global\"> in the app shell,\n * so useApolloClient() returns the global gateway client.\n */\nfunction useStoreClient() {\n return useApolloClient();\n}\n\n// ============================================================================\n// Type Definitions\n// ============================================================================\n\ninterface StoreProduct {\n id: string;\n name: string;\n slug: string;\n type: string;\n nature: string;\n status: string;\n description?: string;\n pricingModel: string;\n price: number;\n currency: string;\n icon?: string;\n screenshots: string[];\n rating?: number;\n reviewCount: number;\n downloads: number;\n featured: boolean;\n category?: string;\n tags?: string[];\n publishedAt?: string;\n publisher?: {\n id: string;\n name: string;\n isVerified: boolean;\n logoUrl?: string;\n };\n}\n\ninterface BrowseStoreResult {\n products: StoreProduct[];\n totalCount: number;\n hasMore: boolean;\n nextCursor?: string;\n facets?: {\n types: { value: string; count: number }[];\n subTypes: { value: string; count: number }[];\n categories: { value: string; count: number }[];\n pricingModels: { value: string; count: number }[];\n licenses: { value: string; count: number }[];\n priceRange?: { min: number; max: number };\n ratingDistribution?: {\n fiveStars: number;\n fourStars: number;\n threeStars: number;\n twoStars: number;\n oneStar: number;\n };\n };\n}\n\ninterface ProductReview {\n id: string;\n productId: string;\n userId: string;\n rating: number;\n title?: string;\n comment?: string;\n status: string;\n helpful: number;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface ProductCategory {\n id: string;\n name: string;\n slug: string;\n description?: string;\n icon?: string;\n parentId?: string;\n}\n\ninterface SearchSuggestion {\n term: string;\n type: string;\n count: number;\n highlight?: string;\n}\n\ninterface GroupedProducts {\n featured: StoreProduct[];\n mostDownloaded: StoreProduct[];\n recentlyAdded: StoreProduct[];\n freeItems: StoreProduct[];\n}\n\n// GraphQL Query Result Types\ninterface StoreProductDetailsData {\n storeProductDetails?: {\n product: StoreProduct;\n publisher?: {\n id: string;\n name: string;\n isVerified: boolean;\n logoUrl?: string;\n };\n relatedProducts?: StoreProduct[];\n reviews?: ProductReview[];\n } | null;\n}\n\ninterface FilterOptionsData {\n filterOptions?: {\n types: { value: string; count: number }[];\n subTypes: { value: string; count: number }[];\n categories: { value: string; count: number }[];\n pricingModels: { value: string; count: number }[];\n licenses: { value: string; count: number }[];\n priceRange?: { min: number; max: number };\n } | null;\n}\n\ninterface CheckEntitlementData {\n checkEntitlement?: {\n hasAccess: boolean;\n entitlement?: {\n id: string;\n productId: string;\n type: string;\n status: string;\n expiresAt?: string;\n };\n } | null;\n}\n\ninterface DeveloperEarningsData {\n developerEarnings?: {\n totalEarnings: number;\n pendingPayout: number;\n periodEarnings: number;\n currency: string;\n transactions?: Array<{\n id: string;\n amount: number;\n type: string;\n status: string;\n createdAt: string;\n }>;\n } | null;\n}\n\n// ============================================================================\n// Browse & Search Hooks\n// ============================================================================\n\n/**\n * Hook to browse/search store products with filters\n * Uses Apollo Client from context\n */\nexport function useBrowseStore(input: BrowseStoreInput = {}) {\n const client = useStoreClient();\n const [products, setProducts] = useState<StoreProduct[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [hasMore, setHasMore] = useState(false);\n const [facets, setFacets] = useState<BrowseStoreResult['facets']>(undefined);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n // Stringify input to use as stable dependency\n const inputKey = JSON.stringify(input);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ browseStore: BrowseStoreResult }>({\n query: BrowseStoreDocument,\n variables: { input: JSON.parse(inputKey) },\n fetchPolicy: 'network-only',\n });\n setProducts(result.data?.browseStore?.products ?? []);\n setTotalCount(result.data?.browseStore?.totalCount ?? 0);\n setHasMore(result.data?.browseStore?.hasMore ?? false);\n setFacets(result.data?.browseStore?.facets);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, inputKey]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n products,\n totalCount,\n hasMore,\n facets,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to browse/search store products with organization context.\n * Uses organization-aware GraphQL client with automatic headers.\n * Automatically applies defaultCompatibleWith from store context\n * to the filter if not already specified in the input.\n */\nexport function useBrowseStoreWithContext(\n input: BrowseStoreInput = {},\n options?: { skip?: boolean }\n) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const { defaultCompatibleWith } = useStore();\n const [allProducts, setAllProducts] = useState<StoreProduct[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [hasMore, setHasMore] = useState(false);\n const [facets, setFacets] = useState<BrowseStoreResult['facets']>(undefined);\n const [loading, setLoading] = useState(!options?.skip);\n const [error, setError] = useState<Error | null>(null);\n const [currentOffset, setCurrentOffset] = useState(input.pagination?.offset ?? 0);\n\n const skip = options?.skip;\n\n // Merge defaultCompatibleWith into the input filter if not already set\n const mergedInput = useMemo(() => {\n if (!defaultCompatibleWith) return input;\n const merged = { ...input };\n if (merged.filter) {\n merged.filter = { ...merged.filter };\n if (!merged.filter.compatibleWith) {\n merged.filter.compatibleWith = defaultCompatibleWith;\n }\n } else {\n merged.filter = { compatibleWith: defaultCompatibleWith };\n }\n return merged;\n }, [input, defaultCompatibleWith]);\n\n // Stringify only filter/sort/type parts (NOT offset) as stable dependency\n // so changing offset for loadMore doesn't retrigger the effect\n const filterKey = useMemo(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { pagination, ...rest } = mergedInput;\n return JSON.stringify(rest);\n }, [mergedInput]);\n\n const pageLimit = input.pagination?.limit ?? 30;\n\n const fetchData = useCallback(\n async (fetchOffset: number, append: boolean) => {\n if (skip) {\n setLoading(false);\n return;\n }\n setLoading(true);\n setError(null);\n try {\n const queryInput: BrowseStoreInput = {\n ...(JSON.parse(filterKey) as BrowseStoreInput),\n pagination: { ...mergedInput.pagination, limit: pageLimit, offset: fetchOffset },\n };\n\n let result;\n\n if (hasOrganizationContext) {\n // Use organization-aware query\n result = (await queryWithContext({\n query: BrowseStoreDocument,\n variables: { input: queryInput },\n fetchPolicy: 'network-only',\n })) as { data?: { browseStore: BrowseStoreResult } };\n } else {\n // Fallback to global client without organization context\n result = await globalClient.query<{ browseStore: BrowseStoreResult }>({\n query: BrowseStoreDocument,\n variables: { input: queryInput },\n fetchPolicy: 'network-only',\n });\n }\n\n const fetched = result.data?.browseStore?.products ?? [];\n if (append) {\n setAllProducts((prev) => [...prev, ...fetched]);\n } else {\n setAllProducts(fetched);\n }\n setTotalCount(result.data?.browseStore?.totalCount ?? 0);\n setHasMore(result.data?.browseStore?.hasMore ?? false);\n setFacets(result.data?.browseStore?.facets);\n setCurrentOffset(fetchOffset + fetched.length);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n },\n [\n queryWithContext,\n globalClient,\n hasOrganizationContext,\n filterKey,\n skip,\n pageLimit,\n mergedInput.pagination,\n ]\n );\n\n // Re-fetch from offset 0 whenever filters/sort change. fetchData and pagination\n // offset are intentionally read via refs to avoid refetch loops on stable changes.\n const fetchDataRef = useRef(fetchData);\n fetchDataRef.current = fetchData;\n const offsetRef = useRef(input.pagination?.offset ?? 0);\n offsetRef.current = input.pagination?.offset ?? 0;\n useEffect(() => {\n void fetchDataRef.current(offsetRef.current, false);\n }, [filterKey, skip]);\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n void fetchData(currentOffset, true);\n }, [fetchData, hasMore, loading, currentOffset]);\n\n return {\n products: allProducts,\n totalCount,\n hasMore,\n facets,\n loading,\n error,\n refetch: () => fetchData(input.pagination?.offset ?? 0, false),\n loadMore,\n };\n}\n\n/**\n * Lazy hook to browse store on demand\n */\nexport function useLazyBrowseStore() {\n const client = useStoreClient();\n const [products, setProducts] = useState<StoreProduct[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [hasMore, setHasMore] = useState(false);\n const [facets, setFacets] = useState<BrowseStoreResult['facets']>(undefined);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const browseStore = useCallback(\n async (input: BrowseStoreInput = {}) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ browseStore: BrowseStoreResult }>({\n query: BrowseStoreDocument,\n variables: { input },\n fetchPolicy: 'network-only',\n });\n const data = result.data?.browseStore;\n setProducts(data?.products ?? []);\n setTotalCount(data?.totalCount ?? 0);\n setHasMore(data?.hasMore ?? false);\n setFacets(data?.facets);\n return data;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n browseStore,\n products,\n totalCount,\n hasMore,\n facets,\n loading,\n error,\n };\n}\n\n/**\n * Hook to fetch product details for product page\n */\nexport function useStoreProductDetails(input: StoreProductDetailsInput) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const [data, setData] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const shouldSkip = !input.id && !input.slug;\n\n // Stringify input to use as stable dependency (prevents infinite loops)\n const inputKey = JSON.stringify(input);\n\n // Track if fetch has been attempted for this input\n const fetchedRef = useRef<string | null>(null);\n\n const fetchData = useCallback(async () => {\n if (shouldSkip) {\n setLoading(false);\n return;\n }\n\n // Skip if already fetched for this input\n if (fetchedRef.current === inputKey) {\n return;\n }\n fetchedRef.current = inputKey;\n\n setLoading(true);\n setError(null);\n try {\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: StoreProductDetailsDocument,\n variables: { input: JSON.parse(inputKey) },\n fetchPolicy: 'network-only',\n })) as { data?: StoreProductDetailsData })\n : await globalClient.query<StoreProductDetailsData>({\n query: StoreProductDetailsDocument,\n variables: { input: JSON.parse(inputKey) },\n fetchPolicy: 'network-only',\n });\n setData(result.data?.storeProductDetails ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [globalClient, hasOrganizationContext, inputKey, queryWithContext, shouldSkip]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n data,\n loading,\n error,\n refetch: () => {\n fetchedRef.current = null; // Reset to allow refetch\n return fetchData();\n },\n };\n}\n\n/**\n * Lazy hook to fetch product details on demand\n */\nexport function useLazyStoreProductDetails() {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const [data, setData] = useState<unknown>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const getProductDetails = useCallback(\n async (input: StoreProductDetailsInput) => {\n setLoading(true);\n setError(null);\n try {\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: StoreProductDetailsDocument,\n variables: { input },\n })) as { data?: StoreProductDetailsData })\n : await globalClient.query<StoreProductDetailsData>({\n query: StoreProductDetailsDocument,\n variables: { input },\n });\n const details = result.data?.storeProductDetails ?? null;\n setData(details);\n return details;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [globalClient, hasOrganizationContext, queryWithContext]\n );\n\n return {\n getProductDetails,\n data,\n loading,\n error,\n };\n}\n\n/**\n * Hook to fetch grouped products for homepage.\n */\nexport function useHomeGroupedProducts(options?: { skip?: boolean }) {\n const client = useStoreClient();\n const { defaultCompatibleWith } = useStore();\n const [data, setData] = useState<GroupedProducts | null>(null);\n const [loading, setLoading] = useState(!options?.skip);\n const [error, setError] = useState<Error | null>(null);\n\n const skip = options?.skip;\n\n const fetchData = useCallback(async () => {\n if (skip) {\n setLoading(false);\n return;\n }\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ homeGroupedProducts: GroupedProducts }>({\n query: HomeGroupedProductsDocument,\n variables: { compatibleWith: defaultCompatibleWith ?? null },\n fetchPolicy: 'cache-first',\n });\n setData(result.data?.homeGroupedProducts ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, defaultCompatibleWith, skip]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n data,\n featured: data?.featured ?? [],\n mostDownloaded: data?.mostDownloaded ?? [],\n recentlyAdded: data?.recentlyAdded ?? [],\n freeItems: data?.freeItems ?? [],\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch featured products\n */\nexport function useFeaturedProducts(limit?: number) {\n const client = useStoreClient();\n const [products, setProducts] = useState<StoreProduct[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ featuredProducts: StoreProduct[] }>({\n query: FeaturedProductsDocument,\n variables: { limit },\n fetchPolicy: 'cache-first',\n });\n setProducts(result.data?.featuredProducts ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, limit]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n products,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch search suggestions for autocomplete\n */\nexport function useSearchSuggestions(\n query: string,\n options?: { limit?: number; types?: string[] }\n) {\n const client = useStoreClient();\n const [suggestions, setSuggestions] = useState<SearchSuggestion[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const shouldSkip = query.length < 2;\n\n const fetchData = useCallback(async () => {\n if (shouldSkip) {\n setSuggestions([]);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ searchSuggestions: SearchSuggestion[] }>({\n query: SearchSuggestionsDocument,\n variables: { query, limit: options?.limit, types: options?.types },\n fetchPolicy: 'network-only',\n });\n setSuggestions(result.data?.searchSuggestions ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, query, options?.limit, options?.types, shouldSkip]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n suggestions,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Lazy hook to fetch search suggestions on demand\n */\nexport function useLazySearchSuggestions() {\n const client = useStoreClient();\n const [suggestions, setSuggestions] = useState<SearchSuggestion[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const getSuggestions = useCallback(\n async (query: string, options?: { limit?: number; types?: string[] }) => {\n if (query.length < 2) {\n setSuggestions([]);\n return [];\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ searchSuggestions: SearchSuggestion[] }>({\n query: SearchSuggestionsDocument,\n variables: { query, limit: options?.limit, types: options?.types },\n fetchPolicy: 'network-only',\n });\n const data = result.data?.searchSuggestions ?? [];\n setSuggestions(data);\n return data;\n } catch (err) {\n setError(err as Error);\n return [];\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n getSuggestions,\n suggestions,\n loading,\n error,\n };\n}\n\n/**\n * Hook to fetch trending search terms\n */\nexport function useTrendingSearches(options?: { limit?: number; type?: ProductType }) {\n const client = useStoreClient();\n const [terms, setTerms] = useState<string[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ trendingSearches: string[] }>({\n query: TrendingSearchesDocument,\n variables: { limit: options?.limit, type: options?.type },\n fetchPolicy: 'cache-first',\n });\n setTerms(result.data?.trendingSearches ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, options?.limit, options?.type]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n terms,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch filter options for dropdowns\n */\nexport function useFilterOptions(options?: { type?: ProductType; withProducts?: boolean }) {\n const client = useStoreClient();\n const [filterOptions, setFilterOptions] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<FilterOptionsData>({\n query: FilterOptionsDocument,\n variables: { type: options?.type, withProducts: options?.withProducts },\n fetchPolicy: 'cache-first',\n });\n setFilterOptions(result.data?.filterOptions ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, options?.type, options?.withProducts]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n filterOptions,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Category Hooks\n// ============================================================================\n\n/**\n * Hook to fetch all categories\n */\nexport function useCategories() {\n const client = useStoreClient();\n const [categories, setCategories] = useState<ProductCategory[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ categories: ProductCategory[] }>({\n query: CategoriesDocument,\n fetchPolicy: 'cache-first',\n });\n setCategories(result.data?.categories ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n categories,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Review Hooks\n// ============================================================================\n\n/**\n * Hook to fetch reviews for a product\n */\nexport function useProductReviews(productId: string, options?: { status?: string }) {\n const client = useStoreClient();\n const [reviews, setReviews] = useState<ProductReview[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!productId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ productReviews: ProductReview[] }>({\n query: ProductReviewsDocument,\n variables: { productId, status: options?.status },\n fetchPolicy: 'cache-first',\n });\n setReviews(result.data?.productReviews ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, productId, options?.status]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n reviews,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch current user's review for a product\n */\nexport function useUserReviewForProduct(productId: string) {\n const client = useStoreClient();\n const [review, setReview] = useState<ProductReview | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!productId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ userReviewForProduct: ProductReview | null }>({\n query: UserReviewForProductDocument,\n variables: { productId },\n fetchPolicy: 'network-only',\n });\n setReview(result.data?.userReviewForProduct ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, productId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n review,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to create a review\n */\nexport function useCreateReview() {\n const client = useStoreClient();\n const [review, setReview] = useState<ProductReview | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const createReview = useCallback(\n async (input: CreateReviewInput) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ createReview: ProductReview }>({\n mutation: CreateReviewDocument,\n variables: { input },\n });\n const data = result.data?.createReview ?? null;\n setReview(data);\n return data;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n createReview,\n review,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update a review\n */\nexport function useUpdateReview() {\n const client = useStoreClient();\n const [review, setReview] = useState<ProductReview | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const updateReview = useCallback(\n async (id: string, input: UpdateReviewInput) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ updateReview: ProductReview }>({\n mutation: UpdateReviewDocument,\n variables: { id, input },\n });\n const data = result.data?.updateReview ?? null;\n setReview(data);\n return data;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n updateReview,\n review,\n loading,\n error,\n };\n}\n\n/**\n * Hook to delete a review\n */\nexport function useDeleteReview() {\n const client = useStoreClient();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const deleteReview = useCallback(\n async (id: string) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ deleteReview: boolean }>({\n mutation: DeleteReviewDocument,\n variables: { id },\n });\n return result.data?.deleteReview ?? false;\n } catch (err) {\n setError(err as Error);\n return false;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n deleteReview,\n loading,\n error,\n };\n}\n\n/**\n * Hook to mark review as helpful\n */\nexport function useMarkReviewHelpful() {\n const client = useStoreClient();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const markHelpful = useCallback(\n async (id: string) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ markReviewHelpful: { id: string; helpful: number } }>({\n mutation: MarkReviewHelpfulDocument,\n variables: { id },\n });\n return result.data?.markReviewHelpful ?? null;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n markHelpful,\n loading,\n error,\n };\n}\n\n// ============================================================================\n// Entitlement Hooks\n// ============================================================================\n\n/**\n * Hook to fetch current user's entitlements\n */\nexport function useMyEntitlements() {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const PAGE_SIZE = 20;\n const [allEntitlements, setAllEntitlements] = useState<unknown[]>([]);\n const [hasMore, setHasMore] = useState(false);\n const [currentOffset, setCurrentOffset] = useState(0);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(\n async (fetchOffset = 0, append = false) => {\n setLoading(true);\n setError(null);\n try {\n const variables = { limit: PAGE_SIZE, offset: fetchOffset };\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: MyEntitlementsDocument,\n variables,\n fetchPolicy: 'network-only',\n })) as { data?: { myEntitlements: unknown[] } })\n : await globalClient.query<{ myEntitlements: unknown[] }>({\n query: MyEntitlementsDocument,\n variables,\n fetchPolicy: 'network-only',\n });\n const fetched = result.data?.myEntitlements ?? [];\n if (append) {\n setAllEntitlements((prev) => [...prev, ...fetched]);\n } else {\n setAllEntitlements(fetched);\n }\n setHasMore(fetched.length === PAGE_SIZE);\n setCurrentOffset(fetchOffset);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n },\n [globalClient, hasOrganizationContext, queryWithContext]\n );\n\n useEffect(() => {\n fetchData(0);\n }, [fetchData]);\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n fetchData(currentOffset + PAGE_SIZE, true);\n }, [fetchData, hasMore, loading, currentOffset]);\n\n return {\n entitlements: allEntitlements,\n hasMore,\n loading,\n error,\n refetch: () => fetchData(0),\n loadMore,\n };\n}\n\n/**\n * Hook to check entitlement for a product\n */\nexport function useCheckEntitlement(productId: string) {\n const client = useStoreClient();\n const [entitlement, setEntitlement] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!productId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<CheckEntitlementData>({\n query: CheckEntitlementDocument,\n variables: { productId },\n fetchPolicy: 'network-only',\n });\n setEntitlement(result.data?.checkEntitlement ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, productId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n entitlement,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Order Hooks\n// ============================================================================\n\n/**\n * Hook to fetch workspace store orders\n */\nexport function useWorkspaceStoreOrders(\n billingAccountId: string,\n page: number,\n limit: number,\n options?: { status?: string; search?: string }\n) {\n const client = useStoreClient();\n const [orders, setOrders] = useState<unknown[]>([]);\n const [total, setTotal] = useState(0);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!billingAccountId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{\n workspaceStoreOrders: { total: number; orders: unknown[] };\n }>({\n query: WorkspaceStoreOrdersDocument,\n variables: {\n billingAccountId,\n page,\n limit,\n status: options?.status,\n search: options?.search,\n },\n fetchPolicy: 'network-only',\n });\n setOrders(result.data?.workspaceStoreOrders?.orders ?? []);\n setTotal(result.data?.workspaceStoreOrders?.total ?? 0);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, billingAccountId, page, limit, options?.status, options?.search]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n orders,\n total,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Publisher Hooks\n// ============================================================================\n\n/**\n * Hook to fetch publisher's products\n */\nexport function useMyPublishedProducts() {\n const client = useStoreClient();\n const [allProducts, setAllProducts] = useState<StoreProduct[]>([]);\n const [hasMore, setHasMore] = useState(false);\n const [currentOffset, setCurrentOffset] = useState(0);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const PAGE_SIZE = 20;\n\n const fetchData = useCallback(\n async (fetchOffset = 0, append = false) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ publishedProducts: StoreProduct[] }>({\n query: MyPublishedProductsDocument,\n variables: { limit: PAGE_SIZE, offset: fetchOffset },\n fetchPolicy: 'network-only',\n });\n const fetched = result.data?.publishedProducts ?? [];\n if (append) {\n setAllProducts((prev) => [...prev, ...fetched]);\n } else {\n setAllProducts(fetched);\n }\n setHasMore(fetched.length === PAGE_SIZE);\n setCurrentOffset(fetchOffset + fetched.length);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n void fetchData(currentOffset, true);\n }, [fetchData, hasMore, loading, currentOffset]);\n\n useEffect(() => {\n void fetchData(0, false);\n }, [fetchData]);\n\n return {\n products: allProducts,\n hasMore,\n loading,\n error,\n refetch: () => fetchData(0, false),\n loadMore,\n };\n}\n\n/**\n * Hook to fetch developer earnings\n */\nexport function useDeveloperEarnings(options?: {\n period?: string;\n startDate?: string;\n endDate?: string;\n}) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const [earnings, setEarnings] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: DeveloperEarningsDocument,\n variables: { input: options },\n fetchPolicy: 'network-only',\n })) as { data?: DeveloperEarningsData })\n : await globalClient.query<DeveloperEarningsData>({\n query: DeveloperEarningsDocument,\n variables: { input: options },\n fetchPolicy: 'network-only',\n });\n setEarnings(result.data?.developerEarnings ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [globalClient, hasOrganizationContext, options, queryWithContext]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n earnings,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Re-export types for convenience\n// ============================================================================\n\nexport type {\n BrowseStoreInput,\n StoreProductDetailsInput,\n ProductType,\n CreateReviewInput,\n UpdateReviewInput,\n StoreProduct,\n ProductReview,\n ProductCategory,\n SearchSuggestion,\n GroupedProducts,\n BrowseStoreResult,\n};\n"],"mappings":";;;;;;AA6CA,SAAS,IAAiB;AACxB,QAAO,GAAiB;;AA4J1B,SAAgB,EAAe,IAA0B,EAAE,EAAE;CAC3D,IAAM,IAAS,GAAgB,EACzB,CAAC,GAAU,KAAe,EAAyB,EAAE,CAAC,EACtD,CAAC,GAAY,KAAiB,EAAS,EAAE,EACzC,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,GAAQ,KAAa,EAAsC,KAAA,EAAU,EACtE,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAuB,KAAK,EAGhD,IAAW,KAAK,UAAU,EAAM,EAEhC,IAAY,EAAY,YAAY;AAExC,EADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,MAAI;GACF,IAAM,IAAS,MAAM,EAAO,MAA0C;IACpE,OAAO;IACP,WAAW,EAAE,OAAO,KAAK,MAAM,EAAS,EAAE;IAC1C,aAAa;IACd,CAAC;AAIF,GAHA,EAAY,EAAO,MAAM,aAAa,YAAY,EAAE,CAAC,EACrD,EAAc,EAAO,MAAM,aAAa,cAAc,EAAE,EACxD,EAAW,EAAO,MAAM,aAAa,WAAW,GAAM,EACtD,EAAU,EAAO,MAAM,aAAa,OAAO;WACpC,GAAK;AACZ,KAAS,EAAa;YACd;AACR,KAAW,GAAM;;IAElB,CAAC,GAAQ,EAAS,CAAC;AAMtB,QAJA,QAAgB;AACd,KAAW;IACV,CAAC,EAAU,CAAC,EAER;EACL;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACV;;AASH,SAAgB,EACd,IAA0B,EAAE,EAC5B,GACA;CACA,IAAM,EAAE,OAAO,GAAkB,8BAA2B,GAA4B,EAClF,IAAe,GAAiB,EAChC,EAAE,6BAA0B,GAAU,EACtC,CAAC,GAAa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AEK,IAAW,QAAkB;AAC7B,GAAC,KAAW,KACX,EAAU,GAAe,GAAK;IAClC;EAAC;EAAW;EAAS;EAAS;EAAc,CAAC;AAMhD,QAJA,QAAgB;AACT,IAAU,GAAG,GAAM;IACvB,CAAC,EAAU,CAAC,EAER;EACL,UAAU;EACV;EACA;EACA;EACA,eAAe,EAAU,GAAG,GAAM;EAClC;EACD;;AAMH,SAAgB,EAAqB,GAIlC;CACD,IAAM,EAAE,OAAO,GAAkB,8BAA2B,GAA4B,EAClF,IAAe,GAAiB,EAChC,CAAC,GAAU,KAAe,EAAkB,KAAK,EACjD,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAuB,KAAK,EAEhD,IAAY,EAAY,YAAY;AAExC,EADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,MAAI;AAYF,MAXe,IACT,MAAM,EAAiB;IACvB,OAAO;IACP,WAAW,EAAE,OAAO,GAAS;IAC7B,aAAa;IACd,CAAC,GACF,MAAM,EAAa,MAA6B;IAC9C,OAAO;IACP,WAAW,EAAE,OAAO,GAAS;IAC7B,aAAa;IACd,CAAC,EACa,MAAM,qBAAqB,KAAK;WAC5C,GAAK;AACZ,KAAS,EAAa;YACd;AACR,KAAW,GAAM;;IAElB;EAAC;EAAc;EAAwB;EAAS;EAAiB,CAAC;AAMrE,QAJA,QAAgB;AACd,KAAW;IACV,CAAC,EAAU,CAAC,EAER;EACL;EACA;EACA;EACA,SAAS;EACV"}
1
+ {"version":3,"file":"useStoreGraphQL.js","names":[],"sources":["../../src/hooks/useStoreGraphQL.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useStore } from '../providers/StoreProvider';\nimport { useStoreGraphQLWithContext } from './useStoreGraphQLWithContext';\nimport {\n BrowseStoreDocument,\n StoreProductDetailsDocument,\n HomeGroupedProductsDocument,\n} from '../generated/global-operations';\nimport { type BrowseStoreInput, type StoreProductDetailsInput } from '../generated/global-types';\n\n// Local type definitions until schema is fully defined\ntype ProductType = 'APP' | 'TEMPLATE' | 'THEME' | 'INTEGRATION' | 'WIDGET' | 'DATASET';\ntype CreateReviewInput = { productId: string; rating: number; title?: string; comment?: string };\ntype UpdateReviewInput = { rating?: number; title?: string; comment?: string };\n\n// Import generated document nodes for operations extracted to .graphql files\nimport {\n FeaturedProductsDocument,\n SearchSuggestionsDocument,\n TrendingSearchesDocument,\n FilterOptionsDocument,\n CategoriesDocument,\n ProductReviewsDocument,\n UserReviewForProductDocument,\n MyEntitlementsDocument,\n CheckEntitlementDocument,\n WorkspaceStoreOrdersDocument,\n MyPublishedProductsDocument,\n DeveloperEarningsDocument,\n CreateReviewDocument,\n UpdateReviewDocument,\n DeleteReviewDocument,\n MarkReviewHelpfulDocument,\n} from '../generated/global-operations';\n\n// ============================================================================\n// Helper to get Apollo Client\n// ============================================================================\n\n/**\n * Hook to get the store Apollo client from the shell's GatewayRoute context.\n * The Store route is wrapped with <GatewayRoute gateway=\"global\"> in the app shell,\n * so useApolloClient() returns the global gateway client.\n */\nfunction useStoreClient() {\n return useApolloClient();\n}\n\n// ============================================================================\n// Type Definitions\n// ============================================================================\n\ninterface StoreProduct {\n id: string;\n name: string;\n slug: string;\n type: string;\n nature: string;\n status: string;\n description?: string;\n pricingModel: string;\n price: number;\n currency: string;\n icon?: string;\n screenshots: string[];\n rating?: number;\n reviewCount: number;\n downloads: number;\n featured: boolean;\n category?: string;\n tags?: string[];\n publishedAt?: string;\n publisher?: {\n id: string;\n name: string;\n isVerified: boolean;\n logoUrl?: string;\n };\n}\n\ninterface BrowseStoreResult {\n products: StoreProduct[];\n totalCount: number;\n hasMore: boolean;\n nextCursor?: string;\n facets?: {\n types: { value: string; count: number }[];\n subTypes: { value: string; count: number }[];\n categories: { value: string; count: number }[];\n pricingModels: { value: string; count: number }[];\n licenses: { value: string; count: number }[];\n priceRange?: { min: number; max: number };\n ratingDistribution?: {\n fiveStars: number;\n fourStars: number;\n threeStars: number;\n twoStars: number;\n oneStar: number;\n };\n };\n}\n\ninterface ProductReview {\n id: string;\n productId: string;\n userId: string;\n rating: number;\n title?: string;\n comment?: string;\n status: string;\n helpful: number;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface ProductCategory {\n id: string;\n name: string;\n slug: string;\n description?: string;\n icon?: string;\n parentId?: string;\n}\n\ninterface SearchSuggestion {\n term: string;\n type: string;\n count: number;\n highlight?: string;\n}\n\ninterface GroupedProducts {\n featured: StoreProduct[];\n mostDownloaded: StoreProduct[];\n recentlyAdded: StoreProduct[];\n freeItems: StoreProduct[];\n}\n\n// GraphQL Query Result Types\ninterface StoreProductDetailsData {\n storeProductDetails?: {\n product: StoreProduct;\n publisher?: {\n id: string;\n name: string;\n isVerified: boolean;\n logoUrl?: string;\n };\n relatedProducts?: StoreProduct[];\n reviews?: ProductReview[];\n } | null;\n}\n\ninterface FilterOptionsData {\n filterOptions?: {\n types: { value: string; count: number }[];\n subTypes: { value: string; count: number }[];\n categories: { value: string; count: number }[];\n pricingModels: { value: string; count: number }[];\n licenses: { value: string; count: number }[];\n priceRange?: { min: number; max: number };\n } | null;\n}\n\ninterface CheckEntitlementData {\n checkEntitlement?: {\n hasAccess: boolean;\n entitlement?: {\n id: string;\n productId: string;\n type: string;\n status: string;\n expiresAt?: string;\n };\n } | null;\n}\n\ninterface DeveloperEarningsData {\n developerEarnings?: {\n totalEarnings: number;\n pendingPayout: number;\n periodEarnings: number;\n currency: string;\n transactions?: Array<{\n id: string;\n amount: number;\n type: string;\n status: string;\n createdAt: string;\n }>;\n } | null;\n}\n\n// ============================================================================\n// Browse & Search Hooks\n// ============================================================================\n\n/**\n * Hook to browse/search store products with filters\n * Uses Apollo Client from context\n */\nexport function useBrowseStore(input: BrowseStoreInput = {}) {\n const client = useStoreClient();\n const [products, setProducts] = useState<StoreProduct[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [hasMore, setHasMore] = useState(false);\n const [facets, setFacets] = useState<BrowseStoreResult['facets']>(undefined);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n // Stringify input to use as stable dependency\n const inputKey = JSON.stringify(input);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ browseStore: BrowseStoreResult }>({\n query: BrowseStoreDocument,\n variables: { input: JSON.parse(inputKey) },\n fetchPolicy: 'network-only',\n });\n setProducts(result.data?.browseStore?.products ?? []);\n setTotalCount(result.data?.browseStore?.totalCount ?? 0);\n setHasMore(result.data?.browseStore?.hasMore ?? false);\n setFacets(result.data?.browseStore?.facets);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, inputKey]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n products,\n totalCount,\n hasMore,\n facets,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to browse/search store products with organization context.\n * Uses organization-aware GraphQL client with automatic headers.\n * Automatically applies defaultCompatibleWith from store context\n * to the filter if not already specified in the input.\n */\nexport function useBrowseStoreWithContext(\n input: BrowseStoreInput = {},\n options?: { skip?: boolean }\n) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const { defaultCompatibleWith } = useStore();\n const [allProducts, setAllProducts] = useState<StoreProduct[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [hasMore, setHasMore] = useState(false);\n const [facets, setFacets] = useState<BrowseStoreResult['facets']>(undefined);\n const [loading, setLoading] = useState(!options?.skip);\n const [error, setError] = useState<Error | null>(null);\n const [currentOffset, setCurrentOffset] = useState(input.pagination?.offset ?? 0);\n\n const skip = options?.skip;\n\n // Merge defaultCompatibleWith into the input filter if not already set\n const mergedInput = useMemo(() => {\n if (!defaultCompatibleWith) return input;\n const merged = { ...input };\n if (merged.filter) {\n merged.filter = { ...merged.filter };\n if (!merged.filter.compatibleWith) {\n merged.filter.compatibleWith = defaultCompatibleWith;\n }\n } else {\n merged.filter = { compatibleWith: defaultCompatibleWith };\n }\n return merged;\n }, [input, defaultCompatibleWith]);\n\n // Stringify only filter/sort/type parts (NOT offset) as stable dependency\n // so changing offset for loadMore doesn't retrigger the effect\n const filterKey = useMemo(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { pagination, ...rest } = mergedInput;\n return JSON.stringify(rest);\n }, [mergedInput]);\n\n const pageLimit = input.pagination?.limit ?? 30;\n\n const fetchData = useCallback(\n async (fetchOffset: number, append: boolean) => {\n if (skip) {\n setLoading(false);\n return;\n }\n setLoading(true);\n setError(null);\n try {\n const queryInput: BrowseStoreInput = {\n ...(JSON.parse(filterKey) as BrowseStoreInput),\n pagination: { ...mergedInput.pagination, limit: pageLimit, offset: fetchOffset },\n };\n\n let result;\n\n if (hasOrganizationContext) {\n // Use organization-aware query\n result = (await queryWithContext({\n query: BrowseStoreDocument,\n variables: { input: queryInput },\n fetchPolicy: 'network-only',\n })) as { data?: { browseStore: BrowseStoreResult } };\n } else {\n // Fallback to global client without organization context\n result = await globalClient.query<{ browseStore: BrowseStoreResult }>({\n query: BrowseStoreDocument,\n variables: { input: queryInput },\n fetchPolicy: 'network-only',\n });\n }\n\n const fetched = result.data?.browseStore?.products ?? [];\n if (append) {\n setAllProducts((prev) => [...prev, ...fetched]);\n } else {\n setAllProducts(fetched);\n }\n setTotalCount(result.data?.browseStore?.totalCount ?? 0);\n setHasMore(result.data?.browseStore?.hasMore ?? false);\n setFacets(result.data?.browseStore?.facets);\n setCurrentOffset(fetchOffset + fetched.length);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n },\n [\n queryWithContext,\n globalClient,\n hasOrganizationContext,\n filterKey,\n skip,\n pageLimit,\n mergedInput.pagination,\n ]\n );\n\n // Re-fetch from offset 0 whenever filters/sort change. fetchData and pagination\n // offset are intentionally read via refs to avoid refetch loops on stable changes.\n const fetchDataRef = useRef(fetchData);\n fetchDataRef.current = fetchData;\n const offsetRef = useRef(input.pagination?.offset ?? 0);\n offsetRef.current = input.pagination?.offset ?? 0;\n useEffect(() => {\n void fetchDataRef.current(offsetRef.current, false);\n }, [filterKey, skip]);\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n void fetchData(currentOffset, true);\n }, [fetchData, hasMore, loading, currentOffset]);\n\n return {\n products: allProducts,\n totalCount,\n hasMore,\n facets,\n loading,\n error,\n refetch: () => fetchData(input.pagination?.offset ?? 0, false),\n loadMore,\n };\n}\n\n/**\n * Lazy hook to browse store on demand\n */\nexport function useLazyBrowseStore() {\n const client = useStoreClient();\n const [products, setProducts] = useState<StoreProduct[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [hasMore, setHasMore] = useState(false);\n const [facets, setFacets] = useState<BrowseStoreResult['facets']>(undefined);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const browseStore = useCallback(\n async (input: BrowseStoreInput = {}) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ browseStore: BrowseStoreResult }>({\n query: BrowseStoreDocument,\n variables: { input },\n fetchPolicy: 'network-only',\n });\n const data = result.data?.browseStore;\n setProducts(data?.products ?? []);\n setTotalCount(data?.totalCount ?? 0);\n setHasMore(data?.hasMore ?? false);\n setFacets(data?.facets);\n return data;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n browseStore,\n products,\n totalCount,\n hasMore,\n facets,\n loading,\n error,\n };\n}\n\n/**\n * Hook to fetch product details for product page\n */\nexport function useStoreProductDetails(input: StoreProductDetailsInput) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const [data, setData] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const shouldSkip = !input.id && !input.slug;\n\n // Stringify input to use as stable dependency (prevents infinite loops)\n const inputKey = JSON.stringify(input);\n\n // Track if fetch has been attempted for this input\n const fetchedRef = useRef<string | null>(null);\n\n const fetchData = useCallback(async () => {\n if (shouldSkip) {\n setLoading(false);\n return;\n }\n\n // Skip if already fetched for this input\n if (fetchedRef.current === inputKey) {\n return;\n }\n fetchedRef.current = inputKey;\n\n setLoading(true);\n setError(null);\n try {\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: StoreProductDetailsDocument,\n variables: { input: JSON.parse(inputKey) },\n fetchPolicy: 'network-only',\n })) as { data?: StoreProductDetailsData })\n : await globalClient.query<StoreProductDetailsData>({\n query: StoreProductDetailsDocument,\n variables: { input: JSON.parse(inputKey) },\n fetchPolicy: 'network-only',\n });\n setData(result.data?.storeProductDetails ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [globalClient, hasOrganizationContext, inputKey, queryWithContext, shouldSkip]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n data,\n loading,\n error,\n refetch: () => {\n fetchedRef.current = null; // Reset to allow refetch\n return fetchData();\n },\n };\n}\n\n/**\n * Lazy hook to fetch product details on demand\n */\nexport function useLazyStoreProductDetails() {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const [data, setData] = useState<unknown>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const getProductDetails = useCallback(\n async (input: StoreProductDetailsInput) => {\n setLoading(true);\n setError(null);\n try {\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: StoreProductDetailsDocument,\n variables: { input },\n })) as { data?: StoreProductDetailsData })\n : await globalClient.query<StoreProductDetailsData>({\n query: StoreProductDetailsDocument,\n variables: { input },\n });\n const details = result.data?.storeProductDetails ?? null;\n setData(details);\n return details;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [globalClient, hasOrganizationContext, queryWithContext]\n );\n\n return {\n getProductDetails,\n data,\n loading,\n error,\n };\n}\n\n/**\n * Hook to fetch grouped products for homepage.\n */\nexport function useHomeGroupedProducts(options?: { skip?: boolean }) {\n const client = useStoreClient();\n const { defaultCompatibleWith } = useStore();\n const [data, setData] = useState<GroupedProducts | null>(null);\n const [loading, setLoading] = useState(!options?.skip);\n const [error, setError] = useState<Error | null>(null);\n\n const skip = options?.skip;\n\n const fetchData = useCallback(async () => {\n if (skip) {\n setLoading(false);\n return;\n }\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ homeGroupedProducts: GroupedProducts }>({\n query: HomeGroupedProductsDocument,\n variables: { compatibleWith: defaultCompatibleWith ?? null },\n fetchPolicy: 'cache-first',\n });\n setData(result.data?.homeGroupedProducts ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, defaultCompatibleWith, skip]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n data,\n featured: data?.featured ?? [],\n mostDownloaded: data?.mostDownloaded ?? [],\n recentlyAdded: data?.recentlyAdded ?? [],\n freeItems: data?.freeItems ?? [],\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch featured products\n */\nexport function useFeaturedProducts(limit?: number) {\n const client = useStoreClient();\n const [products, setProducts] = useState<StoreProduct[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ featuredProducts: StoreProduct[] }>({\n query: FeaturedProductsDocument,\n variables: { limit },\n fetchPolicy: 'cache-first',\n });\n setProducts(result.data?.featuredProducts ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, limit]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n products,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch search suggestions for autocomplete\n */\nexport function useSearchSuggestions(\n query: string,\n options?: { limit?: number; types?: string[] }\n) {\n const client = useStoreClient();\n const [suggestions, setSuggestions] = useState<SearchSuggestion[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const shouldSkip = query.length < 2;\n\n const fetchData = useCallback(async () => {\n if (shouldSkip) {\n setSuggestions([]);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ searchSuggestions: SearchSuggestion[] }>({\n query: SearchSuggestionsDocument,\n variables: { query, limit: options?.limit, types: options?.types },\n fetchPolicy: 'network-only',\n });\n setSuggestions(result.data?.searchSuggestions ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, query, options?.limit, options?.types, shouldSkip]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n suggestions,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Lazy hook to fetch search suggestions on demand\n */\nexport function useLazySearchSuggestions() {\n const client = useStoreClient();\n const [suggestions, setSuggestions] = useState<SearchSuggestion[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const getSuggestions = useCallback(\n async (query: string, options?: { limit?: number; types?: string[] }) => {\n if (query.length < 2) {\n setSuggestions([]);\n return [];\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ searchSuggestions: SearchSuggestion[] }>({\n query: SearchSuggestionsDocument,\n variables: { query, limit: options?.limit, types: options?.types },\n fetchPolicy: 'network-only',\n });\n const data = result.data?.searchSuggestions ?? [];\n setSuggestions(data);\n return data;\n } catch (err) {\n setError(err as Error);\n return [];\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n getSuggestions,\n suggestions,\n loading,\n error,\n };\n}\n\n/**\n * Hook to fetch trending search terms\n */\nexport function useTrendingSearches(options?: { limit?: number; type?: ProductType }) {\n const client = useStoreClient();\n const [terms, setTerms] = useState<string[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ trendingSearches: string[] }>({\n query: TrendingSearchesDocument,\n variables: { limit: options?.limit, type: options?.type },\n fetchPolicy: 'cache-first',\n });\n setTerms(result.data?.trendingSearches ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, options?.limit, options?.type]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n terms,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch filter options for dropdowns\n */\nexport function useFilterOptions(options?: { type?: ProductType; withProducts?: boolean }) {\n const client = useStoreClient();\n const [filterOptions, setFilterOptions] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<FilterOptionsData>({\n query: FilterOptionsDocument,\n variables: { type: options?.type, withProducts: options?.withProducts },\n fetchPolicy: 'cache-first',\n });\n setFilterOptions(result.data?.filterOptions ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, options?.type, options?.withProducts]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n filterOptions,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Category Hooks\n// ============================================================================\n\n/**\n * Hook to fetch all categories\n */\nexport function useCategories() {\n const client = useStoreClient();\n const [categories, setCategories] = useState<ProductCategory[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ categories: ProductCategory[] }>({\n query: CategoriesDocument,\n fetchPolicy: 'cache-first',\n });\n setCategories(result.data?.categories ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n categories,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Review Hooks\n// ============================================================================\n\n/**\n * Hook to fetch reviews for a product\n */\nexport function useProductReviews(productId: string, options?: { status?: string }) {\n const client = useStoreClient();\n const [reviews, setReviews] = useState<ProductReview[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!productId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ productReviews: ProductReview[] }>({\n query: ProductReviewsDocument,\n variables: { productId, status: options?.status },\n fetchPolicy: 'cache-first',\n });\n setReviews(result.data?.productReviews ?? []);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, productId, options?.status]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n reviews,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to fetch current user's review for a product\n */\nexport function useUserReviewForProduct(productId: string) {\n const client = useStoreClient();\n const [review, setReview] = useState<ProductReview | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!productId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ userReviewForProduct: ProductReview | null }>({\n query: UserReviewForProductDocument,\n variables: { productId },\n fetchPolicy: 'network-only',\n });\n setReview(result.data?.userReviewForProduct ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, productId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n review,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n/**\n * Hook to create a review\n */\nexport function useCreateReview() {\n const client = useStoreClient();\n const [review, setReview] = useState<ProductReview | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const createReview = useCallback(\n async (input: CreateReviewInput) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ createReview: ProductReview }>({\n mutation: CreateReviewDocument,\n variables: { input },\n });\n const data = result.data?.createReview ?? null;\n setReview(data);\n return data;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n createReview,\n review,\n loading,\n error,\n };\n}\n\n/**\n * Hook to update a review\n */\nexport function useUpdateReview() {\n const client = useStoreClient();\n const [review, setReview] = useState<ProductReview | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const updateReview = useCallback(\n async (id: string, input: UpdateReviewInput) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ updateReview: ProductReview }>({\n mutation: UpdateReviewDocument,\n variables: { id, input },\n });\n const data = result.data?.updateReview ?? null;\n setReview(data);\n return data;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n updateReview,\n review,\n loading,\n error,\n };\n}\n\n/**\n * Hook to delete a review\n */\nexport function useDeleteReview() {\n const client = useStoreClient();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const deleteReview = useCallback(\n async (id: string) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ deleteReview: boolean }>({\n mutation: DeleteReviewDocument,\n variables: { id },\n });\n return result.data?.deleteReview ?? false;\n } catch (err) {\n setError(err as Error);\n return false;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n deleteReview,\n loading,\n error,\n };\n}\n\n/**\n * Hook to mark review as helpful\n */\nexport function useMarkReviewHelpful() {\n const client = useStoreClient();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const markHelpful = useCallback(\n async (id: string) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.mutate<{ markReviewHelpful: { id: string; helpful: number } }>({\n mutation: MarkReviewHelpfulDocument,\n variables: { id },\n });\n return result.data?.markReviewHelpful ?? null;\n } catch (err) {\n setError(err as Error);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n return {\n markHelpful,\n loading,\n error,\n };\n}\n\n// ============================================================================\n// Entitlement Hooks\n// ============================================================================\n\n/**\n * Hook to fetch current user's entitlements\n */\nexport function useMyEntitlements() {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const PAGE_SIZE = 20;\n const [allEntitlements, setAllEntitlements] = useState<unknown[]>([]);\n const [hasMore, setHasMore] = useState(false);\n const [currentOffset, setCurrentOffset] = useState(0);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(\n async (fetchOffset = 0, append = false) => {\n setLoading(true);\n setError(null);\n try {\n const variables = { limit: PAGE_SIZE, offset: fetchOffset };\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: MyEntitlementsDocument,\n variables,\n fetchPolicy: 'network-only',\n })) as { data?: { myEntitlements: unknown[] } })\n : await globalClient.query<{ myEntitlements: unknown[] }>({\n query: MyEntitlementsDocument,\n variables,\n fetchPolicy: 'network-only',\n });\n const fetched = result.data?.myEntitlements ?? [];\n if (append) {\n setAllEntitlements((prev) => [...prev, ...fetched]);\n } else {\n setAllEntitlements(fetched);\n }\n setHasMore(fetched.length === PAGE_SIZE);\n setCurrentOffset(fetchOffset);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n },\n [globalClient, hasOrganizationContext, queryWithContext]\n );\n\n useEffect(() => {\n fetchData(0);\n }, [fetchData]);\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n fetchData(currentOffset + PAGE_SIZE, true);\n }, [fetchData, hasMore, loading, currentOffset]);\n\n return {\n entitlements: allEntitlements,\n hasMore,\n loading,\n error,\n refetch: () => fetchData(0),\n loadMore,\n };\n}\n\n/**\n * Hook to check entitlement for a product\n */\nexport function useCheckEntitlement(productId: string) {\n const client = useStoreClient();\n const [entitlement, setEntitlement] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!productId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<CheckEntitlementData>({\n query: CheckEntitlementDocument,\n variables: { productId },\n fetchPolicy: 'network-only',\n });\n setEntitlement(result.data?.checkEntitlement ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, productId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n entitlement,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Order Hooks\n// ============================================================================\n\n/**\n * Hook to fetch workspace store orders\n */\nexport function useWorkspaceStoreOrders(\n billingAccountId: string,\n page: number,\n limit: number,\n options?: { status?: string; search?: string }\n) {\n const client = useStoreClient();\n const [orders, setOrders] = useState<unknown[]>([]);\n const [total, setTotal] = useState(0);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n if (!billingAccountId) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{\n workspaceStoreOrders: { total: number; orders: unknown[] };\n }>({\n query: WorkspaceStoreOrdersDocument,\n variables: {\n billingAccountId,\n page,\n limit,\n status: options?.status,\n search: options?.search,\n },\n fetchPolicy: 'network-only',\n });\n setOrders(result.data?.workspaceStoreOrders?.orders ?? []);\n setTotal(result.data?.workspaceStoreOrders?.total ?? 0);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [client, billingAccountId, page, limit, options?.status, options?.search]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n orders,\n total,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Publisher Hooks\n// ============================================================================\n\n/**\n * Hook to fetch publisher's products\n */\nexport function useMyPublishedProducts() {\n const client = useStoreClient();\n const [allProducts, setAllProducts] = useState<StoreProduct[]>([]);\n const [hasMore, setHasMore] = useState(false);\n const [currentOffset, setCurrentOffset] = useState(0);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const PAGE_SIZE = 20;\n\n const fetchData = useCallback(\n async (fetchOffset = 0, append = false) => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query<{ publishedProducts: StoreProduct[] }>({\n query: MyPublishedProductsDocument,\n variables: { limit: PAGE_SIZE, offset: fetchOffset },\n fetchPolicy: 'network-only',\n });\n const fetched = result.data?.publishedProducts ?? [];\n if (append) {\n setAllProducts((prev) => [...prev, ...fetched]);\n } else {\n setAllProducts(fetched);\n }\n setHasMore(fetched.length === PAGE_SIZE);\n setCurrentOffset(fetchOffset + fetched.length);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n },\n [client]\n );\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n void fetchData(currentOffset, true);\n }, [fetchData, hasMore, loading, currentOffset]);\n\n useEffect(() => {\n void fetchData(0, false);\n }, [fetchData]);\n\n return {\n products: allProducts,\n hasMore,\n loading,\n error,\n refetch: () => fetchData(0, false),\n loadMore,\n };\n}\n\n/**\n * Hook to fetch developer earnings\n */\nexport function useDeveloperEarnings(options?: {\n period?: string;\n startDate?: string;\n endDate?: string;\n}) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n const [earnings, setEarnings] = useState<unknown>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const result = hasOrganizationContext\n ? ((await queryWithContext({\n query: DeveloperEarningsDocument,\n variables: { input: options },\n fetchPolicy: 'network-only',\n })) as { data?: DeveloperEarningsData })\n : await globalClient.query<DeveloperEarningsData>({\n query: DeveloperEarningsDocument,\n variables: { input: options },\n fetchPolicy: 'network-only',\n });\n setEarnings(result.data?.developerEarnings ?? null);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [globalClient, hasOrganizationContext, options, queryWithContext]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n return {\n earnings,\n loading,\n error,\n refetch: fetchData,\n };\n}\n\n// ============================================================================\n// Re-export types for convenience\n// ============================================================================\n\nexport type {\n BrowseStoreInput,\n StoreProductDetailsInput,\n ProductType,\n CreateReviewInput,\n UpdateReviewInput,\n StoreProduct,\n ProductReview,\n ProductCategory,\n SearchSuggestion,\n GroupedProducts,\n BrowseStoreResult,\n};\n"],"mappings":";;;;;;AA6CA,SAAS,IAAiB;AACxB,QAAO,GAAiB;;AA4J1B,SAAgB,EAAe,IAA0B,EAAE,EAAE;CAC3D,IAAM,IAAS,GAAgB,EACzB,CAAC,GAAU,KAAe,EAAyB,EAAE,CAAC,EACtD,CAAC,GAAY,KAAiB,EAAS,EAAE,EACzC,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,GAAQ,KAAa,EAAsC,KAAA,EAAU,EACtE,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAuB,KAAK,EAGhD,IAAW,KAAK,UAAU,EAAM,EAEhC,IAAY,EAAY,YAAY;AAExC,EADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,MAAI;GACF,IAAM,IAAS,MAAM,EAAO,MAA0C;IACpE,OAAO;IACP,WAAW,EAAE,OAAO,KAAK,MAAM,EAAS,EAAE;IAC1C,aAAa;IACd,CAAC;AAIF,GAHA,EAAY,EAAO,MAAM,aAAa,YAAY,EAAE,CAAC,EACrD,EAAc,EAAO,MAAM,aAAa,cAAc,EAAE,EACxD,EAAW,EAAO,MAAM,aAAa,WAAW,GAAM,EACtD,EAAU,EAAO,MAAM,aAAa,OAAO;WACpC,GAAK;AACZ,KAAS,EAAa;YACd;AACR,KAAW,GAAM;;IAElB,CAAC,GAAQ,EAAS,CAAC;AAMtB,QAJA,QAAgB;AACd,KAAW;IACV,CAAC,EAAU,C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EACzB,CAAC,GAAQ,KAAa,EAAoB,EAAE,CAAC,EAC7C,CAAC,GAAO,KAAY,EAAS,EAAE,EAC/B,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAuB,KAAK,EAEhD,IAAY,EAAY,YAAY;AACxC,MAAI,CAAC,GAAkB;AACrB,KAAW,GAAM;AACjB;;AAIF,EADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,MAAI;GACF,IAAM,IAAS,MAAM,EAAO,MAEzB;IACD,OAAO;IACP,WAAW;KACT;KACA;KACA;KACA,QAAQ,GAAS;KACjB,QAAQ,GAAS;KAClB;IACD,aAAa;IACd,CAAC;AAEF,GADA,EAAU,EAAO,MAAM,sBAAsB,UAAU,EAAE,CAAC,EAC1D,EAAS,EAAO,MAAM,sBAAsB,SAAS,EAAE;WAChD,GAAK;AACZ,KAAS,EAAa;YACd;AACR,KAAW,GAAM;;IAElB;EAAC;EAAQ;EAAkB;EAAM;EAAO,GAAS;EAAQ,GAAS;EAAO,CAAC;AAM7E,QAJA,QAAgB;AACd,KAAW;IACV,CAAC,EAAU,CAAC,EAER;EACL;EACA;EACA;EACA;EACA,SAAS;EACV"}
package/dist/index.js CHANGED
@@ -8,6 +8,6 @@ import { StoreRoot as mt } from "./StoreRoot.js";
8
8
  import { StoreAdminRoot as ht } from "./StoreAdminRoot.js";
9
9
  import { useProductSearch as gt } from "./hooks/useProductSearch.js";
10
10
  import { calculateCartTotals as _t, debounce as vt, formatFileSize as yt, formatNumber as bt, formatPrice as xt, formatPriceForModel as St, generateCartItemId as Ct, getDaysUntilExpiry as wt, getItemTypeName as Tt, getPricingModelName as Et, getRatingStars as Dt, getStatusColor as Ot, isLicenseExpiringSoon as kt, maskLicenseKey as At, truncate as jt, validateLicenseKey as Mt } from "./utils/index.js";
11
- import { useBrowseStore as Nt, useBrowseStoreWithContext as Pt, useCategories as Ft, useCheckEntitlement as It, useCreateReview as Lt, useDeleteReview as Rt, useDeveloperEarnings as zt, useFeaturedProducts as Bt, useFilterOptions as Vt, useHomeGroupedProducts as Ht, useLazyBrowseStore as Ut, useLazySearchSuggestions as Wt, useLazyStoreProductDetails as Gt, useMarkReviewHelpful as Kt, useMyEntitlements as qt, useMyPublishedProducts as Jt, useProductReviews as Yt, useSearchSuggestions as Xt, useStoreProductDetails as Zt, useTrendingSearches as Qt, useUpdateReview as $t, useUserReviewForProduct as en, useWorkspaceStoreOrders as tn } from "./hooks/useStoreGraphQL.js";
12
- import { enTranslations as nn } from "./translations/en.js";
13
- export { i as AddToCartDocument, a as BrowseStoreDocument, o as CategoriesDocument, s as CheckEntitlementDocument, c as CheckoutDocument, l as ClearCartDocument, u as CreateProductForPublisherDocument, d as CreateReviewDocument, f as CreateStoreOrderDocument, p as DeleteReviewDocument, m as DeveloperEarningsDocument, h as FeaturedProductsDocument, g as FilterOptionsDocument, _ as GetCartDocument, v as GetMyOrdersDocument, y as GetMyStoreInstallationsDocument, b as GetProductDocument, x as GetProductsDocument, S as GetStoreAppInstallationDocument, C as HomeGroupedProductsDocument, w as InstallationStatusUpdatedDocument, T as LicenseStatusUpdatedDocument, E as MarkReviewHelpfulDocument, D as MyEntitlementsDocument, O as MyPublishedProductsDocument, k as OrderStatusUpdatedDocument, A as ProductReviewsDocument, j as RecordAppUninstallationDocument, M as RemoveFromCartDocument, t as STORE_PERMISSIONS, N as SearchSuggestionsDocument, ht as StoreAdminRoot, P as StoreProductDetailsDocument, mt as StoreRoot, F as SubmissionStatusUpdatedDocument, I as TrendingSearchesDocument, L as UpdateCartItemDocument, R as UpdateReviewDocument, z as UserReviewForProductDocument, B as WorkspaceStoreOrdersDocument, _t as calculateCartTotals, vt as debounce, yt as formatFileSize, bt as formatNumber, xt as formatPrice, St as formatPriceForModel, Ct as generateCartItemId, wt as getDaysUntilExpiry, Tt as getItemTypeName, Et as getPricingModelName, Dt as getRatingStars, Ot as getStatusColor, kt as isLicenseExpiringSoon, At as maskLicenseKey, nn as storeTranslations, jt as truncate, V as useAddToCartMutation, ft as useBackendCart, Nt as useBrowseStore, H as useBrowseStoreLazyQuery, U as useBrowseStoreQuery, W as useBrowseStoreSuspenseQuery, Pt as useBrowseStoreWithContext, pt as useCart, Ft as useCategories, G as useCategoriesLazyQuery, K as useCategoriesQuery, q as useCategoriesSuspenseQuery, It as useCheckEntitlement, J as useCheckEntitlementLazyQuery, Y as useCheckEntitlementQuery, X as useCheckEntitlementSuspenseQuery, Z as useCheckoutMutation, Q as useClearCartMutation, $ as useCreateProductForPublisherMutation, Lt as useCreateReview, ee as useCreateReviewMutation, te as useCreateStoreOrderMutation, Rt as useDeleteReview, ne as useDeleteReviewMutation, zt as useDeveloperEarnings, re as useDeveloperEarningsLazyQuery, ie as useDeveloperEarningsQuery, ae as useDeveloperEarningsSuspenseQuery, Bt as useFeaturedProducts, oe as useFeaturedProductsLazyQuery, se as useFeaturedProductsQuery, ce as useFeaturedProductsSuspenseQuery, Vt as useFilterOptions, le as useFilterOptionsLazyQuery, ue as useFilterOptionsQuery, de as useFilterOptionsSuspenseQuery, fe as useGetCartLazyQuery, pe as useGetCartQuery, me as useGetCartSuspenseQuery, he as useGetMyOrdersLazyQuery, ge as useGetMyOrdersQuery, _e as useGetMyOrdersSuspenseQuery, ve as useGetMyStoreInstallationsLazyQuery, ye as useGetMyStoreInstallationsQuery, be as useGetMyStoreInstallationsSuspenseQuery, xe as useGetProductLazyQuery, Se as useGetProductQuery, Ce as useGetProductSuspenseQuery, we as useGetProductsLazyQuery, Te as useGetProductsQuery, Ee as useGetProductsSuspenseQuery, De as useGetStoreAppInstallationLazyQuery, Oe as useGetStoreAppInstallationQuery, ke as useGetStoreAppInstallationSuspenseQuery, Ht as useHomeGroupedProducts, Ae as useHomeGroupedProductsLazyQuery, je as useHomeGroupedProductsQuery, Me as useHomeGroupedProductsSuspenseQuery, Ne as useInstallationStatusUpdatedSubscription, Ut as useLazyBrowseStore, Wt as useLazySearchSuggestions, Gt as useLazyStoreProductDetails, Pe as useLicenseStatusUpdatedSubscription, Kt as useMarkReviewHelpful, Fe as useMarkReviewHelpfulMutation, qt as useMyEntitlements, Ie as useMyEntitlementsLazyQuery, Le as useMyEntitlementsQuery, Re as useMyEntitlementsSuspenseQuery, Jt as useMyPublishedProducts, ze as useMyPublishedProductsLazyQuery, Be as useMyPublishedProductsQuery, Ve as useMyPublishedProductsSuspenseQuery, He as useOrderStatusUpdatedSubscription, Yt as useProductReviews, Ue as useProductReviewsLazyQuery, We as useProductReviewsQuery, Ge as useProductReviewsSuspenseQuery, gt as useProductSearch, Ke as useRecordAppUninstallationMutation, qe as useRemoveFromCartMutation, Xt as useSearchSuggestions, Je as useSearchSuggestionsLazyQuery, Ye as useSearchSuggestionsQuery, Xe as useSearchSuggestionsSuspenseQuery, e as useStore, n as useStorePermissions, Zt as useStoreProductDetails, Ze as useStoreProductDetailsLazyQuery, Qe as useStoreProductDetailsQuery, $e as useStoreProductDetailsSuspenseQuery, r as useStoreStore, et as useSubmissionStatusUpdatedSubscription, Qt as useTrendingSearches, tt as useTrendingSearchesLazyQuery, nt as useTrendingSearchesQuery, rt as useTrendingSearchesSuspenseQuery, it as useUpdateCartItemMutation, $t as useUpdateReview, at as useUpdateReviewMutation, en as useUserReviewForProduct, ot as useUserReviewForProductLazyQuery, st as useUserReviewForProductQuery, ct as useUserReviewForProductSuspenseQuery, tn as useWorkspaceStoreOrders, lt as useWorkspaceStoreOrdersLazyQuery, ut as useWorkspaceStoreOrdersQuery, dt as useWorkspaceStoreOrdersSuspenseQuery, Mt as validateLicenseKey };
11
+ import { useBrowseStore as Nt, useBrowseStoreWithContext as Pt, useCategories as Ft, useCheckEntitlement as It, useCreateReview as Lt, useDeleteReview as Rt, useFeaturedProducts as zt, useFilterOptions as Bt, useHomeGroupedProducts as Vt, useLazyBrowseStore as Ht, useLazySearchSuggestions as Ut, useLazyStoreProductDetails as Wt, useMarkReviewHelpful as Gt, useMyEntitlements as Kt, useProductReviews as qt, useSearchSuggestions as Jt, useStoreProductDetails as Yt, useTrendingSearches as Xt, useUpdateReview as Zt, useUserReviewForProduct as Qt, useWorkspaceStoreOrders as $t } from "./hooks/useStoreGraphQL.js";
12
+ import { enTranslations as en } from "./translations/en.js";
13
+ export { i as AddToCartDocument, a as BrowseStoreDocument, o as CategoriesDocument, s as CheckEntitlementDocument, c as CheckoutDocument, l as ClearCartDocument, u as CreateProductForPublisherDocument, d as CreateReviewDocument, f as CreateStoreOrderDocument, p as DeleteReviewDocument, m as DeveloperEarningsDocument, h as FeaturedProductsDocument, g as FilterOptionsDocument, _ as GetCartDocument, v as GetMyOrdersDocument, y as GetMyStoreInstallationsDocument, b as GetProductDocument, x as GetProductsDocument, S as GetStoreAppInstallationDocument, C as HomeGroupedProductsDocument, w as InstallationStatusUpdatedDocument, T as LicenseStatusUpdatedDocument, E as MarkReviewHelpfulDocument, D as MyEntitlementsDocument, O as MyPublishedProductsDocument, k as OrderStatusUpdatedDocument, A as ProductReviewsDocument, j as RecordAppUninstallationDocument, M as RemoveFromCartDocument, t as STORE_PERMISSIONS, N as SearchSuggestionsDocument, ht as StoreAdminRoot, P as StoreProductDetailsDocument, mt as StoreRoot, F as SubmissionStatusUpdatedDocument, I as TrendingSearchesDocument, L as UpdateCartItemDocument, R as UpdateReviewDocument, z as UserReviewForProductDocument, B as WorkspaceStoreOrdersDocument, _t as calculateCartTotals, vt as debounce, yt as formatFileSize, bt as formatNumber, xt as formatPrice, St as formatPriceForModel, Ct as generateCartItemId, wt as getDaysUntilExpiry, Tt as getItemTypeName, Et as getPricingModelName, Dt as getRatingStars, Ot as getStatusColor, kt as isLicenseExpiringSoon, At as maskLicenseKey, en as storeTranslations, jt as truncate, V as useAddToCartMutation, ft as useBackendCart, Nt as useBrowseStore, H as useBrowseStoreLazyQuery, U as useBrowseStoreQuery, W as useBrowseStoreSuspenseQuery, Pt as useBrowseStoreWithContext, pt as useCart, Ft as useCategories, G as useCategoriesLazyQuery, K as useCategoriesQuery, q as useCategoriesSuspenseQuery, It as useCheckEntitlement, J as useCheckEntitlementLazyQuery, Y as useCheckEntitlementQuery, X as useCheckEntitlementSuspenseQuery, Z as useCheckoutMutation, Q as useClearCartMutation, $ as useCreateProductForPublisherMutation, Lt as useCreateReview, ee as useCreateReviewMutation, te as useCreateStoreOrderMutation, Rt as useDeleteReview, ne as useDeleteReviewMutation, re as useDeveloperEarningsLazyQuery, ie as useDeveloperEarningsQuery, ae as useDeveloperEarningsSuspenseQuery, zt as useFeaturedProducts, oe as useFeaturedProductsLazyQuery, se as useFeaturedProductsQuery, ce as useFeaturedProductsSuspenseQuery, Bt as useFilterOptions, le as useFilterOptionsLazyQuery, ue as useFilterOptionsQuery, de as useFilterOptionsSuspenseQuery, fe as useGetCartLazyQuery, pe as useGetCartQuery, me as useGetCartSuspenseQuery, he as useGetMyOrdersLazyQuery, ge as useGetMyOrdersQuery, _e as useGetMyOrdersSuspenseQuery, ve as useGetMyStoreInstallationsLazyQuery, ye as useGetMyStoreInstallationsQuery, be as useGetMyStoreInstallationsSuspenseQuery, xe as useGetProductLazyQuery, Se as useGetProductQuery, Ce as useGetProductSuspenseQuery, we as useGetProductsLazyQuery, Te as useGetProductsQuery, Ee as useGetProductsSuspenseQuery, De as useGetStoreAppInstallationLazyQuery, Oe as useGetStoreAppInstallationQuery, ke as useGetStoreAppInstallationSuspenseQuery, Vt as useHomeGroupedProducts, Ae as useHomeGroupedProductsLazyQuery, je as useHomeGroupedProductsQuery, Me as useHomeGroupedProductsSuspenseQuery, Ne as useInstallationStatusUpdatedSubscription, Ht as useLazyBrowseStore, Ut as useLazySearchSuggestions, Wt as useLazyStoreProductDetails, Pe as useLicenseStatusUpdatedSubscription, Gt as useMarkReviewHelpful, Fe as useMarkReviewHelpfulMutation, Kt as useMyEntitlements, Ie as useMyEntitlementsLazyQuery, Le as useMyEntitlementsQuery, Re as useMyEntitlementsSuspenseQuery, ze as useMyPublishedProductsLazyQuery, Be as useMyPublishedProductsQuery, Ve as useMyPublishedProductsSuspenseQuery, He as useOrderStatusUpdatedSubscription, qt as useProductReviews, Ue as useProductReviewsLazyQuery, We as useProductReviewsQuery, Ge as useProductReviewsSuspenseQuery, gt as useProductSearch, Ke as useRecordAppUninstallationMutation, qe as useRemoveFromCartMutation, Jt as useSearchSuggestions, Je as useSearchSuggestionsLazyQuery, Ye as useSearchSuggestionsQuery, Xe as useSearchSuggestionsSuspenseQuery, e as useStore, n as useStorePermissions, Yt as useStoreProductDetails, Ze as useStoreProductDetailsLazyQuery, Qe as useStoreProductDetailsQuery, $e as useStoreProductDetailsSuspenseQuery, r as useStoreStore, et as useSubmissionStatusUpdatedSubscription, Xt as useTrendingSearches, tt as useTrendingSearchesLazyQuery, nt as useTrendingSearchesQuery, rt as useTrendingSearchesSuspenseQuery, it as useUpdateCartItemMutation, Zt as useUpdateReview, at as useUpdateReviewMutation, Qt as useUserReviewForProduct, ot as useUserReviewForProductLazyQuery, st as useUserReviewForProductQuery, ct as useUserReviewForProductSuspenseQuery, $t as useWorkspaceStoreOrders, lt as useWorkspaceStoreOrdersLazyQuery, ut as useWorkspaceStoreOrdersQuery, dt as useWorkspaceStoreOrdersSuspenseQuery, Mt as validateLicenseKey };
@@ -1,5 +1,5 @@
1
1
  import { brand as e, isBranded as t } from "./utils.js";
2
- //#region ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/errors/utils.js
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 "../../../../../../rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/empty.js";
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/link/core/ApolloLink.js
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 "../../../../../../rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Observable.js";
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/link/subscriptions/index.js
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/link/utils/createOperation.js
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/utilities/graphql/print.js
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 "../../../../../../@wry_caches@1.0.1/node_modules/@wry/caches/lib/weak.js";
2
- //#region ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/caches.js
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/checkDocument.js
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getMainDefinition.js
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,9 @@
1
+ //#region node_modules/@apollo/client/utilities/internal/getMemoryInternals.js
2
+ var e = {};
3
+ function t(t, n) {
4
+ e[t] = n;
5
+ }
6
+ //#endregion
7
+ export { t as registerGlobalCache };
8
+
9
+ //# sourceMappingURL=getMemoryInternals.js.map
@@ -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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js
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 ../../node_modules/.bun/@apollo+client@4.1.9+e571b0b00fd00a97/node_modules/@apollo/client/utilities/internal/globals/global.js
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,10 @@
1
+ //#region node_modules/@apollo/client/utilities/internal/globals/maybe.js
2
+ function e(e) {
3
+ try {
4
+ return e();
5
+ } catch {}
6
+ }
7
+ //#endregion
8
+ export { e as maybe };
9
+
10
+ //# sourceMappingURL=maybe.js.map