@utk09/ui-observability 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +69 -219
  2. package/README.md +24 -26
  3. package/dist/{batch-CXmPmTse.js → batch-D3NHhF9L.js} +3 -3
  4. package/dist/{batch-CXmPmTse.js.map → batch-D3NHhF9L.js.map} +1 -1
  5. package/dist/{batch-mmPigCpi.cjs → batch-DnYRJqhU.cjs} +2 -2
  6. package/dist/{batch-mmPigCpi.cjs.map → batch-DnYRJqhU.cjs.map} +1 -1
  7. package/dist/bus/bus.d.cts +26 -2
  8. package/dist/bus/bus.d.ts +26 -2
  9. package/dist/bus-B__467mL.cjs +2 -0
  10. package/dist/bus-B__467mL.cjs.map +1 -0
  11. package/dist/{bus-C39wspFV.js → bus-dw7T92sO.js} +37 -24
  12. package/dist/bus-dw7T92sO.js.map +1 -0
  13. package/dist/capture/interactions.d.cts +35 -3
  14. package/dist/capture/interactions.d.ts +35 -3
  15. package/dist/capture/observed-windows.d.cts +51 -0
  16. package/dist/capture/observed-windows.d.ts +51 -0
  17. package/dist/{compression-CvED_Jel.cjs → compression-C0hUHKR-.cjs} +2 -2
  18. package/dist/{compression-CvED_Jel.cjs.map → compression-C0hUHKR-.cjs.map} +1 -1
  19. package/dist/{compression-tVtXwVjX.js → compression-SHPAvS4U.js} +2 -2
  20. package/dist/{compression-tVtXwVjX.js.map → compression-SHPAvS4U.js.map} +1 -1
  21. package/dist/{config-SgQcCP1_.js → config-CSNcS7OZ.js} +194 -196
  22. package/dist/config-CSNcS7OZ.js.map +1 -0
  23. package/dist/config-CybPP5VM.cjs +2 -0
  24. package/dist/config-CybPP5VM.cjs.map +1 -0
  25. package/dist/{console-BGgGnjSi.js → console-BsM-fSCQ.js} +4 -4
  26. package/dist/{console-BGgGnjSi.js.map → console-BsM-fSCQ.js.map} +1 -1
  27. package/dist/{console-CSZ5_Vx5.cjs → console-Dkxs6IVQ.cjs} +2 -2
  28. package/dist/{console-CSZ5_Vx5.cjs.map → console-Dkxs6IVQ.cjs.map} +1 -1
  29. package/dist/{constants-CUyd9cTZ.js → constants-BwJDXzj6.js} +23 -23
  30. package/dist/constants-BwJDXzj6.js.map +1 -0
  31. package/dist/constants-CtF52hIV.cjs +2 -0
  32. package/dist/constants-CtF52hIV.cjs.map +1 -0
  33. package/dist/constants.d.cts +12 -0
  34. package/dist/constants.d.ts +12 -0
  35. package/dist/core/diagnostics.d.cts +1 -1
  36. package/dist/core/diagnostics.d.ts +1 -1
  37. package/dist/core/rotation.d.cts +26 -2
  38. package/dist/core/rotation.d.ts +26 -2
  39. package/dist/core/runtime.d.cts +9 -0
  40. package/dist/core/runtime.d.ts +9 -0
  41. package/dist/{debug-bundle-BXIlwDKM.cjs → debug-bundle-B2v6Cym-.cjs} +2 -2
  42. package/dist/{debug-bundle-BXIlwDKM.cjs.map → debug-bundle-B2v6Cym-.cjs.map} +1 -1
  43. package/dist/{debug-bundle-CRpYV_ui.js → debug-bundle-Cs_YWzTa.js} +4 -4
  44. package/dist/{debug-bundle-CRpYV_ui.js.map → debug-bundle-Cs_YWzTa.js.map} +1 -1
  45. package/dist/doctor.cjs +1 -1
  46. package/dist/doctor.js +31 -31
  47. package/dist/doctor.js.map +1 -1
  48. package/dist/{errors-CNPbesMs.cjs → errors-DP2RUm4V.cjs} +2 -2
  49. package/dist/{errors-CNPbesMs.cjs.map → errors-DP2RUm4V.cjs.map} +1 -1
  50. package/dist/{errors-BE_EZV7Q.js → errors-Q3Ng1ciC.js} +3 -3
  51. package/dist/{errors-BE_EZV7Q.js.map → errors-Q3Ng1ciC.js.map} +1 -1
  52. package/dist/{factory-CTi0Is3F.js → factory-DV17sm2p.js} +22 -22
  53. package/dist/{factory-CTi0Is3F.js.map → factory-DV17sm2p.js.map} +1 -1
  54. package/dist/{factory-hRrH32v5.cjs → factory-K8O6gpux.cjs} +2 -2
  55. package/dist/{factory-hRrH32v5.cjs.map → factory-K8O6gpux.cjs.map} +1 -1
  56. package/dist/{identity-DdhKgrpk.js → identity-BgtHyY4u.js} +38 -27
  57. package/dist/identity-BgtHyY4u.js.map +1 -0
  58. package/dist/identity-CvuyqZk7.cjs +2 -0
  59. package/dist/identity-CvuyqZk7.cjs.map +1 -0
  60. package/dist/index.cjs +1 -1
  61. package/dist/index.cjs.map +1 -1
  62. package/dist/index.d.cts +1 -0
  63. package/dist/index.d.ts +1 -0
  64. package/dist/index.js +600 -569
  65. package/dist/index.js.map +1 -1
  66. package/dist/{indexeddb-storage-CL9uqBCy.cjs → indexeddb-storage-D4KVcqdD.cjs} +2 -2
  67. package/dist/{indexeddb-storage-CL9uqBCy.cjs.map → indexeddb-storage-D4KVcqdD.cjs.map} +1 -1
  68. package/dist/{indexeddb-storage-GHdl0t8A.js → indexeddb-storage-e-13ZLWm.js} +17 -17
  69. package/dist/{indexeddb-storage-GHdl0t8A.js.map → indexeddb-storage-e-13ZLWm.js.map} +1 -1
  70. package/dist/interactions-Byxf1C82.js +207 -0
  71. package/dist/interactions-Byxf1C82.js.map +1 -0
  72. package/dist/interactions-OK85T-Dk.cjs +2 -0
  73. package/dist/interactions-OK85T-Dk.cjs.map +1 -0
  74. package/dist/{journey-D2_sia57.js → journey-C93FTYcs.js} +14 -14
  75. package/dist/{journey-D2_sia57.js.map → journey-C93FTYcs.js.map} +1 -1
  76. package/dist/{journey-B4Adltjm.cjs → journey-nMbob3OB.cjs} +2 -2
  77. package/dist/{journey-B4Adltjm.cjs.map → journey-nMbob3OB.cjs.map} +1 -1
  78. package/dist/{library-console-CPW6bvZH.cjs → library-console-DJUQzcgM.cjs} +2 -2
  79. package/dist/{library-console-CPW6bvZH.cjs.map → library-console-DJUQzcgM.cjs.map} +1 -1
  80. package/dist/{library-console-Btrzt814.js → library-console-DklSmucS.js} +2 -2
  81. package/dist/{library-console-Btrzt814.js.map → library-console-DklSmucS.js.map} +1 -1
  82. package/dist/{library-request-BJ9PLRaD.js → library-request-UGEwOHpf.js} +2 -2
  83. package/dist/{library-request-BJ9PLRaD.js.map → library-request-UGEwOHpf.js.map} +1 -1
  84. package/dist/{library-request-D7OvTxZV.cjs → library-request-kY9iTpIF.cjs} +2 -2
  85. package/dist/{library-request-D7OvTxZV.cjs.map → library-request-kY9iTpIF.cjs.map} +1 -1
  86. package/dist/{lifecycle-22CUCrc9.js → lifecycle-B2PlIuQu.js} +2 -2
  87. package/dist/{lifecycle-22CUCrc9.js.map → lifecycle-B2PlIuQu.js.map} +1 -1
  88. package/dist/{lifecycle-IaAm1mOC.cjs → lifecycle-DaMdH_X7.cjs} +2 -2
  89. package/dist/{lifecycle-IaAm1mOC.cjs.map → lifecycle-DaMdH_X7.cjs.map} +1 -1
  90. package/dist/{log-record-CkivuiEl.cjs → log-record-Bmx6etMh.cjs} +2 -2
  91. package/dist/{log-record-CkivuiEl.cjs.map → log-record-Bmx6etMh.cjs.map} +1 -1
  92. package/dist/{log-record-BNiLfqtL.js → log-record-DSt2P-Sr.js} +2 -2
  93. package/dist/{log-record-BNiLfqtL.js.map → log-record-DSt2P-Sr.js.map} +1 -1
  94. package/dist/{long-frames-DNFaRnC3.js → long-frames-Bamjs1WV.js} +3 -3
  95. package/dist/{long-frames-DNFaRnC3.js.map → long-frames-Bamjs1WV.js.map} +1 -1
  96. package/dist/{long-frames-BUUbXd-B.cjs → long-frames-lhtONgGt.cjs} +2 -2
  97. package/dist/{long-frames-BUUbXd-B.cjs.map → long-frames-lhtONgGt.cjs.map} +1 -1
  98. package/dist/models/bus.d.cts +6 -1
  99. package/dist/models/bus.d.ts +6 -1
  100. package/dist/models/config.d.cts +23 -8
  101. package/dist/models/config.d.ts +23 -8
  102. package/dist/models/serializer.d.cts +3 -1
  103. package/dist/models/serializer.d.ts +3 -1
  104. package/dist/{network-CGMLQ-mA.cjs → network-BCn8Gn47.cjs} +2 -2
  105. package/dist/{network-CGMLQ-mA.cjs.map → network-BCn8Gn47.cjs.map} +1 -1
  106. package/dist/{network-on2zZT6H.js → network-Cg1L2w2r.js} +12 -12
  107. package/dist/{network-on2zZT6H.js.map → network-Cg1L2w2r.js.map} +1 -1
  108. package/dist/observed-windows-B3gJkdql.cjs +2 -0
  109. package/dist/observed-windows-B3gJkdql.cjs.map +1 -0
  110. package/dist/observed-windows-BrwaJNlj.js +64 -0
  111. package/dist/observed-windows-BrwaJNlj.js.map +1 -0
  112. package/dist/{otlp-BENHf3g9.cjs → otlp-CrAWkQdO.cjs} +2 -2
  113. package/dist/{otlp-BENHf3g9.cjs.map → otlp-CrAWkQdO.cjs.map} +1 -1
  114. package/dist/{otlp-DimfrRor.js → otlp-D6dRZyB8.js} +6 -6
  115. package/dist/{otlp-DimfrRor.js.map → otlp-D6dRZyB8.js.map} +1 -1
  116. package/dist/{platform-BaaFIPCU.js → platform-8DLhjddo.js} +7 -7
  117. package/dist/{platform-BaaFIPCU.js.map → platform-8DLhjddo.js.map} +1 -1
  118. package/dist/{platform-CfA3-7sJ.cjs → platform-BqRc-7RO.cjs} +2 -2
  119. package/dist/{platform-CfA3-7sJ.cjs.map → platform-BqRc-7RO.cjs.map} +1 -1
  120. package/dist/{profiler-BAZoh7A4.js → profiler-BaXSqCfz.js} +59 -59
  121. package/dist/{profiler-BAZoh7A4.js.map → profiler-BaXSqCfz.js.map} +1 -1
  122. package/dist/{profiler-D4tJpDRc.cjs → profiler-BvWW2kNM.cjs} +2 -2
  123. package/dist/{profiler-D4tJpDRc.cjs.map → profiler-BvWW2kNM.cjs.map} +1 -1
  124. package/dist/{profiler-frames-cJMx9wNM.js → profiler-frames-C4ySHN0X.js} +16 -16
  125. package/dist/{profiler-frames-cJMx9wNM.js.map → profiler-frames-C4ySHN0X.js.map} +1 -1
  126. package/dist/{profiler-frames-C4xr7KfH.cjs → profiler-frames-DeaBiB-5.cjs} +2 -2
  127. package/dist/{profiler-frames-C4xr7KfH.cjs.map → profiler-frames-DeaBiB-5.cjs.map} +1 -1
  128. package/dist/{remote-rules-_tY0zj5o.cjs → remote-rules-D7L6D_D2.cjs} +2 -2
  129. package/dist/{remote-rules-_tY0zj5o.cjs.map → remote-rules-D7L6D_D2.cjs.map} +1 -1
  130. package/dist/{remote-rules-Dz9MRAsB.js → remote-rules-Dq9xe7Qn.js} +22 -22
  131. package/dist/{remote-rules-Dz9MRAsB.js.map → remote-rules-Dq9xe7Qn.js.map} +1 -1
  132. package/dist/{replay-Ds-ANH34.js → replay-B0M8kWz_.js} +24 -24
  133. package/dist/{replay-Ds-ANH34.js.map → replay-B0M8kWz_.js.map} +1 -1
  134. package/dist/{replay-B3gFXIZd.cjs → replay-QOFBpAXh.cjs} +2 -2
  135. package/dist/{replay-B3gFXIZd.cjs.map → replay-QOFBpAXh.cjs.map} +1 -1
  136. package/dist/{reports-C-thq-bk.js → reports--8APRLa-.js} +3 -3
  137. package/dist/{reports-C-thq-bk.js.map → reports--8APRLa-.js.map} +1 -1
  138. package/dist/{reports-BDSe4dFH.cjs → reports-ojuMKGO7.cjs} +2 -2
  139. package/dist/{reports-BDSe4dFH.cjs.map → reports-ojuMKGO7.cjs.map} +1 -1
  140. package/dist/{resource-timing-eUl2dNgC.js → resource-timing-BzR05rE-.js} +4 -4
  141. package/dist/{resource-timing-eUl2dNgC.js.map → resource-timing-BzR05rE-.js.map} +1 -1
  142. package/dist/{resource-timing-C576gFIQ.cjs → resource-timing-pAG3ZhB5.cjs} +2 -2
  143. package/dist/{resource-timing-C576gFIQ.cjs.map → resource-timing-pAG3ZhB5.cjs.map} +1 -1
  144. package/dist/{response-body-eoSQpLiH.js → response-body-BWvwKQ2p.js} +106 -106
  145. package/dist/{response-body-eoSQpLiH.js.map → response-body-BWvwKQ2p.js.map} +1 -1
  146. package/dist/{response-body-YdNl-HkR.cjs → response-body-CKEJ5itk.cjs} +3 -3
  147. package/dist/{response-body-YdNl-HkR.cjs.map → response-body-CKEJ5itk.cjs.map} +1 -1
  148. package/dist/{rotation-Cwct4ckk.js → rotation-BylN1B9e.js} +10 -11
  149. package/dist/rotation-BylN1B9e.js.map +1 -0
  150. package/dist/rotation-E2eKClIs.cjs +2 -0
  151. package/dist/rotation-E2eKClIs.cjs.map +1 -0
  152. package/dist/{sampling-mXt4dstx.cjs → sampling-B46LW0cy.cjs} +2 -2
  153. package/dist/{sampling-mXt4dstx.cjs.map → sampling-B46LW0cy.cjs.map} +1 -1
  154. package/dist/{sampling-BlrI8jor.js → sampling-zXA6r-Nw.js} +16 -16
  155. package/dist/{sampling-BlrI8jor.js.map → sampling-zXA6r-Nw.js.map} +1 -1
  156. package/dist/{sanitize-Ba0KqU06.js → sanitize-DjnR6RXR.js} +2 -2
  157. package/dist/{sanitize-Ba0KqU06.js.map → sanitize-DjnR6RXR.js.map} +1 -1
  158. package/dist/{sanitize-DQyiI_KY.cjs → sanitize-Qj6LuZqp.cjs} +2 -2
  159. package/dist/{sanitize-DQyiI_KY.cjs.map → sanitize-Qj6LuZqp.cjs.map} +1 -1
  160. package/dist/{sender-Dv8rAmpV.js → sender-Bdp-TAS4.js} +71 -71
  161. package/dist/{sender-Dv8rAmpV.js.map → sender-Bdp-TAS4.js.map} +1 -1
  162. package/dist/{sender-BdRuNVhF.cjs → sender-DR7ZycZY.cjs} +2 -2
  163. package/dist/{sender-BdRuNVhF.cjs.map → sender-DR7ZycZY.cjs.map} +1 -1
  164. package/dist/{stored-context-CXt7eHZL.cjs → stored-context-BOu54M8Y.cjs} +2 -2
  165. package/dist/{stored-context-CXt7eHZL.cjs.map → stored-context-BOu54M8Y.cjs.map} +1 -1
  166. package/dist/{stored-context-B2EzVuYm.js → stored-context-CSttrAsw.js} +6 -6
  167. package/dist/{stored-context-B2EzVuYm.js.map → stored-context-CSttrAsw.js.map} +1 -1
  168. package/dist/{storm-C-zYSdDX.cjs → storm-BHgI12iS.cjs} +2 -2
  169. package/dist/{storm-C-zYSdDX.cjs.map → storm-BHgI12iS.cjs.map} +1 -1
  170. package/dist/{storm-DjKetLKZ.js → storm-DKlpv0FL.js} +2 -2
  171. package/dist/{storm-DjKetLKZ.js.map → storm-DKlpv0FL.js.map} +1 -1
  172. package/dist/{unclean-exit-py99ApzT.cjs → unclean-exit-BYPYYkQ5.cjs} +2 -2
  173. package/dist/{unclean-exit-py99ApzT.cjs.map → unclean-exit-BYPYYkQ5.cjs.map} +1 -1
  174. package/dist/{unclean-exit-DQD1cT7c.js → unclean-exit-BcOB8A2e.js} +2 -2
  175. package/dist/{unclean-exit-DQD1cT7c.js.map → unclean-exit-BcOB8A2e.js.map} +1 -1
  176. package/dist/{user-timing-BePqb1uN.js → user-timing-4KIJ74Vi.js} +2 -2
  177. package/dist/{user-timing-BePqb1uN.js.map → user-timing-4KIJ74Vi.js.map} +1 -1
  178. package/dist/{user-timing-D6XTmpuM.cjs → user-timing-BsU2wQKE.cjs} +2 -2
  179. package/dist/{user-timing-D6XTmpuM.cjs.map → user-timing-BsU2wQKE.cjs.map} +1 -1
  180. package/dist/utils/identity.d.cts +5 -0
  181. package/dist/utils/identity.d.ts +5 -0
  182. package/dist/{web-socket-CoIUBM3C.cjs → web-socket-Cs1ZbmmN.cjs} +2 -2
  183. package/dist/{web-socket-CoIUBM3C.cjs.map → web-socket-Cs1ZbmmN.cjs.map} +1 -1
  184. package/dist/{web-socket-DSHgDiZ6.js → web-socket-Zg0hj1LB.js} +4 -4
  185. package/dist/{web-socket-DSHgDiZ6.js.map → web-socket-Zg0hj1LB.js.map} +1 -1
  186. package/dist/{worker-protocol-x074Rpet.js → worker-protocol-CYpAbrVl.js} +4 -4
  187. package/dist/{worker-protocol-x074Rpet.js.map → worker-protocol-CYpAbrVl.js.map} +1 -1
  188. package/dist/{worker-protocol-QbvqNazn.cjs → worker-protocol-DFYXIFus.cjs} +2 -2
  189. package/dist/{worker-protocol-QbvqNazn.cjs.map → worker-protocol-DFYXIFus.cjs.map} +1 -1
  190. package/dist/{worker-server-CFe4nvos.cjs → worker-server--yGTadTA.cjs} +2 -2
  191. package/dist/{worker-server-CFe4nvos.cjs.map → worker-server--yGTadTA.cjs.map} +1 -1
  192. package/dist/{worker-server-iUVSjH8L.js → worker-server-BokySIII.js} +25 -25
  193. package/dist/{worker-server-iUVSjH8L.js.map → worker-server-BokySIII.js.map} +1 -1
  194. package/dist/worker-transport-BdEvh_-a.cjs +2 -0
  195. package/dist/worker-transport-BdEvh_-a.cjs.map +1 -0
  196. package/dist/{worker-transport-Dy1KMA7t.js → worker-transport-JK-Fby9J.js} +23 -19
  197. package/dist/worker-transport-JK-Fby9J.js.map +1 -0
  198. package/llms.txt +13 -10
  199. package/package.json +13 -5
  200. package/dist/bus-C39wspFV.js.map +0 -1
  201. package/dist/bus-_EaOVPGq.cjs +0 -2
  202. package/dist/bus-_EaOVPGq.cjs.map +0 -1
  203. package/dist/config-DUs7uHHt.cjs +0 -2
  204. package/dist/config-DUs7uHHt.cjs.map +0 -1
  205. package/dist/config-SgQcCP1_.js.map +0 -1
  206. package/dist/constants-CUyd9cTZ.js.map +0 -1
  207. package/dist/constants-CqdJhTxH.cjs +0 -2
  208. package/dist/constants-CqdJhTxH.cjs.map +0 -1
  209. package/dist/identity-DdhKgrpk.js.map +0 -1
  210. package/dist/identity-DlWRIuwy.cjs +0 -2
  211. package/dist/identity-DlWRIuwy.cjs.map +0 -1
  212. package/dist/interactions-CUkzK8sR.cjs +0 -2
  213. package/dist/interactions-CUkzK8sR.cjs.map +0 -1
  214. package/dist/interactions-DiFvCosX.js +0 -111
  215. package/dist/interactions-DiFvCosX.js.map +0 -1
  216. package/dist/rotation-Cwct4ckk.js.map +0 -1
  217. package/dist/rotation-D4qUAHAu.cjs +0 -2
  218. package/dist/rotation-D4qUAHAu.cjs.map +0 -1
  219. package/dist/worker-transport-CRAX-09c.cjs +0 -2
  220. package/dist/worker-transport-CRAX-09c.cjs.map +0 -1
  221. package/dist/worker-transport-Dy1KMA7t.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,46 +1,47 @@
