@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
99 lines (97 loc) • 3.03 kB
JavaScript
/**
* WARNING: This file is intended to be used within MySheerID.
* This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
*/
/**
* VERSION: 2.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694697559
* BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { R as i, q as h, e as s, l as u } from "../_mysheerid-preview.js";
const d = "collect-info-submission-time", m = "collect-info-submit", C = "doc-upload-submit", g = "doc-upload-submission-time", l = () => Math.random().toString(36).substr(2, 9), S = {
OrgSearchNumReworks: "org-search-num-reworks",
OrgSearchQueryLength: "org-search-query-length",
OrgSearchResultRank: "org-search-result-rank",
OrgSearchTimeUntilSelection: "org-search-time-until-selection",
OrgSearchOpenSortMenu: "org-search-open-sort-menu",
OrgSearchSortDistance: "org-search-sort-distance",
OrgSearchSortRelevance: "org-search-sort-relevance",
AsrTipsShown: "asr-tips-shown",
AsrSearchAfterTips: "asr-search-after-tips",
AsrClickThrough: "asr-click-through",
CaptchaUnmountedBeforeRender: "captcha-unmounted-before-render",
CaptchaAbandonedAfterRender: "captcha-abandoned-after-render",
CaptchaRendered: "captcha-rendered",
CaptchaVerified: "captcha-verified",
CaptchaErrorClient: "captcha-error-client",
CaptchaErrorClientCode: "captcha-error-client-code",
CaptchaErrorScriptLoad: "captcha-error-script-load",
CaptchaErrorServer: "captcha-error-server",
CaptchaErrorBrowserCompatibility: "captcha-error-browser-compatibility",
CaptchaRetryClicked: "captcha-retry-clicked",
CaptchaErrorLoadTimeout: "captcha-error-load-timeout"
}, O = ({ segment: a, programId: n }) => {
const [t] = i.useState(l()), e = h();
return i.useEffect(() => {
try {
performance.mark(t);
} catch {
}
}, []), {
// @TODO move GA and NR events into this?
userDidConvert: (r, c) => {
if (s()._launchDarklyUserTargeting)
try {
const o = performance.measure("timeOnForm", t);
e.track(r, {
segment: a
}), e.track(
c,
{
segment: a
},
o.duration
);
} catch (o) {
u.error("Unable to submit metrics", o);
}
},
recordNumericMetric: (r, c) => {
s()._launchDarklyUserTargeting && e.track(
r,
{
segment: a,
programId: n
},
c
);
},
trackEvent: (r) => {
s()._launchDarklyUserTargeting && e.track(r, {
segment: a,
programId: n
});
},
flush: () => {
e.flush();
},
/**
* @deprecated use userDidConvert instead
*/
getTimeOnForm: () => {
try {
return performance.measure("timeOnForm", t);
} catch {
}
}
};
};
export {
m as C,
C as D,
S as M,
d as a,
g as b,
O as u
};