import { createContext, useContext } from "react";
//#region ../core/src/account-api-context.ts
const AccountApiContext = createContext(null);
const AccountApiProvider = AccountApiContext.Provider;
function useAccountApi() {
	const api = useContext(AccountApiContext);
	if (!api) throw new Error("useAccountApi must be used within an AccountApiProvider");
	return api;
}
//#endregion
//#region ../../api-clients/portal-tenant/src/namespaces/portal_tenant.ts
/**
* Get current account
* Returns the authenticated member's account profile and company context. This is the primary endpoint the SPA calls to check auth status and display user information.
*
* @param client - Fetch client instance

*/
async function account_show(client) {
	return client.get(`/api/account`);
}
/**
* Update current account
* Updates the authenticated member's profile fields such as name, phone, bio, avatar, and social links.
*
* @param client - Fetch client instance
* @param body - body
*/
async function account_update(client, body) {
	return client.patch(`/api/account`, body);
}
/**
* Get store branding
* Returns the tenant company's store branding including logo, icon, and app store URLs.
*
* @param client - Fetch client instance

*/
async function store_show(client) {
	return client.get(`/api/store`);
}
/**
* Get the app manifest
* Returns the rendered manifest for the tenant company's active FluidOS definition, matched against the current user's country, rank, and roles.
*
* @param client - Fetch client instance

*/
async function app_manifest_show(client) {
	return client.get(`/api/app/manifest`);
}
/**
* List calendar events
* Returns a paginated list of upcoming and ongoing calendar events for the tenant company, optionally filtered by the authenticated member's country when one is set.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function calendar_events_list(client, params) {
	return client.get(`/api/calendar/events`, params);
}
/**
* List recent activities
* Returns a paginated list of recent activities for the authenticated member, ordered by most recent first. Each activity includes pre-computed user_name and target_name fields ready for direct rendering by the portal SPA.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function activities_list(client, params) {
	return client.get(`/api/activities`, params);
}
/**
* List catch-up suggestions
* Returns a paginated list of catch-up suggestions for the authenticated member. Limited to suggestions with at least one pending action that have not expired.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function catch_ups_list(client, params) {
	return client.get(`/api/catch_ups`, params);
}
/**
* List orders
* Returns a paginated list of orders placed through the tenant company, optionally filtered by status.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function orders_list(client, params) {
	return client.get(`/api/orders`, params);
}
/**
* Get an order
* Returns a single order by token with its line items.
*
* @param client - Fetch client instance
* @param token - token
*/
async function orders_show(client, token) {
	return client.get(`/api/orders/${token}`);
}
/**
* List products
* Returns a paginated list of products available in the tenant company's catalog. Supports sorting and filtering by title, product type, collection, and stock availability.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function products_list(client, params) {
	return client.get(`/api/products`, params);
}
/**
* Get a product
* Returns a single product by ID with its variants.
*
* @param client - Fetch client instance
* @param id - id
*/
async function products_show(client, id) {
	return client.get(`/api/products/${id}`);
}
/**
* Search products
* Searches the tenant company's product catalog by keyword, returning paginated results.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function products_search(client, params) {
	return client.get(`/api/products/search`, params);
}
/**
* List product media
* Returns all media (images, videos) attached to a product.
*
* @param client - Fetch client instance
* @param id - id
*/
async function products_media_list(client, id) {
	return client.get(`/api/products/${id}/media`);
}
/**
* List enrollment packs
* Returns a paginated list of active, non-discarded enrollment packs scoped to the current portal tenant's company. Each pack carries an empty `products` array — fetch a single pack via `/api/enrollment_packs/{id}` to load its visible products.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function enrollment_packs_list(client, params) {
	return client.get(`/api/enrollment_packs`, params);
}
/**
* Get an enrollment pack
* Returns a single active, non-discarded enrollment pack scoped to the current portal tenant's company.
*
* @param client - Fetch client instance
* @param id - id
*/
async function enrollment_packs_show(client, id) {
	return client.get(`/api/enrollment_packs/${id}`);
}
/**
* List subscriptions
* Returns a paginated list of the member's active and historical subscriptions. Supports filtering by lifecycle state and a free-text search across product and plan names.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function subscriptions_list(client, params) {
	return client.get(`/api/subscriptions`, params);
}
/**
* Get a subscription
* Returns a single subscription by its token.
*
* @param client - Fetch client instance
* @param token - token
*/
async function subscriptions_show(client, token) {
	return client.get(`/api/subscriptions/${token}`);
}
/**
* Update a subscription
* Updates a subscription's default payment method or quantity.
*
* @param client - Fetch client instance
* @param token - token
* @param body - body
*/
async function subscriptions_update(client, token, body) {
	return client.put(`/api/subscriptions/${token}`, body);
}
/**
* Pause a subscription
* Pauses billing on an active subscription. When neither `next_bill_date` nor `number_of_orders` is provided, the subscription is paused indefinitely. Specifying both is rejected.
*
* @param client - Fetch client instance
* @param token - token
* @param [body] - body
*/
async function subscriptions_pause(client, token, body) {
	return client.post(`/api/subscriptions/${token}/pause`, body);
}
/**
* Resume a subscription
* Resumes billing on a paused subscription. When `next_bill_date` is omitted, the plan's next bill date from today is used.
*
* @param client - Fetch client instance
* @param token - token
* @param [body] - body
*/
async function subscriptions_resume(client, token, body) {
	return client.post(`/api/subscriptions/${token}/resume`, body);
}
/**
* Skip next billing cycle
* Skips the next billing cycle for a subscription without pausing it.
*
* @param client - Fetch client instance
* @param token - token
*/
async function subscriptions_skip(client, token) {
	return client.post(`/api/subscriptions/${token}/skip_next_billing`);
}
/**
* Cancel a subscription
* Cancels an active subscription.
*
* @param client - Fetch client instance
* @param token - token
*/
async function subscriptions_cancel(client, token) {
	return client.post(`/api/subscriptions/${token}/cancel`);
}
/**
* Reactivate a subscription
* Reactivates a previously cancelled subscription.
*
* @param client - Fetch client instance
* @param token - token
*/
async function subscriptions_reactivate(client, token) {
	return client.post(`/api/subscriptions/${token}/reactivate`);
}
/**
* List todos
* Returns a paginated list of incomplete tasks scoped to the authenticated member. Ordered by due date ascending, tasks without a due date sort last.
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function todos_list(client, params) {
	return client.get(`/api/todos`, params);
}
/**
* Toggle a todo's completion state
* Marks a todo complete or incomplete for the authenticated member. Sending `completed: true` stamps `completed_at` with the current time; `false` clears it.
*
* @param client - Fetch client instance
* @param id - id
* @param body - body
*/
async function todos_update(client, id, body) {
	return client.patch(`/api/todos/${id}`, body);
}
/**
* Top products by direct visits
* Ranked list of the company's products by total visits to the product page (aggregates metrics_product_visits across all visit sources).
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function product_by_visits(client, params) {
	return client.get(`/api/products/by-visits`, params);
}
/**
* Top products by share-link visits
* Ranked list of the company's products by click-throughs on rep share links (aggregates metrics_share_shareable_visits where shareable_type='Product').
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function product_by_shares(client, params) {
	return client.get(`/api/products/by-shares`, params);
}
/**
* Top enrollment packs by direct visits
* Ranked list of the company's enrollment packs by total visits to the pack page (aggregates metrics_enrollment_pack_visits across all visit sources).
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function enrollment_pack_by_visits(client, params) {
	return client.get(`/api/enrollment_packs/by-visits`, params);
}
/**
* Top enrollment packs by share-link visits
* Ranked list of the company's enrollment packs by click-throughs on rep share links (aggregates metrics_share_shareable_visits where shareable_type='EnrollmentPack').
*
* @param client - Fetch client instance
* @param [params] - params
*/
async function enrollment_pack_by_shares(client, params) {
	return client.get(`/api/enrollment_packs/by-shares`, params);
}
//#endregion
export { AccountApiProvider as A, subscriptions_reactivate as C, subscriptions_update as D, subscriptions_skip as E, todos_list as O, subscriptions_pause as S, subscriptions_show as T, products_search as _, calendar_events_list as a, subscriptions_cancel as b, enrollment_pack_by_visits as c, orders_list as d, orders_show as f, products_media_list as g, products_list as h, app_manifest_show as i, useAccountApi as j, todos_update as k, enrollment_packs_list as l, product_by_visits as m, account_update as n, catch_ups_list as o, product_by_shares as p, activities_list as r, enrollment_pack_by_shares as s, account_show as t, enrollment_packs_show as u, products_show as v, subscriptions_resume as w, subscriptions_list as x, store_show as y };

//# sourceMappingURL=portal_tenant-l4a-eX2B.mjs.map