1
- import { $n as e, An as t, Bt as n, Dn as r, En as i, G as a, Gn as o, Hn as s, J as c, K as l, Lt as u, M as d, Mn as f, Nn as p, Ot as m, P as h, Qn as g, Sn as ee, Tn as _, Vn as te, Y as ne, _ as re, _n as ie, a as v, at as ae, bn as oe, c as y, d as se, er as b, f as x, g as S, gn as ce, h as C, hn as le, j as ue, jt as de, kt as w, m as fe, mn as pe, nr as me, o as he, on as ge, or as _e, p as ve, q as ye, rr as be, rt as xe, s as Se, sn as Ce, sr as we, tr as Te, u as Ee, v as T, vn as De, wn as Oe, xn as ke, xt as Ae, y as je, yn as Me, zt as E } from "./constants-CUyd9cTZ.js";
2
- import { n as Ne, r as Pe, t as Fe } from "./log-record-BNiLfqtL.js";
3
- import { n as Ie, r as Le, t as Re } from "./error-like-B11pB4aL.js";
4
- import { n as D, t as ze } from "./guards-BlYGRK4l.js";
5
- import { t as O } from "./unref-DgHPQeWv.js";
6
- import { i as Be, n as Ve, t as He } from "./platform-BaaFIPCU.js";
7
- import { t as k } from "./defineProperty-s2S8BXUc.js";
8
- import { a as Ue, i as A, n as We, o as Ge, r as Ke, s as qe, t as Je } from "./identity-DdhKgrpk.js";
9
- import { t as j } from "./profiler-BAZoh7A4.js";
10
- import { n as M, t as Ye } from "./library-console-Btrzt814.js";
11
- import { i as Xe, n as Ze, r as N } from "./sanitize-Ba0KqU06.js";
12
- import { r as Qe } from "./library-request-BJ9PLRaD.js";
13
- import { n as $e, r as P, t as F } from "./config-SgQcCP1_.js";
14
- import { r as et, t as tt } from "./batch-CXmPmTse.js";
15
- import { n as nt, t as rt } from "./journey-D2_sia57.js";
16
- import { a as it, i as at, n as ot, o as st } from "./sampling-BlrI8jor.js";
1
+ import { An as e, At as t, Bt as n, Cn as r, Dn as i, Fn as a, Gn as o, In as s, J as c, Jn as l, K as u, M as d, Mt as f, Nn as p, On as m, P as h, Rt as g, Sn as ee, St as _, Tn as te, Vt as ne, Wn as re, X as ie, Y as ae, _ as oe, _n as se, a as v, ar as ce, bn as le, c as y, d as ue, f as b, g as x, h as S, ir as de, it as fe, j as pe, kn as me, kt as he, ln as ge, lr as _e, m as ve, nr as ye, o as be, or as xe, ot as Se, p as Ce, q as we, rr as C, s as Te, tr as Ee, u as De, un as Oe, ur as ke, v as w, vn as Ae, wn as je, xn as Me, y as Ne, yn as Pe } from "./constants-BwJDXzj6.js";
2
+ import { n as Fe, r as Ie, t as Le } from "./log-record-DSt2P-Sr.js";
3
+ import { n as Re, r as ze, t as Be } from "./error-like-B11pB4aL.js";
4
+ import { n as T, t as Ve } from "./guards-BlYGRK4l.js";
5
+ import { t as E } from "./unref-DgHPQeWv.js";
6
+ import { i as He, n as Ue, t as We } from "./platform-8DLhjddo.js";
7
+ import { t as D } from "./defineProperty-s2S8BXUc.js";
8
+ import { a as Ge, i as O, n as Ke, o as qe, r as Je, s as Ye, t as Xe } from "./identity-BgtHyY4u.js";
9
+ import { t as k } from "./profiler-BaXSqCfz.js";
10
+ import { n as A, t as Ze } from "./library-console-DklSmucS.js";
11
+ import { i as Qe, n as $e, r as j } from "./sanitize-DjnR6RXR.js";
12
+ import { r as et } from "./library-request-UGEwOHpf.js";
13
+ import { n as tt, r as M, t as N } from "./config-CSNcS7OZ.js";
14
+ import { r as nt, t as rt } from "./batch-D3NHhF9L.js";
15
+ import { n as it, t as at } from "./journey-C93FTYcs.js";
16
+ import { a as ot, i as st, n as ct, o as lt } from "./sampling-zXA6r-Nw.js";
17
+ import { r as ut } from "./observed-windows-BrwaJNlj.js";
17
18
  // src/core/deferred.ts
18
- var I = /* @__PURE__ */ new WeakMap();
19
- function ct(e) {
19
+ var P = /* @__PURE__ */ new WeakMap();
20
+ function dt(e) {
20
21
  let t = e.idle;
21
22
  t !== void 0 && (e.diagnostics.guard("pipeline.crashed", "The idle callback could not be cancelled.", () => {
22
23
  cancelIdleCallback(t);
23
24
  }), e.idle = void 0), clearTimeout(e.timer), e.timer = void 0;
24
25
  }
25
- function lt(e, t) {
26
+ function ft(e, t) {
26
27
  typeof requestIdleCallback == "function" && typeof cancelIdleCallback == "function" && (t.idle = t.diagnostics.guard("pipeline.crashed", "The idle callback could not be scheduled.", () => requestIdleCallback((n) => {
27
- L(e, t, n);
28
- }, { timeout: l })), t.idle !== void 0) || (t.timer = setTimeout(() => {
29
- L(e, t);
30
- }, 0), O(t.timer));
31
- }
32
- function L(e, t, n) {
33
- if (I.get(e) !== t || t.draining) return;
34
- ct(t), t.draining = !0;
28
+ F(e, t, n);
29
+ }, { timeout: we })), t.idle !== void 0) || (t.timer = setTimeout(() => {
30
+ F(e, t);
31
+ }, 0), E(t.timer));
32
+ }
33
+ function F(e, t, n) {
34
+ if (P.get(e) !== t || t.draining) return;
35
+ dt(t), t.draining = !0;
35
36
  let r = t.work;
36
37
  t.work = [];
37
38
  let i = 0;
38
- for (; i < r.length && (!n || n.didTimeout && i === 0 || n.timeRemaining() > 0);) if (t.diagnostics.guard("pipeline.crashed", "The library could not build a deferred record.", r[i]), i++, I.get(e) !== t) return;
39
- t.work = [...r.slice(i), ...t.work], t.draining = !1, t.work.length > 0 ? lt(e, t) : I.delete(e);
39
+ for (; i < r.length && (!n || n.didTimeout && i === 0 || n.timeRemaining() > 0);) if (t.diagnostics.guard("pipeline.crashed", "The library could not build a deferred record.", r[i]), i++, P.get(e) !== t) return;
40
+ t.work = [...r.slice(i), ...t.work], t.draining = !1, t.work.length > 0 ? ft(e, t) : P.delete(e);
40
41
  }
