@utk09/ui-observability 1.1.0 → 1.2.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 (271) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{batch-D3NHhF9L.js → batch-120Kc9jr.js} +3 -3
  3. package/dist/{batch-D3NHhF9L.js.map → batch-120Kc9jr.js.map} +1 -1
  4. package/dist/{batch-DnYRJqhU.cjs → batch-C3uNp5kU.cjs} +2 -2
  5. package/dist/{batch-DnYRJqhU.cjs.map → batch-C3uNp5kU.cjs.map} +1 -1
  6. package/dist/bus/bus.d.cts +5 -0
  7. package/dist/bus/bus.d.ts +5 -0
  8. package/dist/bus-Dj8IEVcC.cjs +2 -0
  9. package/dist/bus-Dj8IEVcC.cjs.map +1 -0
  10. package/dist/{bus-dw7T92sO.js → bus-DyNafxZN.js} +104 -94
  11. package/dist/bus-DyNafxZN.js.map +1 -0
  12. package/dist/capture/errors.d.cts +10 -0
  13. package/dist/capture/errors.d.ts +10 -0
  14. package/dist/capture/replay.d.cts +1 -1
  15. package/dist/capture/replay.d.ts +1 -1
  16. package/dist/capture/types.d.cts +5 -0
  17. package/dist/capture/types.d.ts +5 -0
  18. package/dist/capture/web-vitals.d.cts +1 -0
  19. package/dist/capture/web-vitals.d.ts +1 -0
  20. package/dist/{compression-SHPAvS4U.js → compression-BWkDWY3v.js} +2 -2
  21. package/dist/{compression-SHPAvS4U.js.map → compression-BWkDWY3v.js.map} +1 -1
  22. package/dist/{compression-C0hUHKR-.cjs → compression-CEVe7NPX.cjs} +2 -2
  23. package/dist/{compression-C0hUHKR-.cjs.map → compression-CEVe7NPX.cjs.map} +1 -1
  24. package/dist/config-C0PtemvC.cjs +2 -0
  25. package/dist/config-C0PtemvC.cjs.map +1 -0
  26. package/dist/{config-CSNcS7OZ.js → config-DK1Zf7jn.js} +83 -85
  27. package/dist/config-DK1Zf7jn.js.map +1 -0
  28. package/dist/{console-BsM-fSCQ.js → console-CAyCQOpm.js} +5 -5
  29. package/dist/{console-BsM-fSCQ.js.map → console-CAyCQOpm.js.map} +1 -1
  30. package/dist/{console-Dkxs6IVQ.cjs → console-Dk6GH4yj.cjs} +2 -2
  31. package/dist/{console-Dkxs6IVQ.cjs.map → console-Dk6GH4yj.cjs.map} +1 -1
  32. package/dist/{constants-BwJDXzj6.js → constants-CEHN6KuY.js} +42 -21
  33. package/dist/constants-CEHN6KuY.js.map +1 -0
  34. package/dist/constants-NtiQDWL_.cjs +2 -0
  35. package/dist/constants-NtiQDWL_.cjs.map +1 -0
  36. package/dist/constants.d.cts +11 -0
  37. package/dist/constants.d.ts +11 -0
  38. package/dist/core/config.d.cts +9 -3
  39. package/dist/core/config.d.ts +9 -3
  40. package/dist/core/diagnostics.d.cts +1 -1
  41. package/dist/core/diagnostics.d.ts +1 -1
  42. package/dist/core/pipeline.d.cts +11 -0
  43. package/dist/core/pipeline.d.ts +11 -0
  44. package/dist/core/record.d.cts +2 -2
  45. package/dist/core/record.d.ts +2 -2
  46. package/dist/core/sender.d.cts +3 -2
  47. package/dist/core/sender.d.ts +3 -2
  48. package/dist/{debug-bundle-B2v6Cym-.cjs → debug-bundle-DMzUfiQc.cjs} +2 -2
  49. package/dist/{debug-bundle-B2v6Cym-.cjs.map → debug-bundle-DMzUfiQc.cjs.map} +1 -1
  50. package/dist/{debug-bundle-Cs_YWzTa.js → debug-bundle-w78W46zr.js} +4 -4
  51. package/dist/{debug-bundle-Cs_YWzTa.js.map → debug-bundle-w78W46zr.js.map} +1 -1
  52. package/dist/doctor.cjs +1 -1
  53. package/dist/doctor.js +22 -22
  54. package/dist/doctor.js.map +1 -1
  55. package/dist/errors-07pmZ7VY.cjs +3 -0
  56. package/dist/errors-07pmZ7VY.cjs.map +1 -0
  57. package/dist/{errors-Q3Ng1ciC.js → errors-C-LYbqyB.js} +27 -24
  58. package/dist/errors-C-LYbqyB.js.map +1 -0
  59. package/dist/{factory-DV17sm2p.js → factory-BHYrcSaU.js} +42 -31
  60. package/dist/factory-BHYrcSaU.js.map +1 -0
  61. package/dist/factory-DsaNdcXp.cjs +2 -0
  62. package/dist/factory-DsaNdcXp.cjs.map +1 -0
  63. package/dist/{identity-BgtHyY4u.js → identity-Byh3gCdT.js} +11 -11
  64. package/dist/{identity-BgtHyY4u.js.map → identity-Byh3gCdT.js.map} +1 -1
  65. package/dist/{identity-CvuyqZk7.cjs → identity-BzAzdQyv.cjs} +2 -2
  66. package/dist/{identity-CvuyqZk7.cjs.map → identity-BzAzdQyv.cjs.map} +1 -1
  67. package/dist/index.cjs +1 -1
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.js +539 -534
  70. package/dist/index.js.map +1 -1
  71. package/dist/{indexeddb-storage-e-13ZLWm.js → indexeddb-storage-BYywz-v6.js} +4 -4
  72. package/dist/{indexeddb-storage-e-13ZLWm.js.map → indexeddb-storage-BYywz-v6.js.map} +1 -1
  73. package/dist/{indexeddb-storage-D4KVcqdD.cjs → indexeddb-storage-BfqGkLFe.cjs} +2 -2
  74. package/dist/{indexeddb-storage-D4KVcqdD.cjs.map → indexeddb-storage-BfqGkLFe.cjs.map} +1 -1
  75. package/dist/{interactions-OK85T-Dk.cjs → interactions-BXzEel4F.cjs} +2 -2
  76. package/dist/interactions-BXzEel4F.cjs.map +1 -0
  77. package/dist/{interactions-Byxf1C82.js → interactions-DdKPMWIN.js} +12 -12
  78. package/dist/interactions-DdKPMWIN.js.map +1 -0
  79. package/dist/{journey-nMbob3OB.cjs → journey-BUmsrgaw.cjs} +2 -2
  80. package/dist/{journey-nMbob3OB.cjs.map → journey-BUmsrgaw.cjs.map} +1 -1
  81. package/dist/{journey-C93FTYcs.js → journey-Nu655gEO.js} +3 -3
  82. package/dist/{journey-C93FTYcs.js.map → journey-Nu655gEO.js.map} +1 -1
  83. package/dist/{library-console-DJUQzcgM.cjs → library-console-DdIlzzph.cjs} +2 -2
  84. package/dist/{library-console-DJUQzcgM.cjs.map → library-console-DdIlzzph.cjs.map} +1 -1
  85. package/dist/{library-console-DklSmucS.js → library-console-amePMnP8.js} +2 -2
  86. package/dist/{library-console-DklSmucS.js.map → library-console-amePMnP8.js.map} +1 -1
  87. package/dist/{library-request-UGEwOHpf.js → library-request-Cv7C05jf.js} +2 -2
  88. package/dist/{library-request-UGEwOHpf.js.map → library-request-Cv7C05jf.js.map} +1 -1
  89. package/dist/{library-request-kY9iTpIF.cjs → library-request-DO3Ec7KE.cjs} +2 -2
  90. package/dist/{library-request-kY9iTpIF.cjs.map → library-request-DO3Ec7KE.cjs.map} +1 -1
  91. package/dist/{lifecycle-DaMdH_X7.cjs → lifecycle-B5yfH5is.cjs} +2 -2
  92. package/dist/{lifecycle-DaMdH_X7.cjs.map → lifecycle-B5yfH5is.cjs.map} +1 -1
  93. package/dist/{lifecycle-B2PlIuQu.js → lifecycle-CMHz2Zbs.js} +2 -2
  94. package/dist/{lifecycle-B2PlIuQu.js.map → lifecycle-CMHz2Zbs.js.map} +1 -1
  95. package/dist/{log-record-DSt2P-Sr.js → log-record-B_nSqxoe.js} +2 -2
  96. package/dist/{log-record-DSt2P-Sr.js.map → log-record-B_nSqxoe.js.map} +1 -1
  97. package/dist/{log-record-Bmx6etMh.cjs → log-record-Bdywwg0k.cjs} +2 -2
  98. package/dist/{log-record-Bmx6etMh.cjs.map → log-record-Bdywwg0k.cjs.map} +1 -1
  99. package/dist/{long-frames-Bamjs1WV.js → long-frames-6NGl1-uN.js} +3 -3
  100. package/dist/{long-frames-Bamjs1WV.js.map → long-frames-6NGl1-uN.js.map} +1 -1
  101. package/dist/{long-frames-lhtONgGt.cjs → long-frames-D9DfSWqv.cjs} +2 -2
  102. package/dist/{long-frames-lhtONgGt.cjs.map → long-frames-D9DfSWqv.cjs.map} +1 -1
  103. package/dist/models/config.d.cts +4 -3
  104. package/dist/models/config.d.ts +4 -3
  105. package/dist/{network-BCn8Gn47.cjs → network-BNHBI0Fc.cjs} +2 -2
  106. package/dist/{network-BCn8Gn47.cjs.map → network-BNHBI0Fc.cjs.map} +1 -1
  107. package/dist/{network-Cg1L2w2r.js → network-Cc3tSB7e.js} +13 -13
  108. package/dist/{network-Cg1L2w2r.js.map → network-Cc3tSB7e.js.map} +1 -1
  109. package/dist/{observed-windows-BrwaJNlj.js → observed-windows-8JtCsIr1.js} +3 -3
  110. package/dist/{observed-windows-BrwaJNlj.js.map → observed-windows-8JtCsIr1.js.map} +1 -1
  111. package/dist/{observed-windows-B3gJkdql.cjs → observed-windows-BlE25nrn.cjs} +2 -2
  112. package/dist/{observed-windows-B3gJkdql.cjs.map → observed-windows-BlE25nrn.cjs.map} +1 -1
  113. package/dist/openfin-Bxelt0yg.js.map +1 -1
  114. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  115. package/dist/{otlp-D6dRZyB8.js → otlp-Btix3EBa.js} +7 -7
  116. package/dist/{otlp-D6dRZyB8.js.map → otlp-Btix3EBa.js.map} +1 -1
  117. package/dist/{otlp-CrAWkQdO.cjs → otlp-CFSW-Dno.cjs} +2 -2
  118. package/dist/{otlp-CrAWkQdO.cjs.map → otlp-CFSW-Dno.cjs.map} +1 -1
  119. package/dist/patch-DlcKzIi-.cjs +2 -0
  120. package/dist/patch-DlcKzIi-.cjs.map +1 -0
  121. package/dist/patch-Sr1wKg7W.js +9 -0
  122. package/dist/patch-Sr1wKg7W.js.map +1 -0
  123. package/dist/platform-BZjp9wp1.cjs +2 -0
  124. package/dist/platform-BZjp9wp1.cjs.map +1 -0
  125. package/dist/{platform-8DLhjddo.js → platform-Dba6R3Hp.js} +22 -9
  126. package/dist/platform-Dba6R3Hp.js.map +1 -0
  127. package/dist/{profiler-BaXSqCfz.js → profiler-DNKcqu09.js} +19 -19
  128. package/dist/{profiler-BaXSqCfz.js.map → profiler-DNKcqu09.js.map} +1 -1
  129. package/dist/{profiler-BvWW2kNM.cjs → profiler-DpoPi1hH.cjs} +2 -2
  130. package/dist/{profiler-BvWW2kNM.cjs.map → profiler-DpoPi1hH.cjs.map} +1 -1
  131. package/dist/{profiler-frames-DeaBiB-5.cjs → profiler-frames-C9zJNd8_.cjs} +2 -2
  132. package/dist/{profiler-frames-DeaBiB-5.cjs.map → profiler-frames-C9zJNd8_.cjs.map} +1 -1
  133. package/dist/{profiler-frames-C4ySHN0X.js → profiler-frames-CGXZeZ_3.js} +4 -4
  134. package/dist/{profiler-frames-C4ySHN0X.js.map → profiler-frames-CGXZeZ_3.js.map} +1 -1
  135. package/dist/{remote-rules-Dq9xe7Qn.js → remote-rules-DNK96vLa.js} +15 -15
  136. package/dist/{remote-rules-Dq9xe7Qn.js.map → remote-rules-DNK96vLa.js.map} +1 -1
  137. package/dist/{remote-rules-D7L6D_D2.cjs → remote-rules-DuMFRlit.cjs} +2 -2
  138. package/dist/{remote-rules-D7L6D_D2.cjs.map → remote-rules-DuMFRlit.cjs.map} +1 -1
  139. package/dist/replay-Cab-lSit.cjs +2 -0
  140. package/dist/replay-Cab-lSit.cjs.map +1 -0
  141. package/dist/{replay-B0M8kWz_.js → replay-Dy6OiaOZ.js} +89 -62
  142. package/dist/replay-Dy6OiaOZ.js.map +1 -0
  143. package/dist/{reports-ojuMKGO7.cjs → reports-CGK9YQch.cjs} +2 -2
  144. package/dist/{reports-ojuMKGO7.cjs.map → reports-CGK9YQch.cjs.map} +1 -1
  145. package/dist/{reports--8APRLa-.js → reports-CX57-S9s.js} +3 -3
  146. package/dist/{reports--8APRLa-.js.map → reports-CX57-S9s.js.map} +1 -1
  147. package/dist/{resource-timing-BzR05rE-.js → resource-timing-CWVDCbrY.js} +4 -4
  148. package/dist/{resource-timing-BzR05rE-.js.map → resource-timing-CWVDCbrY.js.map} +1 -1
  149. package/dist/{resource-timing-pAG3ZhB5.cjs → resource-timing-DalulXiR.cjs} +2 -2
  150. package/dist/{resource-timing-pAG3ZhB5.cjs.map → resource-timing-DalulXiR.cjs.map} +1 -1
  151. package/dist/response-body-Cpz5__4g.cjs +3 -0
  152. package/dist/response-body-Cpz5__4g.cjs.map +1 -0
  153. package/dist/{response-body-BWvwKQ2p.js → response-body-yi92Rpvo.js} +100 -100
  154. package/dist/response-body-yi92Rpvo.js.map +1 -0
  155. package/dist/{rotation-BylN1B9e.js → rotation-ChBbNDE2.js} +24 -24
  156. package/dist/rotation-ChBbNDE2.js.map +1 -0
  157. package/dist/rotation-fTnNJcfH.cjs +2 -0
  158. package/dist/rotation-fTnNJcfH.cjs.map +1 -0
  159. package/dist/{sampling-zXA6r-Nw.js → sampling-DZTOD28D.js} +6 -6
  160. package/dist/{sampling-zXA6r-Nw.js.map → sampling-DZTOD28D.js.map} +1 -1
  161. package/dist/{sampling-B46LW0cy.cjs → sampling-wAVJIZXp.cjs} +2 -2
  162. package/dist/{sampling-B46LW0cy.cjs.map → sampling-wAVJIZXp.cjs.map} +1 -1
  163. package/dist/{sanitize-DjnR6RXR.js → sanitize-B2GKlSFp.js} +2 -2
  164. package/dist/{sanitize-DjnR6RXR.js.map → sanitize-B2GKlSFp.js.map} +1 -1
  165. package/dist/{sanitize-Qj6LuZqp.cjs → sanitize-BZdhoghq.cjs} +2 -2
  166. package/dist/{sanitize-Qj6LuZqp.cjs.map → sanitize-BZdhoghq.cjs.map} +1 -1
  167. package/dist/{sender-Bdp-TAS4.js → sender-BRSpc7R8.js} +175 -161
  168. package/dist/sender-BRSpc7R8.js.map +1 -0
  169. package/dist/sender-CFu98DAB.cjs +2 -0
  170. package/dist/sender-CFu98DAB.cjs.map +1 -0
  171. package/dist/storage/emergency-queue.d.cts +3 -1
  172. package/dist/storage/emergency-queue.d.ts +3 -1
  173. package/dist/storage/stored-context.d.cts +3 -2
  174. package/dist/storage/stored-context.d.ts +3 -2
  175. package/dist/stored-context-CPLlzgpm.cjs +2 -0
  176. package/dist/stored-context-CPLlzgpm.cjs.map +1 -0
  177. package/dist/{stored-context-CSttrAsw.js → stored-context-df1dEnht.js} +10 -8
  178. package/dist/stored-context-df1dEnht.js.map +1 -0
  179. package/dist/{storm-DKlpv0FL.js → storm-U3_ek1nA.js} +2 -2
  180. package/dist/{storm-DKlpv0FL.js.map → storm-U3_ek1nA.js.map} +1 -1
  181. package/dist/{storm-BHgI12iS.cjs → storm-qiE_AMC7.cjs} +2 -2
  182. package/dist/{storm-BHgI12iS.cjs.map → storm-qiE_AMC7.cjs.map} +1 -1
  183. package/dist/transport/exit-flush.d.cts +23 -0
  184. package/dist/transport/exit-flush.d.ts +23 -0
  185. package/dist/transport/http-transport.d.cts +3 -2
  186. package/dist/transport/http-transport.d.ts +3 -2
  187. package/dist/transport/retry-engine.d.cts +11 -3
  188. package/dist/transport/retry-engine.d.ts +11 -3
  189. package/dist/types-BAerHgCq.js.map +1 -1
  190. package/dist/types-C7WNpnG1.cjs.map +1 -1
  191. package/dist/{unclean-exit-BcOB8A2e.js → unclean-exit-Bj6gYHeL.js} +2 -2
  192. package/dist/{unclean-exit-BcOB8A2e.js.map → unclean-exit-Bj6gYHeL.js.map} +1 -1
  193. package/dist/{unclean-exit-BYPYYkQ5.cjs → unclean-exit-CuBh-ee5.cjs} +2 -2
  194. package/dist/{unclean-exit-BYPYYkQ5.cjs.map → unclean-exit-CuBh-ee5.cjs.map} +1 -1
  195. package/dist/{user-timing-BsU2wQKE.cjs → user-timing-BWqzYF2Q.cjs} +2 -2
  196. package/dist/{user-timing-BsU2wQKE.cjs.map → user-timing-BWqzYF2Q.cjs.map} +1 -1
  197. package/dist/{user-timing-4KIJ74Vi.js → user-timing-Duz0d-OA.js} +2 -2
  198. package/dist/{user-timing-4KIJ74Vi.js.map → user-timing-Duz0d-OA.js.map} +1 -1
  199. package/dist/utils/lock.d.cts +3 -2
  200. package/dist/utils/lock.d.ts +3 -2
  201. package/dist/utils/openfin.d.cts +18 -6
  202. package/dist/utils/openfin.d.ts +18 -6
  203. package/dist/utils/patch.d.cts +1 -1
  204. package/dist/utils/patch.d.ts +1 -1
  205. package/dist/utils/platform.d.cts +6 -0
  206. package/dist/utils/platform.d.ts +6 -0
  207. package/dist/{web-socket-Zg0hj1LB.js → web-socket-CE_9Q22z.js} +5 -5
  208. package/dist/{web-socket-Zg0hj1LB.js.map → web-socket-CE_9Q22z.js.map} +1 -1
  209. package/dist/{web-socket-Cs1ZbmmN.cjs → web-socket-sm3rD-A_.cjs} +2 -2
  210. package/dist/{web-socket-Cs1ZbmmN.cjs.map → web-socket-sm3rD-A_.cjs.map} +1 -1
  211. package/dist/{web-vitals-4pWACwaR.js → web-vitals-CGwXGF-M.js} +4 -4
  212. package/dist/web-vitals-CGwXGF-M.js.map +1 -0
  213. package/dist/web-vitals-Df4Wsfx9.cjs +2 -0
  214. package/dist/web-vitals-Df4Wsfx9.cjs.map +1 -0
  215. package/dist/{worker-protocol-DFYXIFus.cjs → worker-protocol-D5VnCdWY.cjs} +2 -2
  216. package/dist/{worker-protocol-DFYXIFus.cjs.map → worker-protocol-D5VnCdWY.cjs.map} +1 -1
  217. package/dist/{worker-protocol-CYpAbrVl.js → worker-protocol-h4-tRWqy.js} +6 -6
  218. package/dist/{worker-protocol-CYpAbrVl.js.map → worker-protocol-h4-tRWqy.js.map} +1 -1
  219. package/dist/{worker-server--yGTadTA.cjs → worker-server-CF1yatXq.cjs} +2 -2
  220. package/dist/{worker-server--yGTadTA.cjs.map → worker-server-CF1yatXq.cjs.map} +1 -1
  221. package/dist/worker-server-FYfKHQhJ.js +94 -0
  222. package/dist/{worker-server-BokySIII.js.map → worker-server-FYfKHQhJ.js.map} +1 -1
  223. package/dist/{worker-transport-BdEvh_-a.cjs → worker-transport-COgY4RX8.cjs} +2 -2
  224. package/dist/{worker-transport-BdEvh_-a.cjs.map → worker-transport-COgY4RX8.cjs.map} +1 -1
  225. package/dist/{worker-transport-JK-Fby9J.js → worker-transport-jzX1IusG.js} +34 -34
  226. package/dist/{worker-transport-JK-Fby9J.js.map → worker-transport-jzX1IusG.js.map} +1 -1
  227. package/llms.txt +1 -2
  228. package/package.json +1 -1
  229. package/dist/bus-B__467mL.cjs +0 -2
  230. package/dist/bus-B__467mL.cjs.map +0 -1
  231. package/dist/bus-dw7T92sO.js.map +0 -1
  232. package/dist/config-CSNcS7OZ.js.map +0 -1
  233. package/dist/config-CybPP5VM.cjs +0 -2
  234. package/dist/config-CybPP5VM.cjs.map +0 -1
  235. package/dist/constants-BwJDXzj6.js.map +0 -1
  236. package/dist/constants-CtF52hIV.cjs +0 -2
  237. package/dist/constants-CtF52hIV.cjs.map +0 -1
  238. package/dist/errors-DP2RUm4V.cjs +0 -3
  239. package/dist/errors-DP2RUm4V.cjs.map +0 -1
  240. package/dist/errors-Q3Ng1ciC.js.map +0 -1
  241. package/dist/factory-DV17sm2p.js.map +0 -1
  242. package/dist/factory-K8O6gpux.cjs +0 -2
  243. package/dist/factory-K8O6gpux.cjs.map +0 -1
  244. package/dist/interactions-Byxf1C82.js.map +0 -1
  245. package/dist/interactions-OK85T-Dk.cjs.map +0 -1
  246. package/dist/patch-BX8KrPCT.cjs +0 -2
  247. package/dist/patch-BX8KrPCT.cjs.map +0 -1
  248. package/dist/patch-UdPz1ea8.js +0 -8
  249. package/dist/patch-UdPz1ea8.js.map +0 -1
  250. package/dist/platform-8DLhjddo.js.map +0 -1
  251. package/dist/platform-BqRc-7RO.cjs +0 -2
  252. package/dist/platform-BqRc-7RO.cjs.map +0 -1
  253. package/dist/replay-B0M8kWz_.js.map +0 -1
  254. package/dist/replay-QOFBpAXh.cjs +0 -2
  255. package/dist/replay-QOFBpAXh.cjs.map +0 -1
  256. package/dist/response-body-BWvwKQ2p.js.map +0 -1
  257. package/dist/response-body-CKEJ5itk.cjs +0 -3
  258. package/dist/response-body-CKEJ5itk.cjs.map +0 -1
  259. package/dist/rotation-BylN1B9e.js.map +0 -1
  260. package/dist/rotation-E2eKClIs.cjs +0 -2
  261. package/dist/rotation-E2eKClIs.cjs.map +0 -1
  262. package/dist/sender-Bdp-TAS4.js.map +0 -1
  263. package/dist/sender-DR7ZycZY.cjs +0 -2
  264. package/dist/sender-DR7ZycZY.cjs.map +0 -1
  265. package/dist/stored-context-BOu54M8Y.cjs +0 -2
  266. package/dist/stored-context-BOu54M8Y.cjs.map +0 -1
  267. package/dist/stored-context-CSttrAsw.js.map +0 -1
  268. package/dist/web-vitals-4pWACwaR.js.map +0 -1
  269. package/dist/web-vitals-__X7t4pj.cjs +0 -2
  270. package/dist/web-vitals-__X7t4pj.cjs.map +0 -1
  271. package/dist/worker-server-BokySIII.js +0 -94
