getReferrerDetails(history) {
        // Empty history will return null as it means script is not loaded
        if (history.length === 0) {
            return {
                referrerSource: null,
                referrerMedium: null,
                referrerUrl: null
            };
        }

        for (const item of history) {
            let refUrl = this.getUrlFromStr(item.referrerUrl);
            if (refUrl?.hostname === 'checkout.stripe.com') {
                // Ignore stripe, because second try payments should not be attributed to Stripe
                continue;
            }
            // Use the parser to check against known referrers
            const {referrerSource, referrerMedium, referrerUrl} = this.parser.parse(item.referrerUrl, item.referrerSource, item.referrerMedium);
            // Keep searching history if there's no match
            if (referrerSource || referrerMedium || referrerUrl) {
                return {
                    referrerSource,
                    referrerMedium,
                    referrerUrl
                };
            }
        }
        // Fall back to Direct if no matches in any history entry
        return {
            referrerSource: 'Direct',
            referrerMedium: null,
            referrerUrl: null
        };
    }
Calculate referrer details from history
@param {import('./UrlHistory').UrlHistoryArray} history
@returns {ReferrerData|null}