1import { a as Dt, g as B, n as N, t as v, y as Uu } from "./chunk-xgti9j2t.js"; 2import { t as $u } from "./chunk-o4f8w5yc.js"; 3function ct(e) { 4 return e === null ? "null" : Array.isArray(e) ? "array" : typeof e; 5} 6function ue(e) { 7 return ct(e) === "object"; 8} 9function Vu(e) { 10 return typeof e == "number" && e >= 0 && e <= 100; 11} 12function ke(e) { 13 return typeof e == "string" || e instanceof RegExp || typeof e == "function"; 14} 15function ci(e, t) { 16 return On(e, t, Fu()); 17} 18function On(e, t, n) { 19 if (t === void 0) return e; 20 if (typeof t != "object" || t === null) return t; 21 if (t instanceof Date) return new Date(t.getTime()); 22 if (t instanceof RegExp) return new RegExp(t.source, t.flags); 23 if (n.hasAlreadyBeenSeen(t)) return; 24 if (Array.isArray(t)) { 25 let i = Array.isArray(e) ? e : []; 26 for (let o = 0; o < t.length; ++o) i[o] = On(i[o], t[o], n); 27 return i; 28 } 29 let r = ct(e) === "object" ? e : {}; 30 for (let i in t) Object.prototype.hasOwnProperty.call(t, i) && i !== "__proto__" && (r[i] = On(r[i], t[i], n)); 31 return r; 32} 33function Pt(e) { 34 return ci(void 0, e); 35} 36function pe(...e) { 37 let t; 38 for (let n of e) n != null && (t = ci(t, n)); 39 return t; 40} 41function Fu() { 42 let e = /* @__PURE__ */ new WeakSet(); 43 return { hasAlreadyBeenSeen(t) { 44 let n = e.has(t); 45 return n || e.add(t), n; 46 } }; 47} 48function Hu(e) { 49 return { 50 debug: et.debug.bind(Z, e), 51 log: et.log.bind(Z, e), 52 info: et.info.bind(Z, e), 53 warn: et.warn.bind(Z, e), 54 error: et.error.bind(Z, e) 55 }; 56} 57function qu(e) { 58 Er = e; 59} 60function li() { 61 return Er; 62} 63function In(e) { 64 return Ee(e, O.location?.href).href; 65} 66function Gu(e) { 67 try { 68 return !!Ee(e); 69 } catch { 70 return !1; 71 } 72} 73function Bu(e) { 74 let t = Ee(e).pathname; 75 return t[0] === "/" ? t : `/${t}`; 76} 77function Ee(e, t) { 78 let { URL: n } = Ku(); 79 try { 80 return t !== void 0 ? new n(e, t) : new n(e); 81 } catch (r) { 82 throw new Error(`Failed to construct URL: ${String(r)}`); 83 } 84} 85function Ku() { 86 if (!Sr) { 87 let e, t; 88 try { 89 e = document.createElement("iframe"), e.style.display = "none", document.body.appendChild(e), t = e.contentWindow ?? O; 90 } catch { 91 t = O; 92 } 93 Sr = { URL: t.URL }, e?.remove(); 94 } 95 return Sr; 96} 97function ju(e, t) { 98 function n(s, a, u) { 99 u.value = r(u.value); 100 } 101 function r(s) { 102 return function(...a) { 103 return i(s, this, a); 104 }; 105 } 106 function i(s, a, u) { 107 try { 108 return s.apply(a, u); 109 } catch (c) { 110 o(c); 111 } 112 } 113 function o(s) { 114 let a = (u) => { 115 li() && e.error("[MONITOR]", u); 116 }; 117 a(s); 118 try { 119 t(s); 120 } catch (u) { 121 a(u); 122 } 123 } 124 return { 125 monitored: n, 126 monitor: r, 127 callMonitored: i, 128 monitorError: o 129 }; 130} 131function Wu(e) { 132 ws = e; 133} 134function se() { 135 return (/* @__PURE__ */ new Date()).getTime(); 136} 137function G() { 138 return se(); 139} 140function L(e, t) { 141 return t - e; 142} 143function _(e) { 144 return typeof e != "number" ? e : Math.round(e * 1e6); 145} 146function Oe(e, t) { 147 return e + t; 148} 149function ee() { 150 return performance.now(); 151} 152function x() { 153 return { 154 relative: ee(), 155 timeStamp: G() 156 }; 157} 158function xn() { 159 return { 160 relative: 0, 161 timeStamp: Be() 162 }; 163} 164function lt(e) { 165 return { 166 relative: e, 167 timeStamp: Yu(e) 168 }; 169} 170function di(e) { 171 return { 172 relative: fi(e), 173 timeStamp: e 174 }; 175} 176function fi(e) { 177 return e - Be(); 178} 179function zu(e) { 180 return Math.round(Oe(Be(), e)); 181} 182function Xu(e) { 183 return e < 31536e6; 184} 185function pi() { 186 return Math.round(se() - Oe(Be(), performance.now())); 187} 188function Be() { 189 return _r === void 0 && (_r = performance.timing?.navigationStart ?? performance.timeOrigin), _r; 190} 191function Yu(e) { 192 let t = se() - performance.now(); 193 return t > Be() ? Math.round(Oe(t, e)) : zu(e); 194} 195function Ju(e) { 196 return ks.every((t) => e.includes(t)); 197} 198function dt(e, t, n) { 199 return { 200 build(r, i) { 201 return Nn({ 202 proxy: e.proxy, 203 site: e.site, 204 path: `/api/v2/${t}`, 205 parameters: Qu(e, t, r, i, n) 206 }); 207 }, 208 trackType: t 209 }; 210} 211function mi({ replica: e, proxy: t, source: n }, r) { 212 if (e) return dt({ 213 clientToken: e.clientToken, 214 proxy: t, 215 source: n, 216 site: Tt 217 }, r, r === "rum" ? [`application.id=${e.applicationId}`] : void 0); 218} 219function Nn({ proxy: e, site: t = Tt, path: n, parameters: r = "", subdomain: i }) { 220 let o = n; 221 if (r && (o += `?${r}`), typeof e == "string") { 222 let c = `${In(e)}?ddforward=${encodeURIComponent(o)}`; 223 return i && (c += `&ddforwardSubdomain=${i}`), c; 224 } 225 if (typeof e == "function") return e({ 226 path: n, 227 parameters: r, 228 subdomain: i 229 }); 230 let s = t.split("."), a = s.pop(), u = `browser-intake-${s.join("-")}.${a}`; 231 return i && (u = `${i}.${u}`), `https://${u}${o}`; 232} 233function Qu({ clientToken: e, source: t = "browser" }, n, r, { retry: i, encoding: o }, s = []) { 234 let a = [ 235 `ddsource=${t}`, 236 `dd-api-key=${e}`, 237 `dd-evp-origin-version=${encodeURIComponent("7.9.0")}`, 238 "dd-evp-origin=browser", 239 `dd-request-id=${gi()}` 240 ].concat(s); 241 return o && a.push(`dd-evp-encoding=${o}`), n === "rum" && (a.push(`batch_time=${G()}`, `_dd.api=${r}`), i && a.push(`_dd.retry_count=${i.count}`, `_dd.retry_after=${i.lastFailureStatus}`)), a.join("&"); 242} 243function gi(e) { 244 return e ? (parseInt(e, 10) ^ Math.random() * 16 >> parseInt(e, 10) / 4).toString(16) : "10000000-1000-4000-8000-100000000000".replace(/[018]/g, gi); 245} 246function me(e, t) { 247 let n = O, r; 248 return n.Zone && typeof n.Zone.__symbol__ == "function" && (r = e[n.Zone.__symbol__(t)]), r || (r = e[t]), r; 249} 250function j(e, t) { 251 return me(O, "setTimeout")(R(e), t); 252} 253function Y(e) { 254 me(O, "clearTimeout")(e); 255} 256function Ke(e, t) { 257 return me(O, "setInterval")(R(e), t); 258} 259function ft(e) { 260 me(O, "clearInterval")(e); 261} 262function pt(e, t, n) { 263 let r = n?.leading !== void 0 ? n.leading : !0, i = n?.trailing !== void 0 ? n.trailing : !0, o = !1, s, a; 264 return { 265 throttled: (...u) => { 266 if (o) { 267 s = u; 268 return; 269 } 270 r ? e(...u) : s = u, o = !0, a = j(() => { 271 i && s && e(...s), o = !1, s = void 0; 272 }, t); 273 }, 274 cancel: () => { 275 Y(a), o = !1, s = void 0; 276 } 277 }; 278} 279function V() {} 280function U(e, t, n, r) { 281 return Ie(e, [t], n, r); 282} 283function Ie(e, t, n, { once: r, capture: i, passive: o } = {}) { 284 let s = R((f) => { 285 !f.isTrusted && !f.__ddIsTrusted && wr === !1 || (r && d(), n(f)); 286 }), a = o ? { 287 capture: i, 288 passive: o 289 } : i, u = window.EventTarget && e instanceof EventTarget ? window.EventTarget.prototype : e, c = me(u, "addEventListener"); 290 t.forEach((f) => c.call(e, f, s, a)); 291 function d() { 292 let f = me(u, "removeEventListener"); 293 t.forEach((p) => f.call(e, p, s, a)); 294 } 295 return { stop: d }; 296} 297function Ln(e, t) { 298 if (!e) return !1; 299 try { 300 return U(e, t, V).stop(), !0; 301 } catch { 302 return !1; 303 } 304} 305function Zu(e) { 306 wr !== !0 && (wr = e ?? !1); 307} 308function yi(e) { 309 let t = O.queueMicrotask; 310 typeof t == "function" ? t(R(e)) : Promise.resolve().then(R(e)); 311} 312function hi(...e) { 313 return new k((t) => { 314 let n = e.map((r) => r.subscribe((i) => t.notify(i))); 315 return () =>
315 n.forEach((r) => r.unsubscribe()); 316 }); 317} 318function Mn(e) { 319 return xs.test(e) ? new TextEncoder().encode(e).length : e.length; 320} 321function bi(e) { 322 if (e.length === 1) return e[0]; 323 let t = e.reduce((i, o) => i + o.length, 0), n = new Uint8Array(t), r = 0; 324 for (let i of e) n.set(i, r), r += i.length; 325 return n; 326} 327function Dn(e, t) { 328 return me(O, "fetch")(e, t); 329} 330function ec(e) { 331 return e >= 500; 332} 333function tc(e) { 334 try { 335 return e.clone(); 336 } catch { 337 return; 338 } 339} 340function vi(e, t, n, r, i, o) { 341 t.transportStatus === 0 && t.queuedPayloads.size() === 0 && t.bandwidthMonitor.canHandle(e) ? Si(e, t, n, o, { 342 onSuccess: () => _i(0, t, n, r, i, o), 343 onFailure: () => { 344 t.queuedPayloads.enqueue(e) || o.notify({ 345 type: "queue-full", 346 bandwidth: t.bandwidthMonitor.stats(), 347 payload: e 348 }), Ei(t, n, r, i, o); 349 } 350 }) : t.queuedPayloads.enqueue(e) || o.notify({ 351 type: "queue-full", 352 bandwidth: t.bandwidthMonitor.stats(), 353 payload: e 354 }); 355} 356function Ei(e, t, n, r, i) { 357 e.transportStatus === 2 && j(() => { 358 Si(e.queuedPayloads.first(), e, t, i, { 359 onSuccess: () => { 360 e.queuedPayloads.dequeue(), e.currentBackoffTime = Ar, _i(1, e, t, n, r, i); 361 }, 362 onFailure: () => { 363 e.currentBackoffTime = Math.min(Ls, e.currentBackoffTime * 2), Ei(e, t, n, r, i); 364 } 365 }); 366 }, e.currentBackoffTime); 367} 368function Si(e, t, n, r, { onSuccess: i, onFailure: o }) { 369 t.bandwidthMonitor.add(e), n(e, (s) => { 370 t.bandwidthMonitor.remove(e), nc(s) ? (t.transportStatus = t.bandwidthMonitor.ongoingRequestCount > 0 ? 1 : 2, e.retry = { 371 count: e.retry ? e.retry.count + 1 : 1, 372 lastFailureStatus: s.status 373 }, r.notify({ 374 type: "failure", 375 bandwidth: t.bandwidthMonitor.stats(), 376 payload: e 377 }), o()) : (t.transportStatus = 0, r.notify({ 378 type: "success", 379 bandwidth: t.bandwidthMonitor.stats(), 380 payload: e 381 }), i()); 382 }); 383} 384function _i(e, t, n, r, i, o) { 385 e === 0 && t.queuedPayloads.isFull() && !t.queueFullReported && (i(`Reached max ${r} events size queued for upload: ${Tr / 1048576}MiB`), t.queueFullReported = !0); 386 let s = t.queuedPayloads; 387 for (t.queuedPayloads = Ci(); s.size() > 0;) vi(s.dequeue(), t, n, r, i, o); 388} 389function nc(e) { 390 return e.type !== "opaque" && (e.status === 0 && !navigator.onLine || e.status === 408 || e.status === 429 || ec(e.status)); 391} 392function rc() { 393 return { 394 transportStatus: 0, 395 currentBackoffTime: Ar, 396 bandwidthMonitor: ic(), 397 queuedPayloads: Ci(), 398 queueFullReported: !1 399 }; 400} 401function Ci() { 402 let e = []; 403 return { 404 bytesCount: 0, 405 enqueue(t) { 406 return this.isFull() ? !1 : (e.push(t), this.bytesCount += t.bytesCount, !0); 407 }, 408 first() { 409 return e[0]; 410 }, 411 dequeue() { 412 let t = e.shift(); 413 return t && (this.bytesCount -= t.bytesCount), t; 414 }, 415 size() { 416 return e.length; 417 }, 418 isFull() { 419 return this.bytesCount >= Tr; 420 } 421 }; 422} 423function ic() { 424 return { 425 ongoingRequestCount: 0, 426 ongoingByteCount: 0, 427 canHandle(e) { 428 return this.ongoingRequestCount === 0 || this.ongoingByteCount + e.bytesCount <= Ns && this.ongoingRequestCount < 32; 429 }, 430 add(e) { 431 this.ongoingRequestCount += 1, this.ongoingByteCount += e.bytesCount; 432 }, 433 remove(e) { 434 this.ongoingRequestCount -= 1, this.ongoingByteCount -= e.bytesCount; 435 }, 436 stats() { 437 return { 438 ongoingByteCount: this.ongoingByteCount, 439 ongoingRequestCount: this.ongoingRequestCount 440 }; 441 } 442 }; 443} 444function Pn(e, t, n = on) { 445 let r = new k(), i = rc(); 446 return { 447 observable: r, 448 send: (o) => { 449 for (let s of e) vi(o, i, (a, u) => { 450 wi(s, a, u); 451 }, s.trackType, t, r); 452 }, 453 sendOnExit: (o) => { 454 for (let s of e) oc(s, n, o); 455 } 456 }; 457} 458function oc(e, t, n) { 459 if (n.bytesCount < t) try { 460 let r = e.build("beacon", n); 461 if (navigator.sendBeacon(r, n.data)) return; 462 } catch (r) { 463 sc(r); 464 } 465 wi(e, n); 466} 467function sc(e) { 468 Rr || (Rr = !0, K(e)); 469} 470function wi(e, t, n) { 471 Dn(e.build("fetch", t), { 472 method: "POST", 473 body: t.data, 474 mode: "cors" 475 }).then(R((r) => n?.({ 476 status: r.status, 477 type: r.type 478 }))).catch(R(() => n?.({ status: 0 }))); 479} 480function xe() { 481 let e = uc(); 482 if (e) return { 483 getCapabilities() { 484 return JSON.parse(e.getCapabilities?.() || "[]"); 485 }, 486 getPrivacyLevel() { 487 return e.getPrivacyLevel?.(); 488 }, 489 getIsTraceSampled() { 490 return JSON.parse(e.getIsTraceSampled?.() || "null"); 491 }, 492 getAllowedWebViewHosts() { 493 return JSON.parse(e.getAllowedWebViewHosts()); 494 }, 495 send(t, n, r) { 496 let i = r ? { id: r } : void 0; 497 e.send(JSON.stringify({ 498 eventType: t, 499 event: n, 500 view: i 501 })); 502 } 503 }; 504} 505function Ti(e) { 506 let t = xe(); 507 return !!t && t.getCapabilities().includes(e); 508} 509function Se(e = O.location?.hostname) { 510 return xe()?.getAllowedWebViewHosts().some((t) => ac(e, t)) ?? !1; 511} 512function ac(e, t) { 513 if (!t.includes("*")) return e === t || e.endsWith(`.${t}`); 514 let n = t.split("*"); 515 if (n.length !== 2) return w.error(`Invalid WebView host pattern "${t}": only one wildcard (*) is supported.`), !1; 516 let [r, i] = n; 517 return e.length > r.length + i.length && e.startsWith(r) && e.endsWith(i); 518} 519function uc() { 520 return O.DatadogEventBridge; 521} 522function je(e) { 523 try { 524 return JSON.parse(e, Ms); 525 } catch {} 526} 527function mt(e) { 528 return v({}, e); 529} 530function cc(e, t) { 531 return Object.keys(e).some((n) => e[n] === t); 532} 533function ge(e) { 534 return Object.keys(e).length === 0; 535} 536function Ai(e, t) { 537 let n = {}; 538 for (let r of Object.keys(e)) n[r] = t(e[r]); 539 return n; 540} 541function lc(e) { 542 Array.isArray(e) && dc(e.filter((t) => cc(At, t))); 543} 544function dc(e) { 545 e.forEach((t) => { 546 sn.add(t); 547 }); 548} 549function Un(e) { 550 return sn.has(e); 551} 552function fc() { 553 return sn; 554} 555function Ne(e) { 556 let t = [], n = $n(e, "stack"), r = String(e); 557 if (n?.startsWith(r) && (n = n.slice(r.length)), n && n.split(` 558`).forEach((i) => { 559 let o = pc(i) || mc(i) || gc(i) || yc(i); 560 o && (!o.func && o.line && (o.func = $e), t.push(o)); 561 }), t.length > 0 && vc() && e instanceof Error) { 562 let i = [], o = e; 563 for (;
563 (o = Object.getPrototypeOf(o)) && Ri(o);) { 564 let s = o.constructor?.name || $e; 565 i.push(s); 566 } 567 for (let s = i.length - 1; s >= 0 && t[0]?.func === i[s]; s--) t.shift(); 568 } 569 return { 570 message: $n(e, "message"), 571 name: $n(e, "name"), 572 stack: t 573 }; 574} 575function pc(e) { 576 let t = Ds.exec(e); 577 if (!t) return; 578 let n = t[2]?.indexOf("native") === 0, r = t[2]?.indexOf("eval") === 0, i = Ps.exec(t[2]); 579 return r && i && (t[2] = i[1], t[3] = i[2], t[4] = i[3]), { 580 args: n ? [t[2]] : [], 581 column: t[4] ? +t[4] : void 0, 582 func: t[1] || $e, 583 line: t[3] ? +t[3] : void 0, 584 url: n ? void 0 : t[2] 585 }; 586} 587function mc(e) { 588 let t = Us.exec(e); 589 if (t) return { 590 args: [], 591 column: t[4] ? +t[4] : void 0, 592 func: t[1] || $e, 593 line: t[3] ? +t[3] : void 0, 594 url: t[2] 595 }; 596} 597function gc(e) { 598 let t = $s.exec(e); 599 if (t) return { 600 args: [], 601 column: t[4] ? +t[4] : void 0, 602 func: t[1] || $e, 603 line: +t[3], 604 url: t[2] 605 }; 606} 607function yc(e) { 608 let t = Vs.exec(e); 609 if (!t) return; 610 let n = t[3] && t[3].indexOf(" > eval") > -1, r = Fs.exec(t[3]); 611 return n && r && (t[3] = r[1], t[4] = r[2], t[5] = void 0), { 612 args: t[2] ? t[2].split(",") : [], 613 column: t[5] ? +t[5] : void 0, 614 func: t[1] || $e, 615 line: t[4] ? +t[4] : void 0, 616 url: t[3] 617 }; 618} 619function $n(e, t) { 620 return ue(e) && typeof e[t] == "string" ? e[t] : void 0; 621} 622function hc(e, t, n, r) { 623 if (t === void 0) return; 624 let { name: i, message: o } = bc(e); 625 return { 626 name: i, 627 message: o, 628 stack: [{ 629 url: t, 630 column: r, 631 line: n 632 }] 633 }; 634} 635function bc(e) { 636 let t, n; 637 return {}.toString.call(e) === "[object String]" && ([, t, n] = Hs.exec(e)), { 638 name: t, 639 message: n 640 }; 641} 642function Ri(e) { 643 return String(e.constructor).startsWith("class "); 644} 645function vc() { 646 if (an !== void 0) return an; 647 class e extends Error { 648 constructor() { 649 super(), this.name = "Error"; 650 } 651 } 652 let [t, n] = [e, Error].map((r) => new r()); 653 return an = Ri(Object.getPrototypeOf(t)) && n.stack !== t.stack, an; 654} 655function ce(e) { 656 let t = new Error(e); 657 t.name = "HandlingStack"; 658 let n; 659 return te(() => { 660 let r = Ne(t); 661 r.stack = r.stack.slice(2), n = Ut(r); 662 }), n; 663} 664function Ut(e) { 665 let t = ki(e); 666 return e.stack.forEach((n) => { 667 let r = n.func === "?" ? "<anonymous>" : n.func, i = n.args && n.args.length > 0 ? `(${n.args.join(", ")})` : "", o = n.line ? `:${n.line}` : "", s = n.line && n.column ? `:${n.column}` : ""; 668 t += ` 669 at ${r}${i} @ ${n.url}${o}${s}`; 670 }), t; 671} 672function ki(e) { 673 return `${e.name || "Error"}: ${e.message}`; 674} 675function _e(e, t, n) { 676 if (typeof e != "object" || e === null) return JSON.stringify(e); 677 let r = We(Object.prototype), i = We(Array.prototype), o = We(Object.getPrototypeOf(e)), s = We(e); 678 try { 679 return JSON.stringify(e, t, n); 680 } catch { 681 return "<error: unable to serialize object>"; 682 } finally { 683 r(), i(), o(), s(); 684 } 685} 686function We(e) { 687 let t = e, n = t.toJSON; 688 return n ? (delete t.toJSON, () => { 689 t.toJSON = n; 690 }) : V; 691} 692function ye(e) { 693 try { 694 return e instanceof Error || Object.prototype.toString.call(e) === "[object Error]"; 695 } catch { 696 return !1; 697 } 698} 699function Vn(e) { 700 let { env: t, service: n, version: r, datacenter: i, sdkVersion: o, variant: s } = e, a = [ze("sdk_version", o ?? "7.9.0")]; 701 return t && a.push(ze("env", t)), n && a.push(ze("service", n)), r && a.push(ze("version", r)), i && a.push(ze("datacenter", i)), s && a.push(ze("variant", s)), a; 702} 703function ze(e, t) { 704 let n = t ? `${e}:${t}` : e; 705 return (n.length > 200 || Sc(n)) && w.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${tn} https://docs.datadoghq.com/getting_started/tagging/#defining-tags`), Ec(n); 706} 707function Ec(e) { 708 return e.replace(/,/g, "_"); 709} 710function Sc(e) { 711 return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]", "u").test(e); 712} 713function $t(e, t) { 714 let n = O.__ddBrowserSdkExtensionCallback; 715 n && n({ 716 type: e, 717 payload: t 718 }); 719} 720function Oi() { 721 let { navigator: e } = O; 722 return { 723 status: e?.onLine ? "connected" : "not_connected", 724 interfaces: e?.connection?.type ? [e.connection.type] : void 0, 725 effective_type: e?.connection?.effectiveType 726 }; 727} 728function Ii(e, t) { 729 for (let n = e.length - 1; n >= 0; n -= 1) { 730 let r = e[n]; 731 if (t(r, n, e)) return r; 732 } 733} 734function xi(e) { 735 return Object.values(e); 736} 737function Vt(e) { 738 return Object.entries(e); 739} 740function Ni() { 741 return new k((e) => { 742 let t = O.window; 743 if (!t) return; 744 let { stop: n } = Ie(t, ["visibilitychange", "freeze"], (i) => { 745 i.type === "visibilitychange" && document.visibilityState === "hidden" ? e.notify({ reason: tt.HIDDEN }) : i.type === "freeze" && e.notify({ reason: tt.FROZEN }); 746 }, { capture: !0 }), r = U(t, "beforeunload", () => { 747 e.notify({ reason: tt.UNLOADING }); 748 }).stop; 749 return () => { 750 n(), r(); 751 }; 752 }); 753} 754function Li(e) { 755 return xi(tt).includes(e); 756} 757function Mi() { 758 let e = "", t = 0; 759 return { 760 isAsync: !1, 761 get isEmpty() { 762 return !e; 763 }, 764 write(n, r) { 765 let i = Mn(n); 766 t += i, e += n, r && r(i); 767 }, 768 finish(n) { 769 n(this.finishSync()); 770 }, 771 finishSync() { 772 let n = { 773 output: e, 774 outputBytesCount: t, 775 rawBytesCount: t, 776 pendingData: "" 777 }; 778 return e = "", t = 0, n; 779 }, 780 estimateEncodedBytesCount(n) { 781 return n.length; 782 } 783 }; 784} 785function _c({ pageMayExitObservable: e }) { 786 let t, n = new k(), r = e.subscribe((f) => { 787 t = f.reason; 788 try { 789 n.notify(f.reason); 790 } finally { 791 t = void 0; 792 } 793 a(f.reason); 794 }), i = new k(() => () => { 795 r.unsubscribe(); 796 }), o = 0, s = 0; 797 function a(f) { 798 if (s === 0) return; 799 let p = s, l = o; 800 s = 0, o = 0, d(), i.notify({ 801 reason: f, 802 messagesCount: p, 803 bytesCount: l 804 }); 805 } 806 let u; 807 function c() { 808 u === void 0 && (u = j(() => { 809 a("duration_limit"); 810 }, qs)); 811 } 812 function d() { 813 Y(u), u = void 0; 814 } 815 return { 816 flushObservable: i, 817 prepareUrgentFlushObservable: n, 818 forceFlush: a, 819 get messagesCount() { 820 return s; 821 }, 822 notifyBeforeAddMessage(f) { 823 o + f >= on && a(t ?? "bytes_limit"), s += 1, o += f, c(); 824 }, 825 notifyAfterAddMessage(f = 0) { 826 o += f, s >= Gs ? a(t ?? "messages_limit") : o >= on && a(t ?? "bytes_limit"); 827 } 828 }; 829} 830function Di({ encoder: e = Mi(), endpoints: t, reportError: n }) { 831 let r = Pn(t, n), i = _c({ pageMayExitObservable: Ni() }), o = {}, s = i.flushObservable.subscribe((d) => c(d)); 832 function a(d, f, p) { 833 if (p !== void 0) { 834 let l;
835 o[p] !== void 0 ? l = f - e.estimateEncodedBytesCount(o[p]) : (i.notifyBeforeAddMessage(f), l = 0), o[p] = d, i.notifyAfterAddMessage(l); 836 } else i.notifyBeforeAddMessage(f), e.write(e.isEmpty ? d : ` 837${d}`, (l) => { 838 i.notifyAfterAddMessage(l - f); 839 }); 840 } 841 function u(d, f) { 842 let p = _e(d), l = e.estimateEncodedBytesCount(p); 843 if (l >= xr) { 844 w.warn(`Discarded a message whose size was bigger than the maximum allowed size ${xr / 1024}KiB. ${tn} ${Cs}/#technical-limitations`); 845 return; 846 } 847 a(p, l, f); 848 } 849 function c(d) { 850 let f = xi(o).join(` 851`); 852 o = {}; 853 let p = Li(d.reason), l = p ? r.sendOnExit : r.send; 854 if (p && e.isAsync) { 855 let m = e.finishSync(); 856 m.outputBytesCount && l(Pi(m)); 857 let g = [m.pendingData, f].filter(Boolean).join(` 858`); 859 g && l({ 860 data: g, 861 bytesCount: Mn(g) 862 }); 863 } else f && e.write(e.isEmpty ? f : ` 864${f}`), e.finish((m) => { 865 l(Pi(m)); 866 }); 867 } 868 return { 869 get isEmpty() { 870 return i.messagesCount === 0; 871 }, 872 add: u, 873 upsert: u, 874 prepareUrgentFlushObservable: i.prepareUrgentFlushObservable, 875 forceFlush: i.forceFlush, 876 flushObservable: i.flushObservable, 877 stop: s.unsubscribe 878 }; 879} 880function Pi(e) { 881 let t; 882 return typeof e.output == "string" ? t = e.output : t = new Blob([e.output], { type: "text/plain" }), { 883 data: t, 884 bytesCount: e.outputBytesCount, 885 encoding: e.encoding 886 }; 887} 888function Ui() { 889 let e = []; 890 return { 891 register(t) { 892 return e.push(t), { unregister() { 893 e = e.filter((n) => n !== t); 894 } }; 895 }, 896 trigger(t) { 897 let n = []; 898 for (let r of e) { 899 let i = r(t); 900 if (i === "DISCARDED") return Te; 901 i !== "SKIPPED" && n.push(i); 902 } 903 return pe(...n); 904 } 905 }; 906} 907function Ft(e) { 908 return e !== 0 && Math.random() * 100 <= e; 909} 910function Xe() { 911 return Nr || (Nr = new rn(100)), Nr; 912} 913function Cc(e, t, n, r) { 914 let i = new k(), { enabled: o, metricsEnabled: s } = wc(e, t, n, i, r), { stop: a } = Tc(t, i); 915 return { 916 stop: a, 917 enabled: o, 918 metricsEnabled: s 919 }; 920} 921function wc(e, t, n, r, i, o = js, s = zs) { 922 let a = {}, u = !Ws.includes(t.site) && Ft(t.telemetrySampleRate), c = { 923 [be.LOG]: u, 924 [be.CONFIGURATION]: u && Ft(t.telemetryConfigurationSampleRate), 925 [be.USAGE]: u && Ft(t.telemetryUsageSampleRate), 926 metric: u && Ft(o) 927 }, d = Ac(), f = Xe(); 928 return f.subscribe(({ rawEvent: l, metricName: m }) => { 929 if (m && !c.metric || !c[l.type]) return; 930 let g = m || l.status || l.type, h = a[g]; 931 if (h || (h = a[g] = /* @__PURE__ */ new Set()), h.size >= s) return; 932 let S = _e(l); 933 if (h.has(S)) return; 934 let $ = n.trigger({ startTime: x().relative }); 935 if ($ === Te) return; 936 let M = p($, e, l, d); 937 r.notify(M), $t("telemetry", M), h.add(S); 938 }), f.unbuffer(), Wu($i), { 939 enabled: u, 940 metricsEnabled: c.metric 941 }; 942 function p(l, m, g, h) { 943 return pe({ 944 type: "telemetry", 945 date: x().timeStamp, 946 service: m, 947 version: "7.9.0", 948 source: "browser", 949 _dd: { format_version: 2 }, 950 telemetry: pe(g, { 951 runtime_env: h, 952 connectivity: Oi(), 953 sdk_setup: "npm", 954 sdk_name: i 955 }), 956 ddtags: Vn(t).join(","), 957 experimental_features: Array.from(fc()) 958 }, l); 959 } 960} 961function Tc(e, t) { 962 let n = []; 963 if (Se()) { 964 let r = xe(), i = t.subscribe((o) => r.send("internal_telemetry", o)); 965 n.push(i.unsubscribe); 966 } else { 967 let r = [dt(e, "rum")], i = mi(e, "rum"); 968 i && Rc(e) && r.push(i); 969 let o = Di({ 970 endpoints: r, 971 reportError: V 972 }); 973 n.push(o.stop); 974 let s = t.subscribe(o.add); 975 n.push(s.unsubscribe); 976 } 977 return { stop: () => n.forEach((r) => r()) }; 978} 979function Ac() { 980 return { 981 is_local_file: O.location?.protocol === "file:", 982 is_worker: Ue 983 }; 984} 985function Rc(e) { 986 return e.site === Cr; 987} 988function Ye(e, t) { 989 li() && w.debug("[Telemetry]", e, t), Xe().notify({ rawEvent: v({ 990 type: be.LOG, 991 message: e, 992 status: "debug" 993 }, t) }); 994} 995function $i(e, t) { 996 Xe().notify({ rawEvent: v(v({ 997 type: be.LOG, 998 status: "error" 999 }, Oc(e)), t) }); 1000} 1001function kc(e) { 1002 Xe().notify({ rawEvent: { 1003 type: be.CONFIGURATION, 1004 configuration: e 1005 } }); 1006} 1007function gt(e, t) { 1008 Xe().notify({ 1009 rawEvent: v({ 1010 type: be.LOG, 1011 message: e, 1012 status: "debug" 1013 }, t), 1014 metricName: e 1015 }); 1016} 1017function F(e) { 1018 Xe().notify({ rawEvent: { 1019 type: be.USAGE, 1020 usage: e 1021 } }); 1022} 1023function Oc(e) { 1024 if (ye(e)) { 1025 let t = Ne(e); 1026 return { 1027 error: { 1028 kind: t.name, 1029 stack: Ut(Ic(t)) 1030 }, 1031 message: t.message 1032 }; 1033 } 1034 return { 1035 error: { stack: Ir }, 1036 message: `Uncaught ${_e(e)}` 1037 }; 1038} 1039function Ic(e) { 1040 return e.stack = e.stack.filter((t) => !t.url || Bs.some((n) =>
1040 t.url.startsWith(n))), e; 1041} 1042function Fn(e, t) { 1043 return e * t / 100; 1044} 1045function Ht(e, t) { 1046 if (t === 100) return !0; 1047 if (t === 0) return !1; 1048 let n = Lr.get(t); 1049 if (e === n?.sessionId) return n.decision; 1050 let r = xc(BigInt(`0x${e.split("-")[4]}`), t); 1051 return Lr.set(t, { 1052 sessionId: e, 1053 decision: r 1054 }), r; 1055} 1056function xc(e, t) { 1057 let n = 1111111111111111111n, r = 1n << 64n, i = e * n % r; 1058 return Number(i) <= t / 100 * Number(r); 1059} 1060function Nc(e) { 1061 let t = new k(); 1062 function n() { 1063 return e === un.GRANTED; 1064 } 1065 return { 1066 tryToInit(r) { 1067 e || (e = r); 1068 }, 1069 onGrantedOnce(r) { 1070 if (n()) r(); 1071 else { 1072 let i = t.subscribe(() => { 1073 n() && (r(), i.unsubscribe()); 1074 }); 1075 } 1076 }, 1077 update(r) { 1078 e = r, t.notify(); 1079 }, 1080 isGranted: n, 1081 observable: t 1082 }; 1083} 1084function Lc(e) { 1085 return { 1086 session_sample_rate: e.sessionSampleRate, 1087 telemetry_sample_rate: e.telemetrySampleRate, 1088 telemetry_configuration_sample_rate: e.telemetryConfigurationSampleRate, 1089 telemetry_usage_sample_rate: e.telemetryUsageSampleRate, 1090 use_before_send: !!e.beforeSend, 1091 use_partitioned_cross_site_session_cookie: e.usePartitionedCrossSiteSessionCookie, 1092 use_secure_session_cookie: e.useSecureSessionCookie, 1093 use_proxy: !!e.proxy, 1094 silent_multiple_init: e.silentMultipleInit, 1095 track_session_across_subdomains: e.trackSessionAcrossSubdomains, 1096 track_anonymous_user: e.trackAnonymousUser, 1097 session_persistence: Array.isArray(e.sessionPersistence) ? e.sessionPersistence[0] : e.sessionPersistence, 1098 store_contexts_across_pages: !!e.storeContextsAcrossPages, 1099 allow_untrusted_events: !!e.allowUntrustedEvents, 1100 tracking_consent: e.trackingConsent, 1101 use_allowed_tracking_origins: Array.isArray(e.allowedTrackingOrigins), 1102 source: e.source, 1103 sdk_version: e.sdkVersion, 1104 variant: e.variant 1105 }; 1106} 1107function H(e) { 1108 return e ? (parseInt(e, 10) ^ Math.random() * 16 >> parseInt(e, 10) / 4).toString(16) : "10000000-1000-4000-8000-100000000000".replace(/[018]/g, H); 1109} 1110function Hn(e, t) { 1111 for (He.lastIndex = 0;;) { 1112 let n = He.exec(e); 1113 if (n) { 1114 if (n[1] === t) return n[2]; 1115 } else break; 1116 } 1117} 1118function Mc(e) { 1119 let t = /* @__PURE__ */ new Map(); 1120 for (He.lastIndex = 0;;) { 1121 let n = He.exec(e); 1122 if (n) { 1123 let r = n[1], i = n[2]; 1124 t.has(r) ? t.get(r).push(i) : t.set(r, [i]); 1125 } else break; 1126 } 1127 return t; 1128} 1129function Dc(e) { 1130 let t = /* @__PURE__ */ new Map(); 1131 for (He.lastIndex = 0;;) { 1132 let n = He.exec(e); 1133 if (n) t.set(n[1], n[2]); 1134 else break; 1135 } 1136 return t; 1137} 1138function yt(e, t, n = "") { 1139 let r = e.charCodeAt(t - 1), i = r >= 55296 && r <= 56319 ? t + 1 : t; 1140 return e.length <= i ? e : `${e.slice(0, i)}${n}`; 1141} 1142function Pc(e, t) { 1143 return t ? `${e}-v${t.split(".")[0]}` : e; 1144} 1145function Uc(...e) { 1146 let t = e.filter((n) => !!n); 1147 return t.length > 0 ? t : void 0; 1148} 1149function qn(e, t, n = 0, r) { 1150 let i = /* @__PURE__ */ new Date(); 1151 i.setTime(i.getTime() + n); 1152 let o = `expires=${i.toUTCString()}`, s = r?.crossSite ? "none" : "strict", a = r?.domain ? `;domain=${r.domain}` : "", u = r?.secure ? ";secure" : "", c = r?.partitioned ? ";partitioned" : ""; 1153 document.cookie = `${e}=${t};${o};path=/;samesite=${s}${a}${u}${c}`; 1154} 1155function qt(e) { 1156 let t = Hn(document.cookie, e); 1157 if (t !== "") return t; 1158} 1159function Je(e) { 1160 return Mc(document.cookie).get(e) || []; 1161} 1162function ht(e) { 1163 return Mr || (Mr = Dc(document.cookie)), Mr.get(e); 1164} 1165function Vi(e, t) { 1166 qn(e, "", 0, t); 1167} 1168function $c(e = O.location?.hostname ?? "", t = typeof document < "u" ? document.referrer : "") { 1169 if (!(typeof document > "u")) { 1170 if (Dr === void 0) { 1171 let n = Vc(e, t); 1172 if (n) { 1173 let r = `dd_site_test_${H()}`, i = "test", o = n.split("."), s = o.pop(); 1174 for (; o.length && !qt(r);) s = `${o.pop()}.${s}`, qn(r, i, 1e3, { domain: s }); 1175 Vi(r, { domain: s }), Dr = s; 1176 } 1177 } 1178 return Dr; 1179 } 1180} 1181function Vc(e, t) { 1182 try { 1183 return e || Ee(t).hostname; 1184 } catch {} 1185} 1186function Fc(e) { 1187 let t = {}; 1188 if (t.secure = e.useSecureSessionCookie || e.usePartitionedCrossSiteSessionCookie, t.crossSite = e.usePartitionedCrossSiteSessionCookie, t.partitioned = e.usePartitionedCrossSiteSessionCookie, e.trackSessionAcrossSubdomains) { 1189 let n = $c(); 1190 if (!n) return; 1191 t.domain = n; 1192 } 1193 return t; 1194} 1195function Qe(e, t, n = !1) { 1196 return e.some((r) => { 1197 try { 1198 if (typeof r == "function") return r(t); 1199 if (r instanceof RegExp) return r.lastIndex = 0, r.test(t); 1200 if (typeof r == "string") return n ? t.startsWith(r) : r === t; 1201 } catch (i) { 1202 w.error(i); 1203 } 1204 return !1; 1205 }); 1206} 1207function Fi(e) { 1208 return Ys.some((t) => e.includes(t)); 1209} 1210function Hc(e, t = "") { 1211 return Fi(e) ? !1 : Fi(t.split(` 1212`).filter((n) => { 1213 let r = n.trim(); 1214 return r.length && /^at\s+|@/.test(r); 1215 })[1] || ""); 1216} 1217function qc(e, t) { 1218 let n = O.location, r = n ? n.origin : "", i = e.allowedTrackingOrigins; 1219 if (!i) return Hc(r, t) ? (w.error(Js), !1) : !0; 1220 let o = Qe(i, r); 1221 return o || w.error(Qs), o; 1222} 1223function oe(e, t, n, { computeHandlingStack: r } = {}) { 1224 let i = e[t]; 1225 if (typeof i != "function") if (t in e && typeof t == "string" && t.startsWith("on")) i = V; 1226 else return { stop: V }; 1227 let o = !1, s = function() { 1228 if (o) return i.apply(this, arguments); 1229 let u = Array.from(arguments); 1230 return Hi(n, {
1231 target: this, 1232 parameters: u, 1233 handlingStack: r ? ce("instrumented method") : void 0 1234 }, () => i.apply(this, u)); 1235 }, { stop: a } = Gn(e, t, i, s); 1236 return { stop: () => { 1237 o = !0, a(); 1238 } }; 1239} 1240function Gc(e, t, n, { computeHandlingStack: r } = {}) { 1241 let i = e[t]; 1242 if (typeof i != "function") return { stop: V }; 1243 let o = !1, s = function() { 1244 if (!new.target) return Reflect.apply(i, this, Array.from(arguments)); 1245 let c = new.target === s ? i : new.target; 1246 if (o) return Reflect.construct(i, arguments, c); 1247 let d = Array.from(arguments); 1248 return Hi(n, { 1249 parameters: d, 1250 handlingStack: r ? ce("instrumented constructor") : void 0 1251 }, () => Reflect.construct(i, d, c)); 1252 }, a = Bc(s, i), { stop: u } = Gn(e, t, i, s); 1253 return { stop: () => { 1254 o = !0, a(), u(); 1255 } }; 1256} 1257function Gn(e, t, n, r) { 1258 return e[t] = r, { stop: () => { 1259 e[t] === r && (e[t] = n); 1260 } }; 1261} 1262function Hi(e, t, n) { 1263 let r; 1264 te(e, null, [N(v({}, t), { onPostCall: (o) => { 1265 r = o; 1266 } })]); 1267 let i = n(); 1268 return r && te(r, null, [i]), i; 1269} 1270function Bc(e, t) { 1271 for (let r of [].concat(Object.getOwnPropertyNames(t), Object.getOwnPropertySymbols(t))) { 1272 let i = Object.getOwnPropertyDescriptor(t, r); 1273 Object.defineProperty(e, r, i); 1274 } 1275 let { stop: n } = Gn(t.prototype, "constructor", t.prototype.constructor, e); 1276 return n; 1277} 1278function Kc(e, t, n) { 1279 let r = Object.getOwnPropertyDescriptor(e, t); 1280 if (!r?.set || !r.configurable) return { stop: V }; 1281 let i = V, o = (a, u) => { 1282 j(() => { 1283 o !== i && n(a, u); 1284 }, 0); 1285 }, s = function(a) { 1286 r.set.call(this, a), o(this, a); 1287 }; 1288 return Object.defineProperty(e, t, { set: s }), { stop: () => { 1289 Object.getOwnPropertyDescriptor(e, t)?.set === s && Object.defineProperty(e, t, r), o = i; 1290 } }; 1291} 1292function A(e, t = Zs) { 1293 let n = We(Object.prototype), r = We(Array.prototype); 1294 try { 1295 let i = [], o = /* @__PURE__ */ new WeakMap(), s = Bn(e, ea, void 0, i, o), a = JSON.stringify(s), u = a ? a.length : 0; 1296 if (u > t) { 1297 jn(t, "discarded", e); 1298 return; 1299 } 1300 for (; i.length > 0 && u < t;) { 1301 let c = i.shift(), d = 0; 1302 if (Array.isArray(c.source)) for (let f = 0; f < c.source.length; f++) { 1303 let p = Bn(c.source[f], c.path, f, i, o); 1304 if (p !== void 0 ? u += JSON.stringify(p).length : u += 4, u += d, d = 1, u > t) { 1305 jn(t, "truncated", e); 1306 break; 1307 } 1308 c.target[f] = p; 1309 } 1310 else for (let f in c.source) if (Object.prototype.hasOwnProperty.call(c.source, f)) { 1311 let p = Bn(c.source[f], c.path, f, i, o); 1312 if (p !== void 0 && (u += JSON.stringify(p).length + d + f.length + ta, d = 1), u > t) { 1313 jn(t, "truncated", e); 1314 break; 1315 } 1316 c.target[f] = p; 1317 } 1318 } 1319 return s; 1320 } finally { 1321 n(), r(); 1322 } 1323} 1324function Bn(e, t, n, r, i) { 1325 let o = zc(e); 1326 if (!o || typeof o != "object") return jc(o); 1327 let s = Kn(o); 1328 if (s !== "[Object]" && s !== "[Array]" && s !== "[Error]") return s; 1329 let a = e; 1330 if (i.has(a)) return `[Reference seen at ${i.get(a)}]`; 1331 let u = n !== void 0 ? `${t}.${n}` : t, c = Array.isArray(o) ? [] : {}; 1332 return i.set(a, u), r.push({ 1333 source: o, 1334 target: c, 1335 path: u 1336 }), c; 1337} 1338function jc(e) { 1339 return typeof e == "bigint" ? `[BigInt] ${e.toString()}` : typeof e == "function" ? `[Function] ${e.name || "unknown"}` : typeof e == "symbol" ? `[Symbol] ${e.description || e.toString()}` : e; 1340} 1341function Kn(e) { 1342 try { 1343 if (e instanceof Event) return Wc(e); 1344 if (e instanceof RegExp) return `[RegExp] ${e.toString()}`; 1345 let t = Object.prototype.toString.call(e).match(/\[object (.*)\]/); 1346 if (t?.[1]) return `[${t[1]}]`; 1347 } catch {} 1348 return "[Unserializable]"; 1349} 1350function Wc(e) { 1351 return { 1352 type: e.type, 1353 isTrusted: e.isTrusted, 1354 currentTarget: e.currentTarget ? Kn(e.currentTarget) : null, 1355 target: e.target ? Kn(e.target) : null 1356 }; 1357} 1358function zc(e) { 1359 if ((typeof e != "object" || e === null) && typeof e != "function") return e; 1360 let t = e; 1361 if (typeof t.toJSON == "function") try { 1362 return t.toJSON(); 1363 } catch {} 1364 return e; 1365} 1366function jn(e, t, n) { 1367 w.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`, n); 1368} 1369function qi() { 1370 let e = O.window?.DD_SOURCE_CODE_CONTEXT; 1371 if (!e) return; 1372 let t = !1, n = !1, r = !1; 1373 for (let [i, o] of Object.entries(e)) { 1374 if (t = t || o.ddDebugId !== void 0, n = n || o.service !== void 0, r = r || o.version !== void 0, Pr.has(i)) continue; 1375 Pr.add(i); 1376 let s = Ne({ stack: i }).stack[0]?.url; 1377 s && !kt.has(s) && kt.set(s, o); 1378 } 1379 Ur || (Ur = !0, F({ 1380 feature: "source-code-context", 1381 use_debug_id: t, 1382 use_service: n, 1383 use_version: r 1384 })); 1385} 1386function Wn(e) { 1387 qi(); 1388 let t = /* @__PURE__ */ new Set(), n = []; 1389 for (let r of e) { 1390 if (t.has(r)) continue; 1391 t.add(r); 1392 let i = kt.get(r)?.ddDebugId; 1393 i !== void 0 && n.push({ 1394 url: r, 1395 id: i 1396 }); 1397 } 1398 return n.length ? n : void 0; 1399} 1400function Xc(e) { 1401 return qi(), kt.get(e); 1402} 1403function Gi({ originalError: e, stackTrace: t, source: n, useFallbackStack: r = !0, nonErrorPrefix: i }) { 1404 let o = ye(e); 1405 return { 1406 source: n, 1407 type: t ? t.name : void 0, 1408 message: Qc(t, o, i, e), 1409 stack: t ? Ut(t) : r ? Ir : void 0 1410 }; 1411} 1412function Bi(e) { 1413 return e?.stack.map((t) => t.url).filter((t) => !!t) ?? []; 1414} 1415function Yc(e, t) { 1416 let n = t.flatMap(({ stackTrace: r }) => Bi(r)); 1417 return Wn(Bi(e).concat(n)); 1418}
1419function Jc(e) { 1420 let t = [], n = e.cause; 1421 for (; n != null && t.length < 10;) { 1422 let r = ye(n), i = r ? Ne(n) : void 0; 1423 t.push({ 1424 originalError: n, 1425 stackTrace: i 1426 }), n = r ? n.cause : void 0; 1427 } 1428 return t; 1429} 1430function zn({ stackTrace: e, originalError: t, handlingStack: n, componentStack: r, startClocks: i, nonErrorPrefix: o, useFallbackStack: s = !0, source: a, handling: u }) { 1431 let c = e ?? (ye(t) ? Ne(t) : void 0), d = ye(t) ? Jc(t) : [], f = Gi({ 1432 originalError: t, 1433 stackTrace: c, 1434 source: a, 1435 useFallbackStack: s, 1436 nonErrorPrefix: o 1437 }), p = d.map(({ originalError: l, stackTrace: m }) => Gi({ 1438 originalError: l, 1439 stackTrace: m, 1440 source: a, 1441 useFallbackStack: !1 1442 })); 1443 return N(v({ 1444 startClocks: i, 1445 handling: u, 1446 handlingStack: n, 1447 componentStack: r, 1448 originalError: t 1449 }, f), { 1450 debugIds: Yc(c, d), 1451 causes: p.length ? p : void 0, 1452 fingerprint: Zc(t), 1453 context: el(t) 1454 }); 1455} 1456function Qc(e, t, n, r) { 1457 return e?.message && e?.name ? e.message : t ? "Empty message" : n ? `${n} ${_e(A(r))}` : _e(A(r)); 1458} 1459function Zc(e) { 1460 return ye(e) && "dd_fingerprint" in e ? String(e.dd_fingerprint) : void 0; 1461} 1462function el(e) { 1463 if (ue(e)) return e.dd_context; 1464} 1465function tl() { 1466 return new k((e) => { 1467 let t = (i, o) => { 1468 let s = zn({ 1469 stackTrace: o, 1470 originalError: i, 1471 startClocks: x(), 1472 nonErrorPrefix: "Uncaught", 1473 source: we.SOURCE, 1474 handling: "unhandled" 1475 }); 1476 e.notify(s); 1477 }, { stop: n } = nl(t), { stop: r } = rl(t); 1478 return () => { 1479 n(), r(); 1480 }; 1481 }); 1482} 1483function nl(e) { 1484 return oe(O, "onerror", ({ parameters: [t, n, r, i, o] }) => { 1485 let s; 1486 ye(o) || (s = hc(t, n, r, i)), e(o ?? t, s); 1487 }); 1488} 1489function rl(e) { 1490 return Ln(O.window, "unhandledrejection") ? oe(O, "onunhandledrejection", ({ parameters: [t] }) => { 1491 e(t.reason || "Empty reason"); 1492 }) : { stop: V }; 1493} 1494function Ki(e, t) { 1495 return (...n) => { 1496 try { 1497 return e(...n); 1498 } catch (r) { 1499 w.error(t, r); 1500 } 1501 }; 1502} 1503function il(e) { 1504 let t = v({ 1505 version: "7.9.0", 1506 onReady(n) { 1507 n(); 1508 } 1509 }, e); 1510 return Object.defineProperty(t, "_setDebug", { 1511 get() { 1512 return qu; 1513 }, 1514 enumerable: !1 1515 }), t; 1516} 1517function ol(e, t, n) { 1518 let r = e[t]; 1519 r && !r.q && r.version && w.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."), e[t] = n, r?.q && r.q.forEach((i) => Ki(i, "onReady callback threw an error:")()); 1520} 1521function ji(e, t) { 1522 t.silentMultipleInit || w.error(`${e} is already initialized.`); 1523} 1524function sl(e) { 1525 let t = []; 1526 e.includes(nt.cspViolation) && t.push(ul()); 1527 let n = e.filter((r) => r !== nt.cspViolation); 1528 return n.length && t.push(al(n)), hi(...t); 1529} 1530function al(e) { 1531 return new k((t) => { 1532 if (!window.ReportingObserver) return; 1533 let n = R((i, o) => i.forEach((s) => t.notify(cl(s)))), r = new window.ReportingObserver(n, { 1534 types: e, 1535 buffered: !0 1536 }); 1537 return r.observe(), () => { 1538 r.disconnect(); 1539 }; 1540 }); 1541} 1542function ul() { 1543 return new k((e) => { 1544 if (!Ln(document, "securitypolicyviolation")) return; 1545 let { stop: t } = U(document, "securitypolicyviolation", (n) => { 1546 e.notify(ll(n)); 1547 }); 1548 return t; 1549 }); 1550} 1551function cl(e) { 1552 let { type: t, body: n } = e; 1553 return Wi({ 1554 type: n.id, 1555 message: `${t}: ${n.message}`, 1556 originalError: e, 1557 stack: zi(n.id, n.message, n.sourceFile, n.lineNumber, n.columnNumber) 1558 }); 1559} 1560function ll(e) { 1561 let t = `'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`; 1562 return Wi({ 1563 type: e.effectiveDirective, 1564 message: `${nt.cspViolation}: ${t}`, 1565 originalError: e, 1566 csp: { disposition: e.disposition }, 1567 stack: zi(e.effectiveDirective, e.originalPolicy ? `${t} of the policy "${yt(e.originalPolicy, 100, "...")}"` : "no policy", e.sourceFile, e.lineNumber, e.columnNumber) 1568 }); 1569} 1570function Wi(e) { 1571 return v({ 1572 startClocks: x(), 1573 source: we.REPORT, 1574 handling: "unhandled" 1575 }, e); 1576} 1577function zi(e, t, n, r, i) { 1578 return n ? Ut({ 1579 name: e, 1580 message: t, 1581 stack: [{ 1582 func: "?", 1583 url: n, 1584 line: r ?? void 0, 1585 column: i ?? void 0 1586 }] 1587 }) : void 0; 1588} 1589function dl(e, t) { 1590 let n = e.indexOf(t); 1591 n >= 0 && e.splice(n, 1); 1592} 1593function Le(e) { 1594 return Array.isArray(e) && e.length > 0; 1595} 1596function fl() { 1597 It.forEach((e) => e()); 1598} 1599function Me({ expireDelay: e, maxEntries: t }) { 1600 let n = [], r = () => { 1601 if (!e) return; 1602 let p = ee() - e; 1603 for (; n.length > 0 && n[n.length - 1].endTime < p;
1603) n.pop(); 1604 }; 1605 e && (Ot || (Ot = Ke(() => fl(), na)), It.add(r)); 1606 function i(p, l) { 1607 let m = { 1608 value: p, 1609 startTime: l, 1610 endTime: rt, 1611 remove: () => { 1612 dl(n, m); 1613 }, 1614 close: (g) => { 1615 m.endTime = g; 1616 } 1617 }; 1618 return t && n.length >= t && n.pop(), n.unshift(m), m; 1619 } 1620 function o(p = rt, l = { returnInactive: !1 }) { 1621 for (let m of n) if (m.startTime <= p) { 1622 if (l.returnInactive || p <= m.endTime) return m.value; 1623 break; 1624 } 1625 } 1626 function s(p) { 1627 let l = n[0]; 1628 l?.endTime === rt && l.close(p); 1629 } 1630 function a(p = rt, l = 0) { 1631 let m = Oe(p, l); 1632 return n.filter((g) => g.startTime <= m && p <= g.endTime).map((g) => g.value); 1633 } 1634 function u(p = rt, l = 0) { 1635 let m = Oe(p, l); 1636 return n.filter((g) => g.startTime <= m && p <= g.endTime); 1637 } 1638 function c(p) { 1639 return n.filter((l) => l.startTime === p); 1640 } 1641 function d() { 1642 n = []; 1643 } 1644 function f() { 1645 It.delete(r), It.size === 0 && Ot && (ft(Ot), Ot = void 0); 1646 } 1647 return { 1648 add: i, 1649 find: o, 1650 closeActive: s, 1651 findAll: a, 1652 findAllEntries: u, 1653 getEntries: c, 1654 reset: d, 1655 stop: f 1656 }; 1657} 1658function Xi(e, t) { 1659 return B(this, null, function* () { 1660 let n = `${oa}${H()}`, r = "test", i = e(n, t); 1661 try { 1662 return yield i.getAllAndSet(() => ({ 1663 value: r, 1664 expireDelay: 6e4 1665 })), (yield i.getAll()).includes(r); 1666 } catch (o) { 1667 return w.error(o), !1; 1668 } finally { 1669 try { 1670 yield i.delete(); 1671 } catch {} 1672 } 1673 }); 1674} 1675function Yi(e, t) { 1676 let n = O.cookieStore, r = new k(() => U(n, "change", (i) => { 1677 (i.changed.some((o) => o.name === e) || i.deleted.some((o) => o.name === e)) && r.notify(); 1678 }).stop); 1679 return { 1680 getAll() { 1681 return B(this, null, function* () { 1682 return (yield n.getAll(e)).map((i) => i.value); 1683 }); 1684 }, 1685 delete() { 1686 return n.delete({ 1687 name: e, 1688 domain: t.domain, 1689 path: "/", 1690 partitioned: t.partitioned 1691 }); 1692 }, 1693 getAllAndSet(i) { 1694 return B(this, null, function* () { 1695 let o = yield n.getAll(e), { value: s, expireDelay: a } = i(o.map((u) => u.value)); 1696 try { 1697 yield n.set({ 1698 name: e, 1699 value: s, 1700 expires: se() + a, 1701 path: "/", 1702 sameSite: t.crossSite ? "none" : "strict", 1703 domain: t.domain, 1704 secure: t.secure, 1705 partitioned: t.partitioned 1706 }); 1707 } catch (u) { 1708 if (!e.startsWith("dd_cookie_test_")) { 1709 let c = Je(e); 1710 Ye("Failed to set cookie using Cookie Store API", { 1711 "error.message": u.message, 1712 newValue: s, 1713 cookieOptions: v({}, t), 1714 cookies: o.map((d) => v({}, d)), 1715 cookieCount: o.length, 1716 documentCookies: c 1717 }); 1718 } 1719 } 1720 }); 1721 }, 1722 observable: r 1723 }; 1724} 1725function Ji(e, t) { 1726 let n = Je(e), r = new k(() => { 1727 let o = Ke(() => { 1728 i(Je(e)); 1729 }, sa); 1730 return () => { 1731 ft(o); 1732 }; 1733 }); 1734 function i(o) { 1735 String(o) !== String(n) && (n = o, r.notify()); 1736 } 1737 return { 1738 getAll() { 1739 return Promise.resolve(Je(e)); 1740 }, 1741 getAllAndSet(o) { 1742 return B(this, null, function* () { 1743 let { value: s, expireDelay: a } = o(Je(e)); 1744 qn(e, s, a, t), yield Promise.resolve(), i([s]); 1745 }); 1746 }, 1747 delete() { 1748 return B(this, null, function* () { 1749 Vi(e, t), yield Promise.resolve(), i([]); 1750 }); 1751 }, 1752 observable: r 1753 }; 1754} 1755function Qi() { 1756 let e = O.cookieStore; 1757 return !!(e && Ln(e, "change")); 1758} 1759function pl() { 1760 return { type: ne.MEMORY }; 1761} 1762function ml() { 1763 let e = O; 1764 e._DD_SESSION || (e[Vr] = {}); 1765 let t = e[Vr], n = new k(), r = t.onChange; 1766 return t.onChange = (i) => { 1767 r?.(i), n.notify(i); 1768 }, { 1769 setSessionState(i, o) { 1770 return B(this, null, function* () { 1771 let s = mt(i(t.state ?? {})); 1772 t.state = s, yield Promise.resolve(), t.onChange?.(s); 1773 }); 1774 }, 1775 sessionObservable: n 1776 }; 1777} 1778function gl(e) { 1779 return !!e && (e.indexOf("&") !== -1 || Fr.test(e)); 1780} 1781function Zi(e) { 1782 return e.created ? Number(e.created) : void 0; 1783} 1784function eo(e) { 1785 let t = e.expire && Number(e.expire), n = Zi(e); 1786 if (t && n) return Math.min(t, n + Ae); 1787} 1788function bt(e, t) { 1789 let n = { isExpired: "1" }; 1790 return t.trackAnonymousUser && e?.anonymousId && (n.anonymousId = e?.anonymousId), n; 1791} 1792function Gt(e) { 1793 return ge(e); 1794} 1795function Xn(e) { 1796 return e.isExpired !== void 0 || !yl(e); 1797} 1798function yl(e) { 1799 let t = eo(e); 1800 return t ? se() < t : !1; 1801} 1802function to(e) {
1803 e.expire = String(se() + ra); 1804} 1805function no(e) { 1806 return Vt(e).map(([t, n]) => t === "anonymousId" ? `aid=${n}` : `${t}=${n}`).join("&"); 1807} 1808function Bt(e) { 1809 let t = {}; 1810 return gl(e) && e.split("&").forEach((n) => { 1811 let r = Fr.exec(n); 1812 if (r !== null) { 1813 let [, i, o] = r; 1814 i === "aid" ? t.anonymousId = o : t[i] = o; 1815 } 1816 }), t; 1817} 1818function ro(e, t) { 1819 return Gt(e) ? (t.trackAnonymousUser && (e.anonymousId = H()), bt(e, t)) : e; 1820} 1821function Yn(e, t) { 1822 if (Gt(e)) return e; 1823 let n = e; 1824 return Xn(e) && (n = bt(e, t)), n.id || (n.id = H(), n.created = String(se())), t.trackAnonymousUser && !n.anonymousId && (n.anonymousId = H()), delete n.isExpired, to(n), n; 1825} 1826function hl(e) { 1827 return Xn(e) || Gt(e) || !e.id || to(e), e; 1828} 1829function bl(e) { 1830 return B(this, null, function* () { 1831 let t = Fc(e); 1832 if (t) { 1833 if (Qi() && (yield Xi(Yi, t))) return { 1834 type: ne.COOKIE, 1835 cookieOptions: t, 1836 cookieApi: 1 1837 }; 1838 if (yield Xi(Ji, t)) return { 1839 type: ne.COOKIE, 1840 cookieOptions: t, 1841 cookieApi: 0 1842 }; 1843 } 1844 }); 1845} 1846function vl(e, t) { 1847 let { cookieOptions: n, cookieApi: r } = e, i = new k(), o = !!t.trackAnonymousUser, s = io(n), a = Sl(r, n), u = !0; 1848 a.observable.subscribe(() => { 1849 a.getAll().then((d) => { 1850 i.notify(Jn(d, s)); 1851 }).catch((d) => K(/* @__PURE__ */ new Error(`Error while reading session cookies on change: ${d}`))); 1852 }); 1853 function c(d) { 1854 return a.getAllAndSet((f) => { 1855 let p = Jn(f, s); 1856 return u && ge(p) && (p = Jn(Je($r), s)), u = !1, { 1857 value: _l(d(p), n), 1858 expireDelay: o ? ia : Ae 1859 }; 1860 }); 1861 } 1862 return { 1863 setSessionState(d, f) { 1864 return B(this, null, function* () { 1865 typeof navigator < "u" && navigator.locks ? yield navigator.locks.request(it, () => c(d)).catch((p) => { 1866 if (!El(p)) throw p; 1867 }) : (Hr = (Hr ?? Promise.resolve()).then(() => c(d)), yield Hr); 1868 }); 1869 }, 1870 sessionObservable: i 1871 }; 1872} 1873function El(e) { 1874 return e instanceof Error ? e.name === "AbortError" || e.message.includes("no longer runnable") : !1; 1875} 1876function Sl(e, t) { 1877 return e === 1 ? Yi(it, t) : Ji(it, t); 1878} 1879function Jn(e, t) { 1880 let n; 1881 for (let r of e.slice().reverse()) if (n = Bt(r), n.c === t) break; 1882 return delete n?.c, n ?? {}; 1883} 1884function _l(e, t) { 1885 return no(ge(e) ? e : N(v({}, e), { c: io(t) })); 1886} 1887function io(e) { 1888 let t = e.domain ? e.domain.split(".").length - 1 : 0, n = 0; 1889 return n |= 0, n |= t << 1, n |= e.crossSite ? 1 : 0, n.toString(16); 1890} 1891function Cl() { 1892 try { 1893 let e = H(), t = `${aa}${e}`; 1894 localStorage.setItem(t, e); 1895 let n = localStorage.getItem(t); 1896 return localStorage.removeItem(t), e === n ? { type: ne.LOCAL_STORAGE } : void 0; 1897 } catch { 1898 return; 1899 } 1900} 1901function wl() { 1902 let e = new k((n) => U(window, "storage", (r) => { 1903 r.key === "_dd_s_v2" && r.storageArea === localStorage && n.notify(Bt(r.newValue)); 1904 }).stop), t = !0; 1905 return { 1906 setSessionState(n, r) { 1907 return B(this, null, function* () { 1908 let i = Bt(localStorage.getItem(it)); 1909 t && Gt(i) && (i = Bt(localStorage.getItem($r))), t = !1; 1910 let o = n(i); 1911 localStorage.setItem(it, no(o)), yield Promise.resolve(), e.notify(o); 1912 }); 1913 }, 1914 sessionObservable: e 1915 }; 1916} 1917function Tl(e) { 1918 return B(this, null, function* () { 1919 let t = Al(e.sessionPersistence); 1920 for (let n of t) { 1921 let r = yield Rl(n, e); 1922 if (r !== void 0) return r; 1923 } 1924 }); 1925} 1926function Al(e) { 1927 return e !== void 0 ? e : Ue ? [ne.MEMORY] : [ne.COOKIE]; 1928} 1929function Rl(e, t) { 1930 switch (e) { 1931 case ne.COOKIE: return bl(t); 1932 case ne.LOCAL_STORAGE: return Cl(); 1933 case ne.MEMORY: return pl(); 1934 default: 1935 w.error(`Invalid session persistence '${String(e)}'`); 1936 return; 1937 } 1938} 1939function kl(e, t) { 1940 switch (e.type) { 1941 case ne.COOKIE: return vl(e, t); 1942 case ne.LOCAL_STORAGE: return wl(); 1943 case ne.MEMORY: return ml(); 1944 } 1945} 1946function Ol(e, t) { 1947 return B(this, null, function* () { 1948 let n = ee(), r = new k(), i = new k(), o = yield Tl(e); 1949 if (!o) { 1950 w.warn("No storage available for session. We will not send any data."); 1951 return; 1952 } 1953 let s = kl(o, e), a = Me({ maxEntries: ca }); 1954 le.push(() => a.stop()); 1955 let u = !1, { throttled: c, cancel: d } = pt(() => { 1956 u = !1, s.setSessionState((y) => Yn(y, e), "expandOrRenewOnActivity").catch(K); 1957 }, 1e3); 1958 le.push(d); 1959 let f; 1960 le.push(() => Y(f)); 1961 let p = !1; 1962 le.push(() => { 1963 p = !0; 1964 }); 1965 let l = yield m().catch((y) => K(/* @__PURE__ */ new Error(`Error while resolving initial session state: ${y}`))); 1966 if (!l || p) return; 1967 for (; !t.isGranted();) if (X(), yield new Promise((y) => t.onGrantedOnce(y)), p || (l = yield m().catch(K), !l || p)) return; 1968 return a.add(b(l), xn().relative), h(l), g(), S(), gt("Session manager init metrics", { metrics: { duration: L(n, ee()) } }), $(); 1969 function m() { 1970 return B(this, null, function* () { 1971 let y = {}; 1972 return yield s.setSessionState((E) => (y = Yn(ro(E, e), e), y), "initialize"), y; 1973 }); 1974 } 1975 function g() { 1976 let y = s.sessionObservable.subscribe((E) => { 1977 h(E), M(E); 1978 }); 1979 le.push(() => y.unsubscribe()); 1980 } 1981 function h(y) { 1982 Y(f); 1983 let E = eo(y); 1984 E && (f = j(() => { 1985 s.setSessionState((C) => Xn(C) ? (t.isGranted() || delete C.anonymousId, bt(C, e)) : C, "expireOnTimeout").catch(K); 1986 }, E - se())); 1987 } 1988 function S() { 1989 t.observable.subscribe(() => { 1990 t.isGranted() ? (u = !1, s.setSessionState((y) => Yn(y, e), "expandOrRenewOnConsent").catch(K)) : X(); 1991 }), Ue || (xl(() => { 1992 t.isGranted() && c(); 1993 }), Nl(() => { 1994 u || s.setSessionState((y) => hl(y), "expandOnVisibility").catch(K); 1995 }), Ll(() => { 1996 s.setSessionState((y) => ro(y, e), "initializeOnResume").catch(K); 1997 })); 1998 } 1999 function $() { 2000 return { 2001 findSession: (y, E) => a.find(y, E), 2002 findTrackedSession: (y, { returnInactive: E = !1, maxAge: C = la } = {}) => { 2003 let P = a.find(y, { returnInactive: E });
2004 if (!(!P || P.id === "invalid" || !Ht(P.id, e.sessionSampleRate)) && !(se() - P.createdAt > C)) return P; 2005 }, 2006 renewObservable: r, 2007 expireObservable: i, 2008 expire: X, 2009 updateSessionState: (y) => { 2010 s.setSessionState((E) => v(v({}, E), y), "updateState").catch(K); 2011 } 2012 }; 2013 } 2014 function M(y) { 2015 let E = a.find(), C = E?.id !== void 0, P = y.id !== void 0, ae = C && P && E.id !== y.id; 2016 if (C && (!P || ae) && (u = !0, i.notify(), a.closeActive(ee())), P && (!C || ae)) { 2017 if (u) return; 2018 a.add(b(y), ee()), r.notify(); 2019 } else C && P && !ae && (E.isReplayForced = !!y.forcedReplay); 2020 } 2021 function X() { 2022 d(); 2023 let y = bt(a.find(), e); 2024 t.isGranted() || delete y.anonymousId, M(y), s.setSessionState((E) => (t.isGranted() || delete E.anonymousId, bt(E, e)), "expire").catch(K); 2025 } 2026 function b(y) { 2027 let E = Zi(y) ?? G(); 2028 return y.id ? { 2029 id: y.id, 2030 isReplayForced: !!y.forcedReplay, 2031 anonymousId: y.anonymousId, 2032 createdAt: E 2033 } : { 2034 id: "invalid", 2035 isReplayForced: !1, 2036 anonymousId: void 0, 2037 createdAt: E 2038 }; 2039 } 2040 }); 2041} 2042function Il() { 2043 let e = { 2044 id: H(), 2045 isReplayForced: !1, 2046 anonymousId: void 0, 2047 createdAt: G() 2048 }; 2049 return Promise.resolve({ 2050 findSession: () => e, 2051 findTrackedSession: () => e, 2052 renewObservable: new k(), 2053 expireObservable: new k(), 2054 expire: V, 2055 updateSessionState: (t) => { 2056 e = v(v({}, e), t); 2057 } 2058 }); 2059} 2060function xl(e) { 2061 let { stop: t } = Ie(window, [ 2062 "click", 2063 "touchstart", 2064 "keydown", 2065 "scroll" 2066 ], e, { 2067 capture: !0, 2068 passive: !0 2069 }); 2070 le.push(t); 2071} 2072function Nl(e) { 2073 let t = () => { 2074 document.visibilityState === "visible" && e(); 2075 }, { stop: n } = U(document, "visibilitychange", t); 2076 le.push(n); 2077 let r = Ke(t, ua); 2078 le.push(() => { 2079 ft(r); 2080 }); 2081} 2082function Ll(e) { 2083 let { stop: t } = U(window, "resume", e, { capture: !0 }); 2084 le.push(t); 2085} 2086function Qn(e, t, n = fa) { 2087 let r = 0, i = !1; 2088 return { isLimitReached() { 2089 if (r === 0 && j(() => { 2090 r = 0; 2091 }, 6e4), r += 1, r <= n || i) return i = !1, !1; 2092 if (r === n + 1) { 2093 i = !0; 2094 try { 2095 t(`Reached max number of ${e}s by minute: ${n}`); 2096 } finally { 2097 i = !1; 2098 } 2099 } 2100 return !0; 2101 } }; 2102} 2103function Ml() { 2104 return Dl() === 1; 2105} 2106function Dl() { 2107 return pa ?? (pa = Pl()); 2108} 2109function Pl(e = window) { 2110 let t = e.navigator.userAgent; 2111 return e.chrome || /HeadlessChrome/.test(t) ? 0 : e.navigator.vendor?.indexOf("Apple") === 0 || /safari/i.test(t) && !/chrome|android/i.test(t) ? 1 : 2; 2112} 2113function Zn(e, t) { 2114 return document.readyState === e || document.readyState === "complete" ? (t(), { stop: V }) : U(window, e === "complete" ? "load" : "DOMContentLoaded", t, { once: !0 }); 2115} 2116function Ul(e) { 2117 return new Promise((t) => { 2118 Zn(e, t); 2119 }); 2120} 2121function oo() { 2122 return qr || (qr = $l()), qr; 2123} 2124function $l() { 2125 return "XMLHttpRequest" in O ? new k((e) => { 2126 let { stop: t } = oe(XMLHttpRequest.prototype, "open", Vl), { stop: n } = oe(XMLHttpRequest.prototype, "send", (i) => { 2127 Fl(i, e); 2128 }, { computeHandlingStack: !0 }), { stop: r } = oe(XMLHttpRequest.prototype, "abort", Hl); 2129 return () => { 2130 t(), n(), r(); 2131 }; 2132 }) : new k(); 2133} 2134function Vl({ target: e, parameters: [t, n] }) { 2135 ln.set(e, { 2136 state: "open", 2137 method: String(t).toUpperCase(), 2138 url: In(String(n)) 2139 }); 2140} 2141function Fl({ target: e, parameters: [t], handlingStack: n }, r) { 2142 let i = ln.get(e); 2143 if (!i) return; 2144 let o = i; 2145 o.state = "start", o.startClocks = x(), o.isAborted = !1, o.xhr = e, o.handlingStack = n, o.requestBody = t; 2146 let s = !1, { stop: a } = oe(e, "onreadystatechange", () => { 2147 e.readyState === XMLHttpRequest.DONE && u(); 2148 }), u = () => { 2149 if (c(), a(), s) return; 2150 s = !0; 2151 let d = i; 2152 d.duration = L(o.startClocks.timeStamp, G()), d.status = e.status, typeof e.response == "string" && (d.responseBody = e.response), r.notify(N(v({}, d), { state: "complete" })); 2153 }, { stop: c } = U(e, "loadend", u); 2154 r.notify(o); 2155} 2156function Hl({ target: e }) { 2157 let t = ln.get(e); 2158 t && (t.isAborted = !0); 2159} 2160function ql(e) { 2161 return B(this, null, function* () { 2162 let t = e.getReader(), n = []; 2163 for (;;) { 2164 let r = yield t.read(); 2165 if (r.done) break; 2166 n.push(r.value); 2167 } 2168 return t.cancel().catch(V), bi(n); 2169 }); 2170} 2171function so({ responseBodyAction: e } = {}) { 2172 return e && Kr.push(e), Br || (Br = Gl()), Br; 2173} 2174function Gl() { 2175 return new k((e) => { 2176 if (!O.fetch) return; 2177 let { stop: t } = oe(O, "fetch", (n) => Bl(n, e), { computeHandlingStack: !0 }); 2178 return t; 2179 }); 2180} 2181function Bl({ parameters: e, onPostCall: t, handlingStack: n }, r) { 2182 let [i, o] = e, s = o?.method; 2183 s === void 0 && i instanceof Request && (s = i.method); 2184 let a = s !== void 0 ? String(s).toUpperCase() : "GET", u = i instanceof Request ? i.url : In(String(i)), c = { 2185 state: "start", 2186 init: o, 2187 input: i, 2188 method: a, 2189 startClocks: x(), 2190 url: u, 2191 handlingStack: n, 2192 isAbortedOnStart: i instanceof Request && i.signal?.aborted || o?.signal?.aborted || !1 2193 }; 2194 r.notify(c), e[0] = c.input, e[1] = c.init, t((d) => { 2195 Kl(r, d, c).catch(K); 2196 }); 2197} 2198function Kl(e, t, n) { 2199 return B(this, null, function* () { 2200 let r = n, i; 2201 try { 2202 i = yield t; 2203 } catch (o) { 2204 e.notify(N(v({}, r), { 2205 state: "resolve", 2206 status: 0, 2207 isAborted: r.init?.signal?.aborted || o instanceof DOMException && o.code === DOMException.ABORT_ERR, 2208 error: o 2209 })); 2210 return; 2211 } 2212 if (r.response = i, r.status = i.status, r.responseType = i.type, r.isAborted = !1, Kr.reduce((o, s) => Math.max(o, s(r)), 0) === 1) { 2213 let o = tc(i); 2214 if (o?.body) try { 2215 let s = yield ql(o.body); 2216 r.responseBody = new TextDecoder().decode(s); 2217 } catch {} 2218 } 2219 e.notify(N(v({}, r), { state: "resolve" })); 2220 }); 2221} 2222function jl(e) { 2223 return typeof e.WebSocket == "function"; 2224} 2225function Wl() { 2226 return jr || (jr = zl()), jr; 2227} 2228function zl() { 2229 return new k((e) => { 2230 if (!jl(O)) return; 2231 let { stop: t } = Gc(O, "WebSocket", ({ parameters: r, onPostCall: i }) => { 2232 let o = Array.isArray(r[1]) ? [].concat(r[1]) : r[1], s = x(); 2233 i((a) => { 2234 e.notify({ 2235 state: "connecting", 2236 instance: a, 2237 url: a.url, 2238 protocols: o, 2239 startClocks: s 2240 }), Xl(a, e); 2241 }); 2242 }), { stop: n } = oe(O.WebSocket.prototype, "send", ({ target: r, parameters: [i], onPostCall: o }) => { 2243 let s = ao(i), a = r.bufferedAmount; 2244 o(() => { 2245 e.notify({ 2246 state: "message-out", 2247 instance: r, 2248 size: s, 2249 bufferedAmountPreSend: a, 2250 at: x() 2251 }); 2252 }); 2253 }); 2254 return () => { 2255 t(), n(); 2256 }; 2257 }); 2258} 2259function Xl(e, t) { 2260 let { stop: n } = U(e, "open", () => { 2261 t.notify({ 2262 state: "open", 2263 instance: e, 2264 openClocks: x(), 2265 protocol: e.protocol || "" 2266 }), n(); 2267 }), { stop: r } = U(e, "message", (o) => { 2268 t.notify({ 2269 state: "message-in", 2270 instance: e, 2271 size: ao(o.data), 2272 at: x() 2273 }); 2274 }), { stop: i } = U(e, "close", (o) => { 2275 t.notify({ 2276 state: "closed", 2277 instance: e, 2278 code: o.code, 2279 reason: o.reason, 2280 wasClean: o.wasClean, 2281 at: x() 2282 }), r(), i(); 2283 }); 2284} 2285function ao(e) { 2286 return typeof e == "string" ? Mn(e) : e instanceof ArrayBuffer || ArrayBuffer.isView(e) ? e.byteLength : typeof Blob < "u" && e instanceof Blob ? e.size : 0; 2287} 2288function uo(e, t) { 2289 if (window.requestIdleCallback && window.cancelIdleCallback) { 2290 let n = window.requestIdleCallback(R(e), t); 2291 return () => window.cancelIdleCallback(n); 2292 } 2293 return Yl(e); 2294} 2295function Yl(e) { 2296 let t = se(), n = j(() => { 2297 e({ 2298 didTimeout: !1, 2299 timeRemaining: () => Math.max(0, 50 - (se() - t)) 2300 }); 2301 }, 0); 2302 return () => Y(n); 2303} 2304function Jl() { 2305 let e = []; 2306 function t(r) { 2307 let i; 2308 if (!r || r.didTimeout) { 2309 let o = performance.now(); 2310 i = () => 30 - (performance.now() - o); 2311 } else i = r.timeRemaining.bind(r); 2312 for (; i() > 0 && e.length;) e.shift()(); 2313 e.length && n(); 2314 } 2315 function n() { 2316 uo(t, { timeout: ma }); 2317 } 2318 return { 2319 push(r) { 2320 e.push(r) === 1 && n(); 2321 }, 2322 stop() { 2323 e.length = 0; 2324 } 2325 }; 2326} 2327function Ql(e) { 2328 return hi(...e.map((t) => (dn[t] || (dn[t] = Zl(t)), dn[t]))); 2329} 2330function Zl(e) { 2331 return new k((t) => { 2332 let n = Z[e]; 2333 return Z[e] = (...r) => { 2334 n.apply(console, r); 2335 let i = ce("console error"); 2336 te(() => { 2337 t.notify(ed(r, e, i)); 2338 }); 2339 }, () => { 2340 Z[e] = n; 2341 }; 2342 }); 2343} 2344function ed(e, t, n) { 2345 let r = e.map((i) => td(i)).join(" "); 2346 if (t === nn.error) { 2347 let i = zn({ 2348 originalError: e.find(ye), 2349 handlingStack: n, 2350 startClocks: x(), 2351 source: we.CONSOLE, 2352 handling: "handled", 2353 nonErrorPrefix: "Provided", 2354 useFallbackStack: !1 2355 }); 2356 return i.message = r, { 2357 api: t, 2358 message: r, 2359 handlingStack: n, 2360 error: i 2361 }; 2362 } 2363 return { 2364 api: t, 2365 message: r, 2366 error: void 0, 2367 handlingStack: n 2368 }; 2369} 2370function td(e) { 2371 return typeof e == "string" ? A(e) : ye(e) ? ki(Ne(e)) : _e(A(e), void 0, 2); 2372}
2373function nd(e) { 2374 let t = ct(e) === "object"; 2375 return t || w.error("Unsupported context:", e), t; 2376} 2377function er(e, t, n) { 2378 let r = v({}, e); 2379 for (let [i, { required: o, type: s }] of Object.entries(t)) s === "string" && !co(r[i]) && (r[i] = String(r[i])), o && co(r[i]) && w.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`); 2380 return r; 2381} 2382function co(e) { 2383 return e == null || e === ""; 2384} 2385function Kt(e = "", { propertiesConfig: t = {} } = {}) { 2386 let n = {}, r = new k(), i = { 2387 getContext: () => Pt(n), 2388 setContext: (o) => { 2389 nd(o) ? n = A(er(o, t, e)) : i.clearContext(), r.notify(); 2390 }, 2391 setContextProperty: (o, s) => { 2392 n = A(er(N(v({}, n), { [o]: s }), t, e)), r.notify(); 2393 }, 2394 removeContextProperty: (o) => { 2395 delete n[o], er(n, t, e), r.notify(); 2396 }, 2397 clearContext: () => { 2398 n = {}, r.notify(); 2399 }, 2400 changeObservable: r 2401 }; 2402 return i; 2403} 2404function J(e, t, n, r) { 2405 return R((...i) => (r && F({ feature: r }), e()[t][n](...i))); 2406} 2407function tr(e, t, n) { 2408 e.changeObservable.subscribe(() => { 2409 let r = e.getContext(); 2410 n.notify((i) => i[t].setContext(r)); 2411 }); 2412} 2413function nr(e, t, n) { 2414 if (typeof window > "u" || typeof localStorage > "u") return; 2415 let r = rd(t, n); 2416 ya.push(U(window, "storage", ({ key: u }) => { 2417 r === u && o(); 2418 })), e.changeObservable.subscribe(s); 2419 let i = pe(a(), e.getContext()); 2420 ge(i) || e.setContext(i); 2421 function o() { 2422 e.setContext(a()); 2423 } 2424 function s() { 2425 localStorage.setItem(r, JSON.stringify(e.getContext())); 2426 } 2427 function a() { 2428 let u = localStorage.getItem(r); 2429 return u ? je(u) ?? {} : {}; 2430 } 2431} 2432function rd(e, t) { 2433 return `${ga}_${e}_${t}`; 2434} 2435function id(e, t, n) { 2436 let r = lo(); 2437 return t.storeContextsAcrossPages && nr(r, n, 4), e.register(() => { 2438 let i = r.getContext(); 2439 return ge(i) || !i.id ? Q : { account: i }; 2440 }), r; 2441} 2442function lo() { 2443 return Kt("account", { propertiesConfig: { 2444 id: { 2445 type: "string", 2446 required: !0 2447 }, 2448 name: { type: "string" } 2449 } }); 2450} 2451function od(e) { 2452 let t = sd(); 2453 e.register(() => ({ tab: { id: t } })); 2454} 2455function sd() { 2456 return zr || (zr = ad() ?? H()), zr; 2457} 2458function ad() { 2459 try { 2460 let e = sessionStorage.getItem(Wr); 2461 if (e) return e; 2462 let t = H(); 2463 return sessionStorage.setItem(Wr, t), t; 2464 } catch { 2465 return; 2466 } 2467} 2468function ud(e, t, n, r) { 2469 let i = fo(); 2470 return t.storeContextsAcrossPages && nr(i, n, 2), e.register(() => { 2471 let o = i.getContext(); 2472 return r ? { context: o } : o; 2473 }), i; 2474} 2475function fo() { 2476 return Kt("global context"); 2477} 2478function cd(e, t, n, r) { 2479 let i = po(); 2480 return t.storeContextsAcrossPages && nr(i, r, 1), e.register(({ eventType: o, startTime: s }) => { 2481 let a = i.getContext(), u = n.findTrackedSession(s); 2482 return u?.anonymousId && !a.anonymous_id && t.trackAnonymousUser && (a.anonymous_id = u.anonymousId), ge(a) ? Q : { 2483 type: o, 2484 usr: a 2485 }; 2486 }), i; 2487} 2488function po() { 2489 return Kt("user", { propertiesConfig: { 2490 id: { type: "string" }, 2491 name: { type: "string" }, 2492 email: { type: "string" } 2493 } }); 2494} 2495function mo() { 2496 return Ue ? !1 : !!(O._DATADOG_SYNTHETICS_INJECTS_RUM || ht(va)); 2497} 2498function go() { 2499 let e = dd(); 2500 return fd(e) ? e : void 0; 2501} 2502function ld() { 2503 return !!go(); 2504} 2505function dd() { 2506 let e = O._DATADOG_SYNTHETICS_RUM_CONTEXT; 2507 if (e) return e; 2508 let t = ht(Ea); 2509 return t ? je(decodeURIComponent(t)) : { 2510 test_id: window._DATADOG_SYNTHETICS_PUBLIC_ID || ht(ha), 2511 result_id: window._DATADOG_SYNTHETICS_RESULT_ID || ht(ba) 2512 }; 2513} 2514function fd(e) { 2515 return typeof e == "object" && e !== null && typeof e.test_id == "string" && typeof e.result_id == "string"; 2516} 2517function pd() { 2518 let e = new rn(Sa, (r) => { 2519 Ye("Early data collection dropped data on unbuffer", { count: r }); 2520 }), t = []; 2521 function n(r, i) { 2522 t.push(i.subscribe((o) => { 2523 e.notify({ 2524 type: r, 2525 data: o 2526 }); 2527 })); 2528 } 2529 return n(0, tl()), n(1, so()), n(2, oo()), n(3, Ql(Object.values(nn))), { 2530 observable: e, 2531 stop: () => t.forEach((r) => r.unsubscribe()) 2532 }; 2533} 2534function md() { 2535 try { 2536 return new Intl.DateTimeFormat().resolvedOptions().timeZone; 2537 } catch { 2538 return; 2539 } 2540} 2541function vt(e, t) { 2542 return +e.toFixed(t); 2543} 2544function rr(e) { 2545 return typeof e == "number"; 2546} 2547function gd(e, t, n) { 2548 e.register(({ startTime: r }) => { 2549 let i = t.findTrackedSession(r); 2550 return i ? v({ 2551 session: { id: i.id }, 2552 anonymous_id: i.anonymousId 2553 }, n) : Q; 2554 }); 2555} 2556function yo(e, t) { 2557 t.lastIndex = 0; 2558 let n = t.exec(e); 2559 if (!n) return; 2560 let [r, i] = n; 2561 return i || r; 2562} 2563function yd(e) { 2564 let t = [], n = 0, r, i = { 2565 quote: void 0, 2566 escapeSequence: void 0 2567 }, o = ""; 2568 for (let s of e) { 2569 if (r = Yr[n].find((a) => Oa[a](s, i)), !r) return []; 2570 if (i.escapeSequence !== void 0 && r !== 12) { 2571 if (!hd(i.escapeSequence)) return []; 2572 o += bd(i.escapeSequence), i.escapeSequence = void 0; 2573 } 2574 Ia.includes(r) ? o += s : xa.includes(r) && o !== "" ? (t.push(o), o = "") : r === 12 ? i.escapeSequence = i.escapeSequence ? `${i.escapeSequence}${s}` : s : r === 8 ? i.quote = s : r === 9 && (i.quote = void 0), n = r; 2575 } 2576 return Yr[n].includes(1) ? (o !== "" && t.push(o), t) : []; 2577} 2578function hd(e) { 2579 return `"'/\\bfnrt`.includes(e) || e.startsWith("u") && e.length === 5; 2580} 2581function bd(e) { 2582 return e.startsWith("u") ? String.fromCharCode(parseInt(e.slice(1), 16)) : Na[e]; 2583} 2584function vd(e) { 2585 return `${La}${e}`; 2586} 2587function Ed(e) { 2588 if (typeof e != "object" || e === null) return !1;
2589 let t = "version" in e && e.version === 2, n = "config" in e && typeof e.config == "object" && e.config !== null; 2590 return t && n; 2591} 2592function Sd({ remoteConfigurationId: e }) { 2593 let t = vd(e); 2594 return { 2595 read() { 2596 let n; 2597 try { 2598 n = localStorage.getItem(t); 2599 } catch { 2600 return { status: "error" }; 2601 } 2602 if (n === null) return { status: "miss" }; 2603 let r = je(n); 2604 return r === void 0 ? (this.remove(), { status: "error" }) : Ed(r) ? { 2605 status: "hit", 2606 config: r.config 2607 } : (this.remove(), { status: "error" }); 2608 }, 2609 remove() { 2610 try { 2611 localStorage.removeItem(t); 2612 } catch {} 2613 }, 2614 write(n) { 2615 let r = { 2616 version: 2, 2617 config: n, 2618 fetchedAt: G() 2619 }; 2620 try { 2621 localStorage.setItem(t, JSON.stringify(r)); 2622 } catch {} 2623 } 2624 }; 2625} 2626function _d(e, t) { 2627 return B(this, null, function* () { 2628 let n, r = bo(), i = yield Eo(e); 2629 return i.ok ? (r.increment("fetch", "success"), n = ho(e, i.value, t, r)) : (r.increment("fetch", "failure"), w.error(i.error)), gt(Rt.REMOTE_CONFIGURATION_METRIC_NAME, { metrics: r.get() }), n; 2630 }); 2631} 2632function ho(e, t, n, r) { 2633 let i = v({}, e); 2634 if (t.rum) { 2635 let l = t.rum; 2636 Pa.forEach((m) => { 2637 m in l && (i[m] = o(l[m])); 2638 }), Object.keys(n).forEach((m) => { 2639 l[m] !== void 0 && s(n[m], l[m]); 2640 }); 2641 } 2642 return t.profiling?.sampleRate !== void 0 && (i.profilingSampleRate = t.profiling.sampleRate), i; 2643 function o(l) { 2644 if (Array.isArray(l)) return l.map(o); 2645 if (ue(l)) { 2646 if (Cd(l)) { 2647 let m = l.rcSerializedType; 2648 switch (m) { 2649 case "string": return l.value; 2650 case "regex": return vo(l.value); 2651 case "dynamic": return a(l); 2652 default: 2653 w.error(`Unsupported remote configuration: "rcSerializedType": "${m}"`); 2654 return; 2655 } 2656 } 2657 return Ai(l, o); 2658 } 2659 return l; 2660 } 2661 function s(l, m) { 2662 m.forEach(({ key: g, value: h }) => { 2663 l.setContextProperty(g, o(h)); 2664 }); 2665 } 2666 function a(l) { 2667 let m = l.strategy, g; 2668 switch (m) { 2669 case "cookie": 2670 g = u(l); 2671 break; 2672 case "dom": 2673 g = d(l); 2674 break; 2675 case "js": 2676 g = p(l); 2677 break; 2678 case "localStorage": 2679 g = c(l); 2680 break; 2681 default: 2682 w.error(`Unsupported remote configuration: "strategy": "${m}"`); 2683 return; 2684 } 2685 let h = l.extractor; 2686 return h !== void 0 && typeof g == "string" ? wd(h, g) : g; 2687 } 2688 function u({ name: l }) { 2689 let m = qt(l); 2690 return r.increment("cookie", m !== void 0 ? "success" : "missing"), m; 2691 } 2692 function c({ key: l }) { 2693 let m; 2694 try { 2695 m = localStorage.getItem(l); 2696 } catch { 2697 r.increment("localStorage", "failure"); 2698 return; 2699 } 2700 return r.increment("localStorage", m !== null ? "success" : "missing"), m ?? void 0; 2701 } 2702 function d({ selector: l, attribute: m }) { 2703 let g; 2704 try { 2705 g = document.querySelector(l); 2706 } catch { 2707 w.error(`Invalid selector in the remote configuration: '${l}'`), r.increment("dom", "failure"); 2708 return; 2709 } 2710 if (!g) { 2711 r.increment("dom", "missing"); 2712 return; 2713 } 2714 if (f(g, m)) { 2715 w.error(`Forbidden element selected by the remote configuration: '${l}'`), r.increment("dom", "failure"); 2716 return; 2717 } 2718 let h = m !== void 0 ? g.getAttribute(m) : g.textContent; 2719 if (h === null) { 2720 r.increment("dom", "missing"); 2721 return; 2722 } 2723 return r.increment("dom", "success"), h; 2724 } 2725 function f(l, m) { 2726 return l.getAttribute("type") === "password" && m === "value"; 2727 } 2728 function p({ path: l }) { 2729 let m = window, g = yd(l); 2730 if (g.length === 0) { 2731 w.error(`Invalid JSON path in the remote configuration: '${l}'`), r.increment("js", "failure"); 2732 return; 2733 } 2734 for (let h of g) { 2735 if (!(h in m)) { 2736 r.increment("js", "missing"); 2737 return; 2738 } 2739 try { 2740 m = m[h]; 2741 } catch (S) { 2742 w.error(`Error accessing: '${l}'`, S), r.increment("js", "failure"); 2743 return; 2744 } 2745 } 2746 return r.increment("js", "success"), m; 2747 } 2748} 2749function bo() { 2750 let e = { fetch: {} }; 2751 return { 2752 get: () => e, 2753 increment: (t, n) => { 2754 e[t] || (e[t] = {}), e[t][n] || (e[t][n] = 0), e[t][n] = e[t][n] + 1; 2755 } 2756 }; 2757} 2758function Cd(e) { 2759 return "rcSerializedType" in e; 2760} 2761function vo(e) { 2762 try { 2763 return new RegExp(e); 2764 } catch { 2765 w.error(`Invalid regex in the remote configuration: '${e}'`); 2766 } 2767} 2768function wd(e, t) { 2769 let n = vo(e.value); 2770 if (n !== void 0) return yo(t, n); 2771} 2772function Eo(e) { 2773 return B(this, null, function* () { 2774 let t; 2775 try { 2776 t = yield Dn(Td(e)); 2777 } catch { 2778 t = void 0; 2779 } 2780 if (!t?.ok) return { 2781 ok: !1, 2782 error: /* @__PURE__ */ new Error("Error fetching the remote configuration.") 2783 }; 2784 let n = yield t.json(); 2785 return n.rum || n.profiling ? { 2786 ok: !0, 2787 value: n 2788 } : { 2789 ok: !1, 2790 error: /* @__PURE__ */ new Error("No remote configuration for RUM.") 2791 }; 2792 }); 2793} 2794function Et(e) { 2795 return e.remoteConfiguration?.id ?? e.remoteConfigurationId; 2796} 2797function Td(e) { 2798 if (e.remoteConfigurationProxy) return e.remoteConfigurationProxy; 2799 let t = Et(e); 2800 return Nn({ 2801 site: e.site, 2802 path: `/${Da}/${encodeURIComponent(t)}.json`, 2803 subdomain: "sdk-configuration" 2804 }); 2805} 2806function Ad(e, t, n) { 2807 Eo(e).then((r) => { 2808 r.ok ? (n.increment("fetch", "success"), t.write(r.value)) : (n.increment("fetch", "failure"), w.error(r.error)); 2809 }).catch(K).finally(() => { 2810 gt(Rt.REMOTE_CONFIGURATION_METRIC_NAME, { metrics: n.get() }); 2811 }); 2812} 2813function Rd(e, t) { 2814 let n = Sd({ remoteConfigurationId: Et(e) }), r = bo(), i = n.read(); 2815 if (r.increment("cache", Ma[i.status]), Ad(e, n, r), i.status === "hit") return ho(e, i.config, t, r); 2816 if (!e.remoteConfiguration?.required) return e; 2817} 2818function kd(e, t) { 2819 switch (t.type) { 2820 case "string": return `"${e}" must be a non-empty string`; 2821 case "number": return t.min !== void 0 && t.max !== void 0 ? `"${e}" must be a number between ${t.min} and ${t.max}` : t.min !== void 0 ? `"${e}" must be a number greater than or equal to ${t.min}` : t.max !== void 0 ? `"${e}" must be a number less than or equal to ${t.max}` : `"${e}" must be a finite number`; 2822 case "percentage": return `"${e}" must be a number between 0 and 100`; 2823 case "boolean": return `"${e}" must be a boolean`; 2824 case "site": return `"${e}" must be a valid Datadog site. ${tn} ${en}/getting_started/site/.`; 2825 case "match-option": return `"${e}" must be a string, RegExp, or function`; 2826 case "enum": return `"${e}" must be one of: "${or(t.values).join("\", \"")}"`; 2827 case "union": return `"${e}" does not match any expected type`; 2828 case "schema": return `"${e}" is not a valid object`; 2829 case "function": return `"${e}" must be a function`; 2830 } 2831} 2832function Od(e, t, n) { 2833 if (!e || typeof e != "object") { 2834 n.error("Configuration must be an object"); 2835 return; 2836 } 2837 return So(t, e, n); 2838} 2839function So(e, t, n) { 2840 let r = {}; 2841 for (let [i, o] of Object.entries(e)) { 2842 let s = t[i], a = o.multiple ? Id(o, s, n) : ir(o, s, n); 2843 if (a === void 0) { 2844 if (s != null && s !== "") { 2845 if (n.error(kd(i, o)), o.required || o.strict !== !1) return; 2846 } else if (o.required) { 2847 n.error(`"${i}" is required`); 2848 return; 2849 } 2850 r[i] = "default" in o ? Pt(o.default) : void 0; 2851 } else r[i] = a; 2852 } 2853 return r; 2854} 2855function Id(e, t, n) { 2856 if (t == null) return; 2857 if (e.type === "enum" && e.allowAll && t === "all") return or(e.values).slice(); 2858 let r = Array.isArray(t) ? t : [t], i = []; 2859 for (let o of r) { 2860 let s = ir(e, o, n); 2861 if (s === void 0) { 2862 if (e.strict !== !1) return; 2863 } else i.push(s); 2864 } 2865 if (!(e.strict === !1 && i.length === 0 && r.length > 0)) return i; 2866} 2867function ir(e, t, n) { 2868 if (e.type === "schema") return typeof t != "object" || t === null ? void 0 : So(e.schema, t, n); 2869 if (e.type === "union") { 2870 if (t == null) return; 2871 for (let r of e.variants) { 2872 let i = ir(r, t, n); 2873 if (i !== void 0) return i; 2874 } 2875 return; 2876 } 2877 if (t != null) switch (e.type) { 2878 case "function": return typeof t == "function" ? t : void 0; 2879 case "string": return typeof t == "string" && t.length > 0 ? t : void 0; 2880 case "number": return typeof t == "number" && Number.isFinite(t) && (e.min === void 0 || t >= e.min) && (e.max === void 0 || t <= e.max) ? t : void 0; 2881 case "percentage": return Vu(t) ? t : void 0; 2882 case "boolean": return typeof t == "boolean" ? t : e.strict === !1 ? !!t : void 0; 2883 case "site": return typeof t != "string" || !Ua.test(t) ? void 0 : t; 2884 case "match-option": return ke(t) ? t : void 0; 2885 case "enum": return typeof t == "string" && or(e.values).includes(t) ? t : void 0; 2886 } 2887} 2888function or(e) { 2889 return xd(e) ? e : Object.values(e); 2890} 2891function xd(e) { 2892 return Array.isArray(e); 2893} 2894function Nd(e) { 2895 let t = Od(e, $a, w); 2896 if (!t) return;
2897 let n = t.allowedTracingUrls.map(_o).filter(Boolean); 2898 if (n.length > 0 && !t.service) { 2899 w.error("Service needs to be configured when tracing is enabled"); 2900 return; 2901 } 2902 let r = Un(At.SESSION_REPLAY_RECORD_CANVAS) ? t.sessionReplayCanvasRecording : void 0; 2903 return N(v({}, t), { 2904 sessionReplayCanvasRecording: r, 2905 allowedTracingUrls: n, 2906 beforeSend: t.beforeSend ? Ki(t.beforeSend, "beforeSend threw an error:") : void 0, 2907 rulePsr: rr(e.traceSampleRate) ? e.traceSampleRate / 100 : void 0, 2908 trackResourceHeaders: Dd(e), 2909 allowedGraphQlUrls: Md(e), 2910 remoteConfigurationId: Et(e) 2911 }); 2912} 2913function Ld(e) { 2914 let t = /* @__PURE__ */ new Set(); 2915 return Le(e.allowedTracingUrls) && e.allowedTracingUrls.forEach((n) => { 2916 _o(n)?.propagatorTypes.forEach((r) => t.add(r)); 2917 }), Array.from(t); 2918} 2919function _o(e) { 2920 if (ke(e)) return { 2921 match: e, 2922 propagatorTypes: mn 2923 }; 2924 if (ue(e) && ke(e.match) && (e.propagatorTypes === null || e.propagatorTypes === void 0 || Array.isArray(e.propagatorTypes))) return { 2925 match: e.match, 2926 propagatorTypes: e.propagatorTypes || mn 2927 }; 2928} 2929function Md(e) { 2930 if (!e.allowedGraphQlUrls) return []; 2931 if (!Array.isArray(e.allowedGraphQlUrls)) return w.warn("allowedGraphQlUrls should be an array"), []; 2932 let t = [];
2933 return e.allowedGraphQlUrls.forEach((n) => { 2934 ke(n) ? t.push({ 2935 match: n, 2936 trackPayload: !1, 2937 trackResponseErrors: !1 2938 }) : ue(n) && ke(n.match) && t.push({ 2939 match: n.match, 2940 trackPayload: !!n.trackPayload, 2941 trackResponseErrors: !!n.trackResponseErrors 2942 }); 2943 }), t; 2944} 2945function Dd(e) { 2946 let t = e.trackResourceHeaders; 2947 if (t === void 0 || t === !1) return []; 2948 if (t === !0) return gn.map((r) => ({ name: r })); 2949 if (!Array.isArray(t)) return w.warn("trackResourceHeaders should be true or an array of MatchHeader"), []; 2950 if (t.length === 0) return w.warn("trackResourceHeaders is an empty array, no headers will be captured"), []; 2951 let n = []; 2952 return t.forEach((r, i) => { 2953 if (!ue(r)) { 2954 w.warn(`trackResourceHeaders[${i}] should be a MatchHeader object`); 2955 return; 2956 } 2957 if (r.name !== void 0 && !ke(r.name)) { 2958 w.warn(`trackResourceHeaders[${i}].name should be a MatchOption`); 2959 return; 2960 } 2961 if (r.url !== void 0 && !ke(r.url)) { 2962 w.warn(`trackResourceHeaders[${i}].url should be a MatchOption`); 2963 return; 2964 } 2965 if (r.extractor !== void 0 && !(r.extractor instanceof RegExp)) { 2966 w.warn(`trackResourceHeaders[${i}].extractor should be a RegExp`); 2967 return; 2968 } 2969 if (r.location !== void 0 && (typeof r.location != "string" || !Va.includes(r.location))) { 2970 w.warn(`trackResourceHeaders[${i}].location should be 'request', 'response', or 'any'`); 2971 return; 2972 } 2973 let o = r, { name: s } = o, a = Dt(o, ["name"]); 2974 n.push(v(v({}, a), s !== void 0 ? { name: typeof s == "string" ? s.toLowerCase() : s } : {})); 2975 }), n; 2976} 2977function Pd(e) { 2978 return Le(e) && e.some((t) => ue(t) && t.trackPayload); 2979} 2980function Ud(e) { 2981 return Le(e) && e.some((t) => ue(t) && t.trackResponseErrors); 2982} 2983function $d(e) { 2984 if (e === !0) return "default_headers"; 2985 if (Array.isArray(e)) return "custom"; 2986} 2987function Vd(e) { 2988 let t = Lc(e); 2989 return v({ 2990 session_replay_sample_rate: e.sessionReplaySampleRate, 2991 start_session_replay_recording_manually: e.startSessionReplayRecordingManually, 2992 trace_sample_rate: e.traceSampleRate, 2993 trace_context_injection: e.traceContextInjection, 2994 propagate_trace_baggage: e.propagateTraceBaggage, 2995 action_name_attribute: e.actionNameAttribute, 2996 use_allowed_tracing_urls: Le(e.allowedTracingUrls), 2997 use_allowed_graph_ql_urls: Le(e.allowedGraphQlUrls), 2998 use_track_graph_ql_payload: Pd(e.allowedGraphQlUrls), 2999 use_track_graph_ql_response_errors: Ud(e.allowedGraphQlUrls), 3000 selected_tracing_propagators: Ld(e), 3001 default_privacy_level: e.defaultPrivacyLevel, 3002 enable_privacy_for_action_name: e.enablePrivacyForActionName, 3003 use_excluded_activity_urls: Le(e.excludedActivityUrls), 3004 use_worker_url: !!e.workerUrl, 3005 compress_intake_requests: e.compressIntakeRequests, 3006 track_views_manually: e.trackViewsManually, 3007 track_user_interactions: e.trackUserInteractions, 3008 track_resources: e.trackResources, 3009 track_long_task: e.trackLongTasks, 3010 plugins: e.plugins?.map((n) => v({ name: n.name }, n.getConfigurationTelemetry?.())), 3011 track_feature_flags_for_events: e.trackFeatureFlagsForEvents, 3012 remote_configuration_id: Et(e), 3013 profiling_sample_rate: e.profilingSampleRate, 3014 use_remote_configuration_proxy: !!e.remoteConfigurationProxy, 3015 track_resource_headers: $d(e.trackResourceHeaders), 3016 beta_enable_view_updates: e.betaEnableViewUpdates, 3017 beta_track_web_sockets: e.betaTrackWebSockets 3018 }, t); 3019} 3020function Fd() { 3021 return { 3022 assemble: Ui(), 3023 assembleTelemetry: Ui() 3024 }; 3025} 3026function Hd() { 3027 let e = Co(); 3028 return new k((t) => { 3029 let n = new e(R((r) => t.notify(r))); 3030 return n.observe(document, { 3031 attributes: !0, 3032 characterData: !0, 3033 childList: !0, 3034 subtree: !0 3035 }), () => n.disconnect(); 3036 }); 3037} 3038function Co() { 3039 let e, t = window; 3040 return t.Zone && (e = me(t, "MutationObserver"), t.MutationObserver && e === t.MutationObserver) && (e = me(new t.MutationObserver(V), "originalInstance")?.constructor), e || (e = t.MutationObserver), e; 3041} 3042function qd(e) { 3043 let t = Me({ expireDelay: Fa }); 3044 e.subscribe(1, (r) => { 3045 t.add(n(r), r.startClocks.relative); 3046 }), e.subscribe(6, ({ endClocks: r }) => { 3047 t.closeActive(r.relative); 3048 }), e.subscribe(3, (r) => { 3049 let i = t.find(r.startClocks.relative);
3050 i && (r.name && (i.name = r.name), r.context && (i.context = r.context), i.sessionIsActive = r.sessionIsActive); 3051 }), e.subscribe(11, () => { 3052 t.reset(); 3053 }); 3054 function n(r) { 3055 return { 3056 service: r.service, 3057 version: r.version, 3058 context: r.context, 3059 id: r.id, 3060 name: r.name, 3061 startClocks: r.startClocks 3062 }; 3063 } 3064 return { 3065 findView: (r, i) => t.find(r, i), 3066 stop: () => { 3067 t.stop(); 3068 } 3069 }; 3070} 3071function Gd(e) { 3072 let t = e.name; 3073 if (!Gu(t)) return z.OTHER; 3074 let n = Bu(t); 3075 for (let [r, i] of Ha) if (i(e.initiatorType, n)) return r; 3076 return z.OTHER; 3077} 3078function wo(...e) { 3079 for (let t = 1; t < e.length; t += 1) if (e[t - 1] > e[t]) return !1; 3080 return !0; 3081} 3082function Bd(e) { 3083 return e.initiatorType === "xmlhttprequest" || e.initiatorType === "fetch"; 3084} 3085function Kd(e) { 3086 let { duration: t, startTime: n, responseEnd: r } = e; 3087 return e.initiatorType === "navigation" || t === 0 && n < r ? L(n, r) : t; 3088} 3089function jd(e) { 3090 if (!zd(e)) return; 3091 let { startTime: t, fetchStart: n, workerStart: r, redirectStart: i, redirectEnd: o, domainLookupStart: s, domainLookupEnd: a, connectStart: u, secureConnectionStart: c, connectEnd: d, requestStart: f, responseStart: p, responseEnd: l } = e, m = { 3092 download: De(t, p, l), 3093 first_byte: De(t, f, p) 3094 }; 3095 return 0 < r && r < n && (m.worker = De(t, r, n)), n < d && (m.connect = De(t, u, d), u <= c && c <= d && (m.ssl = De(t, c, d))), n < a && (m.dns = De(t, s, a)), t < o && (m.redirect = De(t, i, o)), m; 3096} 3097function Wd(e) { 3098 return e.duration >= 0; 3099} 3100function zd(e) { 3101 let t = wo(e.startTime, e.fetchStart, e.domainLookupStart, e.domainLookupEnd, e.connectStart, e.connectEnd, e.requestStart, e.responseStart, e.responseEnd), n = Xd(e) ? wo(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) : !0; 3102 return t && n; 3103} 3104function Xd(e) { 3105 return e.redirectEnd > e.startTime; 3106} 3107function De(e, t, n) { 3108 if (e <= t && t <= n) return { 3109 duration: _(L(t, n)), 3110 start: _(L(e, t)) 3111 }; 3112} 3113function Yd(e) { 3114 return e.nextHopProtocol === "" ? void 0 : e.nextHopProtocol; 3115} 3116function Jd(e) { 3117 return e.deliveryType === "" ? "other" : e.deliveryType; 3118} 3119function Qd(e) { 3120 if (e.startTime < e.responseStart) { 3121 let { encodedBodySize: t, decodedBodySize: n, transferSize: r } = e; 3122 return { 3123 size: n, 3124 encoded_body_size: t, 3125 decoded_body_size: n, 3126 transfer_size: r 3127 }; 3128 } 3129 return { 3130 size: void 0, 3131 encoded_body_size: void 0, 3132 decoded_body_size: void 0, 3133 transfer_size: void 0 3134 }; 3135} 3136function St(e) { 3137 return e && (!Ju(e) || Un(At.TRACK_INTAKE_REQUESTS)); 3138} 3139function sr(e, t = Ga) { 3140 if (e.length <= t || !e.startsWith("data:")) return e; 3141 let n = e.substring(0, 100).match(qa); 3142 return n ? `${n[0]}[...]` : e; 3143} 3144function ar(e) { 3145 return e.nodeType === Node.TEXT_NODE; 3146} 3147function Zd(e) { 3148 return e.nodeType === Node.COMMENT_NODE; 3149} 3150function he(e) { 3151 return e.nodeType === Node.ELEMENT_NODE; 3152} 3153function ur(e) { 3154 return he(e) && !!e.shadowRoot; 3155} 3156function jt(e) { 3157 let t = e; 3158 return !!t.host && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE && he(t.host); 3159} 3160function ef(e, t) { 3161 let n = e.firstChild; 3162 for (; n;) t(n), n = n.nextSibling; 3163 ur(e) && t(e.shadowRoot); 3164} 3165function To(e) { 3166 return jt(e) ? e.host : e.parentNode; 3167} 3168function Ao(e) { 3169 if (e.parentElement) return e.parentElement; 3170 let t = e.parentNode; 3171 return t && jt(t) ? t.host : null; 3172} 3173function Ce(e) { 3174 return new k((t) => { 3175 let n = (s) => { 3176 let a = rf(s); 3177 a.length > 0 && t.notify(a); 3178 }, r, i = !0, o = new PerformanceObserver(R((s) => { 3179 i ? r = j(() => n(s.getEntries())) : n(s.getEntries()); 3180 })); 3181 return o.observe(e), i = !1, tf(), () => { 3182 o.disconnect(), Y(r); 3183 }; 3184 }); 3185} 3186function tf() { 3187 !Ka && nf() && "addEventListener" in performance && (Ka = U(performance, "resourcetimingbufferfull", () => { 3188 performance.clearResourceTimings(); 3189 })); 3190} 3191function nf() { 3192 return window.performance !== void 0 && "getEntries" in performance; 3193} 3194function Pe(e) { 3195 return PerformanceObserver.supportedEntryTypes.includes(e); 3196} 3197function rf(e) { 3198 return e.filter((t) => !of(t)); 3199} 3200function of(e) { 3201 return e.entryType === "resource" && (!St(e.name) || !Wd(e)); 3202} 3203function Wt(e, t) { 3204 if (!e.isConnected) return; 3205 let n = sf(e), r = []; 3206 for (let { rootNode: i, target: o } of n) { 3207 let s = af(o, i, t); 3208 if (!s) return; 3209 r.push(s); 3210 } 3211 return r.join(Wa); 3212} 3213function sf(e) { 3214 let t = [], n = e; 3215 for (; n;) { 3216 let r = n.getRootNode(); 3217 if (t.push({ 3218 rootNode: r, 3219 target: n 3220 }), jt(r)) n = r.host; 3221 else break; 3222 } 3223 return t.reverse(); 3224} 3225function af(e, t, n) { 3226 let r, i = e; 3227 for (; i && i.nodeName !== "HTML";) { 3228 let o = No(i, t, za, lf, n, r); 3229 if (o) return zt(o, r); 3230 r = zt(No(i, t, Xa, df, n, r) || cf(i), r), i = i.parentElement; 3231 } 3232 return r; 3233} 3234function cr(e) { 3235 return /[0-9]/.test(e); 3236} 3237function Ro(e) { 3238 if (e.id && !cr(e.id)) return `#${CSS.escape(e.id)}`; 3239} 3240function uf(e) { 3241 if (e.tagName === "BODY") return; 3242 let t = e.classList; 3243 for (let n = 0; n < t.length; n += 1) { 3244 let r = t[n]; 3245 if (!cr(r)) return `${CSS.escape(e.tagName)}.${CSS.escape(r)}`; 3246 } 3247} 3248function ko(e) { 3249 return CSS.escape(e.tagName); 3250} 3251function Oo(e, t) { 3252 if (t) { 3253 let r = n(t); 3254 if (r) return r; 3255 } 3256 for (let r of yn) { 3257 let i = n(r); 3258 if (i) return i; 3259 } 3260 function n(r) { 3261 if (e.hasAttribute(r)) return `${CSS.escape(e.tagName)}${Io(r, e.getAttribute(r))}`; 3262 } 3263} 3264function Io(e, t) { 3265 return `[${e}="${CSS.escape(t)}"]`; 3266} 3267function cf(e) { 3268 let t = xo(e); 3269 return `${CSS.escape(e.tagName)}:nth-of-type(${t})`; 3270} 3271function xo(e) { 3272 let t = e.parentNode.firstElementChild, n = 1; 3273 for (; t && t !== e;) t.tagName === e.tagName && (n += 1), t = t.nextElementSibling; 3274 return n; 3275} 3276function No(e, t, n, r, i, o) { 3277 for (let s of n) { 3278 let a = s(e, i); 3279 if (a && r(e, t, a, o)) return a; 3280 } 3281} 3282function lf(e, t, n, r) { 3283 return t.querySelectorAll(zt(n, r)).length === 1; 3284} 3285function df(e, t, n, r) { 3286 let i; 3287 if (r === void 0) i = (s) => s.matches(n); 3288 else { 3289 let s = zt(`${n}:scope`, r); 3290 i = (a) => a.querySelector(s) !== null; 3291 } 3292 let o = e.previousElementSibling; 3293 for (; o;) { 3294 if (i(o)) return !1; 3295 o = o.previousElementSibling; 3296 } 3297 for (o = e.nextElementSibling; o;) { 3298 if (i(o)) return !1; 3299 o = o.nextElementSibling; 3300 } 3301 return !0; 3302} 3303function zt(e, t) { 3304 return t ? `${e}>${t}` : e; 3305} 3306function _t(e) { 3307 return `[${Qr}="${e}"], .${Ja}${e}`; 3308} 3309function Ct(e, t, n) { 3310 if (n?.has(e)) return n.get(e); 3311 let r = To(e), i = r ? Ct(r, t, n) : t, o = Lo(Mo(e), i); 3312 return n && n.set(e, o), o; 3313} 3314function Lo(e, t) { 3315 switch (t) { 3316 case I.HIDDEN: 3317 case I.IGNORE: return t; 3318 } 3319 switch (e) { 3320 case I.ALLOW: 3321 case I.MASK: 3322 case I.MASK_USER_INPUT: 3323 case I.MASK_UNLESS_ALLOWLISTED: 3324 case I.HIDDEN: 3325 case I.IGNORE: return e; 3326 default: return t; 3327 } 3328} 3329function Mo(e) { 3330 if (he(e)) { 3331 if (e.tagName === "BASE") return I.ALLOW; 3332 if (e.tagName === "INPUT") { 3333 let t = e; 3334 if (t.type === "password" || t.type === "email" || t.type === "tel" || t.type === "hidden") return I.MASK; 3335 let n = t.getAttribute("autocomplete"); 3336 if (n && (n.startsWith("cc-") || n.endsWith("-password"))) return I.MASK; 3337 } 3338 if (e.matches(_t(I.HIDDEN))) return I.HIDDEN; 3339 if (e.matches(_t(I.MASK))) return I.MASK; 3340 if (e.matches(_t(I.MASK_UNLESS_ALLOWLISTED))) return I.MASK_UNLESS_ALLOWLISTED; 3341 if (e.matches(_t(I.MASK_USER_INPUT))) return I.MASK_USER_INPUT; 3342 if (e.matches(_t(I.ALLOW))) return I.ALLOW; 3343 if (pf(e)) return I.IGNORE; 3344 } 3345} 3346function lr(e, t) { 3347 switch (t) { 3348 case I.MASK: 3349 case I.HIDDEN: 3350 case I.IGNORE: return !0; 3351 case I.MASK_UNLESS_ALLOWLISTED: return ar(e) ? Xt(e.parentNode) ? !0 : !Uo(e.textContent || "") : Xt(e); 3352 case I.MASK_USER_INPUT: return ar(e) ? Xt(e.parentNode) : Xt(e); 3353 default: return !1; 3354 } 3355} 3356function Do(e, t, n, r, i) { 3357 if (r !== I.MASK && r !== I.MASK_UNLESS_ALLOWLISTED || t === "data-dd-privacy" || yn.includes(t) || t === i.actionNameAttribute) return !1; 3358 switch (t) { 3359 case "title": 3360 case "alt": 3361 case "placeholder": 3362 case "aria-label": 3363 case "name": return !0; 3364 } 3365 return !!(e === "A" && t === "href" || e === "IFRAME" && t === "srcdoc" || n && t.startsWith("data-") || (e === "IMG" || e === "SOURCE") && (t === "src" || t === "srcset")); 3366} 3367function Xt(e) { 3368 if (!e || e.nodeType !== e.ELEMENT_NODE) return !1; 3369 let t = e; 3370 if (t.tagName === "INPUT") switch (t.type) { 3371 case "button": 3372 case "color": 3373 case "reset": 3374 case "submit": return !1; 3375 } 3376 return !!Za[t.tagName]; 3377} 3378function Po(e) { 3379 return e.replace(/\S/g, "x"); 3380} 3381function ff(e, t) { 3382 let n = e.parentElement?.tagName, r = e.textContent || "", i = t; 3383 return n === "SCRIPT" || i === I.HIDDEN ? r = "***" : lr(e, i) && (n === "DATALIST" || n === "SELECT" || n === "OPTGROUP" || (n === "OPTION" ? r = "***" : r = Po(r))), n === "HEAD" && !r.trim() ? "" : r; 3384} 3385function pf(e) { 3386 if (e.nodeName === "SCRIPT") return !0; 3387 if (e.nodeName === "LINK") { 3388 let n = t("rel"); 3389 return /preload|prefetch/i.test(n) && t("as") === "script" || n === "shortcut icon" || n === "icon"; 3390 } 3391 if (e.nodeName === "META") { 3392 let n = t("name"), r = t("rel"), i = t("property"); 3393 return /^msapplication-tile(image|color)$/.test(n) || n === "application-name" || r === "icon" || r === "apple-touch-icon" || r === "shortcut icon" || n === "keywords" || n === "description" || /^(og|twitter|fb):/.test(i) || /^(og|twitter):/.test(n) || n === "pinterest" || n === "robots" || n === "googlebot" || n === "bingbot" || e.hasAttribute("http-equiv") || n === "author" || n === "generator" || n === "framework" || n === "publisher" || n === "progid" || /^article:/.test(i) || /^product:/.test(i) || n === "google-site-verification" || n === "yandex-verification" || n === "csrf-token" || n === "p:domain_verify" || n === "verify-v1" || n === "verification" || n === "shopify-checkout-api-token"; 3394 } 3395 function t(n) { 3396 return (e.getAttribute(n) || "").toLowerCase(); 3397 } 3398 return !1; 3399} 3400function Uo(e) { 3401 return e?.trim() ? window.$DD_ALLOW?.has(e.toLocaleLowerCase()) || !1 : !0; 3402} 3403function mf(e, t) { 3404 return Uo(e) ? e : t || Po(e); 3405} 3406function gf() {
3407 let e, t = window.visualViewport; 3408 return t ? e = t.pageLeft - t.offsetLeft : window.scrollX !== void 0 ? e = window.scrollX : e = window.pageXOffset || 0, Math.round(e); 3409} 3410function $o() { 3411 let e, t = window.visualViewport; 3412 return t ? e = t.pageTop - t.offsetTop : window.scrollY !== void 0 ? e = window.scrollY : e = window.pageYOffset || 0, Math.round(e); 3413} 3414function Vo() { 3415 return Zr || (Zr = yf()), Zr; 3416} 3417function yf() { 3418 return new k((e) => { 3419 let { throttled: t } = pt(() => { 3420 e.notify(Yt()); 3421 }, 200); 3422 return U(window, D.RESIZE, t, { 3423 capture: !0, 3424 passive: !0 3425 }).stop; 3426 }); 3427} 3428function Yt() { 3429 let e = window.visualViewport; 3430 return e ? { 3431 width: Number(e.width * e.scale), 3432 height: Number(e.height * e.scale) 3433 } : { 3434 width: Number(window.innerWidth || 0), 3435 height: Number(window.innerHeight || 0) 3436 }; 3437} 3438function Fo(e, t) { 3439 return Se() ? Ti(kr.RECORDS) ? 1 : 0 : Ht(e.id, Fn(t.sessionSampleRate, t.sessionReplaySampleRate)) ? 1 : e.isReplayForced ? 2 : 0; 3440} 3441function hf() { 3442 let e = new k(), { stop: t } = oe(window, "open", () => e.notify()); 3443 return { 3444 observable: e, 3445 stop: t 3446 }; 3447} 3448function bf(e, t, n, r, i) { 3449 return { get: (o) => { 3450 let s = n.findView(o), a = i.findUrl(o), u = t.findTrackedSession(o); 3451 if (u && s && a) { 3452 let c = r.findActionId(o); 3453 return { 3454 application_id: e, 3455 session_id: u.id, 3456 user_action: c ? { id: c } : void 0, 3457 view: { 3458 id: s.id, 3459 name: s.name, 3460 referrer: a.referrer, 3461 url: a.url 3462 } 3463 }; 3464 } 3465 } }; 3466} 3467function vf() { 3468 return qo(64); 3469} 3470function Ho() { 3471 return qo(63); 3472} 3473function qo(e) { 3474 let t = crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(2)), n = BigInt(t[0]) + (BigInt(t[1]) << 32n); 3475 return e === 63 && (n &= 9223372036854775807n), n; 3476} 3477function Ze(e) { 3478 return e.toString(16).padStart(16, "0"); 3479} 3480function Ef(e) { 3481 e.status === 0 && !e.isAborted && (e.traceId = void 0, e.spanId = void 0, e.traceSampled = void 0); 3482} 3483function Sf(e, t, n, r) { 3484 return { 3485 clearTracingIfNeeded: Ef, 3486 traceFetch: (i) => Go(e, i, t, n, r, (o) => { 3487 if (i.input instanceof Request && !i.init?.headers) i.input = new Request(i.input), Object.keys(o).forEach((s) => { 3488 i.input.headers.append(s, o[s]); 3489 }); 3490 else { 3491 i.init = mt(i.init); 3492 let s = []; 3493 i.init.headers instanceof Headers ? i.init.headers.forEach((a, u) => { 3494 s.push([u, a]); 3495 }) : Array.isArray(i.init.headers) ? i.init.headers.forEach((a) => { 3496 s.push(a); 3497 }) : i.init.headers && Object.keys(i.init.headers).forEach((a) => { 3498 s.push([a, i.init.headers[a]]); 3499 }), i.init.headers = s.concat(Vt(o)); 3500 } 3501 }), 3502 traceXhr: (i, o) => Go(e, i, t, n, r, (s) => { 3503 try { 3504 Object.keys(s).forEach((a) => { 3505 o.setRequestHeader(a, s[a]); 3506 }); 3507 } catch {} 3508 }) 3509 }; 3510} 3511function Go(e, t, n, r, i, o) { 3512 let s = n.findTrackedSession(); 3513 if (!s) return; 3514 let a = e.allowedTracingUrls.find((d) => Qe([d.match], t.url, !0)); 3515 if (!a) return; 3516 let u = Ht(s.id, Fn(e.sessionSampleRate, e.traceSampleRate)), c = Se() ? xe()?.getIsTraceSampled() ?? u : u; 3517 (c || e.traceContextInjection === cn.ALL) && (t.traceSampled = c, t.traceId = vf(), t.spanId = Ho(), o(_f(t.traceId, t.spanId, t.traceSampled, s.id, a.propagatorTypes, r, i, e))); 3518} 3519function _f(e, t, n, r, i, o, s, a) { 3520 let u = {}; 3521 if (i.forEach((c) => { 3522 switch (c) { 3523 case "datadog": 3524 Object.assign(u, { 3525 "x-datadog-origin": "rum", 3526 "x-datadog-parent-id": t.toString(), 3527 "x-datadog-sampling-priority": n ? "1" : "0", 3528 "x-datadog-trace-id": e.toString() 3529 }); 3530 break; 3531 case "tracecontext": 3532 Object.assign(u, { 3533 traceparent: `00-0000000000000000${Ze(e)}-${Ze(t)}-0${n ? "1" : "0"}`, 3534 tracestate: `dd=s:${n ? "1" : "0"};o:rum` 3535 }); 3536 break; 3537 case "b3": 3538 Object.assign(u, { b3: `${Ze(e)}-${Ze(t)}-${n ? "1" : "0"}` }); 3539 break; 3540 case "b3multi": Object.assign(u, { 3541 "X-B3-TraceId": Ze(e), 3542 "X-B3-SpanId": Ze(t), 3543 "X-B3-Sampled": n ? "1" : "0" 3544 }); 3545 } 3546 }), a.propagateTraceBaggage) { 3547 let c = { "session.id": r }, d = o.getContext().id; 3548 typeof d == "string" && (c["user.id"] = d); 3549 let f = s.getContext().id; 3550 typeof f == "string" && (c["account.id"] = f); 3551 let p = Object.entries(c).map(([l, m]) => `${l}=${encodeURIComponent(m)}`).join(","); 3552 p && (u.baggage = p); 3553 } 3554 return u; 3555} 3556function Cf(e, t) { 3557 let n = Tf(e, t.trackPayload); 3558 if (n) { 3559 if (t.trackResponseErrors && e.responseBody) { 3560 let r = wf(e.responseBody); 3561 r && (n.error_count = r.length, n.errors = r); 3562 } 3563 return n; 3564 } 3565} 3566function wf(e) { 3567 let t = je(e); 3568 if (!t || typeof t != "object") return; 3569 let n = t; 3570 if (Le(n.errors)) return n.errors.map((r) => ({ 3571 message: r.message, 3572 path: r.path, 3573 locations: r.locations, 3574 code: r.extensions?.code 3575 })); 3576} 3577function Bo(e, t) { 3578 return t.allowedGraphQlUrls.find((n) => Qe([n.match], e)); 3579} 3580function Tf(e, t = !1) { 3581 let n; 3582 if (e.method === "POST" ? n = Af(e.requestBody) : e.method === "GET" && (n = Rf(e.url)), !!n) return kf(n, t); 3583} 3584function Af(e) { 3585 if (!e || typeof e != "string") return; 3586 let t = je(e); 3587 if (t) return { 3588 query: t.query, 3589 operationName: t.operationName, 3590 variables: t.variables ? JSON.stringify(t.variables) : void 0, 3591 operationType: t.operationType 3592 }; 3593} 3594function Rf(e) { 3595 let t = Ee(e).searchParams, n = t.get("variables"), r = n && je(n) !== void 0 ? n : void 0; 3596 return { 3597 query: t.get("query") || void 0, 3598 operationName: t.get("operationName") || void 0, 3599 variables: r, 3600 operationType: t.get("operationType") || void 0 3601 }; 3602} 3603function kf(e, t) { 3604 let n, r, i; 3605 if (e.query) { 3606 let o = e.query.trim(); 3607 n = Of(o), t && (r = yt(o, tu, "...")); 3608 } 3609 if (!n) { 3610 let o = e.operationType; 3611 (o === "query" || o === "mutation" || o === "subscription") && (n = o); 3612 } 3613 return e.variables && (i = e.variables), { 3614 operationType: n, 3615 operationName: e.operationName, 3616 variables: i, 3617 payload: r 3618 }; 3619} 3620function Of(e) { 3621 return e.match(/^\s*(query|mutation|subscription)\b/i)?.[1]; 3622} 3623function If(e, t, n, r, i, o) { 3624 let s = Sf(t, n, r, i); 3625 xf(e, s, o), Nf(e, t, s, o); 3626} 3627function xf(e, t, n) { 3628 let r = []; 3629 return r.push(oo().subscribe((i) => { 3630 i.state === "start" && St(i.url) && (t.traceXhr(i, i.xhr), Jt(i)); 3631 })), r.push(n.subscribe(({ data: i, type: o }) => { 3632 if (o !== Nt.XHR) return; 3633 let s = i; 3634 if (St(s.url)) switch (s.state) { 3635 case "start": 3636 Jt(s), e.notify(7, { 3637 requestIndex: s.requestIndex, 3638 url: s.url 3639 }); 3640 break; 3641 case "complete": t.clearTracingIfNeeded(s), e.notify(8, N(v({}, s), { 3642 type: ot.XHR, 3643 isAbortedOnStart: !1 3644 })); 3645 } 3646 })), { stop: () => r.forEach((i) => i.unsubscribe()) }; 3647} 3648function Nf(e, t, n, r) { 3649 let i = []; 3650 return i.push(so({ responseBodyAction: (o) => Bo(o.url, t)?.trackResponseErrors ? Gr.COLLECT : Gr.IGNORE }).subscribe((o) => { 3651 o.state === "start" && St(o.url) && (n.traceFetch(o), Jt(o)); 3652 })), i.push(r.subscribe(({ data: o, type: s }) => { 3653 if (s !== Nt.FETCH) return; 3654 let a = o; 3655 if (St(a.url)) switch (a.state) { 3656 case "start": 3657 Jt(a), e.notify(7, { 3658 requestIndex: a.requestIndex, 3659 url: a.url 3660 }); 3661 break; 3662 case "resolve": n.clearTracingIfNeeded(a), e.notify(8, N(v({}, a), { 3663 duration: L(a.startClocks.timeStamp, G()), 3664 type: ot.FETCH, 3665 requestBody: a.init?.body 3666 })); 3667 } 3668 })), { stop: () =>
3668 i.forEach((o) => o.unsubscribe()) }; 3669} 3670function Jt(e) { 3671 e.requestIndex || (e.requestIndex = nu++); 3672} 3673function Lf(e, t, n) { 3674 let r = Mf(e, Wl(), t, n), i = e.subscribe(10, ({ endClocks: o }) => { 3675 r.flushOpenConnections("session_end", o); 3676 }); 3677 return { stop: () => { 3678 i.unsubscribe(), r.flushOpenConnections("session_end"), r.stop(); 3679 } }; 3680} 3681function Mf(e, t, n, r) { 3682 let i = /* @__PURE__ */ new Map(); 3683 function o(a, u, c) { 3684 let d = Pf(a, u, c, n); 3685 e.notify(9, d), r({ 3686 id: H(), 3687 name: iu, 3688 type: fe.DURATION, 3689 startClocks: d.endClocks, 3690 duration: 0, 3691 context: A({ 3692 url: d.url, 3693 connection_id: d.connectionId 3694 }) 3695 }); 3696 } 3697 let s = t.subscribe((a) => { 3698 switch (a.state) { 3699 case "connecting": { 3700 let u = H(), c = n.findView(a.startClocks.relative)?.id, d = Df(a.url), f = { 3701 webSocket: a.instance, 3702 connectionId: u, 3703 url: d, 3704 startClocks: a.startClocks, 3705 startViewId: c, 3706 messagesIn: { 3707 count: 0, 3708 size: 0 3709 }, 3710 messagesOut: { 3711 count: 0, 3712 size: 0 3713 }, 3714 longestInboundSilence: 0, 3715 bufferedAmountMax: 0 3716 }; 3717 i.set(a.instance, f), r({ 3718 id: H(), 3719 name: ru, 3720 type: fe.DURATION, 3721 startClocks: a.startClocks, 3722 duration: 0, 3723 context: A({ 3724 url: d, 3725 connection_id: u 3726 }) 3727 }); 3728 return; 3729 } 3730 case "open": { 3731 let u = i.get(a.instance); 3732 if (!u) return; 3733 u.openClocks = a.openClocks, u.protocol = a.protocol, u.setupDuration = L(u.startClocks.timeStamp, a.openClocks.timeStamp); 3734 return; 3735 } 3736 case "message-in": { 3737 let u = i.get(a.instance); 3738 if (!u) return; 3739 u.messagesIn.count += 1, u.messagesIn.size += a.size, Ko(u, a.at, "in"); 3740 return; 3741 } 3742 case "message-out": { 3743 let u = i.get(a.instance); 3744 if (!u) return; 3745 a.bufferedAmountPreSend > u.bufferedAmountMax && (u.bufferedAmountMax = a.bufferedAmountPreSend), u.messagesOut.count += 1, u.messagesOut.size += a.size, Ko(u, a.at, "out"); 3746 return; 3747 } 3748 case "closed": { 3749 let u = i.get(a.instance); 3750 if (!u) return; 3751 i.delete(a.instance), o(u, a, "close_event"); 3752 return; 3753 } 3754 } 3755 }); 3756 return { 3757 flushOpenConnections: (a, u = x()) => {
3758 i.forEach((c) => { 3759 o(c, { at: u }, a); 3760 }), i.clear(); 3761 }, 3762 stop: () => { 3763 s.unsubscribe(), i.clear(); 3764 } 3765 }; 3766} 3767function Df(e) { 3768 let t = Ee(e); 3769 return t.search = "", t.href; 3770} 3771function Ko(e, t, n) { 3772 if (e.openClocks === void 0) return; 3773 let r = L(e.openClocks.timeStamp, t.timeStamp); 3774 if (n === "in" && e.firstMessageInOffset === void 0 ? e.firstMessageInOffset = r : n === "out" && e.firstMessageOutOffset === void 0 && (e.firstMessageOutOffset = r), n === "in") { 3775 if (e.lastMessageInAt !== void 0) { 3776 let i = L(e.lastMessageInAt, t.timeStamp); 3777 i > e.longestInboundSilence && (e.longestInboundSilence = i); 3778 } 3779 e.lastMessageInAt = t.timeStamp; 3780 } 3781} 3782function Pf(e, t, n, r) { 3783 let i = t.at, o = n === "session_end" ? r.findView(i.relative, { returnInactive: !0 })?.id : r.findView(i.relative)?.id, s = e.lastMessageInAt !== void 0 ? L(e.lastMessageInAt, i.timeStamp) : void 0, a = e, { openClocks: u } = a; 3784 return N(v({}, Dt(a, ["openClocks"])), { 3785 endClocks: i, 3786 endViewId: o, 3787 inboundIdleDurationBeforeClose: s, 3788 trackingEndReason: n, 3789 handshakeSucceeded: u !== void 0, 3790 setupDuration: e.setupDuration ?? L(e.startClocks.timeStamp, i.timeStamp), 3791 closeCode: t.code, 3792 closeReason: t.reason, 3793 wasClean: t.wasClean 3794 }); 3795} 3796function jo(e) { 3797 return rr(e) && e < 0 ? void 0 : e; 3798} 3799function dr(e, t, n, r, i, o) { 3800 let s = Uf(e, t, n, r), a, u = !1, c = j(R(() => l({ hadActivity: !1 })), 100), d = o !== void 0 ? j(R(() => l({ 3801 hadActivity: !0, 3802 end: G() 3803 })), o) : void 0, f = s.subscribe(({ isBusy: m }) => { 3804 Y(c), Y(a); 3805 let g = G(); 3806 m || (a = j(R(() => l({ 3807 hadActivity: !0, 3808 end: g 3809 })), 100)); 3810 }), p = () => { 3811 u = !0, Y(c), Y(a), Y(d), f.unsubscribe(); 3812 }; 3813 function l(m) { 3814 u || (p(), i(m)); 3815 } 3816 return { stop: p }; 3817} 3818function Uf(e, t, n, r) { 3819 return new k((i) => { 3820 let o = [], s, a = 0; 3821 return o.push(t.subscribe((c) => { 3822 c.every($f) || u(); 3823 }), n.subscribe(u), Ce({ type: "resource" }).subscribe((c) => { 3824 c.some((d) => !fr(r, d.name)) && u(); 3825 }), e.subscribe(7, (c) => { 3826 fr(r, c.url) || (s === void 0 && (s = c.requestIndex), a += 1, u()); 3827 }), e.subscribe(8, (c) => { 3828 fr(r, c.url) || s === void 0 || c.requestIndex < s || (a -= 1, u()); 3829 })), () => { 3830 o.forEach((c) => c.unsubscribe()); 3831 }; 3832 function u() { 3833 i.notify({ isBusy: a > 0 }); 3834 } 3835 }); 3836} 3837function fr(e, t) { 3838 return Qe(e.excludedActivityUrls, t); 3839} 3840function $f(e) { 3841 let t = e.type === "characterData" ? e.target.parentElement : e.target; 3842 return !!(t && he(t) && t.matches("[data-dd-excluded-activity-mutations], [data-dd-excluded-activity-mutations] *")); 3843} 3844function Wo({ lifeCycle: e, isChildEvent: t, onChange: n = V }) { 3845 let r = { 3846 errorCount: 0, 3847 longTaskCount: 0, 3848 resourceCount: 0, 3849 actionCount: 0, 3850 frustrationCount: 0 3851 }, i = e.subscribe(14, (o) => { 3852 if (!(o.type === "view" || o.type === "vital" || !t(o))) switch (o.type) { 3853 case T.ERROR: 3854 r.errorCount += 1, n(); 3855 break; 3856 case T.ACTION: 3857 r.actionCount += 1, o.action.frustration && (r.frustrationCount += o.action.frustration.type.length), n(); 3858 break; 3859 case T.LONG_TASK: 3860 r.longTaskCount += 1, n(); 3861 break; 3862 case T.RESOURCE: o._dd?.discarded || (r.resourceCount += 1, n()); 3863 } 3864 }); 3865 return { 3866 stop: () => { 3867 i.unsubscribe(); 3868 }, 3869 eventCounts: r 3870 }; 3871} 3872function Qt(e) { 3873 let t = Me({ expireDelay: ou }), n = /* @__PURE__ */ new Map(); 3874 function r(p) { 3875 n.delete(p.key), p.eventCounts?.stop(); 3876 } 3877 function i() { 3878 n.forEach((p) => { 3879 r(p); 3880 }), t.reset(); 3881 } 3882 let o = e.subscribe(11, i); 3883 function s(p, l, m, g) { 3884 let h = H(), S = t.add(h, l.relative), $ = n.get(p); 3885 $ && r($); 3886 let M = { 3887 id: h, 3888 key: p, 3889 startClocks: l, 3890 data: m, 3891 historyEntry: S, 3892 eventCounts: g?.isChildEvent ? Wo({ 3893 lifeCycle: e, 3894 isChildEvent: g.isChildEvent(h) 3895 }) : void 0 3896 }; 3897 return n.set(p, M), M; 3898 } 3899 function a(p, l, m) { 3900 let g = n.get(p); 3901 if (!g) return; 3902 let h = m ? pe(g.data, m) : g.data; 3903 g.historyEntry.close(l.relative); 3904 let S = L(g.startClocks.timeStamp, l.timeStamp), $ = g.eventCounts?.eventCounts; 3905 return r(g), N(v({}, h), { 3906 id: g.id, 3907 startClocks: g.startClocks, 3908 duration: S, 3909 counts: $ 3910 }); 3911 } 3912 function u(p) { 3913 let l = n.get(p); 3914 if (!l) return; 3915 let m = l.eventCounts?.eventCounts; 3916 return r(l), l.historyEntry.remove(), N(v({}, l.data), { 3917 id: l.id, 3918 startClocks: l.startClocks,
3919 counts: m 3920 }); 3921 } 3922 function c(p) { 3923 return t.findAll(p); 3924 } 3925 function d(p) { 3926 return n.get(p)?.eventCounts?.eventCounts; 3927 } 3928 function f() { 3929 o.unsubscribe(), i(), t.stop(); 3930 } 3931 return { 3932 start: s, 3933 stop: a, 3934 discard: u, 3935 getCounts: d, 3936 findId: c, 3937 stopAll: f 3938 }; 3939} 3940function Vf(e, t) { 3941 let n = e.filter((o) => o instanceof Element && !su.includes(o.tagName)); 3942 if (n.length === 0) return ""; 3943 let r = t ? [t].concat(ti) : ti, i = ""; 3944 for (let o of n) { 3945 let s = Ff(o, r); 3946 if (i += s, i.length >= ei) return yt(i, ei); 3947 } 3948 return i; 3949} 3950function Ff(e, t) { 3951 let n = ko(e), r = Ro(e), i = Hf(e), o = Gf(e, t), s = qf(e); 3952 return `${n}${r || ""}${o}${i}${s};`; 3953} 3954function Hf(e) { 3955 return Array.from(e.classList).filter((t) => !cr(t)).sort().map((t) => `.${CSS.escape(t)}`).join(""); 3956} 3957function qf(e) { 3958 let t = Array.from(e.parentNode.children); 3959 if (t.length <= 1) return ""; 3960 let n = t.filter((o) => o.tagName === e.tagName), r = t.indexOf(e), i = xo(e); 3961 return `:nth-child(${r + 1})${n.length > 1 ? `:nth-of-type(${i})` : ""}`; 3962} 3963function Gf(e, t) { 3964 let n = [], r = Array.from(e.attributes); 3965 for (let i of r) t.includes(i.name) && n.push(Io(i.name, i.value)); 3966 return n.sort().join(""); 3967} 3968function Bf(e, t) { 3969 let n = [], r = 0, i; 3970 o(e); 3971 function o(u) { 3972 u.stopObservable.subscribe(s), n.push(u), Y(i), i = j(a, ni); 3973 } 3974 function s() { 3975 r === 1 && n.every((u) => u.isStopped()) && (r = 2, t(n)); 3976 } 3977 function a() { 3978 Y(i), r === 0 && (r = 1, s()); 3979 } 3980 return { 3981 tryAppend: (u) => r !== 0 ? !1 : n.length > 0 && !Kf(n[n.length - 1].event, u.event) ? (a(), !1) : (o(u), !0), 3982 stop: () => { 3983 a(); 3984 } 3985 }; 3986} 3987function Kf(e, t) { 3988 return e.target === t.target && jf(e, t) <= 100 && e.timeStamp - t.timeStamp <= ni; 3989} 3990function jf(e, t) { 3991 return Math.sqrt(Math.pow(e.clientX - t.clientX, 2) + Math.pow(e.clientY - t.clientY, 2)); 3992} 3993function Wf(e, t, n = I.ALLOW) { 3994 let r = /* @__PURE__ */ new Map(), { actionNameAttribute: i } = t, o = zo(e, "data-dd-action-name") || i && zo(e, i); 3995 return o ? { 3996 name: o, 3997 nameSource: "custom_attribute" 3998 } : n === I.MASK ? { 3999 name: Jr, 4000 nameSource: "mask_placeholder" 4001 } : Xo(e, au, t, r) || Xo(e, uu, t, r) || { 4002 name: "", 4003 nameSource: "blank" 4004 }; 4005} 4006function zo(e, t) { 4007 let n = zf(e, `[${t}]`); 4008 if (n) return Jo(Yo(n.getAttribute(t).trim())); 4009} 4010function zf(e, t) { 4011 let n = e; 4012 for (; n;) { 4013 if (n.matches(t)) return n; 4014 n = Ao(n); 4015 } 4016 return null; 4017} 4018function Xo(e, t, n, r) { 4019 let i = e, o = 0; 4020 for (; o <= cu && i && i.nodeName !== "BODY" && i.nodeName !== "HTML" && i.nodeName !== "HEAD";) { 4021 for (let s of t) { 4022 let a = s(i, n, r); 4023 if (a) { 4024 let { name: u, nameSource: c } = a, d = u?.trim(); 4025 if (d) return { 4026 name: Jo(Yo(d)), 4027 nameSource: c 4028 }; 4029 } 4030 } 4031 if (i.nodeName === "FORM") break; 4032 i = Ao(i), o += 1; 4033 } 4034} 4035function Yo(e) { 4036 return e.replace(/\s+/g, " "); 4037} 4038function Jo(e) { 4039 return e.length > 100 ? `${yt(e, 100)} [...]` : e; 4040} 4041function Xf(e, t) { 4042 let n = e.getRootNode(); 4043 if (n instanceof ShadowRoot) { 4044 let r = n.getElementById(t); 4045 if (r) return r; 4046 } 4047 return e.ownerDocument ? e.ownerDocument.getElementById(t) : null; 4048} 4049function wt(e, t, n, r) { 4050 let { enablePrivacyForActionName: i, defaultPrivacyLevel: o } = n, s = e.getAttribute(t); 4051 if (s && i) { 4052 let a = Ct(e, o, r); 4053 Do(e.tagName, t, s, a, n) && (s = mf(s, Jr)); 4054 } else s || (s = ""); 4055 return { 4056 name: s, 4057 nameSource: "standard_attribute" 4058 }; 4059} 4060function Zt(e, t, n) { 4061 return { 4062 name: Qo(e, t, n) || "", 4063 nameSource: "text_content" 4064 }; 4065} 4066function Qo(e, t, n) { 4067 if (e.isContentEditable) return; 4068 let { enablePrivacyForActionName: r, actionNameAttribute: i, defaultPrivacyLevel: o } = t, s = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, u), a = ""; 4069 for (; s.nextNode();) { 4070 let c = s.currentNode; 4071 if (he(c)) { 4072 (c.nodeName === "BR" || c.nodeName === "P" || [ 4073 "block", 4074 "flex", 4075 "grid", 4076 "list-item", 4077 "table", 4078 "table-caption" 4079 ].includes(getComputedStyle(c).display)) && (a += " "); 4080 continue; 4081 } 4082 a += c.textContent || ""; 4083 } 4084 return a.replace(/\s+/g, " ").trim(); 4085 function u(c) { 4086 let d = Ct(c, o, n); 4087 if (r && d && lr(c, d)) return NodeFilter.FILTER_REJECT; 4088 if (he(c)) { 4089 if (c.hasAttribute("data-dd-action-name") || i && c.hasAttribute(i)) return NodeFilter.FILTER_REJECT; 4090 let f = getComputedStyle(c); 4091 if (f.visibility !== "visible" || f.display === "none" || f.contentVisibility && f.contentVisibility !== "visible") return NodeFilter.FILTER_REJECT; 4092 } 4093 return NodeFilter.FILTER_ACCEPT; 4094 } 4095} 4096function Yf({ onPointerDown: e, onPointerUp: t }) { 4097 let n, r = { 4098 selection: !1, 4099 input: !1, 4100 scroll: !1 4101 }, i, o = [ 4102 U(window, D.POINTER_DOWN, (s) => { 4103 es(s) && (n = Zo(), r = { 4104 selection: !1, 4105 input: !1, 4106 scroll: !1 4107 }, i = e(s)); 4108 }, { capture: !0 }), 4109 U(window, D.SELECTION_CHANGE, () => { 4110 (!n || !Zo()) && (r.selection = !0); 4111 }, { capture: !0 }), 4112 U(window, D.SCROLL, () => { 4113 r.scroll = !0; 4114 }, { 4115 capture: !0, 4116 passive: !0 4117 }), 4118 U(window, D.POINTER_UP, (s) => { 4119 if (es(s) && i) { 4120 let a = r; 4121 t(i, s, () => a), i = void 0; 4122 } 4123 }, { capture: !0 }), 4124 U(window, D.INPUT, () => { 4125 r.input = !0; 4126 }, { capture: !0 }) 4127 ]; 4128 return { stop: () => { 4129 o.forEach((s) => s.stop()); 4130 } }; 4131} 4132function Zo() { 4133 let e = window.getSelection(); 4134 return !e || e.isCollapsed; 4135} 4136function es(e) { 4137 return e.target instanceof Element && e.isPrimary !== !1; 4138} 4139function Jf(e, t) { 4140 if (Qf(e)) return t.addFrustration(qe.RAGE_CLICK), e.some(ts) && t.addFrustration(qe.DEAD_CLICK), t.hasError && t.addFrustration(qe.ERROR_CLICK), { isRage: !0 }; 4141 let n = e.some((r) => r.getUserActivity().selection); 4142 return e.forEach((r) => { 4143 r.hasError && r.addFrustration(qe.ERROR_CLICK), ts(r) && !n && r.addFrustration(qe.DEAD_CLICK); 4144 }), { isRage: !1 }; 4145} 4146function Qf(e) { 4147 if (e.some((t) => t.getUserActivity().selection || t.getUserActivity().scroll)) return !1; 4148 for (let t = 0; t < e.length - 2; t += 1) if (e[t + lu - 1].event.timeStamp - e[t].event.timeStamp <= 1e3) return !0; 4149 return !1; 4150} 4151function ts(e) { 4152 if (e.hasPageActivity || e.getUserActivity().input || e.getUserActivity().scroll) return !1; 4153 let t = e.event.target; 4154 return t.tagName === "LABEL" && t.hasAttribute("for") && (t = document.getElementById(t.getAttribute("for"))), !t?.matches(du); 4155} 4156function Zf(e) { 4157 let t = st.get(e); 4158 return st.delete(e), t; 4159} 4160function ns(e, t) {
4161 st.set(e, t), st.forEach((n, r) => { 4162 L(r, ee()) > ri && st.delete(r); 4163 }); 4164} 4165function rs(e) { 4166 return (t) => t.action?.id?.includes(e) ?? !1; 4167} 4168function ep(e, t, n, r) { 4169 let i = Qt(e), o = new k(), s; 4170 e.subscribe(5, c), e.subscribe(12, c); 4171 let { stop: a } = Yf({ 4172 onPointerDown: (d) => tp(r, e, t, d, n), 4173 onPointerUp: ({ clickActionBase: d, hadActivityOnPointerDown: f }, p, l) => { 4174 np(r, e, t, n, i, o, u, d, p, l, f); 4175 } 4176 }); 4177 return { 4178 stop: () => { 4179 c(), o.notify(), a(), i.stopAll(); 4180 }, 4181 findActionId: i.findId 4182 }; 4183 function u(d) { 4184 if (!s?.tryAppend(d)) { 4185 let f = d.clone(); 4186 s = Bf(d, (p) => { 4187 ip(p, f), s = void 0; 4188 }); 4189 } 4190 } 4191 function c() { 4192 s && s.stop(); 4193 } 4194} 4195function tp(e, t, n, r, i) { 4196 let o; 4197 if (e.enablePrivacyForActionName ? o = Ct(is(r), e.defaultPrivacyLevel) : o = I.ALLOW, o === I.HIDDEN) return; 4198 let s = rp(r, o, e), a = !1; 4199 return dr(t, n, i, e, (u) => { 4200 a = u.hadActivity; 4201 }, 100), { 4202 clickActionBase: s, 4203 hadActivityOnPointerDown: () => a 4204 }; 4205} 4206function np(e, t, n, r, i, o, s, a, u, c, d) { 4207 let f = os(t, i, c, a, u); 4208 s(f); 4209 let p = a?.target?.selector; 4210 p && ns(u.timeStamp, p); 4211 let { stop: l } = dr(t, n, r, e, (S) => { 4212 S.hadActivity && S.end < f.startClocks.timeStamp ? f.discard() : S.hadActivity ? f.stop(S.end) : d() ? f.stop(f.startClocks.timeStamp) : f.stop(); 4213 }, ri), m = t.subscribe(5, ({ endClocks: S }) => { 4214 f.stop(S.timeStamp); 4215 }), g = t.subscribe(12, () => { 4216 f.stop(G()); 4217 }), h = o.subscribe(() => { 4218 f.stop(); 4219 }); 4220 f.stopObservable.subscribe(() => { 4221 g.unsubscribe(), m.unsubscribe(), l(), h.unsubscribe(); 4222 }); 4223} 4224function rp(e, t, n) { 4225 let r = is(e), i = r.getBoundingClientRect(), o = Wt(r, n.actionNameAttribute), s = Vf(e.composedPath(), n.actionNameAttribute); 4226 o && ns(e.timeStamp, o); 4227 let { name: a, nameSource: u } = Wf(r, n, t); 4228 return { 4229 type: pn.CLICK, 4230 target: { 4231 width: Math.round(i.width), 4232 height: Math.round(i.height), 4233 selector: o, 4234 composedPathSelector: s || void 0 4235 }, 4236 position: { 4237 x: Math.round(e.clientX - i.left), 4238 y: Math.round(e.clientY - i.top) 4239 }, 4240 name: a, 4241 nameSource: u 4242 }; 4243} 4244function is(e) { 4245 if (e.composed && ur(e.target) && typeof e.composedPath == "function") { 4246 let t = e.composedPath(); 4247 if (t.length > 0 && t[0] instanceof Element) return t[0]; 4248 } 4249 return e.target; 4250} 4251function os(e, t, n, r, i) { 4252 let o = H(), s = lt(i.timeStamp), a = t.start(o, s, r, { isChildEvent: rs }); 4253 e.notify(16, a); 4254 let u = 0, c, d = [], f = new k(); 4255 function p(l) { 4256 u === 0 && (u = 1, c = l ? t.stop(o, di(l)) : t.discard(o), f.notify()); 4257 } 4258 return { 4259 event: i, 4260 stop: p, 4261 stopObservable: f, 4262 get hasError() { 4263 let l = c?.counts ?? t.getCounts(o); 4264 return l ? l.errorCount > 0 : !1; 4265 }, 4266 get hasPageActivity() { 4267 return c && "duration" in c; 4268 }, 4269 getUserActivity: n, 4270 addFrustration: (l) => { 4271 d.push(l); 4272 }, 4273 get startClocks() { 4274 return s; 4275 }, 4276 isStopped: () => u === 1 || u === 2, 4277 clone: () => os(e, t, n, r, i), 4278 validate: (l) => { 4279 if (p(), u !== 1 || !c) return; 4280 let m = N(v({ 4281 frustrationTypes: d, 4282 events: l ?? [i], 4283 event: i 4284 }, c), { counts: c.counts }); 4285 e.notify(0, m), u = 2; 4286 }, 4287 discard: () => { 4288 p(), u = 2; 4289 } 4290 }; 4291} 4292function ip(e, t) { 4293 let { isRage: n } = Jf(e, t); 4294 n ? (e.forEach((r) => r.discard()), t.stop(G()), t.validate(e.map((r) => r.event))) : (t.discard(), e.forEach((r) => r.validate())); 4295} 4296function op(e, t) { 4297 let n = Qt(e); 4298 function r(s, a = {}, u = x()) { 4299 let c = a.actionKey ?? s, d = n.start(c, u, v({ name: s }, a), { isChildEvent: rs }); 4300 e.notify(16, d); 4301 } 4302 function i(s, a = {}, u = x()) { 4303 let c = a.actionKey ?? s, d = n.stop(c, u, a); 4304 if (!d) return; 4305 let f = []; 4306 d.counts && d.counts.errorCount > 0 && f.push(qe.ERROR_CLICK), t(N(v({}, d), { 4307 type: d.type || pn.CUSTOM, 4308 frustrationTypes: f 4309 })); 4310 } 4311 function o(s) { 4312 t(v({ 4313 id: H(), 4314 frustrationTypes: [] 4315 }, s)); 4316 } 4317 return { 4318 addAction: o, 4319 startAction: r, 4320 stopAction: i, 4321 findActionId: n.findId, 4322 stop: n.stopAll 4323 }; 4324} 4325function sp(e, t, n, r, i) { 4326 let { unsubscribe: o } = e.subscribe(0, (d) => { 4327 e.notify(13, ss(d)); 4328 }), s = V, a; 4329 i.trackUserInteractions && (a = ep(e, n, r, i)); 4330 let u = op(e, (d) => { 4331 e.notify(13, ss(d)); 4332 }), c = { findActionId: (d) => { 4333 let f = u.findActionId(d), p = a?.findActionId(d) ?? []; 4334 return f.concat(p); 4335 } }; 4336 return t.assemble.register(({ startTime: d, eventType: f }) => { 4337 if (f !== T.ERROR && f !== T.RESOURCE && f !== T.LONG_TASK) return Q; 4338 let p = f === T.LONG_TASK ? Oe(d, 1) : d, l = c.findActionId(p); 4339 return l.length ? { 4340 type: f, 4341 action: { id: l } 4342 } : Q; 4343 }), t.assembleTelemetry.register(({ startTime: d }) => ({ action: { id: c.findActionId(d) } })), { 4344 addAction: u.addAction, 4345 startAction: u.startAction, 4346 stopAction: u.stopAction, 4347 actionContexts: c, 4348 stop: () => { 4349 o(), s(), u.stop(), a?.stop(); 4350 } 4351 }; 4352} 4353function ss(e) { 4354 let t = ap(e), n = jo(_(e.duration)); 4355 return { 4356 rawRumEvent: v({ 4357 type: T.ACTION, 4358 date: e.startClocks.timeStamp, 4359 action: N(v(v({ 4360 id: e.id, 4361 target: { name: e.name }, 4362 type: e.type 4363 }, n !== void 0 && { loading_time: n }), e.counts && { 4364 error: { count: e.counts.errorCount }, 4365 long_task: { count: e.counts.longTaskCount }, 4366 resource: { count: e.counts.resourceCount } 4367 }), { frustration: { type: e.frustrationTypes } }) 4368 }, t ? { _dd: { action: { 4369 target: { 4370 selector: e.target?.selector || void 0, 4371 width: e.target?.width || void 0, 4372 height: e.target?.height || void 0, 4373 composed_path_selector: e.target?.composedPathSelector 4374 }, 4375 position: e.position, 4376 name_source: e.nameSource 4377 } } } : { context: e.context }), 4378 duration: e.duration, 4379 startClocks: e.startClocks, 4380 domainContext: t ? { events: e.events } : { handlingStack: e.handlingStack } 4381 }; 4382} 4383function ap(e) { 4384 return "events" in e; 4385} 4386function up(e) { 4387 let t = sl([nt.cspViolation, nt.intervention]).subscribe((n) => e.notify(n)); 4388 return { stop: () => { 4389 t.unsubscribe(); 4390 } }; 4391} 4392function cp(e, t) { 4393 let n = new k(); 4394 return t.subscribe(({ data: r, type: i }) => { 4395 i === Nt.RUNTIME_ERROR ? n.notify(r) : i === Nt.CONSOLE && r.api === nn.error && n.notify(r.error); 4396 }), up(n), n.subscribe((r) => e.notify(15, { error: r })), lp(e); 4397} 4398function lp(e) { 4399 return e.subscribe(15, ({ error: t }) => { 4400 e.notify(13, dp(t)); 4401 }), { addError: ({ error: t, handlingStack: n, componentStack: r, startClocks: i, context: o }) => { 4402 let s = zn({ 4403 originalError: t, 4404 handlingStack: n, 4405 componentStack: r, 4406 startClocks: i, 4407 nonErrorPrefix: Os.PROVIDED, 4408 source: we.CUSTOM, 4409 handling: Is.HANDLED 4410 }); 4411 s.context = pe(s.context, o), e.notify(15, { error: s }); 4412 } }; 4413} 4414function dp(e) { 4415 let t = { 4416 date: e.startClocks.timeStamp, 4417 error: { 4418 id: H(), 4419 message: e.message, 4420 source: e.source, 4421 stack: e.stack, 4422 handling_stack: e.handlingStack, 4423 component_stack: e.componentStack, 4424 type: e.type, 4425 handling: e.handling, 4426 causes: e.causes, 4427 source_type: "browser", 4428 fingerprint: e.fingerprint, 4429 csp: e.csp 4430 }, 4431 _dd: { debug_ids: e.debugIds }, 4432 type: T.ERROR, 4433 context: e.context 4434 }, n = { 4435 error: e.originalError, 4436 handlingStack: e.handlingStack 4437 }; 4438 return { 4439 rawRumEvent: t, 4440 startClocks: e.startClocks, 4441 domainContext: n 4442 }; 4443} 4444function fp(e) { 4445 return !(e.loadEventEnd > 0 && e.domComplete <= 0); 4446} 4447function pr() { 4448 if (Pe("navigation")) { 4449 let n = performance.getEntriesByType("navigation")[0]; 4450 if (n && fp(n)) return n; 4451 } 4452 let e = pp(), t = v({ 4453 entryType: "navigation", 4454 initiatorType: "navigation", 4455 name: window.location.href, 4456 startTime: 0, 4457 duration: e.loadEventEnd, 4458 decodedBodySize: 0, 4459 encodedBodySize: 0, 4460 transferSize: 0, 4461 workerStart: 0, 4462 toJSON: () => N(v({}, t), { toJSON: void 0 }) 4463 }, e); 4464 return t; 4465} 4466function pp() { 4467 let e = {}, t = performance.timing; 4468 for (let n in t) if (rr(t[n])) { 4469 let r = n, i = t[r]; 4470 e[r] = i === 0 ? 0 : fi(i); 4471 } 4472 return e; 4473} 4474function as(e) { 4475 return e.responseStart >= 0 && e.responseStart <= ee() ? e.responseStart : void 0; 4476} 4477function mp() { 4478 if (Pe("resource")) return performance.getEntriesByType("resource"); 4479} 4480function gp(e, t) { 4481 let n = mp(); 4482 if (n) return Ii(n, (r) => r.name === e && r.startTime <= t); 4483} 4484function yp(e) { 4485 let t = hp(e) || bp(e); 4486 if (!(!t || t.traceTime <= Be() - fu)) return t.traceId; 4487} 4488function hp(e) { 4489 let t = e.querySelector("meta[name=dd-trace-id]"), n = e.querySelector("meta[name=dd-trace-time]"); 4490 return us(t?.content, n?.content); 4491} 4492function bp(e) { 4493 let t = vp(e); 4494 if (t) return us(Hn(t, "trace-id"), Hn(t, "trace-time")); 4495} 4496function us(e, t) { 4497 let n = t && Number(t); 4498 if (!(!e || !n)) return { 4499 traceId: e, 4500 traceTime: n 4501 }; 4502} 4503function vp(e) { 4504 for (let t = 0; t < e.childNodes.length; t += 1) { 4505 let n = cs(e.childNodes[t]); 4506 if (n) return n; 4507 } 4508 if (e.body) for (let t = e.body.childNodes.length - 1; t >= 0; t -= 1) { 4509 let n = e.body.childNodes[t], r = cs(n); 4510 if (r) return r; 4511 if (!ar(n)) break; 4512 } 4513} 4514function cs(e) { 4515 if (e && Zd(e)) { 4516 let t = /^\s*DATADOG;(.*?)\s*$/.exec(e.data); 4517 if (t) return t[1]; 4518 } 4519} 4520function Ep(e) { 4521 let t = /* @__PURE__ */ new Set(), n = e.subscribe(8, (r) => { 4522 t.add(r), t.size > 1e3 && t.delete(t.values().next().value); 4523 }); 4524 return { 4525 getMatchingRequest(r) { 4526 let i = 1 / 0, o; 4527 for (let s of t) { 4528 let a = r.startTime - s.startClocks.relative; 4529 0 <= a && a < i && s.url === r.name && (i = Math.abs(a), o = s); 4530 } 4531 return o && t.delete(o), o; 4532 }, 4533 stop() { 4534 n.unsubscribe(); 4535 } 4536 }; 4537} 4538function Sp(e, t) { 4539 function n(i, o = {}, s = x()) { 4540 let a = o.resourceKey ?? i; 4541 t.start(a, s, v({ url: i }, o)); 4542 } 4543 function r(i, o = {}, s = x()) { 4544 let a = o.resourceKey ?? i, u = t.stop(a, s, { 4545 context: o.context, 4546 type: o.type 4547 }); 4548 if (!u) return; 4549 let c = L(u.startClocks.relative, s.relative), d = { 4550 date: u.startClocks.timeStamp, 4551 type: T.RESOURCE, 4552 resource: { 4553 id: u.id, 4554 type: u.type || z.OTHER, 4555 url: sr(u.url), 4556 duration: _(c), 4557 method: u.method, 4558 status_code: o.statusCode, 4559 size: o.size 4560 }, 4561 _dd: {},
4562 context: u.context 4563 }; 4564 e.notify(13, { 4565 rawRumEvent: d, 4566 startClocks: u.startClocks, 4567 duration: c, 4568 domainContext: { isManual: !0 } 4569 }); 4570 } 4571 return { 4572 startResource: n, 4573 stopResource: r 4574 }; 4575} 4576function _p(e, t) { 4577 let n = Jl(), r = Ep(e); 4578 e.subscribe(9, (c) => { 4579 let d = Cp(c, t); 4580 d && e.notify(13, d); 4581 }); 4582 let i = Ce({ 4583 type: "resource", 4584 buffered: !0 4585 }).subscribe((c) => { 4586 for (let d of c) Bd(d) ? j(() => { 4587 let f = mr(d, r.getMatchingRequest(d), t); 4588 f && e.notify(13, f); 4589 }, 50) : s(() => mr(d, void 0, t)); 4590 }), { stop: o } = Zn("interactive", () => { 4591 s(() => mr(pr(), void 0, t)); 4592 }); 4593 function s(c) { 4594 n.push(() => { 4595 let d = c(); 4596 d && e.notify(13, d); 4597 }); 4598 } 4599 let a = Qt(e), u = Sp(e, a); 4600 return { 4601 startResource: u.startResource, 4602 stopResource: u.stopResource, 4603 stop: () => { 4604 o(), n.stop(), i.unsubscribe(), a.stopAll(); 4605 } 4606 }; 4607} 4608function Cp(e, t) { 4609 let n = L(e.startClocks.timeStamp, e.endClocks.timeStamp), r = { 4610 date: e.startClocks.timeStamp, 4611 type: T.RESOURCE, 4612 resource: { 4613 id: H(), 4614 type: z.WEBSOCKET, 4615 url: e.url, 4616 duration: _(n), 4617 websocket: { 4618 connection_id: e.connectionId, 4619 handshake_succeeded: e.handshakeSucceeded, 4620 start_time: e.startClocks.timeStamp, 4621 end_time: e.endClocks.timeStamp, 4622 start_view_id: e.startViewId, 4623 end_view_id: e.endViewId, 4624 tracking_end_reason: e.trackingEndReason, 4625 close_code: e.closeCode, 4626 close_reason: e.closeReason, 4627 was_clean: e.wasClean, 4628 messages_in: e.messagesIn, 4629 messages_out: e.messagesOut, 4630 time_to_first_message_in: _(e.firstMessageInOffset), 4631 time_to_first_message_out: _(e.firstMessageOutOffset), 4632 last_message_in_at: e.lastMessageInAt, 4633 longest_inbound_silence: _(e.longestInboundSilence), 4634 inbound_idle_duration_before_close: _(e.inboundIdleDurationBeforeClose), 4635 buffered_amount_max: e.bufferedAmountMax, 4636 protocol: e.protocol, 4637 setup_duration: _(e.setupDuration) 4638 } 4639 }, 4640 _dd: { discarded: !t.trackResources } 4641 }; 4642 return { 4643 startClocks: e.startClocks, 4644 duration: n, 4645 rawRumEvent: r, 4646 domainContext: { 4647 isWebSocket: !0, 4648 isManual: !1, 4649 webSocket: e.webSocket 4650 } 4651 }; 4652} 4653function mr(e, t, n) { 4654 let r = t ? Rp(t, n) : kp(e, n); 4655 if (!n.trackResources && !r) return; 4656 let i = lt(e.startTime), o = Kd(e), s = Ip(t, n); 4657 return { 4658 startClocks: i, 4659 duration: o, 4660 rawRumEvent: pe({ 4661 date: i.timeStamp, 4662 resource: v(v({ 4663 id: H(), 4664 duration: _(o), 4665 type: Gd(e), 4666 method: t?.method, 4667 status_code: t ? t.status : Op(e.responseStatus), 4668 url: t ? sr(t.url) : e.name, 4669 protocol: Yd(e), 4670 delivery_type: Jd(e), 4671 graphql: t && wp(t, n), 4672 render_blocking_status: e.renderBlockingStatus 4673 }, Qd(e)), jd(e)), 4674 type: T.RESOURCE, 4675 _dd: { discarded: !n.trackResources } 4676 }, r, Tp(e), s), 4677 domainContext: Ap(e, t) 4678 }; 4679} 4680function wp(e, t) { 4681 let n = Bo(e.url, t); 4682 if (n) return Cf(e, n); 4683} 4684function Tp(e) { 4685 let t = e.contentType; 4686 if (t) return { resource: { response: { headers: { "content-type": t } } } }; 4687} 4688function Ap(e, t) { 4689 return { 4690 performanceEntry: e, 4691 isManual: !1, 4692 isAborted: t ? t.isAborted : !1, 4693 isWebSocket: !1, 4694 handlingStack: t?.handlingStack, 4695 requestInit: t?.init, 4696 requestInput: t?.input, 4697 response: t?.response, 4698 error: t?.error, 4699 xhr: t?.xhr 4700 }; 4701} 4702function Rp(e, t) { 4703 if (e.traceSampled && e.traceId && e.spanId) return { _dd: { 4704 span_id: e.spanId.toString(), 4705 trace_id: e.traceId.toString(), 4706 rule_psr: t.rulePsr 4707 } }; 4708} 4709function kp(e, t) { 4710 if (e.initiatorType !== "navigation") return; 4711 let n = yp(document); 4712 if (n) return { _dd: { 4713 trace_id: n, 4714 span_id: Ho().toString(), 4715 rule_psr: t.rulePsr 4716 } }; 4717} 4718function Op(e) { 4719 return e === 0 ? void 0 : e; 4720} 4721function Ip(e, t) { 4722 let n = t.trackResourceHeaders; 4723 if (n.length === 0 || !e) return; 4724 let r = n.filter((u) => u.url !== void 0 ? Qe([u.url], e.url, !0) : !0); 4725 if (r.length === 0) return; 4726 let i = r.filter((u) => u.location === void 0 || u.location === "any" || u.location === "response"), o = r.filter((u) => u.location === void 0 || u.location === "any" || u.location === "request"), s = i.length > 0 ? xp(e, i) : void 0, a = o.length > 0 ? Np(e, o) : void 0; 4727 if (!(!s && !a)) return { resource: { 4728 request: a ? { headers: a } : void 0, 4729 response: s ? { headers: s } : void 0 4730 } }; 4731} 4732function xp(e, t) { 4733 if (e.type === ot.FETCH && e.response) return gr(e.response.headers, t); 4734 if (e.type === ot.XHR && e.xhr) { 4735 let n = e.xhr.getAllResponseHeaders(); 4736 if (n) try { 4737 return gr(new Headers(Lp(n)), t); 4738 } catch {} 4739 } 4740} 4741function Np(e, t) { 4742 if (e.type !== ot.FETCH) return; 4743 let n; 4744 return e.init?.headers ? n = new Headers(e.init.headers) : e.input instanceof Request && (n = e.input.headers), n ? gr(n, t) : void 0; 4745} 4746function gr(e, t) { 4747 let n = {}, r = 0, i = !1; 4748 return e.forEach((o, s) => { 4749 if (r >= ii) { 4750 i || (w.warn(`Maximum number of headers (${ii}) has been reached. Further headers are dropped.`), i = !0); 4751 return; 4752 } 4753 let a = s.toLowerCase(); 4754 if (pu.test(a)) return; 4755 let u = t.find((f) => Qe([f.name ?? mu], a)); 4756 if (!u) return; 4757 let { extractor: c } = u, d = c ? yo(o, c) : o; 4758 d !== void 0 && (d.length > hn && w.warn(`Header "${a}" value was truncated from ${d.length} to ${hn} characters.`), n[a] = yt(d, hn), r++); 4759 }), r > 0 ? n : void 0; 4760} 4761function Lp(e) { 4762 let t = [], n = e.trim().split(/\r\n/); 4763 for (let r of n) { 4764 let i = r.indexOf(":"); 4765 i > 0 && t.push([r.substring(0, i).trim(), r.substring(i + 1).trim()]); 4766 } 4767 return t; 4768} 4769function Mp(e, t, n) { 4770 let { stop: r, eventCounts: i } = Wo({ 4771 lifeCycle: e, 4772 isChildEvent: (o) => o.view.id === t, 4773 onChange: n 4774 }); 4775 return { 4776 stop: r, 4777 eventCounts: i 4778 }; 4779} 4780function Dp(e, t) { 4781 return { stop: Ce({ 4782 type: "paint", 4783 buffered: !0 4784 }).subscribe((n) => { 4785 let r = n.find((i) => i.name === "first-contentful-paint" && i.startTime < e.timeStamp && i.startTime < gu); 4786 r && t(r.startTime); 4787 }).unsubscribe }; 4788} 4789function Pp(e, t) { 4790 requestAnimationFrame(() => { 4791 requestAnimationFrame(() => { 4792 t(L(e, ee())); 4793 }); 4794 }); 4795} 4796function Up(e) { 4797 return Fp(() => { 4798 let t = pr(); 4799 Vp(t) || e($p(t)); 4800 }); 4801} 4802function $p(e) { 4803 return { 4804 domComplete: e.domComplete, 4805 domContentLoaded: e.domContentLoadedEventEnd, 4806 domInteractive: e.domInteractive, 4807 loadEvent: e.loadEventEnd, 4808 firstByte: as(e) 4809 }; 4810} 4811function Vp(e) { 4812 return e.loadEventEnd <= 0; 4813} 4814function Fp(e) { 4815 let t, { stop: n } = Zn("complete", () => { 4816 t = j(() => e()); 4817 }); 4818 return { stop: () => { 4819 n(), Y(t); 4820 } }; 4821} 4822function Hp(e, t, n, r) { 4823 let i = 1 / 0, { stop: o } = Ie(n, [D.POINTER_DOWN, D.KEY_DOWN], (u) => { 4824 i = u.timeStamp; 4825 }, { 4826 capture: !0, 4827 once: !0 4828 }), s = 0, a = Ce({ 4829 type: "largest-contentful-paint", 4830 buffered: !0 4831 }).subscribe((u) => { 4832 let c = Ii(u, (d) => d.entryType === "largest-contentful-paint" && d.startTime < i && d.startTime < t.timeStamp && d.startTime < yu && d.size > s); 4833 if (c) { 4834 let d; 4835 c.element && (d = Wt(c.element, e.actionNameAttribute)); 4836 let f = qp(c), p = c.startTime, l = Gp(f, p); 4837 r({ 4838 value: p, 4839 targetSelector: d, 4840 resourceUrl: f, 4841 subParts: l 4842 }), s = c.size; 4843 } 4844 }); 4845 return { stop: () => { 4846 o(), a.unsubscribe(); 4847 } }; 4848} 4849function qp(e) { 4850 return e.url === "" ? void 0 : e.url; 4851} 4852function Gp(e, t) { 4853 let n = as(pr()); 4854 if (n === void 0) return; 4855 let r = e ? gp(e, t) : void 0, i = r ? Math.max(n, r.requestStart || r.startTime) : n, o = Math.min(t, Math.max(i, r?.responseEnd || 0)); 4856 return { 4857 loadDelay: i - n, 4858 loadTime: o - i, 4859 renderDelay: t - o 4860 }; 4861} 4862function ls(e, t = window) { 4863 if (document.visibilityState === "hidden") return { 4864 timeStamp: 0, 4865 stop: V 4866 }; 4867 if (Pe("visibility-state")) { 4868 let i = performance.getEntriesByType("visibility-state").filter((o) => o.name === "hidden").find((o) => o.startTime >= e.relative); 4869 if (i) return { 4870 timeStamp: i.startTime, 4871 stop: V 4872 }; 4873 } 4874 let n = 1 / 0, { stop: r }
4874 = Ie(t, [D.PAGE_HIDE, D.VISIBILITY_CHANGE], (i) => { 4875 (i.type === D.PAGE_HIDE || document.visibilityState === "hidden") && (n = i.timeStamp, r()); 4876 }, { capture: !0 }); 4877 return { 4878 get timeStamp() { 4879 return n; 4880 }, 4881 stop: r 4882 }; 4883} 4884function Bp(e, t, n, r) { 4885 let i = {}, { stop: o } = Up((d) => { 4886 n(d.loadEvent), i.navigationTimings = d, r(); 4887 }), s = ls(t), { stop: a } = Dp(s, (d) => { 4888 i.firstContentfulPaint = d, r(); 4889 }), { stop: u } = Hp(e, s, window, (d) => { 4890 i.largestContentfulPaint = d, r(); 4891 }); 4892 function c() { 4893 o(), a(), u(), s.stop(); 4894 } 4895 return { 4896 stop: c, 4897 initialViewMetrics: i 4898 }; 4899} 4900function Kp(e, t, n) { 4901 if (!zp()) return { stop: V }; 4902 let r = 0, i; 4903 n({ value: 0 }); 4904 let o = Wp(), s = Ce({ 4905 type: "layout-shift", 4906 buffered: !0 4907 }).subscribe((a) => { 4908 for (let u of a) { 4909 if (u.hadRecentInput || u.startTime < t) continue; 4910 let { cumulatedValue: c, isMaxValue: d } = o.update(u); 4911 if (d) { 4912 let f = jp(u.sources); 4913 i = { 4914 target: f?.node ? new WeakRef(f.node) : void 0, 4915 time: L(t, u.startTime), 4916 previousRect: f?.previousRect, 4917 currentRect: f?.currentRect, 4918 devicePixelRatio: window.devicePixelRatio 4919 }; 4920 } 4921 if (c > r) { 4922 r = c; 4923 let f = i?.target?.deref(); 4924 n({ 4925 value: vt(r, 4), 4926 targetSelector: f && Wt(f, e.actionNameAttribute), 4927 time: i?.time, 4928 previousRect: i?.previousRect ? ds(i.previousRect) : void 0, 4929 currentRect: i?.currentRect ? ds(i.currentRect) : void 0, 4930 devicePixelRatio: i?.devicePixelRatio 4931 }); 4932 } 4933 } 4934 }); 4935 return { stop: () => { 4936 s.unsubscribe(); 4937 } }; 4938} 4939function jp(e) { 4940 let t; 4941 for (let n of e) if (n.node && he(n.node)) { 4942 let r = oi(n); 4943 (!t || oi(t) < r) && (t = n); 4944 } 4945 return t; 4946} 4947function ds({ x: e, y: t, width: n, height: r }) { 4948 return { 4949 x: e, 4950 y: t, 4951 width: n, 4952 height: r 4953 }; 4954} 4955function Wp() { 4956 let e = 0, t, n, r = 0; 4957 return { update: (i) => { 4958 let o = t === void 0 || i.startTime - n >= vu || i.startTime - t >= bu, s; 4959 return o ? (t = n = i.startTime, r = e = i.value, s = !0) : (e += i.value, n = i.startTime, s = i.value > r, s && (r = i.value)), { 4960 cumulatedValue: e, 4961 isMaxValue: s 4962 }; 4963 } }; 4964} 4965function zp() { 4966 return Pe("layout-shift") && "WeakRef" in window; 4967} 4968function Xp() { 4969 "interactionCount" in performance || vn || (vn = new window.PerformanceObserver(R((e) => { 4970 e.getEntries().forEach((t) => { 4971 let n = t; 4972 n.interactionId && (En = Math.min(En, n.interactionId), Sn = Math.max(Sn, n.interactionId), si = (Sn - En) / 7 + 1); 4973 }); 4974 })), vn.observe({ 4975 type: "event", 4976 buffered: !0, 4977 durationThreshold: 0 4978 })); 4979} 4980function Yp(e, t, n) { 4981 if (!em()) return { 4982 getInteractionToNextPaint: () => {}, 4983 setViewEnd: V, 4984 stop: V 4985 }; 4986 let r = 1 / 0, i, { getViewInteractionCount: o, stopViewInteractionCount: s } = Qp(n), a = Jp(o), u = Zp(a), c = Ce({ 4987 type: "first-input", 4988 buffered: !0 4989 }).subscribe(f), d = Ce({ 4990 type: "event", 4991 durationThreshold: 40, 4992 buffered: !0 4993 }).subscribe(f); 4994 function f(l) { 4995 for (let g of l) g.interactionId && g.startTime >= t && g.startTime <= r && (a.process(g), u.process(g)); 4996 u.pruneUntracked(); 4997 let m = a.estimateP98Interaction(); 4998 m && p(m); 4999 } 5000 function p(l) { 5001 let m = L(t, l.startTime); 5002 if (l.duration !== i?.duration || m !== i.startTime) { 5003 let g = Zf(l.startTime); 5004 !g && l.target && he(l.target) && (g = Wt(l.target, e.actionNameAttribute)), i = { 5005 duration: l.duration, 5006 startTime: m, 5007 targetSelector: g 5008 }; 5009 } 5010 i.subParts = u.computeSubParts(l, fs(i.duration)); 5011 } 5012 return { 5013 getInteractionToNextPaint: () => { 5014 if (i) return { 5015 value: fs(i.duration), 5016 targetSelector: i.targetSelector, 5017 time: i.startTime, 5018 subParts: i.subParts 5019 }; 5020 if (o()) return { value: 0 }; 5021 }, 5022 setViewEnd: (l) => { 5023 r = l, s(); 5024 }, 5025 stop: () => { 5026 d.unsubscribe(), c.unsubscribe(), u.stop(); 5027 } 5028 }; 5029} 5030function Jp(e) { 5031 let t = []; 5032 function n() { 5033 t.sort((r, i) => i.duration - r.duration).splice(ui); 5034 } 5035 return { 5036 process(r) { 5037 let i = t.findIndex((s) => r.interactionId === s.interactionId), o = t[t.length - 1]; 5038 i !== -1 ? r.duration > t[i].duration && (t[i] = r, n()) : (t.length < ui || r.duration > o.duration) && (t.push(r), n()); 5039 }, 5040 estimateP98Interaction() { 5041 let r = Math.min(t.length - 1, Math.floor(e() / 50)); 5042 return t[r]; 5043 }, 5044 isTracked(r) { 5045 return t.some((i) => i.interactionId === r); 5046 } 5047 }; 5048} 5049function Qp(e) { 5050 Xp(); 5051 let t = e === de.INITIAL_LOAD ? 0 : ai(), n = { stopped: !1 }; 5052 function r() { 5053 return ai() - t; 5054 } 5055 return { 5056 getViewInteractionCount: () => n.stopped ? n.interactionCount : r(), 5057 stopViewInteractionCount: () => { 5058 n = { 5059 stopped: !0, 5060 interactionCount: r() 5061 }; 5062 } 5063 }; 5064} 5065function Zp(e) { 5066 let t = /* @__PURE__ */ new Map(); 5067 function n(r, i) { 5068 r.startTime = Math.min(i.startTime, r.startTime), r.processingStart = Math.min(i.processingStart, r.processingStart), r.processingEnd = Math.max(i.processingEnd, r.processingEnd); 5069 } 5070 return { 5071 process(r) { 5072 if (r.interactionId === void 0 || !r.processingStart || !r.processingEnd) return; 5073 let i = r.startTime + r.duration, o = t.get(r.interactionId); 5074 if (o) { 5075 n(o, r); 5076 return; 5077 } 5078 for (let [, s] of t.entries()) if (Math.abs(i - s.referenceRenderTime) <= Su) { 5079 n(s, r), t.set(r.interactionId, s); 5080 return; 5081 } 5082 t.set(r.interactionId, { 5083 startTime: r.startTime, 5084 processingStart: r.processingStart, 5085 processingEnd: r.processingEnd, 5086 referenceRenderTime: i 5087 }); 5088 }, 5089 pruneUntracked() { 5090 for (let [r] of t) e.isTracked(r) || t.delete(r); 5091 }, 5092 computeSubParts(r, i) { 5093 if (!r.processingStart || !r.processingEnd || r.interactionId === void 0) return; 5094 let o = t.get(r.interactionId); 5095 if (!o) return; 5096 let s = Math.max(o.startTime + i, o.processingStart), a = Math.min(o.processingEnd, s); 5097 return { 5098 inputDelay: L(o.startTime, o.processingStart), 5099 processingDuration: L(o.processingStart, a), 5100 presentationDelay: L(a, s) 5101 }; 5102 }, 5103 stop() { 5104 t.clear(); 5105 } 5106 }; 5107} 5108function em() { 5109 return Pe("event") && window.PerformanceEventTiming && "interactionId" in PerformanceEventTiming.prototype; 5110} 5111function fs(e) { 5112 return Math.min(e, Eu); 5113} 5114function tm(e, t, n, r, i, o, s) { 5115 let a = i === de.INITIAL_LOAD, u = !0, c = [], d = ls(o); 5116 function f() { 5117 if (!u && !a && c.length > 0) { 5118 let l = Math.max(...c); 5119 l < d.timeStamp - o.relative && s(l); 5120 } 5121 } 5122 let { stop: p } = dr(e, t, n, r, (l) => { 5123 u && (u = !1, l.hadActivity && c.push(L(o.timeStamp, l.end)), f()); 5124 }); 5125 return { 5126 stop: () => { 5127 p(), d.stop(); 5128 }, 5129 setLoadEvent: (l) => { 5130 a && (a = !1, c.push(l), f()); 5131 } 5132 }; 5133} 5134function nm(e, t, n = im()) { 5135 let r = 0, i = 0, o = 0, s = n.subscribe(({ scrollDepth: a, scrollTop: u, scrollHeight: c }) => { 5136 let d = !1; 5137 if (a > r && (r = a, d = !0), c > i) { 5138 i = c;
5139 let f = ee(); 5140 o = L(e.relative, f), d = !0; 5141 } 5142 d && t({ 5143 maxDepth: Math.min(r, i), 5144 maxDepthScrollTop: u, 5145 maxScrollHeight: i, 5146 maxScrollHeightTime: o 5147 }); 5148 }); 5149 return { stop: () => s.unsubscribe() }; 5150} 5151function rm() { 5152 let e = $o(), { height: t } = Yt(); 5153 return { 5154 scrollHeight: Math.round((document.scrollingElement || document.documentElement).scrollHeight), 5155 scrollDepth: Math.round(t + e), 5156 scrollTop: e 5157 }; 5158} 5159function im(e = _u) { 5160 return new k((t) => { 5161 function n() { 5162 t.notify(rm()); 5163 } 5164 let r = pt(n, e, { 5165 leading: !1, 5166 trailing: !0 5167 }), i = document.scrollingElement || document.documentElement, o = new ResizeObserver(R(r.throttled)); 5168 i && o.observe(i); 5169 let s = U(window, D.SCROLL, r.throttled, { passive: !0 }); 5170 return () => { 5171 r.cancel(), o.disconnect(), s.stop(); 5172 }; 5173 }); 5174} 5175function om(e, t, n, r, i, o, s) { 5176 let a = {}, u = !1, c = !1, { stop: d, setLoadEvent: f } = tm(e, t, n, r, o, s, (S) => { 5177 u || (a.loadingTime = S, i()); 5178 }), { stop: p } = nm(s, (S) => { 5179 a.scroll = S; 5180 }), { stop: l } = Kp(r, s.relative, (S) => { 5181 a.cumulativeLayoutShift = S, i(); 5182 }), { stop: m, getInteractionToNextPaint: g, setViewEnd: h } = Yp(r, s.relative, o); 5183 return { 5184 stop: () => { 5185 d(), l(), p(); 5186 }, 5187 stopINPTracking: m, 5188 setLoadEvent: f, 5189 setViewEnd: (S) => { 5190 c = !0, h(S); 5191 }, 5192 getCommonViewMetrics: () => (a.interactionToNextPaint = g(), a), 5193 setLoadingTime: (S) => { 5194 if (c) return; 5195 let $ = L(s.timeStamp, S ?? G()); 5196 u || d(), u = !0, a.loadingTime = $, i(); 5197 } 5198 }; 5199} 5200function sm(e) { 5201 let { stop: t } = U(window, D.PAGE_SHOW, (n) => { 5202 n.persisted && e(n); 5203 }, { capture: !0 }); 5204 return t; 5205} 5206function am(e, t, n) { 5207 Pp(e.relative, (r) => { 5208 t.firstContentfulPaint = r, t.largestContentfulPaint = { value: r }, n(); 5209 }); 5210} 5211function um(e, t, n, r, i, o, s) { 5212 let a = /* @__PURE__ */ new Set(), u = f(de.INITIAL_LOAD, xn(), s), c; 5213 p(); 5214 let d; 5215 o && (d = l(i), c = sm((m) => { 5216 u.end(); 5217 let g = lt(m.timeStamp); 5218 u = f(de.BF_CACHE, g, void 0); 5219 })); 5220 function f(m, g, h) { 5221 let S = cm(e, t, n, r, m, g, h); 5222 return a.add(S), S.stopObservable.subscribe(() => { 5223 a.delete(S); 5224 }), S; 5225 } 5226 function p() { 5227 e.subscribe(11, () => { 5228 u = f(de.SESSION_RENEWAL, void 0, { 5229 name: u.name, 5230 service: u.service, 5231 version: u.version, 5232 context: u.contextManager.getContext() 5233 }); 5234 }), e.subscribe(10, ({ endClocks: m }) => { 5235 u.end({ 5236 sessionIsActive: !1, 5237 endClocks: m 5238 }); 5239 }); 5240 } 5241 function l(m) { 5242 return m.subscribe(({ oldLocation: g, newLocation: h }) => { 5243 dm(g, h) && (u.end(), u = f(de.ROUTE_CHANGE)); 5244 }); 5245 } 5246 return { 5247 addTiming: (m, g = G()) => { 5248 u.addTiming(m, g); 5249 }, 5250 setLoadingTime: (m) => u.setLoadingTime(m), 5251 startView: (m, g) => { 5252 u.end({ endClocks: g }), u = f(de.ROUTE_CHANGE, g, m); 5253 }, 5254 setViewContext: (m) => { 5255 u.contextManager.setContext(m); 5256 }, 5257 setViewContextProperty: (m, g) => { 5258 u.contextManager.setContextProperty(m, g); 5259 }, 5260 setViewName: (m) => { 5261 u.setViewName(m); 5262 }, 5263 getViewContext: () => u.contextManager.getContext(), 5264 stop: () => { 5265 d && d.unsubscribe(), c && c(), u.end(), a.forEach((m) => m.stop()); 5266 } 5267 }; 5268} 5269function cm(e, t, n, r, i, o = x(), s) { 5270 let a = H(), u = new k(), c = {}, d = 0, f, p = mt(window.location), l = Kt(), m = !0, g = s?.name, h = s?.service || r.service, S = s?.version || r.version, $ = s?.context, M = s?.handlingStack; 5271 $ && l.setContext($); 5272 let X = { 5273 id: a, 5274 name: g, 5275 startClocks: o, 5276 service: h, 5277 version: S, 5278 context: $, 5279 url: s?.url 5280 }; 5281 e.notify(1, X), e.notify(2, X); 5282 let { throttled: b, cancel: y } = pt(re, Cu, { leading: !1 }), { setLoadEvent: E, setViewEnd: C, stop: P, stopINPTracking: ae, getCommonViewMetrics: Cn, setLoadingTime: wn } = om(e, t, n, r, ve, i, o), { stop: Tn, initialViewMetrics: Lt } = i === de.INITIAL_LOAD ? Bp(r, o, E, ve) : { 5283 stop: V, 5284 initialViewMetrics: {} 5285 }; 5286 i === de.BF_CACHE && am(o, Lt, ve); 5287 let { stop: An, eventCounts: Rn } = Mp(e, a, ve), kn = Ke(re, wu), ut = e.subscribe(12, (ie) => { 5288 ie === tt.UNLOADING && re(); 5289 }); 5290 re(), l.changeObservable.subscribe(ve); 5291 function Mt() { 5292 e.notify(3, { 5293 id: a, 5294 name: g, 5295 context: l.getContext(), 5296 startClocks: o, 5297 sessionIsActive: m 5298 }); 5299 } 5300 function ve() { 5301 Mt(), b(); 5302 } 5303 function re() { 5304 y(), Mt(), d += 1; 5305 let ie = f === void 0 ? G() : f.timeStamp; 5306 e.notify(4, { 5307 customTimings: c, 5308 documentVersion: d, 5309 id: a, 5310 name: g, 5311 service: h, 5312 version: S, 5313 context: l.getContext(), 5314 loadingType: i, 5315 location: p, 5316 handlingStack: M, 5317 startClocks: o,
5318 commonViewMetrics: Cn(), 5319 initialViewMetrics: Lt, 5320 duration: L(o.timeStamp, ie), 5321 isActive: f === void 0, 5322 sessionIsActive: m, 5323 eventCounts: Rn 5324 }); 5325 } 5326 return { 5327 get name() { 5328 return g; 5329 }, 5330 service: h, 5331 version: S, 5332 contextManager: l, 5333 stopObservable: u, 5334 end(ie = {}) { 5335 f || (f = ie.endClocks ?? x(), m = ie.sessionIsActive ?? !0, e.notify(5, { endClocks: f }), e.notify(6, { endClocks: f }), ft(kn), C(f.relative), P(), ut.unsubscribe(), re(), j(() => { 5336 this.stop(); 5337 }, Tu)); 5338 }, 5339 stop() { 5340 Tn(), An(), ae(), u.notify(); 5341 }, 5342 addTiming(ie, Re) { 5343 if (f) return; 5344 let Pu = Xu(Re) ? Re : L(o.timeStamp, Re); 5345 c[lm(ie)] = Pu, ve(); 5346 }, 5347 setLoadingTime: wn, 5348 setViewName(ie) { 5349 g = ie, re(); 5350 } 5351 }; 5352} 5353function lm(e) { 5354 let t = e.replace(/[^a-zA-Z0-9-_.@$]/g, "_"); 5355 return t !== e && w.warn(`Invalid timing name: ${e}, sanitized to: ${t}`), t; 5356} 5357function dm(e, t) { 5358 return e.pathname !== t.pathname || !fm(t.hash) && ps(t.hash) !== ps(e.hash); 5359} 5360function fm(e) { 5361 let t = e.substring(1); 5362 return t !== "" && !!document.getElementById(t); 5363} 5364function ps(e) { 5365 let t = e.indexOf("?"); 5366 return t < 0 ? e : e.slice(0, t); 5367} 5368function pm(e, t, n, r, i, o, s, a, u) { 5369 return e.subscribe(4, (c) => e.notify(13, mm(c, n, s))), t.assemble.register(({ startTime: c, eventType: d }) => { 5370 let f = a.findView(c); 5371 return f ? { 5372 type: d, 5373 service: f.service, 5374 version: f.version, 5375 context: f.context, 5376 view: { 5377 id: f.id, 5378 name: f.name 5379 } 5380 } : Te; 5381 }), t.assembleTelemetry.register(({ startTime: c }) => ({ view: { id: a.findView(c)?.id } })), um(e, r, i, n, o, !n.trackViewsManually, u); 5382} 5383function mm(e, t, n) { 5384 let r = n.getReplayStats(e.id), i = e.commonViewMetrics?.cumulativeLayoutShift?.devicePixelRatio, o = { 5385 _dd: { 5386 document_version: e.documentVersion, 5387 replay_stats: r, 5388 cls: i ? { device_pixel_ratio: i } : void 0, 5389 configuration: { 5390 start_session_replay_recording_manually: t.startSessionReplayRecordingManually, 5391 remote_configuration_id: t.remoteConfigurationId 5392 } 5393 }, 5394 date: e.startClocks.timeStamp, 5395 type: T.VIEW, 5396 view: { 5397 action: { count: e.eventCounts.actionCount }, 5398 frustration: { count: e.eventCounts.frustrationCount }, 5399 cumulative_layout_shift: e.commonViewMetrics.cumulativeLayoutShift?.value, 5400 cumulative_layout_shift_time: _(e.commonViewMetrics.cumulativeLayoutShift?.time), 5401 cumulative_layout_shift_target_selector: e.commonViewMetrics.cumulativeLayoutShift?.targetSelector, 5402 first_byte: _(e.initialViewMetrics.navigationTimings?.firstByte), 5403 dom_complete: _(e.initialViewMetrics.navigationTimings?.domComplete), 5404 dom_content_loaded: _(e.initialViewMetrics.navigationTimings?.domContentLoaded), 5405 dom_interactive: _(e.initialViewMetrics.navigationTimings?.domInteractive), 5406 error: { count: e.eventCounts.errorCount }, 5407 first_contentful_paint: _(e.initialViewMetrics.firstContentfulPaint), 5408 interaction_to_next_paint: _(e.commonViewMetrics.interactionToNextPaint?.value), 5409 interaction_to_next_paint_time: _(e.commonViewMetrics.interactionToNextPaint?.time), 5410 interaction_to_next_paint_target_selector: e.commonViewMetrics.interactionToNextPaint?.targetSelector, 5411 is_active: e.isActive, 5412 name: e.name, 5413 largest_contentful_paint: _(e.initialViewMetrics.largestContentfulPaint?.value), 5414 largest_contentful_paint_target_selector: e.initialViewMetrics.largestContentfulPaint?.targetSelector, 5415 load_event: _(e.initialViewMetrics.navigationTimings?.loadEvent), 5416 loading_time: jo(_(e.commonViewMetrics.loadingTime)), 5417 loading_type: e.loadingType, 5418 long_task: { count: e.eventCounts.longTaskCount }, 5419 performance: gm(e.commonViewMetrics, e.initialViewMetrics), 5420 resource: { count: e.eventCounts.resourceCount }, 5421 time_spent: _(e.duration) 5422 }, 5423 display: e.commonViewMetrics.scroll ? { scroll: { 5424 max_depth: e.commonViewMetrics.scroll.maxDepth, 5425 max_depth_scroll_top: e.commonViewMetrics.scroll.maxDepthScrollTop, 5426 max_scroll_height: e.commonViewMetrics.scroll.maxScrollHeight, 5427 max_scroll_height_time: _(e.commonViewMetrics.scroll.maxScrollHeightTime) 5428 } } : void 0, 5429 privacy: { replay_level: t.defaultPrivacyLevel }, 5430 device: { 5431 locale: navigator.language, 5432 locales: navigator.languages, 5433 time_zone: md() 5434 } 5435 }; 5436 return ge(e.customTimings) || (o.view.custom_timings = Ai(e.customTimings, _)), { 5437 rawRumEvent: o, 5438 startClocks: e.startClocks, 5439 duration: e.duration, 5440 domainContext: { 5441 location: e.location, 5442 handlingStack: e.handlingStack 5443 } 5444 }; 5445} 5446function gm({ cumulativeLayoutShift: e, interactionToNextPaint: t }, { firstContentfulPaint: n, largestContentfulPaint: r }) { 5447 return { 5448 cls: e && { 5449 score: e.value, 5450 timestamp: _(e.time), 5451 target_selector: e.targetSelector, 5452 previous_rect: e.previousRect, 5453 current_rect: e.currentRect 5454 }, 5455 fcp: n && { timestamp: _(n) }, 5456 inp: t && { 5457 duration: _(t.value), 5458 timestamp: _(t.time), 5459 target_selector: t.targetSelector, 5460 sub_parts: t.subParts ? { 5461 input_delay: _(t.subParts.inputDelay), 5462 processing_duration: _(t.subParts.processingDuration), 5463 presentation_delay: _(t.subParts.presentationDelay) 5464 } : void 0 5465 }, 5466 lcp: r && { 5467 timestamp: _(r.value), 5468 target_selector: r.targetSelector, 5469 resource_url: r.resourceUrl, 5470 sub_parts: r.subParts ? { 5471 load_delay: _(r.subParts.loadDelay), 5472 load_time: _(r.subParts.loadTime), 5473 render_delay: _(r.subParts.renderDelay) 5474 } : void 0 5475 } 5476 }; 5477} 5478function yr(e, t) { 5479 if (e === t) return !0; 5480 if (e === null || typeof e != "object" || t === null || typeof t != "object") return e === t; 5481 if (Array.isArray(e) && Array.isArray(t)) return e.length !== t.length ? !1 : e.every((s, a) => yr(s, t[a])); 5482 if (Array.isArray(e) || Array.isArray(t)) return !1; 5483 let n = e, r = t, i = Object.keys(n), o = Object.keys(r); 5484 return i.length !== o.length ? !1 : i.every((s) => o.includes(s) && yr(n[s], r[s])); 5485} 5486function ms(e, t, n) { 5487 let r = {}
5487, i = n?.replaceKeys ?? /* @__PURE__ */ new Set(), o = n?.appendKeys ?? /* @__PURE__ */ new Set(), s = n?.ignoreKeys ?? /* @__PURE__ */ new Set(); 5488 for (let a of Object.keys(e)) { 5489 if (s.has(a)) continue; 5490 let u = e[a], c = t[a]; 5491 if (!i.has(a) && ue(u) && ue(c)) { 5492 let d = ms(u, c, { 5493 replaceKeys: hr(i, a), 5494 appendKeys: hr(o, a), 5495 ignoreKeys: hr(s, a) 5496 }); 5497 d && (r[a] = d); 5498 } else o.has(a) && Array.isArray(u) && Array.isArray(c) ? u.length > c.length && (r[a] = u.slice(c.length)) : yr(u, c) || (r[a] = u); 5499 } 5500 for (let a of Object.keys(t)) a in e || (r[a] = null); 5501 return Object.keys(r).length > 0 ? r : void 0; 5502} 5503function hr(e, t) { 5504 let n = /* @__PURE__ */ new Set(); 5505 for (let r of e) r.startsWith(`${t}.`) && n.add(r.slice(t.length + 1)); 5506 return n; 5507} 5508function ym(e, t) { 5509 let n = ms(e, t, { 5510 replaceKeys: /* @__PURE__ */ new Set([ 5511 "view.custom_timings", 5512 "context", 5513 "connectivity", 5514 "usr", 5515 "device", 5516 "privacy" 5517 ]), 5518 appendKeys: /* @__PURE__ */ new Set(["_dd.page_states"]), 5519 ignoreKeys: /* @__PURE__ */ new Set([ 5520 "date", 5521 "type", 5522 "application", 5523 "session", 5524 "view.id", 5525 "view.url", 5526 "_dd.document_version", 5527 "_dd.format_version" 5528 ]) 5529 }); 5530 if (n) return pe(n, { 5531 type: T.VIEW_UPDATE, 5532 date: e.date, 5533 application: e.application, 5534 session: e.session, 5535 view: { 5536 id: e.view.id, 5537 url: e.view.url 5538 }, 5539 _dd: { 5540 document_version: e._dd.document_version, 5541 format_version: e._dd.format_version 5542 } 5543 }); 5544} 5545function hm(e, t) { 5546 let n, r, i = !1, o = 0, { unsubscribe: s } = e.flushObservable.subscribe(() => { 5547 i = !1, r = n; 5548 }); 5549 return { 5550 dispatch: (a) => { 5551 if (a.type !== T.VIEW) { 5552 e.add(a); 5553 return; 5554 } 5555 if (!t) { 5556 e.upsert(a, a.view.id); 5557 return; 5558 } 5559 let u = a.view.id; 5560 if (!a.view.is_active) { 5561 u === n?.view.id && (n = void 0, r = void 0, i = !1, o = 0), e.upsert(a, u); 5562 return; 5563 } 5564 if (u !== n?.view.id) { 5565 o = 0, e.upsert(a, u), n = a, i = !e.isEmpty; 5566 return; 5567 } 5568 if (n = a, i) { 5569 e.upsert(a, u); 5570 return; 5571 } 5572 if (o += 1, o >= 100) { 5573 o = 0, e.upsert(a, u), i = !e.isEmpty; 5574 return; 5575 } 5576 if (r) { 5577 let c = ym(a, r); 5578 c && ($t("rum", c), e.upsert(c, u)); 5579 } 5580 }, 5581 stop: s 5582 }; 5583} 5584function bm(e, t, n, r, i) { 5585 let o = [dt(e, "rum")], s = mi(e, "rum"); 5586 s && o.push(s); 5587 let a = Di({ 5588 encoder: i(Xr.RUM), 5589 endpoints: o, 5590 reportError: n 5591 }); 5592 r.subscribe(() => a.forceFlush("session_expire")); 5593 let { dispatch: u, stop: c } = hm(a, e.betaEnableViewUpdates); 5594 t.subscribe(14, u); 5595 let d = a.stop.bind(a); 5596 return a.stop = () => { 5597 c(), d(); 5598 }, a; 5599} 5600function vm(e) { 5601 let t = xe(); 5602 e.subscribe(14, (n) => { 5603 t.send("rum", n); 5604 }); 5605} 5606function Em(e, t, n) { 5607 let r = Me({ expireDelay: Au }), i; 5608 e.subscribe(1, ({ startClocks: a, url: u }) => { 5609 let c = O.location.href, d = u !== void 0 ? Ee(u, c).href : c; 5610 r.add(s({ 5611 url: d, 5612 referrer: i || document.referrer 5613 }), a.relative), i = d; 5614 }), e.subscribe(6, ({ endClocks: a }) => { 5615 r.closeActive(a.relative); 5616 }); 5617 let o = n.subscribe(({ newLocation: a }) => { 5618 let u = r.find(); 5619 if (u) { 5620 let c = ee(); 5621 r.closeActive(c), r.add(s({ 5622 url: a.href, 5623 referrer: u.referrer 5624 }), c); 5625 } 5626 }); 5627 function s({ url: a, referrer: u }) { 5628 return { 5629 url: a, 5630 referrer: u 5631 }; 5632 } 5633 return t.register(({ startTime: a, eventType: u }) => { 5634 let c = r.find(a); 5635 return c ? { 5636 type: u, 5637 view: { 5638 url: c.url, 5639 referrer: c.referrer 5640 } 5641 } : Te; 5642 }), { 5643 findUrl: (a) => r.find(a), 5644 stop: () => { 5645 o.unsubscribe(), r.stop(); 5646 } 5647 }; 5648} 5649function Sm() { 5650 let e = mt(br()); 5651 return new k((t) => { 5652 let { stop: n } = _m(i), { stop: r } = Cm(i); 5653 function i() { 5654 if (e.href === br().href) return; 5655 let o = mt(br()); 5656 t.notify({ 5657 newLocation: o, 5658 oldLocation: e 5659 }), e = o; 5660 } 5661 return () => { 5662 n(), r(); 5663 }; 5664 }); 5665} 5666function br() { 5667 return O.location; 5668} 5669function _m(e) { 5670 let { stop: t } = oe(gs("pushState"), "pushState", ({ onPostCall: i }) => { 5671 i(e); 5672 }), { stop: n } = oe(gs("replaceState"), "replaceState", ({ onPostCall: i }) => { 5673 i(e); 5674 }), { stop: r } = U(window, D.POP_STATE, e); 5675 return { stop: () => { 5676 t(), n(), r(); 5677 } }; 5678} 5679function Cm(e) { 5680 return U(window, D.HASH_CHANGE, e); 5681} 5682function gs(e) { 5683 return Object.prototype.hasOwnProperty.call(history, e) ? history : History.prototype; 5684} 5685function wm(e, t, n) { 5686 let r = Me({ expireDelay: Ru }); 5687 return e.subscribe(1, ({ startClocks: i }) => { 5688 r.add({}, i.relative); 5689 }), e.subscribe(6, ({ endClocks: i }) => { 5690 r.closeActive(i.relative); 5691 }), t.register(({ startTime: i, eventType: o }) => { 5692 if (!n.trackFeatureFlagsForEvents.concat([T.VIEW, T.ERROR]).includes(o)) return Q; 5693 let s = r.find(i); 5694 return !s || ge(s) ? Q : { 5695 type: o, 5696 feature_flags: s 5697 }; 5698 }), { addFeatureFlagEvaluation: (i, o) => { 5699 let s = r.find(); 5700 s && (s[i] = o); 5701 } }; 5702} 5703function Tm(e, t, n) { 5704 e.metricsEnabled && (bs(), _n = !1, t.subscribe(14, () => { 5705 _n = !0; 5706 }), n.subscribe(({ bytesCount: r, messagesCount: i }) => { 5707 _n && (_n = !1, at.batchCount += 1, hs(at.batchBytesCount, r), hs(at.batchMessagesCount, i)); 5708 }), Ke(Am, ku)); 5709} 5710function Am() { 5711 at.batchCount !== 0 && (gt(Rt.CUSTOMER_DATA_METRIC_NAME, at), bs()); 5712} 5713function ys() { 5714 return { 5715 min: 1 / 0, 5716 max: 0, 5717 sum: 0 5718 }; 5719} 5720function hs(e, t) { 5721 e.sum += t, e.min = Math.min(e.min, t), e.max = Math.max(e.max, t); 5722} 5723function bs() { 5724 at = { 5725 batchCount: 0, 5726 batchBytesCount: ys(), 5727 batchMessagesCount: ys() 5728 }; 5729} 5730function Rm(e, t = 500) { 5731 let n = Me({ 5732 expireDelay: Iu, 5733 maxEntries: Ou 5734 }), r; 5735 Pe("visibility-state") && performance.getEntriesByType("visibility-state").forEach((a) => { 5736 o(a.name === "hidden" ? "hidden" : "active", a.startTime); 5737 }), o(vs(), ee()); 5738 let { stop: i } = Ie(window, [ 5739 D.PAGE_SHOW, 5740 D.FOCUS, 5741 D.BLUR, 5742 D.VISIBILITY_CHANGE, 5743 D.RESUME, 5744 D.FREEZE, 5745 D.PAGE_HIDE 5746 ], (a) => { 5747 o(Om(a), a.timeStamp); 5748 }, { capture: !0 }); 5749 function o(a, u = ee()) { 5750 a !== r && (r = a, n.closeActive(u), n.add({ 5751 state: r, 5752 startTime: u 5753 }, u)); 5754 } 5755 function s(a, u, c) { 5756 return n.findAll(u, c).some((d) => d.state === a); 5757 } 5758 return e.register(({ startTime: a, duration: u = 0, eventType: c }) => c === T.VIEW ? { 5759 type: c, 5760 _dd: { page_states: km(n.findAll(a, u), a, t) } 5761 } : c === T.ACTION || c === T.ERROR ? { 5762 type: c, 5763 view: { in_foreground: s("active", a, 0) } 5764 } : Q), { 5765 wasInPageStateDuringPeriod: s, 5766 addPageState: o, 5767 stop: () => { 5768 i(), n.stop(); 5769 } 5770 }; 5771} 5772function km(e, t, n) { 5773 if (e.length !== 0) return e.slice(-n).reverse().map(({ state: r, startTime: i }) => ({ 5774 state: r, 5775 start: _(L(t, i)) 5776 })); 5777}
5778function Om(e) { 5779 return e.type === D.FREEZE ? "frozen" : e.type === D.PAGE_HIDE ? e.persisted ? "frozen" : "terminated" : vs(); 5780} 5781function vs() { 5782 return document.visibilityState === "hidden" ? "hidden" : document.hasFocus() ? "active" : "passive"; 5783} 5784function Im(e) { 5785 let t, n = requestAnimationFrame(R(() => { 5786 t = Yt(); 5787 })), r = Vo().subscribe((i) => { 5788 t = i; 5789 }).unsubscribe; 5790 return e.register(({ eventType: i }) => ({ 5791 type: i, 5792 display: t ? { viewport: t } : void 0 5793 })), { stop: () => { 5794 r(), n && cancelAnimationFrame(n); 5795 } }; 5796} 5797function xm(e, t) { 5798 let n = Qt(e); 5799 function r(u) { 5800 return !t.wasInPageStateDuringPeriod("frozen", u.startClocks.relative, u.duration); 5801 } 5802 function i(u) { 5803 r(u) && e.notify(13, Es(u)); 5804 } 5805 function o(u, c, d, f) { 5806 let { operationKey: p, context: l, description: m, handlingStack: g } = d || {}, h = { 5807 name: u, 5808 type: fe.OPERATION_STEP, 5809 operationKey: p, 5810 failureReason: f, 5811 stepType: c, 5812 startClocks: x(), 5813 context: A(l), 5814 description: m, 5815 handlingStack: g 5816 }; 5817 e.notify(13, Es(h)); 5818 } 5819 function s(u, c = {}, d = x()) { 5820 let { id: f } = n.start(c.vitalKey ?? u, d, v({ name: u }, c)); 5821 e.notify(17, v({ 5822 id: f, 5823 name: u, 5824 startClocks: d 5825 }, c)); 5826 } 5827 function a(u, c = {}, d = x()) { 5828 let f = n.stop(c.vitalKey ?? u, d, c); 5829 f && i(v({ type: fe.DURATION }, f)); 5830 } 5831 return { 5832 addOperationStepVital: o, 5833 addDurationVital: i, 5834 startDurationVital: s, 5835 stopDurationVital: a 5836 }; 5837} 5838function Es(e) { 5839 let { startClocks: t, type: n, name: r, description: i, context: o, handlingStack: s } = e, a = v({ 5840 id: (e.type === fe.DURATION ? e.id : void 0) ?? H(), 5841 type: n, 5842 name: r, 5843 description: i 5844 }, n === fe.DURATION ? { duration: _(e.duration) } : { 5845 step_type: e.stepType, 5846 operation_key: e.operationKey, 5847 failure_reason: e.failureReason 5848 }); 5849 return { 5850 rawRumEvent: { 5851 date: t.timeStamp, 5852 vital: a, 5853 type: T.VITAL, 5854 context: o 5855 }, 5856 startClocks: t, 5857 duration: n === fe.DURATION ? e.duration : void 0, 5858 domainContext: s ? { handlingStack: s } : {} 5859 }; 5860} 5861function Nm(e, t, n, r, i) { 5862 e.register(({ eventType: o, startTime: s }) => { 5863 let a = n.findTrackedSession(s), u = i.findView(s); 5864 if (!a || !u) return Te; 5865 let c, d, f; 5866 return o === T.VIEW ? (c = r.getReplayStats(u.id) ? !0 : void 0, d = Fo(a, t) === 1, f = u.sessionIsActive ? void 0 : !1) : c = r.isRecording() ? !0 : void 0, { 5867 type: o, 5868 session: { 5869 id: a.id, 5870 type: "user", 5871 has_replay: c, 5872 sampled_for_replay: d, 5873 is_active: f 5874 } 5875 }; 5876 }); 5877} 5878function Lm(e) { 5879 let t = Qi() ? Mm() : Dm; 5880 return new k((n) => t(e, (r) => n.notify(r))); 5881} 5882function Mm() { 5883 return (e, t) => U(O.cookieStore, D.CHANGE, (n) => { 5884 let r = n.changed.find((i) => i.name === e) || n.deleted.find((i) => i.name === e); 5885 r && t(r.value); 5886 }).stop; 5887} 5888function Dm(e, t) { 5889 let n = qt(e), r = Ke(() => { 5890 let i = qt(e); 5891 i !== n && (n = i, t(i)); 5892 }, xu); 5893 return () => { 5894 ft(r); 5895 }; 5896} 5897function Pm(e, t = Lm(Nu)) { 5898 let n = ht("datadog-ci-visibility-test-execution-id") || Um(), r = t.subscribe((i) => { 5899 n = i; 5900 }); 5901 return e.register(({ eventType: i }) => typeof n != "string" ? Q : { 5902 type: i, 5903 session: { type: "ci_test" }, 5904 ci_test: { test_execution_id: n } 5905 }), { stop: () => { 5906 r.unsubscribe(); 5907 } }; 5908} 5909function Um() { 5910 let e = window.Cypress; 5911 if (e) try { 5912 return e.env("traceId"); 5913 } catch { 5914 w.warn("Failed to read Cypress test execution id via Cypress.env(). Upgrade dd-trace-js to >= 5.88.0 to keep RUM ↔ test correlation working."); 5915 return; 5916 } 5917} 5918function $m(e, t) { 5919 let n = Ce({ 5920 type: Pe("long-animation-frame") ? "long-animation-frame" : "longtask", 5921 buffered: !0 5922 }).subscribe((r) => { 5923 for (let i of r) { 5924 if (!t.trackLongTasks) break; 5925 let o = lt(i.startTime), s = Vm(i, o); 5926 e.notify(13, { 5927 rawRumEvent: s, 5928 startClocks: o, 5929 duration: i.duration, 5930 domainContext: { performanceEntry: i } 5931 }); 5932 } 5933 }); 5934 return { stop: () => n.unsubscribe() }; 5935} 5936function Vm(e, t) { 5937 let n = H(), r = _(e.duration), i = { 5938 date: t.timeStamp, 5939 type: T.LONG_TASK, 5940 _dd: { discarded: !1 } 5941 }; 5942 if (e.entryType === "longtask") return N(v({}, i), { long_task: { 5943 id: n, 5944 entry_type: fn.LONG_TASK, 5945 duration: r 5946 } }); 5947 let o = Wn(e.scripts.map((s) => s.sourceURL).filter((s) => !!s)); 5948 return N(v({}, i), { 5949 _dd: { 5950 discarded: !1, 5951 debug_ids: o 5952 }, 5953 long_task: { 5954 id: n, 5955 entry_type: fn.LONG_ANIMATION_FRAME, 5956 duration: r, 5957 blocking_duration: _(e.blockingDuration), 5958 first_ui_event_timestamp: _(e.firstUIEventTimestamp), 5959 render_start: _(e.renderStart), 5960 style_and_layout_start: _(e.styleAndLayoutStart), 5961 start_time: _(e.startTime), 5962 scripts: e.scripts.map((s) => ({ 5963 duration: _(s.duration), 5964 pause_duration: _(s.pauseDuration), 5965 forced_style_and_layout_duration: _(s.forcedStyleAndLayoutDuration), 5966 start_time: _(s.startTime), 5967 execution_start: _(s.executionStart), 5968 source_url: s.sourceURL, 5969 source_function_name: s.sourceFunctionName, 5970 source_char_position: s.sourceCharPosition, 5971 invoker: s.invoker, 5972 invoker_type: s.invokerType, 5973 window_attribution: s.windowAttribution 5974 })) 5975 } 5976 }); 5977} 5978function Fm(e) { 5979 e.register(({ eventType: t }) => ld() ? { 5980 type: t, 5981 session: { type: "synthetics" }, 5982 synthetics: N(v({}, go()), { injected: mo() }) 5983 } : Q); 5984} 5985function Hm(e, t, n) { 5986 let r = Pt(e), i = n(r); 5987 return Vt(t).forEach(([o, s]) => vr(e, r, o.split(/\.|(?=\[\])/), s)), i; 5988} 5989function vr(e, t, n, r) { 5990 let [i, ...o] = n; 5991 if (i === "[]") { 5992 Array.isArray(e) && Array.isArray(t) && e.forEach((s, a) => vr(s, t[a], o, r)); 5993 return; 5994 } 5995 if (!(!Ss(e) || !Ss(t))) { 5996 if (o.length > 0) return vr(e[i], t[i], o, r); 5997 qm(e, i, t[i], r); 5998 } 5999} 6000function qm(e, t, n, r) { 6001 if (e[t] === n) return; 6002 let i = ct(n); 6003 i === r ? e[t] = A(n) : r === "object" && (i === "undefined" || i === "
6003null") ? e[t] = {} : r === "array" && (i === "undefined" || i === "null") && (e[t] = []); 6004} 6005function Ss(e) { 6006 return ct(e) === "object"; 6007} 6008function Gm(e, t, n, r, i) { 6009 let o = { 6010 [T.ERROR]: Qn(T.ERROR, r, i), 6011 [T.ACTION]: Qn(T.ACTION, r, i), 6012 [T.VITAL]: Qn(T.VITAL, r, i) 6013 }; 6014 t.subscribe(13, ({ startClocks: s, duration: a, rawRumEvent: u, domainContext: c }) => { 6015 let d = n.trigger({ 6016 eventType: u.type, 6017 rawRumEvent: u, 6018 domainContext: c, 6019 startTime: s.relative, 6020 duration: a 6021 }); 6022 if (d === Te) return; 6023 let f = pe(d, u, { ddtags: Vn(e).join(",") }); 6024 Bm(f, e.beforeSend, c, o) && (ge(f.context) && delete f.context, t.notify(14, f)); 6025 }); 6026} 6027function Bm(e, t, n, r) { 6028 if (t) { 6029 let i = Hm(e, Lu[e.type], (o) => t(o, n)); 6030 if (i === !1 && e.type !== T.VIEW) return !1; 6031 i === !1 && w.warn("Can't dismiss view events using beforeSend!"); 6032 } 6033 return !r[e.type]?.isLimitReached(); 6034} 6035function Km(e) { 6036 e.register(({ eventType: t }) => ({ 6037 type: t, 6038 connectivity: Oi() 6039 })); 6040} 6041function jm(e, t, n) { 6042 e.register(({ eventType: r }) => { 6043 let i = t.source; 6044 return { 6045 type: r, 6046 _dd: { 6047 format_version: 2, 6048 drift: pi(), 6049 configuration: { 6050 session_sample_rate: vt(t.sessionSampleRate, 3), 6051 session_replay_sample_rate: vt(t.sessionReplaySampleRate, 3), 6052 profiling_sample_rate: vt(t.profilingSampleRate, 3), 6053 trace_sample_rate: vt(t.traceSampleRate, 3) 6054 }, 6055 browser_sdk_version: Se() ? "7.9.0" : void 0, 6056 sdk_name: n 6057 }, 6058 application: { id: t.applicationId }, 6059 date: G(), 6060 source: i 6061 }; 6062 }); 6063} 6064function Wm(e) { 6065 return { addEvent: (t, n, r, i) => { 6066 Mu.includes(n.type) && e.notify(13, { 6067 startClocks: lt(t), 6068 rawRumEvent: n, 6069 domainContext: r, 6070 duration: i 6071 }); 6072 } }; 6073} 6074function zm(e) { 6075 e.register(({ domainContext: t, rawRumEvent: n }) => { 6076 let r = Xm(t, n); 6077 if (!r) return Q; 6078 let i = Xc(r); 6079 return i ? { 6080 type: n.type, 6081 service: i.service, 6082 version: i.version 6083 } : Q; 6084 }); 6085} 6086function Xm(e, t) { 6087 if (t.type === "long_task" && t.long_task.entry_type === "long-animation-frame") return t.long_task.scripts[0]?.source_url; 6088 let n; 6089 return "handlingStack" in e && (n = e.handlingStack), t.type === "error" && t.error.stack && (n = t.error.stack), Ne({ stack: n }).stack[0]?.url; 6090} 6091function Ym(e, t, n, r, i, o, s, a, u, c) { 6092 let d = [], f = new Ca(); 6093 f.subscribe(14, (h) => $t("rum", h)), t.expireObservable.subscribe(() => f.notify(10, { endClocks: x() })), t.renewObservable.subscribe(() => f.notify(11)); 6094 let p = (h) => { 6095 f.notify(15, { error: { 6096 message: h, 6097 source: we.AGENT, 6098 startClocks: x() 6099 } }), Ye("Error reported to customer", { "error.message": h }); 6100 }; 6101 if (Se()) { 6102 vm(f); 6103 let h = Ni().subscribe((S) => { 6104 f.notify(12, S.reason); 6105 }); 6106 d.push(() => h.unsubscribe()); 6107 } else { 6108 let h = bm(e, f, p, t.expireObservable, o), S = h.prepareUrgentFlushObservable.subscribe(($) => { 6109 f.notify(12, $); 6110 }); 6111 d.push(() => S.unsubscribe()), d.push(() => h.stop()), Tm(a, f, h.flushObservable); 6112 } 6113 let l = Jm(f, u, e, t, n, i, s, c, p), { stop: m } = l, g = Dt(l, ["stop"]); 6114 return d.push(m), s.unbuffer(), d.push(() => r.stop()), N(v({}, g), { 6115 lifeCycle: f, 6116 sessionManager: t, 6117 stopSession: () => t.expire(), 6118 telemetry: a, 6119 stop: () => { 6120 d.forEach((h) => h()); 6121 }, 6122 hooks: u 6123 }); 6124} 6125function Jm(e, t, n, r, i, o, s, a, u) { 6126 let c = [], d = Hd(), f = Sm(), { observable: p, stop: l } = hf(); 6127 c.push(l); 6128 let { assemble: m } = t; 6129 jm(m, n, a); 6130 let g = Rm(m); 6131 c.push(() => g.stop()); 6132 let h = qd(e); 6133 c.push(() => h.stop()); 6134 let S = Em(e, m, f); 6135 c.push(() => S.stop()); 6136 let $ = wm(e, m, n); 6137 Nm(m, n, r, i, h), Km(m), od(m); 6138 let M = ud(m, n, "rum", !0), X = cd(m, n, r, "rum"), b = id(m, n, "rum"), y = sp(e, t, d, p, n); 6139 c.push(y.stop); 6140 let E = Wm(e), C = Im(m); 6141 c.push(C.stop); 6142 let P = Pm(m); 6143 c.push(P.stop), Fm(m), Gm(n, e, m, u); 6144 let { addTiming: ae, setLoadingTime: Cn, startView: wn, setViewName: Tn, setViewContext: Lt, setViewContextProperty: An, getViewContext: Rn, stop: kn } = pm(e, t, n, d, p, f, i, h, o); 6145 zm(m), c.push(kn); 6146 let ut = _p(e, n); 6147 c.push(ut.stop); 6148 let { stop: Mt } = $m(e, n); 6149 c.push(Mt); 6150 let { addError: ve } = cp(e, s); 6151 If(e, n, r, X, b, s); 6152 let re = xm(e, g); 6153 if (n.trackResources && (n.betaTrackWebSockets || Un(At.TRACK_WEBSOCKETS))) { 6154 let Re = Lf(e, h, re.addDurationVital); 6155 c.push(Re.stop); 6156 } 6157 let ie = bf(n.applicationId, r, h, y.actionContexts, S); 6158 return { 6159 addAction: y.addAction, 6160 startAction: y.startAction, 6161 stopAction: y.stopAction, 6162 startResource: ut.startResource, 6163 stopResource: ut.stopResource, 6164 addEvent: E.addEvent, 6165 addError: ve, 6166 addTiming: ae, 6167 setLoadingTime: Cn, 6168 addFeatureFlagEvaluation: $.addFeatureFlagEvaluation, 6169 startView: wn, 6170 setViewContext: Lt, 6171 setViewContextProperty: An, 6172 getViewContext: Rn, 6173 setViewName: Tn, 6174 viewHistory: h, 6175 sessionManager: r, 6176 stopSession: () => r.expire(), 6177 getInternalContext: ie.get, 6178 startDurationVital: re.startDurationVital, 6179 stopDurationVital: re.stopDurationVital, 6180 addDurationVital: re.addDurationVital, 6181 addOperationStepVital: re.addOperationStepVital, 6182 globalContext: M, 6183 userContext: X, 6184 accountContext: b, 6185 stop: () =>
6185 c.forEach((Re) => Re()) 6186 }; 6187} 6188function _s(e, t, n) { 6189 if (e) for (let r of e) { 6190 let i = r[t]; 6191 i && i(n); 6192 } 6193} 6194function Qm(e, t) { 6195 e.register(() => t.isGranted() ? Q : Te); 6196} 6197function Zm({ ignoreInitIfSyntheticsWillInjectRum: e = !0, startDeflateWorker: t, sdkName: n }, r, i) { 6198 let o = new rn(500, (b) => { 6199 Ye("preStartRum buffer data lost", { count: b }); 6200 }), s = fo(); 6201 tr(s, q.globalContext, o); 6202 let a = po(); 6203 tr(a, q.userContext, o); 6204 let u = lo(); 6205 tr(u, q.accountContext, o); 6206 let c, d, f, p, l, m, g = Fd(), h = r.observable.subscribe(M), S = {}, $ = !1; 6207 function M() { 6208 if ($ || !f || !p || !l || !m) return; 6209 h.unsubscribe(); 6210 let b; 6211 if (p.trackViewsManually) { 6212 if (!c) return; 6213 b = c.options; 6214 } 6215 let y = p.trackViewsManually ? c?.callback : void 0, E = i(p, l, d, b, m, g); 6216 $ = !0, o.subscribe((C) => { 6217 C !== y && C(E); 6218 }), o.unbuffer(); 6219 } 6220 function X(b, y) { 6221 let E = Se(); 6222 if (E && (b = eg(b)), f = b, p) { 6223 ji("DD_RUM", b); 6224 return; 6225 } 6226 let C = Nd(b); 6227 !C || !qc(C, y ?? "") || C.compressIntakeRequests && !E && t && (d = t(C, "Datadog RUM", V), !d) || (p = C, r.tryToInit(C.trackingConsent), r.onGrantedOnce(() => { 6228 let { assembleTelemetry: P } = g; 6229 if (Qm(P, r), m = Cc(Ks.RUM, C, P, n), Ue) { 6230 w.warn("The RUM SDK is not supported in a web or service worker environment."); 6231 return; 6232 } 6233 (Se() ? Il() : Ol(C, r)).then((ae) => { 6234 ae && (l = ae, gd(P, l, { application: { id: C.applicationId } }), kc(Vd(b)), M()); 6235 }).catch(K); 6236 })); 6237 } 6238 return { 6239 init(b, y, E) { 6240 if (!b) { 6241 w.error("Missing configuration"); 6242 return; 6243 } 6244 if (lc(b.enableExperimentalFeatures), Zu(b.allowUntrustedEvents), f = b, !(e && mo())) if (_s(b.plugins, "onInit", { 6245 initConfiguration: b, 6246 publicApi: y 6247 }), Et(b)) { 6248 let C = { 6249 user: a, 6250 context: s 6251 }; 6252 if (b.remoteConfigurationId || b.remoteConfiguration?.sync) _d(b, C).then((P) => { 6253 P && X(P, E); 6254 }).catch(K); 6255 else { 6256 let P = Rd(b, C); 6257 P && X(P, E); 6258 } 6259 } else X(b, E); 6260 }, 6261 get initConfiguration() { 6262 return f; 6263 }, 6264 getInternalContext: V, 6265 stopSession: V, 6266 addTiming(b, y = G()) { 6267 o.notify((E) => E.addTiming(b, y)); 6268 }, 6269 setLoadingTime: ((b) => { 6270 o.notify((y) => y.setLoadingTime(b)); 6271 }), 6272 startView(b, y = x()) { 6273 let E = (C) => { 6274 C.startView(b, y); 6275 }; 6276 o.notify(E), c || (c = { 6277 options: b, 6278 callback: E 6279 }, M()); 6280 }, 6281 setViewName(b) { 6282 o.notify((y) => y.setViewName(b)); 6283 }, 6284 setViewContext(b) { 6285 o.notify((y) => y.setViewContext(b)); 6286 }, 6287 setViewContextProperty(b, y) { 6288 o.notify((E) => E.setViewContextProperty(b, y)); 6289 }, 6290 getViewContext: () => S, 6291 globalContext: s, 6292 userContext: a, 6293 accountContext: u, 6294 addAction(b) { 6295 o.notify((y) => y.addAction(b)); 6296 }, 6297 startAction(b, y) { 6298 let E = x(); 6299 o.notify((C) => C.startAction(b, y, E)); 6300 }, 6301 stopAction(b, y) { 6302 let E = x(); 6303 o.notify((C) => C.stopAction(b, y, E)); 6304 }, 6305 startResource(b, y) { 6306 let E = x(); 6307 o.notify((C) => C.startResource(b, y, E)); 6308 }, 6309 stopResource(b, y) { 6310 let E = x(); 6311 o.notify((C) => C.stopResource(b, y, E)); 6312 }, 6313 addError(b) { 6314 o.notify((y) => y.addError(b)); 6315 }, 6316 addFeatureFlagEvaluation(b, y) { 6317 o.notify((E) => E.addFeatureFlagEvaluation(b, y)); 6318 }, 6319 startDurationVital(b, y) { 6320 let E = x(); 6321 o.notify((C) => C.startDurationVital(b, y, E)); 6322 }, 6323 stopDurationVital(b, y) { 6324 let E = x(); 6325 o.notify((C) => C.stopDurationVital(b, y, E)); 6326 }, 6327 addDurationVital(b) { 6328 o.notify((y) => y.addDurationVital(b)); 6329 }, 6330 addOperationStepVital: (b, y, E, C) => { 6331 o.notify((P) => P.addOperationStepVital(A(b), y, A(E), A(C))); 6332 } 6333 }; 6334} 6335function eg(e) { 6336 return N(v({}, e), { 6337 applicationId: "00000000-aaaa-0000-aaaa-000000000000", 6338 clientToken: "empty", 6339 sessionSampleRate: 100, 6340 defaultPrivacyLevel: e.defaultPrivacyLevel ?? xe()?.getPrivacyLevel() 6341 }); 6342} 6343function tg(e, t, n = {}) { 6344 let r = Nc(), i = pd(), o = Zm(n, r, (p, l, m, g, h, S) => { 6345 let $ = m && n.createDeflateEncoder ? (X) => n.createDeflateEncoder(m, X) : Mi, M = Ym(p, l, e, t, g, $, i.observable, h, S, n.sdkName); 6346 return e.onRumStart(M.lifeCycle, p, l, M.viewHistory, m, M.telemetry), t.onRumStart(M.lifeCycle, M.hooks, p, l, M.viewHistory, $), o = ng(o, M), _s(p.plugins, "onRumStart", { 6347 addEvent: M.addEvent, 6348 addError: M.addError 6349 }), M; 6350 }), s = () => o, a = (p) => { 6351 let l = ce("view"); 6352 te(() => { 6353 let m = typeof p == "object" ? p : { name: p }; 6354 o.startView(N(v({}, m), { handlingStack: l })), F({ feature: "start-view" }); 6355 }); 6356 }, u = (p, l) => { 6357 let m = ce("vital"); 6358 te(() => { 6359 F({ 6360 feature: "add-operation-step-vital", 6361 action_type: "start" 6362 }), o.addOperationStepVital(p, "start", N(v({}, l), { handlingStack: m })); 6363 }); 6364 }, c = R((p, l) => { 6365 F({ 6366 feature: "add-operation-step-vital", 6367 action_type: "succeed" 6368 }), o.addOperationStepVital(p, "end", l); 6369 }), d = R((p, l, m) => { 6370 F({ 6371 feature: "add-operation-step-vital", 6372 action_type: "fail" 6373 }), o.addOperationStepVital(p, "end", m, l); 6374 }), f = il({ 6375 init: (p) => { 6376 let l = (/* @__PURE__ */ new Error()).stack; 6377 te(() => o.init(p, f, l)); 6378 }, 6379 setTrackingConsent: R((p) => { 6380 r.update(p), F({ 6381 feature: "set-tracking-consent", 6382 tracking_consent: p 6383 }); 6384 }), 6385 setViewName: R((p) => { 6386 o.setViewName(p), F({ feature: "set-view-name" }); 6387 }), 6388 setViewContext: R((p) => { 6389 o.setViewContext(p), F({ feature: "set-view-context" }); 6390 }), 6391 setViewContextProperty: R((p, l) => { 6392 o.setViewContextProperty(p, l), F({ feature: "set-view-context-property" }); 6393 }), 6394 getViewContext: R(() => (F({ feature: "set-view-context-property" }), o.getViewContext())), 6395 getInternalContext: R((p) => o.getInternalContext(p)), 6396 getInitConfiguration: R(() =>
6396 Pt(o.initConfiguration)), 6397 addAction: (p, l) => { 6398 let m = ce("action"); 6399 te(() => { 6400 o.addAction({ 6401 name: A(p), 6402 context: A(l), 6403 startClocks: x(), 6404 type: pn.CUSTOM, 6405 handlingStack: m 6406 }), F({ feature: "add-action" }); 6407 }); 6408 }, 6409 startAction: R((p, l) => { 6410 F({ feature: "start-action" }), o.startAction(A(p), { 6411 type: A(l?.type), 6412 context: A(l?.context), 6413 actionKey: l?.actionKey 6414 }); 6415 }), 6416 stopAction: R((p, l) => { 6417 F({ feature: "stop-action" }), o.stopAction(A(p), { 6418 type: A(l?.type), 6419 context: A(l?.context), 6420 actionKey: l?.actionKey 6421 }); 6422 }), 6423 startResource: R((p, l) => { 6424 F({ feature: "start-resource" }), o.startResource(A(p), { 6425 type: A(l?.type), 6426 method: A(l?.method), 6427 context: A(l?.context), 6428 resourceKey: l?.resourceKey 6429 }); 6430 }), 6431 stopResource: R((p, l) => { 6432 F({ feature: "stop-resource" }), o.stopResource(A(p), { 6433 type: A(l?.type), 6434 statusCode: l?.statusCode, 6435 size: l?.size, 6436 context: A(l?.context), 6437 resourceKey: l?.resourceKey 6438 }); 6439 }), 6440 addError: (p, l) => { 6441 let m = ce("error"); 6442 te(() => { 6443 o.addError({ 6444 error: p, 6445 handlingStack: m, 6446 context: A(l), 6447 startClocks: x() 6448 }), F({ feature: "add-error" }); 6449 }); 6450 }, 6451 addTiming: R((p, l) => { 6452 o.addTiming(A(p), l); 6453 }), 6454 setViewLoadingTime: R(() => { 6455 let p = G(); 6456 o.setLoadingTime(p), F({ feature: "addViewLoadingTime" }); 6457 }), 6458 setGlobalContext: J(s, q.globalContext, W.setContext, "set-global-context"), 6459 getGlobalContext: J(s, q.globalContext, W.getContext, "get-global-context"), 6460 setGlobalContextProperty: J(s, q.globalContext, W.setContextProperty, "set-global-context-property"), 6461 removeGlobalContextProperty: J(s, q.globalContext, W.removeContextProperty, "remove-global-context-property"), 6462 clearGlobalContext: J(s, q.globalContext, W.clearContext, "clear-global-context"), 6463 setUser: J(s, q.userContext, W.setContext, "set-user"), 6464 getUser: J(s, q.userContext, W.getContext, "get-user"), 6465 setUserProperty: J(s, q.userContext, W.setContextProperty, "set-user-property"), 6466 removeUserProperty: J(s, q.userContext, W.removeContextProperty, "remove-user-property"), 6467 clearUser: J(s, q.userContext, W.clearContext, "clear-user"), 6468 setAccount: J(s, q.accountContext, W.setContext, "set-account"), 6469 getAccount: J(s, q.accountContext, W.getContext, "get-account"), 6470 setAccountProperty: J(s, q.accountContext, W.setContextProperty, "set-account-property"), 6471 removeAccountProperty: J(s, q.accountContext, W.removeContextProperty, "remove-account-property"), 6472 clearAccount: J(s, q.accountContext, W.clearContext, "clear-account"), 6473 startView: a, 6474 stopSession: R(() => { 6475 o.stopSession(), F({ feature: "stop-session" }); 6476 }), 6477 addFeatureFlagEvaluation: R((p, l) => { 6478 o.addFeatureFlagEvaluation(A(p), A(l)), F({ feature: "add-feature-flag-evaluation" }); 6479 }), 6480 getSessionReplayLink: R(() => e.getSessionReplayLink()), 6481 startSessionReplayRecording: R((p) => { 6482 e.start(p), F({ 6483 feature: "start-session-replay-recording", 6484 force: p?.force 6485 }); 6486 }), 6487 stopSessionReplayRecording: R(() => e.stop()), 6488 addDurationVital: (p, l) => { 6489 let m = ce("vital"); 6490 te(() => { 6491 F({ feature: "add-duration-vital" }), o.addDurationVital({ 6492 id: H(), 6493 name: A(p), 6494 type: fe.DURATION, 6495 startClocks: di(l.startTime), 6496 duration: l.duration, 6497 context: A(l?.context), 6498 description: A(l?.description), 6499 handlingStack: m 6500 }); 6501 }); 6502 }, 6503 startDurationVital: (p, l) => { 6504 let m = ce("vital"); 6505 te(() => { 6506 F({ feature: "start-duration-vital" }), o.startDurationVital(A(p), { 6507 vitalKey: l?.vitalKey, 6508 context: A(l?.context), 6509 description: A(l?.description), 6510 handlingStack: m 6511 }); 6512 }); 6513 }, 6514 stopDurationVital: R((p, l) => { 6515 F({ feature: "stop-duration-vital" }), o.stopDurationVital(A(p), { 6516 vitalKey: l?.vitalKey, 6517 context: A(l?.context), 6518 description: A(l?.description) 6519 }); 6520 }), 6521 startOperation: u, 6522 succeedOperation: c, 6523 failOperation: d, 6524 startFeatureOperation: u, 6525 succeedFeatureOperation: c, 6526 failFeatureOperation: d, 6527 DEFAULT_TRACKED_RESOURCE_HEADERS: gn 6528 }); 6529 return f; 6530} 6531function ng(e, t) { 6532 return N(v({}, e), { 6533 init: (n) => { 6534 ji("DD_RUM", n); 6535 }, 6536 getInternalContext: t.getInternalContext, 6537 stopSession: t.stopSession, 6538 getViewContext: t.getViewContext, 6539 globalContext: t.globalContext, 6540 userContext: t.userContext, 6541 accountContext: t.accountContext 6542 }); 6543} 6544function rg(e, { session: t, viewContext: n, errorType: r }) { 6545 let i = t ? t.id : "no-session-id", o = []; 6546 return r !== void 0 && o.push(`error-type=${r}`), n && (o.push(`seed=${n.id}`), o.push(`from=${n.startClocks.timeStamp}`)), `${ig(e)}${`/rum/replay/sessions/${i}`}?${o.join("&")}`;
6547} 6548function ig(e) { 6549 let t = e.site, n = e.subdomain || og(e); 6550 return `https://${n ? `${n}.` : ""}${t}`; 6551} 6552function og(e) { 6553 switch (e.site) { 6554 case Tt: 6555 case Ts: return "app"; 6556 case Cr: return "dd"; 6557 default: return; 6558 } 6559} 6560function sg(e, t, n, r) { 6561 let i = (a) => { 6562 t.notify(15, { error: { 6563 message: a, 6564 source: we.AGENT, 6565 startClocks: x() 6566 } }), Ye("Error reported to customer", { "error.message": a }); 6567 }, o = Pn([dt(e, "profile")], i), s = n(r); 6568 return { send(a) { 6569 return B(this, null, function* () { 6570 var u = a, { event: c } = u, d = Dt(u, ["event"]); 6571 let f = new FormData(), p = _e(c); 6572 if (!p) throw new Error("Failed to serialize event"); 6573 f.append("event", new Blob([p], { type: "application/json" }), "event.json"); 6574 let l = p.length; 6575 for (let [m, g] of Vt(d)) { 6576 let h = _e(g); 6577 if (!h) throw new Error("Failed to serialize attachment"); 6578 let S = yield ag(s, h); 6579 l += S.outputBytesCount, f.append(m, new Blob([S.output]), m); 6580 } 6581 o.send({ 6582 data: f, 6583 bytesCount: l 6584 }); 6585 }); 6586 } }; 6587} 6588function ag(e, t) { 6589 return new Promise((n) => { 6590 e.write(t), e.finish((r) => { 6591 n(r); 6592 }); 6593 }); 6594} 6595var O, Ue, en, tn, nn, Z, et, Er, Sr, w, Cs, ws, ug, R, te, K, _r, Cr, Tt, Ts, As, Rs, ks, D, wr, we, Os, Is, k, rn, xs, Ns, Tr, Ls, Ar, on, Rr, kr, Ms, At, sn, $e, Or, Ve, Ds, Ps, Us, $s, Vs, Fs, Hs, an, Ir, tt, qs, Gs, xr, be, Te, Q, Bs, Ks, Rt, js, Ws, zs, Nr, Lr, un, Fe, cn, Xs, He, Mr, Dr, Ys, Js, Qs, Zs, ea, ta, kt, Pr, Ur, nt, rt, na, Ot, It, Ae, ra, ia, ne, oa, sa, it, $r, Vr, Fr, Hr, aa, ua, ca, la, le, da, fa, pa, qr, ln, Gr, Br, Kr, jr, ma, dn, ga, ya, q, W, Wr, zr, xt, ha, ba, va, Ea, z, ot, Sa, Nt, Xr, _a, Ca, T, fn, de, pn, qe, fe, wa, Ta, Aa, Ra, ka, Oa, Yr, Ia, xa, Na, La, Ma, Da, Pa, Ua, mn, gn, $a, Va, Fa, Ha, qa, Ga, Ba, Ka, ja, Jr, Wa, yn, za, Xa, I, Qr, Ya, Ja, Qa, Za, Zr, eu, tu, nu, ru, iu, ou, su, ei, ti, ni, au, uu, cu, lu, du, ri, st, fu, pu, ii, hn, mu, gu, yu, bn, hu, oi, bu, vu, vn, si, En, Sn, ai, ui, Eu, Su, _u, Cu, wu, Tu, Au, Ru, ku, at, _n, Ou, Iu, xu, Nu, Ge, Lu, Mu; 6596function Du() { 6597 return (Du = $u((() => { 6598 Uu(), O = globalThis, Ue = "WorkerGlobalScope" in O, en = "https://docs.datadoghq.com", tn = "More details:", nn = { 6599 log: "log", 6600 debug: "debug", 6601 info: "info", 6602 warn: "warn", 6603 error: "error" 6604 }, Z = console, et = { 6605 log: Z.log, 6606 debug: Z.debug, 6607 info: Z.info, 6608 warn: Z.warn, 6609 error: Z.error 6610 }, Er = !1, w = Hu("Datadog Browser SDK:"), Cs = `${en}/real_user_monitoring/browser/troubleshooting`, {monitored: ug, monitor: R, callMonitored: te, monitorError: K} = ju(w, (e) => ws?.(e)), Cr = "datad0g.com", Tt = "datadoghq.com", Ts = "datadoghq.eu", As = "ddog-gov.com", Rs = "us2.ddog-gov.com", ks = [ 6611 "ddsource", 6612 "dd-api-key", 6613 "dd-request-id" 6614 ], D = (function(e) { 6615 return e.BEFORE_UNLOAD = "beforeunload", e.CLICK = "click", e.DBL_CLICK = "dblclick", e.KEY_DOWN = "keydown", e.LOAD = "load", e.POP_STATE = "popstate", e.SCROLL = "scroll", e.TOUCH_START = "touchstart", e.TOUCH_END = "touchend", e.TOUCH_MOVE = "touchmove", e.VISIBILITY_CHANGE = "visibilitychange", e.PAGE_SHOW = "pageshow", e.FREEZE = "freeze", e.RESUME = "resume", e.DOM_CONTENT_LOADED = "DOMContentLoaded", e.POINTER_DOWN = "pointerdown", e.POINTER_UP = "pointerup", e.POINTER_CANCEL = "pointercancel", e.HASH_CHANGE = "hashc
6615hange", e.PAGE_HIDE = "pagehide", e.MOUSE_DOWN = "mousedown", e.MOUSE_UP = "mouseup", e.MOUSE_MOVE = "mousemove", e.FOCUS = "focus", e.BLUR = "blur", e.CONTEXT_MENU = "contextmenu", e.RESIZE = "resize", e.CHANGE = "change", e.INPUT = "input", e.PLAY = "play", e.PAUSE = "pause", e.SECURITY_POLICY_VIOLATION = "securitypolicyviolation", e.SELECTION_CHANGE = "selectionchange", e.STORAGE = "storage", e.UNHANDLED_REJECTION = "unhandledrejection", e; 6616 })({}), we = { 6617 AGENT: "agent", 6618 CONSOLE: "console", 6619 CUSTOM: "custom", 6620 LOGGER: "logger", 6621 NETWORK: "network", 6622 SOURCE: "source", 6623 REPORT: "report" 6624 }, Os = (function(e) { 6625 return e.UNCAUGHT = "Uncaught", e.PROVIDED = "Provided", e; 6626 })({}), Is = (function(e) { 6627 return e.HANDLED = "handled", e.UNHANDLED = "unhandled", e; 6628 })({}), k = class { 6629 constructor(e) { 6630 this.onFirstSubscribe = e, this.observers = []; 6631 } 6632 subscribe(e) { 6633 return this.addObserver(e), { unsubscribe: () => this.removeObserver(e) }; 6634 } 6635 notify(e) { 6636 this.observers.forEach((t) => t(e)); 6637 } 6638 addObserver(e) { 6639 this.observers.push(e), this.observers.length === 1 && this.onFirstSubscribe && (this.onLastUnsubscribe = this.onFirstSubscribe(this) || void 0); 6640 } 6641 removeObserver(e) { 6642 this.observers = this.observers.filter((t) => e !== t), !this.observers.length && this.onLastUnsubscribe && this.onLastUnsubscribe(); 6643 } 6644 }, rn = class extends k { 6645 constructor(e, t) { 6646 super(), this.maxBufferSize = e, this.onDrop = t, this.buffer = [], this.droppedCount = 0; 6647 } 6648 notify(e) { 6649 this.buffer.push(e), this.buffer.length > this.maxBufferSize && (this.buffer.shift(), this.droppedCount++), super.notify(e); 6650 } 6651 subscribe(e) { 6652 let t = !1; 6653 return yi(() => { 6654 for (let n of this.buffer) { 6655 if (t) return; 6656 e(n); 6657 } 6658 t || this.addObserver(e); 6659 }), { unsubscribe: () => { 6660 t = !0, this.removeObserver(e); 6661 } }; 6662 } 6663 unbuffer() { 6664 yi(() => { 6665 this.droppedCount > 0 && this.onDrop && this.onDrop(this.droppedCount), this.maxBufferSize = this.buffer.length = 0; 6666 }); 6667 } 6668 }, xs = /[^\u0000-\u007F]/, Ns = 81920, Tr = 20971520, Ls = 6e4, Ar = 1e3, on = 16384, Rr = !1, kr = (function(e) { 6669 return e.RECORDS = "records", e.PROFILES = "profiles", e; 6670 })({}), Ms = (e, t) => e === "__proto__" ? void 0 : t, At = (function(e) { 6671 return e.SESSION_REPLAY_RECORD_CANVAS = "session_replay_record_canvas", e.TRACK_INTAKE_REQUESTS = "track_intake_requests", e.TRACK_WEBSOCKETS = "track_websockets", e; 6672 })({}), sn = /* @__PURE__ */ new Set(), $e = "?", Or = "((?:blob|native|eval|<anonymous>|[a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/|\\w+\\.|\\/).*?)", Ve = "(?::(\\d+))", Ds = new RegExp(`^\\s*at (.*?) ?\\(${Or}${Ve}?${Ve}?\\)?\\s*$`, "i"), Ps = new RegExp(`\\((\\S*)${Ve}${Ve}\\)`), Us = new RegExp(`^\\s*at\\s*(?:(.*)?(?: @))?\\s*${Or}${Ve}?${Ve}??\\s*$`, "i"), $s = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, Vs = /^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i, Fs = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, Hs = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/, Ir = "No stack, consider using an instance of Error", tt = { 6673 HIDDEN: "visibility_hidden", 6674 UNLOADING: "before_unload", 6675 PAGEHIDE: "page_hide", 6676 FROZEN: "page_frozen" 6677 }, qs = 3e4, Gs = Ue ? 1 : 50, xr = 262144, be = { 6678 LOG: "log", 6679 CONFIGURATION: "configuration", 6680 USAGE: "usage" 6681 }, Te = "DISCARDED", Q = "SKIPPED", Bs = [ 6682 "https://www.datadoghq-browser-agent.com", 6683 "https://www.datad0g-browser-agent.com", 6684 "https://d3uc069fcn7uxw.cloudfront.net", 6685 "https://d20xtzwzcl0ceb.cloudfront.net", 6686 "http://localhost", 6687 "<anonymous>" 6688 ], Ks = (function(e) { 6689 return e.LOGS = "browser-logs-sdk", e.RUM = "browser-rum-sdk", e; 6690 })({}), Rt = (function(e) { 6691 return e.CUSTOMER_DATA_METRIC_NAME = "Customer data measures", e.REMOTE_CONFIGURATION_METRIC_NAME
6691= "remote configuration metrics", e.RECORDER_INIT_METRICS_TELEMETRY_NAME = "Recorder init metrics", e.SEGMENT_METRICS_TELEMETRY_NAME = "Segment network request metrics", e.SESSION_MANAGER_INIT_METRICS_TELEMETRY_NAME = "Session manager init metrics", e; 6692 })({}), js = 1, Ws = [As, Rs], zs = 15, Lr = /* @__PURE__ */ new Map(), un = { 6693 GRANTED: "granted", 6694 NOT_GRANTED: "not-granted" 6695 }, Fe = { 6696 ALLOW: "allow", 6697 MASK: "mask", 6698 MASK_USER_INPUT: "mask-user-input", 6699 MASK_UNLESS_ALLOWLISTED: "mask-unless-allowlisted" 6700 }, cn = { 6701 ALL: "all", 6702 SAMPLED: "sampled" 6703 }, Xs = { 6704 clientToken: { 6705 type: "string", 6706 required: !0 6707 }, 6708 service: { type: "string" }, 6709 env: { type: "string" }, 6710 version: { type: "string" }, 6711 site: { 6712 type: "site", 6713 default: Tt 6714 }, 6715 proxy: { 6716 type: "union", 6717 variants: [{ type: "string" }, { 6718 type: "function", 6719 signature: void 0 6720 }] 6721 }, 6722 sessionSampleRate: { 6723 type: "percentage", 6724 default: 100 6725 }, 6726 telemetrySampleRate: { 6727 type: "percentage", 6728 default: 20 6729 }, 6730 telemetryConfigurationSampleRate: { 6731 type: "percentage", 6732 default: 5 6733 }, 6734 telemetryUsageSampleRate: { 6735 type: "percentage", 6736 default: 5 6737 }, 6738 silentMultipleInit: { 6739 type: "boolean", 6740 default: !1, 6741 strict: !1 6742 }, 6743 storeContextsAcrossPages: { 6744 type: "boolean", 6745 default: !1, 6746 strict: !1 6747 }, 6748 trackAnonymousUser: { 6749 type: "boolean", 6750 default: !0, 6751 strict: !1 6752 }, 6753 useSecureSessionCookie: { 6754 type: "boolean", 6755 default: !1, 6756 strict: !1 6757 }, 6758 usePartitionedCrossSiteSessionCookie: { 6759 type: "boolean", 6760 default: !1, 6761 strict: !1 6762 }, 6763 trackSessionAcrossSubdomains: { 6764 type: "boolean", 6765 default: !1, 6766 strict: !1 6767 }, 6768 allowedTrackingOrigins: { 6769 type: "match-option", 6770 multiple: !0, 6771 strict: !1 6772 }, 6773 trackingConsent: { 6774 type: "enum", 6775 values: un, 6776 default: un.GRANTED 6777 }, 6778 beforeSend: { 6779 type: "function", 6780 signature: void 0 6781 }, 6782 source: { 6783 type: "enum", 6784 values: [ 6785 "browser", 6786 "flutter", 6787 "unity" 6788 ], 6789 default: "browser", 6790 strict: !1 6791 }, 6792 sessionPersistence: { 6793 type: "enum", 6794 values: [ 6795 "cookie", 6796 "local-storage", 6797 "memory" 6798 ], 6799 multiple: !0, 6800 strict: !1 6801 }, 6802 replica: { 6803 type: "schema", 6804 schema: { 6805 clientToken: { 6806 type: "string", 6807 required: !0 6808 }, 6809 applicationId: { type: "string" } 6810 } 6811 }, 6812 datacenter: { type: "string" }, 6813 sdkVersion: { type: "string" }, 6814 variant: { type: "string" } 6815 }, He = /(\S+?)\s*=\s*(.*?)(?:;|$)/g, Ys = ["chrome-extension://", "moz-extension://"], Js = "Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.", Qs = "SDK initialized on a non-allowed domain.", Zs = 225280, ea = "$", ta = 3, kt = /* @__PURE__ */ new Map(), Pr = /* @__PURE__ */ new Set(), Ur = !1, nt = { 6816 intervention: "intervention", 6817 deprecation: "deprecation", 6818 cspViolation: "csp_violation" 6819 }, rt = 1 / 0, na = 6e4, It = /* @__PURE__ */ new Set(), Ae = 144e5, ra = 9e5, ia = 31536e6, ne = { 6820 COOKIE: "cookie", 6821 MEMORY: "memory", 6822 LOCAL_STORAGE: "local-storage" 6823 }, oa = "dd_cookie_test_", sa = 1e3, it = "_dd_s_v2", $r = "_dd_s", Vr = "_DD_SESSION", Fr = /^([a-zA-Z]+)=([a-z0-9-]+)$/, aa = "_dd_test_", ua = 6e4, ca = 1e3, la = 432e5, le = [], da = class { 6824 constructor() { 6825 this.callbacks = {}; 6826 } 6827 notify(e, t) { 6828 let n = this.callbacks[e]; 6829 n && n.forEach((r) => r(t)); 6830 } 6831 subscribe(e, t) {
6832 return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(t), { unsubscribe: () => { 6833 this.callbacks[e] = this.callbacks[e].filter((n) => t !== n); 6834 } }; 6835 } 6836 }, fa = 3e3, ln = /* @__PURE__ */ new WeakMap(), Gr = (function(e) { 6837 return e[e.IGNORE = 0] = "IGNORE", e[e.COLLECT = 1] = "COLLECT", e; 6838 })({}), Kr = [], ma = 1e3, dn = {}, ga = "_dd_c", ya = [], q = { 6839 userContext: "userContext", 6840 globalContext: "globalContext", 6841 accountContext: "accountContext" 6842 }, W = { 6843 getContext: "getContext", 6844 setContext: "setContext", 6845 setContextProperty: "setContextProperty", 6846 removeContextProperty: "removeContextProperty", 6847 clearContext: "clearContext" 6848 }, Wr = "_dd_tab_id", xt = "datadog-synthetics-", ha = `${xt}public-id`, ba = `${xt}result-id`, va = `${xt}injects-rum`, Ea = `${xt}rum-context`, z = { 6849 DOCUMENT: "document", 6850 XHR: "xhr", 6851 BEACON: "beacon", 6852 FETCH: "fetch", 6853 CSS: "css", 6854 JS: "js", 6855 IMAGE: "image", 6856 FONT: "font", 6857 MEDIA: "media", 6858 WEBSOCKET: "websocket", 6859 OTHER: "other" 6860 }, ot = { 6861 FETCH: z.FETCH, 6862 XHR: z.XHR 6863 }, Sa = 500, Nt = (function(e) { 6864 return e[e.RUNTIME_ERROR = 0] = "RUNTIME_ERROR", e[e.FETCH = 1] = "FETCH", e[e.XHR = 2] = "XHR", e[e.CONSOLE = 3] = "CONSOLE", e; 6865 })({}), Xr = (function(e) { 6866 return e[e.REPLAY = 1] = "REPLAY", e[e.RUM = 2] = "RUM", e[e.TELEMETRY = 4] = "TELEMETRY", e[e.PROFILING = 6] = "PROFILING", e; 6867 })({}), _a = (function(e) { 6868 return e[e.AUTO_ACTION_COMPLETED = 0] = "AUTO_ACTION_COMPLETED", e[e.BEFORE_VIEW_CREATED = 1] = "BEFORE_VIEW_CREATED", e[e.VIEW_CREATED = 2] = "VIEW_CREATED", e[e.BEFORE_VIEW_UPDATED = 3] = "BEFORE_VIEW_UPDATED", e[e.VIEW_UPDATED = 4] = "VIEW_UPDATED", e[e.VIEW_ENDED = 5] = "VIEW_ENDED", e[e.AFTER_VIEW_ENDED = 6] = "AFTER_VIEW_ENDED", e[e.REQUEST_STARTED = 7] = "REQUEST_STARTED", e[e.REQUEST_COMPLETED = 8] = "REQUEST_COMPLETED", e[e.WEBSOCKET_COMPLETED = 9] = "WEBSOCKET_COMPLETED", e[e.SESSION_EXPIRED = 10] = "SESSION_EXPIRED", e[e.SESSION_RENEWED = 11] = "SESSION_RENEWED", e[e.PREPARE_URGENT_FLUSH = 12] = "PREPARE_URGENT_FLUSH", e[e.RAW_RUM_EVENT_COLLECTED = 13] = "RAW_RUM_EVENT_COLLECTED", e[e.RUM_EVENT_COLLECTED = 14] = "RUM_EVENT_COLLECTED", e[e.RAW_ERROR_COLLECTED = 15] = "RAW_ERROR_COLLECTED", e[e.ACTION_STARTED = 16] = "ACTION_STARTED", e[e.DURATION_VITAL_STARTED = 17] = "DURATION_VITAL_STARTED", e; 6869 })({}), Ca = da, T = { 6870 ACTION: "action", 6871 ERROR: "error", 6872 LONG_TASK: "long_task", 6873 VIEW: "view", 6874 VIEW_UPDATE: "view_update", 6875 RESOURCE: "resource", 6876 VITAL: "vital" 6877 }, fn = { 6878 LONG_TASK: "long-task", 6879 LONG_ANIMATION_FRAME: "long-animation-frame" 6880 }, de = { 6881 INITIAL_LOAD: "initial_load", 6882 ROUTE_CHANGE: "route_change", 6883 SESSION_RENEWAL: "session_renewal", 6884 BF_CACHE: "bf_cache" 6885 }, pn = { 6886 CLICK: "click", 6887 CUSTOM: "custom", 6888 TAP: "tap", 6889 SCROLL: "scroll", 6890 SWIPE: "swipe", 6891 APPLICATION_START: "application_start", 6892 BACK: "back" 6893 }, qe = { 6894 RAGE_CLICK: "rage_click", 6895 ERROR_CLICK: "error_click", 6896 DEAD_CLICK: "dead_click" 6897 }, fe = { 6898 DURATION: "duration", 6899 OPERATION_STEP: "operation_step" 6900 }, wa = /[a-zA-Z_$]/, Ta = /[a-zA-Z0-9_$]/, Aa = /[0-9]/, Ra = /[a-fA-F0-9]/, ka = `'"`, Oa = { 6901 0: () => !1, 6902 1: () => !1, 6903 2: (e) => wa.test(e), 6904 3: (e) => Ta.test(e), 6905 4: (e) => e === ".", 6906 5: (e) => e === "[", 6907 6: (e) => e === "]", 6908 7: (e) => Aa.test(e), 6909 8: (e) => ka.includes(e), 6910 9: (e, t) => e === t.quote, 6911 10: () => !0, 6912 11: (e) => e === "\\", 6913 12: (e, t) => t.escapeSequence === void 0 ? `${t.quote}/\\bfnrtu`.includes(e) : t.escapeSequence.startsWith("u") && t.escapeSequence.length < 5 ? Ra.test(e) : !1 6914 }, Yr = { 6915 0: [2, 5], 6916 1: [], 6917 2: [ 6918 3, 6919 4, 6920 5, 6921 1 6922 ], 6923 3: [ 6924 3, 6925 4, 6926 5, 6927 1 6928 ], 6929 4: [2], 6930 5: [8, 7], 6931 6: [ 6932 4, 6933 5, 6934 1 6935 ], 6936 7: [7, 6], 6937 8: [ 6938 11, 6939 9, 6940 10 6941 ], 6942 9: [6], 6943 10: [ 6944 11, 6945 9, 6946 10 6947 ], 6948 11: [12], 6949 12: [ 6950 12, 6951 11, 6952 9, 6953 10 6954 ] 6955 }, Ia = [ 6956 2, 6957 3, 6958 7, 6959 10 6960 ], xa = [ 6961 4, 6962 5, 6963 6 6964 ], Na = { 6965 "\"": "\"", 6966 "'": "'", 6967 "/": "/", 6968 "\\": "\\", 6969 b: "\b", 6970 f: "\f", 6971 n: ` 6972`, 6973 r: "\r", 6974 t: " " 6975 }, La = "dd_rc_", Ma = { 6976 hit: "success", 6977 miss: "missing", 6978 error: "failure" 6979 }, Da = "v1", Pa = [ 6980 "applicationId", 6981 "service", 6982 "env", 6983 "version", 6984 "sessionSampleRate", 6985 "sessionReplaySampleRate", 6986 "telemetrySampleRate",
6987 "trackAnonymousUser", 6988 "trackUserInteractions", 6989 "trackResources", 6990 "trackLongTasks", 6991 "traceContextInjection", 6992 "actionNameAttribute", 6993 "defaultPrivacyLevel", 6994 "enablePrivacyForActionName", 6995 "traceSampleRate", 6996 "trackSessionAcrossSubdomains", 6997 "allowedTracingUrls", 6998 "allowedTrackingOrigins" 6999 ], Ua = /(datadog|ddog|datad0g|dd0g)/, mn = ["tracecontext", "datadog"], gn = [ 7000 "cache-control", 7001 "etag", 7002 "age", 7003 "expires", 7004 "content-type", 7005 "content-encoding", 7006 "vary", 7007 "content-length", 7008 "server-timing", 7009 "x-cache", 7010 "cf-cache-status", 7011 "x-vercel-cache" 7012 ], $a = N(v({}, Xs), { 7013 applicationId: { 7014 type: "string", 7015 required: !0 7016 }, 7017 actionNameAttribute: { type: "string" }, 7018 workerUrl: { type: "string" }, 7019 subdomain: { type: "string" }, 7020 sessionReplaySampleRate: { 7021 type: "percentage", 7022 default: 0 7023 }, 7024 traceSampleRate: { 7025 type: "percentage", 7026 default: 100 7027 }, 7028 profilingSampleRate: { 7029 type: "percentage", 7030 default: 0 7031 }, 7032 compressIntakeRequests: { 7033 type: "boolean", 7034 default: !1 7035 }, 7036 trackUserInteractions: { 7037 type: "boolean", 7038 default: !0, 7039 strict: !1 7040 }, 7041 trackResources: { 7042 type: "boolean", 7043 default: !0, 7044 strict: !1 7045 }, 7046 trackLongTasks: { 7047 type: "boolean", 7048 default: !0, 7049 strict: !1 7050 }, 7051 trackViewsManually: { 7052 type: "boolean", 7053 default: !1, 7054 strict: !1 7055 }, 7056 betaEnableViewUpdates: { 7057 type: "boolean", 7058 default: !1 7059 }, 7060 betaTrackWebSockets: { 7061 type: "boolean", 7062 default: !1, 7063 strict: !1 7064 }, 7065 enablePrivacyForActionName: { 7066 type: "boolean", 7067 default: !0 7068 }, 7069 propagateTraceBaggage: { 7070 type: "boolean", 7071 default: !0 7072 }, 7073 startSessionReplayRecordingManually: { 7074 type: "boolean", 7075 default: !1, 7076 strict: !1 7077 }, 7078 sessionReplayCanvasRecording: { 7079 type: "schema", 7080 schema: { 7081 enable: { 7082 type: "boolean", 7083 required: !0 7084 }, 7085 maxFramesPerSecond: { 7086 type: "number", 7087 min: 0, 7088 max: 5, 7089 default: 1 7090 } 7091 } 7092 }, 7093 defaultPrivacyLevel: { 7094 type: "enum", 7095 values: Fe, 7096 default: Fe.MASK_USER_INPUT,
7097 strict: !1 7098 }, 7099 traceContextInjection: { 7100 type: "enum", 7101 values: cn, 7102 default: cn.SAMPLED, 7103 strict: !1 7104 }, 7105 excludedActivityUrls: { 7106 type: "match-option", 7107 multiple: !0, 7108 default: [] 7109 }, 7110 allowedTracingUrls: { 7111 type: "union", 7112 multiple: !0, 7113 strict: !1, 7114 default: [], 7115 variants: [{ type: "match-option" }, { 7116 type: "schema", 7117 schema: { 7118 match: { 7119 type: "match-option", 7120 required: !0 7121 }, 7122 propagatorTypes: { 7123 type: "enum", 7124 values: [ 7125 "datadog", 7126 "b3", 7127 "b3multi", 7128 "tracecontext" 7129 ], 7130 multiple: !0, 7131 strict: !1, 7132 default: mn 7133 } 7134 } 7135 }] 7136 }, 7137 plugins: { 7138 type: "schema", 7139 multiple: !0, 7140 strict: !1, 7141 default: [], 7142 schema: { 7143 name: { 7144 type: "string", 7145 required: !0 7146 }, 7147 getConfigurationTelemetry: { 7148 type: "function", 7149 strict: !1, 7150 signature: void 0 7151 }, 7152 onInit: { 7153 type: "function", 7154 strict: !1, 7155 signature: void 0 7156 }, 7157 onRumStart: { 7158 type: "function", 7159 strict: !1, 7160 signature: void 0 7161 } 7162 } 7163 }, 7164 trackFeatureFlagsForEvents: { 7165 type: "enum", 7166 values: [ 7167 "vital", 7168 "action", 7169 "long_task", 7170 "resource" 7171 ], 7172 multiple: !0, 7173 strict: !1, 7174 default: [] 7175 } 7176 }), Va = [ 7177 "request", 7178 "response", 7179 "any" 7180 ], Fa = Ae, Ha = [ 7181 [z.DOCUMENT, (e) => e === "navigation"], 7182 [z.XHR, (e) => e === "xmlhttprequest"], 7183 [z.FETCH, (e) => e === "fetch"], 7184 [z.BEACON, (e) => e === "beacon"], 7185 [z.CSS, (e, t) => /\.css$/i.test(t)], 7186 [z.JS, (e, t) => /\.js$/i.test(t)], 7187 [z.IMAGE, (e, t) => [ 7188 "image", 7189 "img", 7190 "icon" 7191 ].includes(e) || /\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t) !== null], 7192 [z.FONT, (e, t) => /\.(woff|eot|woff2|ttf)$/i.exec(t) !== null], 7193 [z.MEDIA, (e, t) => ["audio", "video"].includes(e) || /\.(mp3|mp4)$/i.exec(t) !== null] 7194 ], qa = /data:(.+)?(;base64)?,/g, Ga = 24e3, Ba = (function(e) { 7195 return e.EVENT = "event", e.FIRST_INPUT = "first-input", e.LARGEST_CONTENTFUL_PAINT = "largest-contentful-paint", e.LAYOUT_SHIFT = "layout-shift", e.LONG_TASK = "longtask", e.LONG_ANIMATION_FRAME = "long-animation-frame", e.NAVIGATION = "navigation", e.PAINT = "paint", e.RESOURCE = "resource", e.VISIBILITY_STATE = "visibility-state", e; 7196 })({}), ja = "data-dd-action-name", Jr = "Masked Element", Wa = "::shadow ", yn = [ 7197 ja, 7198 "data-testid", 7199 "data-test", 7200 "data-qa", 7201 "data-cy", 7202 "data-test-id", 7203 "data-qa-id", 7204 "data-testing", 7205 "data-component", 7206 "data-element", 7207 "data-source-file" 7208 ], za = [Oo, Ro], Xa = [ 7209 Oo, 7210 uf, 7211 ko 7212 ], I = { 7213 IGNORE: "ignore", 7214 HIDDEN: "hidden", 7215 ALLOW: Fe.ALLOW, 7216 MASK: Fe.MASK, 7217 MASK_USER_INPUT: Fe.MASK_USER_INPUT, 7218 MASK_UNLESS_ALLOWLISTED: Fe.MASK_UNLESS_ALLOWLISTED 7219 }, Qr = "data-dd-privacy", Ya = "hidden", Ja = "dd-privacy-", Qa = "data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==", Za = { 7220 INPUT: !0, 7221 OUTPUT: !0, 7222 TEXTAREA: !0, 7223 SELECT: !0, 7224 OPTION: !0, 7225 DATALIST: !0, 7226 OPTGROUP: !0 7227 }, eu = (function(e) { 7228 return e[e.OFF = 0] = "OFF", e[e.SAMPLED = 1] = "SAMPLED", e[e.FORCED = 2] = "FORCED", e; 7229 })({}), tu = 32768, nu = 1, ru = "websocket-connecting", iu = "websocket-closed", ou = 3e5, su = ["HTML", "BODY"], ei = 2048, ti = yn.concat([ 7230 "role", 7231 "type", 7232 "disabled", 7233 "readonly", 7234 "tabindex", 7235 "draggable", 7236 "target", 7237 "rel", 7238 "download", 7239 "method", 7240 "action", 7241 "enctype", 7242 "autocomplete" 7243 ]), ni = 1e3, au = [ 7244 (e, t, n) => { 7245 if ("labels" in e && e.labels && e.labels.length > 0) return Zt(e.labels[0], t, n); 7246 }, 7247 (e) => { 7248 if (e.nodeName === "INPUT") { 7249 let t = e, n = t.getAttribute("type"); 7250 if (n === "button" || n === "submit" || n === "reset") return { 7251 name: t.value, 7252 nameSource: "text_content" 7253 }; 7254 } 7255 }, 7256 (e, t, n) => { 7257 if (e.nodeName === "BUTTON" || e.nodeName === "LABEL" || e.getAttribute("role") === "button") return Zt(e, t, n); 7258 }, 7259 (e, t, n) => wt(e, "aria-label", t, n), 7260 (e, t, n) => { 7261 let r = e.getAttribute("aria-labelledby"); 7262 if (r) return { 7263 name: r.split(/\s+/).map((i) => Xf(e, i)).filter((i) => !!i).map((i) => Qo(i, t, n)).join(" "), 7264 nameSource: "text_content" 7265 }; 7266 }, 7267 (e, t, n) => wt(e, "alt", t, n), 7268 (e, t, n) => wt(e, "name", t, n), 7269 (e, t, n) => wt(e, "title", t, n), 7270 (e, t, n) => wt(e, "placeholder", t, n), 7271 (e, t, n) => { 7272 if ("options" in e && e.options.length > 0) return Zt(e.options[0], t, n); 7273 } 7274 ], uu = [(e, t, n) => Zt(e, t, n)], cu = 10, lu = 3, du = "input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"range\"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *", ri = 1e4, st = /* @__PURE__ */ new Map(), fu = 12e4, pu = /(token|cookie|secret|authorization|(api|secret|access|app).?key|(client|connecting|real).?ip|forwarded)/, ii = 100, hn = 128, mu = (e) => gn.includes(e), gu = 6e5, yu = 6e5, bn = (e, t) => e * t, hu = (e, t) => { 7275 let n = Math.max(e.left, t.left), r = Math.max(e.top, t.top), i = Math.min(e.right, t.right), o = Math.min(e.bottom, t.bottom); 7276 return n >= i || r >= o ? 0 : bn(i - n, o - r); 7277 }, oi = (e) => { 7278 let t = bn(e.previousRect.width, e.previousRect.height), n = bn(e.currentRect.width, e.currentRect.height), r = hu(e.previousRect, e.currentRect); 7279 return t + n - r; 7280 }, bu = 5e3, vu = 1e3, si = 0, En = 1 / 0, Sn = 0, ai = () => vn ? si : window.performance.interactionCount || 0, ui = 10, Eu = 6e4, Su = 8, _u = 1e3, Cu = 3e3, wu = 3e5, Tu = 3e5, Au = Ae, Ru = Ae, ku = 1e4, Ou = 4e3, Iu = Ae, xu = 1e3, Nu = "datadog-ci-visibility-test-execution-id", Ge = { 7281 "view.name": "string", 7282 "view.url": "string", 7283 "view.referrer": "string", 7284 context: "object", 7285 service: "string", 7286 version: "string" 7287 }, Lu = { 7288 [T.VIEW]: N(v({}, Ge), { "view.performance.lcp.resource_url": "string" }), 7289 [T.ERROR]: N(v({}, Ge), { 7290 "error.message": "string", 7291 "error.stack": "string", 7292 "error.handling_stack": "string", 7293 "error.resource.url": "string", 7294 "error.fingerprint": "string", 7295 "_dd.debug_ids": "array" 7296 }), 7297 [T.RESOURCE]: N(v({}, Ge), { 7298 "resource.url": "string", 7299 "resource.graphql.variables": "string", 7300 "resource.request.headers": "object", 7301 "resource.response.headers": "object", 7302 "resource.websocket.close_reason": "string", 7303 "resource.websocket.protocol": "string" 7304 }), 7305 [T.ACTION]: N(v({}, Ge), { "action.target.name": "string" }), 7306 [T.LONG_TASK]: N(v({}, Ge), { 7307 "long_task.scripts[].source_url": "string", 7308 "long_task.scripts[].invoker": "string", 7309 "_dd.debug_ids": "array" 7310 }), 7311 [T.VITAL]: Ge 7312 }, Mu = [ 7313 T.ACTION,
7314 T.ERROR, 7315 T.LONG_TASK, 7316 T.RESOURCE, 7317 T.VITAL 7318 ]; 7319 })))(); 7320} 7321export { oe as $, O as A, Ba as At, ff as B, fe as C, te as Ct, Co as D, Uc as Dt, I as E, ef as Et, G as F, Nn as G, _a as H, jt as I, Ul as J, Ee as K, $i as L, ce as M, gf as Mt, D as N, Mo as O, Ie as Ot, sr as P, en as Q, K as R, To as S, tg as St, Pc as T, kr as Tt, xn as U, Fo as V, ol as W, rg as X, ur as Y, Se as Z, Lo as _, Xr as _t, V as a, dt as at, U as b, eu as bt, j as c, Qa as ct, Ya as d, L as dt, Pn as et, $o as f, Ti as ft, Ae as g, Yt as gt, Wn as h, Oe as ht, lr as i, we as it, Fn as j, w as jt, he as k, x as kt, Ct as l, Vo as lt, $t as m, Dn as mt, T as n, pi as nt, Ml as o, Du as ot, R as p, sg as pt, bi as q, Me as r, k as rt, Li as s, Y as st, Q as t, fn as tt, Do as u, pt as ut, Kc as v, Vn as vt, Ht as w, gt as wt, xe as x, uo as xt, Ye as y, Qr as yt, Rt as z }; 7322 7323//# sourceMappingURL=chunk-f2v2cgea.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.