@amplitude/plugin-web-vitals-browser 1.1.49-video-analytics-5.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +36 -0
  2. package/lib/cjs/constants.d.ts +34 -0
  3. package/lib/cjs/constants.d.ts.map +1 -1
  4. package/lib/cjs/constants.js +14 -1
  5. package/lib/cjs/constants.js.map +1 -1
  6. package/lib/cjs/index.d.ts +9 -1
  7. package/lib/cjs/index.d.ts.map +1 -1
  8. package/lib/cjs/index.js +21 -3
  9. package/lib/cjs/index.js.map +1 -1
  10. package/lib/cjs/utils.d.ts +4 -0
  11. package/lib/cjs/utils.d.ts.map +1 -0
  12. package/lib/cjs/utils.js +29 -0
  13. package/lib/cjs/utils.js.map +1 -0
  14. package/lib/cjs/version.d.ts +1 -1
  15. package/lib/cjs/version.d.ts.map +1 -1
  16. package/lib/cjs/version.js +1 -1
  17. package/lib/cjs/version.js.map +1 -1
  18. package/lib/cjs/web-vitals-plugin.d.ts.map +1 -1
  19. package/lib/cjs/web-vitals-plugin.js +6 -22
  20. package/lib/cjs/web-vitals-plugin.js.map +1 -1
  21. package/lib/cjs/web-vitals-soft-nav-plugin.d.ts +4 -0
  22. package/lib/cjs/web-vitals-soft-nav-plugin.d.ts.map +1 -0
  23. package/lib/cjs/web-vitals-soft-nav-plugin.js +177 -0
  24. package/lib/cjs/web-vitals-soft-nav-plugin.js.map +1 -0
  25. package/lib/esm/constants.d.ts +34 -0
  26. package/lib/esm/constants.d.ts.map +1 -1
  27. package/lib/esm/constants.js +13 -0
  28. package/lib/esm/constants.js.map +1 -1
  29. package/lib/esm/index.d.ts +9 -1
  30. package/lib/esm/index.d.ts.map +1 -1
  31. package/lib/esm/index.js +20 -1
  32. package/lib/esm/index.js.map +1 -1
  33. package/lib/esm/utils.d.ts +4 -0
  34. package/lib/esm/utils.d.ts.map +1 -0
  35. package/lib/esm/utils.js +25 -0
  36. package/lib/esm/utils.js.map +1 -0
  37. package/lib/esm/version.d.ts +1 -1
  38. package/lib/esm/version.d.ts.map +1 -1
  39. package/lib/esm/version.js +1 -1
  40. package/lib/esm/version.js.map +1 -1
  41. package/lib/esm/web-vitals-plugin.d.ts.map +1 -1
  42. package/lib/esm/web-vitals-plugin.js +1 -17
  43. package/lib/esm/web-vitals-plugin.js.map +1 -1
  44. package/lib/esm/web-vitals-soft-nav-plugin.d.ts +4 -0
  45. package/lib/esm/web-vitals-soft-nav-plugin.d.ts.map +1 -0
  46. package/lib/esm/web-vitals-soft-nav-plugin.js +173 -0
  47. package/lib/esm/web-vitals-soft-nav-plugin.js.map +1 -0
  48. package/lib/scripts/amplitude-min.js +1 -1
  49. package/lib/scripts/amplitude-min.js.gz +0 -0
  50. package/lib/scripts/amplitude-min.js.map +1 -1
  51. package/lib/scripts/amplitude-min.umd.js +1 -1
  52. package/lib/scripts/amplitude-min.umd.js.gz +0 -0
  53. package/lib/scripts/constants.d.ts +34 -0
  54. package/lib/scripts/constants.d.ts.map +1 -1
  55. package/lib/scripts/index.d.ts +9 -1
  56. package/lib/scripts/index.d.ts.map +1 -1
  57. package/lib/scripts/utils.d.ts +4 -0
  58. package/lib/scripts/utils.d.ts.map +1 -0
  59. package/lib/scripts/version.d.ts +1 -1
  60. package/lib/scripts/version.d.ts.map +1 -1
  61. package/lib/scripts/web-vitals-plugin.d.ts.map +1 -1
  62. package/lib/scripts/web-vitals-soft-nav-plugin.d.ts +4 -0
  63. package/lib/scripts/web-vitals-soft-nav-plugin.d.ts.map +1 -0
  64. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"amplitude-min.js","sources":["../../../../node_modules/.pnpm/@rollup+plugin-typescript@10.0.1_rollup@2.80.0_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js","../../../analytics-core/src/global-scope.ts","../../../analytics-core/src/utils/url-utils.ts","../../../../node_modules/.pnpm/web-vitals@5.1.0/node_modules/web-vitals/dist/web-vitals.js","../../../src/web-vitals-plugin.ts","../../../src/constants.ts","../../../src/version.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/* eslint-disable no-restricted-globals */\n/* Only file allowed to access to globalThis, window, self */\n\nexport const getGlobalScope = (): typeof globalThis | undefined => {\n // This should only be used for integrations with Amplitude that are not running in a browser environment\n // We need to specify the name of the global variable as a string to prevent it from being minified\n const ampIntegrationContextName = 'ampIntegrationContext' as keyof typeof globalThis;\n if (typeof globalThis !== 'undefined' && typeof globalThis[ampIntegrationContextName] !== 'undefined') {\n return globalThis[ampIntegrationContextName] as typeof globalThis;\n }\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n};\n","import { ILogger } from '../logger';\n\n/**\n * Checks if a given URL matches any pattern in an allowlist of URLs or regex patterns.\n * @param url - The URL to check\n * @param allowlist - Array of allowed URLs (strings) or regex patterns\n * @returns true if the URL matches any pattern in the allowlist, false otherwise\n */\nexport const isUrlMatchAllowlist = (url: string, allowlist: (string | RegExp)[] | undefined): boolean => {\n if (!allowlist || !allowlist.length) {\n return true;\n }\n return allowlist.some((allowedUrl) => {\n if (typeof allowedUrl === 'string') {\n return url === allowedUrl;\n }\n return url.match(allowedUrl);\n });\n};\n\nexport const getDecodeURI = (locationStr: string, loggerProvider?: ILogger): string => {\n let decodedLocationStr = locationStr;\n try {\n decodedLocationStr = decodeURI(locationStr);\n } catch (e) {\n /* istanbul ignore next */\n loggerProvider?.error('Malformed URI sequence: ', e);\n }\n\n return decodedLocationStr;\n};\n","let e=-1;const t=t=>{addEventListener(\"pageshow\",(n=>{n.persisted&&(e=n.timeStamp,t(n))}),!0)},n=(e,t,n,i)=>{let s,o;return r=>{t.value>=0&&(r||i)&&(o=t.value-(s??0),(o||void 0===s)&&(s=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?\"poor\":e>t[0]?\"needs-improvement\":\"good\")(t.value,n),e(t)))}},i=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},s=()=>{const e=performance.getEntriesByType(\"navigation\")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},o=()=>{const e=s();return e?.activationStart??0},r=(t,n=-1)=>{const i=s();let r=\"navigate\";e>=0?r=\"back-forward-cache\":i&&(document.prerendering||o()>0?r=\"prerender\":document.wasDiscarded?r=\"restore\":i.type&&(r=i.type.replace(/_/g,\"-\")));return{name:t,value:n,rating:\"good\",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},c=new WeakMap;function a(e,t){return c.get(e)||c.set(e,new t),c.get(e)}class d{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const h=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return i.observe({type:e,buffered:!0,...n}),i}}catch{}},f=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let u=-1;const l=new Set,m=()=>\"hidden\"!==document.visibilityState||document.prerendering?1/0:0,p=e=>{if(\"hidden\"===document.visibilityState){if(\"visibilitychange\"===e.type)for(const e of l)e();isFinite(u)||(u=\"visibilitychange\"===e.type?e.timeStamp:0,removeEventListener(\"prerenderingchange\",p,!0))}},v=()=>{if(u<0){const e=o(),n=document.prerendering?void 0:globalThis.performance.getEntriesByType(\"visibility-state\").filter((t=>\"hidden\"===t.name&&t.startTime>e))[0]?.startTime;u=n??m(),addEventListener(\"visibilitychange\",p,!0),addEventListener(\"prerenderingchange\",p,!0),t((()=>{setTimeout((()=>{u=m()}))}))}return{get firstHiddenTime(){return u},onHidden(e){l.add(e)}}},g=e=>{document.prerendering?addEventListener(\"prerenderingchange\",(()=>e()),!0):e()},y=[1800,3e3],E=(e,s={})=>{g((()=>{const c=v();let a,d=r(\"FCP\");const f=h(\"paint\",(e=>{for(const t of e)\"first-contentful-paint\"===t.name&&(f.disconnect(),t.startTime<c.firstHiddenTime&&(d.value=Math.max(t.startTime-o(),0),d.entries.push(t),a(!0)))}));f&&(a=n(e,d,y,s.reportAllChanges),t((t=>{d=r(\"FCP\"),a=n(e,d,y,s.reportAllChanges),i((()=>{d.value=performance.now()-t.timeStamp,a(!0)}))})))}))},b=[.1,.25],L=(e,s={})=>{const o=v();E(f((()=>{let c,f=r(\"CLS\",0);const u=a(s,d),l=e=>{for(const t of e)u.h(t);u.i>f.value&&(f.value=u.i,f.entries=u.o,c())},m=h(\"layout-shift\",l);m&&(c=n(e,f,b,s.reportAllChanges),o.onHidden((()=>{l(m.takeRecords()),c(!0)})),t((()=>{u.i=0,f=r(\"CLS\",0),c=n(e,f,b,s.reportAllChanges),i((()=>c()))})),setTimeout(c))})))};let P=0,T=1/0,_=0;const M=e=>{for(const t of e)t.interactionId&&(T=Math.min(T,t.interactionId),_=Math.max(_,t.interactionId),P=_?(_-T)/7+1:0)};let w;const C=()=>w?P:performance.interactionCount??0,I=()=>{\"interactionCount\"in performance||w||(w=h(\"event\",M,{type:\"event\",buffered:!0,durationThreshold:0}))};let F=0;class k{u=[];l=new Map;m;p;v(){F=C(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((C()-F)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&\"first-input\"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const A=e=>{const t=globalThis.requestIdleCallback||setTimeout;\"hidden\"===document.visibilityState?e():(e=f(e),addEventListener(\"visibilitychange\",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener(\"visibilitychange\",e,{capture:!0})})))},B=[200,500],S=(e,i={})=>{if(!globalThis.PerformanceEventTiming||!(\"interactionId\"in PerformanceEventTiming.prototype))return;const s=v();g((()=>{I();let o,c=r(\"INP\");const d=a(i,k),f=e=>{A((()=>{for(const t of e)d.h(t);const t=d.L();t&&t.P!==c.value&&(c.value=t.P,c.entries=t.entries,o())}))},u=h(\"event\",f,{durationThreshold:i.durationThreshold??40});o=n(e,c,B,i.reportAllChanges),u&&(u.observe({type:\"first-input\",buffered:!0}),s.onHidden((()=>{f(u.takeRecords()),o(!0)})),t((()=>{d.v(),c=r(\"INP\"),o=n(e,c,B,i.reportAllChanges)})))}))};class N{m;h(e){this.m?.(e)}}const q=[2500,4e3],x=(e,s={})=>{g((()=>{const c=v();let d,u=r(\"LCP\");const l=a(s,N),m=e=>{s.reportAllChanges||(e=e.slice(-1));for(const t of e)l.h(t),t.startTime<c.firstHiddenTime&&(u.value=Math.max(t.startTime-o(),0),u.entries=[t],d())},p=h(\"largest-contentful-paint\",m);if(p){d=n(e,u,q,s.reportAllChanges);const o=f((()=>{m(p.takeRecords()),p.disconnect(),d(!0)})),c=e=>{e.isTrusted&&(A(o),removeEventListener(e.type,c,{capture:!0}))};for(const e of[\"keydown\",\"click\",\"visibilitychange\"])addEventListener(e,c,{capture:!0});t((t=>{u=r(\"LCP\"),d=n(e,u,q,s.reportAllChanges),i((()=>{u.value=performance.now()-t.timeStamp,d(!0)}))}))}}))},H=[800,1800],O=e=>{document.prerendering?g((()=>O(e))):\"complete\"!==document.readyState?addEventListener(\"load\",(()=>O(e)),!0):setTimeout(e)},$=(e,i={})=>{let c=r(\"TTFB\"),a=n(e,c,H,i.reportAllChanges);O((()=>{const d=s();d&&(c.value=Math.max(d.responseStart-o(),0),c.entries=[d],a(!0),t((()=>{c=r(\"TTFB\",0),a=n(e,c,H,i.reportAllChanges),a(!0)})))}))};export{b as CLSThresholds,y as FCPThresholds,B as INPThresholds,q as LCPThresholds,H as TTFBThresholds,L as onCLS,E as onFCP,S as onINP,x as onLCP,$ as onTTFB};\n","/* eslint-disable no-restricted-globals */\nimport {\n BrowserClient,\n BrowserConfig,\n EnrichmentPlugin,\n getGlobalScope,\n getDecodeURI,\n} from '@amplitude/analytics-core';\nimport { PLUGIN_NAME, WEB_VITALS_EVENT_NAME } from './constants';\nimport { onLCP, onINP, onCLS, onFCP, onTTFB, Metric } from 'web-vitals';\n\nexport type BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;\n\ntype WebVitalsMetricPayload = {\n value: number;\n rating: Metric['rating'];\n delta: number;\n navigationType: Metric['navigationType'];\n id: string;\n timestamp: number;\n navigationStart: number;\n};\n\ntype WebVitalsEventPayload = {\n '[Amplitude] LCP'?: WebVitalsMetricPayload;\n '[Amplitude] FCP'?: WebVitalsMetricPayload;\n '[Amplitude] INP'?: WebVitalsMetricPayload;\n '[Amplitude] CLS'?: WebVitalsMetricPayload;\n '[Amplitude] TTFB'?: WebVitalsMetricPayload;\n '[Amplitude] Page Domain'?: string;\n '[Amplitude] Page Location'?: string;\n '[Amplitude] Page Path'?: string;\n '[Amplitude] Page Title'?: string;\n '[Amplitude] Page URL'?: string;\n};\n\nfunction getMetricStartTime(metric: Metric) {\n /* istanbul ignore next */\n const startTime = metric.entries[0]?.startTime || 0;\n return performance.timeOrigin + startTime;\n}\n\nfunction processMetric(metric: Metric) {\n return {\n value: metric.value,\n rating: metric.rating,\n delta: metric.delta,\n navigationType: metric.navigationType,\n id: metric.id,\n timestamp: Math.floor(getMetricStartTime(metric)),\n navigationStart: Math.floor(performance.timeOrigin),\n };\n}\n\nexport const webVitalsPlugin = (): BrowserEnrichmentPlugin => {\n let visibilityListener: ((this: Document, ev: Event) => void) | null = null;\n const globalScope = getGlobalScope();\n const doc = globalScope?.document;\n const location = globalScope?.location;\n const setup: BrowserEnrichmentPlugin['setup'] = async (config, amplitude) => {\n if (doc === undefined) {\n return;\n }\n const locationHref = getDecodeURI(/* istanbul ignore next */ location?.href || '', config.loggerProvider);\n const webVitalsPayload: WebVitalsEventPayload = {\n '[Amplitude] Page Domain': /* istanbul ignore next */ location?.hostname || '',\n '[Amplitude] Page Location': locationHref,\n '[Amplitude] Page Path': getDecodeURI(/* istanbul ignore next */ location?.pathname || '', config.loggerProvider),\n '[Amplitude] Page Title': /* istanbul ignore next */ (typeof document !== 'undefined' && document.title) || '',\n '[Amplitude] Page URL': getDecodeURI(locationHref.split('?')[0], config.loggerProvider),\n };\n\n onLCP((metric) => {\n webVitalsPayload['[Amplitude] LCP'] = processMetric(metric);\n });\n\n onFCP((metric) => {\n webVitalsPayload['[Amplitude] FCP'] = processMetric(metric);\n });\n\n onINP((metric) => {\n webVitalsPayload['[Amplitude] INP'] = processMetric(metric);\n });\n\n onCLS((metric) => {\n webVitalsPayload['[Amplitude] CLS'] = processMetric(metric);\n });\n\n onTTFB((metric) => {\n webVitalsPayload['[Amplitude] TTFB'] = processMetric(metric);\n });\n\n visibilityListener = () => {\n if (doc.visibilityState === 'hidden' && visibilityListener) {\n amplitude.track(WEB_VITALS_EVENT_NAME, webVitalsPayload);\n doc.removeEventListener('visibilitychange', visibilityListener);\n visibilityListener = null;\n }\n };\n doc.addEventListener('visibilitychange', visibilityListener);\n };\n\n const execute: BrowserEnrichmentPlugin['execute'] = async (event) => {\n return event;\n };\n\n const teardown = async () => {\n if (visibilityListener) {\n /* istanbul ignore next */\n doc?.removeEventListener('visibilitychange', visibilityListener);\n }\n };\n\n return {\n name: PLUGIN_NAME,\n type: 'enrichment',\n setup,\n execute,\n teardown,\n };\n};\n","export const PLUGIN_NAME = 'web-vitals-browser';\nexport const WEB_VITALS_EVENT_NAME = '[Amplitude] Web Vitals';\n","export const VERSION = '1.1.49-video-analytics-5.0';\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","_","label","sent","trys","ops","g","Object","create","Iterator","prototype","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","SuppressedError","getDecodeURI","locationStr","loggerProvider","decodedLocationStr","decodeURI","error","addEventListener","persisted","timeStamp","i","s","o","r","delta","rating","requestAnimationFrame","performance","getEntriesByType","responseStart","now","activationStart","document","prerendering","wasDiscarded","type","replace","name","entries","id","Date","Math","floor","random","navigationType","c","WeakMap","a","get","set","d","h","hadRecentInput","at","startTime","PerformanceObserver","supportedEntryTypes","includes","getEntries","observe","buffered","u","l","Set","m","visibilityState","p","isFinite","removeEventListener","globalThis","filter","setTimeout","firstHiddenTime","onHidden","add","E","disconnect","max","reportAllChanges","b","T","M","interactionId","min","w","C","interactionCount","F","k","Map","clear","L","entryType","duration","sort","splice","delete","A","requestIdleCallback","once","capture","B","S","PerformanceEventTiming","durationThreshold","takeRecords","N","q","H","O","readyState","getMetricStartTime","metric","_a","timeOrigin","processMetric","timestamp","navigationStart","webVitalsPlugin","ampIntegrationContextName","visibilityListener","globalScope","window","self","global","doc","location","setup","config","amplitude","undefined","locationHref","href","webVitalsPayload","hostname","pathname","title","split","slice","isTrusted","onLCP","onFCP","onINP","onCLS","onTTFB","track","execute","event","teardown"],"mappings":"sDAkHO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,UAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,EAAE,SAAUG,GAAWA,EAAQG,EAAO,IAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUa,MA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AAG,KAAK,MAAM3D,EAAE7B,IAAI6B,IAAIL,EAAEvE,MAAMmE,KAAKoC,IAAI3B,EAAErB,cAAcP,IAAI,GAAGuB,EAAEP,QAAQ,CAACY,GAAGH,GAAE,GAAI5D,EAAG,KAAK0D,EAAEtB,EAAE,OAAO,GAAGwB,EAAE7C,EAAEzB,EAAEoE,EAAE+D,EAAExF,EAAE0D,kBAAkB/B,GAAE,EAAI,GAAI,ICwFlkLiG,CAAO,SAAChC,GACNqB,EAAiB,oBAAsBlB,EAAcH,EACvD,GAEAQ,EAAqB,WACS,WAAxBK,EAAI5D,iBAAgCuD,IACtCS,EAAUgB,MC7FmB,yBD6FUZ,GACvCR,EAAIzD,oBAAoB,mBAAoBoD,GAC5CA,EAAqB,KAEzB,EACAK,EAAI5G,iBAAiB,mBAAoBuG,IAtChC,CAAA,QAwDT0B,QAfkD,SAAOC,GAAK,OAAAtL,OAAA,OAAA,OAAA,EAAA,qCAC9D,MAAA,CAAA,EAAOsL,QAePC,SAZe,WAAA,OAAAvL,OAAA,OAAA,OAAA,EAAA,4CACX2J,IAEFK,SAAAA,EAAKzD,oBAAoB,mBAAoBoD,aAWnD,mBExHuB"}