@@ -1,27 +1,27 @@
1
- import { D as e, Mn as t, V as n, Z as r, an as i, dt as a, ft as o, g as s, gt as c, ht as l, l as u, mt as d, nt as f, on as p, pt as m, qn as h, ut as g } from "./constants-BwJDXzj6.js";
2
- import { c as _, d as v, f as ee, l as y, n as te, p as b, s as ne, t as re, u as ie } from "./factory-DV17sm2p.js";
3
- import { n as x, t as S } from "./deadline-C4ccAuk5.js";
4
- import { i as ae, r as C } from "./library-request-UGEwOHpf.js";
5
- import { t as w } from "./openfin-Bxelt0yg.js";
6
- import { t as T } from "./sanitize-DjnR6RXR.js";
7
- import { n as oe } from "./library-console-DklSmucS.js";
8
- import { a as se, c as E, f as D, i as ce, n as le, o as O, p as ue, r as de, s as k, t as fe } from "./response-body-BWvwKQ2p.js";
9
- import { t as A } from "./defineProperty-s2S8BXUc.js";
10
- import { r as j } from "./platform-8DLhjddo.js";
11
- import { t as M } from "./unref-DgHPQeWv.js";
12
- import { t as N } from "./compression-SHPAvS4U.js";
13
- import { a as P } from "./batch-D3NHhF9L.js";
14
- import { r as F } from "./log-record-DSt2P-Sr.js";
15
- import { i as I } from "./identity-BgtHyY4u.js";
16
- import { t as L } from "./sampling-zXA6r-Nw.js";
17
- import { n as R, t as z } from "./remote-rules-Dq9xe7Qn.js";
1
+ import { D as e, Jn as t, Nn as n, V as r, Z as i, an as a, dt as o, ft as s, g as c, gt as l, ht as u, l as d, mt as f, nt as p, on as m, pt as h, ut as g } from "./constants-CEHN6KuY.js";
2
+ import { c as _, d as v, f as ee, l as y, n as te, p as b, s as ne, t as re, u as ie } from "./factory-BHYrcSaU.js";
3
+ import { n as x, t as ae } from "./deadline-C4ccAuk5.js";
4
+ import { i as oe, r as S } from "./library-request-Cv7C05jf.js";
5
+ import { t as C } from "./openfin-Bxelt0yg.js";
6
+ import { t as w } from "./sanitize-B2GKlSFp.js";
7
+ import { n as se } from "./library-console-amePMnP8.js";
8
+ import { a as ce, c as T, f as E, i as le, n as ue, o as D, p as de, r as fe, s as O, t as pe } from "./response-body-yi92Rpvo.js";
9
+ import { t as k } from "./defineProperty-s2S8BXUc.js";
10
+ import { r as A } from "./platform-Dba6R3Hp.js";
11
+ import { t as j } from "./unref-DgHPQeWv.js";
12
+ import { t as M } from "./compression-BWkDWY3v.js";
13
+ import { a as N } from "./batch-120Kc9jr.js";
14
+ import { r as P } from "./log-record-B_nSqxoe.js";
15
+ import { i as F } from "./identity-Byh3gCdT.js";
16
+ import { t as I } from "./sampling-DZTOD28D.js";
17
+ import { n as L, t as R } from "./remote-rules-DNK96vLa.js";
18
18
  // src/storage/persistence.ts
