{"version":3,"file":"ach.types.es.mjs","sources":["../../../src/components/ach/ach.types.ts"],"sourcesContent":["// Dependencies\nimport type * as React from 'react';\nimport type * as Square from '@square/web-sdk';\nimport type * as Stitches from '@stitches/react';\n\n// Internals\nimport { PayButton, SvgIcon } from './ach.styles';\n\nexport interface PlaidLinkOnEventMetadata {\n  error_type: null | string;\n  error_code: null | string;\n  error_message: null | string;\n  exit_status: null | string;\n  institution_id: null | string;\n  institution_name: null | string;\n  institution_search_query: null | string;\n  mfa_type: null | string;\n  // see possible values for view_name at https://plaid.com/docs/link/web/#link-web-onevent-view-name\n  view_name: null | string;\n  // see possible values for selection at https://plaid.com/docs/link/web/#link-web-onevent-selection\n  selection: null | string;\n  // ISO 8601 format timestamp\n  timestamp: string;\n  link_session_id: string;\n  request_id: string;\n}\n\n// The following event names are stable and will not be deprecated or changed\nexport enum PlaidLinkStableEvent {\n  OPEN = 'OPEN',\n  EXIT = 'EXIT',\n  HANDOFF = 'HANDOFF',\n  SELECT_INSTITUTION = 'SELECT_INSTITUTION',\n  ERROR = 'ERROR',\n}\n\nexport type AchPayButtonProps = Omit<\n  React.ComponentPropsWithoutRef<'button'>,\n  'aria-disabled' | 'disabled' | 'type'\n> & {\n  /**\n   * Sets the style for the Payment Button using a CSS object\n   *\n   * @example\n   *\n   * ```js\n   * const overrideStyles = {\n   *   background: 'white',\n   *   '&:hover': {\n   *     background: 'rgba(1, 208, 158, 0.1)',\n   *   },\n   * };\n   * ```\n   */\n  css?: Stitches.ComponentProps<typeof PayButton>['css'];\n  /** Control the loading state of the button a.k.a disabling the button. */\n  isLoading?: boolean;\n};\n\nexport type SvgProps = React.ComponentPropsWithRef<'svg'> & {\n  /**\n   * Sets the style for the SVG using a CSS object\n   *\n   * @example\n   *\n   * ```js\n   * const overrideStyles = {\n   *   background: 'white',\n   *   '&:hover': {\n   *     background: 'rgba(1, 208, 158, 0.1)',\n   *   },\n   * };\n   * ```\n   */\n  css?: Stitches.ComponentProps<typeof SvgIcon>['css'];\n};\n\nexport interface AchBase extends Square.AchOptions {\n  callbacks?: {\n    /** The user has completed the Assets and Bank Income Insights flow. */\n    bankIncomeInsightsCompleted?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user closed the third-party website or mobile app without completing\n     * the OAuth flow.\n     */\n    closeOauth?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** A recoverable error occurred in the Link flow, see the `error_code` metadata. */\n    error?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user has exited without completing the Link flow and the\n     * [onExit](https://plaid.com/docs/link/web/#onexit) callback is fired.\n     */\n    exit?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user encountered an error while completing the third-party's OAuth login flow. */\n    failOauth?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user has exited Link after successfully linking an Item. */\n    handoff?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user selected an institution that was presented as a matched institution. */\n    matchedSelectInstitution?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user selected a verification method for a matched institution. */\n    matchedSelectVerifyMethod?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user has opened Link. */\n    open?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user has opened my.plaid.com. This event is only sent when Link is\n     * initialized with Assets as a product\n     */\n    openMyPlaid?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user has navigated to a third-party website or mobile app in order to\n     * complete the OAuth login flow.\n     */\n    openOauth?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user has searched for an institution. */\n    searchInstitution?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user selected a brand, e.g. Bank of America. The `SELECT_BRAND` event\n     * is only emitted for large financial institutions with multiple online\n     * banking portals.\n     */\n    selectBrand?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user selected an instititon with a `DEGRADED` health status and were\n     * shown a corresponding message.\n     */\n    selectDegradedInstitution?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user selected an instititon with a `DOWN` health status and were\n     * shown a corresponding message.\n     */\n    selectDownInstitution?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user selected an institution. */\n    selectInstitution?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user has submitted credentials. */\n    submitCredentials?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user is being prompted to submit documents for an Income verification flow. */\n    submitDocuments?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The user encountered an error when submitting documents for an Income\n     * verification flow.\n     */\n    submitDocumentsError?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /** The user has submitted MFA. */\n    submitMfa?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n    /**\n     * The `TRANSITION_VIEW` event indicates that the user has moved from one\n     * view to the next.\n     */\n    transitionView?(event: Square.SqEvent<PlaidLinkOnEventMetadata>): void;\n  };\n}\n\nexport interface AchWithChildrenProps extends AchBase {\n  /**\n   * The children of the button to override icon and text, you can put any\n   * component inside the button.\n   */\n  children?: React.ReactNode;\n}\n\nexport interface AchWithoutChildrenProps extends AchBase {\n  /**\n   * Props to be passed to the `<button>` element. The following props are not\n   * supported: `aria-disabled`, `disabled`, `type`. Since we use that to\n   * control the disabled state of the button, we don't support it.\n   *\n   * But in addition to this we offer a `isLoading` prop to control the loading\n   * state of the button a.k.a disabling the button.\n   */\n  buttonProps?: AchPayButtonProps;\n  /** Props to be passed to the `<svg>` element. */\n  svgProps?: SvgProps;\n}\n\nexport interface AchProps extends AchBase {\n  /**\n   * The children of the button to override icon and text, you can put any\n   * component inside the button.\n   */\n  children?: React.ReactNode;\n  /**\n   * Props to be passed to the `<button>` element. The following props are not\n   * supported: `aria-disabled`, `disabled`, `type`. Since we use that to\n   * control the disabled state of the button, we don't support it.\n   *\n   * But in addition to this we offer a `isLoading` prop to control the loading\n   * state of the button a.k.a disabling the button.\n   */\n  buttonProps?: AchPayButtonProps;\n  /** Props to be passed to the `<svg>` element. */\n  svgProps?: SvgProps;\n  /** Props to be passed to the ach.tokenize method */\n  accountHolderName: string;\n  redirectURI?: string;\n}\n"],"names":["PlaidLinkStableEvent"],"mappings":"AA4BY,IAAAA,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,qBAAqB,sBACrBA,EAAA,QAAQ,SALEA,IAAAA,KAAA,CAAA,CAAA;"}