<commit_before>
import xcomponent from 'xcomponent/src';
import { SyncPromise as Promise } from 'sync-browser-mocks/src/promise';

import { Checkout } from '../components';
import { isLegacyEligible } from './eligibility';
import { config } from '../config';
import { setupBridge } from '../compat';

import { redirect as redir, onDocumentReady, getElements, once } from './util';
import { renderButtons } from './button';
import { $logger } from './log';

const REDIRECT_DELAY = 500;


let inClick = false;

let ifNotClickMethods = [];

function registerClick() {
    inClick = true;

    ifNotClickMethods = [];

    setTimeout(() => {
        inClick = false;
    }, 1);<commit_msg>Add temporary window.Promise shim<commit_after>
import xcomponent from 'xcomponent/src';
import { SyncPromise as Promise } from 'sync-browser-mocks/src/promise';

import { Checkout } from '../components';
import { isLegacyEligible } from './eligibility';
import { config } from '../config';
import { setupBridge } from '../compat';

import { redirect as redir, onDocumentReady, getElements, once } from './util';
import { renderButtons } from './button';
import { $logger } from './log';

const REDIRECT_DELAY = 500;


// Do this until button code is fixed to not expect window.Promise

if (!window.Promise) {
    window.Promise = Promise;
}


let inClick = false;

let ifNotClickMethods = [];

function registerClick() {
    inClick = true;

    ifNotClickMethods = [];

    setTimeout(() => {
        inClick = false;
    }, 1);
{'fraction_non_alphanumeric': 0.1419141914191419, 'fraction_numerical': 0.005280528052805281, 'mean_word_length': 3.7080745341614905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '321223', 'n_tokens_mistral': 459, 'n_tokens_neox': 441, 'n_words': 139}