{"version":3,"sources":["../../src/google-one-tap/types.ts"],"sourcesContent":["interface ClientConfigError extends Error {\n  message: string;\n  stack?: string;\n  type: 'unknown' | 'popup_closed' | 'popup_failed_to_open';\n}\n\ninterface OverridableTokenClientConfig {\n  scope?: string;\n  include_granted_scopes?: boolean;\n  prompt?: string;\n  enable_granular_consent?: boolean;\n  enable_serial_consent?: boolean;\n  login_hint?: string;\n  hint?: string;\n  state?: string;\n}\n\ninterface TokenClient {\n  requestAccessToken: (overrideConfig?: OverridableTokenClientConfig) => void;\n}\n\ninterface CodeClient {\n  requestCode: () => void;\n}\n\ninterface TokenResponse {\n  access_token: string;\n  expires_in: string;\n  hd: string;\n  prompt: string;\n  token_type: string;\n  scope: string;\n  state: string;\n  error: string;\n  error_description: string;\n  error_uri: string;\n}\n\ninterface CodeResponse {\n  code: string;\n  scope: string;\n  state: string;\n  error: string;\n  error_description: string;\n  error_uri: string;\n}\n\ninterface TokenClientConfig {\n  client_id: string;\n  scope: string;\n  include_granted_scopes?: boolean;\n  prompt?: '' | 'none' | 'consent' | 'select_account';\n  enable_granular_consent?: boolean;\n  enable_serial_consent?: boolean;\n  login_hint?: string;\n  hint?: string;\n  hd?: string;\n  hosted_domain?: string;\n  state?: string;\n  callback: (tokenResponse: TokenResponse) => void;\n  error_callback?: (error: ClientConfigError) => void;\n}\n\ninterface CodeClientConfig {\n  client_id: string;\n  scope: string;\n  include_granted_scopes?: boolean;\n  redirect_uri?: string;\n  state?: string;\n  enable_granular_consent?: boolean;\n  enable_serial_consent?: boolean;\n  login_hint?: string;\n  hint?: string;\n  hd?: string;\n  hosted_domain?: string;\n  ux_mode?: 'popup' | 'redirect';\n  select_account?: boolean;\n  callback?: (response: CodeResponse) => void;\n  error_callback?: (error: ClientConfigError) => void;\n}\n\ninterface RevocationResponse {\n  successful: boolean;\n  error?: string;\n}\n\ninterface Credential {\n  id: string;\n  password: string;\n}\n\nexport interface CredentialResponse {\n  credential: string;\n  select_by: string;\n}\n\nexport interface IdConfiguration {\n  client_id: string;\n  auto_select?: boolean;\n  login_uri?: string;\n  cancel_on_tap_outside?: boolean;\n  prompt_parent_id?: string;\n  nonce?: string;\n  context?: 'signin' | 'signup' | 'use';\n  state_cookie_domain?: string;\n  ux_mode?: 'popup' | 'redirect';\n  allowed_parent_origin?: string | string[];\n  itp_support?: boolean;\n  login_hint?: string;\n  hd?: string;\n  use_fedcm_for_prompt?: boolean;\n  callback?: (response: CredentialResponse) => void;\n  native_callback?: (response: CredentialResponse) => void;\n  intermediate_iframe_close_callback?: () => void;\n}\n/**\n * ref: https://developers.google.com/identity/gsi/web/guides/fedcm-migration?s=dc&utm_source=devtools&utm_campaign=stable#display_moment\n */\nexport interface PromptMomentNotification {\n  /** @deprecated */\n  isDisplayMoment(): boolean;\n\n  /** @deprecated */\n  isDisplayed(): boolean;\n\n  /** @deprecated */\n  isNotDisplayed(): boolean;\n\n  /** @deprecated */\n  getNotDisplayedReason():\n    | 'browser_not_supported'\n    | 'invalid_client'\n    | 'missing_client_id'\n    | 'opt_out_or_no_session'\n    | 'secure_http_required'\n    | 'suppressed_by_user'\n    | 'unregistered_origin'\n    | 'unknown_reason';\n\n  /** @deprecated */\n  getSkippedReason(): 'auto_cancel' | 'user_cancel' | 'tap_outside' | 'issuing_failed';\n\n  isSkippedMoment(): boolean;\n  isDismissedMoment(): boolean;\n  getDismissedReason(): 'credential_returned' | 'cancel_called' | 'flow_restarted';\n  getMomentType(): 'display' | 'skipped' | 'dismissed';\n}\n\ninterface GsiButtonConfiguration {\n  type: 'standard' | 'icon';\n  theme?: 'outline' | 'filled_blue' | 'filled_black';\n  size?: 'small' | 'medium' | 'large';\n  text?: 'signin_with' | 'signup_with' | 'continue_with' | 'signin';\n  shape?: 'rectangular' | 'pill' | 'circle' | 'square';\n  logo_alignment?: 'left' | 'center';\n  width?: number;\n  locale?: string;\n  state?: string;\n  click_listener?: () => void;\n}\n\nexport interface GoogleAccounts {\n  oauth2: {\n    initCodeClient(config: CodeClientConfig): CodeClient;\n    initTokenClient(config: TokenClientConfig): TokenClient;\n    hasGrantedAllScopes(\n      tokenResponse: TokenResponse,\n      firstScope: string,\n      ...restScopes: string[]\n    ): boolean;\n    hasGrantedAnyScope(\n      tokenResponse: TokenResponse,\n      firstScope: string,\n      ...restScopes: string[]\n    ): boolean;\n    revoke(accessToken: string, done: () => void): void;\n  };\n  id: {\n    initialize(idConfig: IdConfiguration): void;\n    prompt(momentListener?: (promptMomentNotification: PromptMomentNotification) => void): void;\n    renderButton(parent: HTMLElement, options: GsiButtonConfiguration): void;\n    disableAutoSelect(): void;\n    storeCredential(credential: Credential, callback?: () => void): void;\n    cancel(): void;\n    revoke(hint: string, callback?: (response: RevocationResponse) => void): void;\n  };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}