import * as React from 'react';
// Production extension Url
const extensionUrl = 'chrome-extension://dgjhfomjieaadpoljlnidmbgkdffpack';
/**
 * Returns the URL used to link the browser extension to a Sourcegraph instance.
 *
 * @param email the email address of the authenticated user.
 */
const getExtensionLinkURL = (email) => {
    const url = new URL(`${extensionUrl}/link.html`);
    url.searchParams.set('sourceurl', location.origin);
    url.searchParams.set('userId', email);
    return url.toString();
};
/**
 * Embeds an iframe responsible for passing the current user and Sourcegraph URL to the browser
 * extension.
 */
export const LinkExtension = props => (React.createElement("iframe", { className: "link-extension", src: getExtensionLinkURL(props.user.email) }));
//# sourceMappingURL=Link.js.map