{"version":3,"sources":["../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.ts","../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.ts","../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.ts","../src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient } from '@wix/sdk-types';\nimport * as ambassadorWixGatewaysBillingV1TaxCalculationGateway from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js';\nimport { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface TaxCalculationGateway {\n  _id?: string | null;\n}\n\nexport interface CalculateTaxRequest {\n  /** Optional ID of the entity that tax is being calculated for. For example, a cart ID. */\n  externalId?: string | null;\n  /** 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */\n  currency?: string;\n  /** Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. */\n  addresses: Address[];\n  /** Line items to calculate tax for. */\n  lineItems: LineItem[];\n}\n\n/** Wix common address format for physical address to use if you plan to store addresses in your service. */\nexport interface Address {\n  /** 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */\n  country?: string | null;\n  /** Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. */\n  subdivision?: string | null;\n  /** City name. */\n  city?: string | null;\n  /** Postal or zip code. */\n  postalCode?: string | null;\n  /** Main address line, usually street and number as free text. */\n  addressLine1?: string | null;\n  /** Free text providing more detailed address information, such as apartment, suite, or floor. */\n  addressLine2?: string | null;\n}\n\n/** Line items to calculate tax for. */\nexport interface LineItem {\n  /** Line item ID. */\n  _id?: string;\n  /** Line item name to display. */\n  itemName?: string | null;\n  /** Line item quantity. */\n  quantity?: number;\n  /** Line item price. */\n  price?: string;\n  /** Stock keeping unit for this line item. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). */\n  itemCode?: string | null;\n  /** Tax group ID for this line item. If not provided, the default tax group applies. */\n  taxGroupId?: string | null;\n  /**\n   * ID of the app providing the catalog for this line item.\n   *\n   * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n   *\n   * For items from Wix catalogs, the following values always apply:\n   * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n   * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n   * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n   */\n  appId?: string | null;\n  /** Whether tax is included in the price. */\n  taxIncludedInPrice?: boolean | null;\n  /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */\n  addressIndex?: AddressIndex;\n}\n\n/** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */\nexport interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {\n  /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */\n  singleAddress?: number;\n  /**\n   * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,\n   * as well as the address the item is shipped to.\n   */\n  multipleAddresses?: MultipleAddresses;\n}\n\n/** @oneof */\nexport interface AddressIndexAddressIndexOptionsOneOf {\n  /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */\n  singleAddress?: number;\n  /**\n   * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,\n   * as well as the address the item is shipped to.\n   */\n  multipleAddresses?: MultipleAddresses;\n}\n\n/**\n * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item\n * is shipped from, as well as the address the item is shipped to.\n */\nexport interface MultipleAddresses {\n  /** Index of the origin address. */\n  origin?: number;\n  /** Index of the destination address. */\n  destination?: number;\n}\n\nexport interface CalculateTaxResponse {\n  /** Optional ID of the entity that tax is being calculated for. For example, a cart ID. */\n  externalId?: string | null;\n  /** 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */\n  currency?: string;\n  /** Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. */\n  addresses?: Address[];\n  /** Summary of the tax calculated. */\n  taxSummary?: TaxSummary;\n  /** Details of each tax applied to each line item. */\n  lineItemTaxDetails?: LineItemTaxDetails[];\n  /** Errors that occurred during the tax calculation. */\n  errors?: ApplicationError[];\n}\n\nexport interface TaxSummary {\n  /** Total price for all line items. */\n  totalAmount?: string;\n  /**\n   * Total amount of tax calculated for all line items.\n   * Note that due to rounding, `totalTax` may not equal the sum of `lineItemTaxDetails.taxSummary.taxAmount`.\n   */\n  totalTax?: string;\n  /** Total taxable amount for all line items. */\n  totalTaxableAmount?: string;\n  /** Total amount of `totalTax` that is included in price. Applies to line items with `taxIncludedInPrice` set to `true`. */\n  totalTaxIncludedInPrice?: string;\n  /** Array of each tax applied, grouped by `\"jurisdiction\"`, `\"jurisdictionType\"`, `\"taxType\"`, `\"taxName\"` and `\"rate\"`. */\n  aggregatedTaxBreakdown?: AggregatedTaxBreakdown[];\n}\n\n/**\n * The summary of the tax breakdown for all the line items. It will hold for each tax name, the aggregated tax amount paid for it and the tax rate.\n * Tax breakdown is the tax amount split to the tax authorities that applied on the line item.\n *\n * Note: Because that the tax is calculated only on the taxable amount, the tax amount may be looks strange.\n * e.g. if you pay 100$ and the tax applies only on 50$ from it with tax rate of 10%,\n * then the tax rate will be remain 10% but tax amount in the breakdown will be 5$ instead of 10$.\n */\nexport interface AggregatedTaxBreakdown {\n  /** Name of the tax that was calculated. */\n  taxName?: string;\n  /** Type of tax that was calculated. */\n  taxType?: string;\n  /** Jurisdiction that taxes were calculated for. */\n  jurisdiction?: string;\n  /** Type of jurisdiction that taxes were calculated for. */\n  jurisdictionType?: JurisdictionType;\n  /** Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `\"0.1000\"` and 200% tax is `\"2.0000\"`. */\n  rate?: string;\n  /** Total amount of this tax for this jurisdiction. */\n  aggregatedTaxAmount?: string;\n}\n\n/** Type of jurisdiction that taxes were calculated for. For example, `\"State\"`, `\"County\"`, `\"City\"`, `\"Special\"`, etc. */\nexport enum JurisdictionType {\n  UNDEFINED = 'UNDEFINED',\n  COUNTRY = 'COUNTRY',\n  STATE = 'STATE',\n  COUNTY = 'COUNTY',\n  CITY = 'CITY',\n  SPECIAL = 'SPECIAL',\n}\n\n/** Tax details for a specific line item. */\nexport interface LineItemTaxDetails {\n  /** Line item ID. */\n  _id?: string;\n  /** Line item name to display. */\n  itemName?: string | null;\n  /** Line item quantity. */\n  quantity?: number;\n  /** Array of each tax applied, grouped by `jurisdiction`. */\n  taxBreakdown?: TaxBreakdown[];\n  /** Summary of this line item's total price and tax. */\n  taxSummary?: LineItemTaxSummary;\n  /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */\n  addressIndex?: AddressIndex;\n  /** Whether tax is included in the price. */\n  taxIncludedInPrice?: boolean;\n}\n\n/** A detailed description of all the tax authorities applied on this item. */\nexport interface TaxBreakdown {\n  /** Jurisdiction that taxes were calculated for. */\n  jurisdiction?: string | null;\n  /** Non-taxable amount of the price. */\n  nonTaxableAmount?: string | null;\n  /** Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `\"0.1000\"` and 200% tax is `\"2.0000\"`. */\n  rate?: string | null;\n  /** Amount of this tax calculated for this jurisdiction. */\n  taxAmount?: string | null;\n  /** Taxable amount of the price. */\n  taxableAmount?: string | null;\n  /** Type of tax that was calculated. For example, `\"Sales Tax\"`, `\"Income Tax\"`, `\"Value Added Tax\"`, etc. */\n  taxType?: string | null;\n  /** Name of the tax that was calculated. For example, `\"NY State Sales Tax\"`, `\"Quebec GST\"`, etc. */\n  taxName?: string | null;\n  /** Type of jurisdiction that taxes were calculated for. For example, `\"State\"`, `\"Çounty\"`, `\"City\"`, `\"Special\"`, etc. */\n  jurisdictionType?: JurisdictionType;\n}\n\nexport interface LineItemTaxSummary {\n  /**\n   * Total price for this line item.\n   * To determine the price for each individual unit of this line item, divide by `quantity`.\n   */\n  fullPrice?: string | null;\n  /** Total amount of tax calculated for this line item. */\n  taxAmount?: string;\n  /** Total taxable amount for this line item. */\n  taxableAmount?: string;\n  /** ID of the calculator app that calculated tax for this line item. */\n  appId?: string | null;\n}\n\nexport interface ApplicationError {\n  /** Error code. */\n  code?: string;\n  /** Description of the error. */\n  description?: string;\n  /** Data related to the error. */\n  data?: Record<string, any> | null;\n}\n\nexport interface ListTaxCalculatorsRequest {}\n\nexport interface ListTaxCalculatorsResponse {\n  /** Retrieved tax calculators. */\n  taxCalculatorDetails?: TaxCalculatorDetails[];\n}\n\nexport interface TaxCalculatorDetails {\n  /** ID of the tax calculator. */\n  appId?: string;\n  /** Display name of the tax calculator. */\n  displayName?: string;\n  /** List of countries, in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format, that the calculator does not support. */\n  unsupportedCountries?: string[];\n}\n\ninterface AggregatedTaxBreakdownNonNullableFields {\n  taxName: string;\n  taxType: string;\n  jurisdiction: string;\n  jurisdictionType: JurisdictionType;\n  rate: string;\n  aggregatedTaxAmount: string;\n  aggregatedTaxableAmount: string;\n}\n\ninterface TaxSummaryNonNullableFields {\n  totalAmount: string;\n  totalTax: string;\n  totalTaxableAmount: string;\n  totalTaxIncludedInPrice: string;\n  aggregatedTaxBreakdown: AggregatedTaxBreakdownNonNullableFields[];\n}\n\ninterface TaxBreakdownNonNullableFields {\n  jurisdictionType: JurisdictionType;\n}\n\ninterface LineItemTaxSummaryNonNullableFields {\n  taxAmount: string;\n  taxableAmount: string;\n}\n\ninterface MultipleAddressesNonNullableFields {\n  origin: number;\n  destination: number;\n}\n\ninterface AddressIndexNonNullableFields {\n  singleAddress: number;\n  multipleAddresses?: MultipleAddressesNonNullableFields;\n}\n\ninterface LineItemTaxDetailsNonNullableFields {\n  _id: string;\n  quantity: number;\n  taxBreakdown: TaxBreakdownNonNullableFields[];\n  taxSummary?: LineItemTaxSummaryNonNullableFields;\n  addressIndex?: AddressIndexNonNullableFields;\n  taxIncludedInPrice: boolean;\n}\n\ninterface ApplicationErrorNonNullableFields {\n  code: string;\n  description: string;\n}\n\nexport interface CalculateTaxResponseNonNullableFields {\n  currency: string;\n  taxSummary?: TaxSummaryNonNullableFields;\n  lineItemTaxDetails: LineItemTaxDetailsNonNullableFields[];\n  errors: ApplicationErrorNonNullableFields[];\n}\n\ninterface TaxCalculatorDetailsNonNullableFields {\n  appId: string;\n  displayName: string;\n  unsupportedCountries: string[];\n}\n\nexport interface ListTaxCalculatorsResponseNonNullableFields {\n  taxCalculatorDetails: TaxCalculatorDetailsNonNullableFields[];\n}\n\n/**\n * Calculates tax for the provided line items.\n *\n * Tax is calculated for each line item based on the tax region\n * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for\n * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the\n * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.\n *\n * The tax is calculated by a tax calculator app installed on the site.\n * Call List Tax Calculators to see which tax calculators are available.\n * To provide your own tax calculations, use the Tax Calculation service plugin.\n *\n * The breakdown of calculated tax returned, includes:\n * + `taxSummary`: The overall total tax calculated.\n * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.\n * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.\n * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.\n * @public\n * @documentationMaturity preview\n * @requiredField options.addresses\n * @requiredField options.lineItems\n * @requiredField options.lineItems._id\n * @requiredField options.lineItems.addressIndex\n * @requiredField options.lineItems.price\n * @param options - Calculate tax options.\n * @permissionId BILLING.CALCULATE_TAX\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.billing.v1.TaxCalculation.CalculateTax\n */\nexport async function calculateTax(\n  options?: CalculateTaxOptions\n): Promise<CalculateTaxResponse & CalculateTaxResponseNonNullableFields> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = transformPaths(\n    renameKeysFromSDKRequestToRESTRequest({\n      externalId: options?.externalId,\n      currency: options?.currency,\n      addresses: options?.addresses,\n      lineItems: options?.lineItems,\n    }),\n    [\n      {\n        transformFn: transformSDKAddressToRESTAddress,\n        paths: [{ path: 'addresses', isRepeated: true }],\n      },\n    ]\n  );\n\n  const reqOpts =\n    ambassadorWixGatewaysBillingV1TaxCalculationGateway.calculateTax(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(result.data, [\n        {\n          transformFn: transformRESTAddressToSDKAddress,\n          paths: [{ path: 'addresses', isRepeated: true }],\n        },\n      ])\n    )!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          externalId: '$[0].externalId',\n          currency: '$[0].currency',\n          addresses: '$[0].addresses',\n          lineItems: '$[0].lineItems',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CalculateTaxOptions {\n  /** Optional ID of the entity that tax is being calculated for. For example, a cart ID. */\n  externalId?: string | null;\n  /** 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */\n  currency?: string;\n  /** Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. */\n  addresses: Address[];\n  /** Line items to calculate tax for. */\n  lineItems: LineItem[];\n}\n\n/**\n * Retrieves a list of installed tax calculators.\n *\n * Wix uses these calculators to calculate tax.\n * @public\n * @documentationMaturity preview\n * @permissionId BILLING.TAX_CALCULATORS_READ\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @applicableIdentity APP\n * @fqn wix.billing.v1.TaxCalculation.ListTaxCalculators\n */\nexport async function listTaxCalculators(): Promise<\n  ListTaxCalculatorsResponse & ListTaxCalculatorsResponseNonNullableFields\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n  const reqOpts =\n    ambassadorWixGatewaysBillingV1TaxCalculationGateway.listTaxCalculators(\n      payload\n    );\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {},\n        singleArgumentUnchanged: false,\n      },\n      []\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBillingV1TaxCalculationUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/billing/v1/calculate-tax',\n        destPath: '/v1/calculate-tax',\n      },\n      {\n        srcPath: '/billing/v1/list-tax-calculators',\n        destPath: '/v1/list-tax-calculators',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/billing/v1/calculate-tax',\n        destPath: '/v1/calculate-tax',\n      },\n      {\n        srcPath: '/billing/v1/list-tax-calculators',\n        destPath: '/v1/list-tax-calculators',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tax-calculation';\n\n/**\n * Calculates tax for the provided line items.\n *\n * Tax is calculated for each line item based on the tax region\n * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for\n * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the\n * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.\n *\n * The tax is calculated by a tax calculator app installed on the site.\n * Call List Tax Calculators to see which tax calculators are available.\n * To provide your own tax calculations, use the Tax Calculation service plugin.\n *\n * The breakdown of calculated tax returned, includes:\n * + `taxSummary`: The overall total tax calculated.\n * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.\n * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.\n * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.\n */\nexport function calculateTax(payload: object): RequestOptionsFactory<any> {\n  function __calculateTax({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.gateways.billing.v1.tax_calculation_gateway',\n      method: 'POST' as any,\n      methodFqn: 'wix.billing.v1.TaxCalculation.CalculateTax',\n      packageName: PACKAGE_NAME,\n      url: resolveWixBillingV1TaxCalculationUrl({\n        protoPath: '/v1/calculate-tax',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __calculateTax;\n}\n\n/**\n * Retrieves a list of installed tax calculators.\n *\n * Wix uses these calculators to calculate tax.\n */\nexport function listTaxCalculators(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __listTaxCalculators({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.gateways.billing.v1.tax_calculation_gateway',\n      method: 'GET' as any,\n      methodFqn: 'wix.billing.v1.TaxCalculation.ListTaxCalculators',\n      packageName: PACKAGE_NAME,\n      url: resolveWixBillingV1TaxCalculationUrl({\n        protoPath: '/v1/list-tax-calculators',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __listTaxCalculators;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n  CalculateTaxOptions,\n  CalculateTaxResponse,\n  CalculateTaxResponseNonNullableFields,\n  ListTaxCalculatorsResponse,\n  ListTaxCalculatorsResponseNonNullableFields,\n  calculateTax as universalCalculateTax,\n  listTaxCalculators as universalListTaxCalculators,\n} from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function calculateTax(httpClient: HttpClient): CalculateTaxSignature {\n  return (options?: CalculateTaxOptions) =>\n    universalCalculateTax(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CalculateTaxSignature {\n  /**\n   * Calculates tax for the provided line items.\n   *\n   * Tax is calculated for each line item based on the tax region\n   * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for\n   * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the\n   * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.\n   *\n   * The tax is calculated by a tax calculator app installed on the site.\n   * Call List Tax Calculators to see which tax calculators are available.\n   * To provide your own tax calculations, use the Tax Calculation service plugin.\n   *\n   * The breakdown of calculated tax returned, includes:\n   * + `taxSummary`: The overall total tax calculated.\n   * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.\n   * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.\n   * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.\n   * @param - Calculate tax options.\n   */\n  (options?: CalculateTaxOptions | undefined): Promise<\n    CalculateTaxResponse & CalculateTaxResponseNonNullableFields\n  >;\n}\n\nexport function listTaxCalculators(\n  httpClient: HttpClient\n): ListTaxCalculatorsSignature {\n  return () =>\n    universalListTaxCalculators(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ListTaxCalculatorsSignature {\n  /**\n   * Retrieves a list of installed tax calculators.\n   *\n   * Wix uses these calculators to calculate tax.\n   */\n  (): Promise<\n    ListTaxCalculatorsResponse & ListTaxCalculatorsResponseNonNullableFields\n  >;\n}\n\nexport {\n  Address,\n  AddressIndex,\n  AddressIndexAddressIndexOptionsOneOf,\n  AggregatedTaxBreakdown,\n  ApplicationError,\n  CalculateTaxOptions,\n  CalculateTaxRequest,\n  CalculateTaxResponse,\n  CalculateTaxResponseNonNullableFields,\n  JurisdictionType,\n  LineItem,\n  LineItemTaxDetails,\n  LineItemTaxSummary,\n  ListTaxCalculatorsRequest,\n  ListTaxCalculatorsResponse,\n  ListTaxCalculatorsResponseNonNullableFields,\n  MultipleAddresses,\n  TaxBreakdown,\n  TaxCalculationGateway,\n  TaxCalculatorDetails,\n  TaxSummary,\n} from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';\n","import {\n  calculateTax as publicCalculateTax,\n  listTaxCalculators as publicListTaxCalculators,\n} from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const calculateTax: MaybeContext<\n  BuildRESTFunction<typeof publicCalculateTax> & typeof publicCalculateTax\n> = /*#__PURE__*/ createRESTModule(publicCalculateTax);\nexport const listTaxCalculators: MaybeContext<\n  BuildRESTFunction<typeof publicListTaxCalculators> &\n    typeof publicListTaxCalculators\n> = /*#__PURE__*/ createRESTModule(publicListTaxCalculators);\n\nexport { JurisdictionType } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';\nexport {\n  TaxCalculationGateway,\n  CalculateTaxRequest,\n  Address,\n  LineItem,\n  AddressIndex,\n  AddressIndexAddressIndexOptionsOneOf,\n  MultipleAddresses,\n  CalculateTaxResponse,\n  TaxSummary,\n  AggregatedTaxBreakdown,\n  LineItemTaxDetails,\n  TaxBreakdown,\n  LineItemTaxSummary,\n  ApplicationError,\n  ListTaxCalculatorsRequest,\n  ListTaxCalculatorsResponse,\n  TaxCalculatorDetails,\n  CalculateTaxResponseNonNullableFields,\n  ListTaxCalculatorsResponseNonNullableFields,\n  CalculateTaxOptions,\n} from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,qCACP,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,U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B,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEhdO,SAASC,cAAa,YAA+C;AAC1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AA2BO,SAASC,oBACd,YAC6B;AAC7B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnDA,SAAS,wBAAwB;AAG1B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,sBAGK,iCAAiBA,mBAAwB;","names":["JurisdictionType","calculateTax","listTaxCalculators","calculateTax","listTaxCalculators","calculateTax","listTaxCalculators"]}