19
- async function B(e) {
19
+ async function z(e) {
20
20
  let t = globalThis.navigator?.storage;
21
21
  return typeof t?.persist == "function" ? await e.guardAsync("storage.unavailable", "The browser rejected the request for persistent storage.", () => t.persist()) === !0 ? "granted" : "denied" : "unsupported";
22
22
  }
23
23
  // src/transport/status-transport.ts
24
- function pe(e) {
24
+ function B(e) {
25
25
  let t = typeof e == "string" ? Date.parse(e) : NaN;
26
26
  return Number.isNaN(t) ? void 0 : Math.round(t + 500 - Date.now());
27
27
  }
@@ -30,13 +30,13 @@ var V = class {
30
30
  this.cancellation.abort();
31
31
  }
32
32
  assertContext(e) {
33
- if (this.cancellation.signal.aborted || this.config.securityContext.isolation && this.config.securityContext.id && e.routingContextId !== this.config.securityContext.id) throw this.diagnostics.count("security.context_mismatch"), new D("permanent", "The delivery context is inactive or does not match the batch.");
33
+ if (this.cancellation.signal.aborted || this.config.securityContext.isolation && this.config.securityContext.id && e.routingContextId !== this.config.securityContext.id) throw this.diagnostics.count("security.context_mismatch"), new E("permanent", "The delivery context is inactive or does not match the batch.");
34
34
  }
35
35
  async untilCancelled(e) {
36
- if (this.cancellation.signal.aborted) throw new D("permanent", "The delivery context retired.");
36
+ if (this.cancellation.signal.aborted) throw new E("permanent", "The delivery context retired.");
37
37
  let t, n = new Promise((e, n) => {
38
38
  t = () => {
39
- n(new D("permanent", "The delivery context retired."));
39
+ n(new E("permanent", "The delivery context retired."));
40
40
  }, this.cancellation.signal.addEventListener("abort", t, { once: !0 });
41
41
  });
42
42
  try {
@@ -46,14 +46,14 @@ var V = class {
46
46
  }
47
47
  }
48
48
  constructor(e, t, n = () => void 0, r = () => void 0, i = () => void 0) {
49
- A(this, "config", void 0), A(this, "diagnostics", void 0), A(this, "onSampling", void 0), A(this, "onLoss", void 0), A(this, "onClock", void 0), A(this, "cancellation", new AbortController()), A(this, "throttledUntil", {
49
+ k(this, "config", void 0), k(this, "diagnostics", void 0), k(this, "onSampling", void 0), k(this, "onLoss", void 0), k(this, "onClock", void 0), k(this, "cancellation", new AbortController()), k(this, "throttledUntil", {
50
50
  logs: 0,
51
51
  metrics: 0,
52
52
  traces: 0
53
- }), A(this, "acceptedAt", null), this.config = e, this.diagnostics = t, this.onSampling = n, this.onLoss = r, this.onClock = i;
53
+ }), k(this, "acceptedAt", null), this.config = e, this.diagnostics = t, this.onSampling = n, this.onLoss = r, this.onClock = i;
54
54
  }
55
55
  throttledForMs(e) {
56
- return Math.max(0, this.throttledUntil[O(e, this.config)] - Date.now());
56
+ return Math.max(0, this.throttledUntil[D(e, this.config)] - Date.now());
57
57
  }
58
58
  throttleEnd() {
59
59
  let e = Math.max(...Object.values(this.throttledUntil));
@@ -63,18 +63,18 @@ var V = class {
63
63
  return this.acceptedAt;
64
64
  }
65
65
  serialize(e) {
66
- let t = E(this.config, e, this.diagnostics, "The serializer threw an error. The library dropped the batch.");
66
+ let t = T(this.config, e, this.diagnostics, "The serializer threw an error. The library dropped the batch.");
67
67
  return t || this.onLoss("unserializable", e.records, [e.id]), t;
68
68
  }
69
69
  accept(e, t, n) {
70
70
  this.throttledUntil[e] = 0, this.acceptedAt = Date.now(), this.config.sampling.remote && t != null && this.onSampling(t);
71
- let r = pe(n);
71
+ let r = B(n);
72
72
  r !== void 0 && this.onClock(r);
73
73
  }
74
74
  reportPartial(e, t, n) {
75
- let r = this.diagnostics.guard("transport.http_error", "The library could not read the body of the 2xx response.", () => ce(n, t));
75
+ let r = this.diagnostics.guard("transport.http_error", "The library could not read the body of the 2xx response.", () => le(n, t));
76
76
  if (!r) return 0;
77
- let i = k(t, this.config), a = Math.min(r.rejected, e.records.length);
77
+ let i = O(t, this.config), a = Math.min(r.rejected, e.records.length);
78
78
  if (a === 0) return this.diagnostics.report("transport.partial_success", "The server accepted the batch with a warning.", {
79
79
  endpoint: i,
80
80
  serverMessage: r.message
@@ -93,18 +93,18 @@ var V = class {
93
93
  let t = r.advice === void 0 ? "" : ` ${r.advice}`;
94
94
  return this.diagnostics.report("transport.rejected_credentials", `The server returned ${i}.${t}`, {
95
95
  status: e,
96
- endpoint: k(n, this.config)
97
- }), new D("permanent", `The server rejected the batch with ${i}.`, e);
96
+ endpoint: O(n, this.config)
97
+ }), new E("permanent", `The server rejected the batch with ${i}.`, e);
98
98
  }
99
- if (e === 413) return new D("too_large", "The payload is too large.", e, void 0, r.maxBytes);
99
+ if (e === 413) return new E("too_large", "The payload is too large.", e, void 0, r.maxBytes);
100
100
  if (e === 429 || e === 503) {
101
101
  let t = e === 429, i = r.retryAfterMs === void 0 ? void 0 : Math.min(r.retryAfterMs, this.config.delivery.retryMaxDelayMs);
102
- return this.throttledUntil[n] = Date.now() + (i ?? this.config.delivery.retryBaseDelayMs), t && this.diagnostics.report("transport.throttled", "The server throttles the requests.", { retryAfterMs: i }), new D("throttled", t ? "The server throttles the requests." : "The service is not available.", e, i);
102
+ return this.throttledUntil[n] = Date.now() + (i ?? this.config.delivery.retryBaseDelayMs), t && this.diagnostics.report("transport.throttled", "The server throttles the requests.", { retryAfterMs: i }), new E("throttled", t ? "The server throttles the requests." : "The service is not available.", e, i);
103
103
  }
104
- return e === 408 || e >= 500 ? new D("transient", `The server returned the error ${i}.`, e) : (this.diagnostics.report("transport.dropped_permanent", `The server rejected the batch with ${i}. The library dropped it.`, {
104
+ return e === 408 || e >= 500 ? new E("transient", `The server returned the error ${i}.`, e) : (this.diagnostics.report("transport.dropped_permanent", `The server rejected the batch with ${i}. The library dropped it.`, {
105
105
  batchId: t,
106
106
  status: e
107
- }), new D("permanent", `The server rejected the batch with ${i}.`, e));
107
+ }), new E("permanent", `The server rejected the batch with ${i}.`, e));
108
108
  }
109
109
  };
110
110
  // src/transport/custom-transport.ts
@@ -134,16 +134,16 @@ var he = class extends V {
134
134
  if (!t || e.records.length === 0) return e.records.length;
135
135
  let n = this.serialize(e);
136
136
  if (!n) return e.records.length;
137
- let r = O(e, this.config), i = H(e, n, r);
137
+ let r = D(e, this.config), i = H(e, n, r);
138
138
  i.signal = this.cancellation.signal;
139
139
  let a;
140
140
  try {
141
- a = await x(this.untilCancelled(ae(() => C(() => oe(() => t(i))))), this.config.delivery.requestTimeoutMs);
141
+ a = await x(this.untilCancelled(oe(() => S(() => se(() => t(i))))), this.config.delivery.requestTimeoutMs);
142
142
  } catch (e) {
143
- let t = e instanceof S ? e : void 0, n = t ? "timeout" : "transient", r = t?.message ?? "The custom transport failed.";
144
- throw new D(n, r, void 0, void 0, void 0, e);
143
+ let t = e instanceof ae ? e : void 0, n = t ? "timeout" : "transient", r = t?.message ?? "The custom transport failed.";
144
+ throw new E(n, r, void 0, void 0, void 0, e);
145
145
  }
146
- if (this.assertContext(e), !me(a)) throw this.diagnostics.report("transport.http_error", "The custom transport returned no valid status. The library sends the batch again later.", { batchId: e.id }), new D("transient", "The custom transport returned no valid status.");
146
+ if (this.assertContext(e), !me(a)) throw this.diagnostics.report("transport.http_error", "The custom transport returned no valid status. The library sends the batch again later.", { batchId: e.id }), new E("transient", "The custom transport returned no valid status.");
147
147
  let { status: o } = a;
148
148
  if (o >= 200 && o < 300) return this.accept(r, a.sampling, a.date), 0;
149
149
  throw this.reject(o, e.id, r, {
@@ -151,39 +151,46 @@ var he = class extends V {
151
151
  maxBytes: U(a.maxBytes)
152
152
  });
153
153
  }
154
- }, W = class {
154
+ }, W = 8, ge = class {
155
155
  constructor(e) {
156
- A(this, "deps", void 0), A(this, "installed", !1), A(this, "keepaliveBytes", 0), A(this, "onVisibility", () => {
156
+ k(this, "deps", void 0), k(this, "installed", !1), k(this, "left", !1), k(this, "lateQueued", !1), k(this, "lateFlushes", 0), k(this, "collecting", !1), k(this, "keepaliveBytes", 0), k(this, "leaveBytes", 0), k(this, "onVisibility", () => {
157
157
  document.visibilityState === "hidden" && this.flush("hidden");
158
- }), A(this, "onPageHide", () => {
159
- this.flush("pagehide");
160
- }), A(this, "onFreeze", () => {
158
+ }), k(this, "onPageHide", () => {
159
+ this.left = !0, this.leaveBytes = 0, this.lateFlushes = 0, this.flush("pagehide");
160
+ }), k(this, "onPageShow", () => {
161
+ this.left = !1, this.leaveBytes = 0;
162
+ }), k(this, "onFreeze", () => {
161
163
  this.flush("freeze");
162
- }), A(this, "onOpenFinClose", () => {
164
+ }), k(this, "onOpenFinClose", () => {
163
165
  this.flush("openfin-close");
164
166
  }), this.deps = e;
165
167
  }
166
168
  install() {
167
169
  if (this.installed || typeof addEventListener > "u") return;
168
- this.installed = !0, typeof document < "u" && (document.addEventListener("visibilitychange", this.onVisibility), document.addEventListener("freeze", this.onFreeze)), addEventListener("pagehide", this.onPageHide);
169
- let e = w()?.me;
170
+ this.installed = !0, typeof document < "u" && (document.addEventListener("visibilitychange", this.onVisibility), document.addEventListener("freeze", this.onFreeze)), addEventListener("pagehide", this.onPageHide), addEventListener("pageshow", this.onPageShow);
171
+ let e = C()?.me;
170
172
  this.deps.diagnostics.guard("openfin.unavailable", "The library could not subscribe to close-requested.", () => {
171
173
  e?.on?.("close-requested", this.onOpenFinClose);
172
174
  });
173
175
  }
174
176
  uninstall() {
175
177
  if (!this.installed) return;
176
- this.installed = !1, typeof document < "u" && (document.removeEventListener("visibilitychange", this.onVisibility), document.removeEventListener("freeze", this.onFreeze)), removeEventListener("pagehide", this.onPageHide);
177
- let e = w()?.me;
178
+ this.installed = !1, this.left = !1, this.leaveBytes = 0, typeof document < "u" && (document.removeEventListener("visibilitychange", this.onVisibility), document.removeEventListener("freeze", this.onFreeze)), removeEventListener("pagehide", this.onPageHide), removeEventListener("pageshow", this.onPageShow);
179
+ let e = C()?.me;
178
180
  this.deps.diagnostics.guard("openfin.unavailable", "The library could not unsubscribe from close-requested.", () => {
179
181
  e?.removeListener?.("close-requested", this.onOpenFinClose);
180
182
  });
181
183
  }
184
+ flushLate() {
185
+ !this.left || this.collecting || this.lateQueued || this.lateFlushes >= W || (this.lateQueued = !0, this.lateFlushes++, queueMicrotask(() => {
186
+ this.lateQueued = !1, this.left && this.flush("pagehide");
187
+ }));
188
+ }
182
189
  flush(e) {
183
190
  let { config: t, diagnostics: n } = this.deps;
184
- if (n.guard("pipeline.crashed", "The metric points before the exit flush failed.", () => {
191
+ if (this.collecting = !0, n.guard("pipeline.crashed", "The metric points before the exit flush failed.", () => {
185
192
  this.deps.beforeExit?.();
186
- }), e === "hidden") {
193
+ }), this.collecting = !1, e === "hidden") {
187
194
  this.flushAlive();
188
195
  return;
189
196
  }
@@ -192,48 +199,49 @@ var he = class extends V {
192
199
  return;
193
200
  }
194
201
  let r = this.endpointUrl();
195
- if (r !== null) {
196
- this.keepaliveBytes = this.deps.keepaliveInFlight() ?? 0;
197
- for (let i of this.deps.drainForExit()) {
198
- let a = O(i, t), o = a === "logs" ? r.href : k(a, t);
199
- o ? this.flushBatch(i, e, new URL(o)) : n.count("record.dropped_no_destination");
200
- }
202
+ if (r === null) return;
203
+ let i = this.deps.keepaliveInFlight() ?? 0;
204
+ this.keepaliveBytes = i + (this.left ? this.leaveBytes : 0);
205
+ for (let i of this.deps.drainForExit()) {
206
+ let a = D(i, t), o = a === "logs" ? r.href : O(a, t);
207
+ o ? this.flushBatch(i, e, new URL(o)) : n.count("record.dropped_no_destination");
201
208
  }
209
+ this.left && (this.leaveBytes = this.keepaliveBytes - i);
202
210
  }
203
- flushBatch(t, r, o) {
211
+ flushBatch(t, n, i) {
204
212
  let { config: s } = this.deps;
205
213
  if (t.records.length === 0) return;
206
- let c = this.serialize(t, r);
214
+ let c = this.serialize(t, n);
207
215
  if (!c) return;
208
- let l = T(c.body);
216
+ let l = w(c.body);
209
217
  if (l > 6e4) {
210
218
  this.park(t);
211
219
  return;
212
220
  }
213
- o.searchParams.set(i, t.id), o.searchParams.set(p, r);
214
- let u = o.toString(), d = this.deps.exitHeaders(), f = () => {
221
+ i.searchParams.set(a, t.id), i.searchParams.set(m, n);
222
+ let u = i.toString(), d = this.deps.exitHeaders(), f = () => {
215
223
  let e = new Headers(d);
216
- return e.set(m, c.contentType), e.set(a, t.id), e;
224
+ return e.set(h, c.contentType), e.set(o, t.id), e;
217
225
  };
218
226
  if (d) {
219
- this.keepaliveFetch(u, t, c.body, l, r, f);
227
+ this.keepaliveFetch(u, t, c.body, l, n, f);
220
228
  return;
221
229
  }
222
230
  if (s.headers) {
223
231
  this.park(t);
224
232
  return;
225
233
  }
226
- if (this.isSameOrigin(o)) {
227
- this.keepaliveFetch(u, t, c.body, l, r, f);
234
+ if (this.isSameOrigin(i)) {
235
+ this.keepaliveFetch(u, t, c.body, l, n, f);
228
236
  return;
229
237
  }
230
- let h = () => new Headers({ [m]: n });
238
+ let p = () => new Headers({ [h]: r });
231
239
  if (s.credentials !== "include") {
232
- this.keepaliveFetch(u, t, c.body, l, r, h);
240
+ this.keepaliveFetch(u, t, c.body, l, n, p);
233
241
  return;
234
242
  }
235
243
  let g = this.beacon(u, c.body);
236
- g === "sent" ? this.keepaliveBytes += l : g === "refused" ? (this.keepaliveBytes = e, this.park(t)) : this.keepaliveFetch(u, t, c.body, l, r, h);
244
+ g === "sent" ? this.keepaliveBytes += l : g === "refused" ? (this.keepaliveBytes = e, this.park(t)) : this.keepaliveFetch(u, t, c.body, l, n, p);
237
245
  }
238
246
  isSameOrigin(e) {
239
247
  if (typeof location > "u") return !1;
@@ -253,8 +261,8 @@ var he = class extends V {
253
261
  for (let i of this.deps.drainForExit()) {
254
262
  let a = this.serialize(i, e);
255
263
  if (!a) continue;
256
- let o = H(i, a, O(i, n));
257
- (t === void 0 || r.guard("transport.http_error", "The transportOnExit hook threw an error.", () => C(() => t(o))) !== !0) && this.park(i);
264
+ let o = H(i, a, D(i, n));
265
+ (t === void 0 || r.guard("transport.http_error", "The transportOnExit hook threw an error.", () => S(() => t(o))) !== !0) && this.park(i);
258
266
  }
259
267
  }
260
268
  park(e) {
@@ -262,7 +270,7 @@ var he = class extends V {
262
270
  i === "memory" || i === "none" ? r?.("not_stored", e.records, [e.id]) : y(e, n, r);
263
271
  }
264
272
  serialize(e, t) {
265
- let n = E(this.deps.config, e, this.deps.diagnostics, `The ${t} exit flush could not serialize its batch.`);
273
+ let n = T(this.deps.config, e, this.deps.diagnostics, `The ${t} exit flush could not serialize its batch.`);
266
274
  return n || this.deps.onLoss?.("unserializable", e.records, [e.id]), n;
267
275
  }
268
276
  endpointUrl() {
@@ -279,7 +287,7 @@ var he = class extends V {
279
287
  let { config: o, diagnostics: s } = this.deps, c = () => {
280
288
  this.park(t);
281
289
  };
282
- this.keepaliveBytes + r > 6e4 ? c() : (this.keepaliveBytes += r, s.guard("transport.http_error", "The keepalive fetch failed.", () => (C(() => fetch(e, {
290
+ this.keepaliveBytes + r > 6e4 ? c() : (this.keepaliveBytes += r, s.guard("transport.http_error", "The keepalive fetch failed.", () => (S(() => fetch(e, {
283
291
  method: "POST",
284
292
  body: n,
285
293
  headers: a(),
@@ -290,7 +298,7 @@ var he = class extends V {
290
298
  }), !0)) !== !0 && c());
291
299
  }
292
300
  }, G = /* @__PURE__ */ new WeakMap();
293
- function ge(e, t) {
301
+ function _e(e, t) {
294
302
  let { headers: n } = t;
295
303
  if (!n) return;
296
304
  if (typeof n != "function") return n;
@@ -316,15 +324,15 @@ function q(e) {
316
324
  // src/transport/http-transport.ts
317
325
  var J = "In a cross-origin iframe, the session cookie is a third-party cookie. The browser often blocks it. Forward the records to the platform document. As an alternative, issue the cookie with the Partitioned attribute.", Y = class extends V {
318
326
  constructor(...e) {
319
- super(...e), A(this, "keepaliveBytes", 0);
327
+ super(...e), k(this, "keepaliveBytes", 0);
320
328
  }
321
329
  async send(e, t) {
322
330
  this.assertContext(e);
323
- let { config: n } = this, r = O(e, n), i = k(r, n);
331
+ let { config: n } = this, r = D(e, n), i = O(r, n);
324
332
  return i ? e.records.length === 0 ? 0 : this.post(e, r, i, t) : (this.diagnostics.count("record.dropped_no_destination"), e.records.length);
325
333
  }
326
334
  lastHeaders() {
327
- return ge(this, this.config);
335
+ return _e(this, this.config);
328
336
  }
329
337
  keepaliveInFlight() {
330
338
  return this.keepaliveBytes;
@@ -332,15 +340,15 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
332
340
  async post(e, t, n, r) {
333
341
  let i = this.serialize(e);
334
342
  if (!i) return e.records.length;
335
- let a = fe(t, this.config.serializer), o = await this.attempt(e, n, i, a, r);
343
+ let a = pe(t, this.config.serializer), o = await this.attempt(e, n, i, a, r);
336
344
  this.assertContext(e), this.rejectsCredentials(o.response.status) && typeof this.config.headers == "function" && (q(this), o = await this.attempt(e, n, i, a, r), this.assertContext(e));
337
- let { response: s, body: u } = o;
345
+ let { response: s, body: c } = o;
338
346
  if (s.ok) {
339
347
  let { headers: n } = s;
340
- return this.accept(t, n.get(c), n.get(d)), u === void 0 ? 0 : this.reportPartial(e, t, u);
348
+ return this.accept(t, n.get(l), n.get(f)), c === void 0 ? 0 : this.reportPartial(e, t, c);
341
349
  }
342
- let f = s.status, p = ue(s.headers.get(l)), m = f === 413 && u !== void 0 ? this.readMaxBytes(u) : void 0;
343
- throw this.reject(f, e.id, t, {
350
+ let d = s.status, p = de(s.headers.get(u)), m = d === 413 && c !== void 0 ? this.readMaxBytes(c) : void 0;
351
+ throw this.reject(d, e.id, t, {
344
352
  retryAfterMs: p,
345
353
  maxBytes: m,
346
354
  advice: J
@@ -350,15 +358,15 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
350
358
  return e === 401 || e === 403;
351
359
  }
352
360
  async attempt(e, t, n, r, i) {
353
- let s = Date.now() + this.config.delivery.requestTimeoutMs, c = new Headers(await this.before(this.resolveHeaders(), s, t));
354
- c.set(m, n.contentType), c.set(a, e.id), c.set(g, String(e.attempts));
355
- let l = await this.before(this.encodeBody(n.body), s, t);
356
- this.assertContext(e), typeof l != "string" && c.set(o, f);
357
- let u = typeof l == "string" ? T(l) : l.byteLength;
358
- if (!this.keepalive(u)) return this.dispatch(t, c, l, s, !1, r);
361
+ let a = Date.now() + this.config.delivery.requestTimeoutMs, c = new Headers(await this.before(this.resolveHeaders(), a, t));
362
+ c.set(h, n.contentType), c.set(o, e.id), c.set(g, String(e.attempts));
363
+ let l = await this.before(this.encodeBody(n.body), a, t);
364
+ this.assertContext(e), typeof l != "string" && c.set(s, p);
365
+ let u = typeof l == "string" ? w(l) : l.byteLength;
366
+ if (!this.keepalive(u)) return this.dispatch(t, c, l, a, !1, r);
359
367
  i?.(), this.keepaliveBytes += u;
360
368
  try {
361
- return await this.dispatch(t, c, l, s, !0, r);
369
+ return await this.dispatch(t, c, l, a, !0, r);
362
370
  } finally {
363
371
  this.keepaliveBytes -= u;
364
372
  }
@@ -367,16 +375,16 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
367
375
  try {
368
376
  return await x(this.untilCancelled(e), Math.max(0, t - Date.now()));
369
377
  } catch {
370
- throw this.cancellation.signal.aborted ? new D("permanent", "The delivery context retired.") : this.timeout(n);
378
+ throw this.cancellation.signal.aborted ? new E("permanent", "The delivery context retired.") : this.timeout(n);
371
379
  }
372
380
  }
373
381
  timeout(e) {
374
382
  let t = `The request took longer than ${String(this.config.delivery.requestTimeoutMs)} ms.`;
375
- return this.diagnostics.report("transport.timeout", t, { endpoint: e }), new D("timeout", t);
383
+ return this.diagnostics.report("transport.timeout", t, { endpoint: e }), new E("timeout", t);
376
384
  }
377
385
  async encodeBody(e) {
378
386
  let { config: t } = this;
379
- return t.compression !== "gzip" || T(e) < 1024 ? e : await this.diagnostics.guardAsync("transport.http_error", "The library could not compress the payload.", () => N(e)) ?? e;
387
+ return t.compression !== "gzip" || w(e) < 1024 ? e : await this.diagnostics.guardAsync("transport.http_error", "The library could not compress the payload.", () => M(e)) ?? e;
380
388
  }
381
389
  async dispatch(e, t, n, r, i, a) {
382
390
  let { config: o } = this, s = new AbortController(), c = () => {
@@ -386,9 +394,9 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
386
394
  let l = setTimeout(() => {
387
395
  s.abort();
388
396
  }, Math.max(0, r - Date.now()));
389
- M(l);
397
+ j(l);
390
398
  try {
391
- let r = await C(() => fetch(e, {
399
+ let r = await S(() => fetch(e, {
392
400
  method: "POST",
393
401
  headers: t,
394
402
  body: n,
@@ -398,36 +406,36 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
398
406
  keepalive: i,
399
407
  priority: i ? "auto" : o.delivery.priority
400
408
  }));
401
- return de(r, a) ? {
409
+ return fe(r, a) ? {
402
410
  response: r,
403
- body: await se(r, s.signal, this.diagnostics)
411
+ body: await ce(r, s.signal, this.diagnostics)
404
412
  } : { response: r };
405
413
  } catch {
406
- throw this.cancellation.signal.aborted ? new D("permanent", "The delivery context retired.") : s.signal.aborted ? this.timeout(e) : new D(j() ? "transient" : "offline", "A network error occurred.");
414
+ throw this.cancellation.signal.aborted ? new E("permanent", "The delivery context retired.") : s.signal.aborted ? this.timeout(e) : new E(A() ? "transient" : "offline", "A network error occurred.");
407
415
  } finally {
408
416
  this.cancellation.signal.removeEventListener("abort", c), clearTimeout(l);
409
417
  }
410
418
  }
411
419
  keepalive(e) {
412
- return globalThis.document?.visibilityState === "hidden" && e <= 6e4;
420
+ return globalThis.document?.visibilityState === "hidden" && this.keepaliveBytes + e <= 6e4;
413
421
  }
414
422
  readMaxBytes(e) {
415
- return this.diagnostics.guard("transport.http_error", "The library could not read the body of the 413 response.", () => le(e));
423
+ return this.diagnostics.guard("transport.http_error", "The library could not read the body of the 413 response.", () => ue(e));
416
424
  }
417
425
  async resolveHeaders() {
418
426
  return K(this, this.config, this.diagnostics);
419
427
  }
420
- }, _e = class {
428
+ }, ve = class {
421
429
  constructor(e, t, n, r, i = 20, a = () => void 0) {
422
- A(this, "storage", void 0), A(this, "transport", void 0), A(this, "diagnostics", void 0), A(this, "config", void 0), A(this, "batchesPerDrain", void 0), A(this, "onLoss", void 0), A(this, "timer", null), A(this, "attempt", 0), A(this, "draining", !1), A(this, "stopped", !1), A(this, "maxAttempts", void 0), A(this, "onOnline", () => {
430
+ k(this, "storage", void 0), k(this, "transport", void 0), k(this, "diagnostics", void 0), k(this, "config", void 0), k(this, "batchesPerDrain", void 0), k(this, "onLoss", void 0), k(this, "timer", null), k(this, "idle", !1), k(this, "attempt", 0), k(this, "draining", !1), k(this, "stopped", !1), k(this, "maxAttempts", void 0), k(this, "onOnline", () => {
423
431
  this.attempt = 0, this.schedule(0);
424
432
  }), this.storage = e, this.transport = t, this.diagnostics = n, this.config = r, this.batchesPerDrain = i, this.onLoss = a, this.maxAttempts = b(r.retention).maxAttempts;
425
433
  }
426
434
  start() {
427
- this.stopped = !1, typeof addEventListener < "u" && addEventListener("online", this.onOnline), this.schedule(t);
435
+ this.stopped = !1, typeof addEventListener < "u" && addEventListener("online", this.onOnline), this.schedule(n, !0);
428
436
  }
429
437
  nudge() {
430
- this.draining || this.schedule(this.config.delivery.retryBaseDelayMs);
438
+ !this.draining && (this.timer === null || this.idle) && this.schedule(this.config.delivery.retryBaseDelayMs);
431
439
  }
432
440
  async storeFailed(e, t) {
433
441
  let n = this.toStorable(e, t);
@@ -456,16 +464,16 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
456
464
  this.stop();
457
465
  }
458
466
  }
459
- schedule(e) {
467
+ schedule(e, t = !1) {
460
468
  if (this.stopped) return;
461
- this.clearTimer();
462
- let t = setTimeout(() => {
469
+ this.clearTimer(), this.idle = t;
470
+ let n = setTimeout(() => {
463
471
  this.drain();
464
472
  }, e);
465
- this.timer = t, M(t);
473
+ this.timer = n, j(n);
466
474
  }
467
475
  bounded(e) {
468
- return x(e, h);
476
+ return x(e, t);
469
477
  }
470
478
  clearTimer() {
471
479
  this.timer !== null && (clearTimeout(this.timer), this.timer = null);
@@ -478,8 +486,8 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
478
486
  if (!this.draining) {
479
487
  this.draining = !0;
480
488
  try {
481
- let e = ie(r, this.config.storage.namespace);
482
- await v(e, this.diagnostics, () => this.drainLocked()) !== !0 && this.schedule(t);
489
+ let e = ie(i, this.config.storage.namespace);
490
+ await v(e, this.diagnostics, () => this.drainLocked()) !== !0 && this.schedule(n, !0);
483
491
  } finally {
484
492
  this.draining = !1;
485
493
  }
@@ -487,19 +495,19 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
487
495
  }
488
496
  async drainLocked() {
489
497
  try {
490
- if (!j()) return this.schedule(t), !0;
498
+ if (!A()) return this.schedule(n, !0), !0;
491
499
  let e = await this.bounded(this.storage.take(this.batchesPerDrain));
492
- if (e.length === 0) return this.schedule(t), !0;
493
- let n = /* @__PURE__ */ new Set(), r = 0;
494
- for (let t of e) {
500
+ if (e.length === 0) return this.schedule(n, !0), !0;
501
+ let t = /* @__PURE__ */ new Set(), r = 0, i = !1;
502
+ for (let n of e) {
495
503
  if (this.stopped) return !0;
496
- let e = O(t, this.config);
497
- if (n.has(e)) continue;
498
- let i = await this.deliver(t);
499
- if (i === "stop") return !0;
500
- i !== "next" && (n.add(e), r = Math.max(r, i));
504
+ let e = D(n, this.config);
505
+ if (t.has(e)) continue;
506
+ let a = this.transport.throttledForMs(n), o = a > 0 ? a : await this.deliver(n);
507
+ if (o === "stop") return !0;
508
+ o === "split" ? i = !0 : o !== "next" && (t.add(e), r = Math.max(r, o));
501
509
  }
502
- return n.size > 0 ? this.schedule(r) : this.schedule(e.length === this.batchesPerDrain ? 0 : t), !0;
510
+ return t.size > 0 ? this.schedule(r) : e.length === this.batchesPerDrain ? this.schedule(0) : i ? this.schedule(this.config.delivery.retryBaseDelayMs) : this.schedule(n, !0), !0;
503
511
  } catch (e) {
504
512
  return this.diagnostics.report("storage.degraded", "The drain loop threw an error.", void 0, e), this.attempt++, this.schedule(this.backoffMs()), !0;
505
513
  }
@@ -511,22 +519,24 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
511
519
  }), this.onLoss("max_attempts", e.records, [e.id]), await this.bounded(this.storage.remove(e.id)), "next";
512
520
  try {
513
521
  return await this.transport.send(e), await this.bounded(this.storage.remove(e.id)), this.attempt = 0, "next";
514
- } catch (n) {
522
+ } catch (t) {
515
523
  if (this.stopped) return "stop";
516
- let r = n instanceof D ? n : void 0;
517
- return r?.kind === "permanent" || r?.kind === "too_large" ? (await this.replaceStored(e, n), "next") : r?.kind === "offline" ? (this.schedule(t), "stop") : r?.kind === "throttled" ? (this.attempt++, r.retryAfterMs ?? this.backoffMs()) : (await this.bounded(this.storage.bumpAttempts(e.id, e.attempts + 1)), this.attempt++, r?.retryAfterMs ?? this.backoffMs());
524
+ let r = t instanceof E ? t : void 0;
525
+ return r?.kind === "permanent" || r?.kind === "too_large" ? await this.replaceStored(e, t) ? "split" : "next" : r?.kind === "offline" ? (this.schedule(n, !0), "stop") : r?.kind === "throttled" ? (this.attempt++, r.retryAfterMs ?? this.backoffMs()) : (await this.bounded(this.storage.bumpAttempts(e.id, e.attempts + 1)), this.attempt++, r?.retryAfterMs ?? this.backoffMs());
518
526
  }
519
527
  }
520
528
  async replaceStored(e, t) {
521
529
  let n = this.toStorable(e, t);
522
530
  await this.bounded(this.storage.remove(e.id));
523
- for (let e of n) await this.bounded(this.storage.save(e));
531
+ let r = !1;
532
+ for (let e of n) await this.bounded(this.storage.save(e)) && (r = !0);
533
+ return r;
524
534
  }
525
535
  toStorable(e, t) {
526
- let n = t instanceof D ? t : void 0;
536
+ let n = t instanceof E ? t : void 0;
527
537
  if (n?.kind === "permanent") return this.onLoss("rejected", e.records, [e.id]), [];
528
538
  if (n?.kind !== "too_large") return [e];
529
- let r = P(e, this.diagnostics);
539
+ let r = N(e, this.diagnostics);
530
540
  return r ? (this.diagnostics.report("transport.batch_split", "The server refused the batch because it is too large.", {
531
541
  from: e.records.length,
532
542
  to: r[0].records.length,
@@ -542,7 +552,7 @@ var J = "In a cross-origin iframe, the session cookie is a third-party cookie. T
542
552
  "traces"
543
553
  ];
544
554
  function Z(e) {
545
- let t = e.attributes[s];
555
+ let t = e.attributes[c];
546
556
  return t === "metric" ? "metrics" : t === "span" ? "traces" : "logs";
547
557
  }
548
558
  function Q(e, t) {
@@ -552,19 +562,19 @@ function Q(e, t) {
552
562
  dropped: t - e
553
563
  };
554
564
  }
555
- var ve = {
565
+ var ye = {
556
566
  stored: "The send failed. The library stored the batch and sends it again later.",
557
567
  split: "The send failed. The library stored the batch in two parts and sends them again later.",
558
568
  rejected: "The send failed, and another send would fail too. The library drops the batch.",
559
569
  not_stored: "The send failed, and storage did not keep the batch. The library drops the records that are not in storage.",
560
570
  unknown: "The send failed. The library could not confirm that storage kept the batch. The library sends again only the records that are in storage."
561
- }, ye = {
571
+ }, be = {
562
572
  stored: "The server throttles requests. The pipeline stored the batch and did not send it.",
563
573
  not_stored: "The server throttles requests, and storage did not keep the batch. The library drops the batch.",
564
574
  unknown: "The server throttles requests. The library could not confirm that storage kept the batch. The library sends the batch later only if it is in storage."
565
575
  }, $ = class {
566
576
  constructor(e, t) {
567
- A(this, "options", void 0), A(this, "onFlush", void 0), A(this, "pending", []), A(this, "timer", null), this.options = e, this.onFlush = t;
577
+ k(this, "options", void 0), k(this, "onFlush", void 0), k(this, "pending", []), k(this, "timer", null), this.options = e, this.onFlush = t;
568
578
  }
569
579
  add(e) {
570
580
  this.pending.push(e), this.pending.length >= this.options.batchSize ? this.onFlush(this) : this.arm();
@@ -588,12 +598,12 @@ var ve = {
588
598
  let e = setTimeout(() => {
589
599
  this.timer = null, this.onFlush(this);
590
600
  }, this.options.flushIntervalMs);
591
- this.timer = e, M(e);
601
+ this.timer = e, j(e);
592
602
  }
593
603
  clearTimer() {
594
604
  this.timer !== null && (clearTimeout(this.timer), this.timer = null);
595
605
  }
596
- }, be = class {
606
+ }, xe = class {
597
607
  release(e) {
598
608
  for (let t of e) this.heldBytes -= this.held.get(t) ?? 0, this.held.delete(t);
599
609
  }
@@ -614,7 +624,7 @@ var ve = {
614
624
  if (!this.policy) return !0;
615
625
  let { maxPendingRecords: t, maxPendingBytes: n, overflow: r } = this.policy.buffering, i;
616
626
  try {
617
- i = T(JSON.stringify(e));
627
+ i = w(JSON.stringify(e));
618
628
  } catch {
619
629
  return this.onLoss("unserializable", [e]), !1;
620
630
  }
@@ -637,7 +647,7 @@ var ve = {
637
647
  return this.held.set(e, i), this.heldBytes += i, !0;
638
648
  }
639
649
  constructor(e, t, n, r, i, a, o, s = () => void 0, c = () => void 0) {
640
- A(this, "transport", void 0), A(this, "storage", void 0), A(this, "retry", void 0), A(this, "diagnostics", void 0), A(this, "routingContextId", void 0), A(this, "policy", void 0), A(this, "onLoss", void 0), A(this, "clockOffset", void 0), A(this, "streams", void 0), A(this, "unconfirmed", /* @__PURE__ */ new Map()), A(this, "queue", []), A(this, "open", /* @__PURE__ */ new Set()), A(this, "ceiling", new L()), A(this, "inFlight", 0), A(this, "pumpScheduled", !1), A(this, "stopped", !1), A(this, "paused", !1), A(this, "waiters", /* @__PURE__ */ new Set()), A(this, "held", /* @__PURE__ */ new Map()), A(this, "heldBytes", 0), A(this, "persisting", !1), this.transport = e, this.storage = t, this.retry = n, this.diagnostics = r, this.routingContextId = a, this.policy = o, this.onLoss = s, this.clockOffset = c;
650
+ k(this, "transport", void 0), k(this, "storage", void 0), k(this, "retry", void 0), k(this, "diagnostics", void 0), k(this, "routingContextId", void 0), k(this, "policy", void 0), k(this, "onLoss", void 0), k(this, "clockOffset", void 0), k(this, "streams", void 0), k(this, "unconfirmed", /* @__PURE__ */ new Map()), k(this, "keptAlive", /* @__PURE__ */ new Map()), k(this, "queue", []), k(this, "open", /* @__PURE__ */ new Set()), k(this, "ceiling", new I()), k(this, "inFlight", 0), k(this, "pumpScheduled", !1), k(this, "stopped", !1), k(this, "paused", !1), k(this, "waiters", /* @__PURE__ */ new Set()), k(this, "held", /* @__PURE__ */ new Map()), k(this, "heldBytes", 0), k(this, "persisting", !1), this.transport = e, this.storage = t, this.retry = n, this.diagnostics = r, this.routingContextId = a, this.policy = o, this.onLoss = s, this.clockOffset = c;
641
651
  let l = (e) => {
642
652
  this.claim(e);
643
653
  };
@@ -649,7 +659,7 @@ var ve = {
649
659
  }
650
660
  push(e) {
651
661
  if (this.stopped) return;
652
- e.observedTimeUnixNano = F();
662
+ e.observedTimeUnixNano = P();
653
663
  let t = { ...e };
654
664
  this.admit(t) && this.route(t);
655
665
  }
@@ -657,6 +667,10 @@ var ve = {
657
667
  let e = [...this.unconfirmed.values()].flatMap((e) => e.records);
658
668
  return this.unconfirmed.clear(), this.held.clear(), this.heldBytes = 0, X.map((t) => this.toBatch([...e.filter((e) => Z(e) === t), ...this.streams[t].take()])).filter((e) => e !== null);
659
669
  }
670
+ drainForRetire() {
671
+ let e = [...this.keptAlive.values()];
672
+ return this.keptAlive.clear(), [...e, ...this.drainForExit()];
673
+ }
660
674
  async flushPending(e) {
661
675
  if (this.paused) return [];
662
676
  if (!this.stopped) for (let e of X) this.claim(this.streams[e]);
@@ -724,7 +738,7 @@ var ve = {
724
738
  }
725
739
  toBatch(e) {
726
740
  return e.length === 0 ? null : {
727
- id: I(this.diagnostics),
741
+ id: F(this.diagnostics),
728
742
  records: e,
729
743
  createdAt: Date.now(),
730
744
  attempts: 0,
@@ -742,7 +756,7 @@ var ve = {
742
756
  let r = this.clockOffset();
743
757
  r !== void 0 && t !== "metrics" && (e.attributes = {
744
758
  ...e.attributes,
745
- [u]: r
759
+ [d]: r
746
760
  }), n.add(e);
747
761
  } catch (e) {
748
762
  this.diagnostics.report("pipeline.crashed", "The pipeline dropped a record before it reached a stream.", void 0, e);
@@ -790,7 +804,7 @@ var ve = {
790
804
  let n = this.transport.throttledForMs(e);
791
805
  if (n > 0) {
792
806
  let r = await this.store(e);
793
- return this.diagnostics.report("transport.throttled", ye[r], {
807
+ return this.diagnostics.report("transport.throttled", be[r], {
794
808
  batchId: e.id,
795
809
  records: t,
796
810
  throttledMs: n
@@ -798,7 +812,7 @@ var ve = {
798
812
  }
799
813
  try {
800
814
  let n = await this.transport.send(e, () => {
801
- this.unconfirmed.delete(e.id);
815
+ this.unconfirmed.delete(e.id), this.keptAlive.set(e.id, e);
802
816
  });
803
817
  return {
804
818
  accepted: t - n,
@@ -811,28 +825,28 @@ var ve = {
811
825
  ...e,
812
826
  attempts: e.attempts + 1
813
827
  }, n);
814
- return this.diagnostics.report("transport.http_error", ve[r?.outcome ?? "unknown"], {
828
+ return this.diagnostics.report("transport.http_error", ye[r?.outcome ?? "unknown"], {
815
829
  batchId: e.id,
816
830
  records: t
817
831
  }, n), r ? Q(r.stored, t) : void 0;
818
832
  }
819
833
  } finally {
820
- this.unconfirmed.delete(e.id);
834
+ this.unconfirmed.delete(e.id), this.keptAlive.delete(e.id);
821
835
  }
822
836
  }
823
837
  storeFailed(e, t) {
824
838
  return this.diagnostics.guardAsync("storage.degraded", "The library could not store an undelivered batch.", () => this.retry.storeFailed(e, t));
825
839
  }
826
840
  async store(e) {
827
- let t = await this.diagnostics.guardAsync("storage.degraded", "The library could not store an undelivered batch.", async () => {
828
- let t = await x(this.storage.save(e), h);
829
- return t && this.retry.nudge(), t;
841
+ let n = await this.diagnostics.guardAsync("storage.degraded", "The library could not store an undelivered batch.", async () => {
842
+ let n = await x(this.storage.save(e), t);
843
+ return n && this.retry.nudge(), n;
830
844
  });
831
- return t === void 0 ? "unknown" : t ? "stored" : "not_stored";
845
+ return n === void 0 ? "unknown" : n ? "stored" : "not_stored";
832
846
  }
833
- }, xe = class {
847
+ }, Se = class {
834
848
  constructor(e, t = () => void 0) {
835
- A(this, "transport", void 0), A(this, "onSent", void 0), A(this, "failures", 0), A(this, "failedAt", null), this.transport = e, this.onSent = t;
849
+ k(this, "transport", void 0), k(this, "onSent", void 0), k(this, "failures", 0), k(this, "failedAt", null), this.transport = e, this.onSent = t;
836
850
  }
837
851
  async send(e, t) {
838
852
  let n = this.transport.lastSendAt(), r;
@@ -853,19 +867,19 @@ var ve = {
853
867
  consecutiveFailures: this.failures
854
868
  };
855
869
  }
856
- }, Se = class e {
870
+ }, Ce = class e {
857
871
  constructor(e, t, n, r, i, a, o) {
858
- A(this, "storage", void 0), A(this, "retry", void 0), A(this, "pipeline", void 0), A(this, "exitFlush", void 0), A(this, "diagnostics", void 0), A(this, "transport", void 0), A(this, "outcomes", void 0), A(this, "retired", !1), A(this, "emergencyImport", Promise.resolve()), this.storage = e, this.retry = t, this.pipeline = n, this.exitFlush = r, this.diagnostics = i, this.transport = a, this.outcomes = o;
872
+ k(this, "storage", void 0), k(this, "retry", void 0), k(this, "pipeline", void 0), k(this, "exitFlush", void 0), k(this, "diagnostics", void 0), k(this, "transport", void 0), k(this, "outcomes", void 0), k(this, "retired", !1), k(this, "emergencyImport", Promise.resolve()), this.storage = e, this.retry = t, this.pipeline = n, this.exitFlush = r, this.diagnostics = i, this.transport = a, this.outcomes = o;
859
873
  }
860
874
  static async create(t) {
861
875
  let { config: n, diagnostics: r } = t, i = t.storage ?? await re(n.storage.backend, te(n.storage.namespace), b(n.retention), r, t.onGap, n.storage.namespace);
862
- t.onStorage?.(i), n.storage.requestPersistent && (i.name === "indexeddb" || i.name === "localstorage") && (t.onPersistence?.("pending"), B(r).then(t.onPersistence));
876
+ t.onStorage?.(i), n.storage.requestPersistent && (i.name === "indexeddb" || i.name === "localstorage") && (t.onPersistence?.("pending"), z(r).then(t.onPersistence));
863
877
  let a = new ee(i, n.securityContext, n.storage.namespace), o = (e) => {
864
- let i = R(e, r);
865
- i && z(t.remote, n, i);
878
+ let i = L(e, r);
879
+ i && R(t.remote, n, i);
866
880
  }, s, c = (e) => {
867
881
  s = e;
868
- }, { onLoss: l } = t, u = !n.transport && n.transportWorker ? await r.guardAsync("transport.http_error", "The transport worker module did not load. The library uses HTTP.", async () => (await import("./worker-transport-JK-Fby9J.js")).createWorkerTransport(n, r, o, l, c)) : void 0, d = n.transport !== void 0 || u !== void 0 ? void 0 : new Y(n, r, o, l, c), f = u?.transport ?? d ?? new he(n, r, o, l, c), p = new xe(f, t.onSent), m = new _e(a, p, r, n, void 0, l), { batching: h } = n, g = new be(p, a, m, r, {
882
+ }, { onLoss: l } = t, u = !n.transport && n.transportWorker ? await r.guardAsync("transport.http_error", "The transport worker module did not load. The library uses HTTP.", async () => (await import("./worker-transport-jzX1IusG.js")).createWorkerTransport(n, r, o, l, c)) : void 0, d = n.transport !== void 0 || u !== void 0 ? void 0 : new Y(n, r, o, l, c), f = u?.transport ?? d ?? new he(n, r, o, l, c), p = new Se(f, t.onSent), m = new ve(a, p, r, n, void 0, l), { batching: h } = n, g = new xe(p, a, m, r, {
869
883
  logs: {
870
884
  flushIntervalMs: h.logFlushIntervalMs,
871
885
  batchSize: h.logBatchSize
@@ -880,7 +894,7 @@ var ve = {
880
894
  flushIntervalMs: h.logFlushIntervalMs,
881
895
  batchSize: h.logBatchSize
882
896
  }
883
- }, () => n.securityContext.id || void 0, n, l, () => n.metadata.clockOffset ? s : void 0), _ = new W({
897
+ }, () => n.securityContext.id || void 0, n, l, () => n.metadata.clockOffset ? s : void 0), _ = new ge({
884
898
  config: n,
885
899
  diagnostics: r,
886
900
  drainForExit: () => g.drainForExit(),
@@ -899,7 +913,7 @@ var ve = {
899
913
  return y.emergencyImport = y.importEmergency(), y;
900
914
  }
901
915
  push(e) {
902
- this.pipeline.push(e);
916
+ this.pipeline.push(e), this.exitFlush.flushLate();
903
917
  }
904
918
  hold(e) {
905
919
  this.pipeline.hold(e), e ? (this.exitFlush.uninstall(), this.retry.stop()) : (this.exitFlush.install(), this.retry.start());
@@ -933,7 +947,7 @@ var ve = {
933
947
  }
934
948
  async pause(e) {
935
949
  this.retired = !0, this.exitFlush.uninstall(), this.retry.stop(), this.transport.stop();
936
- let t = this.pipeline.drainForExit();
950
+ let t = this.pipeline.drainForRetire();
937
951
  this.pipeline.destroy(), await this.emergencyImport, await this.keep(t, e);
938
952
  }
939
953
  async keep(e, t) {
@@ -950,12 +964,12 @@ var ve = {
950
964
  this.diagnostics.report("transport.timeout", "The flush of the old security context did not complete before its time limit.", void 0, e);
951
965
  }
952
966
  this.retry.stop(), this.transport.stop();
953
- let r = this.pipeline.drainForExit(), i = r.flatMap((e) => e.records);
967
+ let r = this.pipeline.drainForRetire(), i = r.flatMap((e) => e.records);
954
968
  this.pipeline.destroy(), await this.emergencyImport;
955
969
  let a = await this.storage.take(2 ** 53 - 1);
956
970
  e === "retain" && await this.keep(r, n);
957
971
  let o = e === "discard" || e === "flush";
958
- return await this.storage.retire(o), o && ne(n, this.diagnostics, this.storage.namespace), {
972
+ return await this.storage.retire(o), o && a.push(...ne(n, this.diagnostics, this.storage.namespace)), {
959
973
  buffered: i,
960
974
  stored: a
961
975
  };
@@ -974,6 +988,6 @@ var ve = {
974
988
  !this.retired && e !== void 0 && e > 0 && this.retry.nudge();
975
989
  }
976
990
  };
977
- export { Se as Sender, V as a, K as i, Y as n, q as r, J as t };
991
+ export { Ce as Sender, V as a, K as i, Y as n, q as r, J as t };
978
992
 
979
- //# sourceMappingURL=sender-Bdp-TAS4.js.map
993
+ //# sourceMappingURL=sender-BRSpc7R8.js.map