41
- function ut(e, t, n, r) {
42
- let i = I.get(e), a = r === null ? ye : Math.min(r, ye);
43
- if (i && i.work.length >= a && !i.draining && (L(e, i), i = I.get(e)), i) {
42
+ function pt(e, t, n, r) {
43
+ let i = P.get(e), a = r === null ? c : Math.min(r, c);
44
+ if (i && i.work.length >= a && !i.draining && (F(e, i), i = P.get(e)), i) {
44
45
  if (i.work.length >= a) {
45
46
  n.count("record.dropped_by_ceiling");
46
47
  return;
@@ -50,29 +51,29 @@ function ut(e, t, n, r) {
50
51
  work: [t],
51
52
  diagnostics: n,
52
53
  draining: !1
53
- }, I.set(e, i), lt(e, i);
54
+ }, P.set(e, i), ft(e, i);
54
55
  }
55
- function R(e) {
56
- let t = I.get(e);
57
- t && L(e, t);
56
+ function I(e) {
57
+ let t = P.get(e);
58
+ t && F(e, t);
58
59
  }
59
- function dt(e) {
60
- let t = I.get(e);
60
+ function mt(e) {
61
+ let t = P.get(e);
61
62
  if (t) {
62
- ct(t), I.delete(e);
63
+ dt(t), P.delete(e);
63
64
  for (let e of t.work) t.diagnostics.count("record.dropped_by_ceiling");
64
65
  t.work = [];
65
66
  }
66
67
  }
67
68
  // src/core/logger.ts
68
- var ft = [
69
+ var ht = [
69
70
  h,
70
- o,
71
- c
71
+ l,
72
+ ae
72
73
  ];
73
- function pt(e, t) {
74
+ function gt(e, t) {
74
75
  let n = t.guard("record.sanitize_failed", "The library could not read the error reason.", () => {
75
- if (!(e instanceof Error) && !Le(e)) return;
76
+ if (!(e instanceof Error) && !ze(e)) return;
76
77
  let t = Error(e.message);
77
78
  return t.name = e.name, t.stack = e.stack, t;
78
79
  });
@@ -80,50 +81,50 @@ function pt(e, t) {
80
81
  let r = t.guard("record.sanitize_failed", "The library could not convert the error reason to text.", () => String(e));
81
82
  return Error(r ?? typeof e);
82
83
  }
83
- function mt(e, t, n) {
84
+ function _t(e, t, n) {
84
85
  return n.guard("record.sanitize_failed", "The library could not read the error reason.", () => e instanceof Error ? e : t) ?? t;
85
86
  }
86
- function ht(e, t) {
87
+ function vt(e, t) {
87
88
  if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e == "symbol") return e;
88
89
  if (typeof e == "object" && e) return t.guard("record.sanitize_failed", "The library could not read the properties of the error reason.", () => {
89
- let t = e, n = Le(e), r = {}, i = 0;
90
+ let t = e, n = ze(e), r = {}, i = 0;
90
91
  for (let e of Object.keys(t)) {
91
92
  let a = t[e];
92
- n && Re.has(e) || !Ie(a) || (r[e] = a, i++);
93
+ n && Be.has(e) || !Re(a) || (r[e] = a, i++);
93
94
  }
94
95
  return i === 0 ? void 0 : r;
95
96
  });
96
97
  }
97
- function gt(e) {
98
- if (!D(e) || e instanceof Error) return !1;
98
+ function yt(e) {
99
+ if (!T(e) || e instanceof Error) return !1;
99
100
  let t = Object.getPrototypeOf(e);
100
101
  return t === null || Object.getPrototypeOf(t) === null;
101
102
  }
102
- function _t(e) {
103
- return ft.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
103
+ function bt(e) {
104
+ return ht.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
104
105
  }
105
- function z(e, t) {
106
+ function L(e, t) {
106
107
  return e === void 0 ? {} : t.guard("record.sanitize_failed", "The library could not read the payload.", () => ({ ...e })) ?? { "uiobs.sanitize_failed": !0 };
107
108
  }
108
- var B = class e {
109
+ var R = class e {
109
110
  constructor(e, t, n = {}) {
110
- k(this, "bind", void 0), k(this, "namespace", void 0), k(this, "options", void 0), k(this, "levelType", void 0), k(this, "trace", (e, t) => {
111
+ D(this, "bind", void 0), D(this, "namespace", void 0), D(this, "options", void 0), D(this, "levelType", void 0), D(this, "trace", (e, t) => {
111
112
  this.write("TRACE", this.levelType, e, t);
112
- }), k(this, "debug", (e, t) => {
113
+ }), D(this, "debug", (e, t) => {
113
114
  this.write("DEBUG", this.levelType, e, t);
114
- }), k(this, "info", (e, t) => {
115
+ }), D(this, "info", (e, t) => {
115
116
  this.write("INFO", this.levelType, e, t);
116
- }), k(this, "warn", (e, t) => {
117
+ }), D(this, "warn", (e, t) => {
117
118
  this.write("WARN", this.levelType, e, t);
118
- }), k(this, "error", (e, t, n) => {
119
+ }), D(this, "error", (e, t, n) => {
119
120
  this.writeError("ERROR", e, t, n);
120
- }), k(this, "fatal", (e, t, n) => {
121
+ }), D(this, "fatal", (e, t, n) => {
121
122
  this.writeError("FATAL", e, t, n);
122
- }), k(this, "logAction", (e, t) => {
123
+ }), D(this, "logAction", (e, t) => {
123
124
  this.write("INFO", "action", e, t);
124
- }), k(this, "logEvent", (e, t) => {
125
+ }), D(this, "logEvent", (e, t) => {
125
126
  this.write("INFO", "event", e, t);
126
- }), this.bind = e, this.namespace = t, this.options = n, this.levelType = _t(t);
127
+ }), this.bind = e, this.namespace = t, this.options = n, this.levelType = bt(t);
127
128
  }
128
129
  child(t, n = {}) {
129
130
  return new e(this.bind, `${this.namespace}.${t}`, { scopedContext: {
@@ -143,13 +144,13 @@ var B = class e {
143
144
  else if (e.config.payloadMode === "defer" && e.config.enabled && !e.config.debugBuffer.enabled && this.namespace !== "uiobs.diagnostics") {
144
145
  if (!e.builder.isEnabled(t, this.namespace, n) && !this.mirrors(e, t)) return;
145
146
  let i = e.journey.current(), a = {
146
- timeUnixNano: Pe(),
147
+ timeUnixNano: Ie(),
147
148
  trace: e.tracing.resolve(),
148
149
  journey: i ? { ...i } : null,
149
150
  context: e.context.getAll(),
150
- url: He(e.diagnostics)
151
+ url: We(e.diagnostics)
151
152
  };
152
- ut(e, () => {
153
+ pt(e, () => {
153
154
  r(a);
154
155
  }, e.diagnostics, e.config.buffering.maxPendingRecords);
155
156
  } else r();
@@ -167,7 +168,7 @@ var B = class e {
167
168
  body: r,
168
169
  namespace: this.namespace,
169
170
  scoped: this.options.scopedContext,
170
- payload: a ? i : z(i, e.diagnostics)
171
+ payload: a ? i : L(i, e.diagnostics)
171
172
  }, { record: c, dropped: l } = e.builder.build(s), u = !!e.config.redact || e.config.processors.length > 0, d = n !== "metric" && e.config.captureLimits.breadcrumbs > 0, f = l === "sampling" && u && d ? e.builder.build(s, !0) : void 0, p = c ?? f?.record ?? null, m = p ? p.body : l === "sampling" && !u ? r : void 0;
172
173
  d && m !== void 0 && e.breadcrumbs.push({
173
174
  t: o ? Number(o.timeUnixNano.slice(0, -6)) : Date.now(),
@@ -184,12 +185,12 @@ var B = class e {
184
185
  writeErrorNow(e, t, n, r, i, a) {
185
186
  let o = e.builder.isEnabled(t, this.namespace);
186
187
  if (!o && !this.mirrors(e, t)) return;
187
- let s = i === void 0 && (e.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () => gt(r)) ?? !1), c = s ? r : i, l = s ? void 0 : r, u = l === void 0 ? void 0 : pt(l, e.diagnostics), d = u === void 0 ? void 0 : mt(l, u, e.diagnostics);
188
+ let s = i === void 0 && (e.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () => yt(r)) ?? !1), c = s ? r : i, l = s ? void 0 : r, u = l === void 0 ? void 0 : gt(l, e.diagnostics), d = u === void 0 ? void 0 : _t(l, u, e.diagnostics);
188
189
  if (!o) {
189
190
  this.print(e, t, n, c, d, null, void 0, a);
190
191
  return;
191
192
  }
192
- let f = u ? ht(l, e.diagnostics) : void 0, { record: p, dropped: m } = e.builder.build({
193
+ let f = u ? vt(l, e.diagnostics) : void 0, { record: p, dropped: m } = e.builder.build({
193
194
  snapshot: a,
194
195
  level: t,
195
196
  type: this.levelType,
@@ -197,13 +198,13 @@ var B = class e {
197
198
  namespace: this.namespace,
198
199
  scoped: this.options.scopedContext,
199
200
  payload: {
200
- ...z(c, e.diagnostics),
201
+ ...L(c, e.diagnostics),
201
202
  ...u ? {
202
203
  "error.type": u.name,
203
204
  "error.message": u.message,
204
205
  "error.stack_trace": u.stack
205
206
  } : {},
206
- ...f === void 0 ? {} : { [se]: f },
207
+ ...f === void 0 ? {} : { [ue]: f },
207
208
  [y]: e.breadcrumbs.snapshot()
208
209
  }
209
210
  });
@@ -227,7 +228,7 @@ var B = class e {
227
228
  namespace: this.namespace,
228
229
  scoped: this.options.scopedContext,
229
230
  payload: {
230
- ...z(r, e.diagnostics),
231
+ ...L(r, e.diagnostics),
231
232
  ...i ? {
232
233
  "error.type": i.name,
233
234
  "error.message": i.message,
@@ -240,61 +241,61 @@ var B = class e {
240
241
  mirrors(e, t) {
241
242
  return e.config.enabled && e.console.accepts(t);
242
243
  }
243
- }, vt = class extends B {
244
+ }, xt = class extends R {
244
245
  constructor(...e) {
245
- super(...e), k(this, "logMetric", (e, t, n = a, r = "gauge", i, o) => {
246
+ super(...e), D(this, "logMetric", (e, t, r = u, i = "gauge", a, o) => {
246
247
  if (!Number.isFinite(t)) {
247
248
  this.bind().diagnostics.report("record.dropped_malformed", "The metric value is not a finite number. The library dropped the metric.", { "metric.name": e });
248
249
  return;
249
250
  }
250
251
  let s = this.bind();
251
- this.submit(s, "INFO", "metric", (a) => {
252
- let c = z(i, s.diagnostics), l = {
253
- ...z(o, s.diagnostics),
254
- ...c,
252
+ this.submit(s, "INFO", "metric", (c) => {
253
+ let l = L(a, s.diagnostics), u = {
254
+ ...L(o, s.diagnostics),
255
+ ...l,
255
256
  "metric.name": e,
256
257
  "metric.value": t,
257
- "metric.unit": n,
258
- "metric.type": r,
259
- [E.attributeKeys]: Object.keys(c)
258
+ "metric.unit": r,
259
+ "metric.type": i,
260
+ [n.attributeKeys]: Object.keys(l)
260
261
  };
261
- this.writeNow(s, "INFO", "metric", e, l, !0, a);
262
+ this.writeNow(s, "INFO", "metric", e, u, !0, c);
262
263
  });
263
264
  });
264
265
  }
265
- }, yt = /^[0-9a-f]{32}$/, bt = /^[0-9a-f]{16}$/, xt = /[1-9a-f]/;
266
- function St(e) {
267
- return yt.test(e.traceId) && xt.test(e.traceId) && bt.test(e.spanId) && xt.test(e.spanId);
266
+ }, St = /^[0-9a-f]{32}$/, Ct = /^[0-9a-f]{16}$/, wt = /[1-9a-f]/;
267
+ function Tt(e) {
268
+ return St.test(e.traceId) && wt.test(e.traceId) && Ct.test(e.spanId) && wt.test(e.spanId);
268
269
  }
269
- function Ct() {
270
- return Ge(16);
270
+ function Et() {
271
+ return qe(16);
271
272
  }
272
- function wt() {
273
- return Ge(8);
273
+ function Dt() {
274
+ return qe(8);
274
275
  }
275
- function Tt(e) {
276
+ function Ot(e) {
276
277
  return {
277
- traceId: Ct(),
278
- spanId: wt(),
278
+ traceId: Et(),
279
+ spanId: Dt(),
279
280
  traceFlags: 1,
280
281
  startedAt: Date.now(),
281
282
  reason: e,
282
283
  ended: !1
283
284
  };
284
285
  }
285
- function Et(e, t, n) {
286
+ function kt(e, t, n) {
286
287
  return `00-${e}-${t}-${(n & 255).toString(16).padStart(2, "0")}`;
287
288
  }
288
- function Dt(e) {
289
+ function At(e) {
289
290
  return {
290
291
  traceId: e.traceId,
291
292
  spanId: e.spanId,
292
293
  traceFlags: e.traceFlags
293
294
  };
294
295
  }
295
- var Ot = class {
296
- constructor(e, t = me, n, r) {
297
- k(this, "diagnostics", void 0), k(this, "maxAgeMs", void 0), k(this, "load", void 0), k(this, "spans", void 0), k(this, "ambient", Tt("start")), k(this, "otel", void 0), this.diagnostics = e, this.maxAgeMs = t, this.load = n, this.spans = r;
296
+ var jt = class {
297
+ constructor(e, t = ce, n, r) {
298
+ D(this, "diagnostics", void 0), D(this, "maxAgeMs", void 0), D(this, "load", void 0), D(this, "spans", void 0), D(this, "ambient", Ot("start")), D(this, "otel", void 0), this.diagnostics = e, this.maxAgeMs = t, this.load = n, this.spans = r;
298
299
  }
299
300
  setup(e, t) {
300
301
  this.maxAgeMs = e, this.load = t;
@@ -310,7 +311,7 @@ var Ot = class {
310
311
  return this.activeSpanContext() ?? this.ambientContext();
311
312
  }
312
313
  ambientContext() {
313
- return Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"), Dt(this.ambient);
314
+ return Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"), At(this.ambient);
314
315
  }
315
316
  activeSpanContext() {
316
317
  let e = this.otel;
@@ -318,7 +319,7 @@ var Ot = class {
318
319
  let t = e.trace.getActiveSpan();
319
320
  if (t === void 0) return;
320
321
  let n = t.spanContext();
321
- if (St(n)) return {
322
+ if (Tt(n)) return {
322
323
  traceId: n.traceId,
323
324
  spanId: n.spanId,
324
325
  traceFlags: n.traceFlags
@@ -327,8 +328,8 @@ var Ot = class {
327
328
  }
328
329
  rotate(e) {
329
330
  let t = this.ambient;
330
- this.ambient = Tt(e);
331
- let n = Dt(this.ambient);
331
+ this.ambient = Ot(e);
332
+ let n = At(this.ambient);
332
333
  return this.finish(t), n;
333
334
  }
334
335
  end() {
@@ -355,9 +356,9 @@ var Ot = class {
355
356
  n.propagation.inject(n.context.active(), t);
356
357
  }), t.traceparent) return { headers: t };
357
358
  let r = this.activeSpanContext(), i = r ?? this.ambientContext(), a = r ? void 0 : this.spans;
358
- if (!a?.enabled()) return t[Te] = Et(i.traceId, i.spanId, i.traceFlags), { headers: t };
359
- let o = a.keeps(i.traceId), s = o ? i.traceFlags : i.traceFlags & -2, c = e ? wt() : i.spanId;
360
- return t[Te] = Et(i.traceId, c, s), !e || !o ? { headers: t } : {
359
+ if (!a?.enabled()) return t[de] = kt(i.traceId, i.spanId, i.traceFlags), { headers: t };
360
+ let o = a.keeps(i.traceId), s = o ? i.traceFlags : i.traceFlags & -2, c = e ? Dt() : i.spanId;
361
+ return t[de] = kt(i.traceId, c, s), !e || !o ? { headers: t } : {
361
362
  headers: t,
362
363
  span: {
363
364
  traceId: i.traceId,
@@ -366,20 +367,20 @@ var Ot = class {
366
367
  }
367
368
  };
368
369
  }
369
- }, kt = {
370
+ }, Mt = {
370
371
  name: "ui.measure.duration",
371
372
  kind: "histogram",
372
373
  unit: "ms",
373
- boundaries: u
374
- }, At = {
374
+ boundaries: g
375
+ }, Nt = {
375
376
  name: "ui.measure.phase.duration",
376
377
  kind: "histogram",
377
378
  unit: "ms",
378
- boundaries: u
379
+ boundaries: g
379
380
  };
380
- function jt(e, t, n, r) {
381
+ function Pt(e, t, n, r) {
381
382
  let i = String(e), a = Date.now(), o = performance.now(), s, c = !1, l = (e) => a + e - o, u = (e, a) => {
382
- s &&= (r.metric(At, e - s.at, {
383
+ s &&= (r.metric(Nt, e - s.at, {
383
384
  ...t,
384
385
  "measure.name": i,
385
386
  "measure.phase": s.name
@@ -387,7 +388,7 @@ function jt(e, t, n, r) {
387
388
  name: s.name,
388
389
  kind: "internal",
389
390
  traceId: n.traceId,
390
- spanId: wt(),
391
+ spanId: Dt(),
391
392
  parentSpanId: n.spanId,
392
393
  startMs: l(s.at),
393
394
  endMs: l(e),
@@ -413,7 +414,7 @@ function jt(e, t, n, r) {
413
414
  ...t,
414
415
  "measure.outcome": e
415
416
  };
416
- r.metric(kt, s - o, {
417
+ r.metric(Mt, s - o, {
417
418
  ...f,
418
419
  "measure.name": i
419
420
  }), n && r.span({
@@ -428,7 +429,7 @@ function jt(e, t, n, r) {
428
429
  }
429
430
  };
430
431
  }
431
- function Mt(e, t, n) {
432
+ function Ft(e, t, n) {
432
433
  let r = "error";
433
434
  try {
434
435
  let i = t(), a = n.guard("record.sanitize_failed", "The library could not read what the function of the measure returned. The measure ends now.", () => i?.then);
@@ -442,51 +443,51 @@ function Mt(e, t, n) {
442
443
  }
443
444
  }
444
445
  // src/core/meter.ts
445
- var Nt = "overflow", Pt = /* @__PURE__ */ new Set([
446
+ var It = "overflow", Lt = /* @__PURE__ */ new Set([
447
+ x,
446
448
  S,
447
- C,
448
449
  v,
449
- T,
450
- x,
451
- ve,
452
- fe
450
+ w,
451
+ b,
452
+ Ce,
453
+ ve
453
454
  ]);
454
- function Ft(e = {}) {
455
+ function Rt(e = {}) {
455
456
  let t = {};
456
457
  for (let n of Object.keys(e).sort()) {
457
- if (n.startsWith("metric.") || Pt.has(n)) continue;
458
+ if (n.startsWith("metric.") || Lt.has(n)) continue;
458
459
  let r = e[n];
459
460
  (typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) && (t[n] = r);
460
461
  }
461
462
  return t;
462
463
  }
463
- function It(e, t) {
464
+ function zt(e, t) {
464
465
  if (!Array.isArray(e)) return null;
465
466
  let n = t === null ? e.length : Math.min(e.length, t + 1);
466
467
  return Array.from({ length: n }, (t, n) => e[n]);
467
468
  }
468
- function Lt(e, t) {
469
+ function Bt(e, t) {
469
470
  return Array.isArray(e) && (t === null || e.length <= t) && e.every((t, n) => typeof t == "number" && Number.isFinite(t) && (n === 0 || t > e[n - 1]));
470
471
  }
471
- function Rt(e, t, n) {
472
- let r = {
472
+ function Vt(e, t, r) {
473
+ let i = {
473
474
  "metric.name": e.name,
474
475
  "metric.unit": e.unit,
475
476
  "metric.type": e.kind,
476
- [E.start]: n,
477
- [E.attributeKeys]: Object.keys(t.attributes)
477
+ [n.start]: r,
478
+ [n.attributeKeys]: Object.keys(t.attributes)
478
479
  };
479
480
  return e.kind === "histogram" ? {
480
- ...r,
481
- [E.count]: t.count,
482
- [E.sum]: t.sum,
483
- [E.min]: t.min,
484
- [E.max]: t.max,
485
- [E.bounds]: e.boundaries,
486
- [E.buckets]: t.buckets
487
- } : (r["metric.value"] = e.kind === "gauge" ? t.last : t.sum, r);
488
- }
489
- function zt(e, t) {
481
+ ...i,
482
+ [n.count]: t.count,
483
+ [n.sum]: t.sum,
484
+ [n.min]: t.min,
485
+ [n.max]: t.max,
486
+ [n.bounds]: e.boundaries,
487
+ [n.buckets]: t.buckets
488
+ } : (i["metric.value"] = e.kind === "gauge" ? t.last : t.sum, i);
489
+ }
490
+ function Ht(e, t) {
490
491
  try {
491
492
  return {
492
493
  unit: e.unit,
@@ -499,69 +500,69 @@ function zt(e, t) {
499
500
  };
500
501
  }
501
502
  }
502
- function Bt(e, t, n, r) {
503
+ function Ut(e, t, n, r) {
503
504
  return {
504
505
  name: e,
505
506
  kind: t,
506
- unit: zt(n, r).unit ?? "count",
507
+ unit: Ht(n, r).unit ?? "count",
507
508
  boundaries: []
508
509
  };
509
510
  }
510
- function Vt(e, t, n, r) {
511
- let i = Bt(e, "counter", t, r);
511
+ function Wt(e, t, n, r) {
512
+ let i = Ut(e, "counter", t, r);
512
513
  return { add: (e, t) => {
513
514
  n(i, e, t);
514
515
  } };
515
516
  }
516
- function Ht(e, t, n, r) {
517
- let i = Bt(e, "gauge", t, r);
517
+ function Gt(e, t, n, r) {
518
+ let i = Ut(e, "gauge", t, r);
518
519
  return { set: (e, t) => {
519
520
  n(i, e, t);
520
521
  } };
521
522
  }
522
- function Ut(e, t, n, r) {
523
- let { unit: i, boundaries: a } = zt(t, r), o = {
523
+ function Kt(e, t, n, r) {
524
+ let { unit: i, boundaries: a } = Ht(t, r), o = {
524
525
  name: e,
525
526
  kind: "histogram",
526
527
  unit: i ?? "count",
527
- boundaries: a ?? u,
528
+ boundaries: a ?? g,
528
529
  fromApp: a !== void 0
529
530
  };
530
531
  return { record: (e, t) => {
531
532
  n(o, e, t);
532
533
  } };
533
534
  }
534
- var Wt = class {
535
+ var qt = class {
535
536
  constructor(e, t, n, r = {
536
537
  maxSeries: 100,
537
538
  maxInstruments: 1e3,
538
539
  maxHistogramBoundaries: 50
539
540
  }) {
540
- k(this, "intervalMs", void 0), k(this, "emit", void 0), k(this, "diagnostics", void 0), k(this, "policy", void 0), k(this, "instruments", /* @__PURE__ */ new Map()), k(this, "timer", null), k(this, "startedAt", 0), this.intervalMs = e, this.emit = t, this.diagnostics = n, this.policy = r;
541
+ D(this, "intervalMs", void 0), D(this, "emit", void 0), D(this, "diagnostics", void 0), D(this, "policy", void 0), D(this, "instruments", /* @__PURE__ */ new Map()), D(this, "timer", null), D(this, "startedAt", 0), this.intervalMs = e, this.emit = t, this.diagnostics = n, this.policy = r;
541
542
  }
542
543
  record(e, t, n) {
543
544
  !Number.isFinite(t) || e.kind === "counter" && t < 0 ? this.diagnostics.report("record.dropped_malformed", `The value of the metric ${e.name} is not valid. The library dropped it.`, { "metric.name": e.name }) : this.diagnostics.guard("record.sanitize_failed", `The library could not read the attributes of the metric ${e.name}.`, () => {
544
545
  let r = this.instrumentOf(e);
545
- r && (this.add(r, t, Ft(n)), this.arm());
546
+ r && (this.add(r, t, Rt(n)), this.arm());
546
547
  });
547
548
  }
548
549
  collect() {
549
550
  this.timer !== null && (clearTimeout(this.timer), this.timer = null);
550
551
  let e = `${String(this.startedAt)}000000`, t = [...this.instruments.values()];
551
552
  this.instruments.clear();
552
- for (let { def: n, series: r } of t) for (let t of r.values()) this.emit(n.name, t.attributes, Rt(n, t, e));
553
+ for (let { def: n, series: r } of t) for (let t of r.values()) this.emit(n.name, t.attributes, Vt(n, t, e));
553
554
  }
554
555
  instrumentOf(e) {
555
556
  let t = this.instruments.get(e.name);
556
557
  if (t) return t.def.kind === e.kind ? t : (this.diagnostics.report("record.dropped_malformed", `The metric ${e.name} is a ${t.def.kind} and a ${e.kind}. The library dropped the value.`, { "metric.name": e.name }), null);
557
558
  let { maxInstruments: n } = this.policy;
558
559
  if (n !== null && this.instruments.size >= n) return this.diagnostics.count("record.dropped_by_ceiling"), null;
559
- let r = e.fromApp === !0 ? this.policy.maxHistogramBoundaries : null, i = It(e.boundaries, r), a = Lt(i, r);
560
+ let r = e.fromApp === !0 ? this.policy.maxHistogramBoundaries : null, i = zt(e.boundaries, r), a = Bt(i, r);
560
561
  e.kind === "histogram" && !a && this.diagnostics.report("config.invalid", `The boundaries of the metric ${e.name} must meet metrics.maxHistogramBoundaries and contain finite numbers in ascending order. The library uses the default boundaries.`);
561
562
  let o = {
562
563
  def: {
563
564
  ...e,
564
- boundaries: a ? i : [...u]
565
+ boundaries: a ? i : [...g]
565
566
  },
566
567
  series: /* @__PURE__ */ new Map()
567
568
  };
@@ -569,7 +570,7 @@ var Wt = class {
569
570
  }
570
571
  add(e, t, n) {
571
572
  let r = JSON.stringify(n), i = e.series.get(r), a = n, { maxSeries: o } = this.policy;
572
- if (!i && o !== null && e.series.size >= o && (r = Nt, i = e.series.get(r), a = { [re]: !0 }), !i) {
573
+ if (!i && o !== null && e.series.size >= o && (r = It, i = e.series.get(r), a = { [oe]: !0 }), !i) {
573
574
  let n = e.def.kind === "histogram" ? e.def.boundaries.length + 1 : 0, o = Array(n).fill(0);
574
575
  i = {
575
576
  attributes: a,
@@ -589,45 +590,45 @@ var Wt = class {
589
590
  arm() {
590
591
  this.timer === null && (this.startedAt = Date.now(), this.timer = setTimeout(() => {
591
592
  this.collect();
592
- }, this.intervalMs()), O(this.timer));
593
+ }, this.intervalMs()), E(this.timer));
593
594
  }
594
- }, Gt = {
595
+ }, Jt = {
595
596
  TRACE: "debug",
596
597
  DEBUG: "debug",
597
598
  INFO: "info",
598
599
  WARN: "warn",
599
600
  ERROR: "error",
600
601
  FATAL: "error"
601
- }, Kt = class {
602
+ }, Yt = class {
602
603
  constructor(e, t, n = ge) {
603
- k(this, "settings", void 0), k(this, "diagnostics", void 0), k(this, "limits", void 0), this.settings = e, this.diagnostics = t, this.limits = n;
604
+ D(this, "settings", void 0), D(this, "diagnostics", void 0), D(this, "limits", void 0), this.settings = e, this.diagnostics = t, this.limits = n;
604
605
  }
605
606
  update(e) {
606
607
  this.settings = e;
607
608
  }
608
609
  accepts(e) {
609
- return this.settings.level === null || !ze(w, this.settings.level) ? !1 : w[e] >= w[this.settings.level];
610
+ return this.settings.level === null || !Ve(t, this.settings.level) ? !1 : t[e] >= t[this.settings.level];
610
611
  }
611
612
  write(e, t, n, r, i) {
612
- if (!this.accepts(t) || typeof console > "u" || Ye()) return;
613
- let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = Gt[t];
613
+ if (!this.accepts(t) || typeof console > "u" || Ze()) return;
614
+ let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = Jt[t];
614
615
  this.diagnostics.guard("handler.threw", `The library could not print to console.${s}.`, () => {
615
616
  let c = [];
616
- i !== void 0 && c.push(i), r !== void 0 && c.push(Ze(r, this.limits, this.diagnostics)), M(() => {
617
+ i !== void 0 && c.push(i), r !== void 0 && c.push($e(r, this.limits, this.diagnostics)), A(() => {
617
618
  console[s](a, o.namespace, e, o[t], "", n, ...c);
618
619
  });
619
620
  });
620
621
  }
621
- }, qt = class {
622
+ }, Xt = class {
622
623
  constructor() {
623
- k(this, "value", 0);
624
+ D(this, "value", 0);
624
625
  }
625
626
  next() {
626
627
  return ++this.value;
627
628
  }
628
- }, Jt = class {
629
+ }, Zt = class {
629
630
  constructor(e) {
630
- k(this, "buffer", void 0), k(this, "pointer", 0), k(this, "filled", !1), k(this, "capacity", void 0), this.capacity = e === 0 ? 0 : Math.max(e, 1), this.buffer = Array(this.capacity);
631
+ D(this, "buffer", void 0), D(this, "pointer", 0), D(this, "filled", !1), D(this, "capacity", void 0), this.capacity = e === 0 ? 0 : Math.max(e, 1), this.buffer = Array(this.capacity);
631
632
  }
632
633
  resize(e) {
633
634
  let t = this.snapshot().slice(-e);
@@ -647,9 +648,9 @@ var Wt = class {
647
648
  snapshot() {
648
649
  return (this.filled ? [...this.buffer.slice(this.pointer), ...this.buffer.slice(0, this.pointer)] : this.buffer.slice(0, this.pointer)).filter((e) => e !== void 0);
649
650
  }
650
- }, Yt = class {
651
+ }, Qt = class {
651
652
  constructor() {
652
- k(this, "map", /* @__PURE__ */ new Map());
653
+ D(this, "map", /* @__PURE__ */ new Map());
653
654
  }
654
655
  merge(e) {
655
656
  for (let [t, n] of Object.entries(e)) n === null ? this.map.delete(t) : n !== void 0 && this.map.set(t, n);
@@ -663,9 +664,9 @@ var Wt = class {
663
664
  getAll() {
664
665
  return Object.fromEntries(this.map);
665
666
  }
666
- }, Xt = class {
667
+ }, $t = class {
667
668
  constructor(e) {
668
- k(this, "policy", void 0), k(this, "kept", []), this.policy = e;
669
+ D(this, "policy", void 0), D(this, "kept", []), this.policy = e;
669
670
  }
670
671
  push(e) {
671
672
  let { enabled: t, maxRecords: n } = this.policy();
@@ -680,7 +681,7 @@ var Wt = class {
680
681
  ...e,
681
682
  attributes: {
682
683
  ...e.attributes,
683
- [Ee]: !0
684
+ [De]: !0
684
685
  }
685
686
  }));
686
687
  }
@@ -696,9 +697,9 @@ var Wt = class {
696
697
  clear() {
697
698
  this.kept = [];
698
699
  }
699
- }, V = class {
700
- constructor(e, t = ne, n = !1) {
701
- k(this, "handler", void 0), k(this, "throttleMs", void 0), k(this, "consoleFallback", void 0), k(this, "counters", /* @__PURE__ */ new Map()), k(this, "lastEmitted", /* @__PURE__ */ new Map()), this.handler = e, this.throttleMs = t, this.consoleFallback = n;
700
+ }, z = class {
701
+ constructor(e, t = ie, n = !1) {
702
+ D(this, "handler", void 0), D(this, "throttleMs", void 0), D(this, "consoleFallback", void 0), D(this, "counters", /* @__PURE__ */ new Map()), D(this, "lastEmitted", /* @__PURE__ */ new Map()), this.handler = e, this.throttleMs = t, this.consoleFallback = n;
702
703
  }
703
704
  setPolicy(e, t) {
704
705
  this.throttleMs = e, this.consoleFallback = t;
@@ -724,12 +725,12 @@ var Wt = class {
724
725
  }, { handler: s } = this;
725
726
  if (!s) return !0;
726
727
  try {
727
- M(() => {
728
+ A(() => {
728
729
  s(o);
729
730
  });
730
731
  } catch {
731
- this.count("handler.threw"), this.consoleFallback && typeof console < "u" && M(() => {
732
- console.warn(`${de} The onDiagnostic handler threw an error.`);
732
+ this.count("handler.threw"), this.consoleFallback && typeof console < "u" && A(() => {
733
+ console.warn(`${f} The onDiagnostic handler threw an error.`);
733
734
  });
734
735
  }
735
736
  return !0;
@@ -755,12 +756,12 @@ var Wt = class {
755
756
  }
756
757
  };
757
758
  // src/core/drops.ts
758
- function Zt(e, t) {
759
+ function en(e, t) {
759
760
  e.length < 20 && !e.includes(t) && e.push(t);
760
761
  }
761
- var Qt = class {
762
+ var tn = class {
762
763
  constructor(e, t) {
763
- k(this, "config", void 0), k(this, "diagnostics", void 0), k(this, "pending", /* @__PURE__ */ new Map()), k(this, "scheduled", !1), k(this, "reporting", !1), k(this, "lost", {}), this.config = e, this.diagnostics = t;
764
+ D(this, "config", void 0), D(this, "diagnostics", void 0), D(this, "pending", /* @__PURE__ */ new Map()), D(this, "scheduled", !1), D(this, "reporting", !1), D(this, "lost", {}), this.config = e, this.diagnostics = t;
764
765
  }
765
766
  add(e, t, n = [], r = t.length) {
766
767
  if (r > 0 && (this.lost[e] = (this.lost[e] ?? 0) + r), !this.config.onDrop || this.reporting || t.length === 0 && n.length === 0) return;
@@ -772,12 +773,12 @@ var Qt = class {
772
773
  journeyIds: [],
773
774
  actions: []
774
775
  }, this.pending.set(e, i)), i.records += r;
775
- for (let e of n) Zt(i.batchIds, e);
776
+ for (let e of n) en(i.batchIds, e);
776
777
  for (let e of t) {
777
- let t = tt(e, x);
778
- typeof t == "string" && Zt(i.journeyIds, t);
779
- let n = et(e) ? e.body : void 0;
780
- typeof n == "string" && Zt(i.actions, n);
778
+ let t = rt(e, b);
779
+ typeof t == "string" && en(i.journeyIds, t);
780
+ let n = nt(e) ? e.body : void 0;
781
+ typeof n == "string" && en(i.actions, n);
781
782
  }
782
783
  this.scheduled || (this.scheduled = !0, queueMicrotask(() => {
783
784
  this.flush();
@@ -794,8 +795,8 @@ var Qt = class {
794
795
  if (t) {
795
796
  this.reporting = !0;
796
797
  for (let n of e) this.diagnostics.guard("handler.threw", "The onDrop hook threw an error.", () => {
797
- Qe(() => {
798
- M(() => {
798
+ et(() => {
799
+ A(() => {
799
800
  t(n);
800
801
  });
801
802
  });
@@ -803,15 +804,15 @@ var Qt = class {
803
804
  this.reporting = !1;
804
805
  }
805
806
  }
806
- }, $t = class {
807
+ }, nn = class {
807
808
  constructor(e) {
808
- k(this, "onDrop", void 0), k(this, "actions", {
809
+ D(this, "onDrop", void 0), D(this, "actions", {
809
810
  head: [],
810
811
  tail: []
811
- }), k(this, "others", {
812
+ }), D(this, "others", {
812
813
  head: [],
813
814
  tail: []
814
- }), k(this, "arrivals", 0), this.onDrop = e;
815
+ }), D(this, "arrivals", 0), this.onDrop = e;
815
816
  }
816
817
  get records() {
817
818
  return this.inOrder();
@@ -821,7 +822,7 @@ var Qt = class {
821
822
  return e.head.length + e.tail.length + t.head.length + t.tail.length;
822
823
  }
823
824
  push(e, t) {
824
- let n = et(e), r = n ? this.actions : this.others, i = n ? ue : t, a = {
825
+ let n = nt(e), r = n ? this.actions : this.others, i = n ? pe : t, a = {
825
826
  record: e,
826
827
  arrival: this.arrivals
827
828
  };
@@ -850,11 +851,11 @@ var Qt = class {
850
851
  ...t.tail
851
852
  ].sort((e, t) => e.arrival - t.arrival).map((e) => e.record);
852
853
  }
853
- }, en = "error.", tn = [
854
- T,
855
- x,
856
- ve
857
- ], nn = {
854
+ }, rn = "error.", an = [
855
+ w,
856
+ b,
857
+ Ce
858
+ ], on = {
858
859
  processor: {
859
860
  label: "A processor",
860
861
  code: "record.dropped_by_processor",
@@ -865,47 +866,47 @@ var Qt = class {
865
866
  code: "record.dropped_by_redact",
866
867
  refused: "redact is not a function. The library drops each record until redact is a function or null."
867
868
  }
868
- }, H = (e) => typeof e == "number" && Number.isFinite(e), rn = (e) => Array.isArray(e) && e.every(H), U = (e) => typeof e == "string" && /^\d{1,20}$/.test(e), an = (e) => typeof e == "string" && /^[0-9a-f]{32}$/.test(e), on = (e) => typeof e == "string" && /^[0-9a-f]{16}$/.test(e), sn = (e) => e === "" || on(e), cn = (e) => e === "counter", ln = (e) => e === "histogram", un = (e) => e === "client" || e === "internal", dn = (e) => e === "error" || e === "unset", fn = {
869
- "metric.type": cn,
870
- "metric.value": H,
871
- [E.start]: U
872
- }, pn = {
873
- "metric.type": ln,
874
- [E.start]: U,
875
- [E.count]: H,
876
- [E.sum]: H,
877
- [E.min]: H,
878
- [E.max]: H,
879
- [E.bounds]: rn,
880
- [E.buckets]: rn
881
- }, mn = {
882
- [s.kind]: un,
883
- [s.parentId]: sn,
884
- [s.start]: U,
885
- [s.end]: U,
886
- [s.status]: dn
887
- }, hn = {
888
- [s.linkTraceId]: an,
889
- [s.linkSpanId]: on
869
+ }, B = (e) => typeof e == "number" && Number.isFinite(e), sn = (e) => Array.isArray(e) && e.every(B), V = (e) => typeof e == "string" && /^\d{1,20}$/.test(e), cn = (e) => typeof e == "string" && /^[0-9a-f]{32}$/.test(e), ln = (e) => typeof e == "string" && /^[0-9a-f]{16}$/.test(e), un = (e) => e === "" || ln(e), dn = (e) => e === "counter", fn = (e) => e === "histogram", pn = (e) => e === "client" || e === "internal", mn = (e) => e === "error" || e === "unset", hn = {
870
+ "metric.type": dn,
871
+ "metric.value": B,
872
+ [n.start]: V
873
+ }, gn = {
874
+ "metric.type": fn,
875
+ [n.start]: V,
876
+ [n.count]: B,
877
+ [n.sum]: B,
878
+ [n.min]: B,
879
+ [n.max]: B,
880
+ [n.bounds]: sn,
881
+ [n.buckets]: sn
882
+ }, _n = {
883
+ [o.kind]: pn,
884
+ [o.parentId]: un,
885
+ [o.start]: V,
886
+ [o.end]: V,
887
+ [o.status]: mn
888
+ }, vn = {
889
+ [o.linkTraceId]: cn,
890
+ [o.linkSpanId]: ln
890
891
  };
891
- function gn(e) {
892
- let t = e[S], n = e[v];
893
- return t === "span" && n === "uiobs.traces" ? [mn, hn] : t !== "metric" || n !== "uiobs.metrics" ? [] : e["metric.type"] === "histogram" ? [pn] : [fn];
892
+ function yn(e) {
893
+ let t = e[x], n = e[v];
894
+ return t === "span" && n === "uiobs.traces" ? [_n, vn] : t !== "metric" || n !== "uiobs.metrics" ? [] : e["metric.type"] === "histogram" ? [gn] : [hn];
894
895
  }
895
- function _n(e) {
896
+ function bn(e) {
896
897
  let t = {};
897
- for (let n of gn(e)) {
898
+ for (let n of yn(e)) {
898
899
  let r = Object.keys(n);
899
900
  if (r.every((t) => n[t](e[t]))) for (let n of r) t[n] = e[n];
900
901
  }
901
902
  return t;
902
903
  }
903
- function W(e) {
904
+ function H(e) {
904
905
  return e;
905
906
  }
906
- var vn = class {
907
+ var xn = class {
907
908
  constructor(e) {
908
- k(this, "deps", void 0), k(this, "resourceCache", null), this.deps = e;
909
+ D(this, "deps", void 0), D(this, "resourceCache", null), this.deps = e;
909
910
  }
910
911
  invalidateResource() {
911
912
  this.resourceCache = null;
@@ -913,11 +914,11 @@ var vn = class {
913
914
  isEnabled(e, t, n) {
914
915
  return this.deps.config.enabled && this.passesLevel(e, t, n);
915
916
  }
916
- passesLevel(e, t, n) {
917
- let { config: r } = this.deps;
918
- if (n !== void 0 && m.includes(n)) return !0;
919
- let i = this.deps.remote.sampling?.minLevelFor(t) ?? ot(t, r);
920
- return w[e] >= w[i];
917
+ passesLevel(e, n, r) {
918
+ let { config: i } = this.deps;
919
+ if (r !== void 0 && he.includes(r)) return !0;
920
+ let a = this.deps.remote.sampling?.minLevelFor(n) ?? ct(n, i);
921
+ return t[e] >= t[a];
921
922
  }
922
923
  keepForDebug(e) {
923
924
  let { config: t, debug: n } = this.deps;
@@ -931,7 +932,7 @@ var vn = class {
931
932
  record: null,
932
933
  dropped: "level"
933
934
  };
934
- let l = e.trace ?? e.snapshot?.trace ?? i.resolve(), u = e.snapshot ? e.snapshot.journey : a.current(), d = st({
935
+ let l = e.trace ?? e.snapshot?.trace ?? i.resolve(), u = e.snapshot ? e.snapshot.journey : a.current(), d = lt({
935
936
  level: e.level,
936
937
  type: e.type,
937
938
  namespace: e.namespace,
@@ -943,62 +944,62 @@ var vn = class {
943
944
  record: null,
944
945
  dropped: "sampling"
945
946
  };
946
- let f = o.next(), p = e.snapshot?.url ?? He(r), m = n.metadata.pageUrl ? Be(p, n.capture.fullUrls, n.capture.urlTransform, r) : "", h, g = 0;
947
+ let f = o.next(), p = e.snapshot?.url ?? We(r), m = n.metadata.pageUrl ? He(p, n.capture.fullUrls, n.capture.urlTransform, r) : "", h, g = 0;
947
948
  try {
948
- let t = N(e.snapshot?.context ?? this.deps.context.getAll(), s, r), n = N(this.provided(), s, r), i = N(e.scoped ?? {}, s, r), a = N(e.payload ?? {}, s, r);
949
+ let t = j(e.snapshot?.context ?? this.deps.context.getAll(), s, r), n = j(this.provided(), s, r), i = j(e.scoped ?? {}, s, r), a = j(e.payload ?? {}, s, r);
949
950
  g = t.bytes + n.bytes + i.bytes + a.bytes, h = {
950
- ...W(t.value),
951
- ...W(n.value),
952
- ...W(i.value),
953
- ...W(a.value)
951
+ ...H(t.value),
952
+ ...H(n.value),
953
+ ...H(i.value),
954
+ ...H(a.value)
954
955
  };
955
956
  } catch (e) {
956
- r.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), h = { [je]: !0 };
957
+ r.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), h = { [Ne]: !0 };
957
958
  }
958
- Object.assign(h, e.fixed), h[S] = e.type, h[C] = f, h[v] = e.namespace, h[T] = m, u && (h[x] = u.id, h[ve] = u.name, u.parentId !== void 0 && (h[fe] = u.parentId));
959
- let ee = Xe(e.body, s.maxBodyChars);
959
+ Object.assign(h, e.fixed), h[x] = e.type, h[S] = f, h[v] = e.namespace, h[w] = m, u && (h[b] = u.id, h[Ce] = u.name, u.parentId !== void 0 && (h[ve] = u.parentId));
960
+ let ee = Qe(e.body, s.maxBodyChars);
960
961
  ee !== e.body && r.count("record.truncated");
961
962
  let _ = {
962
- timeUnixNano: e.snapshot?.timeUnixNano ?? Pe(),
963
+ timeUnixNano: e.snapshot?.timeUnixNano ?? Ie(),
963
964
  traceId: l.traceId,
964
965
  spanId: l.spanId,
965
966
  traceFlags: l.traceFlags,
966
- severityNumber: te[e.level],
967
+ severityNumber: re[e.level],
967
968
  severityText: e.level,
968
969
  body: ee,
969
970
  attributes: h,
970
971
  resource: this.resource()
971
- }, ne = this.hookStages();
972
- if (ne.length > 0) {
973
- let t = this.applyHooks(_, ne, e.fixed);
972
+ }, te = this.hookStages();
973
+ if (te.length > 0) {
974
+ let t = this.applyHooks(_, te, e.fixed);
974
975
  if (typeof t == "string") return {
975
976
  record: null,
976
977
  dropped: t
977
978
  };
978
979
  ({record: _, bytes: g} = t);
979
980
  }
980
- let re = {
981
- [S]: e.type,
982
- [C]: f,
981
+ let ne = {
982
+ [x]: e.type,
983
+ [S]: f,
983
984
  [v]: e.namespace
984
985
  };
985
- return { record: this.fit(_, g, re, e.fixed) };
986
+ return { record: this.fit(_, g, ne, e.fixed) };
986
987
  }
987
988
  redactForwarded(e) {
988
989
  let { redact: t } = this.deps.config;
989
990
  if (!t) return e;
990
- let n = [[t, "redact"]], r = this.applyHooks(e, n, _n(e.attributes));
991
+ let n = [[t, "redact"]], r = this.applyHooks(e, n, bn(e.attributes));
991
992
  return typeof r == "string" ? null : r.record;
992
993
  }
993
994
  rehook(e) {
994
- let { config: t, diagnostics: n, limits: r, remote: i, debug: a } = this.deps, { attributes: o } = e, s = String(o[v]), c = this.passesLevel(e.severityText, s, o[S]), l = c && it(e, t, i.sampling?.current() ?? null), u = t.metadata.pageUrl ? Be(String(o[T]), t.capture.fullUrls, t.capture.urlTransform, n) : "", d = Xe(e.body, r.maxBodyChars);
995
+ let { config: t, diagnostics: n, limits: r, remote: i, debug: a } = this.deps, { attributes: o } = e, s = String(o[v]), c = this.passesLevel(e.severityText, s, o[x]), l = c && ot(e, t, i.sampling?.current() ?? null), u = t.metadata.pageUrl ? He(String(o[w]), t.capture.fullUrls, t.capture.urlTransform, n) : "", d = Qe(e.body, r.maxBodyChars);
995
996
  d !== e.body && n.count("record.truncated");
996
- let f = _n(o), p = {
997
+ let f = bn(o), p = {
997
998
  ...e,
998
999
  body: d,
999
1000
  attributes: {
1000
1001
  ...o,
1001
- [T]: u
1002
+ [w]: u
1002
1003
  },
1003
1004
  resource: this.resource()
1004
1005
  }, m = this.applyHooks(p, this.hookStages(), f), h = typeof m == "string" ? null : this.fit(m.record, m.bytes, o, f);
@@ -1012,19 +1013,19 @@ var vn = class {
1012
1013
  body: e.body
1013
1014
  });
1014
1015
  let o = {
1016
+ [x]: n[x],
1015
1017
  [S]: n[S],
1016
- [C]: n[C],
1017
1018
  [v]: n[v],
1018
- [Se]: !0,
1019
- [he]: t
1019
+ [Te]: !0,
1020
+ [be]: t
1020
1021
  };
1021
- for (let t of tn) t in e.attributes && (o[t] = e.attributes[t]);
1022
- for (let [t, n] of Object.entries(e.attributes)) t.startsWith(en) && (o[t] = n);
1023
- let s = N(o, a, i).bytes;
1024
- s > a.maxRecordBytes && "error.data" in o && (Reflect.deleteProperty(o, se), s = N(o, a, i).bytes);
1022
+ for (let t of an) t in e.attributes && (o[t] = e.attributes[t]);
1023
+ for (let [t, n] of Object.entries(e.attributes)) t.startsWith(rn) && (o[t] = n);
1024
+ let s = j(o, a, i).bytes;
1025
+ s > a.maxRecordBytes && "error.data" in o && (Reflect.deleteProperty(o, ue), s = j(o, a, i).bytes);
1025
1026
  let c = e.attributes[y];
1026
1027
  if (c !== void 0) {
1027
- let e = N(c, a, i).bytes;
1028
+ let e = j(c, a, i).bytes;
1028
1029
  s + e <= a.maxRecordBytes && (o[y] = c);
1029
1030
  }
1030
1031
  return Object.assign(o, r), e.attributes = o, e;
@@ -1040,7 +1041,7 @@ var vn = class {
1040
1041
  if (typeof t == "string") return t;
1041
1042
  r = t;
1042
1043
  }
1043
- let { diagnostics: i, limits: a } = this.deps, o = N(r.attributes, a, i), s = W(o.value);
1044
+ let { diagnostics: i, limits: a } = this.deps, o = j(r.attributes, a, i), s = H(o.value);
1044
1045
  return Object.assign(s, n), {
1045
1046
  record: {
1046
1047
  ...r,
@@ -1050,17 +1051,17 @@ var vn = class {
1050
1051
  };
1051
1052
  }
1052
1053
  runHook(e, t, n) {
1053
- let { diagnostics: r } = this.deps, { label: i, code: a, refused: o } = nn[t], s;
1054
+ let { diagnostics: r } = this.deps, { label: i, code: a, refused: o } = on[t], s;
1054
1055
  try {
1055
1056
  s = e(n);
1056
1057
  } catch (e) {
1057
1058
  return r.report(a, `${i} threw an error. The library dropped the record.`, void 0, e), t;
1058
1059
  }
1059
- if (s === null) return e === F ? r.report(a, o) : r.count(a), t;
1060
+ if (s === null) return e === N ? r.report(a, o) : r.count(a), t;
1060
1061
  let c = s ?? n;
1061
- return Ne(c) ? Fe(c.severityText) ? {
1062
+ return Fe(c) ? Le(c.severityText) ? {
1062
1063
  ...c,
1063
- severityNumber: te[c.severityText]
1064
+ severityNumber: re[c.severityText]
1064
1065
  } : (r.report("record.dropped_malformed", `${i} set a severityText that is not a log level. The library dropped the record.`), "malformed") : c === n ? (r.report("record.dropped_malformed", `${i} changed the record to a shape that is not a record. The library dropped it.`), "malformed") : (r.report(a, `${i} returned a value that is not a record. The library dropped the record.`), t);
1065
1066
  }
1066
1067
  provided() {
@@ -1068,7 +1069,7 @@ var vn = class {
1068
1069
  if (!e) return {};
1069
1070
  let { diagnostics: t } = this.deps, n = t.guard("handler.threw", "The contextProvider threw an error. The record has no attributes from it.", () => {
1070
1071
  let t = e();
1071
- return t === void 0 ? {} : D(t) && typeof t.then != "function" ? t : null;
1072
+ return t === void 0 ? {} : T(t) && typeof t.then != "function" ? t : null;
1072
1073
  });
1073
1074
  return n === null && t.report("config.invalid", "contextProvider must return an object of attributes. The library ignores the value."), n ?? {};
1074
1075
  }
@@ -1076,34 +1077,34 @@ var vn = class {
1076
1077
  if (this.resourceCache) return this.resourceCache;
1077
1078
  let { config: t, identity: n, platform: a } = this.deps;
1078
1079
  return this.resourceCache = {
1079
- [oe]: t.serviceName,
1080
- [ke]: t.serviceVersion,
1081
- [ce]: t.environment,
1082
- [i]: e,
1083
- [r]: b,
1084
- [_]: g,
1085
- [ie]: a.platform,
1086
- [ee]: n.sessionId,
1087
- [Oe]: n.tabId,
1088
- [le]: n.contextId,
1089
- ...t.metadata.userAgent ? { [pe]: a.userAgent } : {},
1090
- ...!t.metadata.openfin || a.openfinUuid === void 0 ? {} : { [Me]: a.openfinUuid },
1091
- ...!t.metadata.openfin || a.openfinName === void 0 ? {} : { [De]: a.openfinName }
1080
+ [r]: t.serviceName,
1081
+ [je]: t.serviceVersion,
1082
+ [Pe]: t.environment,
1083
+ [me]: ye,
1084
+ [e]: C,
1085
+ [m]: Ee,
1086
+ [le]: a.platform,
1087
+ [te]: n.sessionId,
1088
+ [i]: n.tabId,
1089
+ [Ae]: n.contextId,
1090
+ ...t.metadata.userAgent ? { [se]: a.userAgent } : {},
1091
+ ...!t.metadata.openfin || a.openfinUuid === void 0 ? {} : { [ee]: a.openfinUuid },
1092
+ ...!t.metadata.openfin || a.openfinName === void 0 ? {} : { [Me]: a.openfinName }
1092
1093
  }, this.resourceCache;
1093
1094
  }
1094
- }, yn = 1e3, bn = {
1095
+ }, Sn = 1e3, Cn = {
1095
1096
  start: "ui.start",
1096
1097
  interaction: "ui.interaction",
1097
1098
  navigation: "ui.navigation",
1098
1099
  explicit: "ui.trace",
1099
1100
  maxAge: "ui.trace"
1100
1101
  };
1101
- function xn(e) {
1102
- return `${String(Math.round(e * yn))}000`;
1102
+ function wn(e) {
1103
+ return `${String(Math.round(e * Sn))}000`;
1103
1104
  }
1104
- function Sn(e) {
1105
+ function Tn(e) {
1105
1106
  return {
1106
- name: bn[e.reason],
1107
+ name: Cn[e.reason],
1107
1108
  kind: "internal",
1108
1109
  traceId: e.traceId,
1109
1110
  spanId: e.spanId,
@@ -1114,72 +1115,72 @@ function Sn(e) {
1114
1115
  attributes: {}
1115
1116
  };
1116
1117
  }
1117
- function Cn(e) {
1118
+ function En(e) {
1118
1119
  return {
1119
- [s.kind]: e.kind,
1120
- [s.parentId]: e.parentSpanId,
1121
- [s.start]: xn(e.startMs),
1122
- [s.end]: xn(e.endMs),
1123
- [s.status]: e.error ? "error" : "unset",
1120
+ [o.kind]: e.kind,
1121
+ [o.parentId]: e.parentSpanId,
1122
+ [o.start]: wn(e.startMs),
1123
+ [o.end]: wn(e.endMs),
1124
+ [o.status]: e.error ? "error" : "unset",
1124
1125
  ...e.link ? {
1125
- [s.linkTraceId]: e.link.traceId,
1126
- [s.linkSpanId]: e.link.spanId
1126
+ [o.linkTraceId]: e.link.traceId,
1127
+ [o.linkSpanId]: e.link.spanId
1127
1128
  } : {}
1128
1129
  };
1129
1130
  }
1130
1131
  // src/core/runtime.ts
1131
- var wn = {
1132
- errors: async () => (await import("./errors-BE_EZV7Q.js")).ErrorCapture,
1133
- network: async () => (await import("./network-on2zZT6H.js")).NetworkCapture,
1134
- interactions: async () => (await import("./interactions-DiFvCosX.js")).InteractionCapture,
1132
+ var Dn = {
1133
+ errors: async () => (await import("./errors-Q3Ng1ciC.js")).ErrorCapture,
1134
+ network: async () => (await import("./network-Cg1L2w2r.js")).NetworkCapture,
1135
+ interactions: async () => (await import("./interactions-Byxf1C82.js")).InteractionCapture,
1135
1136
  webVitals: async () => (await import("./web-vitals-4pWACwaR.js")).WebVitalsCapture,
1136
- longFrames: async () => (await import("./long-frames-DNFaRnC3.js")).LongFrameCapture,
1137
- console: async () => (await import("./console-BGgGnjSi.js")).ConsoleCapture,
1138
- uncleanExit: async () => (await import("./unclean-exit-DQD1cT7c.js")).UncleanExitCapture,
1139
- userTiming: async () => (await import("./user-timing-BePqb1uN.js")).UserTimingCapture,
1140
- reports: async () => (await import("./reports-C-thq-bk.js")).ReportCapture,
1141
- resourceTiming: async () => (await import("./resource-timing-eUl2dNgC.js")).ResourceTimingCapture,
1142
- lifecycle: async () => (await import("./lifecycle-22CUCrc9.js")).LifecycleCapture,
1143
- framePhases: async () => (await import("./profiler-frames-cJMx9wNM.js")).FramePhasesCapture,
1144
- framePacing: async () => (await import("./profiler-frames-cJMx9wNM.js")).FramePacingCapture,
1145
- replay: async () => (await import("./replay-Ds-ANH34.js")).ReplayCapture
1146
- }, Tn = /* @__PURE__ */ new WeakMap(), En = 0;
1147
- function G(e) {
1148
- let t = Tn.get(e);
1149
- return t === void 0 && (t = ++En, Tn.set(e, t)), t;
1150
- }
1151
- var Dn = Symbol.for(f), On = Symbol.for(p), kn = ["batching", "retention"], An = [
1137
+ longFrames: async () => (await import("./long-frames-Bamjs1WV.js")).LongFrameCapture,
1138
+ console: async () => (await import("./console-BsM-fSCQ.js")).ConsoleCapture,
1139
+ uncleanExit: async () => (await import("./unclean-exit-BcOB8A2e.js")).UncleanExitCapture,
1140
+ userTiming: async () => (await import("./user-timing-4KIJ74Vi.js")).UserTimingCapture,
1141
+ reports: async () => (await import("./reports--8APRLa-.js")).ReportCapture,
1142
+ resourceTiming: async () => (await import("./resource-timing-BzR05rE-.js")).ResourceTimingCapture,
1143
+ lifecycle: async () => (await import("./lifecycle-B2PlIuQu.js")).LifecycleCapture,
1144
+ framePhases: async () => (await import("./profiler-frames-C4ySHN0X.js")).FramePhasesCapture,
1145
+ framePacing: async () => (await import("./profiler-frames-C4ySHN0X.js")).FramePacingCapture,
1146
+ replay: async () => (await import("./replay-B0M8kWz_.js")).ReplayCapture
1147
+ }, On = /* @__PURE__ */ new WeakMap(), kn = 0;
1148
+ function U(e) {
1149
+ let t = On.get(e);
1150
+ return t === void 0 && (t = ++kn, On.set(e, t)), t;
1151
+ }
1152
+ var An = Symbol.for(a), jn = Symbol.for(s), Mn = ["batching", "retention"], Nn = [
1152
1153
  "log",
1153
1154
  "event",
1154
1155
  "action"
1155
- ], jn = "configure() could not read its options. The library drops each record and installs no capture until a configure() call sets redact to a function or null.", Mn = "shutdown() got invalid options. The library discards the records in memory. An invalid clearStorage removes the \"context\" scope.", Nn = "flush() got invalid options. The library waits the default 5000 ms.", Pn = /* @__PURE__ */ new Set([
1156
+ ], Pn = "configure() could not read its options. The library drops each record and installs no capture until a configure() call sets redact to a function or null.", Fn = "shutdown() got invalid options. The library discards the records in memory. An invalid clearStorage removes the \"context\" scope.", In = "flush() got invalid options. The library waits the default 5000 ms.", Ln = /* @__PURE__ */ new Set([
1156
1157
  "bus.role_resolved",
1157
1158
  "config.reconfigured",
1158
1159
  "security.rotated",
1159
1160
  "journey.adopted",
1160
1161
  "journey.expired"
1161
1162
  ]);
1162
- function Fn(e) {
1163
+ function Rn(e) {
1163
1164
  return JSON.stringify({
1164
1165
  ...e,
1165
- urlTransform: e.urlTransform ? G(e.urlTransform) : void 0,
1166
+ urlTransform: e.urlTransform ? U(e.urlTransform) : void 0,
1166
1167
  webVitals: typeof e.webVitals == "object" ? { loader: e.webVitals.loader !== void 0 } : e.webVitals,
1167
1168
  ignoreUrls: e.ignoreUrls.map(String),
1168
1169
  propagateTraceHeaderTo: e.propagateTraceHeaderTo.map(String),
1169
1170
  userTiming: typeof e.userTiming == "object" ? { include: e.userTiming.include?.map(String) } : e.userTiming,
1170
- plugins: e.plugins.map(G)
1171
+ plugins: e.plugins.map(U)
1171
1172
  });
1172
1173
  }
1173
- function In(e) {
1174
- if (!D(e)) return e;
1174
+ function zn(e) {
1175
+ if (!T(e)) return e;
1175
1176
  let t = { ...e };
1176
1177
  for (let e of ["url", "endpoint"]) {
1177
1178
  let n = t[e];
1178
- typeof n == "string" && (t[e] = Be(n, !1));
1179
+ typeof n == "string" && (t[e] = He(n, !1));
1179
1180
  }
1180
1181
  return t;
1181
1182
  }
1182
- function Ln(e) {
1183
+ function Bn(e) {
1183
1184
  return {
1184
1185
  ...e,
1185
1186
  endpoint: null,
@@ -1194,10 +1195,10 @@ function Ln(e) {
1194
1195
  }
1195
1196
  };
1196
1197
  }
1197
- function Rn(e) {
1198
+ function Vn(e) {
1198
1199
  return !!e.endpoint || !!e.metricsEndpoint || !!e.tracesEndpoint || !!e.transport || !!e.transportWorker;
1199
1200
  }
1200
- function zn(e, t) {
1201
+ function Hn(e, t) {
1201
1202
  return {
1202
1203
  status: e,
1203
1204
  accepted: 0,
@@ -1208,13 +1209,13 @@ function zn(e, t) {
1208
1209
  ...t
1209
1210
  };
1210
1211
  }
1211
- function K(e) {
1212
- return zn(e.pending > 0 ? "timeout" : "complete", e);
1212
+ function W(e) {
1213
+ return Hn(e.pending > 0 ? "timeout" : "complete", e);
1213
1214
  }
1214
- function Bn(e) {
1215
- return e.sdkVersion === b;
1215
+ function G(e) {
1216
+ return e.sdkVersion === C;
1216
1217
  }
1217
- var q = class e {
1218
+ var K = class e {
1218
1219
  isRotating() {
1219
1220
  return this.rotating;
1220
1221
  }
@@ -1222,58 +1223,59 @@ var q = class e {
1222
1223
  typeof e == "boolean" && (this.config.lockConfiguration = e);
1223
1224
  }
1224
1225
  constructor(e, t) {
1225
- k(this, "rotating", !1), k(this, "rotationSeq", 0), k(this, "profilerOn", !1), k(this, "closingContext", !1), k(this, "mismatchVersion", null), k(this, "contextMismatch", !1), k(this, "rotation", void 0), k(this, "memoryStorage", void 0), k(this, "storagePersistence", "off"), k(this, "recordingDiagnostic", !1), k(this, "diagnosticLogger", new B(() => this, c)), k(this, "debugBuffer", new Xt(() => this.config.debugBuffer)), k(this, "explicitSecurityContext", void 0), k(this, "ownerAdopted", !1), k(this, "sdkVersion", b), k(this, "protocol", d), k(this, "diagnostics", void 0), k(this, "config", void 0), k(this, "platform", void 0), k(this, "identity", void 0), k(this, "backing", Ke()), k(this, "stores", {
1226
+ D(this, "rotating", !1), D(this, "rotationSeq", 0), D(this, "profilerOn", !1), D(this, "closingContext", !1), D(this, "mismatchVersion", null), D(this, "contextMismatch", !1), D(this, "rotation", void 0), D(this, "memoryStorage", void 0), D(this, "storagePersistence", "off"), D(this, "recordingDiagnostic", !1), D(this, "holdingRecords", !1), D(this, "heldDiagnostics", []), D(this, "diagnosticLogger", new R(() => this, ae)), D(this, "debugBuffer", new $t(() => this.config.debugBuffer)), D(this, "explicitSecurityContext", void 0), D(this, "ownerAdopted", !1), D(this, "sdkVersion", C), D(this, "protocol", d), D(this, "diagnostics", void 0), D(this, "config", void 0), D(this, "platform", void 0), D(this, "identity", void 0), D(this, "backing", Je()), D(this, "stores", {
1226
1227
  local: () => this.backing.local(),
1227
- session: () => this.backing.session()
1228
- }), k(this, "identityBuiltAs", void 0), k(this, "sessionTouch", void 0), k(this, "context", new Yt()), k(this, "breadcrumbs", void 0), k(this, "tracing", void 0), k(this, "sequence", new qt()), k(this, "journey", void 0), k(this, "builder", void 0), k(this, "remote", {
1228
+ session: () => this.backing.session(),
1229
+ opener: () => this.backing.opener?.() ?? null
1230
+ }), D(this, "identityBuiltAs", void 0), D(this, "sessionTouch", void 0), D(this, "context", new Qt()), D(this, "breadcrumbs", void 0), D(this, "tracing", void 0), D(this, "sequence", new Xt()), D(this, "journey", void 0), D(this, "builder", void 0), D(this, "remote", {
1229
1231
  sampling: null,
1230
1232
  changed: () => {
1231
1233
  this.refreshCaptures();
1232
1234
  }
1233
- }), k(this, "identityEpoch", 0), k(this, "errorHook", void 0), k(this, "replayConsent", void 0), k(this, "replay", void 0), k(this, "remoteCaptureTimer", void 0), k(this, "installedCaptureKey", ""), k(this, "replayBuiltKey", ""), k(this, "console", void 0), k(this, "drops", void 0), k(this, "meter", void 0), k(this, "bus", null), k(this, "busBuilt", void 0), k(this, "busLoad", void 0), k(this, "sender", void 0), k(this, "senderLoad", void 0), k(this, "pendingRecords", new $t((e) => {
1235
+ }), D(this, "identityEpoch", 0), D(this, "errorHook", void 0), D(this, "replayConsent", void 0), D(this, "replay", void 0), D(this, "remoteCaptureTimer", void 0), D(this, "installedCaptureKey", ""), D(this, "replayBuiltKey", ""), D(this, "console", void 0), D(this, "drops", void 0), D(this, "meter", void 0), D(this, "bus", null), D(this, "busBuilt", void 0), D(this, "busLoad", void 0), D(this, "sender", void 0), D(this, "senderLoad", void 0), D(this, "pendingRecords", new nn((e) => {
1234
1236
  this.dropHeld(e);
1235
- })), k(this, "pausedLoss", /* @__PURE__ */ new WeakSet()), k(this, "carried", []), k(this, "sessionPicked", !1), k(this, "deliveryClosed", !1), k(this, "parkedSender", void 0), k(this, "retiring", void 0), k(this, "startFailed", !1), k(this, "running", !1), k(this, "openGate", void 0), k(this, "startGate", new Promise((e) => {
1237
+ })), D(this, "pausedLoss", /* @__PURE__ */ new WeakSet()), D(this, "carried", []), D(this, "sessionPicked", !1), D(this, "deliveryClosed", !1), D(this, "parkedSender", void 0), D(this, "retiring", void 0), D(this, "startFailed", !1), D(this, "running", !1), D(this, "openGate", void 0), D(this, "startGate", new Promise((e) => {
1236
1238
  this.openGate = e;
1237
- })), k(this, "captures", []), k(this, "captureGeneration", 0), k(this, "captureOnce", {
1239
+ })), D(this, "captures", []), D(this, "captureGeneration", 0), D(this, "captureOnce", {
1238
1240
  webVitals: !1,
1239
1241
  navigationTiming: !1,
1240
1242
  longFrames: !1,
1241
1243
  uncleanExit: !1,
1242
1244
  userTiming: !1
1243
- }), k(this, "bootBuffer", new $t((e) => {
1245
+ }), D(this, "bootBuffer", new nn((e) => {
1244
1246
  this.dropHeld(e);
1245
- })), k(this, "forwardBuffer", []), k(this, "forwardScheduled", !1), k(this, "roleResolved", !1), k(this, "started", Promise.resolve()), k(this, "ready", !1), k(this, "destroyed", !1), k(this, "stopping", void 0), k(this, "lastSendAt", null), k(this, "lastGapAt", 0), k(this, "limits", void 0), k(this, "journeyOptions", void 0), k(this, "tunablesLocked", !1), k(this, "degraded", void 0), k(this, "serverReported", !1), k(this, "onPageHide", () => {
1246
- R(this), this.dropPaused(), this.role() === "forwarder" && (this.tracing.end(), this.sendForwarded());
1247
- }), k(this, "busCanAccept", (e, t) => this.bus?.isRegistered(e, t) ?? !1), k(this, "busAccept", (e, t, n) => {
1247
+ })), D(this, "forwardBuffer", []), D(this, "forwardScheduled", !1), D(this, "roleResolved", !1), D(this, "started", Promise.resolve()), D(this, "ready", !1), D(this, "destroyed", !1), D(this, "stopping", void 0), D(this, "lastSendAt", null), D(this, "lastGapAt", 0), D(this, "limits", void 0), D(this, "journeyOptions", void 0), D(this, "tunablesLocked", !1), D(this, "degraded", void 0), D(this, "serverReported", !1), D(this, "onPageHide", () => {
1248
+ I(this), this.dropPaused(), this.role() === "forwarder" && (this.tracing.end(), this.sendForwarded());
1249
+ }), D(this, "busCanAccept", (e, t) => this.bus?.isRegistered(e, t) ?? !1), D(this, "busAccept", (e, t, n) => {
1248
1250
  this.destroyed || this.ensureBus().then((r) => {
1249
1251
  r && !this.destroyed && this.diagnostics.guard("bus.send_failed", "The bus could not accept a direct message from a child frame.", () => {
1250
1252
  r.acceptDirect(e, t, n);
1251
1253
  });
1252
1254
  });
1253
- }), k(this, "reportLoss", (e, t, n, r) => {
1255
+ }), D(this, "reportLoss", (e, t, n, r) => {
1254
1256
  this.drops.add(e, t, n, r);
1255
- }), k(this, "reportGap", (e, t) => {
1257
+ }), D(this, "reportGap", (e, t) => {
1256
1258
  this.drops.add(e.reason, t.flatMap((e) => e.records), t.map((e) => e.id));
1257
1259
  let n = Date.now();
1258
- n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new B(() => this, o).warn("stored records were dropped before delivery", {
1260
+ n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new R(() => this, l).warn("stored records were dropped before delivery", {
1259
1261
  "gap.batches": e.batches,
1260
1262
  "gap.records": e.records,
1261
1263
  "gap.reason": e.reason
1262
1264
  }));
1263
- }), this.diagnostics = new V(typeof e.onDiagnostic == "function" ? e.onDiagnostic : void 0), this.platform = Ve(this.diagnostics), this.degraded = t || this.onServer(), this.config = P(this.allowed(e), this.diagnostics), this.explicitSecurityContext = !!e.securityContext?.id, this.config.securityContext.id ||= A(this.diagnostics), this.diagnostics.setPolicy(this.config.diagnostics.throttleMs, this.config.diagnostics.consoleFallback), this.identityBuiltAs = this.config.identity, this.identity = qe(this.diagnostics, this.stores, this.config.correlation.sessionIdleMs), this.sessionTouch = new We(this.diagnostics, this.stores, this.config.correlation.sessionIdleMs), this.breadcrumbs = new Jt(this.config.captureLimits.breadcrumbs);
1264
- let n = (e) => at(e, this.config.sampling.defaultRate);
1265
- this.tracing = new Ot(this.diagnostics, this.config.correlation.traceMaxAgeMs ?? Infinity, this.config.otelLoader, {
1265
+ }), this.diagnostics = new z(typeof e.onDiagnostic == "function" ? e.onDiagnostic : void 0), this.platform = Ue(this.diagnostics), this.degraded = t || this.onServer(), this.config = M(this.allowed(e), this.diagnostics), this.explicitSecurityContext = !!e.securityContext?.id, this.config.securityContext.id ||= O(this.diagnostics), this.diagnostics.setPolicy(this.config.diagnostics.throttleMs, this.config.diagnostics.consoleFallback), this.identityBuiltAs = this.config.identity, this.identity = Ye(this.diagnostics, this.stores, this.config.correlation.sessionIdleMs), this.sessionTouch = new Ke(this.diagnostics, this.stores, this.config.correlation.sessionIdleMs), this.breadcrumbs = new Zt(this.config.captureLimits.breadcrumbs);
1266
+ let n = (e) => st(e, this.config.sampling.defaultRate);
1267
+ this.tracing = new jt(this.diagnostics, this.config.correlation.traceMaxAgeMs ?? Infinity, this.config.otelLoader, {
1266
1268
  enabled: () => this.config.tracesEndpoint !== null,
1267
1269
  keeps: n,
1268
1270
  onEnd: (e) => {
1269
- n(e.traceId) && this.recordSpan(Sn(e));
1271
+ n(e.traceId) && this.recordSpan(Tn(e));
1270
1272
  }
1271
- }), this.limits = { ...this.config.limits }, this.console = new Kt(this.config.consoleOutput, this.diagnostics, this.limits), this.drops = new Qt(this.config, this.diagnostics), this.journeyOptions = {
1272
- ...rt,
1273
+ }), this.limits = { ...this.config.limits }, this.console = new Yt(this.config.consoleOutput, this.diagnostics, this.limits), this.drops = new tn(this.config, this.diagnostics), this.journeyOptions = {
1274
+ ...at,
1273
1275
  maxAgeMs: this.config.journey.maxAgeMs
1274
- }, this.journey = new nt(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
1276
+ }, this.journey = new it(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
1275
1277
  this.bus?.broadcastJourney(e);
1276
- }, this.stores), this.builder = new vn({
1278
+ }, this.stores), this.builder = new xn({
1277
1279
  remote: this.remote,
1278
1280
  config: this.config,
1279
1281
  limits: this.limits,
@@ -1285,7 +1287,7 @@ var q = class e {
1285
1287
  identity: this.identity,
1286
1288
  platform: this.platform,
1287
1289
  debug: this.debugBuffer
1288
- }), this.meter = new Wt(() => this.config.metrics.intervalMs, (e, t, n) => {
1290
+ }), this.meter = new qt(() => this.config.metrics.intervalMs, (e, t, n) => {
1289
1291
  this.emitPoint(e, t, n);
1290
1292
  }, this.diagnostics, this.config.metrics), this.diagnostics.setHandler(this.diagnosticHandler()), this.syncProfiler();
1291
1293
  }
@@ -1297,28 +1299,35 @@ var q = class e {
1297
1299
  recordDiagnostic(e) {
1298
1300
  let { records: t } = this.config.diagnostics;
1299
1301
  if ((t === !0 || t !== !1 && t.includes(e.code)) && !this.recordingDiagnostic) {
1300
- this.recordingDiagnostic = !0;
1301
- try {
1302
- (Pn.has(e.code) ? this.diagnosticLogger.info : this.diagnosticLogger.warn)(e.message, {
1303
- "diagnostic.code": e.code,
1304
- "diagnostic.count": e.count,
1305
- "diagnostic.detail": In(e.detail)
1306
- });
1307
- } finally {
1308
- this.recordingDiagnostic = !1;
1302
+ if (this.holdingRecords) this.heldDiagnostics.push(e);
1303
+ else {
1304
+ this.recordingDiagnostic = !0;
1305
+ try {
1306
+ (Ln.has(e.code) ? this.diagnosticLogger.info : this.diagnosticLogger.warn)(e.message, {
1307
+ "diagnostic.code": e.code,
1308
+ "diagnostic.count": e.count,
1309
+ "diagnostic.detail": zn(e.detail)
1310
+ });
1311
+ } finally {
1312
+ this.recordingDiagnostic = !1;
1313
+ }
1309
1314
  }
1310
1315
  }
1311
1316
  }
1317
+ dropHeldRecords() {
1318
+ let e = this.heldDiagnostics.length;
1319
+ this.heldDiagnostics = [], e > 0 && this.diagnostics.count("record.dropped_during_rotation", e);
1320
+ }
1312
1321
  addBreadcrumb(e, t) {
1313
1322
  this.rotating || this.destroyed || this.diagnostics.guard("record.sanitize_failed", "The library could not add the breadcrumb.", () => {
1314
1323
  let n = {
1315
1324
  t: Date.now(),
1316
1325
  category: "custom",
1317
- message: Xe(String(e), this.limits.maxBodyChars)
1326
+ message: Qe(String(e), this.limits.maxBodyChars)
1318
1327
  };
1319
1328
  if (t !== void 0) {
1320
- let e = Ze(t, this.limits, this.diagnostics);
1321
- n.data = D(e) ? e : { value: e };
1329
+ let e = $e(t, this.limits, this.diagnostics);
1330
+ n.data = T(e) ? e : { value: e };
1322
1331
  }
1323
1332
  this.breadcrumbs.push(n);
1324
1333
  });
@@ -1328,7 +1337,7 @@ var q = class e {
1328
1337
  }
1329
1338
  startMeasure(e, t) {
1330
1339
  let n = this.identityEpoch, r = () => !this.destroyed && !this.rotating && (!this.config.securityContext.isolation || this.identityEpoch === n), i = this.diagnostics.guard("record.sanitize_failed", "The library could not read the attributes of the measure.", () => ({ ...t }));
1331
- return jt(this.diagnostics.guard("record.sanitize_failed", "The library could not read the name of the measure.", () => `${e}`) ?? "", i ?? {}, this.tracing.request().span, {
1340
+ return Pt(this.diagnostics.guard("record.sanitize_failed", "The library could not read the name of the measure.", () => `${e}`) ?? "", i ?? {}, this.tracing.request().span, {
1332
1341
  metric: (e, t, n) => {
1333
1342
  r() && this.recordMetric(e, t, n);
1334
1343
  },
@@ -1343,9 +1352,9 @@ var q = class e {
1343
1352
  level: "INFO",
1344
1353
  type: "span",
1345
1354
  body: e.name,
1346
- namespace: be,
1355
+ namespace: xe,
1347
1356
  payload: e.attributes,
1348
- fixed: Cn(e),
1357
+ fixed: En(e),
1349
1358
  trace: {
1350
1359
  traceId: e.traceId,
1351
1360
  spanId: e.spanId,
@@ -1354,24 +1363,24 @@ var q = class e {
1354
1363
  });
1355
1364
  this.emit(t);
1356
1365
  }
1357
- emitPoint(e, t, r) {
1366
+ emitPoint(e, t, n) {
1358
1367
  if (this.destroyed) return;
1359
- let { record: i } = this.builder.build({
1368
+ let { record: r } = this.builder.build({
1360
1369
  level: "INFO",
1361
1370
  type: "metric",
1362
1371
  body: e,
1363
- namespace: n,
1372
+ namespace: ne,
1364
1373
  payload: t,
1365
- fixed: r,
1374
+ fixed: n,
1366
1375
  aggregated: !0
1367
1376
  });
1368
- this.emit(i);
1377
+ this.emit(r);
1369
1378
  }
1370
1379
  syncProfiler() {
1371
1380
  let e = this.config.profiler.enabled && this.config.enabled;
1372
1381
  if (e === this.profilerOn) return;
1373
1382
  this.profilerOn = e;
1374
- let t = j();
1383
+ let t = k();
1375
1384
  if (!e) {
1376
1385
  t.collect(!1), t.detach();
1377
1386
  return;
@@ -1398,25 +1407,25 @@ var q = class e {
1398
1407
  this.replayConsent = e, e ? this.replay?.start() : this.replay?.stop();
1399
1408
  }
1400
1409
  collectPoints() {
1401
- this.meter.collect(), this.profilerOn && j().collect(!1);
1410
+ this.meter.collect(), this.profilerOn && k().collect(!1);
1402
1411
  }
1403
1412
  advanceIdentity() {
1404
- this.identityEpoch++, this.profilerOn && this.config.securityContext.isolation && j().reset(), this.remote.sampling = null, this.refreshCaptures();
1413
+ this.identityEpoch++, this.profilerOn && this.config.securityContext.isolation && k().reset(), this.remote.sampling = null, this.refreshCaptures();
1405
1414
  }
1406
1415
  static pinned() {
1407
- return globalThis[Dn] ?? null;
1416
+ return globalThis[An] ?? null;
1408
1417
  }
1409
1418
  static current() {
1410
1419
  let t = e.local;
1411
1420
  if (t) return t.destroyed ? null : t;
1412
1421
  let n = e.pinned();
1413
- return n && Bn(n) ? n : null;
1422
+ return n && G(n) ? n : null;
1414
1423
  }
1415
1424
  static stopped() {
1416
1425
  let t = e.local;
1417
1426
  if (t?.destroyed) return t;
1418
- let n = globalThis[On];
1419
- return n && Bn(n) ? n : null;
1427
+ let n = globalThis[jn];
1428
+ return n && G(n) ? n : null;
1420
1429
  }
1421
1430
  isDestroyed() {
1422
1431
  return this.destroyed;
@@ -1433,10 +1442,10 @@ var q = class e {
1433
1442
  }
1434
1443
  refuse(e) {
1435
1444
  this.startFailed = !0;
1436
- let t = P({ redact: F }, new V(), this.config);
1437
- $e(this.config, t), M(() => {
1438
- console.warn(`${de} ${jn}`);
1439
- }), this.diagnostics.report("config.invalid", jn, void 0, e), this.rehookHeld();
1445
+ let t = M({ redact: N }, new z(), this.config);
1446
+ tt(this.config, t), A(() => {
1447
+ console.warn(`${f} ${Pn}`);
1448
+ }), this.diagnostics.report("config.invalid", Pn, void 0, e), this.rehookHeld();
1440
1449
  }
1441
1450
  static startOrUpdate(t, n) {
1442
1451
  let r = e.local;
@@ -1444,19 +1453,19 @@ var q = class e {
1444
1453
  e.local = null;
1445
1454
  let i = e.pinned();
1446
1455
  if (i) {
1447
- if (!Bn(i)) return e.startDegraded(t, i.sdkVersion, n);
1456
+ if (!G(i)) return e.startDegraded(t, i.sdkVersion, n);
1448
1457
  if (!i.destroyed) return i.reconfigure(t), i;
1449
1458
  }
1450
1459
  let a = new e(t, !1);
1451
- return globalThis[Dn] = a, Reflect.deleteProperty(globalThis, On), n || a.launch(), a;
1460
+ return globalThis[An] = a, Reflect.deleteProperty(globalThis, jn), n || a.launch(), a;
1452
1461
  }
1453
1462
  static startDegraded(t, n, r) {
1454
1463
  let i = new e(t, !0);
1455
1464
  e.local = i;
1456
1465
  let a = typeof n == "string" ? n : "before 0.9.0";
1457
- return i.mismatchVersion = a, i.diagnostics.report("runtime.version_mismatch", `Another copy of the library, version ${a}, owns the page runtime. This copy, version ${b}, runs in console-only mode and installs no capture. Load one version of the library on the page.`, {
1466
+ return i.mismatchVersion = a, i.diagnostics.report("runtime.version_mismatch", `Another copy of the library, version ${a}, owns the page runtime. This copy, version ${C}, runs in console-only mode and installs no capture. Load one version of the library on the page.`, {
1458
1467
  found: a,
1459
- own: b
1468
+ own: C
1460
1469
  }), r || i.launch(), i;
1461
1470
  }
1462
1471
  reconfigure(e) {
@@ -1465,39 +1474,39 @@ var q = class e {
1465
1474
  return;
1466
1475
  }
1467
1476
  if (this.config.lockConfiguration) {
1468
- let t = P(e, this.diagnostics, this.config);
1469
- J(this.config, t) || this.diagnostics.report("config.locked", "Runtime configuration is locked. Use setConfigurationLocked(false) to unlock it explicitly.");
1477
+ let t = M(e, this.diagnostics, this.config);
1478
+ q(this.config, t) || this.diagnostics.report("config.locked", "Runtime configuration is locked. Use setConfigurationLocked(false) to unlock it explicitly.");
1470
1479
  return;
1471
1480
  }
1472
- R(this);
1481
+ I(this);
1473
1482
  let t = this.keepDestination(this.keepRouting(this.allowed(e)));
1474
1483
  !this.tunablesLocked && t.securityContext?.id && (this.explicitSecurityContext = !0);
1475
- let n = P(t, this.diagnostics, this.config), r = this.tunablesLocked ? ["correlation", "storage"] : [];
1476
- for (let e of r) J(n[e], this.config[e]) || (this.diagnostics.report("config.invalid", `${e} cannot change after startup. The library keeps the current settings.`), Object.assign(n, { [e]: this.config[e] }));
1484
+ let n = M(t, this.diagnostics, this.config), r = this.tunablesLocked ? ["correlation", "storage"] : [];
1485
+ for (let e of r) q(n[e], this.config[e]) || (this.diagnostics.report("config.invalid", `${e} cannot change after startup. The library keeps the current settings.`), Object.assign(n, { [e]: this.config[e] }));
1477
1486
  this.keepStartupTunables(n);
1478
1487
  let { redact: i, processors: a, enabled: o } = this.config;
1479
- o && !n.enabled && this.collectPoints(), $e(this.config, n), this.config.redact !== F && (this.startFailed = !1), (this.config.redact !== i || this.config.processors !== a) && this.debugBuffer.clear(), this.breadcrumbs.resize(this.config.captureLimits.breadcrumbs), this.diagnostics.setHandler(this.diagnosticHandler()), this.diagnostics.setPolicy(this.config.diagnostics.throttleMs, this.config.diagnostics.consoleFallback), this.builder.invalidateResource(), this.console.update(this.config.consoleOutput), this.keepBuiltIdentity(), this.syncProfiler(), this.launch(), this.running && o !== this.config.enabled && this.sender?.hold(!this.config.enabled), this.refreshCaptures(), this.roleResolved && this.syncSender(), this.diagnostics.report("config.reconfigured", "A later configure() call updated the runtime.");
1488
+ o && !n.enabled && this.collectPoints(), tt(this.config, n), this.config.redact !== N && (this.startFailed = !1), (this.config.redact !== i || this.config.processors !== a) && this.debugBuffer.clear(), this.breadcrumbs.resize(this.config.captureLimits.breadcrumbs), this.diagnostics.setHandler(this.diagnosticHandler()), this.diagnostics.setPolicy(this.config.diagnostics.throttleMs, this.config.diagnostics.consoleFallback), this.builder.invalidateResource(), this.console.update(this.config.consoleOutput), this.keepBuiltIdentity(), this.syncProfiler(), this.launch(), this.running && o !== this.config.enabled && this.sender?.hold(!this.config.enabled), this.refreshCaptures(), this.roleResolved && this.syncSender(), this.diagnostics.report("config.reconfigured", "A later configure() call updated the runtime.");
1480
1489
  }
1481
1490
  onServer() {
1482
1491
  return this.platform.platform === "node";
1483
1492
  }
1484
1493
  allowed(e) {
1485
- return this.degraded ? (this.onServer() && !this.serverReported && Rn(e) && (this.serverReported = !0, this.diagnostics.report("config.invalid", "The library runs console-only on Node. It sends no record and installs no capture. It ignores endpoint, metricsEndpoint, tracesEndpoint, transport and transportWorker.")), Ln(e)) : e;
1494
+ return this.degraded ? (this.onServer() && !this.serverReported && Vn(e) && (this.serverReported = !0, this.diagnostics.report("config.invalid", "The library runs console-only on Node. It sends no record and installs no capture. It ignores endpoint, metricsEndpoint, tracesEndpoint, transport and transportWorker.")), Bn(e)) : e;
1486
1495
  }
1487
1496
  keepRouting(e) {
1488
1497
  if (!this.tunablesLocked || this.degraded || !this.config.securityContext.isolation) return e;
1489
- let n = P(e, new V(), this.config), r = t.filter((e) => !J(n[e], this.config[e]));
1490
- if (n.securityContext.id !== this.config.securityContext.id && r.push("securityContext.id"), r.length === 0) return e;
1491
- let i = { ...e };
1492
- for (let e of t) r.includes(e) && Reflect.deleteProperty(i, e);
1493
- if (r.includes("securityContext.id")) {
1498
+ let t = M(e, new z(), this.config), n = p.filter((e) => !q(t[e], this.config[e]));
1499
+ if (t.securityContext.id !== this.config.securityContext.id && n.push("securityContext.id"), n.length === 0) return e;
1500
+ let r = { ...e };
1501
+ for (let e of p) n.includes(e) && Reflect.deleteProperty(r, e);
1502
+ if (n.includes("securityContext.id")) {
1494
1503
  let t = { ...e.securityContext };
1495
- Reflect.deleteProperty(t, "id"), i.securityContext = t;
1504
+ Reflect.deleteProperty(t, "id"), r.securityContext = t;
1496
1505
  }
1497
- return this.diagnostics.report("config.invalid", `Isolation refuses changes to ${r.join(", ")}. Use rotateSecurityContext() for these changes. To permit them, set securityContext.isolation: false in a separate configure() call. The other settings apply.`), i;
1506
+ return this.diagnostics.report("config.invalid", `Isolation refuses changes to ${n.join(", ")}. Use rotateSecurityContext() for these changes. To permit them, set securityContext.isolation: false in a separate configure() call. The other settings apply.`), r;
1498
1507
  }
1499
1508
  keepStartupTunables(e) {
1500
- if (this.senderLoad !== void 0 && this.keepSections(e, kn), !this.tunablesLocked) {
1509
+ if (this.senderLoad !== void 0 && this.keepSections(e, Mn), !this.tunablesLocked) {
1501
1510
  Object.assign(this.limits, e.limits), this.journeyOptions.maxAgeMs = e.journey.maxAgeMs;
1502
1511
  return;
1503
1512
  }
@@ -1509,7 +1518,7 @@ var q = class e {
1509
1518
  e.profiler.maxProbes !== n && (this.diagnostics.report("config.invalid", `profiler.maxProbes cannot change after startup. It stays ${String(n)}.`, { requested: e.profiler.maxProbes }), e.profiler.maxProbes = n);
1510
1519
  }
1511
1520
  keepSections(e, t) {
1512
- for (let n of t) J(e[n], this.config[n]) || (this.diagnostics.report("config.invalid", `${n} cannot change after startup. The current values stay.`, { requested: e[n] }), Object.assign(e, { [n]: this.config[n] }));
1521
+ for (let n of t) q(e[n], this.config[n]) || (this.diagnostics.report("config.invalid", `${n} cannot change after startup. The current values stay.`, { requested: e[n] }), Object.assign(e, { [n]: this.config[n] }));
1513
1522
  }
1514
1523
  keepDestination(e) {
1515
1524
  if (this.senderLoad === void 0) return e;
@@ -1535,9 +1544,9 @@ var q = class e {
1535
1544
  this.startFailed || (this.tunablesLocked || (this.tunablesLocked = !0, this.config.enabled || this.drops.add("disabled", this.rehookHeld())), !this.running && this.config.enabled && this.start());
1536
1545
  }
1537
1546
  start() {
1538
- this.running = !0, this.identityBuiltAs === "storage" && !this.onServer() && (this.backing = Je);
1539
- let { sessionIdleMs: e, traceMaxAgeMs: t } = this.config.correlation, { sessionId: n, tabId: r } = qe(this.diagnostics, this.stores, e);
1540
- this.sessionTouch = new We(this.diagnostics, this.stores, e), this.sessionPicked ? this.sessionTouch.restart(this.identity.sessionId) : this.identity.sessionId = n, this.identity.tabId = r, this.builder.invalidateResource(), this.breadcrumbs.retain((e) => !An.includes(e.category)), this.tracing.setup(t ?? Infinity, this.config.otelLoader), this.tracing.loadOtel();
1547
+ this.running = !0, this.identityBuiltAs === "storage" && !this.onServer() && (this.backing = Xe);
1548
+ let { sessionIdleMs: e, traceMaxAgeMs: t } = this.config.correlation, { sessionId: n, tabId: r } = Ye(this.diagnostics, this.stores, e);
1549
+ this.sessionTouch = new Ke(this.diagnostics, this.stores, e), this.sessionPicked ? this.sessionTouch.restart(this.identity.sessionId) : this.identity.sessionId = n, this.identity.tabId = r, this.builder.invalidateResource(), this.breadcrumbs.retain((e) => !Nn.includes(e.category)), this.tracing.setup(t ?? Infinity, this.config.otelLoader), this.tracing.loadOtel();
1541
1550
  for (let e of this.rehookHeld()) this.bootBuffer.push(e, this.config.buffering.maxHeldRecords);
1542
1551
  this.openGate(), this.init();
1543
1552
  }
@@ -1577,22 +1586,22 @@ var q = class e {
1577
1586
  async buildBus() {
1578
1587
  try {
1579
1588
  await this.startGate;
1580
- let { Bus: e } = await import("./bus-C39wspFV.js");
1589
+ let { Bus: e } = await import("./bus-dw7T92sO.js");
1581
1590
  if (this.destroyed) return null;
1582
1591
  let t = new e(this.config, this.diagnostics, this.platform, this.identity.contextId, this.identity.tabId, {
1583
1592
  onSecurityContext: (e) => {
1584
1593
  if (this.explicitSecurityContext && this.config.securityContext.id !== e) return this.contextMismatch = !0, this.diagnostics.report("security.context_mismatch", "The configured security context differs from the upstream owner."), !1;
1585
1594
  if (this.contextMismatch = !1, this.config.securityContext.id !== e) {
1586
1595
  if (this.ownerAdopted) {
1587
- R(this), this.drops.add("security_context", [
1596
+ I(this), this.drops.add("security_context", [
1588
1597
  ...this.bootBuffer.take(),
1589
1598
  ...this.pendingRecords.take(),
1590
1599
  ...this.forwardBuffer
1591
1600
  ]), this.forwardBuffer = [], this.context.clear(), this.breadcrumbs.clear();
1592
1601
  let e = this.rotating;
1593
- this.rotating = !0, this.collectPoints(), this.profilerOn && j().reset();
1602
+ this.rotating = !0, this.collectPoints(), this.profilerOn && k().reset();
1594
1603
  let t = this.sessionTouch.stored();
1595
- this.resetSession(t !== void 0 && t !== this.identity.sessionId ? t : A(this.diagnostics)), this.rotating = e, this.advanceIdentity();
1604
+ this.resetSession(t !== void 0 && t !== this.identity.sessionId ? t : O(this.diagnostics)), this.rotating = e, this.advanceIdentity();
1596
1605
  }
1597
1606
  this.config.securityContext.id = e;
1598
1607
  }
@@ -1631,7 +1640,7 @@ var q = class e {
1631
1640
  }
1632
1641
  async buildSender() {
1633
1642
  try {
1634
- let { Sender: e } = await import("./sender-Dv8rAmpV.js"), t = this.destroyed ? null : await e.create({
1643
+ let { Sender: e } = await import("./sender-Bdp-TAS4.js"), t = this.destroyed ? null : await e.create({
1635
1644
  storage: this.memoryStorage,
1636
1645
  onStorage: (e) => {
1637
1646
  e.name === "memory" && (this.memoryStorage = e);
@@ -1645,7 +1654,7 @@ var q = class e {
1645
1654
  onLoss: this.reportLoss,
1646
1655
  remote: this.remote,
1647
1656
  beforeExit: () => {
1648
- R(this), this.collectPoints(), this.tracing.end();
1657
+ I(this), this.collectPoints(), this.tracing.end();
1649
1658
  },
1650
1659
  onSent: (e) => {
1651
1660
  this.lastSendAt = e;
@@ -1664,8 +1673,10 @@ var q = class e {
1664
1673
  this.senderLoad = void 0, this.diagnostics.report("pipeline.crashed", "The delivery stack did not load. The library does not send records.", { held: this.pendingRecords.length }, e), this.drops.add("load_failed", this.pendingRecords.records);
1665
1674
  }
1666
1675
  for (let e of this.pendingRecords.take()) this.sender?.push(e);
1667
- let e = this.carried;
1668
- this.carried = [], this.sender && e.length > 0 && await this.adoptStored(this.sender, e);
1676
+ if (this.sender && this.carried.length > 0) {
1677
+ let e = this.carried;
1678
+ this.carried = [], await this.adoptStored(this.sender, e);
1679
+ }
1669
1680
  }
1670
1681
  async adoptStored(e, t) {
1671
1682
  await this.diagnostics.guardAsync("storage.degraded", "The library could not store the carried batches under the new context.", () => e.adopt(t, this.config.securityContext.id));
@@ -1675,18 +1686,18 @@ var q = class e {
1675
1686
  let e = this.remote.sampling?.wire();
1676
1687
  e && (this.remoteCaptureTimer = setTimeout(() => {
1677
1688
  this.refreshCaptures();
1678
- }, e.ttlMs), O(this.remoteCaptureTimer)), this.captureState(this.effectiveCapture()) !== this.installedCaptureKey && this.installCaptures();
1689
+ }, e.ttlMs), E(this.remoteCaptureTimer)), this.captureState(this.effectiveCapture()) !== this.installedCaptureKey && this.installCaptures();
1679
1690
  }
1680
1691
  captureState(e) {
1681
1692
  let { enabled: t, framePhases: n, framePacing: r } = this.config.profiler;
1682
- return `${String(this.config.enabled)}${Fn(e)}${String(t && n)}${String(t && r)}${this.replayState(e)}`;
1693
+ return `${String(this.config.enabled)}${Rn(e)}${String(t && n)}${String(t && r)}${this.replayState(e)}`;
1683
1694
  }
1684
1695
  replayState(e) {
1685
1696
  let { replay: t } = this.config;
1686
1697
  return t.enabled ? JSON.stringify([
1687
- t.loader && G(t.loader),
1688
- t.onSegment && G(t.onSegment),
1689
- G(t.recordOptions),
1698
+ t.loader && U(t.loader),
1699
+ t.onSegment && U(t.onSegment),
1700
+ U(t.recordOptions),
1690
1701
  t.endpoint,
1691
1702
  t.requireConsent,
1692
1703
  t.mode,
@@ -1696,14 +1707,14 @@ var q = class e {
1696
1707
  t.blockSelectors,
1697
1708
  t.recordCanvas,
1698
1709
  t.bufferMs,
1699
- t.plugins.map(G),
1710
+ t.plugins.map(U),
1700
1711
  e.fullUrls,
1701
1712
  e.ignoreUrls.map(String)
1702
1713
  ]) : "";
1703
1714
  }
1704
1715
  effectiveCapture() {
1705
1716
  let e = { ...this.config.capture }, t = this.remote.sampling?.current()?.capture;
1706
- for (let n of Ce) {
1717
+ for (let n of Oe) {
1707
1718
  let r = t?.[n];
1708
1719
  if (e.remoteToggles.includes(n) && r !== void 0) {
1709
1720
  if (r && typeof e[n] == "object") continue;
@@ -1732,7 +1743,7 @@ var q = class e {
1732
1743
  diagnostics: this.diagnostics,
1733
1744
  breadcrumbs: this.breadcrumbs,
1734
1745
  tracing: this.tracing,
1735
- logger: new vt(() => this, h),
1746
+ logger: new xt(() => this, h),
1736
1747
  once: this.captureOnce,
1737
1748
  recordMetric: (e, t, n) => {
1738
1749
  this.recordMetric(e, t, n);
@@ -1768,21 +1779,21 @@ var q = class e {
1768
1779
  this.captures.length = 0, this.replay = e, e && this.captures.push(e);
1769
1780
  }
1770
1781
  loadWebSocket() {
1771
- return this.diagnostics.guardAsync("capture.install_failed", "The library could not load the webSocket capture.", async () => (await import("./web-socket-DSHgDiZ6.js")).WebSocketCapture);
1782
+ return this.diagnostics.guardAsync("capture.install_failed", "The library could not load the webSocket capture.", async () => (await import("./web-socket-Zg0hj1LB.js")).WebSocketCapture);
1772
1783
  }
1773
1784
  pluginCapture(e) {
1774
1785
  let { name: t } = e, n = (e, t, n) => {
1775
1786
  this.recordMetric(e, t, n);
1776
1787
  }, r = (e) => {
1777
- this.diagnostics.report("config.invalid", Ae, void 0, e);
1788
+ this.diagnostics.report("config.invalid", _, void 0, e);
1778
1789
  }, i = {
1779
- logger: new B(() => this, `${h}.${t}`),
1780
- counter: (e, t = {}) => Vt(e, t, n, r),
1781
- histogram: (e, t = {}) => Ut(e, t, n, r),
1790
+ logger: new R(() => this, `${h}.${t}`),
1791
+ counter: (e, t = {}) => Wt(e, t, n, r),
1792
+ histogram: (e, t = {}) => Kt(e, t, n, r),
1782
1793
  addBreadcrumb: (e, t) => {
1783
1794
  this.addBreadcrumb(e, t);
1784
1795
  },
1785
- ownRequest: Qe
1796
+ ownRequest: et
1786
1797
  };
1787
1798
  return {
1788
1799
  name: t,
@@ -1795,7 +1806,7 @@ var q = class e {
1795
1806
  };
1796
1807
  }
1797
1808
  loadCapture(e) {
1798
- return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`, wn[e]);
1809
+ return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`, Dn[e]);
1799
1810
  }
1800
1811
  registerWorker(e, t = {}) {
1801
1812
  let n = !1, r;
@@ -1820,29 +1831,31 @@ var q = class e {
1820
1831
  this.stopping ??= this.stop(t), await this.stopping, n !== void 0 && await this.clearStorage(n);
1821
1832
  }
1822
1833
  async stop(t) {
1823
- t || (R(this), this.collectPoints(), this.tracing.end()), this.profilerOn && (this.profilerOn = !1, j().detach()), this.destroyed = !0, this.backing = Ke(), dt(this), this.collectPoints(), clearTimeout(this.remoteCaptureTimer), this.remoteCaptureTimer = void 0, this.degraded || removeEventListener("pagehide", this.onPageHide), this.uninstallCaptures();
1834
+ t || (I(this), this.collectPoints(), this.tracing.end()), this.profilerOn && (this.profilerOn = !1, k().detach()), this.destroyed = !0, this.backing = Je(), mt(this), this.collectPoints(), clearTimeout(this.remoteCaptureTimer), this.remoteCaptureTimer = void 0, this.degraded || removeEventListener("pagehide", this.onPageHide), this.uninstallCaptures();
1824
1835
  let n = t ? this.discardHeld() : this.flushHeld();
1825
1836
  this.journey.destroy(), this.bus?.destroy(), await n, await this.senderLoad, await this.rotation?.catch(() => void 0);
1826
1837
  let r = this.parkedSender;
1827
1838
  this.parkedSender = void 0, await this.diagnostics.guardAsync("pipeline.crashed", "The delivery stack of the old context did not stop at shutdown. The library leaves its stored batches in storage.", async () => {
1828
1839
  await (t ? r?.discard() : r?.retire("retain", 0, this.config.securityContext.id));
1829
- }), await this.memoryStorage?.close(), e.pinned() === this && (Reflect.deleteProperty(globalThis, Dn), globalThis[On] = this);
1840
+ }), await this.memoryStorage?.close(), e.pinned() === this && (Reflect.deleteProperty(globalThis, An), globalThis[jn] = this);
1830
1841
  }
1831
1842
  shutdownRule(e) {
1832
- let t = this.readOptions(e, Mn);
1843
+ let t = this.readOptions(e, Fn);
1833
1844
  if (t === void 0) return { discard: !0 };
1834
1845
  let { pending: n, clearStorage: r } = t, i = r == null, a = i || r === "context" || r === "namespace", o;
1835
1846
  i || (o = r === "namespace" ? "namespace" : "context");
1836
1847
  let s = n === void 0 || n === "flush";
1837
- return (!a || !(s || n === "discard") || n === "flush" && o) && this.diagnostics.report("config.invalid", Mn), {
1848
+ return (!a || !(s || n === "discard") || n === "flush" && o) && this.diagnostics.report("config.invalid", Fn), {
1838
1849
  discard: !s || o !== void 0,
1839
1850
  scope: o
1840
1851
  };
1841
1852
  }
1842
1853
  async flushHeld() {
1843
- this.dropPaused();
1854
+ this.sender && this.releaseBootBuffer(), this.dropPaused();
1844
1855
  let e = this.sender?.destroy();
1845
- this.sendForwarded(), this.drops.add("load_failed", this.unreported(this.pendingRecords.take())), await e;
1856
+ this.sendForwarded();
1857
+ let t = [...this.bootBuffer.take(), ...this.pendingRecords.take()];
1858
+ this.drops.add("load_failed", this.unreported(t)), await e;
1846
1859
  }
1847
1860
  async discardHeld() {
1848
1861
  let e = [
@@ -1856,7 +1869,7 @@ var q = class e {
1856
1869
  }
1857
1870
  async clearStorage(e) {
1858
1871
  this.tunablesLocked && await this.diagnostics.guardAsync("storage.degraded", "The library could not remove the stored batches at shutdown.", async () => {
1859
- let { clearStored: t } = await import("./stored-context-B2EzVuYm.js"), n = this.carried.map((e) => e.id);
1872
+ let { clearStored: t } = await import("./stored-context-CSttrAsw.js"), n = this.carried.map((e) => e.id);
1860
1873
  this.carried = [], await t(this.storeAccess(), e, n, this.identityBuiltAs === "storage" && !this.onServer());
1861
1874
  });
1862
1875
  }
@@ -1917,11 +1930,11 @@ var q = class e {
1917
1930
  }
1918
1931
  let t = [];
1919
1932
  for (let n of e) {
1920
- if (!Ne(n)) {
1933
+ if (!Fe(n)) {
1921
1934
  this.diagnostics.count("record.dropped_malformed");
1922
1935
  continue;
1923
1936
  }
1924
- if (n.attributes["uiobs.debug_buffer"] !== !0 && !it(n, this.config, this.remote.sampling?.current() ?? null)) {
1937
+ if (n.attributes["uiobs.debug_buffer"] !== !0 && !ot(n, this.config, this.remote.sampling?.current() ?? null)) {
1925
1938
  this.diagnostics.count("record.dropped_by_sampling");
1926
1939
  continue;
1927
1940
  }
@@ -1937,14 +1950,14 @@ var q = class e {
1937
1950
  for (let t of e) r && !t.attributes["journey.id"] && (t.attributes["journey.id"] = r.id, t.attributes["journey.name"] = r.name), this.route(t);
1938
1951
  }
1939
1952
  regenerateTabId() {
1940
- let e = A(this.diagnostics);
1953
+ let e = O(this.diagnostics);
1941
1954
  this.diagnostics.report("bus.role_resolved", "Another context uses this tab id. A duplicated tab is the usual cause. The library makes a new tab id.", {
1942
1955
  was: this.identity.tabId,
1943
1956
  now: e
1944
- }), this.identity.tabId = e, Ue(e, this.diagnostics, this.stores), this.builder.invalidateResource();
1957
+ }), this.identity.tabId = e, Ge(e, this.diagnostics, this.stores), this.builder.invalidateResource(), this.bus?.setTabId(e);
1945
1958
  }
1946
1959
  newSession() {
1947
- this.destroyed || (R(this), this.resetSession(A(this.diagnostics)));
1960
+ this.destroyed || (I(this), this.resetSession(O(this.diagnostics)));
1948
1961
  }
1949
1962
  resetSession(e) {
1950
1963
  this.sessionPicked = !0, this.collectPoints(), this.tracing.rotate("explicit"), this.journey.end(), this.breadcrumbs.clear(), this.debugBuffer.clear(), this.replay?.reset(), this.identity.sessionId = e, this.sessionTouch.restart(e), this.builder.invalidateResource();
@@ -1952,7 +1965,7 @@ var q = class e {
1952
1965
  rotateSecurityContext(e, t = {}) {
1953
1966
  if (this.destroyed) return Promise.reject(/* @__PURE__ */ Error("The runtime has stopped."));
1954
1967
  if (!this.tunablesLocked) return Promise.reject(/* @__PURE__ */ Error("The runtime is not configured. Call configure() before rotateSecurityContext()."));
1955
- R(this), this.rotating = !0;
1968
+ I(this), this.rotating = !0;
1956
1969
  let n = ++this.rotationSeq, r = (this.rotation ?? Promise.resolve()).catch(() => void 0).then(() => this.runRotation(e, t, n));
1957
1970
  this.rotation = r;
1958
1971
  let i = () => {
@@ -1965,20 +1978,32 @@ var q = class e {
1965
1978
  if (await this.started, this.role() === "forwarder") throw Error("Rotate the security context on the upstream owner, or use bus.mode: sender for an independent identity.");
1966
1979
  let r;
1967
1980
  try {
1968
- r = (await import("./rotation-Cwct4ckk.js")).rotateContext;
1981
+ r = (await import("./rotation-BylN1B9e.js")).rotateContext;
1969
1982
  } catch (e) {
1970
1983
  throw this.diagnostics.report("pipeline.crashed", "The library could not load the security-context rotation.", void 0, e), await this.closeDelivery(), e;
1971
1984
  }
1972
1985
  if (this.isDestroyed()) throw Error("The runtime has stopped.");
1973
- await r(this.rotationHost(), e, t, n);
1986
+ try {
1987
+ await r(this.rotationHost(), e, t, n);
1988
+ } finally {
1989
+ this.dropHeldRecords();
1990
+ }
1974
1991
  }
1975
1992
  rotationHost() {
1976
1993
  return {
1977
1994
  runtime: this,
1978
- quiet: new V(),
1995
+ quiet: new z(),
1979
1996
  senderLoaded: async () => {
1980
1997
  await this.senderLoad;
1981
1998
  },
1999
+ holdRecords: (e) => {
2000
+ this.holdingRecords = !0;
2001
+ try {
2002
+ return e();
2003
+ } finally {
2004
+ this.holdingRecords = !1;
2005
+ }
2006
+ },
1982
2007
  allowed: (e) => this.allowed(e),
1983
2008
  closeDelivery: () => this.closeDelivery(),
1984
2009
  closeContext: () => {
@@ -2015,13 +2040,19 @@ var q = class e {
2015
2040
  this.deliveryClosed = !1, await this.syncSender(), this.bus?.rotateContext();
2016
2041
  },
2017
2042
  endRotation: (e) => {
2018
- this.rotating = e !== this.rotationSeq;
2043
+ if (this.rotating = e !== this.rotationSeq, this.rotating) {
2044
+ this.dropHeldRecords();
2045
+ return;
2046
+ }
2047
+ let t = this.heldDiagnostics;
2048
+ this.heldDiagnostics = [];
2049
+ for (let e of t) this.recordDiagnostic(e);
2019
2050
  },
2020
2051
  route: (e) => {
2021
2052
  this.route(e);
2022
2053
  },
2023
2054
  adopt: async (e) => {
2024
- this.config.enabled ? await this.sender?.adopt(e, this.config.securityContext.id) : this.carried = [...e];
2055
+ !this.config.enabled || this.destroyed ? this.carried = [...e] : await this.sender?.adopt(e, this.config.securityContext.id);
2025
2056
  }
2026
2057
  };
2027
2058
  }
@@ -2034,13 +2065,13 @@ var q = class e {
2034
2065
  this.parkedSender = e, await this.diagnostics.guardAsync("pipeline.crashed", "The delivery stack of the old context did not stop. The next rotation that succeeds retires it.", () => e.pause(this.config.securityContext.id));
2035
2066
  }
2036
2067
  async debugBundle(e) {
2037
- let { configSummary: t } = await import("./debug-bundle-CRpYV_ui.js"), { record: n } = this.builder.build({
2068
+ let { configSummary: t } = await import("./debug-bundle-Cs_YWzTa.js"), { record: n } = this.builder.build({
2038
2069
  level: "INFO",
2039
2070
  type: "system",
2040
2071
  body: "debug bundle",
2041
- namespace: c,
2072
+ namespace: ae,
2042
2073
  payload: { [y]: this.breadcrumbs.snapshot() }
2043
- }, !0), r = n?.attributes ?? {}, i = r[y], a = r[T];
2074
+ }, !0), r = n?.attributes ?? {}, i = r[y], a = r[w];
2044
2075
  return {
2045
2076
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2046
2077
  sdkVersion: this.sdkVersion,
@@ -2057,7 +2088,7 @@ var q = class e {
2057
2088
  let e = this.sender?.stats(), t = [];
2058
2089
  this.mismatchVersion && t.push("runtime.version_mismatch"), this.contextMismatch && t.push("security.context_mismatch");
2059
2090
  let { redact: n, processors: r } = this.config;
2060
- (n === F || r.includes(F)) && t.push("records.refused"), this.deliveryClosed ? t.push("security.rotation_failed") : this.ready && this.config.enabled && this.hasDestination() && this.role() === "sender" && !this.sender && t.push("sender.unavailable");
2091
+ (n === N || r.includes(N)) && t.push("records.refused"), this.deliveryClosed ? t.push("security.rotation_failed") : this.ready && this.config.enabled && this.hasDestination() && this.role() === "sender" && !this.sender && t.push("sender.unavailable");
2061
2092
  let { sourcePolicy: i, maxMessageBytes: a, maxRecordsPerMessage: o, maxMessagesPerSecond: s } = this.config.bus;
2062
2093
  return {
2063
2094
  delivery: {
@@ -2101,12 +2132,12 @@ var q = class e {
2101
2132
  return this.flushFor(this.flushTimeout(e), !0);
2102
2133
  }
2103
2134
  async flushFor(e, t) {
2104
- R(this), t && this.collectPoints();
2135
+ I(this), t && this.collectPoints();
2105
2136
  let n = this.idle();
2106
2137
  if (n) return n;
2107
2138
  let r = Date.now() + e, i, a = new Promise((t) => {
2108
2139
  let n = setTimeout(t, e);
2109
- O(n), i = () => {
2140
+ E(n), i = () => {
2110
2141
  clearTimeout(n);
2111
2142
  };
2112
2143
  });
@@ -2118,26 +2149,26 @@ var q = class e {
2118
2149
  }
2119
2150
  async flushBefore(e, t) {
2120
2151
  let n = this.heldRecords(), r = this.ready ? this.senderLoad : this.started;
2121
- if (r && (!this.ready || !this.sender) && !await Promise.race([r.then(() => !0), t.then(() => !1)])) return K({ pending: this.waiting() });
2152
+ if (r && (!this.ready || !this.sender) && !await Promise.race([r.then(() => !0), t.then(() => !1)])) return W({ pending: this.waiting() });
2122
2153
  let { bus: i } = this, a = i?.getRole() === "forwarder", o = this.idle();
2123
2154
  if (o) return o;
2124
2155
  if (a) {
2125
- let n = this.forwardBuffer.length, r = this.sendForwarded(), a = n - r, o = Math.floor(Math.max(0, e - Date.now()) * xe), s = await i.requestFlush(o, t);
2156
+ let n = this.forwardBuffer.length, r = this.sendForwarded(), a = n - r, o = Math.floor(Math.max(0, e - Date.now()) * fe), s = await i.requestFlush(o, t);
2126
2157
  return s ? {
2127
2158
  ...s,
2128
2159
  forwarded: r,
2129
2160
  dropped: s.dropped + a
2130
- } : K({
2161
+ } : W({
2131
2162
  forwarded: r,
2132
2163
  pending: r,
2133
2164
  dropped: a
2134
2165
  });
2135
2166
  }
2136
2167
  let { sender: s } = this;
2137
- return s ? K(await s.flushUntil(t)) : this.rotating ? K({ pending: n + this.waiting() }) : zn("complete", { dropped: n });
2168
+ return s ? W(await s.flushUntil(t)) : this.rotating ? W({ pending: n + this.waiting() }) : Hn("complete", { dropped: n });
2138
2169
  }
2139
2170
  idle() {
2140
- return this.tunablesLocked && this.config.enabled && !this.destroyed ? null : zn("inactive", { pending: this.destroyed ? 0 : this.waiting() });
2171
+ return this.tunablesLocked && this.config.enabled && !this.destroyed ? null : Hn("inactive", { pending: this.destroyed ? 0 : this.waiting() });
2141
2172
  }
2142
2173
  heldRecords() {
2143
2174
  return this.bootBuffer.length + this.pendingRecords.length + this.forwardBuffer.length;
@@ -2155,34 +2186,34 @@ var q = class e {
2155
2186
  else return this.diagnostics.guard("config.invalid", t, () => ({ ...e }));
2156
2187
  }
2157
2188
  flushTimeout(e) {
2158
- let t = this.readOptions(e, Nn);
2159
- if (!t) return ae;
2189
+ let t = this.readOptions(e, In);
2190
+ if (!t) return Se;
2160
2191
  let n = t.timeoutMs ?? 5e3;
2161
- return typeof n == "number" && n >= 0 && n <= 6e5 ? n : (this.diagnostics.report("config.invalid", Nn), ae);
2192
+ return typeof n == "number" && n >= 0 && n <= 6e5 ? n : (this.diagnostics.report("config.invalid", In), Se);
2162
2193
  }
2163
2194
  };
2164
- k(q, "local", null);
2165
- function J(e, t, n = /* @__PURE__ */ new WeakMap()) {
2195
+ D(K, "local", null);
2196
+ function q(e, t, n = /* @__PURE__ */ new WeakMap()) {
2166
2197
  if (Object.is(e, t)) return !0;
2167
2198
  if (e instanceof RegExp && t instanceof RegExp) return String(e) === String(t);
2168
2199
  if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
2169
2200
  if (n.has(e)) return n.get(e) === t;
2170
2201
  n.set(e, t);
2171
2202
  let r = Object.keys(e), i = Object.keys(t);
2172
- return r.length === i.length && r.every((r) => ze(t, r) && J(Reflect.get(e, r), Reflect.get(t, r), n));
2203
+ return r.length === i.length && r.every((r) => Ve(t, r) && q(Reflect.get(e, r), Reflect.get(t, r), n));
2173
2204
  }
2174
2205
  // src/transport/worker-entry.ts
2175
- var Y;
2176
- function Vn(e = {}) {
2177
- if (Y) return Y;
2178
- let t = new V(e.onDiagnostic);
2206
+ var J;
2207
+ function Un(e = {}) {
2208
+ if (J) return J;
2209
+ let t = new z(e.onDiagnostic);
2179
2210
  if (typeof document < "u" || typeof addEventListener != "function") return t.report("config.invalid", "Call serveTransportWorker() in a dedicated worker."), () => void 0;
2180
2211
  let n = !1, r, i, a = (e) => {
2181
2212
  t.guard("transport.http_error", "The transport worker could not read its connection.", () => {
2182
2213
  let a = e.data;
2183
- if (!D(a) || a.p !== "ui-observability.transport/1" || a.t !== we.connect || e.ports.length === 0) return;
2214
+ if (!T(a) || a.p !== "ui-observability.transport/1" || a.t !== ke.connect || e.ports.length === 0) return;
2184
2215
  let o = e.ports[0];
2185
- r || a.v !== "1.0.0" ? (o.postMessage(_e), o.close()) : (r = o, import("./worker-server-iUVSjH8L.js").then((e) => {
2216
+ r || a.v !== "1.1.0" ? (o.postMessage(_e), o.close()) : (r = o, import("./worker-server-BokySIII.js").then((e) => {
2186
2217
  n || (i = e.serveWorkerPort(o, t));
2187
2218
  }).catch((e) => {
2188
2219
  t.report("transport.http_error", "The transport worker delivery module could not load.", void 0, e), t.guard("transport.http_error", "The failed transport port could not be closed.", () => {
@@ -2191,16 +2222,16 @@ function Vn(e = {}) {
2191
2222
  }));
2192
2223
  });
2193
2224
  }, o = () => {
2194
- n || (n = !0, Y = void 0, removeEventListener("message", a), i?.(), t.guard("transport.http_error", "The transport service could not close its port.", () => {
2225
+ n || (n = !0, J = void 0, removeEventListener("message", a), i?.(), t.guard("transport.http_error", "The transport service could not close its port.", () => {
2195
2226
  r?.postMessage(_e);
2196
2227
  }), t.guard("transport.http_error", "The transport port could not close.", () => {
2197
2228
  r?.close();
2198
2229
  }));
2199
2230
  };
2200
- return addEventListener("message", a), Y = o, o;
2231
+ return addEventListener("message", a), J = o, o;
2201
2232
  }
2202
2233
  // src/transport/memory-transport.ts
2203
- function Hn() {
2234
+ function Wn() {
2204
2235
  let e = [], t = [], n = { status: 200 };
2205
2236
  return {
2206
2237
  transport: (r) => (e.push(r), n.status >= 200 && n.status < 300 && t.push(r), Promise.resolve({ ...n })),
@@ -2218,160 +2249,160 @@ function Hn() {
2218
2249
  };
2219
2250
  }
2220
2251
  // src/index.ts
2221
- var X = /* @__PURE__ */ new Map();
2222
- function Z() {
2223
- return (q.current() ?? q.stopped()) || q.configure({}, !0);
2252
+ var Y = /* @__PURE__ */ new Map();
2253
+ function X() {
2254
+ return (K.current() ?? K.stopped()) || K.configure({}, !0);
2224
2255
  }
2225
- function Un(e) {
2226
- q.configure(e), Q();
2256
+ function Gn(e) {
2257
+ K.configure(e), Z();
2227
2258
  }
2228
- function Wn(e) {
2229
- Z().setConfigurationLocked(e);
2259
+ function Kn(e) {
2260
+ X().setConfigurationLocked(e);
2230
2261
  }
2231
- function Gn(e, t) {
2232
- return Z().rotateSecurityContext(e, t);
2262
+ function qn(e, t) {
2263
+ return X().rotateSecurityContext(e, t);
2233
2264
  }
2234
- async function Kn() {
2235
- let e = Z();
2236
- return Q(), {
2265
+ async function Jn() {
2266
+ let e = X();
2267
+ return Z(), {
2237
2268
  ...await e.health(),
2238
2269
  loggerCache: {
2239
2270
  ...e.config.loggerCache,
2240
- size: X.size
2271
+ size: Y.size
2241
2272
  }
2242
2273
  };
2243
2274
  }
2244
- async function qn() {
2245
- let e = await Kn();
2246
- return Z().debugBundle(e);
2275
+ async function Yn() {
2276
+ let e = await Jn();
2277
+ return X().debugBundle(e);
2247
2278
  }
2248
- function Q() {
2249
- let e = (q.current() ?? q.stopped())?.config.loggerCache.maxEntries, t = e === void 0 ? 256 : e;
2250
- if (t !== null) for (let e of X.keys()) {
2251
- if (X.size <= t) break;
2252
- X.delete(e);
2279
+ function Z() {
2280
+ let e = (K.current() ?? K.stopped())?.config.loggerCache.maxEntries, t = e === void 0 ? 256 : e;
2281
+ if (t !== null) for (let e of Y.keys()) {
2282
+ if (Y.size <= t) break;
2283
+ Y.delete(e);
2253
2284
  }
2254
2285
  return t;
2255
2286
  }
2256
- function Jn(e, t) {
2257
- let n = Q();
2258
- if (t || n === 0) return new B(Z, e, t);
2259
- let r = X.get(e);
2260
- return r ??= new B(Z, e), X.delete(e), X.set(e, r), Q(), r;
2261
- }
2262
- function $() {
2263
- return Jn("app");
2264
- }
2265
- function Yn(e, t) {
2266
- $().trace(e, t);
2267
- }
2268
2287
  function Xn(e, t) {
2269
- $().debug(e, t);
2288
+ let n = Z();
2289
+ if (t || n === 0) return new R(X, e, t);
2290
+ let r = Y.get(e);
2291
+ return r ??= new R(X, e), Y.delete(e), Y.set(e, r), Z(), r;
2292
+ }
2293
+ function Q() {
2294
+ return Xn("app");
2270
2295
  }
2271
2296
  function Zn(e, t) {
2272
- $().info(e, t);
2297
+ Q().trace(e, t);
2273
2298
  }
2274
2299
  function Qn(e, t) {
2275
- $().warn(e, t);
2300
+ Q().debug(e, t);
2301
+ }
2302
+ function $n(e, t) {
2303
+ Q().info(e, t);
2276
2304
  }
2277
- function $n(e, t, n) {
2278
- $().error(e, t, n);
2305
+ function er(e, t) {
2306
+ Q().warn(e, t);
2279
2307
  }
2280
- function er(e, t, n) {
2281
- $().fatal(e, t, n);
2308
+ function tr(e, t, n) {
2309
+ Q().error(e, t, n);
2282
2310
  }
2283
- function tr(e, t) {
2284
- $().logAction(e, t);
2311
+ function nr(e, t, n) {
2312
+ Q().fatal(e, t, n);
2285
2313
  }
2286
- function nr(e, t) {
2287
- $().logEvent(e, t);
2314
+ function rr(e, t) {
2315
+ Q().logAction(e, t);
2288
2316
  }
2289
- function rr(e) {
2290
- q.current()?.diagnostics.report("config.invalid", Ae, void 0, e);
2317
+ function ir(e, t) {
2318
+ Q().logEvent(e, t);
2291
2319
  }
2292
- function ir(e, t = {}) {
2293
- return Vt(e, t, (e, t, n) => {
2294
- Z().recordMetric(e, t, n);
2295
- }, rr);
2320
+ function $(e) {
2321
+ K.current()?.diagnostics.report("config.invalid", _, void 0, e);
2296
2322
  }
2297
2323
  function ar(e, t = {}) {
2298
- return Ht(e, t, (e, t, n) => {
2299
- Z().recordMetric(e, t, n);
2300
- }, rr);
2324
+ return Wt(e, t, (e, t, n) => {
2325
+ X().recordMetric(e, t, n);
2326
+ }, $);
2301
2327
  }
2302
2328
  function or(e, t = {}) {
2303
- return Ut(e, t, (e, t, n) => {
2304
- Z().recordMetric(e, t, n);
2305
- }, rr);
2329
+ return Gt(e, t, (e, t, n) => {
2330
+ X().recordMetric(e, t, n);
2331
+ }, $);
2306
2332
  }
2307
- function sr(e, t) {
2308
- return Z().startMeasure(e, t);
2333
+ function sr(e, t = {}) {
2334
+ return Kt(e, t, (e, t, n) => {
2335
+ X().recordMetric(e, t, n);
2336
+ }, $);
2309
2337
  }
2310
- function cr(e, t, n) {
2311
- let r = Z();
2312
- return Mt(r.startMeasure(e, n), t, r.diagnostics);
2338
+ function cr(e, t) {
2339
+ return X().startMeasure(e, t);
2313
2340
  }
2314
- function lr() {
2315
- Z().setReplay(!0);
2341
+ function lr(e, t, n) {
2342
+ let r = X();
2343
+ return Ft(r.startMeasure(e, n), t, r.diagnostics);
2316
2344
  }
2317
2345
  function ur() {
2318
- Z().setReplay(!1);
2346
+ X().setReplay(!0);
2319
2347
  }
2320
- var dr = {
2321
- probe: (e, t) => j().probe(e, t, q.current()?.diagnostics),
2322
- time: (e, t) => j().time(e, t, q.current()?.diagnostics)
2348
+ function dr() {
2349
+ X().setReplay(!1);
2350
+ }
2351
+ var fr = {
2352
+ probe: (e, t) => k().probe(e, t, K.current()?.diagnostics),
2353
+ time: (e, t) => k().time(e, t, K.current()?.diagnostics)
2323
2354
  };
2324
- function fr(e, t) {
2325
- Z().addBreadcrumb(e, t);
2355
+ function pr(e, t) {
2356
+ X().addBreadcrumb(e, t);
2326
2357
  }
2327
- function pr(e) {
2328
- let t = Z();
2329
- D(e) ? t.diagnostics.guard("record.sanitize_failed", "The library could not read the values of setContext().", () => {
2358
+ function mr(e) {
2359
+ let t = X();
2360
+ T(e) ? t.diagnostics.guard("record.sanitize_failed", "The library could not read the values of setContext().", () => {
2330
2361
  t.context.merge(e);
2331
2362
  }) : t.diagnostics.report("config.invalid", "setContext() takes an object. The library keeps the current context.");
2332
2363
  }
2333
- function mr(e) {
2334
- Z().context.remove(e);
2335
- }
2336
- function hr(e, t) {
2337
- return Z().journey.start(e, t);
2364
+ function hr(e) {
2365
+ X().context.remove(e);
2338
2366
  }
2339
- function gr() {
2340
- Z().journey.end();
2367
+ function gr(e, t) {
2368
+ return X().journey.start(e, t);
2341
2369
  }
2342
2370
  function _r() {
2343
- return Z().journey.current();
2371
+ X().journey.end();
2344
2372
  }
2345
2373
  function vr() {
2346
- return Z().journey.getToken();
2374
+ return X().journey.current();
2347
2375
  }
2348
- function yr(e) {
2349
- return Z().journey.adopt(e, "manual", !0);
2376
+ function yr() {
2377
+ return X().journey.getToken();
2350
2378
  }
2351
- function br(e, t) {
2352
- return Z().registerWorker(e, t);
2379
+ function br(e) {
2380
+ return X().journey.adopt(e, "manual", !0);
2353
2381
  }
2354
2382
  function xr(e, t) {
2355
- return Z().registerFrame(e, t);
2383
+ return X().registerWorker(e, t);
2356
2384
  }
2357
- function Sr() {
2358
- Z().tracing.rotate("explicit");
2385
+ function Sr(e, t) {
2386
+ return X().registerFrame(e, t);
2359
2387
  }
2360
2388
  function Cr() {
2361
- return Z().tracing.headers();
2389
+ X().tracing.rotate("explicit");
2362
2390
  }
2363
- function wr(e) {
2364
- return Z().flush(e);
2391
+ function wr() {
2392
+ return X().tracing.headers();
2365
2393
  }
2366
- function Tr() {
2367
- Z().newSession();
2394
+ function Tr(e) {
2395
+ return X().flush(e);
2368
2396
  }
2369
2397
  function Er() {
2370
- return Z().diagnostics.snapshot();
2398
+ X().newSession();
2399
+ }
2400
+ function Dr() {
2401
+ return X().diagnostics.snapshot();
2371
2402
  }
2372
- async function Dr(e) {
2373
- await (q.current() ?? q.stopped())?.destroy(e);
2403
+ async function Or(e) {
2404
+ await (K.current() ?? K.stopped())?.destroy(e);
2374
2405
  }
2375
- export { fr as addBreadcrumb, yr as adoptJourney, qn as collectDebugBundle, Un as configure, ir as counter, Hn as createMemoryTransport, _r as currentJourney, Xn as debug, gr as endJourney, $n as error, er as fatal, wr as flush, ar as gauge, Er as getDiagnosticCounters, Kn as getHealth, vr as getJourneyToken, Jn as getLogger, Cr as getTraceHeaders, or as histogram, Zn as info, tr as logAction, nr as logEvent, cr as measure, Tr as newSession, Sr as newTrace, dr as profiler, xr as registerFrame, br as registerWorker, mr as removeContext, Gn as rotateSecurityContext, Vn as serveTransportWorker, Wn as setConfigurationLocked, pr as setContext, Dr as shutdown, hr as startJourney, sr as startMeasure, lr as startReplay, ur as stopReplay, Yn as trace, Qn as warn };
2406
+ export { pr as addBreadcrumb, br as adoptJourney, Yn as collectDebugBundle, Gn as configure, ar as counter, Wn as createMemoryTransport, vr as currentJourney, Qn as debug, _r as endJourney, tr as error, nr as fatal, Tr as flush, or as gauge, Dr as getDiagnosticCounters, Jn as getHealth, yr as getJourneyToken, Xn as getLogger, wr as getTraceHeaders, sr as histogram, $n as info, rr as logAction, ir as logEvent, lr as measure, Er as newSession, Cr as newTrace, ut as observeWindow, fr as profiler, Sr as registerFrame, xr as registerWorker, hr as removeContext, qn as rotateSecurityContext, Un as serveTransportWorker, Kn as setConfigurationLocked, mr as setContext, Or as shutdown, gr as startJourney, cr as startMeasure, ur as startReplay, dr as stopReplay, Zn as trace, er as warn };
2376
2407
 
2377
2408
  //# sourceMappingURL=index.js.map