1
+ {"version":3,"file":"amplitude-min.js","sources":["../../../../node_modules/.pnpm/@rollup+plugin-typescript@10.0.1_rollup@2.80.0_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js","../../../analytics-core/src/global-scope.ts","../../../analytics-core/src/utils/url-utils.ts","../../../src/constants.ts","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/bfcache.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/bindReporter.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/doubleRAF.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/getNavigationEntry.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/getActivationStart.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/getVisibilityWatcher.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/initMetric.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/generateUniqueID.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/initUnique.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/LayoutShiftManager.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/observe.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/softNavs.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/runOnce.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/FCPEntryManager.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/whenActivated.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/onFCP.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/onCLS.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/polyfills/interactionCountPolyfill.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/InteractionManager.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/whenIdleOrHidden.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/onINP.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/lib/LCPEntryManager.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/onLCP.js","../../../../node_modules/.pnpm/web-vitals@6.2.1/node_modules/web-vitals/dist/modules/onTTFB.js","../../../src/utils.ts","../../../src/web-vitals-plugin.ts","../../../src/web-vitals-soft-nav-plugin.ts","../../../src/index.ts","../../../src/version.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/* eslint-disable no-restricted-globals */\n/* Only file allowed to access to globalThis, window, self */\n\nexport const getGlobalScope = (): typeof globalThis | undefined => {\n // This should only be used for integrations with Amplitude that are not running in a browser environment\n // We need to specify the name of the global variable as a string to prevent it from being minified\n const ampIntegrationContextName = 'ampIntegrationContext' as keyof typeof globalThis;\n if (typeof globalThis !== 'undefined' && typeof globalThis[ampIntegrationContextName] !== 'undefined') {\n return globalThis[ampIntegrationContextName] as typeof globalThis;\n }\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n};\n","import { ILogger } from '../logger';\n\n/**\n * Checks if a given URL matches any pattern in an allowlist of URLs or regex patterns.\n * @param url - The URL to check\n * @param allowlist - Array of allowed URLs (strings) or regex patterns\n * @returns true if the URL matches any pattern in the allowlist, false otherwise\n */\nexport const isUrlMatchAllowlist = (url: string, allowlist: (string | RegExp)[] | undefined): boolean => {\n if (!allowlist || !allowlist.length) {\n return true;\n }\n return allowlist.some((allowedUrl) => {\n if (typeof allowedUrl === 'string') {\n return url === allowedUrl;\n }\n return url.match(allowedUrl);\n });\n};\n\nexport const getDecodeURI = (locationStr: string, loggerProvider?: ILogger): string => {\n let decodedLocationStr = locationStr;\n try {\n decodedLocationStr = decodeURI(locationStr);\n } catch (e) {\n /* istanbul ignore next */\n loggerProvider?.error('Malformed URI sequence: ', e);\n }\n\n return decodedLocationStr;\n};\n","export const PLUGIN_NAME = 'web-vitals-browser';\nexport const WEB_VITALS_EVENT_NAME = '[Amplitude] Web Vitals';\nimport type { Metric } from 'web-vitals';\n\n/**\n * How long to wait, after a newer navigation starts reporting metrics, before sending the event for\n * a superseded navigation. Metrics for a navigation can be reported slightly after the next soft\n * navigation begins, so the event is deferred to give those late metrics a chance to land.\n */\nexport const SOFT_NAV_FLUSH_DELAY_MS = 1000;\n\nexport const WebVitalsMetricProperty = {\n LCP: '[Amplitude] LCP',\n FCP: '[Amplitude] FCP',\n INP: '[Amplitude] INP',\n CLS: '[Amplitude] CLS',\n TTFB: '[Amplitude] TTFB',\n} as const;\n\nexport type WebVitalsMetricPropertyType = (typeof WebVitalsMetricProperty)[keyof typeof WebVitalsMetricProperty];\n\nexport type WebVitalsMetricPayload = {\n value: number;\n rating: Metric['rating'];\n delta: number;\n navigationType: Metric['navigationType'];\n id: string;\n timestamp: number;\n navigationStart: number;\n navigationId?: number;\n};\n\nexport type WebVitalsEventPayload = {\n [P in WebVitalsMetricPropertyType]?: WebVitalsMetricPayload;\n} & {\n '[Amplitude] Page Domain'?: string;\n '[Amplitude] Page Location'?: string;\n '[Amplitude] Page Path'?: string;\n '[Amplitude] Page Title'?: string;\n '[Amplitude] Page URL'?: string;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet bfcacheRestoreTime = -1;\nexport const getBFCacheRestoreTime = () => bfcacheRestoreTime;\nexport const onBFCacheRestore = (cb) => {\n addEventListener('pageshow', (event) => {\n if (event.persisted) {\n bfcacheRestoreTime = event.timeStamp;\n cb(event);\n }\n }, true);\n};\n//# sourceMappingURL=bfcache.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst getRating = (value, thresholds) => {\n if (value > thresholds[1]) {\n return 'poor';\n }\n if (value > thresholds[0]) {\n return 'needs-improvement';\n }\n return 'good';\n};\nexport const bindReporter = (callback, metric, thresholds, reportAllChanges) => {\n let prevValue;\n let delta;\n return (forceReport) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue ?? 0);\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n metric.rating = getRating(metric.value, thresholds);\n callback(metric);\n }\n }\n }\n };\n};\n//# sourceMappingURL=bindReporter.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const doubleRAF = (cb) => {\n requestAnimationFrame(() => requestAnimationFrame(() => cb()));\n};\n//# sourceMappingURL=doubleRAF.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNavigationEntry = () => {\n const navigationEntry = performance.getEntriesByType('navigation')[0];\n // Check to ensure the `responseStart` property is present and valid.\n // In some cases a zero value is reported by the browser (for\n // privacy/security reasons), and in other cases (bugs) the value is\n // negative or is larger than the current page time. Ignore these cases:\n // - https://github.com/GoogleChrome/web-vitals/issues/137\n // - https://github.com/GoogleChrome/web-vitals/issues/162\n // - https://github.com/GoogleChrome/web-vitals/issues/275\n if (navigationEntry &&\n navigationEntry.responseStart > 0 &&\n navigationEntry.responseStart < performance.now()) {\n return navigationEntry;\n }\n};\n//# sourceMappingURL=getNavigationEntry.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNavigationEntry } from './getNavigationEntry.js';\nexport const getActivationStart = () => {\n return getNavigationEntry()?.activationStart ?? 0;\n};\n//# sourceMappingURL=getActivationStart.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { onBFCacheRestore } from './bfcache.js';\nimport { getActivationStart } from './getActivationStart.js';\nlet firstHiddenTime = -1;\nconst onHiddenFunctions = new Set();\nconst initHiddenTime = () => {\n // If the document is hidden when this code runs, assume it was always\n // hidden and the page was loaded in the background, with the one exception\n // that visibility state is always 'hidden' during prerendering, so we have\n // to ignore that case until prerendering finishes (see: `prerenderingchange`\n // event logic below).\n return document.visibilityState === 'hidden' && !document.prerendering\n ? 0\n : Infinity;\n};\nconst onVisibilityUpdate = (event) => {\n // Handle changes to hidden state\n if (document.visibilityState === 'hidden') {\n if (event.type === 'visibilitychange') {\n for (const onHiddenFunction of onHiddenFunctions) {\n onHiddenFunction();\n }\n }\n // If the document is 'hidden' and no previous hidden timestamp has been\n // set (so is infinity), update it based on the current event data.\n if (!isFinite(firstHiddenTime)) {\n // If the event is a 'visibilitychange' event, it means the page was\n // visible prior to this change, so the event timestamp is the first\n // hidden time.\n // However, if the event is not a 'visibilitychange' event, then it must\n // be a 'prerenderingchange' event, and the fact that the document is\n // still 'hidden' from the above check means the tab was activated\n // in a background state and so has always been hidden.\n firstHiddenTime = event.type === 'visibilitychange' ? event.timeStamp : 0;\n // We no longer need the `prerenderingchange` event listener now we've\n // set an initial init time so remove that\n // (we'll keep the visibilitychange one for onHiddenFunction above)\n removeEventListener('prerenderingchange', onVisibilityUpdate, true);\n }\n }\n};\nexport const getVisibilityWatcher = (reset = false) => {\n if (reset) {\n firstHiddenTime = Infinity;\n }\n if (firstHiddenTime < 0) {\n // Check if we have a previous hidden `visibility-state` performance entry.\n const activationStart = getActivationStart();\n /* eslint-disable indent */\n const firstVisibilityStateHiddenTime = !document.prerendering\n ? globalThis.performance\n .getEntriesByType('visibility-state')\n .find((e) => e.name === 'hidden' && e.startTime >= activationStart)\n ?.startTime\n : undefined;\n /* eslint-enable indent */\n // Prefer that, but if it's not available and the document is hidden when\n // this code runs, assume it was hidden since navigation start. This isn't\n // a perfect heuristic, but it's the best we can do until the\n // `visibility-state` performance entry becomes available in all browsers.\n firstHiddenTime = firstVisibilityStateHiddenTime ?? initHiddenTime();\n // Listen for visibility changes so we can handle things like bfcache\n // restores and/or prerender without having to examine individual\n // timestamps in detail and also for onHidden function calls.\n addEventListener('visibilitychange', onVisibilityUpdate, true);\n // IMPORTANT: when a page is prerendering, its `visibilityState` is\n // 'hidden', so in order to account for cases where this module checks for\n // visibility during prerendering, an additional check after prerendering\n // completes is also required.\n addEventListener('prerenderingchange', onVisibilityUpdate, true);\n // Reset the time on bfcache restores.\n onBFCacheRestore(() => {\n // Schedule a task in order to track the `visibilityState` once it's\n // had an opportunity to change to visible in all browsers.\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1133363\n setTimeout(() => {\n firstHiddenTime = initHiddenTime();\n });\n });\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n onHidden(cb) {\n onHiddenFunctions.add(cb);\n },\n };\n};\n//# sourceMappingURL=getVisibilityWatcher.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getBFCacheRestoreTime } from './bfcache.js';\nimport { generateUniqueID } from './generateUniqueID.js';\nimport { getActivationStart } from './getActivationStart.js';\nimport { getNavigationEntry } from './getNavigationEntry.js';\nexport const initMetric = (name, value = -1, navigationType, navigationId = 0, navigationInteractionId, navigationURL, navigationStartTime) => {\n const hardNavEntry = getNavigationEntry();\n const hardNavId = hardNavEntry?.navigationId || 0;\n let _navigationType = 'navigate';\n if (navigationType) {\n // If it was passed in, then use that\n _navigationType = navigationType;\n }\n else if (getBFCacheRestoreTime() >= 0) {\n _navigationType = 'back-forward-cache';\n }\n else if (hardNavEntry) {\n if (document.prerendering || getActivationStart() > 0) {\n _navigationType = 'prerender';\n }\n else if (document.wasDiscarded) {\n _navigationType = 'restore';\n }\n else if (hardNavEntry.type) {\n _navigationType = hardNavEntry.type.replace(/_/g, '-');\n }\n }\n // Use `entries` type specific for the metric.\n const entries = [];\n return {\n name,\n value,\n rating: 'good', // If needed, will be updated when reported. `const` to keep the type from widening to `string`.\n delta: 0,\n entries,\n id: generateUniqueID(),\n navigationType: _navigationType,\n navigationId: navigationId || hardNavId,\n navigationInteractionId: navigationInteractionId,\n navigationURL: navigationURL || hardNavEntry?.name,\n navigationStartTime: navigationStartTime || 0,\n };\n};\n//# sourceMappingURL=initMetric.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = () => {\n return `v6-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n//# sourceMappingURL=generateUniqueID.js.map","/*\n * Copyright 2024 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst instanceMap = new WeakMap();\n/**\n * A function that accepts and identity object and a class object and returns\n * either a new instance of that class or an existing instance, if the\n * identity object was previously used.\n */\nexport function initUnique(identityObj, ClassObj) {\n let classInstances = instanceMap.get(ClassObj);\n if (!classInstances) {\n classInstances = new WeakMap();\n instanceMap.set(ClassObj, classInstances);\n }\n if (!classInstances.get(identityObj)) {\n classInstances.set(identityObj, new ClassObj());\n }\n return classInstances.get(identityObj);\n}\n//# sourceMappingURL=initUnique.js.map","/*\n * Copyright 2024 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class LayoutShiftManager {\n _onAfterProcessingUnexpectedShift;\n _sessionValue = 0;\n _sessionEntries = [];\n _processEntry(entry) {\n // Only count layout shifts without recent user input.\n if (entry.hadRecentInput)\n return;\n const firstSessionEntry = this._sessionEntries[0];\n const lastSessionEntry = this._sessionEntries.at(-1);\n // If the entry occurred less than 1 second after the previous entry\n // and less than 5 seconds after the first entry in the session,\n // include the entry in the current session. Otherwise, start a new\n // session.\n if (this._sessionValue &&\n firstSessionEntry &&\n lastSessionEntry &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000) {\n this._sessionValue += entry.value;\n this._sessionEntries.push(entry);\n }\n else {\n this._sessionValue = entry.value;\n this._sessionEntries = [entry];\n }\n this._onAfterProcessingUnexpectedShift?.(entry);\n }\n}\n//# sourceMappingURL=LayoutShiftManager.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = (types, callback, opts = {}) => {\n try {\n const supportedTypes = types.filter((t) => PerformanceObserver.supportedEntryTypes.includes(t));\n if (supportedTypes.length > 0) {\n const po = new PerformanceObserver((list) => {\n // Delay by a microtask to workaround a bug in Safari where the\n // callback is invoked immediately, rather than in a separate task.\n // See: https://github.com/GoogleChrome/web-vitals/issues/277\n queueMicrotask(() => {\n const entries = list.getEntries();\n // When observing more than one entry type, entries from different\n // types can be delivered out of order, so sort by end time\n // (startTime + duration) to ensure they're in the right order.\n // See: https://github.com/w3c/performance-timeline/issues/224\n if (supportedTypes.length > 1) {\n entries.sort((a, b) => {\n const scoreA = a.startTime + a.duration;\n const scoreB = b.startTime + b.duration;\n return scoreA - scoreB;\n });\n }\n callback(entries);\n });\n });\n for (const t of supportedTypes) {\n po.observe({ type: t, buffered: true, ...opts });\n }\n return po;\n }\n }\n catch {\n // Do nothing.\n }\n return;\n};\n//# sourceMappingURL=observe.js.map","/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const checkSoftNavsEnabled = (opts) => {\n return (\n // Firefox has a preference to disable this, which some people use so add a guard\n globalThis.PerformanceObserver?.supportedEntryTypes?.includes('soft-navigation') &&\n // Older implementations expose the value as an attribute rather than the\n // method. We only support the newer method as that was what was launched\n // to stable unflagged.\n typeof globalThis.PerformanceSoftNavigation?.prototype\n ?.getLargestInteractionContentfulPaint === 'function' &&\n opts &&\n opts.reportSoftNavs);\n};\n// Stores a soft navigation entry keyed by its navigationId, keeping only\n// the 2 most recent entries so the map cannot grow unbounded.\nexport const storeSoftNavEntry = (map, entry) => {\n map.set(entry.navigationId, entry);\n // Clean up older entries to prevent memory leaks, keeping only\n // the 2 most recent entries.\n if (map.size > 2) {\n const firstKey = map.keys().next().value;\n if (firstKey !== undefined) {\n map.delete(firstKey);\n }\n }\n};\n//# sourceMappingURL=softNavs.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const runOnce = (cb) => {\n let called = false;\n return () => {\n if (!called) {\n cb();\n called = true;\n }\n };\n};\n//# sourceMappingURL=runOnce.js.map","/*\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FCPEntryManager {\n _softNavigationEntryMap;\n}\n//# sourceMappingURL=FCPEntryManager.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const whenActivated = (callback) => {\n if (document.prerendering) {\n addEventListener('prerenderingchange', callback, true);\n }\n else {\n callback();\n }\n};\n//# sourceMappingURL=whenActivated.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { bindReporter } from './lib/bindReporter.js';\nimport { checkSoftNavsEnabled, storeSoftNavEntry } from './lib/softNavs.js';\nimport { doubleRAF } from './lib/doubleRAF.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { initUnique } from './lib/initUnique.js';\nimport { FCPEntryManager } from './lib/FCPEntryManager.js';\nimport { observe } from './lib/observe.js';\nimport { getBFCacheRestoreTime, onBFCacheRestore } from './lib/bfcache.js';\nimport { whenActivated } from './lib/whenActivated.js';\n/** Thresholds for FCP. See https://web.dev/articles/fcp#what_is_a_good_fcp_score */\nexport const FCPThresholds = [1800, 3000];\n/**\n * Calculates the [FCP](https://web.dev/articles/fcp) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `paint` performance entry used to determine the value. The reported\n * value is a `DOMHighResTimeStamp`.\n */\nexport const onFCP = (onReport, opts = {}) => {\n const softNavsEnabled = checkSoftNavsEnabled(opts);\n whenActivated(() => {\n // Create a new FCP entry manager for each page activation\n // This allows us to track soft navigations separately\n // needed when attribution is enabled.\n const fcpEntryManager = initUnique(opts, FCPEntryManager);\n const visibilityWatcher = getVisibilityWatcher();\n let metric = initMetric('FCP');\n let report;\n const handleEntries = (entries) => {\n for (const entry of entries) {\n if (entry.name === 'first-contentful-paint') {\n po.disconnect();\n // Only report if the page wasn't hidden prior to FCP.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n // The activationStart reference is used because FCP should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the FCP, this time should be clamped at 0.\n metric.value = Math.max(entry.startTime - getActivationStart(), 0);\n metric.entries.push(entry);\n metric.navigationId = entry.navigationId || metric.navigationId;\n // FCP should only be reported once so can report right away\n report(true);\n }\n }\n }\n };\n const po = observe(['paint'], handleEntries);\n if (po) {\n report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);\n // Only report after a bfcache restore if the `PerformanceObserver`\n // successfully registered or the `paint` entry exists.\n onBFCacheRestore((event) => {\n metric = initMetric('FCP', -1, 'back-forward-cache', metric.navigationId, metric.navigationInteractionId, metric.navigationURL, getBFCacheRestoreTime());\n report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);\n doubleRAF(() => {\n metric.value = performance.now() - event.timeStamp;\n report(true);\n });\n });\n }\n if (softNavsEnabled) {\n // As first-contentful-paint is only reported once, we can handle soft\n // navigations afterwards on their own for simplicity, as no need to\n // observe both and sort the entries like for the other metrics\n const handleSoftNavEntries = (entries) => {\n entries.forEach((entry) => {\n // Store the soft navigation entries in the entry manager so that\n // they can be retrieved for attribution if necessary. This code\n // is only used when attribution is enabled which sets the\n // _softNavigationEntryMap.\n if (fcpEntryManager._softNavigationEntryMap && entry.navigationId) {\n storeSoftNavEntry(fcpEntryManager._softNavigationEntryMap, entry);\n }\n // Clamp FCP at 0. It should never be less, but better safe than sorry.\n const FCPTime = Math.max((entry.presentationTime || entry.paintTime || 0) - entry.startTime, 0);\n metric = initMetric('FCP', FCPTime, 'soft-navigation', entry.navigationId, entry.interactionId, entry.name, entry.startTime);\n report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);\n report(true);\n });\n };\n observe(['soft-navigation'], handleSoftNavEntries, opts);\n }\n });\n};\n//# sourceMappingURL=onFCP.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getBFCacheRestoreTime, onBFCacheRestore } from './lib/bfcache.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { doubleRAF } from './lib/doubleRAF.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { initUnique } from './lib/initUnique.js';\nimport { LayoutShiftManager } from './lib/LayoutShiftManager.js';\nimport { observe } from './lib/observe.js';\nimport { checkSoftNavsEnabled } from './lib/softNavs.js';\nimport { runOnce } from './lib/runOnce.js';\nimport { onFCP } from './onFCP.js';\n/** Thresholds for CLS. See https://web.dev/articles/cls#what_is_a_good_cls_score */\nexport const CLSThresholds = [0.1, 0.25];\n/**\n * Calculates the [CLS](https://web.dev/articles/cls) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/articles/cls#layout_shift_score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (onReport, opts = {}) => {\n const visibilityWatcher = getVisibilityWatcher();\n // Start monitoring FCP so we can only report CLS if FCP is also reported.\n // Note: this is done to match the current behavior of CrUX.\n onFCP(runOnce(() => {\n let metric = initMetric('CLS', 0);\n let report;\n const layoutShiftManager = initUnique(opts, LayoutShiftManager);\n const initNewCLSMetric = (navigationType, navigationId, navigationInteractionId, navigationURL, navigationStartTime) => {\n metric = initMetric('CLS', 0, navigationType, navigationId, navigationInteractionId, navigationURL, navigationStartTime);\n layoutShiftManager._sessionValue = 0;\n report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);\n };\n const updateAndReportMetric = (forceReport = false) => {\n // If the current session value is larger than the current CLS value,\n // update CLS and the entries contributing to it.\n if (layoutShiftManager._sessionValue > metric.value) {\n metric.value = layoutShiftManager._sessionValue;\n metric.entries = layoutShiftManager._sessionEntries;\n }\n report(forceReport);\n };\n const handleSoftNavEntry = (entry) => {\n updateAndReportMetric(true);\n initNewCLSMetric('soft-navigation', entry.navigationId, entry.interactionId, entry.name, entry.startTime);\n };\n const handleEntries = (entries) => {\n for (const entry of entries) {\n if (entry.entryType === 'soft-navigation') {\n handleSoftNavEntry(entry);\n continue;\n }\n layoutShiftManager._processEntry(entry);\n }\n updateAndReportMetric();\n };\n const types = ['layout-shift'];\n if (checkSoftNavsEnabled(opts)) {\n types.push('soft-navigation');\n }\n const po = observe(types, handleEntries);\n if (po) {\n report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);\n visibilityWatcher.onHidden(() => {\n handleEntries(po.takeRecords());\n report(true);\n });\n // Only report after a bfcache restore if the `PerformanceObserver`\n // successfully registered.\n onBFCacheRestore(() => {\n initNewCLSMetric('back-forward-cache', metric.navigationId, metric.navigationInteractionId, metric.navigationURL, getBFCacheRestoreTime());\n doubleRAF(report);\n });\n // Queue a task to report (if nothing else triggers a report first).\n // This allows CLS to be reported as soon as FCP fires when\n // `reportAllChanges` is true.\n setTimeout(report);\n }\n }));\n};\n//# sourceMappingURL=onCLS.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { observe } from '../observe.js';\nlet interactionCountEstimate = 0;\nlet minKnownInteractionId = Infinity;\nlet maxKnownInteractionId = 0;\nconst updateEstimate = (entries) => {\n for (const entry of entries) {\n if (entry.interactionId) {\n minKnownInteractionId = Math.min(minKnownInteractionId, entry.interactionId);\n maxKnownInteractionId = Math.max(maxKnownInteractionId, entry.interactionId);\n interactionCountEstimate = maxKnownInteractionId\n ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1\n : 0;\n }\n }\n};\nlet po;\n/**\n * Returns the `interactionCount` value using the native API (if available)\n * or the polyfill estimate in this module.\n */\nexport const getInteractionCount = () => {\n return po ? interactionCountEstimate : (performance.interactionCount ?? 0);\n};\n/**\n * Feature detects native support or initializes the polyfill if needed.\n */\nexport const initInteractionCountPolyfill = () => {\n if ('interactionCount' in performance || po)\n return;\n po = observe(['event'], updateEstimate, {\n durationThreshold: 0,\n });\n};\n//# sourceMappingURL=interactionCountPolyfill.js.map","/*\n * Copyright 2024 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getInteractionCount } from './polyfills/interactionCountPolyfill.js';\n// To prevent unnecessary memory usage on pages with lots of interactions,\n// store at most 10 of the longest interactions to consider as INP candidates.\nconst MAX_INTERACTIONS_TO_CONSIDER = 10;\nexport class InteractionManager {\n /**\n * The interaction count at the start of the current navigation, so p98\n * interaction latencies only consider interactions since then.\n *\n * This is per-instance rather than module state: `initUnique()` gives every\n * `onINP()` call its own manager, and a shared counter would let whichever\n * instance resets first hide the interactions from all the others.\n */\n _prevInteractionCount = 0;\n /**\n * A list of longest interactions on the page (by latency) sorted so the\n * longest one is first. The list is at most MAX_INTERACTIONS_TO_CONSIDER\n * long.\n */\n _longestInteractionList = [];\n /**\n * A mapping of longest interactions by their interaction ID.\n * This is used for faster lookup.\n */\n _longestInteractionMap = new Map();\n _onBeforeProcessingEntry;\n _onAfterProcessingINPCandidate;\n /**\n * Returns the interaction count since the start of the current navigation\n * (or the full page lifecycle if there were no soft navs / bfcache restores).\n */\n _getInteractionCountForNavigation() {\n return getInteractionCount() - this._prevInteractionCount;\n }\n _resetInteractions() {\n this._prevInteractionCount = getInteractionCount();\n this._longestInteractionList.length = 0;\n this._longestInteractionMap.clear();\n }\n /**\n * Returns the estimated p98 longest interaction based on the stored\n * interaction candidates and the interaction count for the current page.\n */\n _estimateP98LongestInteraction(navigationType) {\n const interactionCountForNavigation = this._getInteractionCountForNavigation();\n const candidateInteractionIndex = Math.min(this._longestInteractionList.length - 1, Math.floor(interactionCountForNavigation / 50));\n // If we have a non-zero interactionCountForNavigation but no\n // candidateInteractionIndex, then it's below the 16ms limit\n // so report a dummy 8ms interaction. This is only needed for\n // soft-navs and bfcache restores as `first-input` handles the\n // rest.\n if (interactionCountForNavigation &&\n candidateInteractionIndex === -1 &&\n (navigationType === 'soft-navigation' ||\n navigationType === 'back-forward-cache')) {\n return {\n _latency: 8,\n id: -1,\n entries: [],\n };\n }\n return this._longestInteractionList[candidateInteractionIndex];\n }\n /**\n * Takes a performance entry and adds it to the list of worst interactions\n * if its duration is long enough to make it among the worst. If the\n * entry is part of an existing interaction, it is merged and the latency\n * and entries list is updated as needed.\n */\n _processEntry(entry) {\n this._onBeforeProcessingEntry?.(entry);\n // Skip further processing for entries that cannot be INP candidates.\n if (!entry.interactionId)\n return;\n // The least-long of the 10 longest interactions.\n const minLongestInteraction = this._longestInteractionList.at(-1);\n let interaction = this._longestInteractionMap.get(entry.interactionId);\n // Only process the entry if it's possibly one of the ten longest,\n // or if it's part of an existing interaction.\n if (interaction ||\n this._longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||\n // If the above conditions are false, `minLongestInteraction` will be set.\n entry.duration > minLongestInteraction._latency) {\n // If the interaction already exists, update it. Otherwise create one.\n if (interaction) {\n // If the new entry has a longer duration, replace the old entries,\n // otherwise add to the array.\n if (entry.duration > interaction._latency) {\n interaction.entries = [entry];\n interaction._latency = entry.duration;\n }\n else if (entry.duration === interaction._latency &&\n entry.startTime === interaction.entries[0].startTime) {\n interaction.entries.push(entry);\n }\n }\n else {\n interaction = {\n id: entry.interactionId,\n entries: [entry],\n _latency: entry.duration,\n };\n this._longestInteractionMap.set(interaction.id, interaction);\n this._longestInteractionList.push(interaction);\n }\n // Sort the entries by latency (descending) and keep only the top ten.\n this._longestInteractionList.sort((a, b) => b._latency - a._latency);\n if (this._longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) {\n const removedInteractions = this._longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER);\n for (const interaction of removedInteractions) {\n this._longestInteractionMap.delete(interaction.id);\n }\n }\n // Call any post-processing on the interaction\n this._onAfterProcessingINPCandidate?.(interaction);\n }\n }\n}\n//# sourceMappingURL=InteractionManager.js.map","/*\n * Copyright 2024 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { runOnce } from './runOnce.js';\n/**\n * Runs the passed callback during the next idle period, or immediately\n * if the browser's visibility state is (or becomes) hidden.\n */\nexport const whenIdleOrHidden = (cb) => {\n // Cap the requestIdleCallback to 1 sec for very busy apps\n // https://github.com/GoogleChrome/web-vitals/issues/754\n // If not using rIC, then the setTimeout timeout should be 0\n const timeout = 'requestIdleCallback' in globalThis ? 1000 : 0;\n const rIC = globalThis.requestIdleCallback || setTimeout;\n const cIC = globalThis.cancelIdleCallback || clearTimeout;\n // If the document is hidden, run the callback immediately, otherwise\n // race an idle callback with the next `visibilitychange` event.\n if (document.visibilityState === 'hidden') {\n cb();\n }\n else {\n const wrappedCb = runOnce(cb);\n let idleHandle = -1;\n const onHidden = () => {\n cIC(idleHandle);\n wrappedCb();\n };\n addEventListener('visibilitychange', onHidden, { once: true, capture: true });\n idleHandle = rIC(() => {\n removeEventListener('visibilitychange', onHidden, { capture: true });\n wrappedCb();\n }, { timeout: timeout });\n }\n};\n//# sourceMappingURL=whenIdleOrHidden.js.map","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getBFCacheRestoreTime, onBFCacheRestore } from './lib/bfcache.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { initUnique } from './lib/initUnique.js';\nimport { InteractionManager } from './lib/InteractionManager.js';\nimport { observe } from './lib/observe.js';\nimport { checkSoftNavsEnabled } from './lib/softNavs.js';\nimport { initInteractionCountPolyfill } from './lib/polyfills/interactionCountPolyfill.js';\nimport { whenActivated } from './lib/whenActivated.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { whenIdleOrHidden } from './lib/whenIdleOrHidden.js';\n/** Thresholds for INP. See https://web.dev/articles/inp#what_is_a_good_inp_score */\nexport const INPThresholds = [200, 500];\n// The default `durationThreshold` used across this library for observing\n// `event` entries via PerformanceObserver.\n// Event Timing entries have their durations rounded to the nearest 8ms,\n// so a duration of 40ms would be any event that spans 2.5 or more frames\n// at 60Hz. This threshold is chosen to strike a balance between usefulness\n// and performance. Running this callback for any interaction that spans\n// just one or two frames is likely not worth the insight that could be\n// gained.\nconst DEFAULT_DURATION_THRESHOLD = 40;\n/**\n * Calculates the [INP](https://web.dev/articles/inp) value for the current\n * page and calls the `callback` function once the value is ready, along with\n * the `event` performance entries reported for that interaction. The reported\n * value is a `DOMHighResTimeStamp`.\n *\n * A custom `durationThreshold` configuration option can optionally be passed\n * to control what `event-timing` entries are considered for INP reporting. The\n * default threshold is `40`, which means INP scores of less than 40 will not\n * be reported. To avoid reporting no interactions in these cases, the library\n * will fall back to the input delay of the first interaction. Note that this\n * will not affect your 75th percentile INP value unless that value is also\n * less than 40 (well below the recommended\n * [good](https://web.dev/articles/inp#what_is_a_good_inp_score) threshold).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** INP should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onINP = (onReport, opts = {}) => {\n // Return if the browser doesn't support all APIs needed to measure INP.\n if (!(globalThis.PerformanceEventTiming &&\n 'interactionId' in PerformanceEventTiming.prototype)) {\n return;\n }\n const visibilityWatcher = getVisibilityWatcher();\n whenActivated(() => {\n // TODO(philipwalton): remove once the polyfill is no longer needed.\n initInteractionCountPolyfill();\n let metric = initMetric('INP');\n let report;\n const interactionManager = initUnique(opts, InteractionManager);\n const initNewINPMetric = (navigationType, navigationId, navigationInteractionId, navigationURL, navigationStartTime) => {\n interactionManager._resetInteractions();\n metric = initMetric('INP', -1, navigationType, navigationId, navigationInteractionId, navigationURL, navigationStartTime);\n report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);\n };\n const updateINPMetric = () => {\n const inp = interactionManager._estimateP98LongestInteraction(metric.navigationType);\n if (inp && inp._latency !== metric.value) {\n metric.value = inp._latency;\n metric.entries = inp.entries;\n report();\n }\n };\n const handleSoftNavEntry = (entry) => {\n updateINPMetric();\n report(true);\n initNewINPMetric('soft-navigation', entry.navigationId, entry.interactionId, entry.name, entry.startTime);\n };\n const handleEntries = (entries, forceReport = false) => {\n // Queue the `handleEntries()` callback in the next idle task.\n // This is needed to increase the chances that all event entries that\n // occurred between the user interaction and the next paint\n // have been dispatched. Note: there is currently an experiment\n // running in Chrome (EventTimingKeypressAndCompositionInteractionId)\n // 123+ that if rolled out fully may make this no longer necessary.\n whenIdleOrHidden(() => {\n for (const entry of entries) {\n if (entry.entryType === 'soft-navigation') {\n handleSoftNavEntry(entry);\n continue;\n }\n interactionManager._processEntry(entry);\n }\n updateINPMetric();\n if (forceReport) {\n report(true);\n }\n });\n };\n const types = ['event', 'first-input'];\n if (checkSoftNavsEnabled(opts)) {\n types.push('soft-navigation');\n }\n const po = observe(types, handleEntries, {\n ...opts,\n durationThreshold: opts.durationThreshold ?? DEFAULT_DURATION_THRESHOLD,\n });\n report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);\n if (po) {\n visibilityWatcher.onHidden(() => {\n handleEntries(po.takeRecords(), true);\n });\n // Only report after a bfcache restore if the `PerformanceObserver`\n // successfully registered.\n onBFCacheRestore(() => {\n initNewINPMetric('back-forward-cache', metric.navigationId, metric.navigationInteractionId, metric.navigationURL, getBFCacheRestoreTime());\n });\n }\n });\n};\n//# sourceMappingURL=onINP.js.map","/*\n * Copyright 2024 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class LCPEntryManager {\n _onBeforeProcessingEntry;\n _softNavigationEntryMap;\n _processEntry(entry) {\n this._onBeforeProcessingEntry?.(entry);\n }\n}\n//# sourceMappingURL=LCPEntryManager.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LCPEntryManager } from './lib/LCPEntryManager.js';\nimport { getBFCacheRestoreTime, onBFCacheRestore } from './lib/bfcache.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { doubleRAF } from './lib/doubleRAF.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { checkSoftNavsEnabled, storeSoftNavEntry } from './lib/softNavs.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { initUnique } from './lib/initUnique.js';\nimport { observe } from './lib/observe.js';\nimport { whenActivated } from './lib/whenActivated.js';\nimport { whenIdleOrHidden } from './lib/whenIdleOrHidden.js';\n/** Thresholds for LCP. See https://web.dev/articles/lcp#what_is_a_good_lcp_score */\nexport const LCPThresholds = [2500, 4000];\n/**\n * Calculates the [LCP](https://web.dev/articles/lcp) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called any time a new `largest-contentful-paint`\n * performance entry is dispatched, or once the final value of the metric has\n * been determined.\n */\nexport const onLCP = (onReport, opts = {}) => {\n // As InteractionContentfulPaint entries used by soft navs can emit after\n // LCP is finalized, we need a flag to know to ignore them.\n let isFinalized = false;\n const softNavsEnabled = checkSoftNavsEnabled(opts);\n whenActivated(() => {\n let visibilityWatcher = getVisibilityWatcher();\n let metric = initMetric('LCP');\n let report;\n const lcpEntryManager = initUnique(opts, LCPEntryManager);\n const initNewLCPMetric = (navigation, navigationId, navigationInteractionId, navigationURL, navigationStartTime) => {\n metric = initMetric('LCP', -1, navigation, navigationId, navigationInteractionId, navigationURL, navigationStartTime);\n report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);\n // Reset the finalized flag\n isFinalized = false;\n // If it's a soft nav, then need to reset the visibilityWatcher\n if (navigation === 'soft-navigation') {\n visibilityWatcher = getVisibilityWatcher(true);\n }\n };\n const handleSoftNavEntry = (entry) => {\n if (lcpEntryManager._softNavigationEntryMap && entry.navigationId) {\n storeSoftNavEntry(lcpEntryManager._softNavigationEntryMap, entry);\n }\n if (!isFinalized)\n report(true);\n initNewLCPMetric('soft-navigation', entry.navigationId, entry.interactionId, entry.name, entry.startTime);\n // Soft Navs should contain the largest paint until now, so handle that\n // as if it just happened, then listen for more.\n // It can however be null in rare circumstances\n // (see https://github.com/GoogleChrome/web-vitals/issues/725)\n const largestInteractionContentfulPaint = entry.getLargestInteractionContentfulPaint?.();\n if (largestInteractionContentfulPaint) {\n handleEntries([largestInteractionContentfulPaint]);\n }\n };\n const handleEntries = (entries) => {\n // If reportAllChanges is set or soft navs is enabled then call this\n // function for each entry, otherwise only consider the last one.\n if (!opts.reportAllChanges && !softNavsEnabled) {\n entries = entries.slice(-1);\n }\n for (const entry of entries) {\n if (!entry)\n continue;\n if (entry.entryType === 'soft-navigation') {\n handleSoftNavEntry(entry);\n continue;\n }\n let value = 0;\n let metricEntries = [];\n let renderTime = entry.startTime;\n if (entry.entryType === 'largest-contentful-paint') {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered. But in cases\n // where `activationStart` occurs after the LCP, this time should be\n // clamped at 0.\n value = Math.max(entry.startTime - getActivationStart(), 0);\n lcpEntryManager._processEntry(entry);\n metricEntries = [entry];\n }\n else if (entry.entryType === 'interaction-contentful-paint') {\n const ICPEntry = entry;\n // InteractionContentfulPaints should only happen after a\n // PerformanceSoftNavigation so the metric should have been set\n // with a non-zero navigationId mapping to a soft nav.\n if (!metric.navigationId)\n continue;\n // Ignore interactions not for this soft nav\n // (either paints that have bled into this interaction or paints when\n // we should have already finalized)\n if ('interactionId' in ICPEntry &&\n ICPEntry.interactionId != metric.navigationInteractionId) {\n continue;\n }\n renderTime = ICPEntry.largestContentfulPaint?.renderTime || 0;\n // Paints should never be less than 0 but add cap just in case\n value = Math.max(renderTime - entry.startTime, 0);\n if (ICPEntry.largestContentfulPaint) {\n lcpEntryManager._processEntry(ICPEntry.largestContentfulPaint);\n metricEntries = [ICPEntry.largestContentfulPaint];\n }\n }\n // Only report if the page wasn't hidden prior to LCP.\n if (renderTime < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries = metricEntries;\n report();\n }\n }\n };\n const types = ['largest-contentful-paint'];\n if (softNavsEnabled) {\n types.push('interaction-contentful-paint', 'soft-navigation');\n }\n const po = observe(types, handleEntries);\n if (po) {\n report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);\n const finalizeEventTypes = ['keydown', 'click', 'visibilitychange'];\n const finalizeLCP = (event) => {\n if (event.isTrusted && !isFinalized) {\n // Wrap the listener in an idle callback so it's run in a separate\n // task to reduce potential INP impact.\n // https://github.com/GoogleChrome/web-vitals/issues/383\n const metricIdToFinalize = metric.id;\n whenIdleOrHidden(() => {\n if (!isFinalized) {\n if (!softNavsEnabled) {\n // Do some clean up since these won't be needed anymore.\n po.disconnect();\n for (const type of finalizeEventTypes) {\n removeEventListener(type, finalizeLCP, { capture: true });\n }\n }\n // As this is in a whenIdleOrHidden check, whether we're still\n // on the metric you meant to finalize, and ignore if we've moved\n // on in the meantime.\n if (metricIdToFinalize === metric.id) {\n isFinalized = true;\n report(true);\n }\n }\n });\n }\n };\n // Finalize the current LCP after input or visibilitychange.\n // Although the browser will automatically stop emitting entries in these\n // cases, we don't know it's finalized, so we track to allow early report.\n // Note: while scrolling is an input that stops LCP observation, it's\n // unreliable since it can be programmatically generated.\n // See: https://github.com/GoogleChrome/web-vitals/issues/75\n for (const type of finalizeEventTypes) {\n addEventListener(type, finalizeLCP, {\n capture: true,\n });\n }\n // Only report after a bfcache restore if the `PerformanceObserver`\n // successfully registered.\n onBFCacheRestore((event) => {\n initNewLCPMetric('back-forward-cache', metric.navigationId, metric.navigationInteractionId, metric.navigationURL, getBFCacheRestoreTime());\n report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);\n doubleRAF(() => {\n metric.value = performance.now() - event.timeStamp;\n isFinalized = true;\n report(true);\n });\n });\n }\n });\n};\n//# sourceMappingURL=onLCP.js.map","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { bindReporter } from './lib/bindReporter.js';\nimport { checkSoftNavsEnabled } from './lib/softNavs.js';\nimport { getNavigationEntry } from './lib/getNavigationEntry.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { getBFCacheRestoreTime, onBFCacheRestore } from './lib/bfcache.js';\nimport { whenActivated } from './lib/whenActivated.js';\n/** Thresholds for TTFB. See https://web.dev/articles/ttfb#what_is_a_good_ttfb_score */\nexport const TTFBThresholds = [800, 1800];\n/**\n * Runs in the next task after the page is done loading and/or prerendering.\n * @param callback\n */\nconst whenReady = (callback) => {\n if (document.prerendering) {\n whenActivated(() => whenReady(callback));\n }\n else if (document.readyState !== 'complete') {\n addEventListener('load', () => whenReady(callback), true);\n }\n else {\n // Queue a task so the callback runs after `loadEventEnd`.\n setTimeout(callback);\n }\n};\n/**\n * Calculates the [TTFB](https://web.dev/articles/ttfb) value for the\n * current page and calls the `callback` function once the page has loaded,\n * along with the relevant `navigation` performance entry used to determine the\n * value. The reported value is a `DOMHighResTimeStamp`.\n *\n * Note, this function waits until after the page is loaded to call `callback`\n * in order to ensure all properties of the `navigation` entry are populated.\n * This is useful if you want to report on other metrics exposed by the\n * [Navigation Timing API](https://w3c.github.io/navigation-timing/). For\n * example, the TTFB metric starts from the page's [time\n * origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it\n * includes time spent on DNS lookup, connection negotiation, network latency,\n * and server processing time.\n */\nexport const onTTFB = (onReport, opts = {}) => {\n const softNavsEnabled = checkSoftNavsEnabled(opts);\n let metric = initMetric('TTFB');\n let report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);\n whenReady(() => {\n const hardNavEntry = getNavigationEntry();\n if (hardNavEntry) {\n const responseStart = hardNavEntry.responseStart;\n // The activationStart reference is used because TTFB should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the first byte is received, this time should be clamped at 0.\n metric.value = Math.max(responseStart - getActivationStart(), 0);\n metric.entries = [hardNavEntry];\n report(true);\n // Only report TTFB after bfcache restores if a `navigation` entry\n // was reported for the initial load.\n onBFCacheRestore(() => {\n metric = initMetric('TTFB', 0, 'back-forward-cache', metric.navigationId, metric.navigationInteractionId, metric.navigationURL, getBFCacheRestoreTime());\n report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);\n report(true);\n });\n // Listen for soft-navigation entries and emit a dummy 0 TTFB entry\n if (softNavsEnabled) {\n const reportSoftNavTTFBs = (entries) => {\n entries.forEach((entry) => {\n if (entry.navigationId) {\n metric = initMetric('TTFB', 0, 'soft-navigation', entry.navigationId, entry.interactionId, entry.name, entry.startTime);\n metric.entries = [entry];\n report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);\n report(true);\n }\n });\n };\n observe(['soft-navigation'], reportSoftNavTTFBs, opts);\n }\n }\n });\n};\n//# sourceMappingURL=onTTFB.js.map","import { WebVitalsMetricPayload } from './constants';\nimport { Metric } from 'web-vitals';\n\nfunction getMetricStartTime(metric: Metric) {\n /* istanbul ignore next */\n const startTime = metric.entries[0]?.startTime || 0;\n return performance.timeOrigin + startTime;\n}\n\nexport function processMetric(metric: Metric, isSoftNav = false): WebVitalsMetricPayload {\n const payload: WebVitalsMetricPayload = {\n value: metric.value,\n rating: metric.rating,\n delta: metric.delta,\n navigationType: metric.navigationType,\n id: metric.id,\n timestamp: Math.floor(getMetricStartTime(metric)),\n navigationStart: !isSoftNav\n ? Math.floor(performance.timeOrigin)\n : Math.floor(performance.timeOrigin + /* istanbul ignore next */ (metric.navigationStartTime || 0)),\n };\n\n if (isSoftNav) {\n payload.navigationId = metric.navigationId;\n }\n\n return payload;\n}\n","/* eslint-disable no-restricted-globals */\nimport {\n BrowserClient,\n BrowserConfig,\n EnrichmentPlugin,\n getGlobalScope,\n getDecodeURI,\n} from '@amplitude/analytics-core';\nimport { PLUGIN_NAME, WEB_VITALS_EVENT_NAME, WebVitalsEventPayload } from './constants';\nimport { onLCP, onINP, onCLS, onFCP, onTTFB } from 'web-vitals';\nimport { processMetric } from './utils';\n\nexport type BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;\n\nexport const webVitalsPlugin = (): BrowserEnrichmentPlugin => {\n let visibilityListener: ((this: Document, ev: Event) => void) | null = null;\n const globalScope = getGlobalScope();\n const doc = globalScope?.document;\n const location = globalScope?.location;\n const setup: BrowserEnrichmentPlugin['setup'] = async (config, amplitude) => {\n if (doc === undefined) {\n return;\n }\n const locationHref = getDecodeURI(/* istanbul ignore next */ location?.href || '', config.loggerProvider);\n const webVitalsPayload: WebVitalsEventPayload = {\n '[Amplitude] Page Domain': /* istanbul ignore next */ location?.hostname || '',\n '[Amplitude] Page Location': locationHref,\n '[Amplitude] Page Path': getDecodeURI(/* istanbul ignore next */ location?.pathname || '', config.loggerProvider),\n '[Amplitude] Page Title': /* istanbul ignore next */ (typeof document !== 'undefined' && document.title) || '',\n '[Amplitude] Page URL': getDecodeURI(locationHref.split('?')[0], config.loggerProvider),\n };\n\n onLCP((metric) => {\n webVitalsPayload['[Amplitude] LCP'] = processMetric(metric);\n });\n\n onFCP((metric) => {\n webVitalsPayload['[Amplitude] FCP'] = processMetric(metric);\n });\n\n onINP((metric) => {\n webVitalsPayload['[Amplitude] INP'] = processMetric(metric);\n });\n\n onCLS((metric) => {\n webVitalsPayload['[Amplitude] CLS'] = processMetric(metric);\n });\n\n onTTFB((metric) => {\n webVitalsPayload['[Amplitude] TTFB'] = processMetric(metric);\n });\n\n visibilityListener = () => {\n if (doc.visibilityState === 'hidden' && visibilityListener) {\n amplitude.track(WEB_VITALS_EVENT_NAME, webVitalsPayload);\n doc.removeEventListener('visibilitychange', visibilityListener);\n visibilityListener = null;\n }\n };\n doc.addEventListener('visibilitychange', visibilityListener);\n };\n\n const execute: BrowserEnrichmentPlugin['execute'] = async (event) => {\n return event;\n };\n\n const teardown = async () => {\n if (visibilityListener) {\n /* istanbul ignore next */\n doc?.removeEventListener('visibilitychange', visibilityListener);\n }\n };\n\n return {\n name: PLUGIN_NAME,\n type: 'enrichment',\n setup,\n execute,\n teardown,\n };\n};\n","/* eslint-disable no-restricted-globals */\nimport { onLCP, onINP, onCLS, onFCP, onTTFB, Metric } from 'web-vitals';\nimport {\n BrowserClient,\n BrowserConfig,\n EnrichmentPlugin,\n ILogger,\n getGlobalScope,\n getDecodeURI,\n} from '@amplitude/analytics-core';\nimport {\n PLUGIN_NAME,\n SOFT_NAV_FLUSH_DELAY_MS,\n WEB_VITALS_EVENT_NAME,\n WebVitalsEventPayload,\n WebVitalsMetricProperty,\n WebVitalsMetricPropertyType,\n} from './constants';\nimport { processMetric } from './utils';\n\nexport type BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;\n\nconst METRIC_PROPERTIES = Object.values(WebVitalsMetricProperty);\n\n/**\n * Builds the page properties for the URL the metrics belong to. That is the URL of the navigation\n * being reported on, which is not necessarily the current URL: a navigation's metrics can be\n * reported after the next navigation has already started.\n */\nfunction getPageProperties(url: string, title: string, loggerProvider: ILogger): WebVitalsEventPayload {\n let hostname = '';\n let pathname = '';\n try {\n const parsedUrl = new URL(url);\n hostname = parsedUrl.hostname;\n pathname = parsedUrl.pathname;\n } catch (e) {\n loggerProvider.debug('Web vitals plugin is unable to parse page URL: ', e);\n }\n\n const locationHref = getDecodeURI(url, loggerProvider);\n\n return {\n '[Amplitude] Page Domain': hostname,\n '[Amplitude] Page Location': locationHref,\n '[Amplitude] Page Path': getDecodeURI(pathname, loggerProvider),\n '[Amplitude] Page Title': title,\n '[Amplitude] Page URL': getDecodeURI(locationHref.split('?')[0], loggerProvider),\n };\n}\n\nfunction hasMetrics(payload: WebVitalsEventPayload): boolean {\n return METRIC_PROPERTIES.some((property) => property in payload);\n}\n\nexport const webVitalsSoftNavPlugin = (): BrowserEnrichmentPlugin => {\n let visibilityListener: ((this: Document, ev: Event) => void) | null = null;\n let flushTimeout: ReturnType<typeof setTimeout> | undefined;\n const globalScope = getGlobalScope();\n const doc = globalScope?.document;\n const location = globalScope?.location;\n let isActive = false;\n const recordedNavigationIds = new Set<number>();\n\n const setup: BrowserEnrichmentPlugin['setup'] = async (config, amplitude) => {\n if (doc === undefined) {\n return;\n }\n isActive = true;\n\n // One payload per navigation, keyed by the navigation its metrics belong to.\n const payloads = new Map<number, WebVitalsEventPayload>();\n let latestNavigationId = -1;\n\n const getPayload = (metric: Metric): WebVitalsEventPayload => {\n const key = metric.navigationId;\n let payload = payloads.get(key);\n if (!payload) {\n payload = getPageProperties(\n /* istanbul ignore next */ metric.navigationURL || location?.href || '',\n /* istanbul ignore next */ doc.title || '',\n config.loggerProvider,\n );\n payloads.set(key, payload);\n }\n return payload;\n };\n\n const flush = (key: number) => {\n recordedNavigationIds.add(key);\n\n const payload = payloads.get(key);\n /* istanbul ignore if */\n if (!payload) {\n return;\n }\n payloads.delete(key);\n\n // The page can be hidden repeatedly without a new navigation reporting anything.\n if (hasMetrics(payload)) {\n amplitude.track(WEB_VITALS_EVENT_NAME, payload);\n }\n };\n\n const flushAll = () => {\n for (const key of Array.from(payloads.keys())) {\n flush(key);\n }\n };\n\n // Once a newer navigation starts reporting metrics, the navigations before it are final. Sending\n // them is deferred briefly so metrics reported late still make it into their event.\n const scheduleFlushOfPreviousNavigations = (currentNavigationId: number) => {\n if (flushTimeout !== undefined) {\n clearTimeout(flushTimeout);\n }\n flushTimeout = setTimeout(() => {\n flushTimeout = undefined;\n for (const key of Array.from(payloads.keys())) {\n if (key < currentNavigationId) {\n flush(key);\n }\n }\n }, SOFT_NAV_FLUSH_DELAY_MS);\n };\n\n const recordMetric = (property: WebVitalsMetricPropertyType) => (metric: Metric) => {\n if (!isActive || recordedNavigationIds.has(metric.navigationId)) {\n return;\n }\n getPayload(metric)[property] = processMetric(metric, true);\n\n if (metric.navigationId > latestNavigationId) {\n if (latestNavigationId !== -1) {\n scheduleFlushOfPreviousNavigations(metric.navigationId);\n }\n latestNavigationId = metric.navigationId;\n }\n };\n\n const reportOpts = { reportSoftNavs: true };\n\n onLCP(recordMetric(WebVitalsMetricProperty.LCP), reportOpts);\n onFCP(recordMetric(WebVitalsMetricProperty.FCP), reportOpts);\n onINP(recordMetric(WebVitalsMetricProperty.INP), reportOpts);\n onCLS(recordMetric(WebVitalsMetricProperty.CLS), reportOpts);\n onTTFB(recordMetric(WebVitalsMetricProperty.TTFB), reportOpts);\n\n visibilityListener = () => {\n if (doc.visibilityState === 'hidden' && visibilityListener) {\n flushAll();\n // Keep listening: the page can become visible again and report metrics for further navigations.\n }\n };\n doc.addEventListener('visibilitychange', visibilityListener);\n };\n\n const execute: BrowserEnrichmentPlugin['execute'] = async (event) => {\n return event;\n };\n\n const teardown = async () => {\n isActive = false;\n if (flushTimeout !== undefined) {\n clearTimeout(flushTimeout);\n flushTimeout = undefined;\n }\n if (visibilityListener) {\n /* istanbul ignore next */\n doc?.removeEventListener('visibilitychange', visibilityListener);\n visibilityListener = null;\n }\n };\n\n return {\n name: PLUGIN_NAME,\n type: 'enrichment',\n setup,\n execute,\n teardown,\n };\n};\n","import { WebVitalsOptions, getGlobalScope } from '@amplitude/analytics-core';\nimport { webVitalsPlugin as createWebVitalsPlugin } from './web-vitals-plugin';\nimport { webVitalsSoftNavPlugin } from './web-vitals-soft-nav-plugin';\n\nexport { VERSION } from './version';\nexport { webVitalsSoftNavPlugin };\n\nconst isSoftNavSupported = () => {\n const globalScope = getGlobalScope();\n return globalScope && 'PerformanceSoftNavigation' in globalScope;\n};\n\n/**\n * Creates the web vitals plugin. When `reportSoftNav` is enabled, uses the soft-navigation\n * plugin so each navigation (including SPA route changes) is reported separately.\n */\nexport const webVitalsPlugin = (options: WebVitalsOptions = {}) => {\n if (options.reportSoftNav === true && isSoftNavSupported()) {\n return webVitalsSoftNavPlugin();\n }\n return createWebVitalsPlugin();\n};\n\nexport { webVitalsPlugin as plugin };\n","export const VERSION = '1.2.1';\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","_","label","sent","trys","ops","g","Object","create","Iterator","prototype","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","__values","o","s","m","i","SuppressedError","getGlobalScope","ampIntegrationContextName","globalThis","window","self","global","getDecodeURI","locationStr","loggerProvider","decodedLocationStr","decodeURI","error","PLUGIN_NAME","WEB_VITALS_EVENT_NAME","WebVitalsMetricProperty","LCP","FCP","INP","CLS","TTFB","bfcacheRestoreTime","getBFCacheRestoreTime","onBFCacheRestore","cb","addEventListener","event","persisted","timeStamp","bindReporter","callback","metric","thresholds","reportAllChanges","prevValue","delta","forceReport","rating","getRating","doubleRAF","requestAnimationFrame","getNavigationEntry","navigationEntry","performance","getEntriesByType","responseStart","now","getActivationStart","activationStart","firstHiddenTime","onHiddenFunctions","Set","initHiddenTime","document","visibilityState","prerendering","Infinity","onVisibilityUpdate","type","onHiddenFunction","isFinite","removeEventListener","getVisibilityWatcher","reset","firstVisibilityStateHiddenTime","find","name","startTime","setTimeout","onHidden","add","initMetric","navigationType","navigationId","navigationInteractionId","navigationURL","navigationStartTime","hardNavEntry","hardNavId","_navigationType","wasDiscarded","replace","entries","id","Date","Math","floor","random","instanceMap","WeakMap","initUnique","identityObj","ClassObj","classInstances","get","set","LayoutShiftManager","_onAfterProcessingUnexpectedShift","_sessionValue","_sessionEntries","_processEntry","entry","hadRecentInput","firstSessionEntry","lastSessionEntry","at","observe","types","opts","supportedTypes","filter","PerformanceObserver","supportedEntryTypes","includes","po","list","queueMicrotask","getEntries","sort","a","b","duration","buffered","checkSoftNavsEnabled","PerformanceSoftNavigation","getLargestInteractionContentfulPaint","reportSoftNavs","storeSoftNavEntry","map","size","firstKey","keys","delete","runOnce","called","FCPEntryManager","_softNavigationEntryMap","whenActivated","FCPThresholds","onFCP","onReport","softNavsEnabled","fcpEntryManager","visibilityWatcher","report","disconnect","max","forEach","FCPTime","presentationTime","paintTime","interactionId","CLSThresholds","onCLS","layoutShiftManager","initNewCLSMetric","updateAndReportMetric","handleSoftNavEntry","handleEntries","entryType","takeRecords","interactionCountEstimate","minKnownInteractionId","maxKnownInteractionId","updateEstimate","min","getInteractionCount","interactionCount","InteractionManager","_prevInteractionCount","_longestInteractionList","_longestInteractionMap","Map","_onBeforeProcessingEntry","_onAfterProcessingINPCandidate","_getInteractionCountForNavigation","_resetInteractions","clear","_estimateP98LongestInteraction","interactionCountForNavigation","candidateInteractionIndex","_latency","minLongestInteraction","interaction","removedInteractions","splice","whenIdleOrHidden","timeout","rIC","requestIdleCallback","cIC","cancelIdleCallback","clearTimeout","wrappedCb","idleHandle","once","capture","INPThresholds","onINP","PerformanceEventTiming","durationThreshold","interactionManager","initNewINPMetric","updateINPMetric","inp","LCPEntryManager","LCPThresholds","onLCP","isFinalized","lcpEntryManager","initNewLCPMetric","navigation","largestInteractionContentfulPaint","slice","metricEntries","renderTime","ICPEntry","largestContentfulPaint","finalizeEventTypes","finalizeLCP","isTrusted","metricIdToFinalize","TTFBThresholds","whenReady","readyState","onTTFB","getMetricStartTime","_a","timeOrigin","processMetric","isSoftNav","payload","timestamp","navigationStart","METRIC_PROPERTIES","values","webVitalsSoftNavPlugin","flushTimeout","visibilityListener","globalScope","doc","location","isActive","recordedNavigationIds","setup","config","amplitude","undefined","payloads","latestNavigationId","getPayload","key","url","title","hostname","pathname","parsedUrl","URL","debug","locationHref","split","getPageProperties","href","flush","some","property","hasMetrics","track","flushAll","_b","Array","from","_c","scheduleFlushOfPreviousNavigations","currentNavigationId","reportOpts","recordMetric","has","execute","teardown","webVitalsPlugin","options","reportSoftNav","webVitalsPayload","createWebVitalsPlugin"],"mappings":"sDAkHO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,UAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQ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4CACXgS,IAEFE,SAAAA,EAAKnL,oBAAoB,mBAAoBiL,aAWnD,CE5DS8C,GAbkB,IACnB7C,CAaR,mBCrBuB"}
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,function(e){"use strict";function t(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})}function n(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}"function"==typeof SuppressedError&&SuppressedError;var i=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n};let r=-1;const o=e=>{addEventListener("pageshow",t=>{t.persisted&&(r=t.timeStamp,e(t))},!0)},a=(e,t,n,i)=>{let r,o;return a=>{t.value>=0&&(a||i)&&(o=t.value-(r??0),(o||void 0===r)&&(r=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},s=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},l=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},u=()=>{const e=l();return e?.activationStart??0},c=(e,t=-1)=>{const n=l();let i="navigate";return r>=0?i="back-forward-cache":n&&(document.prerendering||u()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},d=new WeakMap;function f(e,t){return d.get(e)||d.set(e,new t),d.get(e)}class p{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const h=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const i=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return i.observe({type:e,buffered:!0,...n}),i}}catch{}},v=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let m=-1;const g=new Set,y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,b=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of g)e();isFinite(m)||(m="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",b,!0))}},T=()=>{if(m<0){const e=u(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;m=t??y(),addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0),o(()=>{setTimeout(()=>{m=y()})})}return{get firstHiddenTime(){return m},onHidden(e){g.add(e)}}},P=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},w=[1800,3e3],A=(e,t={})=>{P(()=>{const n=T();let i,r=c("FCP");const l=h("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(l.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-u(),0),r.entries.push(t),i(!0)))});l&&(i=a(e,r,w,t.reportAllChanges),o(n=>{r=c("FCP"),i=a(e,r,w,t.reportAllChanges),s(()=>{r.value=performance.now()-n.timeStamp,i(!0)})}))})},C=[.1,.25];let E=0,L=1/0,S=0;const I=e=>{for(const t of e)t.interactionId&&(L=Math.min(L,t.interactionId),S=Math.max(S,t.interactionId),E=S?(S-L)/7+1:0)};let M;const x=()=>M?E:performance.interactionCount??0;let k=0;class F{u=[];l=new Map;m;p;v(){k=x(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((x()-k)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const O=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=v(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},R=[200,500],H=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=T();P(()=>{"interactionCount"in performance||M||(M=h("event",I,{type:"event",buffered:!0,durationThreshold:0}));let i,r=c("INP");const s=f(t,F),l=e=>{O(()=>{for(const t of e)s.h(t);const t=s.L();t&&t.P!==r.value&&(r.value=t.P,r.entries=t.entries,i())})},u=h("event",l,{durationThreshold:t.durationThreshold??40});i=a(e,r,R,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(u.takeRecords()),i(!0)}),o(()=>{s.v(),r=c("INP"),i=a(e,r,R,t.reportAllChanges)}))})};class B{m;h(e){this.m?.(e)}}const j=[2500,4e3],q=[800,1800],N=e=>{document.prerendering?P(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};function D(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function U(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(D(e)),navigationStart:Math.floor(performance.timeOrigin)}}var V=function(){var e,r=null,d=(e="ampIntegrationContext","undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0),m=null==d?void 0:d.document,g=null==d?void 0:d.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(e,d){return t(void 0,void 0,void 0,function(){var t,y;return n(this,function(n){return void 0===m||(t=i((null==g?void 0:g.href)||"",e.loggerProvider),y={"[Amplitude] Page Domain":(null==g?void 0:g.hostname)||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":i((null==g?void 0:g.pathname)||"",e.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":i(t.split("?")[0],e.loggerProvider)},((e,t={})=>{P(()=>{const n=T();let i,r=c("LCP");const l=f(t,B),d=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)l.h(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-u(),0),r.entries=[t],i())},p=h("largest-contentful-paint",d);if(p){i=a(e,r,j,t.reportAllChanges);const n=v(()=>{d(p.takeRecords()),p.disconnect(),i(!0)}),l=e=>{e.isTrusted&&(O(n),removeEventListener(e.type,l,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,l,{capture:!0});o(n=>{r=c("LCP"),i=a(e,r,j,t.reportAllChanges),s(()=>{r.value=performance.now()-n.timeStamp,i(!0)})})}})})(function(e){y["[Amplitude] LCP"]=U(e)}),A(function(e){y["[Amplitude] FCP"]=U(e)}),H(function(e){y["[Amplitude] INP"]=U(e)}),((e,t={})=>{const n=T();A(v(()=>{let i,r=c("CLS",0);const l=f(t,p),u=e=>{for(const t of e)l.h(t);l.i>r.value&&(r.value=l.i,r.entries=l.o,i())},d=h("layout-shift",u);d&&(i=a(e,r,C,t.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),o(()=>{l.i=0,r=c("CLS",0),i=a(e,r,C,t.reportAllChanges),s(()=>i())}),setTimeout(i))}))})(function(e){y["[Amplitude] CLS"]=U(e)}),((e,t={})=>{let n=c("TTFB"),i=a(e,n,q,t.reportAllChanges);N(()=>{const r=l();r&&(n.value=Math.max(r.responseStart-u(),0),n.entries=[r],i(!0),o(()=>{n=c("TTFB",0),i=a(e,n,q,t.reportAllChanges),i(!0)}))})})(function(e){y["[Amplitude] TTFB"]=U(e)}),r=function(){"hidden"===m.visibilityState&&r&&(d.track("[Amplitude] Web Vitals",y),m.removeEventListener("visibilitychange",r),r=null)},m.addEventListener("visibilitychange",r)),[2]})})},execute:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){return[2,e]})})},teardown:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){return r&&(null==m||m.removeEventListener("visibilitychange",r)),[2]})})}}};e.VERSION="1.1.49-video-analytics-5.0",e.plugin=V,e.webVitalsPlugin=V,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).amplitude={})}(this,function(t){"use strict";function e(t,e,n,i){return new(n||(n=Promise))(function(o,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(r,s)}l((i=i.apply(t,e||[])).next())})}function n(t,e){var n,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=s(0),r.throw=s(1),r.return=s(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}"function"==typeof SuppressedError&&SuppressedError;var o=function(){var t="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[t]?globalThis[t]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},a=function(t,e){var n=t;try{n=decodeURI(t)}catch(t){null==e||e.error("Malformed URI sequence: ",t)}return n},r="web-vitals-browser",s="[Amplitude] Web Vitals",l={LCP:"[Amplitude] LCP",FCP:"[Amplitude] FCP",INP:"[Amplitude] INP",CLS:"[Amplitude] CLS",TTFB:"[Amplitude] TTFB"};let c=-1;const u=()=>c,d=t=>{addEventListener("pageshow",e=>{e.persisted&&(c=e.timeStamp,t(e))},!0)},f=(t,e,n,i)=>{let o,a;return r=>{e.value>=0&&(r||i)&&(a=e.value-(o??0),(a||void 0===o)&&(o=e.value,e.delta=a,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},v=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},g=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},p=()=>g()?.activationStart??0;let h=-1;const m=new Set,y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,T=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of m)t();isFinite(h)||(h="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",T,!0))}},b=(t=!1)=>{if(t&&(h=1/0),h<0){const t=p(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t)?.startTime;h=e??y(),addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0),d(()=>{setTimeout(()=>{h=y()})})}return{get firstHiddenTime(){return h},onHidden(t){m.add(t)}}},I=(t,e=-1,n,i=0,o,a,r)=>{const s=g(),l=s?.navigationId||0;let c="navigate";return n?c=n:u()>=0?c="back-forward-cache":s&&(document.prerendering||p()>0?c="prerender":document.wasDiscarded?c="restore":s.type&&(c=s.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:c,navigationId:i||l,navigationInteractionId:o,navigationURL:a||s?.name,navigationStartTime:r||0}},P=new WeakMap;function w(t,e){let n=P.get(e);return n||(n=new WeakMap,P.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}class C{t;i=0;o=[];h(t){if(t.hadRecentInput)return;const e=this.o[0],n=this.o.at(-1);this.i&&e&&n&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),this.t?.(t)}}const L=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe({type:e,buffered:!0,...n});return t}}catch{}},A=t=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&t&&t.reportSoftNavs,S=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},E=t=>{let e=!1;return()=>{e||(t(),e=!0)}};class k{l}const x=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},M=[1800,3e3],F=(t,e={})=>{const n=A(e);x(()=>{const i=w(e,k),o=b();let a,r=I("FCP");const s=L(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<o.firstHiddenTime&&(r.value=Math.max(e.startTime-p(),0),r.entries.push(e),r.navigationId=e.navigationId||r.navigationId,a(!0)))});s&&(a=f(t,r,M,e.reportAllChanges),d(n=>{r=I("FCP",-1,"back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,u()),a=f(t,r,M,e.reportAllChanges),v(()=>{r.value=performance.now()-n.timeStamp,a(!0)})})),n&&L(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&S(i.l,n);const o=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);r=I("FCP",o,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),a=f(t,r,M,e.reportAllChanges),a(!0)})},e)})},R=[.1,.25],N=(t,e={})=>{const n=b();F(E(()=>{let i,o=I("CLS",0);const a=w(e,C),r=(n,r,s,l,c)=>{o=I("CLS",0,n,r,s,l,c),a.i=0,i=f(t,o,R,e.reportAllChanges)},s=(t=!1)=>{a.i>o.value&&(o.value=a.i,o.entries=a.o),i(t)},l=t=>{s(!0),r("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=t=>{for(const e of t)"soft-navigation"!==e.entryType?a.h(e):l(e);s()},g=["layout-shift"];A(e)&&g.push("soft-navigation");const p=L(g,c);p&&(i=f(t,o,R,e.reportAllChanges),n.onHidden(()=>{c(p.takeRecords()),i(!0)}),d(()=>{r("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,u()),v(i)}),setTimeout(i))}))};let U=0,O=1/0,B=0;const j=t=>{for(const e of t)e.interactionId&&(O=Math.min(O,e.interactionId),B=Math.max(B,e.interactionId),U=B?(B-O)/7+1:0)};let q;const H=()=>q?U:performance.interactionCount??0;class _{u=0;v=[];m=new Map;p;T;_(){return H()-this.u}M(){this.u=H(),this.v.length=0,this.m.clear()}L(t){const e=this._(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{P:8,id:-1,entries:[]}}h(t){if(this.p?.(t),!t.interactionId)return;const e=this.v.at(-1);let n=this.m.get(t.interactionId);if(n||this.v.length<10||t.duration>e.P){if(n?t.duration>n.P?(n.entries=[t],n.P=t.duration):t.duration===n.P&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],P:t.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.m.delete(e.id)}this.T?.(n)}}}const D=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const o=E(t);let a=-1;const r=()=>{i(a),o()};addEventListener("visibilitychange",r,{once:!0,capture:!0}),a=n(()=>{removeEventListener("visibilitychange",r,{capture:!0}),o()},{timeout:e})}},V=[200,500],W=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=b();x(()=>{"interactionCount"in performance||q||(q=L(["event"],j,{durationThreshold:0}));let i,o=I("INP");const a=w(e,_),r=(n,r,s,l,c)=>{a.M(),o=I("INP",-1,n,r,s,l,c),i=f(t,o,V,e.reportAllChanges)},s=()=>{const t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())},l=t=>{s(),i(!0),r("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{D(()=>{for(const e of t)"soft-navigation"!==e.entryType?a.h(e):l(e);s(),e&&i(!0)})},v=["event","first-input"];A(e)&&v.push("soft-navigation");const g=L(v,c,{...e,durationThreshold:e.durationThreshold??40});i=f(t,o,V,e.reportAllChanges),g&&(n.onHidden(()=>{c(g.takeRecords(),!0)}),d(()=>{r("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,u())}))})};class ${p;l;h(t){this.p?.(t)}}const z=[2500,4e3],G=(t,e={})=>{let n=!1;const i=A(e);x(()=>{let o,a=b(),r=I("LCP");const s=w(e,$),l=(i,s,l,c,u)=>{r=I("LCP",-1,i,s,l,c,u),o=f(t,r,z,e.reportAllChanges),n=!1,"soft-navigation"===i&&(a=b(!0))},c=t=>{s.l&&t.navigationId&&S(s.l,t),n||o(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const e=t.getLargestInteractionContentfulPaint?.();e&&g([e])},g=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){c(e);continue}let t=0,n=[],i=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-p(),0),s.h(e),n=[e];else if("interaction-contentful-paint"===e.entryType){const o=e;if(!r.navigationId)continue;if("interactionId"in o&&o.interactionId!=r.navigationInteractionId)continue;i=o.largestContentfulPaint?.renderTime||0,t=Math.max(i-e.startTime,0),o.largestContentfulPaint&&(s.h(o.largestContentfulPaint),n=[o.largestContentfulPaint])}i<a.firstHiddenTime&&(r.value=t,r.entries=n,o())}},h=["largest-contentful-paint"];i&&h.push("interaction-contentful-paint","soft-navigation");const m=L(h,g);if(m){o=f(t,r,z,e.reportAllChanges);const a=["keydown","click","visibilitychange"],s=t=>{if(t.isTrusted&&!n){const t=r.id;D(()=>{if(!n){if(!i){m.disconnect();for(const t of a)removeEventListener(t,s,{capture:!0})}t===r.id&&(n=!0,o(!0))}})}};for(const t of a)addEventListener(t,s,{capture:!0});d(i=>{l("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,u()),o=f(t,r,z,e.reportAllChanges),v(()=>{r.value=performance.now()-i.timeStamp,n=!0,o(!0)})})}})},J=[800,1800],K=t=>{document.prerendering?x(()=>K(t)):"complete"!==document.readyState?addEventListener("load",()=>K(t),!0):setTimeout(t)},Q=(t,e={})=>{const n=A(e);let i=I("TTFB"),o=f(t,i,J,e.reportAllChanges);K(()=>{const a=g();if(a){const r=a.responseStart;i.value=Math.max(r-p(),0),i.entries=[a],o(!0),d(()=>{i=I("TTFB",0,"back-forward-cache",i.navigationId,i.navigationInteractionId,i.navigationURL,u()),o=f(t,i,J,e.reportAllChanges),o(!0)}),n&&L(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(i=I("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),i.entries=[n],o=f(t,i,J,e.reportAllChanges),o(!0))})},e)}})};function X(t){var e,n=(null===(e=t.entries[0])||void 0===e?void 0:e.startTime)||0;return performance.timeOrigin+n}function Y(t,e){void 0===e&&(e=!1);var n={value:t.value,rating:t.rating,delta:t.delta,navigationType:t.navigationType,id:t.id,timestamp:Math.floor(X(t)),navigationStart:e?Math.floor(performance.timeOrigin+(t.navigationStartTime||0)):Math.floor(performance.timeOrigin)};return e&&(n.navigationId=t.navigationId),n}var Z=Object.values(l);var tt=function(){var t,c=null,u=o(),d=null==u?void 0:u.document,f=null==u?void 0:u.location,v=!1,g=new Set;return{name:r,type:"enrichment",setup:function(o,r){return e(void 0,void 0,void 0,function(){var e,u,p,h,m,y,T,b;return n(this,function(n){return void 0===d||(v=!0,e=new Map,u=-1,p=function(t){var n=t.navigationId,i=e.get(n);return i||(i=function(t,e,n){var i="",o="";try{var r=new URL(t);i=r.hostname,o=r.pathname}catch(t){n.debug("Web vitals plugin is unable to parse page URL: ",t)}var s=a(t,n);return{"[Amplitude] Page Domain":i,"[Amplitude] Page Location":s,"[Amplitude] Page Path":a(o,n),"[Amplitude] Page Title":e,"[Amplitude] Page URL":a(s.split("?")[0],n)}}(t.navigationURL||(null==f?void 0:f.href)||"",d.title||"",o.loggerProvider),e.set(n,i)),i},h=function(t){g.add(t);var n=e.get(t);n&&(e.delete(t),function(t){return Z.some(function(e){return e in t})}(n)&&r.track(s,n))},m=function(){var t,n;try{for(var o=i(Array.from(e.keys())),a=o.next();!a.done;a=o.next()){var r=a.value;h(r)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},y=function(n){void 0!==t&&clearTimeout(t),t=setTimeout(function(){var o,a;t=void 0;try{for(var r=i(Array.from(e.keys())),s=r.next();!s.done;s=r.next()){var l=s.value;l<n&&h(l)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}},1e3)},b={reportSoftNavs:!0},G((T=function(t){return function(e){v&&!g.has(e.navigationId)&&(p(e)[t]=Y(e,!0),e.navigationId>u&&(-1!==u&&y(e.navigationId),u=e.navigationId))}})(l.LCP),b),F(T(l.FCP),b),W(T(l.INP),b),N(T(l.CLS),b),Q(T(l.TTFB),b),c=function(){"hidden"===d.visibilityState&&c&&m()},d.addEventListener("visibilitychange",c)),[2]})})},execute:function(t){return e(void 0,void 0,void 0,function(){return n(this,function(e){return[2,t]})})},teardown:function(){return e(void 0,void 0,void 0,function(){return n(this,function(e){return v=!1,void 0!==t&&(clearTimeout(t),t=void 0),c&&(null==d||d.removeEventListener("visibilitychange",c),c=null),[2]})})}}},et=function(t){return void 0===t&&(t={}),!0===t.reportSoftNav&&((i=o())&&"PerformanceSoftNavigation"in i)?tt():function(){var t=null,i=o(),l=null==i?void 0:i.document,c=null==i?void 0:i.location;return{name:r,type:"enrichment",setup:function(i,o){return e(void 0,void 0,void 0,function(){var e,r;return n(this,function(n){return void 0===l||(e=a((null==c?void 0:c.href)||"",i.loggerProvider),r={"[Amplitude] Page Domain":(null==c?void 0:c.hostname)||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":a((null==c?void 0:c.pathname)||"",i.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":a(e.split("?")[0],i.loggerProvider)},G(function(t){r["[Amplitude] LCP"]=Y(t)}),F(function(t){r["[Amplitude] FCP"]=Y(t)}),W(function(t){r["[Amplitude] INP"]=Y(t)}),N(function(t){r["[Amplitude] CLS"]=Y(t)}),Q(function(t){r["[Amplitude] TTFB"]=Y(t)}),t=function(){"hidden"===l.visibilityState&&t&&(o.track(s,r),l.removeEventListener("visibilitychange",t),t=null)},l.addEventListener("visibilitychange",t)),[2]})})},execute:function(t){return e(void 0,void 0,void 0,function(){return n(this,function(e){return[2,t]})})},teardown:function(){return e(void 0,void 0,void 0,function(){return n(this,function(e){return t&&(null==l||l.removeEventListener("visibilitychange",t)),[2]})})}}}();var i};t.VERSION="1.2.1",t.plugin=et,t.webVitalsPlugin=et,t.webVitalsSoftNavPlugin=tt,Object.defineProperty(t,"__esModule",{value:!0})});
Binary file
@@ -1,3 +1,37 @@
1
1
  export declare const PLUGIN_NAME = "web-vitals-browser";
2
2
  export declare const WEB_VITALS_EVENT_NAME = "[Amplitude] Web Vitals";
3
+ import type { Metric } from 'web-vitals';
4
+ /**
5
+ * How long to wait, after a newer navigation starts reporting metrics, before sending the event for
6
+ * a superseded navigation. Metrics for a navigation can be reported slightly after the next soft
7
+ * navigation begins, so the event is deferred to give those late metrics a chance to land.
8
+ */
9
+ export declare const SOFT_NAV_FLUSH_DELAY_MS = 1000;
10
+ export declare const WebVitalsMetricProperty: {
11
+ readonly LCP: "[Amplitude] LCP";
12
+ readonly FCP: "[Amplitude] FCP";
13
+ readonly INP: "[Amplitude] INP";
14
+ readonly CLS: "[Amplitude] CLS";
15
+ readonly TTFB: "[Amplitude] TTFB";
16
+ };
17
+ export type WebVitalsMetricPropertyType = (typeof WebVitalsMetricProperty)[keyof typeof WebVitalsMetricProperty];
18
+ export type WebVitalsMetricPayload = {
19
+ value: number;
20
+ rating: Metric['rating'];
21
+ delta: number;
22
+ navigationType: Metric['navigationType'];
23
+ id: string;
24
+ timestamp: number;
25
+ navigationStart: number;
26
+ navigationId?: number;
27
+ };
28
+ export type WebVitalsEventPayload = {
29
+ [P in WebVitalsMetricPropertyType]?: WebVitalsMetricPayload;
30
+ } & {
31
+ '[Amplitude] Page Domain'?: string;
32
+ '[Amplitude] Page Location'?: string;
33
+ '[Amplitude] Page Path'?: string;
34
+ '[Amplitude] Page Title'?: string;
35
+ '[Amplitude] Page URL'?: string;
36
+ };
3
37
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,qBAAqB,2BAA2B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,eAAO,MAAM,uBAAuB;;;;;;CAM1B,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEjH,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,2BAA2B,CAAC,CAAC,EAAE,sBAAsB;CAC5D,GAAG;IACF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC"}
@@ -1,3 +1,11 @@
1
- export { webVitalsPlugin as plugin, webVitalsPlugin } from './web-vitals-plugin';
1
+ import { WebVitalsOptions } from '@amplitude/analytics-core';
2
+ import { webVitalsSoftNavPlugin } from './web-vitals-soft-nav-plugin';
2
3
  export { VERSION } from './version';
4
+ export { webVitalsSoftNavPlugin };
5
+ /**
6
+ * Creates the web vitals plugin. When `reportSoftNav` is enabled, uses the soft-navigation
7
+ * plugin so each navigation (including SPA route changes) is reported separately.
8
+ */
9
+ export declare const webVitalsPlugin: (options?: WebVitalsOptions) => import("./web-vitals-plugin").BrowserEnrichmentPlugin;
10
+ export { webVitalsPlugin as plugin };
3
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkB,MAAM,2BAA2B,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAOlC;;;GAGG;AACH,eAAO,MAAM,eAAe,aAAa,gBAAgB,0DAKxD,CAAC;AAEF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { WebVitalsMetricPayload } from './constants';
2
+ import { Metric } from 'web-vitals';
3
+ export declare function processMetric(metric: Metric, isSoftNav?: boolean): WebVitalsMetricPayload;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAQpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,sBAAsB,CAkBvF"}