{"version":3,"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth\";\nimport type { creem } from \"./index.js\";\n\n/**\n * Creem client plugin for Better-Auth.\n *\n * Provides client-side methods for interacting with Creem:\n * - `authClient.creem.createCheckout()` - Create a checkout session\n * - `authClient.creem.createPortal()` - Create a customer portal session\n * - `authClient.creem.cancelSubscription()` - Cancel a subscription\n * - `authClient.creem.retrieveSubscription()` - Get subscription details\n * - `authClient.creem.searchTransactions()` - Search transactions\n * - `authClient.creem.hasAccessGranted()` - Check if user has access granted\n *\n * @example\n * ```typescript\n * import { createAuthClient } from \"better-auth/client\";\n * import { creemClient } from \"./lib/creem-betterauth/client\";\n *\n * export const authClient = createAuthClient({\n *   plugins: [creemClient()]\n * });\n *\n * // Usage in components - hover over createCheckout to see clean parameter types!\n * const { data, error } = await authClient.creem.createCheckout({\n *   productId: \"prod_abc123\",\n *   units: 1,\n *   successUrl: \"/success\"\n * });\n * ```\n */\nexport const creemClient = () => {\n  return {\n    id: \"creem\",\n    $InferServerPlugin: {} as ReturnType<typeof creem>,\n    pathMethods: {\n      \"/creem/create-portal\": \"POST\",\n      \"/creem/cancel-subscription\": \"POST\",\n      \"/creem/retrieve-subscription\": \"POST\",\n      \"/creem/search-transactions\": \"POST\",\n    },\n  } satisfies BetterAuthClientPlugin;\n};\n\n// Re-export types for client-side usage\nexport type {\n  CreateCheckoutInput,\n  CreateCheckoutResponse,\n  CheckoutCustomer,\n  CustomFieldInput,\n  TextFieldConfig,\n  CheckboxFieldConfig,\n} from \"./checkout-types.js\";\n\nexport type { CreatePortalInput, CreatePortalResponse } from \"./portal-types.js\";\n\nexport type {\n  CancelSubscriptionInput,\n  CancelSubscriptionResponse,\n} from \"./cancel-subscription-types.js\";\n\nexport type { RetrieveSubscriptionInput, SubscriptionData } from \"./retrieve-subscription-types.js\";\n\nexport type {\n  SearchTransactionsInput,\n  SearchTransactionsResponse,\n  TransactionData,\n} from \"./search-transactions-types.js\";\n\nexport type { HasAccessGrantedResponse } from \"./has-active-subscription-types.js\";\n"],"mappings":";AA+BO,IAAM,cAAc,MAAM;AAC/B,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,oBAAoB,CAAC;AAAA,IACrB,aAAa;AAAA,MACX,wBAAwB;AAAA,MACxB,8BAA8B;AAAA,MAC9B,gCAAgC;AAAA,MAChC,8BAA8B;AAAA,IAChC;AAAA,EACF;AACF;","names":[]}