{
  "version": 3,
  "sources": ["../../../../src/managers/UnlockPanelManager/helpers/getProviderList.ts"],
  "sourcesContent": ["import { providerLabels } from 'constants/providerFactory.constants';\nimport {\n  ICustomProvider,\n  IProviderBase,\n  ProviderType,\n  ProviderTypeEnum\n} from 'providers/types/providerFactory.types';\n\nexport function getProvidersList(\n  addedCustomProviders: ICustomProvider[] = [],\n  allowedProviders?: ProviderType[] | null\n): IProviderBase[] {\n  const defaultProviderTypes = (\n    Object.values(ProviderTypeEnum) as ProviderType[]\n  ).filter((type) => {\n    const excludedProviders: ProviderType[] = [\n      ProviderTypeEnum.none,\n      ProviderTypeEnum.webview\n    ];\n    return !excludedProviders.includes(type);\n  });\n\n  const allAvailableProviderTypes: ProviderType[] = [\n    ...defaultProviderTypes,\n    ...addedCustomProviders.map((p) => p.type as ProviderType)\n  ];\n\n  const customProviderLabels = addedCustomProviders.reduce(\n    (acc, provider) => {\n      acc[provider.type as ProviderType] = provider.name;\n      return acc;\n    },\n    {} as Record<ProviderType, string>\n  );\n\n  const allAvailableLabels = {\n    ...providerLabels,\n    ...customProviderLabels\n  };\n\n  const allowedProviderTypes: ProviderType[] = allowedProviders\n    ? allowedProviders.filter((type) =>\n        allAvailableProviderTypes.includes(type)\n      )\n    : allAvailableProviderTypes;\n\n  const providerList: IProviderBase[] = allowedProviderTypes.map((type) => {\n    const custom = addedCustomProviders.find(\n      (customProvider) => customProvider.type === type\n    );\n    if (custom) {\n      return custom;\n    }\n\n    return {\n      name: type in allAvailableLabels ? allAvailableLabels[type] : type,\n      type\n    };\n  });\n\n  return providerList;\n}\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA+B,+CAC/BA,EAKO,iDAEA,SAASF,EACdG,EAA0C,CAAC,EAC3CC,EACiB,CAWjB,MAAMC,EAA4C,CAChD,GAVA,OAAO,OAAO,kBAAgB,EAC9B,OAAQC,GAKD,CAJmC,CACxC,mBAAiB,KACjB,mBAAiB,OACnB,EAC0B,SAASA,CAAI,CACxC,EAIC,GAAGH,EAAqB,IAAKI,GAAMA,EAAE,IAAoB,CAC3D,EAEMC,EAAuBL,EAAqB,OAChD,CAACM,EAAKC,KACJD,EAAIC,EAAS,IAAoB,EAAIA,EAAS,KACvCD,GAET,CAAC,CACH,EAEME,EAAqB,CACzB,GAAG,iBACH,GAAGH,CACL,EAsBA,OApB6CJ,EACzCA,EAAiB,OAAQE,GACvBD,EAA0B,SAASC,CAAI,CACzC,EACAD,GAEuD,IAAKC,GAAS,CACvE,MAAMM,EAAST,EAAqB,KACjCU,GAAmBA,EAAe,OAASP,CAC9C,EACA,OAAIM,GAIG,CACL,KAAMN,KAAQK,EAAqBA,EAAmBL,CAAI,EAAIA,EAC9D,KAAAA,CACF,CACF,CAAC,CAGH",
  "names": ["getProviderList_exports", "__export", "getProvidersList", "__toCommonJS", "import_providerFactory", "addedCustomProviders", "allowedProviders", "allAvailableProviderTypes", "type", "p", "customProviderLabels", "acc", "provider", "allAvailableLabels", "custom", "customProvider"]
}
