{"version":3,"file":"index-DaVNzrL8.js","sources":["../../../app/javascript/src/explore/elements/SectionBreak/index.tsx","../../../app/javascript/src/explore/hooks/useSettings/index.ts","../../../app/javascript/src/explore/compositions/SSOButtons/elements/SocialButton/index.tsx","../../../app/javascript/src/explore/compositions/SSOButtons/index.tsx"],"sourcesContent":["import React from 'react';\nimport cls from 'classnames';\n\nimport styles from './index.module.sass';\n\ntype Props = {\n className?: string;\n title: string;\n};\n\nexport const SectionBreak: React.FC<Props> = ({ className, title }) => (\n <div className={cls( styles.container, className )}>\n <hr className={styles.rule} />\n <div className={styles.title}>{title}</div>\n <hr className={styles.rule} />\n </div>\n);\n","// TODO: this should become a Context once we move to a SPA\nimport { useSelector } from 'react-redux';\nimport { IStore } from 'src/explore/types/store';\n\nexport const useSettings = () => useSelector(( state: IStore ) => state.data.settings );\n","import * as React from 'react';\nimport cls from 'classnames';\n\nimport { Button } from '@goldbely/explore-component-library';\nimport styles from './index.module.sass';\n\ninterface Props {\n children?: React.ReactNode;\n className?: string;\n href: string;\n icon: React.ReactNode;\n}\n\nexport const SocialButton: React.FC<Props> = ({ children, className, href, icon }) => {\n const handleClick = ( event: { currentTarget: any }) => {\n const target = event.currentTarget;\n setTimeout(() => {\n // If we disable synchronously than the form won't be submitted, queue it to be done immediately\n target.disabled = true;\n }, 0 );\n };\n\n return (\n <form action={href} method=\"post\" className={cls( 'no-track', styles.container )}>\n <Button\n type=\"submit\"\n variant=\"secondary\"\n outline\n fullWidth\n className={cls( 'no-track', styles.button, className )}\n data-turbolinks=\"false\"\n data-submit=\"false\"\n onClick={handleClick}\n >\n <span className={styles.icon}>{icon}</span>\n <span className={styles.text}>{children}</span>\n </Button>\n </form>\n );\n};\n","import * as React from 'react';\nimport cls from 'classnames';\n\nimport { SectionBreak } from 'src/explore/elements/SectionBreak';\nimport { SvgUse } from 'src/shoppe/elements/SvgUse';\nimport { useRoutes } from 'src/explore/hooks/useRoutes';\nimport { useSettings } from 'src/explore/hooks/useSettings';\nimport { isNativeMobileApp } from 'src/explore/services/mobile';\n\nimport { SocialButton } from './elements/SocialButton';\n\nimport styles from './index.module.sass';\n\ninterface Props {\n ssoOrigin?: string;\n}\n\nexport const SSOButtons: React.FC<Props> = ({ ssoOrigin }) => {\n const routes = useRoutes();\n const settings = useSettings();\n\n if ( settings?.mobileApp?.showSso !== 't' && isNativeMobileApp()) {\n return null;\n }\n\n return (\n <>\n <SectionBreak className={styles.sectionBreak} title=\"OR\" />\n <div className={styles.authButtons}>\n {!isNativeMobileApp() && (\n <SocialButton\n className=\"spec__google-sso\"\n href={routes.auth.google( ssoOrigin )}\n icon={<SvgUse ariaLabel=\"Google\" className={cls( styles.icon )} name=\"social-google\" />}\n >\n Continue with Google\n </SocialButton>\n )}\n <SocialButton\n className=\"spec__apple-sso\"\n href={routes.auth.apple( ssoOrigin )}\n icon={\n <SvgUse\n ariaLabel=\"Apple\"\n className={cls( styles.apple, styles.icon )}\n name=\"social-apple\"\n />\n }\n >\n Continue with Apple\n </SocialButton>\n {!isNativeMobileApp() && (\n <SocialButton\n className=\"spec__facebook-sso\"\n href={routes.auth.facebook( ssoOrigin )}\n icon={\n <SvgUse ariaLabel=\"Facebook\" className={cls( styles.icon )} name=\"social-facebook\" />\n }\n >\n Continue with Facebook\n </SocialButton>\n )}\n </div>\n </>\n );\n};\n"],"names":["SectionBreak","className","title","React","cls","styles","useSettings","useSelector","state","SocialButton","children","href","icon","handleClick","event","target","React.createElement","Button","SSOButtons","ssoOrigin","routes","useRoutes","settings","_a","isNativeMobileApp","SvgUse"],"mappings":"gaAUaA,EAAgC,CAAC,CAAE,UAAAC,EAAW,MAAAC,CACzD,IAAAC,EAAA,cAAC,MAAI,CAAA,UAAWC,EAAKC,EAAO,UAAWJ,CAAU,GAC9CE,EAAA,cAAA,KAAA,CAAG,UAAWE,EAAO,IAAM,CAAA,EAC3BF,EAAA,cAAA,MAAA,CAAI,UAAWE,EAAO,KAAA,EAAQH,CAAM,EACpCC,EAAA,cAAA,KAAA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