{"version":3,"sources":["../../src/innovation-assistant-v2-statistics-statistics.http.ts","../../src/innovation-assistant-v2-statistics-statistics.types.ts","../../src/innovation-assistant-v2-statistics-statistics.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInnovationAssistantStatsV2WixAssistantStatisticsUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/wix-assistant-stats',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/wix-assistant-stats',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/innovation/assistant/v2/statistics',\n        destPath: '/v2/statistics',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/innovation/assistant/v2/statistics',\n        destPath: '/v2/statistics',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/innovation/assistant/v2/statistics',\n        destPath: '/v2/statistics',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_assistant-stats_statistics';\n\n/** Retrieves aggregated AI Site-Chat statistics for the authenticated site. */\nexport function getStatistics(payload: object): RequestOptionsFactory<any> {\n  function __getStatistics({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.innovation.assistant.v2.statistics',\n      method: 'GET' as any,\n      methodFqn:\n        'wix.innovation.assistant.stats.v2.WixAssistantStatistics.GetStatistics',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixInnovationAssistantStatsV2WixAssistantStatisticsUrl({\n        protoPath: '/v2/statistics',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [{ path: 'statistics.dailies.date' }],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getStatistics;\n}\n","/**\n * Aggregated AI Site-Chat statistics for a site.\n *\n * Statistics include daily KPI rows for recent activity and period KPI rows for comparison windows, such as the last 30 days and the previous 30 days.\n */\nexport interface Statistics {\n  /**\n   * Site ID the statistics are scoped to.\n   * @format GUID\n   */\n  id?: string;\n  /**\n   * Typed daily statistics.\n   *\n   * Deprecated. Use `dailyKpis` instead.\n   * @maxSize 30\n   * @deprecated Typed daily statistics.\n   *\n   * Deprecated. Use `dailyKpis` instead.\n   * @replacedBy daily_kpis\n   * @targetRemovalDate 2026-02-03\n   */\n  dailies?: Daily[];\n  /**\n   * Typed period statistics.\n   *\n   * Deprecated. Use `periodKpis` instead.\n   * @maxSize 10\n   * @deprecated Typed period statistics.\n   *\n   * Deprecated. Use `periodKpis` instead.\n   * @replacedBy period_kpis\n   * @targetRemovalDate 2026-02-03\n   */\n  timespans?: Timespan[];\n  /**\n   * Daily KPI rows for the last 30 days.\n   *\n   * Each row contains the fields requested in `dailyFields`, or all default daily KPI fields if `dailyFields` isn't provided.\n   * @maxSize 30\n   */\n  dailyKpis?: Record<string, any>[] | null;\n  /**\n   * Period KPI rows for comparison windows.\n   *\n   * Each row contains the fields requested in `byPeriodFields`, or all default period KPI fields if `byPeriodFields` isn't provided.\n   * @maxSize 10\n   */\n  periodKpis?: Record<string, any>[] | null;\n}\n\nexport interface Daily {\n  /** Date the daily statistics are for. */\n  date?: Date | null;\n  /** Number of conversations on this date. */\n  conversations?: string | null;\n  /**\n   * Number of messages on this date.\n   *\n   * Deprecated.\n   * @deprecated\n   */\n  messages?: string | null;\n  /** Number of unique visitors on this date. */\n  visitors?: string | null;\n  /** Number of product items shown or recommended in AI Site-Chat on this date. */\n  exposedItems?: string | null;\n  /** Number of orders associated with AI Site-Chat activity on this date. */\n  orders?: string | null;\n  /** Chat handler the daily statistics are grouped by. */\n  chatHandler?: ChatHandlerWithLiterals;\n  /** Number of conversations that received a response on this date. */\n  repliedConversationsCount?: string | null;\n}\n\nexport enum ChatHandler {\n  /** Unknown handler. */\n  UNKNOWN_HANDLER = 'UNKNOWN_HANDLER',\n  /** AI assistant. */\n  AI = 'AI',\n  /** Wix user, such as a site owner or contributor. */\n  WIX_USER = 'WIX_USER',\n}\n\n/** @enumType */\nexport type ChatHandlerWithLiterals =\n  | ChatHandler\n  | 'UNKNOWN_HANDLER'\n  | 'AI'\n  | 'WIX_USER';\n\nexport interface Timespan {\n  /** Comparison period the statistics are aggregated for. */\n  period?: PeriodWithLiterals;\n  /** Number of conversations in this period. */\n  conversations?: string | null;\n  /**\n   * Number of messages in this period.\n   *\n   * Deprecated.\n   * @deprecated\n   */\n  messages?: string | null;\n  /** Number of unique visitors in this period. */\n  visitors?: string | null;\n  /** Number of product items shown or recommended in AI Site-Chat in this period. */\n  exposedItems?: string | null;\n  /** Number of orders associated with AI Site-Chat activity in this period. */\n  orders?: string | null;\n  /** Chat handler the period statistics are grouped by. */\n  chatHandler?: ChatHandlerWithLiterals;\n  /** Number of conversations that received a response in this period. */\n  repliedConversationsCount?: string | null;\n  /** Median response time in seconds. */\n  medianResponseTimeSecondsP50?: string | null;\n  /** Median first response time in seconds. */\n  medianFirstResponseTimeSecondsP50?: string | null;\n}\n\nexport enum Period {\n  /** Unknown period. */\n  UNKNOWN_PERIOD = 'UNKNOWN_PERIOD',\n  /** Rolling 30-day period from the current date. */\n  LAST_30_DAYS = 'LAST_30_DAYS',\n  /** The 30-day period before `LAST_30_DAYS`. */\n  PREVIOUS_30_DAYS = 'PREVIOUS_30_DAYS',\n}\n\n/** @enumType */\nexport type PeriodWithLiterals =\n  | Period\n  | 'UNKNOWN_PERIOD'\n  | 'LAST_30_DAYS'\n  | 'PREVIOUS_30_DAYS';\n\nexport interface GetStatisticsRequest {\n  /**\n   * Daily KPI fields to return in `statistics.dailyKpis`.\n   *\n   * Supported values: `kpi_date`, `mode`, `conversations_count`, `visitors_distinct_count`, `exposed_items_count`, `total_orders_count`, `replied_conversations_count`, `response_time_seconds_p50`, `first_response_time_seconds_p50`.\n   *\n   * Default: All supported daily KPI fields.\n   */\n  dailyFields?: string[];\n  /**\n   * Period KPI fields to return in `statistics.periodKpis`.\n   *\n   * Supported values: `period`, `mode`, `conversations_count`, `visitors_distinct_count`, `exposed_items_count`, `total_orders_count`, `replied_conversations_count`, `response_time_seconds_p50`, `first_response_time_seconds_p50`.\n   *\n   * Default: All supported period KPI fields.\n   */\n  byPeriodFields?: string[];\n}\n\nexport interface GetStatisticsResponse {\n  /** Aggregated AI Site-Chat statistics for the authenticated site. */\n  statistics?: Statistics;\n}\n","import * as ambassadorWixInnovationAssistantV2Statistics from './innovation-assistant-v2-statistics-statistics.http.js';\nimport * as ambassadorWixInnovationAssistantV2StatisticsTypes from './innovation-assistant-v2-statistics-statistics.types.js';\nimport * as ambassadorWixInnovationAssistantV2StatisticsUniversalTypes from './innovation-assistant-v2-statistics-statistics.universal.js';\n\nexport type __PublicMethodMetaInfo<\n  K = string,\n  M = unknown,\n  T = unknown,\n  S = unknown,\n  Q = unknown,\n  R = unknown\n> = {\n  getUrl: (context: any) => string;\n  httpMethod: K;\n  path: string;\n  pathParams: M;\n  __requestType: T;\n  __originalRequestType: S;\n  __responseType: Q;\n  __originalResponseType: R;\n};\n\nexport function getStatistics(): __PublicMethodMetaInfo<\n  'GET',\n  {},\n  ambassadorWixInnovationAssistantV2StatisticsUniversalTypes.GetStatisticsRequest,\n  ambassadorWixInnovationAssistantV2StatisticsTypes.GetStatisticsRequest,\n  ambassadorWixInnovationAssistantV2StatisticsUniversalTypes.GetStatisticsResponse,\n  ambassadorWixInnovationAssistantV2StatisticsTypes.GetStatisticsResponse\n> {\n  const payload = {} as any;\n\n  const getRequestOptions =\n    ambassadorWixInnovationAssistantV2Statistics.getStatistics(payload);\n\n  const getUrl = (context: any): string => {\n    const { url } = getRequestOptions(context);\n    return url!;\n  };\n\n  return {\n    getUrl,\n    httpMethod: 'GET',\n    path: '/v2/statistics',\n    pathParams: {},\n    __requestType: null as any,\n    __originalRequestType: null as any,\n    __responseType: null as any,\n    __originalResponseType: null as any,\n  };\n}\n\nexport {\n  Statistics as StatisticsOriginal,\n  Daily as DailyOriginal,\n  ChatHandler as ChatHandlerOriginal,\n  ChatHandlerWithLiterals as ChatHandlerWithLiteralsOriginal,\n  Timespan as TimespanOriginal,\n  Period as PeriodOriginal,\n  PeriodWithLiterals as PeriodWithLiteralsOriginal,\n  GetStatisticsRequest as GetStatisticsRequestOriginal,\n  GetStatisticsResponse as GetStatisticsResponseOriginal,\n} from './innovation-assistant-v2-statistics-statistics.types.js';\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,8DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;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