{"version":3,"file":"client.login-button_B2EnT95x.da.esm.js","sources":["../../src/__deprecated__/common/shop-swirl.ts","../../src/__deprecated__/components/loginButton/components/modal-content.ts","../../src/__deprecated__/components/loginButton/components/follow-on-shop-button.ts","../../src/__deprecated__/components/loginButton/components/store-logo.ts","../../src/__deprecated__/components/loginButton/shop-follow-button.ts","../../src/__deprecated__/components/loginButton/init.ts"],"sourcesContent":["import {pickLogoColor} from './colors';\nimport {defineCustomElement} from './init';\n\nexport class ShopSwirl extends HTMLElement {\n constructor() {\n super();\n\n const template = document.createElement('template');\n const size = this.getAttribute('size');\n // If not specified, will assume a white background and render the purple logo.\n const backgroundColor = this.getAttribute('background-color') || '#FFF';\n\n template.innerHTML = getTemplateContents(\n size ? Number.parseInt(size, 10) : undefined,\n backgroundColor,\n );\n\n this.attachShadow({mode: 'open'}).appendChild(\n template.content.cloneNode(true),\n );\n }\n}\n\n/**\n * @param {number} size size of the logo.\n * @param {string} backgroundColor hex or rgb string for background color.\n * @returns {string} HTML content for the logo.\n */\nfunction getTemplateContents(size = 36, backgroundColor: string) {\n const [red, green, blue] = pickLogoColor(backgroundColor);\n const color = `rgb(${red}, ${green}, ${blue})`;\n const sizeRatio = 23 / 20;\n const height = size;\n const width = Math.round(height / sizeRatio);\n\n return `\n \n \n \n \n `;\n}\n\n/**\n * Define the shop-swirl custom element.\n */\nexport function defineElement() {\n defineCustomElement('shop-swirl', ShopSwirl);\n}\n","import {colors} from '../../../common/colors';\nimport {\n createStatusIndicator,\n ShopStatusIndicator,\n StatusIndicatorLoader,\n} from '../../../common/shop-status-indicator';\nimport {\n AuthorizeState,\n LoginButtonProcessingStatus as ProcessingStatus,\n} from '../../../types';\n\nexport const ELEMENT_CLASS_NAME = 'shop-modal-content';\n\ninterface Content {\n title?: string;\n description?: string;\n disclaimer?: string;\n authorizeState?: AuthorizeState;\n email?: string;\n status?: ProcessingStatus;\n}\n\nexport class ModalContent extends HTMLElement {\n #rootElement: ShadowRoot;\n\n // Header Elements\n #headerWrapper!: HTMLDivElement;\n #headerTitle!: HTMLHeadingElement;\n #headerDescription!: HTMLDivElement;\n\n // Main Content Elements\n #contentWrapper!: HTMLDivElement;\n #contentProcessingWrapper!: HTMLDivElement;\n #contentProcessingUser!: HTMLDivElement;\n #contentStatusIndicator?: ShopStatusIndicator;\n #contentChildrenWrapper!: HTMLDivElement;\n\n // Disclaimer Elements\n #disclaimerText!: HTMLDivElement;\n\n // Storage for content\n #contentStore: Content = {};\n\n constructor() {\n super();\n\n const template = document.createElement('template');\n template.innerHTML = getContent();\n this.#rootElement = this.attachShadow({mode: 'open'});\n this.#rootElement.appendChild(template.content.cloneNode(true));\n\n this.#headerWrapper = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}`,\n )!;\n this.#headerTitle = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-title`,\n )!;\n this.#headerDescription = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-description`,\n )!;\n this.#contentWrapper = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-content`,\n )!;\n this.#contentProcessingWrapper = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-processing`,\n )!;\n this.#contentProcessingUser = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-processing-user`,\n )!;\n this.#contentChildrenWrapper = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-children`,\n )!;\n this.#disclaimerText = this.#rootElement.querySelector(\n `.${ELEMENT_CLASS_NAME}-disclaimer`,\n )!;\n }\n\n hideDivider() {\n this.#headerWrapper.classList.add('hide-divider');\n }\n\n showDivider() {\n this.#headerWrapper.classList.remove('hide-divider');\n }\n\n update(content: Content) {\n this.#contentStore = {\n ...this.#contentStore,\n ...content,\n };\n\n this.#updateHeader();\n this.#updateMainContent();\n this.#updateDisclaimer();\n }\n\n #updateHeader() {\n const {title, description, authorizeState} = this.#contentStore;\n const visible = title || description;\n\n this.#headerWrapper.classList.toggle('hidden', !visible);\n this.#headerTitle.classList.toggle('hidden', !title);\n this.#headerDescription.classList.toggle('hidden', !description);\n\n this.#headerTitle.textContent = title || '';\n this.#headerDescription.textContent = description || '';\n\n if (authorizeState) {\n this.#headerWrapper.classList.toggle(\n 'hide-divider',\n authorizeState === AuthorizeState.Start,\n );\n\n this.#headerWrapper.classList.toggle(\n `${ELEMENT_CLASS_NAME}--small`,\n authorizeState === AuthorizeState.Start,\n );\n }\n }\n\n #updateMainContent() {\n const {authorizeState, status, email} = this.#contentStore;\n const contentWrapperVisible = Boolean(authorizeState || status);\n const processingWrapperVisible = Boolean(status && email);\n const childrenWrapperVisible = Boolean(\n contentWrapperVisible && !processingWrapperVisible,\n );\n\n this.#contentWrapper.classList.toggle('hidden', !contentWrapperVisible);\n this.#contentProcessingWrapper.classList.toggle(\n 'hidden',\n !processingWrapperVisible,\n );\n this.#contentChildrenWrapper.classList.toggle(\n 'hidden',\n !childrenWrapperVisible,\n );\n\n if (!this.#contentStatusIndicator && processingWrapperVisible) {\n const loaderType =\n authorizeState === AuthorizeState.OneClick\n ? StatusIndicatorLoader.Branded\n : StatusIndicatorLoader.Regular;\n this.#contentStatusIndicator = createStatusIndicator(loaderType);\n this.#contentProcessingWrapper.appendChild(this.#contentStatusIndicator);\n this.#contentStatusIndicator?.setStatus({\n status: 'loading',\n message: '',\n });\n }\n\n this.#contentProcessingUser.textContent = email || '';\n }\n\n #updateDisclaimer() {\n const {disclaimer} = this.#contentStore;\n const visible = Boolean(disclaimer);\n\n this.#disclaimerText.classList.toggle('hidden', !visible);\n this.#disclaimerText.innerHTML = disclaimer || '';\n }\n}\n\n/**\n * @returns {string} element styles and content\n */\nfunction getContent() {\n return `\n \n
\n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n `;\n}\n\nif (!customElements.get('shop-modal-content')) {\n customElements.define('shop-modal-content', ModalContent);\n}\n\n/**\n * helper function which creates a new modal content element\n * @param {object} content modal content\n * @param {boolean} hideDivider whether the bottom divider should be hidden\n * @returns {ModalContent} a new ModalContent element\n */\nexport function createModalContent(\n content: Content,\n hideDivider = false,\n): ModalContent {\n const modalContent = document.createElement(\n 'shop-modal-content',\n ) as ModalContent;\n if (hideDivider) {\n modalContent.hideDivider();\n }\n modalContent.update(content);\n\n return modalContent;\n}\n","import {I18n} from '../../../common/translator/i18n';\nimport {\n ShopLogo,\n createShopHeartIcon,\n ShopHeartIcon,\n} from '../../../common/svg';\nimport Bugsnag from '../../../common/bugsnag';\nimport {calculateContrast, inferBackgroundColor} from '../../../common/colors';\n\nconst ATTRIBUTE_FOLLOWING = 'following';\n\nexport class FollowOnShopButton extends HTMLElement {\n private _rootElement: ShadowRoot | null = null;\n private _button: HTMLButtonElement | null = null;\n private _wrapper: HTMLSpanElement | null = null;\n private _heartIcon: ShopHeartIcon | null = null;\n private _followSpan: HTMLSpanElement | null = null;\n private _followingSpan: HTMLSpanElement | null = null;\n private _i18n: I18n | null = null;\n private _followTextWidth = 0;\n private _followingTextWidth = 0;\n\n constructor() {\n super();\n\n if (!customElements.get('shop-logo')) {\n customElements.define('shop-logo', ShopLogo);\n }\n }\n\n async connectedCallback(): Promise {\n await this._initTranslations();\n this._initElements();\n }\n\n setFollowing({\n following = true,\n skipAnimation = false,\n }: {\n following?: boolean;\n skipAnimation?: boolean;\n }) {\n this._button?.classList.toggle(`button--animating`, !skipAnimation);\n this._button?.classList.toggle(`button--following`, following);\n\n if (this._followSpan !== null && this._followingSpan !== null) {\n this._followSpan.ariaHidden = following ? 'true' : 'false';\n this._followingSpan.ariaHidden = following ? 'false' : 'true';\n }\n\n this.style.setProperty(\n '--button-width',\n `${following ? this._followingTextWidth : this._followTextWidth}px`,\n );\n\n if (\n window.matchMedia(`(prefers-reduced-motion: reduce)`).matches ||\n skipAnimation\n ) {\n this._heartIcon?.setFilled(following);\n } else {\n this._button\n ?.querySelector('.follow-text')\n ?.addEventListener('transitionend', () => {\n this._heartIcon?.setFilled(following);\n });\n }\n }\n\n setFocused() {\n this._button?.focus();\n }\n\n private async _initTranslations() {\n try {\n // BUILD_LOCALE is used for generating localized bundles.\n // See ./scripts/i18n-dynamic-import-replacer-rollup.mjs for more info.\n // eslint-disable-next-line no-process-env\n const locale = process.env.BUILD_LOCALE || I18n.getDefaultLanguage();\n const dictionary = await import(`../translations/${locale}.json`);\n this._i18n = new I18n({[locale]: dictionary});\n } catch (error) {\n if (error instanceof Error) {\n Bugsnag.notify(error);\n }\n }\n return null;\n }\n\n private _initElements() {\n const template = document.createElement('template');\n template.innerHTML = getTemplateContents();\n\n this._rootElement = this.attachShadow({mode: 'open'});\n this._rootElement.appendChild(template.content.cloneNode(true));\n\n if (this._i18n) {\n const followText = this._i18n.translate('follow_on_shop.follow', {\n shop: getShopLogoHtml('white'),\n });\n const followingText = this._i18n.translate('follow_on_shop.following', {\n shop: getShopLogoHtml('black'),\n });\n this._rootElement.querySelector('slot[name=\"follow-text\"]')!.innerHTML =\n followText;\n this._rootElement.querySelector(\n 'slot[name=\"following-text\"]',\n )!.innerHTML = followingText;\n }\n\n this._button = this._rootElement.querySelector(`.button`)!;\n this._wrapper = this._button.querySelector(`.follow-icon-wrapper`)!;\n this._followSpan = this._rootElement?.querySelector('span.follow-text');\n this._followingSpan = this._rootElement?.querySelector(\n 'span.following-text',\n );\n\n this._heartIcon = createShopHeartIcon();\n this._wrapper.prepend(this._heartIcon);\n\n this._followTextWidth =\n this._rootElement.querySelector('.follow-text')?.scrollWidth || 0;\n this._followingTextWidth =\n this._rootElement.querySelector('.following-text')?.scrollWidth || 0;\n this.style.setProperty(\n '--reserved-width',\n `${Math.max(this._followTextWidth, this._followingTextWidth)}px`,\n );\n\n this.setFollowing({\n following: this.hasAttribute(ATTRIBUTE_FOLLOWING),\n skipAnimation: true,\n });\n\n this._setButtonStyle();\n }\n\n /**\n * Adds extra classes to the parent button component depending on the following calculations\n * 1. If the currently detected background color has a higher contrast ratio with white than black, the \"button--dark\" class will be added\n * 2. If the currently detected background color has a contrast ratio <= 3.06 ,the \"button--bordered\" class will be added\n *\n * When the \"button--dark\" class is added, the \"following\" text and shop logo should be changed to white.\n * When the \"button--bordered\" class is added, the button should have a border.\n */\n private _setButtonStyle() {\n const background = inferBackgroundColor(this);\n const isDark =\n calculateContrast(background, '#ffffff') >\n calculateContrast(background, '#000000');\n const isBordered = calculateContrast(background, '#5433EB') <= 3.06;\n\n this._button?.classList.toggle('button--dark', isDark);\n this._button?.classList.toggle('button--bordered', isBordered);\n\n if (isDark && this._i18n) {\n const followingText = this._i18n.translate('follow_on_shop.following', {\n shop: getShopLogoHtml('white'),\n });\n this._rootElement!.querySelector(\n 'slot[name=\"following-text\"]',\n )!.innerHTML = followingText;\n }\n }\n}\n\nif (!customElements.get('follow-on-shop-button')) {\n customElements.define('follow-on-shop-button', FollowOnShopButton);\n}\n\n/**\n * Get the template contents for the follow on shop trigger button.\n * @returns {string} string The template for the follow on shop trigger button\n */\nfunction getTemplateContents() {\n return `\n \n \n `;\n}\n\n/**\n * helper function to create a follow on shop trigger button\n * @param {string} color The color of the Shop logo.\n * @returns {string} The HTML for the Shop logo in the Follow on Shop button.\n */\nexport function getShopLogoHtml(color: string): string {\n return ``;\n}\n\n/**\n * helper function for building a Follow on Shop Button\n * @param {boolean} following Whether the user is following the shop.\n * @returns {FollowOnShopButton} - a Follow on Shop Button\n */\nexport function createFollowButton(following: boolean): FollowOnShopButton {\n const element = document.createElement('follow-on-shop-button');\n\n if (following) {\n element.setAttribute(ATTRIBUTE_FOLLOWING, '');\n }\n\n return element as FollowOnShopButton;\n}\n","import {createShopHeartIcon, ShopHeartIcon} from '../../../common/svg';\nimport {colors} from '../../../common/colors';\n\nexport const ELEMENT_NAME = 'store-logo';\n\nexport class StoreLogo extends HTMLElement {\n #rootElement: ShadowRoot;\n #wrapper: HTMLDivElement;\n #logoWrapper: HTMLDivElement;\n #logoImg: HTMLImageElement;\n #logoText: HTMLSpanElement;\n #heartIcon: ShopHeartIcon;\n\n #storeName = '';\n #logoSrc = '';\n\n constructor() {\n super();\n\n const template = document.createElement('template');\n template.innerHTML = getContent();\n this.#rootElement = this.attachShadow({mode: 'open'});\n this.#rootElement.appendChild(template.content.cloneNode(true));\n\n this.#wrapper = this.#rootElement.querySelector(`.${ELEMENT_NAME}`)!;\n this.#logoWrapper = this.#rootElement.querySelector(\n `.${ELEMENT_NAME}-logo-wrapper`,\n )!;\n this.#logoImg = this.#logoWrapper.querySelector('img')!;\n this.#logoText = this.#logoWrapper.querySelector('span')!;\n\n this.#heartIcon = createShopHeartIcon();\n this.#rootElement\n .querySelector(`.${ELEMENT_NAME}-icon-wrapper`)!\n .append(this.#heartIcon);\n }\n\n update({name, logoSrc}: {name?: string; logoSrc?: string}) {\n this.#storeName = name || this.#storeName;\n this.#logoSrc = logoSrc || this.#logoSrc;\n\n this.#updateDom();\n }\n\n connectedCallback() {\n this.#logoImg.addEventListener('error', () => {\n this.#logoSrc = '';\n this.#updateDom();\n });\n }\n\n setFavorited() {\n this.#wrapper.classList.add(`${ELEMENT_NAME}--favorited`);\n\n if (window.matchMedia(`(prefers-reduced-motion: reduce)`).matches) {\n this.#heartIcon.setFilled();\n return Promise.resolve();\n } else {\n return new Promise((resolve) => {\n this.#heartIcon.addEventListener('animationstart', () => {\n this.#heartIcon.setFilled();\n });\n\n this.#heartIcon.addEventListener('animationend', () => {\n setTimeout(resolve, 1000);\n });\n });\n }\n }\n\n #updateDom() {\n const name = this.#storeName;\n const currentLogoSrc = this.#logoImg.src;\n\n this.#logoText.textContent = name.charAt(0);\n this.#logoText.ariaLabel = name;\n\n if (this.#logoSrc && this.#logoSrc !== currentLogoSrc) {\n this.#logoImg.src = this.#logoSrc;\n this.#logoImg.alt = name;\n this.#logoWrapper.classList.remove(`${ELEMENT_NAME}-logo-wrapper--text`);\n this.#logoWrapper.classList.add(`${ELEMENT_NAME}-logo-wrapper--image`);\n } else if (!this.#logoSrc) {\n this.#logoWrapper.classList.remove(`${ELEMENT_NAME}-logo-wrapper--image`);\n this.#logoWrapper.classList.add(`${ELEMENT_NAME}-logo-wrapper--text`);\n }\n }\n}\n\n/**\n * @returns {string} the HTML content for the StoreLogo\n */\nfunction getContent() {\n return `\n \n
\n
\n \"\"\n \n
\n
\n
\n `;\n}\n\nif (!customElements.get(ELEMENT_NAME)) {\n customElements.define(ELEMENT_NAME, StoreLogo);\n}\n\n/**\n * helper function to create a new store logo component\n * @returns {StoreLogo} a new StoreLogo element\n */\nexport function createStoreLogo() {\n const storeLogo = document.createElement(ELEMENT_NAME) as StoreLogo;\n\n return storeLogo;\n}\n","import {constraintWidthInViewport} from '__deprecated__/common/utils/constraintWidthInViewport';\nimport {ShopifyPayModalState} from '__deprecated__/common/analytics';\nimport {StorageManager} from '__deprecated__/common/utils/storageManager';\n\nimport {PayMessageSender} from '../../common/MessageSender';\nimport {defineCustomElement} from '../../common/init';\nimport {StoreMetadata} from '../../common/utils/types';\nimport Bugsnag from '../../common/bugsnag';\nimport {IFrameEventSource} from '../../common/MessageEventSource';\nimport MessageListener from '../../common/MessageListener';\nimport {ShopSheetModal} from '../../common/shop-sheet-modal/shop-sheet-modal';\nimport {\n PAY_AUTH_DOMAIN,\n PAY_AUTH_DOMAIN_ALT,\n SHOP_WEBSITE_DOMAIN,\n validateStorefrontOrigin,\n} from '../../common/utils/urls';\nimport {I18n} from '../../common/translator/i18n';\nimport {\n exchangeLoginCookie,\n getAnalyticsTraceId,\n getStoreMeta,\n isMobileBrowser,\n updateAttribute,\n ShopHubTopic,\n removeOnePasswordPrompt,\n} from '../../common/utils';\nimport ConnectedWebComponent from '../../common/ConnectedWebComponent';\nimport {\n sheetModalBuilder,\n SheetModalManager,\n} from '../../common/shop-sheet-modal/shop-sheet-modal-builder';\nimport {\n AuthorizeState,\n LoginButtonCompletedEvent as CompletedEvent,\n LoginButtonMessageEventData as MessageEventData,\n OAuthParams,\n OAuthParamsV1,\n ShopActionType,\n LoginButtonVersion as Version,\n} from '../../types';\nimport {\n ATTRIBUTE_CLIENT_ID,\n ATTRIBUTE_STOREFRONT_ORIGIN,\n ATTRIBUTE_VERSION,\n ERRORS,\n LOAD_TIMEOUT_MS,\n ATTRIBUTE_DEV_MODE,\n ATTRIBUTE_ANALYTICS_TRACE_ID,\n} from '../../constants/loginButton';\nimport {\n createGetAppButtonHtml,\n createScanCodeTooltipHtml,\n SHOP_FOLLOW_BUTTON_HTML,\n} from '../../constants/followButton';\n\nimport {FollowOnShopMonorailTracker} from './analytics';\nimport {createModalContent, ModalContent} from './components/modal-content';\nimport {buildAuthorizeUrl} from './authorize';\nimport {\n createFollowButton,\n FollowOnShopButton,\n} from './components/follow-on-shop-button';\nimport {createStoreLogo, StoreLogo} from './components/store-logo';\n\nenum ModalOpenStatus {\n Closed = 'closed',\n Mounting = 'mounting',\n Open = 'open',\n}\n\nexport default class ShopFollowButton extends ConnectedWebComponent {\n #rootElement: ShadowRoot;\n #analyticsTraceId = getAnalyticsTraceId();\n #clientId = '';\n #version: Version = '2';\n #storefrontOrigin = window.location.origin;\n #devMode = false;\n #monorailTracker = new FollowOnShopMonorailTracker({\n elementName: 'shop-follow-button',\n analyticsTraceId: this.#analyticsTraceId,\n });\n\n #buttonInViewportObserver: IntersectionObserver | undefined;\n\n #followShopButton: FollowOnShopButton | undefined;\n #isFollowing = false;\n #storefrontMeta: StoreMetadata | null = null;\n\n #iframe: HTMLIFrameElement | undefined;\n #iframeListener: MessageListener | undefined;\n #iframeMessenger: PayMessageSender | undefined;\n #iframeLoadTimeout: ReturnType | undefined;\n\n #authorizeModalManager: SheetModalManager | undefined;\n #followModalManager: SheetModalManager | undefined;\n\n #authorizeModal: ShopSheetModal | undefined;\n #authorizeLogo: StoreLogo | undefined;\n #authorizeModalContent: ModalContent | undefined;\n #authorizeModalOpenedStatus: ModalOpenStatus = ModalOpenStatus.Closed;\n #followedModal: ShopSheetModal | undefined;\n #followedModalContent: ModalContent | undefined;\n #followedTooltip: HTMLDivElement | undefined;\n #storageManager = new StorageManager('following', false);\n\n #i18n: I18n | null = null;\n\n static get observedAttributes(): string[] {\n return [\n ATTRIBUTE_CLIENT_ID,\n ATTRIBUTE_VERSION,\n ATTRIBUTE_STOREFRONT_ORIGIN,\n ATTRIBUTE_DEV_MODE,\n ];\n }\n\n constructor() {\n super();\n\n this.#rootElement = this.attachShadow({mode: 'open'});\n this.#isFollowing = this.#storageManager.value;\n }\n\n #handleUserIdentityChange = () => {\n this.#updateSrc(true);\n };\n\n attributeChangedCallback(\n name: string,\n _oldValue: string,\n newValue: string,\n ): void {\n switch (name) {\n case ATTRIBUTE_VERSION:\n this.#version = newValue as Version;\n this.#updateSrc();\n break;\n case ATTRIBUTE_CLIENT_ID:\n this.#clientId = newValue;\n this.#updateSrc();\n break;\n case ATTRIBUTE_STOREFRONT_ORIGIN:\n this.#storefrontOrigin = newValue;\n validateStorefrontOrigin(this.#storefrontOrigin);\n break;\n case ATTRIBUTE_DEV_MODE:\n this.#devMode = newValue === 'true';\n this.#updateSrc();\n break;\n }\n }\n\n async connectedCallback(): Promise {\n this.subscribeToHub(\n ShopHubTopic.UserStatusIdentity,\n this.#handleUserIdentityChange,\n );\n\n await this.#initTranslations();\n this.#initElements();\n this.#initEvents();\n }\n\n async #initTranslations() {\n try {\n // BUILD_LOCALE is used for generating localized bundles.\n // See ./scripts/i18n-dynamic-import-replacer-rollup.mjs for more info.\n // eslint-disable-next-line no-process-env\n const locale = process.env.BUILD_LOCALE || I18n.getDefaultLanguage();\n const dictionary = await import(`./translations/${locale}.json`);\n this.#i18n = new I18n({[locale]: dictionary});\n } catch (error) {\n if (error instanceof Error) {\n Bugsnag.notify(error);\n }\n }\n return null;\n }\n\n #initElements() {\n this.#followShopButton = createFollowButton(this.#isFollowing);\n this.#rootElement.innerHTML = SHOP_FOLLOW_BUTTON_HTML;\n this.#rootElement.appendChild(this.#followShopButton);\n }\n\n #initEvents() {\n this.#trackComponentLoadedEvent(this.#isFollowing);\n this.#trackComponentInViewportEvent();\n\n validateStorefrontOrigin(this.#storefrontOrigin);\n this.#followShopButton?.addEventListener('click', () => {\n // dev mode\n if (this.#devMode) {\n this.#isFollowing = !this.#isFollowing;\n this.#followShopButton?.setFollowing({\n following: this.#isFollowing,\n });\n return;\n }\n\n if (this.#isFollowing) {\n this.#monorailTracker.trackFollowingGetAppButtonPageImpression();\n\n if (isMobileBrowser()) {\n this.#createAndOpenAlreadyFollowingModal();\n } else {\n this.#createAlreadyFollowingTooltip();\n }\n } else {\n this.#monorailTracker.trackFollowButtonClicked();\n this.#createAndOpenFollowOnShopModal();\n }\n });\n }\n\n disconnectedCallback(): void {\n this.unsubscribeAllFromHub();\n this.#iframeListener?.destroy();\n this.#buttonInViewportObserver?.disconnect();\n this.#authorizeModalManager?.destroy();\n this.#followModalManager?.destroy();\n }\n\n #createAndOpenFollowOnShopModal() {\n if (this.#authorizeModal) {\n this.#openAuthorizeModal();\n return;\n }\n\n this.#authorizeLogo = this.#createStoreLogo();\n this.#authorizeModalContent = createModalContent({});\n this.#authorizeModalContent.append(this.#createIframe());\n\n this.#authorizeModalManager = sheetModalBuilder()\n .withInnerHTML(SHOP_FOLLOW_BUTTON_HTML)\n .build();\n this.#authorizeModalManager.setNametagSuffix('follow');\n this.#authorizeModal = this.#authorizeModalManager.sheetModal;\n this.#authorizeModal.setAttribute(\n ATTRIBUTE_ANALYTICS_TRACE_ID,\n this.#analyticsTraceId,\n );\n this.#authorizeModal.appendChild(this.#authorizeLogo);\n this.#authorizeModal.appendChild(this.#authorizeModalContent);\n this.#authorizeModal.addEventListener(\n 'modalcloserequest',\n this.#closeAuthorizeModal.bind(this),\n );\n\n this.#authorizeModal.setMonorailTracker(this.#monorailTracker);\n this.#authorizeModalOpenedStatus = ModalOpenStatus.Mounting;\n }\n\n async #createAndOpenAlreadyFollowingModal() {\n if (!this.#followedModal) {\n this.#followModalManager = sheetModalBuilder()\n .withInnerHTML(SHOP_FOLLOW_BUTTON_HTML)\n .build();\n this.#followModalManager.setNametagSuffix('followed');\n this.#followedModal = this.#followModalManager.sheetModal;\n this.#followedModal.setMonorailTracker(this.#monorailTracker);\n this.#followedModal.setAttribute('disable-popup', 'true');\n const storeMeta = await this.#fetchStorefrontMetadata();\n const storeName = storeMeta?.name ?? 'the store';\n const title = this.#i18n?.translate(\n 'follow_on_shop.following_modal.title',\n {store: storeName},\n );\n const description = this.#i18n?.translate(\n 'follow_on_shop.following_modal.subtitle',\n );\n this.#followedModalContent = createModalContent(\n {\n title,\n description,\n },\n true,\n );\n this.#followedModal.appendChild(this.#followedModalContent);\n this.#followedModal.appendChild(\n await this.#createAlreadyFollowingModalButton(),\n );\n this.#followedModal.addEventListener('modalcloserequest', async () => {\n if (this.#followedModal) {\n await this.#followedModal.close();\n }\n this.#followShopButton?.setFocused();\n });\n\n if (title) {\n this.#followedModal.setAttribute('title', title);\n }\n }\n\n this.#followedModal.open();\n this.#monorailTracker.trackFollowingGetAppButtonPageImpression();\n }\n\n #createStoreLogo(): StoreLogo {\n const storeLogo = createStoreLogo();\n\n this.#fetchStorefrontMetadata()\n .then((storefrontMeta) => {\n storeLogo.update({\n name: storefrontMeta?.name || '',\n logoSrc: storefrontMeta?.id\n ? `${SHOP_WEBSITE_DOMAIN}/shops/${storefrontMeta.id}/logo?width=58`\n : '',\n });\n })\n .catch(() => {\n /** no-op */\n });\n\n return storeLogo;\n }\n\n #createIframe(): HTMLIFrameElement {\n this.#iframe = document.createElement('iframe');\n this.#iframe.tabIndex = 0;\n this.#updateSrc();\n\n const eventDestination: Window | undefined =\n this.ownerDocument?.defaultView || undefined;\n\n this.#iframeListener = new MessageListener(\n new IFrameEventSource(this.#iframe),\n [PAY_AUTH_DOMAIN, PAY_AUTH_DOMAIN_ALT, this.#storefrontOrigin],\n this.#handlePostMessage.bind(this),\n eventDestination,\n );\n this.#iframeMessenger = new PayMessageSender(this.#iframe);\n\n updateAttribute(this.#iframe, 'allow', 'publickey-credentials-get *');\n\n return this.#iframe;\n }\n\n async #createAlreadyFollowingModalButton(): Promise {\n const buttonWrapper = document.createElement('div');\n const storeMeta = await this.#fetchStorefrontMetadata();\n const storeId = storeMeta?.id;\n\n const buttonText =\n this.#i18n?.translate('follow_on_shop.following_modal.continue', {\n defaultValue: 'Continue',\n }) ?? '';\n const buttonLink = storeId ? `https://shop.app/sid/${storeId}` : '#';\n buttonWrapper.innerHTML = createGetAppButtonHtml(buttonLink, buttonText);\n buttonWrapper.addEventListener('click', async () => {\n this.#monorailTracker.trackFollowingGetAppButtonClicked();\n this.#followedModal?.close();\n });\n return buttonWrapper;\n }\n\n async #createAlreadyFollowingTooltip() {\n if (!this.#followedTooltip) {\n this.#followedTooltip = document.createElement('div');\n this.#followedTooltip.classList.add('fos-tooltip', 'fos-tooltip-hidden');\n\n const storeMeta = await this.#fetchStorefrontMetadata();\n const storeName = storeMeta?.name ?? 'the store';\n const description =\n this.#i18n?.translate('follow_on_shop.following_modal.qr_header', {\n store: storeName,\n }) ?? '';\n const qrCodeAltText =\n this.#i18n?.translate('follow_on_shop.following_modal.qr_alt_text') ??\n '';\n const storeId = storeMeta?.id;\n const qrCodeUrl = storeId\n ? `${SHOP_WEBSITE_DOMAIN}/qr/sid/${storeId}`\n : `#`;\n this.#followedTooltip.innerHTML = createScanCodeTooltipHtml(\n description,\n qrCodeUrl,\n qrCodeAltText,\n );\n\n this.#followedTooltip\n .querySelector('.fos-tooltip-overlay')\n ?.addEventListener('click', () => {\n this.#followedTooltip?.classList.toggle('fos-tooltip-hidden', true);\n });\n this.#followedTooltip?.addEventListener('click', () => {\n this.#followedTooltip?.classList.toggle('fos-tooltip-hidden', true);\n });\n\n this.#rootElement.appendChild(this.#followedTooltip);\n }\n\n this.#followedTooltip.classList.toggle('fos-tooltip-hidden', false);\n }\n\n #updateSrc(forced?: boolean) {\n if (this.#iframe) {\n const oauthParams: OAuthParams | OAuthParamsV1 = {\n clientId: this.#clientId,\n responseType: 'code',\n };\n const authorizeUrl = buildAuthorizeUrl({\n version: this.#version,\n analyticsTraceId: this.#analyticsTraceId,\n flow: ShopActionType.Follow,\n oauthParams,\n });\n\n this.#initLoadTimeout();\n updateAttribute(this.#iframe, 'src', authorizeUrl, forced);\n Bugsnag.leaveBreadcrumb('Iframe url updated', {authorizeUrl}, 'state');\n }\n }\n\n #initLoadTimeout() {\n this.#clearLoadTimeout();\n this.#iframeLoadTimeout = setTimeout(() => {\n const error = ERRORS.temporarilyUnavailable;\n this.dispatchCustomEvent('error', {\n message: error.message,\n code: error.code,\n });\n // eslint-disable-next-line no-warning-comments\n // TODO: replace this bugsnag notify with a Observe-able event\n // Bugsnag.notify(\n // new PayTimeoutError(`Pay failed to load within ${LOAD_TIMEOUT_MS}ms.`),\n // {component: this.#component, src: this.iframe?.getAttribute('src')},\n // );\n this.#clearLoadTimeout();\n }, LOAD_TIMEOUT_MS);\n }\n\n #clearLoadTimeout() {\n if (!this.#iframeLoadTimeout) return;\n clearTimeout(this.#iframeLoadTimeout);\n this.#iframeLoadTimeout = undefined;\n }\n\n #trackComponentLoadedEvent(isFollowing: boolean) {\n this.#monorailTracker.trackFollowButtonPageImpression(isFollowing);\n }\n\n #trackComponentInViewportEvent() {\n this.#buttonInViewportObserver = new IntersectionObserver((entries) => {\n for (const {isIntersecting} of entries) {\n if (isIntersecting) {\n this.#buttonInViewportObserver?.disconnect();\n this.#monorailTracker.trackFollowButtonInViewport();\n }\n }\n });\n\n this.#buttonInViewportObserver.observe(this.#followShopButton!);\n }\n\n async #fetchStorefrontMetadata() {\n if (!this.#storefrontMeta) {\n this.#storefrontMeta = await getStoreMeta(this.#storefrontOrigin);\n }\n\n return this.#storefrontMeta;\n }\n\n async #handleCompleted({\n loggedIn,\n shouldFinalizeLogin,\n email,\n givenNameFirstInitial,\n avatar,\n }: Partial) {\n this.#storageManager.set(true);\n\n if (loggedIn) {\n if (shouldFinalizeLogin) {\n exchangeLoginCookie(this.#storefrontOrigin, (error) => {\n Bugsnag.notify(new Error(error));\n });\n\n this.publishToHub(ShopHubTopic.UserSessionCreate, {\n email: givenNameFirstInitial || email,\n initial: givenNameFirstInitial || email?.[0] || '',\n avatar,\n });\n }\n }\n\n this.dispatchCustomEvent('completed', {\n loggedIn,\n email,\n });\n\n await this.#authorizeLogo?.setFavorited();\n await this.#authorizeModal?.close();\n this.#iframeListener?.destroy();\n this.#followShopButton?.setFollowing({following: true});\n this.#isFollowing = true;\n this.#trackComponentLoadedEvent(true);\n }\n\n #handleError(code: string, message: string, email?: string): void {\n this.#clearLoadTimeout();\n\n this.dispatchCustomEvent('error', {\n code,\n message,\n email,\n });\n }\n\n async #handleLoaded({\n clientName,\n logoSrc,\n }: {\n clientName?: string;\n logoSrc?: string;\n }) {\n if (clientName || logoSrc) {\n this.#authorizeLogo!.update({\n name: clientName,\n logoSrc,\n });\n }\n\n this.#monorailTracker.trackShopPayModalStateChange({\n currentState: ShopifyPayModalState.Loaded,\n });\n\n if (this.#authorizeModalOpenedStatus === ModalOpenStatus.Mounting) {\n this.#openAuthorizeModal();\n this.#authorizeModalOpenedStatus = ModalOpenStatus.Open;\n this.#clearLoadTimeout();\n }\n }\n\n async #openAuthorizeModal() {\n const result = await this.#authorizeModal!.open();\n if (result) {\n this.#iframeMessenger?.postMessage({\n type: 'sheetmodalopened',\n });\n }\n }\n\n async #closeAuthorizeModal() {\n if (this.#authorizeModal) {\n const result = await this.#authorizeModal.close();\n if (result) {\n this.#iframeMessenger?.postMessage({type: 'sheetmodalclosed'});\n // Remove the 1password custom element from the DOM after the sheet modal is closed.\n removeOnePasswordPrompt();\n }\n }\n this.#followShopButton?.setFocused();\n }\n\n #handlePostMessage(data: MessageEventData) {\n switch (data.type) {\n case 'loaded':\n this.#handleLoaded(data);\n break;\n case 'resize_iframe':\n this.#iframe!.style.height = `${data.height}px`;\n this.#iframe!.style.width = `${constraintWidthInViewport(data.width, this.#iframe!)}px`;\n break;\n case 'completed':\n this.#handleCompleted(data as CompletedEvent);\n break;\n case 'error':\n this.#handleError(data.code, data.message, data.email);\n break;\n case 'content':\n this.#authorizeModal?.setAttribute('title', data.title);\n this.#authorizeModalContent?.update(data);\n this.#authorizeLogo?.classList.toggle(\n 'hidden',\n data.authorizeState === AuthorizeState.Captcha,\n );\n break;\n case 'processing_status_updated':\n this.#authorizeModalContent?.update(data);\n break;\n case 'close_requested':\n this.#closeAuthorizeModal();\n break;\n }\n }\n}\n\n/**\n * Define the shop-follow-button custom element.\n */\nexport function defineElement() {\n defineCustomElement('shop-follow-button', ShopFollowButton);\n}\n","import {startBugsnag, isBrowserSupported} from '../../common/init';\nimport {defineElement as defineShopSwirl} from '../../common/shop-swirl';\n\nimport {defineElement as defineShopFollowButton} from './shop-follow-button';\nimport {defineElement as defineShopLoginButton} from './shop-login-button';\nimport {defineElement as defineShopLoginDefault} from './shop-login-default';\n\n/**\n * Initialize the login button web components.\n * This is the entry point that will be used for code-splitting.\n */\nfunction init() {\n if (!isBrowserSupported()) return;\n // eslint-disable-next-line no-process-env\n startBugsnag({bundle: 'loginButton', bundleLocale: process.env.BUILD_LOCALE});\n\n // The order of these calls is not significant. However, it is worth noting that\n // ShopFollowButton and ShopLoginDefault all rely on the ShopLoginButton.\n // To ensure that the ShopLoginButton is available when the other components are\n // defined, we prioritize defining the ShopLoginButton first.\n defineShopLoginButton();\n defineShopFollowButton();\n defineShopLoginDefault();\n defineShopSwirl();\n}\n\ninit();\n"],"names":["ShopSwirl","HTMLElement","constructor","super","template","document","createElement","size","this","getAttribute","backgroundColor","innerHTML","red","green","blue","pickLogoColor","color","sizeRatio","height","width","Math","round","getTemplateContents","Number","parseInt","undefined","attachShadow","mode","appendChild","content","cloneNode","ELEMENT_CLASS_NAME","ModalContent","_ModalContent_rootElement","set","_ModalContent_headerWrapper","_ModalContent_headerTitle","_ModalContent_headerDescription","_ModalContent_contentWrapper","_ModalContent_contentProcessingWrapper","_ModalContent_contentProcessingUser","_ModalContent_contentStatusIndicator","_ModalContent_contentChildrenWrapper","_ModalContent_disclaimerText","_ModalContent_contentStore","colors","brand","__classPrivateFieldSet","__classPrivateFieldGet","querySelector","hideDivider","classList","add","showDivider","remove","update","_ModalContent_instances","_ModalContent_updateHeader","call","_ModalContent_updateMainContent","_ModalContent_updateDisclaimer","createModalContent","modalContent","title","description","authorizeState","visible","toggle","textContent","AuthorizeState","Start","status","email","contentWrapperVisible","Boolean","processingWrapperVisible","childrenWrapperVisible","loaderType","OneClick","StatusIndicatorLoader","Branded","Regular","createStatusIndicator","_a","setStatus","message","disclaimer","customElements","get","define","ATTRIBUTE_FOLLOWING","FollowOnShopButton","_rootElement","_button","_wrapper","_heartIcon","_followSpan","_followingSpan","_i18n","_followTextWidth","_followingTextWidth","ShopLogo","connectedCallback","_initTranslations","_initElements","setFollowing","following","skipAnimation","_b","ariaHidden","style","setProperty","window","matchMedia","matches","_c","setFilled","_e","_d","addEventListener","setFocused","focus","locale","dictionary","I18n","error","Error","Bugsnag","notify","getShopLogoHtml","followText","translate","shop","followingText","createShopHeartIcon","prepend","scrollWidth","max","hasAttribute","_setButtonStyle","background","inferBackgroundColor","isDark","calculateContrast","isBordered","ELEMENT_NAME","StoreLogo","_StoreLogo_rootElement","_StoreLogo_wrapper","_StoreLogo_logoWrapper","_StoreLogo_logoImg","_StoreLogo_logoText","_StoreLogo_heartIcon","_StoreLogo_storeName","_StoreLogo_logoSrc","foregroundSecondary","white","append","name","logoSrc","_StoreLogo_instances","_StoreLogo_updateDom","setFavorited","Promise","resolve","setTimeout","ModalOpenStatus","currentLogoSrc","src","charAt","ariaLabel","alt","ShopFollowButton","ConnectedWebComponent","observedAttributes","ATTRIBUTE_CLIENT_ID","ATTRIBUTE_VERSION","ATTRIBUTE_STOREFRONT_ORIGIN","ATTRIBUTE_DEV_MODE","_ShopFollowButton_rootElement","_ShopFollowButton_analyticsTraceId","getAnalyticsTraceId","_ShopFollowButton_clientId","_ShopFollowButton_version","_ShopFollowButton_storefrontOrigin","location","origin","_ShopFollowButton_devMode","_ShopFollowButton_monorailTracker","FollowOnShopMonorailTracker","elementName","analyticsTraceId","_ShopFollowButton_buttonInViewportObserver","_ShopFollowButton_followShopButton","_ShopFollowButton_isFollowing","_ShopFollowButton_storefrontMeta","_ShopFollowButton_iframe","_ShopFollowButton_iframeListener","_ShopFollowButton_iframeMessenger","_ShopFollowButton_iframeLoadTimeout","_ShopFollowButton_authorizeModalManager","_ShopFollowButton_followModalManager","_ShopFollowButton_authorizeModal","_ShopFollowButton_authorizeLogo","_ShopFollowButton_authorizeModalContent","_ShopFollowButton_authorizeModalOpenedStatus","Closed","_ShopFollowButton_followedModal","_ShopFollowButton_followedModalContent","_ShopFollowButton_followedTooltip","_ShopFollowButton_storageManager","StorageManager","_ShopFollowButton_i18n","_ShopFollowButton_handleUserIdentityChange","_ShopFollowButton_instances","_ShopFollowButton_updateSrc","value","attributeChangedCallback","_oldValue","newValue","validateStorefrontOrigin","subscribeToHub","ShopHubTopic","UserStatusIdentity","_ShopFollowButton_initTranslations","_ShopFollowButton_initElements","_ShopFollowButton_initEvents","disconnectedCallback","unsubscribeAllFromHub","destroy","disconnect","element","setAttribute","createFollowButton","SHOP_FOLLOW_BUTTON_HTML","_ShopFollowButton_trackComponentInViewportEvent","trackFollowingGetAppButtonPageImpression","isMobileBrowser","_ShopFollowButton_createAndOpenAlreadyFollowingModal","_ShopFollowButton_createAlreadyFollowingTooltip","trackFollowButtonClicked","_ShopFollowButton_createAndOpenFollowOnShopModal","_ShopFollowButton_openAuthorizeModal","_ShopFollowButton_createIframe","sheetModalBuilder","withInnerHTML","build","setNametagSuffix","sheetModal","ATTRIBUTE_ANALYTICS_TRACE_ID","_ShopFollowButton_closeAuthorizeModal","bind","setMonorailTracker","Mounting","storeMeta","_ShopFollowButton_fetchStorefrontMetadata","storeName","store","_ShopFollowButton_createAlreadyFollowingModalButton","__awaiter","close","open","storeLogo","then","storefrontMeta","id","SHOP_WEBSITE_DOMAIN","catch","tabIndex","eventDestination","ownerDocument","defaultView","MessageListener","IFrameEventSource","PAY_AUTH_DOMAIN","PAY_AUTH_DOMAIN_ALT","_ShopFollowButton_handlePostMessage","PayMessageSender","updateAttribute","buttonWrapper","storeId","buttonText","defaultValue","buttonLink","createGetAppButtonHtml","trackFollowingGetAppButtonClicked","qrCodeAltText","qrCodeUrl","createScanCodeTooltipHtml","_f","_g","forced","oauthParams","clientId","responseType","authorizeUrl","buildAuthorizeUrl","version","flow","ShopActionType","Follow","_ShopFollowButton_initLoadTimeout","leaveBreadcrumb","_ShopFollowButton_clearLoadTimeout","ERRORS","temporarilyUnavailable","dispatchCustomEvent","code","LOAD_TIMEOUT_MS","clearTimeout","isFollowing","trackFollowButtonPageImpression","IntersectionObserver","entries","isIntersecting","trackFollowButtonInViewport","observe","getStoreMeta","loggedIn","shouldFinalizeLogin","givenNameFirstInitial","avatar","exchangeLoginCookie","publishToHub","UserSessionCreate","initial","_ShopFollowButton_trackComponentLoadedEvent","_ShopFollowButton_handleLoaded","clientName","trackShopPayModalStateChange","currentState","ShopifyPayModalState","Loaded","Open","postMessage","type","removeOnePasswordPrompt","data","constraintWidthInViewport","_ShopFollowButton_handleCompleted","_ShopFollowButton_handleError","Captcha","isBrowserSupported","startBugsnag","bundle","bundleLocale","defineShopLoginButton","defineCustomElement","defineShopLoginDefault"],"mappings":"qaAGM,MAAOA,UAAkBC,YAC7B,WAAAC,GACEC,QAEA,MAAMC,EAAWC,SAASC,cAAc,YAClCC,EAAOC,KAAKC,aAAa,QAEzBC,EAAkBF,KAAKC,aAAa,qBAAuB,OAEjEL,EAASO,UAgBb,SAA6BJ,EAAO,GAAIG,GACtC,MAAOE,EAAKC,EAAOC,GAAQC,EAAcL,GACnCM,EAAQ,OAAOJ,MAAQC,MAAUC,KACjCG,EAAY,KACZC,EAASX,EACTY,EAAQC,KAAKC,MAAMH,EAASD,GAElC,MAAO,uDAGSC,wBACDC,0rBAKygBH,uBAG1hB,CAnCyBM,CACnBf,EAAOgB,OAAOC,SAASjB,EAAM,SAAMkB,EACnCf,GAGFF,KAAKkB,aAAa,CAACC,KAAM,SAASC,YAChCxB,EAASyB,QAAQC,WAAU,GAE9B,iDCTI,MAAMC,GAAqB,qBAW5B,MAAOC,WAA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