{"version":3,"file":"AccountSelector.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/AccountSelector.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAuBtD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,eAAe,GAAG,IAAA,+BAAmB,EAGhD,IAAI,CAAC,CAAC","sourcesContent":["import type { CaipAccountId, CaipChainId } from '@metamask/utils';\n\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link AccountSelector} component.\n *\n * @property name - The name of the account selector. This is used to identify the\n * state in the form data.\n * @property hideExternalAccounts - Whether to hide accounts that don't belong to the snap.\n * @property chainIds - The chain IDs to filter the accounts to show.\n * @property switchGlobalAccount - Whether to switch the selected account in the client.\n * @property disabled - Whether the account selector is disabled.\n * @property value - The selected address.\n * @category Component Props\n */\nexport type AccountSelectorProps = {\n  name: string;\n  hideExternalAccounts?: boolean | undefined;\n  chainIds?: CaipChainId[] | undefined;\n  switchGlobalAccount?: boolean | undefined;\n  value?: CaipAccountId | undefined;\n  disabled?: boolean | undefined;\n};\n\nconst TYPE = 'AccountSelector';\n\n/**\n * An account selector component, which is used to create an account selector.\n *\n * @param props - The props of the component.\n * @param props.name - The name of the account selector. This is used to identify the\n * state in the form data.\n * @param props.hideExternalAccounts - Whether to hide accounts that doesn't belong to the snap.\n * @param props.chainIds - The chain IDs to filter the accounts to show.\n * @param props.switchGlobalAccount - Whether to switch the selected account in the client.\n * @param props.value - The selected address.\n * @param props.disabled - Whether the account selector is disabled.\n * @returns An account selector element.\n * @example\n * <AccountSelector name=\"account-selector\" />\n * @example\n * <AccountSelector name=\"account-selector\" hideExternalAccounts />\n * @example\n * <AccountSelector name=\"account-selector\" chainIds={['eip155:1']} />\n * @example\n * <AccountSelector name=\"account-selector\" switchGlobalAccount />\n * @example\n * <AccountSelector name=\"account-selector\" value=\"eip155:1:0x1234...\" />\n * @example\n * <AccountSelector name=\"account-selector\" hideExternalAccounts chainIds={['eip155:1']} switchGlobalAccount value=\"eip155:1:0x1234...\" />\n * @category Components\n */\nexport const AccountSelector = createSnapComponent<\n  AccountSelectorProps,\n  typeof TYPE\n>(TYPE);\n\n/**\n * An account selector element.\n *\n * @see {@link AccountSelector}\n * @category Elements\n */\nexport type AccountSelectorElement = ReturnType<typeof AccountSelector>;\n"]}