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cAAc,OACtCD,EAAOE,MAAMC,QAAU,WACvBH,EAAOE,MAAME,WAAa,OAC1BJ,EAAOE,MAAMG,MAAQ,OACrBL,EAAOE,MAAMI,SAAW,UACxBN,EAAOE,MAAMK,WAAa,MAC1BP,EAAOE,MAAMM,UAAY,SAEzB,MAAM9N,EAAoB,OAAhBqN,EAAGxG,QAAQkH,QAAW,OAANV,EAAbA,EAAerN,WAAI,EAAnBqN,EAAqBW,OAClCV,EAAOhP,YAAc0B,EAAO,oCAAoCA,MAC9D,oCAKF,MAAMiO,EAAU,IAAIC,IAAIzD,SAAStL,MACjC8O,EAAQE,aAAaC,IAAI,cAAe,KAExC,MAAMC,EAAW3N,SAAS6M,cAAc,KACxCc,EAASlP,KAAO8O,EAAQ9O,KACxBkP,EAAS/P,YAAc,OACvB+P,EAASb,MAAMG,MAAQ,UACvBU,EAASb,MAAMc,eAAiB,YAChChB,EAAOiB,OAAOF,GAEdjB,EAAOoB,OAAOlB,EAChB,CACF,CACF","sources":["webpack://lange/./sections/footer/trustpilot-badge/index.ts","webpack://lange/./sections/footer/yotpo-badge/index.ts","webpack://lange/./sections/footer/trustpilot-rating-stars/index.ts","webpack://lange/./lib/dom-ready.ts","webpack://lange/./sections/footer/country-selector-form/index.ts","webpack://lange/./sections/footer/country-selector-modal-cta.ts","webpack://lange/./lib/attentive-service.ts","webpack://lange/./sections/footer/marketing-subscribe.ts","webpack://lange/../node_modules/@integrabeauty/person/dist/src/email.js","webpack://lange/../node_modules/@integrabeauty/assert/src/index.ts","webpack://lange/./sections/footer/trustpilot-fetch-business-unit.ts","webpack://lange/./sections/footer/trustpilot-badge-init.ts","webpack://lange/./sections/footer/preview-notice.ts"],"sourcesContent":["import type { CustomElement } from '@integrabeauty/custom-elements';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders a Trustpilot badge with the provided rating and total number of votes. This component is\n * designed to be used within the footer of the website, but it should not be used on the product\n * reviews page. The badge displays the overall rating, total votes, and a star rating based on the\n * provided data attributes.\n */\nclass TrustpilotBadge extends HTMLElement implements CustomElement {\n  public static get observedAttributes() {\n    return ['data-rating', 'data-total'];\n  }\n\n  declare readonly dataset: {\n    /**\n     * Overall rating\n     */\n    rating: string;\n\n    /**\n     * Total number of votes\n     */\n    total: string;\n  };\n\n  public connectedCallback() {\n    this.initializeShadowRoot();\n\n    this.render();\n  }\n\n  public attributeChangedCallback(_name: string, oldValue: string, newValue: string) {\n    this.initializeShadowRoot();\n\n    if (this.isConnected && oldValue !== newValue) {\n      this.render();\n    }\n  }\n\n  private initializeShadowRoot() {\n    if (!this.shadowRoot) {\n      this.attachShadow({ mode: 'open' });\n      this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n    }\n  }\n\n  private render() {\n    const rating = Math.min(parseFloat(this.dataset.rating), 5);\n    if (isNaN(rating)) {\n      return;\n    }\n\n    const total = parseInt(this.dataset.total, 10);\n    if (!total) {\n      return;\n    }\n\n    // Show the element. The html starts it out hidden, and the global rule for the hidden attribute\n    // lives in an inlined stylesheet that comes down with the html, so there is no flash of the\n    // badge while this module loads.\n    this.hidden = false;\n\n    // we are modifying HTML inside of a slot, so there's no guarantee that any of the elements\n    // below exist\n\n    const scoreElement = this.querySelector('.trust-score');\n    if (scoreElement) {\n      scoreElement.textContent = rating.toString();\n    }\n\n    const totalElement = this.querySelector('.trust-total');\n    if (totalElement) {\n      const format = new Intl.NumberFormat('en-US');\n      totalElement.textContent = format.format(total);\n    }\n\n    const starsElement = this.querySelector('trustpilot-rating-stars');\n    if (starsElement) {\n      starsElement.dataset.rating = rating.toString();\n    }\n\n    const starPrefix = this.querySelector('.stars-prefix');\n    if (starPrefix) {\n      let prefix = '';\n      if (rating >= 5) {\n        prefix = 'Excellent';\n      } else if (rating >= 4) {\n        prefix = 'Great';\n      } else if (rating >= 3) {\n        prefix = 'Average';\n      } else if (rating >= 2) {\n        prefix = 'Poor';\n      } else {\n        prefix = 'Bad';\n      }\n\n      starPrefix.textContent = prefix;\n    }\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'trustpilot-badge': TrustpilotBadge;\n  }\n}\n\nif (!customElements.get('trustpilot-badge')) {\n  customElements.define('trustpilot-badge', TrustpilotBadge);\n}\n","import type { CustomElement } from '@integrabeauty/custom-elements';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders Yotpo site rating badge.\n */\nclass YotpoBadge extends HTMLElement implements CustomElement {\n  public static get observedAttributes() {\n    return [\n      'data-total',\n      'data-average-score'\n    ];\n  }\n\n  declare readonly dataset: {\n    /**\n     * Overall rating\n     */\n    averageScore: string;\n\n    /**\n     * URL to badge image in the assets folder\n     */\n    badgeImageSrc: string;\n\n    /**\n     * Total number of votes\n     */\n    total: string;\n\n    /**\n     * URL where the badge click will lead to\n     */\n    url: string;\n  };\n\n  public connectedCallback() {\n    this.initializeShadowRoot();\n\n    this.render();\n  }\n\n  public attributeChangedCallback(_name: string, oldValue: string, newValue: string) {\n    this.initializeShadowRoot();\n\n    if (this.isConnected && oldValue !== newValue) {\n      this.render();\n    }\n  }\n\n  private initializeShadowRoot() {\n    if (!this.shadowRoot) {\n      this.attachShadow({ mode: 'open' });\n      this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n    }\n  }\n\n  private render() {\n    const link = this.shadowRoot.querySelector('a');\n    link.href = this.dataset.url || '#';\n\n    const imageElement = this.shadowRoot.querySelector('img');\n    imageElement.src = this.dataset.badgeImageSrc;\n\n    const totalElement = this.shadowRoot.querySelector('.total');\n    const total = parseInt(this.dataset.total, 10) / 1000000;\n\n    const totalText = Number.isNaN(total) ? '' : total.toFixed(1);\n\n    totalElement.textContent = totalText ? totalText + 'M' : '';\n\n    const score = this.dataset.averageScore ? this.dataset.averageScore : '';\n\n    const badge = this.shadowRoot.querySelector('.badge');\n    if (score && totalText) {\n      badge?.setAttribute('aria-label', [\n        score,\n        'average score based on',\n        totalText,\n        'million certified reviews',\n        'powered by Yotpo and Trustpilot.'\n      ].join(' '));\n    } else {\n      badge?.setAttribute('aria-label', 'Certified reviews, powered by Yotpo and Trustpilot.');\n    }\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'yotpo-badge': YotpoBadge;\n  }\n}\n\nif (!customElements.get('yotpo-badge')) {\n  customElements.define('yotpo-badge', YotpoBadge);\n}\n","import type { CustomElement } from '@integrabeauty/custom-elements';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders a row of Trustpilot styled stars filled to a given rating, including a half filled star.\n *\n * It is the shared star visual wherever a Trustpilot rating is shown, such as the footer badge and\n * individual reviews.\n */\nclass TrustpilotRatingStars extends HTMLElement implements CustomElement {\n  public static get observedAttributes() {\n    return ['data-rating'];\n  }\n\n  declare readonly dataset: {\n    /**\n     * Present for a perfect rating, switching the stars to the darker fill via CSS.\n     */\n    dark?: string;\n\n    /**\n     * Rating, how many stars will be filled\n     */\n    rating: string;\n  };\n\n  public connectedCallback() {\n    this.initializeShadowRoot();\n\n    this.render();\n  }\n\n  public attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n    this.initializeShadowRoot();\n\n    if (this.isConnected && name === 'data-rating' && oldValue !== newValue) {\n      this.render();\n    }\n  }\n\n  private initializeShadowRoot() {\n    if (!this.shadowRoot) {\n      this.attachShadow({ mode: 'open' });\n      this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n    }\n  }\n\n  private render() {\n    let rating = parseFloat(this.dataset.rating);\n    rating = rating > 5 ? 5 : rating;\n\n    if (!rating) {\n      return;\n    }\n\n    if (rating === 5) {\n      this.dataset.dark = 'true';\n    }\n\n    const starsElement = this.shadowRoot.querySelectorAll<SVGGElement>('svg g');\n    for (let i = 0; i < starsElement.length; i++) {\n      if (i + 1 <= rating) {\n        starsElement[i].classList.add('filled');\n      }\n\n      if (i + 1.5 > rating) {\n        starsElement[i].classList.add('filled-half');\n        break;\n      }\n    }\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'trustpilot-rating-stars': TrustpilotRatingStars;\n  }\n}\n\nif (!customElements.get('trustpilot-rating-stars')) {\n  customElements.define('trustpilot-rating-stars', TrustpilotRatingStars);\n}\n","/**\n * Releases the handle returned from the ready() function.\n *\n * This is idempotent. Additional calls are pointless but harmless.\n */\nexport type ReleaseHandle = () => void;\n\n/**\n * A subset of events that pertain to document ready state.\n */\ntype LoadingEventMap = Pick<DocumentEventMap, 'DOMContentLoaded' | 'load'>;\n\n/**\n * Calls the provided callback when the document is ready. This works both when the document is\n * already ready and when it is not, so callers do not have to care. This exists because it ensures\n * that each caller consistently expresses its dependency on document readiness, and to save a bit\n * of boilerplate.\n *\n * A document is considered ready when it has been parsed. This corresponds to the ready state of\n * 'interactive'. When the document has been fully loaded, the ready state is 'complete'. The\n * callback runs either way, so callers do not have to check which one they are in.\n *\n * Ready means the html is parsed and the DOM is there to query. It does not mean the page's other\n * scripts have run. Deferred scripts and module scripts run after the ready state turns\n * 'interactive' and before DOMContentLoaded fires, so a callback here can run before them. When a\n * caller needs some other script to have run already, this is the wrong tool, and it should wait on\n * whatever that script produces instead.\n *\n * That remedy has a catch of its own when the calling bundle is loaded with async. An async bundle\n * can execute after DOMContentLoaded has already fired, so a plain listener for that event never\n * runs and the work silently never happens. Nothing here can detect that, because by the time this\n * file executes the event is long gone. Catching it needs something registered at parse time,\n * before any bundle loads.\n *\n * There is a second trap right next to that one, and it applies only when waiting for\n * DOMContentLoaded. The ready state stays 'interactive' after DOMContentLoaded has fired, all the\n * way until 'complete', so the ready state cannot tell you whether DOMContentLoaded is still coming\n * or has already gone. Waiting for load is not exposed to this, because the ready state turns\n * 'complete' and load fires in the same task, so seeing 'complete' means load has fired too.\n *\n * When the document is already ready, the callback is invoked via setTimeout. This way, if the\n * callback throws, the error surfaces to the global error handler in a way that is similar to what\n * happens when an event listener throws.\n *\n * We might one day want to move this to an NPM library.\n *\n * Beware of a quirk here. setTimeout yields, and the busier the frontend, the longer it takes to\n * fire. Page load is exactly when the frontend is busiest. The timeout is a floor and not a\n * guarantee, so there is no real bound on how long that yield lasts. What this means is that using\n * this library can introduce more delay than you might expect. Compare code that runs on async load\n * and checks ready state and invokes immediately to code that runs after setTimeout. The former\n * runs in the same tick, the latter runs in \"some later tick\". That later tick can be surprisingly\n * much later. That can cause initial paint issues.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event\n * @see https://html.spec.whatwg.org/multipage/parsing.html#the-end\n */\nexport function ready(callback: (event?: Event) => void,\n  type: keyof LoadingEventMap = 'DOMContentLoaded') {\n  if (document.readyState === 'complete' || (type === 'DOMContentLoaded' &&\n    document.readyState === 'interactive')) {\n    const timer = setTimeout(callback, 0);\n    const handle: ReleaseHandle = () => clearTimeout(timer);\n    return handle;\n  } else {\n    addEventListener(type, callback);\n    const handle: ReleaseHandle = () => removeEventListener(type, callback);\n    return handle;\n  }\n}\n","import type { CustomElement } from '@integrabeauty/custom-elements';\nimport { ready, type ReleaseHandle } from '../../../lib/dom-ready.js';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders the country selector modal. The modal renders the required localization form with a\n * single usable drop down listing all available markets as indicated in the Shopify global objects.\n * Once the user selects a country, the disabled currency input will populate the currency ISO code\n * for that country. Once a user saves, the form will be submitted and on next page load the country\n * and currency locale will reflect their choice.\n *\n * The drop down is a select-only combobox. Focus stays on the country button while the list is\n * open, and the button points at the highlighted country with aria-activedescendant.\n */\nclass CountrySelectorForm extends HTMLElement implements CustomElement {\n  public static get observedAttributes() {\n    return [\n      'data-country-code',\n      'data-country-name',\n      'data-currency-code',\n      'data-language-code'\n    ];\n  }\n\n  declare readonly dataset: {\n    /**\n     * Country ISO Code. Required.\n     */\n    countryCode: string;\n\n    /**\n     * Country Name. Required.\n     */\n    countryName: string;\n\n    /**\n     * Currency ISO Code. Required.\n     */\n    currencyCode: string;\n\n    /**\n     * Language ISO Code. Required.\n     */\n    languageCode: string;\n  };\n\n  private onReadyBound = this.onReady.bind(this);\n  private onOptionClickBound = this.onOptionClick.bind(this);\n  private onContainerKeyUpBound = this.onContainerKeyUp.bind(this);\n  private onButtonClickBound = this.onButtonClick.bind(this);\n  private onButtonKeyDownBound = this.onButtonKeyDown.bind(this);\n  private onButtonFocusOutBound = this.onButtonFocusOut.bind(this);\n  private declare releaseReady: ReleaseHandle;\n\n  public connectedCallback() {\n    this.initializeShadowRoot();\n\n    this.releaseReady = ready(this.onReadyBound);\n\n    this.addEventListener('keyup', this.onContainerKeyUpBound);\n  }\n\n  private initializeShadowRoot() {\n    if (!this.shadowRoot) {\n      this.attachShadow({ mode: 'open', delegatesFocus: true });\n      this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n    }\n  }\n\n  /**\n   * This queries the light dom, which may not be ready by the time of connected callback\n   */\n  private onReady() {\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    button.addEventListener('click', this.onButtonClickBound);\n    button.addEventListener('keydown', this.onButtonKeyDownBound);\n    button.addEventListener('focusout', this.onButtonFocusOutBound);\n    button.addEventListener('mousedown', keepFocusOnMouseDown);\n\n    // The country list comes from the section's Liquid, so it starts out as one of our light DOM\n    // children. We move it into the shadow tree right after the button, because aria-controls and\n    // aria-activedescendant on the button only find ids in their own tree.\n    const lightList = this.querySelector('#country-list');\n    if (lightList) {\n      button.after(lightList);\n    }\n\n    const list = this.shadowRoot.querySelector<HTMLElement>('#country-list');\n    list?.addEventListener('click', this.onOptionClickBound);\n    list?.addEventListener('mousedown', keepFocusOnMouseDown);\n\n    this.render();\n  }\n\n  public attributeChangedCallback(_name: string, oldValue: string, newValue: string) {\n    this.initializeShadowRoot();\n\n    if (this.isConnected && oldValue !== newValue) {\n      this.render();\n    }\n  }\n\n  public disconnectedCallback() {\n    if (this.releaseReady) {\n      this.releaseReady();\n    }\n\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    if (button) {\n      button.removeEventListener('click', this.onButtonClickBound);\n      button.removeEventListener('keydown', this.onButtonKeyDownBound);\n      button.removeEventListener('focusout', this.onButtonFocusOutBound);\n      button.removeEventListener('mousedown', keepFocusOnMouseDown);\n    }\n\n    this.removeEventListener('keyup', this.onContainerKeyUpBound);\n\n    const list = this.shadowRoot.querySelector<HTMLElement>('#country-list');\n    list?.removeEventListener('click', this.onOptionClickBound);\n    list?.removeEventListener('mousedown', keepFocusOnMouseDown);\n  }\n\n  private onButtonClick(_event: MouseEvent) {\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    button.focus();\n\n    if (button.getAttribute('aria-expanded') === 'true') {\n      this.closeList();\n    } else {\n      this.openList();\n    }\n  }\n\n  /**\n   * The keys that act on keydown while focus is on the country button. Down or up opens the list.\n   * With the list open, down and up move the highlight without wrapping, Enter picks the\n   * highlighted country and closes the list, and Tab picks it before focus moves on. With the list\n   * closed, Enter and Space are left to the button's own click, which opens the list. Space and\n   * Escape on an open list are handled on keyup, in {@link onContainerKeyUp}.\n   */\n  private onButtonKeyDown(event: KeyboardEvent) {\n    const isOpen = this.isListOpen();\n\n    // Tab comes ahead of the modifier check, since Safari moves between buttons with Option+Tab\n    // unless its settings say otherwise\n    if (event.key === 'Tab') {\n      if (isOpen) {\n        this.selectActiveOption();\n      }\n\n      return;\n    }\n\n    // A key pressed with a modifier is a browser or system shortcut, such as Alt+Down, so we leave\n    // it alone\n    if (event.altKey || event.ctrlKey || event.metaKey) {\n      return;\n    }\n\n    switch (event.key) {\n      case 'ArrowDown':\n        event.preventDefault();\n        if (isOpen) {\n          this.moveActiveOption(1);\n        } else {\n          this.openList();\n        }\n\n        break;\n      case 'ArrowUp':\n        event.preventDefault();\n        if (isOpen) {\n          this.moveActiveOption(-1);\n        } else {\n          this.openList();\n        }\n\n        break;\n      case 'Enter':\n        // The button's own click would toggle the list closed without picking anything\n        if (isOpen) {\n          event.preventDefault();\n          this.selectActiveOption();\n        }\n\n        break;\n      case ' ':\n        // Keeps the page from scrolling. The pick happens on keyup.\n        if (isOpen) {\n          event.preventDefault();\n        }\n\n        break;\n      default:\n        break;\n    }\n  }\n\n  /**\n   * Focus never leaves the country button for the list, so focus leaving the button means a click\n   * or a Tab somewhere else, and the list closes.\n   */\n  private onButtonFocusOut(_event: FocusEvent) {\n    this.closeList();\n  }\n\n  /**\n   * The keys that act on keyup while the country list is open. Space picks the highlighted country,\n   * the same moment Space activates a button, and preventing the default keeps the button's click\n   * from opening the list again. Escape closes the list and stops there, since the modal manager\n   * closes the whole modal on an Escape keyup. With the list closed, Escape goes on to close the\n   * modal as usual.\n   */\n  private onContainerKeyUp(event: KeyboardEvent) {\n    if (!this.isListOpen()) {\n      return;\n    }\n\n    if (event.key === ' ') {\n      event.preventDefault();\n      this.selectActiveOption();\n    } else if (event.key === 'Escape') {\n      event.stopPropagation();\n      this.closeList();\n\n      const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n      button.focus();\n    }\n  }\n\n  private onOptionClick(event: MouseEvent) {\n    if (!(event.target instanceof Element)) {\n      return;\n    }\n\n    const option = event.target.closest<HTMLElement>('[role=\"option\"]');\n    if (!option) {\n      return;\n    }\n\n    this.selectOption(option);\n    this.closeList();\n\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    button.focus({ focusVisible: true });\n  }\n\n  private isListOpen() {\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    return button.getAttribute('aria-expanded') === 'true';\n  }\n\n  /**\n   * Shows the country list with the highlight on the selected country, the way a native select\n   * opens on its current value.\n   */\n  private openList() {\n    const list = this.shadowRoot.querySelector<HTMLElement>('#country-list');\n    if (!list) {\n      return;\n    }\n\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    button.setAttribute('aria-expanded', 'true');\n    list.hidden = false;\n\n    const selectedOption = list.querySelector<HTMLElement>('[aria-selected=\"true\"]');\n    const firstOption = list.querySelector<HTMLElement>('[role=\"option\"]');\n    this.setActiveOption(selectedOption || firstOption);\n  }\n\n  private closeList() {\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    button?.setAttribute('aria-expanded', 'false');\n    button?.removeAttribute('aria-activedescendant');\n\n    const list = this.shadowRoot.querySelector<HTMLElement>('#country-list');\n    if (list) {\n      list.hidden = true;\n    }\n\n    const activeOption = this.shadowRoot.querySelector<HTMLElement>('#country-list [data-active]');\n    if (activeOption) {\n      delete activeOption.dataset.active;\n    }\n  }\n\n  /**\n   * Moves the highlight to the given option, both for the eye, through data-active, and for a\n   * screen reader, through the button's aria-activedescendant.\n   */\n  private setActiveOption(activeOption: HTMLElement) {\n    if (!activeOption) {\n      return;\n    }\n\n    const options = this.shadowRoot.querySelectorAll<HTMLElement>('#country-list [role=\"option\"]');\n    for (const option of options) {\n      if (option === activeOption) {\n        option.dataset.active = 'true';\n      } else {\n        delete option.dataset.active;\n      }\n    }\n\n    const button = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button');\n    button.setAttribute('aria-activedescendant', activeOption.id);\n  }\n\n  /**\n   * Moves the highlight by the given number of options, stopping at the first and the last.\n   */\n  private moveActiveOption(step: number) {\n    const options = Array.from(\n      this.shadowRoot.querySelectorAll<HTMLElement>('#country-list [role=\"option\"]'));\n    const activeIndex = options.findIndex(option => option.dataset.active === 'true');\n    const nextIndex = Math.min(Math.max(activeIndex + step, 0), options.length - 1);\n    this.setActiveOption(options[nextIndex]);\n  }\n\n  private selectActiveOption() {\n    const activeOption = this.shadowRoot.querySelector<HTMLElement>('#country-list [data-active]');\n    if (activeOption) {\n      this.selectOption(activeOption);\n    }\n\n    this.closeList();\n  }\n\n  /**\n   * Shows the option's country on the button, and fills in the form's country code and the currency\n   * field from it.\n   */\n  private selectOption(option: HTMLElement) {\n    const span = this.shadowRoot.querySelector<HTMLButtonElement>('button.disclosure-button span');\n    span.textContent = option.dataset.countryName;\n\n    const input = this.shadowRoot.querySelector<HTMLInputElement>('input[name=\"country_code\"]');\n    input.value = option.dataset.value;\n\n    const currencyInput = this.shadowRoot.querySelector<HTMLInputElement>('input.currency-code');\n    currencyInput.value = option.dataset.currencyCode;\n\n    this.updateSelectedAttribute(option.id);\n  }\n\n  private updateSelectedAttribute(selectedId: string) {\n    const options = this.shadowRoot.querySelectorAll<HTMLElement>('#country-list [role=\"option\"]');\n    for (const option of options) {\n      if (option.id === selectedId) {\n        option.setAttribute('aria-selected', 'true');\n      } else {\n        option.setAttribute('aria-selected', 'false');\n      }\n    }\n  }\n\n  private render() {\n    const buttonSpan = this.shadowRoot.querySelector<HTMLButtonElement>(\n      'button.disclosure-button span');\n    buttonSpan.textContent = this.dataset.countryName;\n\n    const countryInput = this.shadowRoot.querySelector<HTMLInputElement>(\n      'input[name=\"country_code\"]');\n    countryInput.value = this.dataset.countryCode;\n\n    const currencyInput = this.shadowRoot.querySelector<HTMLInputElement>('input.currency-code');\n    currencyInput.value = this.dataset.currencyCode;\n\n    const languageInput = this.shadowRoot.querySelector<HTMLInputElement>(\n      'input[name=\"language_code\"]');\n    languageInput.value = this.dataset.languageCode;\n  }\n}\n\n/**\n * Keeps focus on the country button through a press on the button or on an option. A press would\n * otherwise move focus off the button, which WebKit does even for a press on the button itself, and\n * the focusout would close the list before the click lands. A click on an option would then miss,\n * and a click on the button meant to close the list would open it again.\n */\nfunction keepFocusOnMouseDown(event: MouseEvent) {\n  event.preventDefault();\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'country-selector-form': CountrySelectorForm;\n  }\n}\n\nif (!customElements.get('country-selector-form')) {\n  customElements.define('country-selector-form', CountrySelectorForm);\n}\n","import { ready } from '../../lib/dom-ready.js';\n\n// The modal-element around the country selector handles the close button, the dismiss gestures, and\n// telling the modal manager when it opens and closes. We open it, and inert the rest of the footer\n// while it's open.\n\ntype ModalElement = HTMLElementTagNameMap['modal-element'];\n\nfunction onReady() {\n  const modal = document.querySelector('#country-selector-modal');\n  if (modal) {\n    modal.addEventListener('modal-opened', onModalOpened);\n    modal.addEventListener('modal-closed', onModalClosed);\n  }\n\n  const buttons = document.querySelectorAll<HTMLButtonElement>('.open-country-selector-modal');\n  for (const button of buttons) {\n    button.addEventListener('click', onShowSelectorClick);\n  }\n}\n\nfunction onShowSelectorClick(event: MouseEvent) {\n  if (event.currentTarget instanceof HTMLElement) {\n    const focusEvent = new Event('focus-stack-push-requested', { bubbles: true, composed: true });\n    event.currentTarget.dispatchEvent(focusEvent);\n\n    const modal = document.querySelector<ModalElement>('#country-selector-modal');\n    modal.dataset.open = 'true';\n  }\n}\n\n/**\n * The modal manager inerts every other section on the page, but it can't inert the footer, since\n * the modal lives in it too. That leaves the footer's links and sign up form tabbable behind the\n * open modal, so we inert them ourselves. The modal renders as a sibling of the footer content\n * rather than inside it, so this doesn't reach the modal.\n */\nfunction onModalOpened(_event: HTMLElementEventMap['modal-opened']) {\n  const content = document.querySelector('.footer-section > .content');\n  if (content instanceof HTMLElement) {\n    content.inert = true;\n  }\n}\n\n/**\n * Takes the footer back out of inert. The modal manager puts focus back on the opener only after\n * this runs, and the opener is in the footer, so it is no longer inert by then.\n */\nfunction onModalClosed(_event: HTMLElementEventMap['modal-closed']) {\n  const content = document.querySelector('.footer-section > .content');\n  if (content instanceof HTMLElement) {\n    content.inert = false;\n  }\n}\n\nready(onReady);\n","export interface SubscribeInput {\n  email?: string;\n  first_name?: string;\n  phone?: string;\n  shopify_customer_id?: string;\n  sign_up_source_id: string;\n}\n\nexport interface RequestBody {\n  email?: string;\n  first_name?: string;\n  phone?: string;\n  shop_domain?: string;\n  shopify_customer_id?: string;\n  sign_up_source_id?: string;\n}\n\nexport type ResponseBody = Record<string, any>;\n\ninterface ErrorResponseBody {\n  error: string;\n}\n\n/**\n * This uses the no-store cache property because we never want this request to use the cache.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n */\nexport async function subscribe(input: SubscribeInput) {\n  const url = 'https://langehair.com/apps/attentive-relay/prod/v1/subscribe';\n\n  const requestBody: RequestBody = {\n    email: input.email,\n    first_name: input.first_name,\n    phone: input.phone,\n    shop_domain: 'lange-beauty.myshopify.com',\n    shopify_customer_id: input.shopify_customer_id,\n    sign_up_source_id: input.sign_up_source_id\n  };\n\n  let response;\n  try {\n    response = await fetch(url, {\n      body: JSON.stringify(requestBody),\n      cache: 'no-store',\n      headers: {\n        'Content-Type': 'application/json'\n      },\n      method: 'POST',\n      mode: 'cors'\n    });\n  } catch (error) {\n    const ae = new AttentiveError('There was a problem subscribing', { cause: error });\n    ae.request_body = requestBody;\n    ae.url = url;\n    throw ae;\n  }\n\n  // On success, we have a 204 No Content, so we do not attempt to fetch the response body. Calling\n  // await response.json() can throw for 204s. So we either have a non-204 indicating an error or we\n  // succeeded.\n\n  if (response.status !== 204) {\n    const error = new AttentiveError('There was a problem subscribing');\n    error.request_body = requestBody;\n\n    // If there is an issue in the backend subscribing, then we might have some information about\n    // the error in the response body, so we have to try to extract the message.\n\n    try {\n      const responseBody = await response.json();\n      error.response_body = responseBody;\n\n      if (isErrorResponseBody(responseBody)) {\n        error.message = responseBody.error;\n      }\n    } catch (error) {\n      // ignore\n    }\n\n    error.status = response.status;\n    error.url = response.url;\n    throw error;\n  }\n}\n\nfunction isErrorResponseBody(value: any): value is ErrorResponseBody {\n  return typeof value?.error === 'string' && value.error.length > 0;\n}\n\nexport class AttentiveError extends Error {\n  public declare request_body: any;\n  public declare response_body: any;\n  public declare status: number;\n  public declare url: string;\n\n  constructor(message?: string, options?: ErrorOptions) {\n    super(message || 'Unknown', options);\n  }\n}\n","import { isValidEmailAddress } from '@integrabeauty/person';\nimport { AttentiveError, type SubscribeInput, subscribe } from '../../lib/attentive-service.js';\nimport { ready } from '../../lib/dom-ready.js';\n\ninterface RequestData {\n  email: string;\n  first_name: string;\n  phone: string | undefined;\n}\n\nfunction isValidPhone(phone: string) {\n  return /^[+]?(1\\s?)?((\\([0-9]{3}\\))|[0-9]{3})[\\s\\-]?[\\0-9]{3}[\\s\\-]?[0-9]{4}$/.test(phone);\n}\n\n// Each input sits in a field group that contains a single message element. These helpers toggle the\n// group's error/success state and message by walking up from the input, so the surrounding markup\n// is reached by structure rather than through per-element handles.\n\nfunction markFieldError(input: HTMLInputElement, message: string) {\n  const field = input.closest('.field-wrapper');\n  field.classList.add('error');\n  field.querySelector('.form-message').textContent = message;\n}\n\nfunction markFieldValid(input: HTMLInputElement) {\n  input.closest('.field-wrapper').classList.add('success');\n}\n\nfunction clearField(input: HTMLInputElement | null) {\n  if (input) {\n    const field = input.closest('.field-wrapper');\n    field.classList.remove('error', 'success');\n    field.querySelector('.form-message').textContent = '';\n  }\n}\n\n/**\n * Validates and submits the newsletter signup form\n */\nfunction onSubmit(event: SubmitEvent) {\n  event.preventDefault();\n\n  // In the theme editor a merchant is not actually subscribing, so do not submit the form. We do\n  // this check here instead of dynamically registering the listener so that we handle all submit\n  // events and ensure that we call preventDefault().\n\n  // This module expects that the Shopify global is correctly declared and initialized. We\n  // intentionally are not being defensive about its presence here.\n\n  if (Shopify.designMode) {\n    return;\n  }\n\n  const form = event.currentTarget;\n  if (!(form instanceof HTMLFormElement)) {\n    return;\n  }\n\n  const submitButton = form.querySelector('button');\n  submitButton.classList.add('submitting');\n  submitButton.textContent = 'Submitting...';\n\n  const emailInput = form.querySelector<HTMLInputElement>('#subscribe-email');\n  const nameInput = form.querySelector<HTMLInputElement>('#subscribe-name');\n  const phoneInput = form.querySelector<HTMLInputElement>('#subscribe-phone-number');\n\n  const requestData: RequestData = {\n    email: emailInput.value,\n    first_name: nameInput.value,\n    phone: phoneInput?.value\n  };\n\n  const nameError = !isValidPersonName(requestData.first_name);\n  const emailError = !isValidEmailAddress(requestData.email);\n\n  let phoneError = false;\n  if (requestData.phone) {\n    phoneError = !isValidPhone(requestData.phone);\n  }\n\n  const termsInputElement = form.querySelector<HTMLInputElement>('#subscribe-terms');\n\n  let termsError = false;\n  if (requestData.phone && termsInputElement) {\n    termsError = !termsInputElement.checked;\n  }\n\n  const customerId = form.querySelector<HTMLInputElement>('#customer-id').value;\n\n  if (nameError) {\n    markFieldError(nameInput, 'Please enter a name');\n  } else {\n    markFieldValid(nameInput);\n  }\n\n  if (emailError) {\n    markFieldError(emailInput, 'Please enter a valid email address');\n  } else {\n    markFieldValid(emailInput);\n  }\n\n  const termsWrapper = form.querySelector('#subscribe-terms-wrapper');\n  if (termsError) {\n    termsWrapper.classList.add('error');\n    termsWrapper.querySelector('.form-message').textContent =\n      'Please accept the Conditions and Terms above';\n  } else {\n    termsWrapper.classList.add('success');\n  }\n\n  if (phoneError) {\n    markFieldError(phoneInput, 'Please enter a valid phone number');\n  } else {\n    markFieldValid(phoneInput);\n  }\n\n  if (nameError || emailError || phoneError || termsError) {\n    submitButton.classList.remove('submitting');\n    submitButton.textContent = 'Submit';\n    return;\n  }\n\n  let currencyCode = 'USD';\n  const currencyCodeInput = form.querySelector<HTMLInputElement>('#currency-code');\n  if (currencyCodeInput) {\n    currencyCode = currencyCodeInput.value;\n  }\n\n  const resultElement = form.querySelector('#subscribe-response');\n  if (!resultElement) {\n    return;\n  }\n\n  const subscribeInput: SubscribeInput = {\n    email: requestData.email,\n    first_name: requestData.first_name,\n    phone: requestData.phone,\n    shopify_customer_id: customerId,\n    sign_up_source_id: '991550'\n  };\n\n  subscribe(subscribeInput)\n    .then(() => onSubscribeSuccess(form, requestData, currencyCode))\n    .catch((error) => onSubscribeError(error, form));\n}\n\nfunction isValidPersonName(name: string) {\n  // Some browsers do not tolerate using an empty space in the character class so we use \\s\n  // explicitly, even though it matches multiple kinds of spaces.\n  return /^[a-z\\s]{2,30}$/i.test(name);\n}\n\nfunction onSubscribeSuccess(form: HTMLFormElement, requestData: RequestData, currencyCode: string) {\n  const resultElement = form.querySelector('#subscribe-response');\n  resultElement.classList.remove('error');\n  resultElement.classList.add('success');\n  resultElement.textContent = 'Thank you for registering!';\n\n  const phoneInput = form.querySelector<HTMLInputElement>('#subscribe-phone-number');\n  if (phoneInput) {\n    phoneInput.value = '';\n  }\n\n  const termsInput = form.querySelector<HTMLInputElement>('#subscribe-terms');\n  if (termsInput) {\n    termsInput.checked = false;\n  }\n\n  const termsWrapper = form.querySelector<HTMLElement>('#subscribe-terms-wrapper');\n  if (termsWrapper) {\n    termsWrapper.hidden = true;\n    termsWrapper.classList.remove('success');\n  }\n\n  const inputs = form.querySelectorAll<HTMLInputElement>('input:not([type=\"hidden\"])');\n  for (const input of inputs) {\n    input.value = '';\n  }\n\n  const nameInput = form.querySelector<HTMLInputElement>('#subscribe-name');\n  clearField(nameInput);\n\n  const emailInput = form.querySelector<HTMLInputElement>('#subscribe-email');\n  clearField(emailInput);\n\n  clearField(phoneInput);\n\n  const submitButton = form.querySelector('button');\n  submitButton.classList.remove('submitting');\n  submitButton.classList.add('success');\n  submitButton.textContent = 'Success!';\n\n  dispatchIdentityCaptured(form, requestData);\n\n  type FormSubmitDetail = WindowEventMap['form-submit']['detail'];\n  const submitEvent = new CustomEvent<FormSubmitDetail>('form-submit', {\n    bubbles: true,\n    detail: {\n      currency_code: currencyCode,\n      email_provided: requestData.email ? true : false,\n      form_name: 'footer-subscribe',\n      form_location: location.href,\n      form_type: 'marketing-subscribe',\n      phone_provided: requestData.phone ? true : false\n    }\n  });\n  form.dispatchEvent(submitEvent);\n}\n\nfunction dispatchIdentityCaptured(form: HTMLFormElement, requestData: RequestData) {\n  if (!requestData.email && !requestData.phone) {\n    return;\n  }\n\n  type Detail = WindowEventMap['identity-captured']['detail'];\n  const detail: Detail = {};\n\n  // Although the input field is labelled first_name, the placeholder text suggests that it can\n  // contain the full name. To accommodate this, we will attempt to parse the first_name field into\n  // first and last name by splitting on space. If there is only one part, we will treat it as the\n  // first name. If there are two parts, we will treat the first part as the first name and the\n  // second part as the last name. If there are more than two parts, we treat the last part as the\n  // last name and the rest as the first name.\n\n  if (requestData.first_name) {\n    const parts = requestData.first_name.split(' ');\n    if (parts.length === 1) {\n      detail.first_name = parts[0];\n    } else if (parts.length === 2) {\n      detail.first_name = parts[0];\n      detail.last_name = parts[1];\n    } else {\n      detail.last_name = parts.pop();\n      detail.first_name = parts.join(' ');\n    }\n  }\n\n  if (requestData.email) {\n    detail.email = requestData.email;\n  }\n\n  if (requestData.phone) {\n    detail.phone = requestData.phone;\n  }\n\n  const event = new CustomEvent<Detail>('identity-captured', {\n    bubbles: true,\n    detail\n  });\n  form.dispatchEvent(event);\n}\n\nfunction onSubscribeError(error: unknown, form: HTMLFormElement) {\n  const resultElement = form.querySelector('#subscribe-response');\n  resultElement.classList.remove('success');\n  resultElement.classList.add('error');\n\n  const submitButton = form.querySelector('button');\n  submitButton.classList.remove('submitting');\n  submitButton.textContent = 'Submit';\n\n  if (error instanceof AttentiveError) {\n    resultElement.innerHTML = error.message ||\n      'There was a problem submitting your request, please try again later';\n  } else {\n    resultElement.innerHTML =\n      'There was a problem submitting your request, please try again later';\n    console.warn(error, 'Failed to subscribe in Attentive');\n  }\n\n  const termsWrapper = form.querySelector<HTMLElement>('#subscribe-terms-wrapper');\n  termsWrapper.hidden = true;\n}\n\nfunction onPhoneFocus(event: FocusEvent) {\n  if (event.currentTarget instanceof HTMLInputElement) {\n    clearField(event.currentTarget);\n\n    const terms = event.currentTarget.form.querySelector<HTMLElement>('#subscribe-terms-wrapper');\n    terms.hidden = false;\n    terms.querySelector('.form-message').textContent = '';\n  }\n}\n\nfunction onPhoneBlur(event: FocusEvent) {\n  if (event.currentTarget instanceof HTMLInputElement) {\n    const terms = event.currentTarget.form.querySelector<HTMLElement>('#subscribe-terms-wrapper');\n    terms.hidden = !event.currentTarget.value;\n  }\n}\n\nfunction onTermsChange(event: Event) {\n  if (event.target instanceof HTMLInputElement && event.target.checked) {\n    const terms = event.target.form.querySelector('#subscribe-terms-wrapper');\n    terms.classList.remove('error');\n    terms.querySelector('.form-message').textContent = '';\n  }\n}\n\nfunction onNameFocus(event: FocusEvent) {\n  if (event.currentTarget instanceof HTMLInputElement) {\n    clearField(event.currentTarget);\n  }\n}\n\nfunction onEmailFocus(event: FocusEvent) {\n  if (event.currentTarget instanceof HTMLInputElement) {\n    clearField(event.currentTarget);\n  }\n}\n\nfunction onReady() {\n  const terms = document.querySelector<HTMLInputElement>('#subscribe-terms');\n  terms?.addEventListener('change', onTermsChange);\n\n  const phone = document.querySelector<HTMLInputElement>('#subscribe-phone-number');\n  phone?.addEventListener('focus', onPhoneFocus);\n  phone?.addEventListener('blur', onPhoneBlur);\n\n  const form = document.querySelector<HTMLFormElement>('form[name=\"subscribe\"]');\n  form?.addEventListener('submit', onSubmit);\n\n  const submitButton = form?.querySelector('button');\n  if (submitButton) {\n    submitButton.disabled = false;\n  }\n\n  const name = document.querySelector<HTMLInputElement>('#subscribe-name');\n  name?.addEventListener('focus', onNameFocus);\n\n  const email = document.querySelector<HTMLInputElement>('#subscribe-email');\n  email?.addEventListener('focus', onEmailFocus);\n}\n\nready(onReady);\n","/**\n * Validates an email address.\n *\n * Based on the regex used by Meta's pixel.\n */\nexport function isValidEmailAddress(email) {\n    // eslint-disable-next-line @stylistic/max-len\n    return /^[\\w!#\\$%&\\'\\*\\+\\/\\=\\?\\^`\\{\\|\\}~\\-]+(:?\\.[\\w!#\\$%&\\'\\*\\+\\/\\=\\?\\^`\\{\\|\\}~\\-]+)*@(?:[a-z0-9](?:[a-z0-9\\-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9\\-]*[a-z0-9])?$/i.test(email);\n}\n","/**\n * Throws an assertion error if the given condition is falsy.\n *\n * @param expression any expression, although one that evaluates to true or false is preferred by\n * convention\n * @param message optional error text\n */\nexport function assert(expression: unknown, message?: string) {\n  if (!expression) {\n    throw new AssertionError(message);\n  }\n}\n\nexport class AssertionError extends Error {\n  constructor(message = 'Assertion error') {\n    super(message);\n    this.name = this.constructor.name;\n  }\n}\n","import { assert } from '@integrabeauty/assert';\nimport type { FetchBusinessUnitResponseBody } from '@integrabeauty/trustpilot-types';\n\n/**\n * Fetches public information about a business unit from TrustPilot's API.\n *\n * @param apiKey api key\n * @param businessUnitId business unit id\n * @param useCache whether to use Integra's own custom backend cache service in order to avoid the\n * unreliable TrustPilot API\n */\nexport async function fetchBusinessUnit(apiKey: string, businessUnitId: string, useCache = false) {\n  assert(apiKey, 'Invalid api key');\n  assert(businessUnitId, 'Invalid business unit id');\n\n  const path = useCache ?\n    '/apps/trustpilot-cache/lange-business-unit.json' :\n    `/apps/trustpilot-api/v1/business-units/${businessUnitId}`;\n\n  let headers: HeadersInit = {};\n  if (!useCache) {\n    headers = {\n      'Content-Type': 'application/json',\n      'apiKey': apiKey\n    };\n  }\n\n  let response;\n  try {\n    response = await fetch(path, { headers });\n  } catch (cause) {\n    const error: any = new Error('Failed to fetch business units', { cause });\n    error.url = path;\n    throw error;\n  }\n\n  if (!response.ok) {\n    const error: any = new Error('Trustpilot Site Rating Service Error ' +\n      `${response.status} ${response.statusText} ${response.url}`);\n    error.status = response.status;\n    error.url = response.url;\n    throw error;\n  }\n\n  // We are intentionally not using response.json() here because it obscures errors.\n  let responseText;\n  try {\n    responseText = await response.text();\n  } catch (cause) {\n    const error: any = new Error('Failed to fetch TrustPilot business units response body',\n      { cause });\n    error.status = response.status;\n    error.url = response.url;\n    throw error;\n  }\n\n  let body;\n  try {\n    body = JSON.parse(responseText);\n  } catch (cause) {\n    const error: any = new Error('Failed to parse TrustPilot business units response body',\n      { cause });\n    error.body = responseText;\n    error.status = response.status;\n    error.url = response.url;\n    throw error;\n  }\n\n  if (!isResponseBody(body)) {\n    const error: any = new Error('Unexpected TrustPilot business units response body');\n    error.body = body;\n    error.status = response.status;\n    error.url = response.url;\n    throw error;\n  }\n\n  return body;\n}\n\nfunction isResponseBody(value: any): value is FetchBusinessUnitResponseBody {\n  return Number.isInteger(value?.numberOfReviews?.total);\n}\n","import { ready } from '../../lib/dom-ready.js';\nimport { fetchBusinessUnit } from './trustpilot-fetch-business-unit.js';\n\ninterface CachedRating {\n  score: number;\n  total: number;\n}\n\nasync function fetchBusinessUnitCached(apiKey: string, businessUnitId: string) {\n  const storageKey = 'trustpilot_site_rating';\n\n  let rating: CachedRating;\n\n  try {\n    const value = sessionStorage.getItem(storageKey);\n    if (value) {\n      rating = JSON.parse(value);\n      if (rating) {\n        return rating;\n      }\n    }\n  } catch (error) {\n    console.debug(error);\n  }\n\n  const body = await fetchBusinessUnit(apiKey, businessUnitId, true);\n\n  rating = {\n    score: body.score.trustScore,\n    total: body.numberOfReviews.total\n  };\n\n  try {\n    sessionStorage.setItem(storageKey, JSON.stringify(rating));\n  } catch (error) {\n    console.debug(error);\n  }\n\n  return rating;\n}\n\nfunction onReady() {\n  // init calls out to fetch business unit and otherwise does nothing fallible. the only reason init\n  // fails is because of a failure to fetch. the failure to fetch here is not really indicative of a\n  // programming error. it is in fact routine to experience load failures because of networking\n  // problems (e.g. unreliable cellular data). if something were truly systemic it would be visually\n  // obvious. because the fetch errors are so routine, this does not capture the error at the error\n  // or warning level.\n\n  init().catch(console.debug);\n}\n\nasync function init() {\n  const badges = document.querySelectorAll('trustpilot-badge');\n  if (badges.length === 0) {\n    return;\n  }\n\n  // cspell:disable\n  const apiKey = 'zY69rTwFDPKLgqcVnM2Ai95NZ2V6NeAR';\n  const businessUnitId = '5ccc9833442b4b00014a6eb9';\n  // cspell:enable\n\n  const businessUnit = await fetchBusinessUnitCached(apiKey, businessUnitId);\n  for (const badge of badges) {\n    badge.dataset.rating = `${businessUnit.score}`;\n    badge.dataset.total = `${businessUnit.total}`;\n  }\n}\n\nready(onReady);\n","import { ready } from '../../lib/dom-ready.js';\n\n/**\n * Shopify's preview bar is the only thing that tells you you are looking at a preview theme. People\n * working on the theme often close it and then forget whether they are looking at production or an\n * alternative. So they report a bug that is already fixed, or they QA the theme thinking it is\n * live. We add a thin bar above the footer naming the theme as a second signal that sticks around\n * after the preview bar is gone. It sits below the fold so adding it after load causes no visible\n * repaint.\n */\nfunction onReady() {\n  // The theme editor also reports preview mode, and there it is already obvious which theme you are\n  // on.\n\n  if (Shopify.previewMode && !Shopify.designMode) {\n    const footer = document.querySelector('.footer-section');\n    if (footer) {\n      // The styles go inline so that this preview-only bar adds nothing to the footer stylesheet\n      // every visitor downloads.\n\n      const notice = document.createElement('div');\n      notice.style.padding = '4px 16px';\n      notice.style.background = '#000';\n      notice.style.color = '#fff';\n      notice.style.fontSize = '0.75rem';\n      notice.style.lineHeight = '1.5';\n      notice.style.textAlign = 'center';\n\n      const name = Shopify.theme?.name?.trim();\n      notice.textContent = name ? `You are viewing a preview theme: ${name}. ` :\n        'You are viewing a preview theme. ';\n\n      // This is the same request the Exit preview button in Shopify's preview bar makes. Shopify\n      // ends the preview and redirects back to the same url without the param.\n\n      const exitURL = new URL(location.href);\n      exitURL.searchParams.set('exitPreview', '1');\n\n      const exitLink = document.createElement('a');\n      exitLink.href = exitURL.href;\n      exitLink.textContent = 'Exit';\n      exitLink.style.color = 'inherit';\n      exitLink.style.textDecoration = 'underline';\n      notice.append(exitLink);\n\n      footer.before(notice);\n    }\n  }\n}\n\nready(onReady);\n"],"names":["TrustpilotBadge","HTMLElement","observedAttributes","connectedCallback","this","initializeShadowRoot","render","attributeChangedCallback","_name","oldValue","newValue","isConnected","shadowRoot","attachShadow","mode","innerHTML","rating","Math","min","parseFloat","dataset","isNaN","total","parseInt","hidden","scoreElement","querySelector","textContent","toString","totalElement","format","Intl","NumberFormat","starsElement","starPrefix","prefix","customElements","get","define","YotpoBadge","href","url","src","badgeImageSrc","totalText","Number","toFixed","score","averageScore","badge","setAttribute","join","TrustpilotRatingStars","name","dark","querySelectorAll","i","length","classList","add","ready","callback","type","document","readyState","timer","setTimeout","clearTimeout","addEventListener","removeEventListener","CountrySelectorForm","onReadyBound","onReady","bind","onOptionClickBound","onOptionClick","onContainerKeyUpBound","onContainerKeyUp","onButtonClickBound","onButtonClick","onButtonKeyDownBound","onButtonKeyDown","onButtonFocusOutBound","onButtonFocusOut","releaseReady","delegatesFocus","button","keepFocusOnMouseDown","lightList","after","list","disconnectedCallback","_event","focus","getAttribute","closeList","openList","event","isOpen","isListOpen","key","altKey","ctrlKey","metaKey","preventDefault","moveActiveOption","selectActiveOption","stopPropagation","target","Element","option","closest","selectOption","focusVisible","selectedOption","firstOption","setActiveOption","removeAttribute","activeOption","active","options","id","step","Array","from","activeIndex","findIndex","nextIndex","max","countryName","value","currencyCode","updateSelectedAttribute","selectedId","countryCode","languageCode","onShowSelectorClick","currentTarget","focusEvent","Event","bubbles","composed","dispatchEvent","open","onModalOpened","content","inert","onModalClosed","modal","buttons","AttentiveError","Error","constructor","message","super","markFieldError","input","field","markFieldValid","clearField","remove","onSubmit","Shopify","designMode","form","HTMLFormElement","submitButton","emailInput","nameInput","phoneInput","requestData","email","first_name","phone","nameError","test","emailError","phoneError","termsInputElement","termsError","checked","customerId","termsWrapper","currencyCodeInput","async","requestBody","shop_domain","shopify_customer_id","sign_up_source_id","response","fetch","body","JSON","stringify","cache","headers","method","error","ae","cause","request_body","status","responseBody","json","response_body","subscribe","then","resultElement","termsInput","inputs","detail","parts","split","last_name","pop","CustomEvent","dispatchIdentityCaptured","submitEvent","currency_code","email_provided","form_name","form_location","location","form_type","phone_provided","onSubscribeSuccess","catch","console","warn","onSubscribeError","onPhoneFocus","HTMLInputElement","terms","onPhoneBlur","onTermsChange","onNameFocus","onEmailFocus","assert","expression","AssertionError","disabled","fetchBusinessUnit","apiKey","businessUnitId","useCache","path","responseText","ok","statusText","text","parse","isInteger","_value$numberOfReview","numberOfReviews","badges","businessUnit","storageKey","sessionStorage","getItem","debug","trustScore","setItem","fetchBusinessUnitCached","init","previewMode","footer","_Shopify$theme","notice","createElement","style","padding","background","color","fontSize","lineHeight","textAlign","theme","trim","exitURL","URL","searchParams","set","exitLink","textDecoration","append","before"],"sourceRoot":""}