@harperfast/harper 5.3.0-beta.4 → 5.3.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 (314) hide show
  1. package/bin/backup.ts +6 -1
  2. package/components/Application.ts +486 -115
  3. package/components/DESIGN.md +109 -21
  4. package/components/deploymentProvenance.ts +28 -0
  5. package/components/operations.js +14 -7
  6. package/components/packageComponent.ts +5 -1
  7. package/config-root.schema.json +1 -1
  8. package/dataLayer/DESIGN.md +35 -7
  9. package/dataLayer/blobBackup.ts +71 -30
  10. package/dataLayer/harperBridge/ResourceBridge.ts +16 -2
  11. package/dataLayer/rocksdbBackup.ts +88 -34
  12. package/dataLayer/schemaDescribe.ts +45 -1
  13. package/dist/bin/backup.js +1 -1
  14. package/dist/bin/backup.js.map +1 -1
  15. package/dist/components/Application.d.ts +11 -21
  16. package/dist/components/Application.js +436 -105
  17. package/dist/components/Application.js.map +1 -1
  18. package/dist/components/deploymentProvenance.d.ts +4 -0
  19. package/dist/components/deploymentProvenance.js +32 -0
  20. package/dist/components/deploymentProvenance.js.map +1 -0
  21. package/dist/components/operations.js +14 -7
  22. package/dist/components/operations.js.map +1 -1
  23. package/dist/components/packageComponent.js +6 -1
  24. package/dist/components/packageComponent.js.map +1 -1
  25. package/dist/dataLayer/blobBackup.d.ts +30 -3
  26. package/dist/dataLayer/blobBackup.js +73 -36
  27. package/dist/dataLayer/blobBackup.js.map +1 -1
  28. package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +1 -0
  29. package/dist/dataLayer/harperBridge/ResourceBridge.js +15 -3
  30. package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
  31. package/dist/dataLayer/rocksdbBackup.d.ts +4 -1
  32. package/dist/dataLayer/rocksdbBackup.js +74 -36
  33. package/dist/dataLayer/rocksdbBackup.js.map +1 -1
  34. package/dist/dataLayer/schemaDescribe.js +45 -1
  35. package/dist/dataLayer/schemaDescribe.js.map +1 -1
  36. package/dist/resources/DatabaseTransaction.d.ts +1 -0
  37. package/dist/resources/DatabaseTransaction.js +33 -8
  38. package/dist/resources/DatabaseTransaction.js.map +1 -1
  39. package/dist/resources/ResourceInterface.d.ts +7 -3
  40. package/dist/resources/ResourceInterface.js +2 -0
  41. package/dist/resources/ResourceInterface.js.map +1 -1
  42. package/dist/resources/Table.d.ts +151 -445
  43. package/dist/resources/Table.js +209 -8
  44. package/dist/resources/Table.js.map +1 -1
  45. package/dist/resources/analytics/write.d.ts +11 -0
  46. package/dist/resources/analytics/write.js +3 -0
  47. package/dist/resources/analytics/write.js.map +1 -1
  48. package/dist/resources/blob.d.ts +30 -0
  49. package/dist/resources/blob.js +189 -1
  50. package/dist/resources/blob.js.map +1 -1
  51. package/dist/resources/databases.d.ts +1 -0
  52. package/dist/resources/databases.js +80 -15
  53. package/dist/resources/databases.js.map +1 -1
  54. package/dist/resources/derivedIndexRuntime.d.ts +13 -0
  55. package/dist/resources/derivedIndexRuntime.js +57 -5
  56. package/dist/resources/derivedIndexRuntime.js.map +1 -1
  57. package/dist/resources/derivedIndexes.d.ts +1 -0
  58. package/dist/resources/derivedIndexes.js +116 -15
  59. package/dist/resources/derivedIndexes.js.map +1 -1
  60. package/dist/resources/fullTextSchema.d.ts +5 -3
  61. package/dist/resources/fullTextSchema.js +48 -5
  62. package/dist/resources/fullTextSchema.js.map +1 -1
  63. package/dist/resources/fullTextSchemaLifecycle.d.ts +2 -0
  64. package/dist/resources/fullTextSchemaLifecycle.js +33 -0
  65. package/dist/resources/fullTextSchemaLifecycle.js.map +1 -1
  66. package/dist/resources/graphql.js +30 -12
  67. package/dist/resources/graphql.js.map +1 -1
  68. package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +21 -1
  69. package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +114 -5
  70. package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
  71. package/dist/resources/indexes/fullTextDerivedIndex.d.ts +11 -2
  72. package/dist/resources/indexes/fullTextDerivedIndex.js +187 -24
  73. package/dist/resources/indexes/fullTextDerivedIndex.js.map +1 -1
  74. package/dist/resources/indexes/fullTextNativeBinding.d.ts +99 -1
  75. package/dist/resources/indexes/fullTextNativeBinding.js +35 -1
  76. package/dist/resources/indexes/fullTextNativeBinding.js.map +1 -1
  77. package/dist/resources/indexes/fullTextQueryIndex.d.ts +58 -0
  78. package/dist/resources/indexes/fullTextQueryIndex.js +943 -0
  79. package/dist/resources/indexes/fullTextQueryIndex.js.map +1 -0
  80. package/dist/resources/indexes/fullTextQueryProtocol.d.ts +6 -0
  81. package/dist/resources/indexes/fullTextQueryProtocol.js +32 -0
  82. package/dist/resources/indexes/fullTextQueryProtocol.js.map +1 -0
  83. package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.d.ts +4 -1
  84. package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.js +30 -7
  85. package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.js.map +1 -1
  86. package/dist/resources/search.d.ts +41 -0
  87. package/dist/resources/search.js +468 -26
  88. package/dist/resources/search.js.map +1 -1
  89. package/dist/resources/transactionBroadcast.js +101 -50
  90. package/dist/resources/transactionBroadcast.js.map +1 -1
  91. package/dist/resources/typeParity.d.ts +9 -0
  92. package/dist/resources/typeParity.js +3 -0
  93. package/dist/resources/typeParity.js.map +1 -0
  94. package/dist/server/REST.js.map +1 -1
  95. package/dist/server/itc/serverHandlers.js +48 -8
  96. package/dist/server/itc/serverHandlers.js.map +1 -1
  97. package/dist/server/serverHelpers/contentTypes.d.ts +7 -0
  98. package/dist/server/serverHelpers/contentTypes.js +36 -23
  99. package/dist/server/serverHelpers/contentTypes.js.map +1 -1
  100. package/dist/server/serverHelpers/uwsServer.js +28 -5
  101. package/dist/server/serverHelpers/uwsServer.js.map +1 -1
  102. package/dist/server/threads/itc.js +19 -0
  103. package/dist/server/threads/itc.js.map +1 -1
  104. package/dist/server/threads/manageThreads.d.ts +3 -0
  105. package/dist/server/threads/manageThreads.js +90 -23
  106. package/dist/server/threads/manageThreads.js.map +1 -1
  107. package/dist/utility/operation_authorization.js +25 -7
  108. package/dist/utility/operation_authorization.js.map +1 -1
  109. package/dist/utility/signalling.js +3 -0
  110. package/dist/utility/signalling.js.map +1 -1
  111. package/dist/validation/searchValidator.js +22 -2
  112. package/dist/validation/searchValidator.js.map +1 -1
  113. package/npm-shrinkwrap.json +22 -22
  114. package/package.json +2 -4
  115. package/resources/DESIGN.md +19 -2
  116. package/resources/DatabaseTransaction.ts +40 -10
  117. package/resources/FULL_TEXT.md +97 -0
  118. package/resources/ResourceInterface.ts +8 -2
  119. package/resources/Table.ts +767 -17
  120. package/resources/analytics/write.ts +3 -3
  121. package/resources/blob.ts +183 -1
  122. package/resources/databases.ts +126 -14
  123. package/resources/derivedIndexRuntime.ts +79 -6
  124. package/resources/derivedIndexes.ts +142 -18
  125. package/resources/fullTextSchema.ts +55 -9
  126. package/resources/fullTextSchemaLifecycle.ts +45 -0
  127. package/resources/graphql.ts +33 -12
  128. package/resources/indexes/DESIGN.md +167 -15
  129. package/resources/indexes/HierarchicalNavigableSmallWorld.ts +125 -5
  130. package/resources/indexes/fullTextDerivedIndex.ts +216 -32
  131. package/resources/indexes/fullTextNativeBinding.ts +133 -3
  132. package/resources/indexes/fullTextQueryIndex.ts +1120 -0
  133. package/resources/indexes/fullTextQueryProtocol.ts +35 -0
  134. package/resources/indexes/nativeFullTextDerivedIndexLifecycle.ts +28 -8
  135. package/resources/search.ts +513 -26
  136. package/resources/transactionBroadcast.ts +86 -47
  137. package/resources/typeParity.ts +20 -0
  138. package/schema.graphql +18 -5
  139. package/server/DESIGN.md +18 -0
  140. package/server/REST.ts +1 -1
  141. package/server/itc/serverHandlers.js +61 -8
  142. package/server/serverHelpers/contentTypes.ts +31 -26
  143. package/server/serverHelpers/uwsServer.ts +35 -7
  144. package/server/threads/itc.js +21 -0
  145. package/server/threads/manageThreads.js +95 -21
  146. package/studio/web/assets/{Chat-Bq60AO-g.js → Chat-CNEKMllJ.js} +13 -13
  147. package/studio/web/assets/FloatingChat-CEnWhHeR.js +23 -0
  148. package/studio/web/assets/SearchDialog-CwhJdEdY.js +1 -0
  149. package/studio/web/assets/{abnfDiagram-O67JEVCF-DpPZWMOf.js → abnfDiagram-O67JEVCF-raXE027J.js} +1 -1
  150. package/studio/web/assets/alertDialog-BbWD9Xxa.js +1 -0
  151. package/studio/web/assets/apiToken-DC5vsaaO.js +1 -0
  152. package/studio/web/assets/applications-DQZxDy0x.js +296 -0
  153. package/studio/web/assets/architecture-7GRP2DOG-DDmz3hpI.js +1 -0
  154. package/studio/web/assets/{architectureDiagram-NJMV4G6O-OmgLraID.js → architectureDiagram-NJMV4G6O-C8_Eet7w.js} +1 -1
  155. package/studio/web/assets/arrow-up-D2g_57vT.js +1 -0
  156. package/studio/web/assets/authStore-CJCaADw9.js +3 -0
  157. package/studio/web/assets/{blockDiagram-BEXU5L5S-Cv7CD3Ai.js → blockDiagram-BEXU5L5S-DR6S5-1D.js} +1 -1
  158. package/studio/web/assets/{button-MFP9n8Ck.js → button-DWwfgGWI.js} +2 -2
  159. package/studio/web/assets/{c4Diagram-YGBWAQC7-Ds1vKYnN.js → c4Diagram-YGBWAQC7-BAfZ1G01.js} +1 -1
  160. package/studio/web/assets/channel-D0AkPjJ8.js +1 -0
  161. package/studio/web/assets/{chevron-up-CFe8x5Bp.js → chevron-up-CFxbMGv2.js} +1 -1
  162. package/studio/web/assets/{chunk-3FUC2YCW-DpnBPH8B.js → chunk-3FUC2YCW-DuRp-j19.js} +1 -1
  163. package/studio/web/assets/{chunk-5DYCD2WN-LLLCQSzg.js → chunk-5DYCD2WN-BceBfIHT.js} +1 -1
  164. package/studio/web/assets/{chunk-742MDFTN-BL8J_pIO.js → chunk-742MDFTN-CIkt8ijt.js} +1 -1
  165. package/studio/web/assets/{chunk-7INBJB4K-C-hJHiiK.js → chunk-7INBJB4K-BpeAXyOi.js} +1 -1
  166. package/studio/web/assets/{chunk-7M6MHVWA-C6ZqkFbA.js → chunk-7M6MHVWA-h6WlaTzO.js} +1 -1
  167. package/studio/web/assets/{chunk-7PRAP22T-CUXM8BG6.js → chunk-7PRAP22T-KyqX6x3f.js} +1 -1
  168. package/studio/web/assets/{chunk-GTNCS2PH-DJ2BFvS1.js → chunk-GTNCS2PH-DGHLXyow.js} +1 -1
  169. package/studio/web/assets/{chunk-GWA4HPMP-C42bSqLL.js → chunk-GWA4HPMP-DsejB6gA.js} +1 -1
  170. package/studio/web/assets/{chunk-MBY4JIJT-C-5jz6Lo.js → chunk-MBY4JIJT-BwSGweQP.js} +1 -1
  171. package/studio/web/assets/{chunk-NETBCI7D-D-bzlN4r.js → chunk-NETBCI7D-C8UnOw_f.js} +1 -1
  172. package/studio/web/assets/{chunk-O7XYJQB3-ep14zA23.js → chunk-O7XYJQB3-CBS3nZYV.js} +1 -1
  173. package/studio/web/assets/{chunk-UA2S7LBM-BMRWRHED.js → chunk-UA2S7LBM-BHpEdH8D.js} +1 -1
  174. package/studio/web/assets/{chunk-WEXAMYUT-DdLYVdX1.js → chunk-WEXAMYUT-BAIhTwyh.js} +1 -1
  175. package/studio/web/assets/{chunk-Z7XXMR3K-BmKEDjcP.js → chunk-Z7XXMR3K-DSHbImdf.js} +1 -1
  176. package/studio/web/assets/{chunk-ZIGJFQKS-DLZgdNxA.js → chunk-ZIGJFQKS-Cs8fUn7y.js} +1 -1
  177. package/studio/web/assets/{classDiagram-v2-NBCMYWYE-DOI5vgKT.js → classDiagram-v2-NBCMYWYE-DmDPkt2u.js} +1 -1
  178. package/studio/web/assets/cn-6T8VranJ.js +1 -0
  179. package/studio/web/assets/{codicon-Brq4_Ui5.ttf → codicon-DF1abBS2.ttf} +0 -0
  180. package/studio/web/assets/{createLucideIcon-bziYxJli.js → createLucideIcon-fO5dL7D5.js} +1 -1
  181. package/studio/web/assets/{css.worker-l1psR_wG.js → css.worker-DoT-OOzx.js} +36 -36
  182. package/studio/web/assets/{cssMode-DJyc9mHj.js → cssMode-Dz2DxF4e.js} +1 -1
  183. package/studio/web/assets/{cynefin-OW5HDTMX-BSW-DB7S.js → cynefin-OW5HDTMX-DIvbXLSj.js} +1 -1
  184. package/studio/web/assets/{cynefinDiagram-VND7K2PF-CbAHEwxt.js → cynefinDiagram-VND7K2PF-BdtaXiCE.js} +1 -1
  185. package/studio/web/assets/{dagre-6A5THRUB-Csxewgs4.js → dagre-6A5THRUB-C7RUWHyz.js} +1 -1
  186. package/studio/web/assets/{diagram-22UHCM2B-a0rt8tY4.js → diagram-22UHCM2B-DJCvcaWP.js} +1 -1
  187. package/studio/web/assets/{diagram-3UASUU5V-lEj2SVNh.js → diagram-3UASUU5V-Du6VKWln.js} +1 -1
  188. package/studio/web/assets/{diagram-ATOU4E4O-HcrAeB-q.js → diagram-ATOU4E4O-dxRfeG4B.js} +1 -1
  189. package/studio/web/assets/{diagram-CDSNMT55-CYxiuyEx.js → diagram-CDSNMT55-l5Ga0u-W.js} +1 -1
  190. package/studio/web/assets/{diagram-MLGK6HIB-ChbCJTgJ.js → diagram-MLGK6HIB-CNQY47LA.js} +1 -1
  191. package/studio/web/assets/{diagram-MPIPVDR6-DaX9Y-N3.js → diagram-MPIPVDR6-7prveD1B.js} +1 -1
  192. package/studio/web/assets/{dist-Cz2Y6-6G.js → dist-BrRuMUzt.js} +1 -1
  193. package/studio/web/assets/{download-CtostjYn.js → download-Cn6tPG4L.js} +1 -1
  194. package/studio/web/assets/{ebnfDiagram-ZINNZB2B-CwAsENB1.js → ebnfDiagram-ZINNZB2B-5OnkTpfi.js} +1 -1
  195. package/studio/web/assets/{editor-DDIsQfj6.js → editor-B3mjd3tz.js} +1 -1
  196. package/studio/web/assets/editor.worker-Yd1NR0QT.js +33 -0
  197. package/studio/web/assets/{elk-276RUBZZ-Hexg9E4D.js → elk-276RUBZZ-DxDQPjQT.js} +1 -1
  198. package/studio/web/assets/{erDiagram-OPXOYQCR-CeC-wwO1.js → erDiagram-OPXOYQCR-CQlCX84D.js} +1 -1
  199. package/studio/web/assets/eventmodeling-NTZA5JFV-DONQf5aG.js +1 -0
  200. package/studio/web/assets/flowDiagram-KWPJA3E3-BoZ8_QR1.js +1 -0
  201. package/studio/web/assets/{ganttDiagram-FUAMR5RP-C2_Hhl1-.js → ganttDiagram-FUAMR5RP-bloX3Voy.js} +1 -1
  202. package/studio/web/assets/{getAnalytics-CjthMQqF.js → getAnalytics-C0FHjtdQ.js} +1 -1
  203. package/studio/web/assets/{gitGraph-4MIJSDKK-xIk5Vuew.js → gitGraph-4MIJSDKK-BrXWmJt2.js} +1 -1
  204. package/studio/web/assets/{gitGraphDiagram-X574FWY7-CMxJ34up.js → gitGraphDiagram-X574FWY7-C2KnnZeY.js} +1 -1
  205. package/studio/web/assets/{html-g1BJHxLy.js → html-BsRGM7tp.js} +1 -1
  206. package/studio/web/assets/{html.worker-DdwM4IrA.js → html.worker-B1dwY0Ay.js} +27 -27
  207. package/studio/web/assets/{htmlMode-Vh5IglCQ.js → htmlMode-tUKJaA3o.js} +1 -1
  208. package/studio/web/assets/index-72cEH474.css +1 -0
  209. package/studio/web/assets/index-BuqFjN5K.js +828 -0
  210. package/studio/web/assets/index.lazy-CcpfQFY_.js +2 -0
  211. package/studio/web/assets/{info-A6RAGUB7-o49TEbj-.js → info-A6RAGUB7-BhzBHe4U.js} +1 -1
  212. package/studio/web/assets/{infoDiagram-VRGFBTTK-Cjhh7yzZ.js → infoDiagram-VRGFBTTK-B0J1132p.js} +1 -1
  213. package/studio/web/assets/{ishikawaDiagram-OU5B5YK6-C63aXRmh.js → ishikawaDiagram-OU5B5YK6-BNk0tuQx.js} +1 -1
  214. package/studio/web/assets/{javascript-5VIolqf7.js → javascript-BZ_uRGHl.js} +1 -1
  215. package/studio/web/assets/{journeyDiagram-ZHPQQLJL-D_o0P5Mu.js → journeyDiagram-ZHPQQLJL-Be79RMQM.js} +1 -1
  216. package/studio/web/assets/json.worker-BQqXGI3X.js +65 -0
  217. package/studio/web/assets/{jsonMode-DG4zQraI.js → jsonMode-DgB-aFMj.js} +1 -1
  218. package/studio/web/assets/{kanban-definition-PNTS6WVX-CTI9SSxY.js → kanban-definition-PNTS6WVX-4uuoQP9W.js} +1 -1
  219. package/studio/web/assets/{languageServices-t5FBpX-i.js → languageServices-BleuBw17.js} +1 -1
  220. package/studio/web/assets/localStorageKeys-etzFY_xV.js +1 -0
  221. package/studio/web/assets/{lspLanguageFeatures-DgVnNPh-.js → lspLanguageFeatures-ByVYLSsQ.js} +1 -1
  222. package/studio/web/assets/{mermaid-parser.core-C2lcH_jP.js → mermaid-parser.core-V1UYMeXV.js} +3 -3
  223. package/studio/web/assets/{mermaid.core-BG5bjfIG.js → mermaid.core-1PX6R49U.js} +4 -4
  224. package/studio/web/assets/{mindmap-definition-NLK3R4M7-BK7ho6JD.js → mindmap-definition-NLK3R4M7-C70Ctm0J.js} +1 -1
  225. package/studio/web/assets/notifications-D1Nf-Edn.js +1 -0
  226. package/studio/web/assets/notifications-TuzN0IMi.js +1 -0
  227. package/studio/web/assets/{packet-AYTQ26CC-BHPy6KBV.js → packet-AYTQ26CC-DWbXHx5g.js} +1 -1
  228. package/studio/web/assets/{pegDiagram-GJSIUBJH-DzjwG3jO.js → pegDiagram-GJSIUBJH-d6z1cc7W.js} +1 -1
  229. package/studio/web/assets/{pie-WAS4IAKB-D0cP-DTU.js → pie-WAS4IAKB-DjoTm3yr.js} +1 -1
  230. package/studio/web/assets/{pieDiagram-5QR66LMP-C_hOP9Lv.js → pieDiagram-5QR66LMP-Dz3RHpDA.js} +1 -1
  231. package/studio/web/assets/profile-D7C7Lupz.js +1 -0
  232. package/studio/web/assets/{quadrantDiagram-O4NWA36T-CZW8PbV1.js → quadrantDiagram-O4NWA36T-CIF5Qkou.js} +1 -1
  233. package/studio/web/assets/{radar-RG4KPBEZ-C8fk0U81.js → radar-RG4KPBEZ-CVBgjCOj.js} +1 -1
  234. package/studio/web/assets/{railroad-74A4TZTK-B60FWm17.js → railroad-74A4TZTK-BdhXw10Q.js} +1 -1
  235. package/studio/web/assets/railroad-abnf-HS5TGJTU-BcoQPN39.js +1 -0
  236. package/studio/web/assets/railroad-ebnf-LZEXJU2U-B1Lke2JN.js +1 -0
  237. package/studio/web/assets/railroad-peg-WCYAUIDC-D-oJFkiV.js +1 -0
  238. package/studio/web/assets/{railroadDiagram-XR7U4H2S-DyyNmgbU.js → railroadDiagram-XR7U4H2S-y3Jv2U6N.js} +1 -1
  239. package/studio/web/assets/regions-nGQCm-v8.js +1 -0
  240. package/studio/web/assets/register-C3x9Ze6P.js +909 -0
  241. package/studio/web/assets/register-DjpsE8to.css +1 -0
  242. package/studio/web/assets/{requirementDiagram-PLB6GJNP-C4H-mLKu.js → requirementDiagram-PLB6GJNP-ChINZEmu.js} +1 -1
  243. package/studio/web/assets/restartGate-nHAFLDh-.js +1 -0
  244. package/studio/web/assets/{sankeyDiagram-IPEJSGJF-DHDyga4c.js → sankeyDiagram-IPEJSGJF-D9AyLce2.js} +1 -1
  245. package/studio/web/assets/{sequenceDiagram-PO4LG4MO-CdNcHXRI.js → sequenceDiagram-PO4LG4MO-hfk4aIEm.js} +1 -1
  246. package/studio/web/assets/{setComponentFile-z4-qJCbA.js → setComponentFile-DpjrRqeG.js} +1 -1
  247. package/studio/web/assets/{setup-CS50uJ4x.js → setup-CGiKLZ9e.js} +2 -2
  248. package/studio/web/assets/{stateDiagram-v2-GCMORJYK-CpKuXq15.js → stateDiagram-v2-GCMORJYK-Bs8RIb9K.js} +1 -1
  249. package/studio/web/assets/status-CGJwrNPH.js +61 -0
  250. package/studio/web/assets/{swimlanes-2SLR337P-NRHa2D8I.js → swimlanes-2SLR337P-B52xrf6t.js} +1 -1
  251. package/studio/web/assets/swimlanesDiagram-TC7HE7FX-DfN7BAP5.js +8 -0
  252. package/studio/web/assets/tabs-BCTQzoQK.js +1 -0
  253. package/studio/web/assets/{timeline-definition-EJHVYXUP-D39Y-xpq.js → timeline-definition-EJHVYXUP-DJSITpQX.js} +1 -1
  254. package/studio/web/assets/toggleHighContrast-C-Ne6P7T.js +51 -0
  255. package/studio/web/assets/toggleHighContrast-n7clI0si.css +1 -0
  256. package/studio/web/assets/{treeView-Q6P3EWNA-CRWR9OqD.js → treeView-Q6P3EWNA-C-epdxRo.js} +1 -1
  257. package/studio/web/assets/{treemap-WGGIJYW6-ZfXyJgLO.js → treemap-WGGIJYW6-DOVyp_zw.js} +1 -1
  258. package/studio/web/assets/{ts.worker-DDMUrpqh.js → ts.worker-Clm12uY6.js} +131 -131
  259. package/studio/web/assets/{tsMode-D83Gg3cq.js → tsMode-CSreYTys.js} +1 -1
  260. package/studio/web/assets/{typescript-Dfp-GrNq.js → typescript-MnxBk89W.js} +1 -1
  261. package/studio/web/assets/{useEntityRestURL-BKetlINf.js → useEntityRestURL-TNrh77-s.js} +1 -1
  262. package/studio/web/assets/{usecaseDiagram-POWQR4AR-jf-zIDZ_.js → usecaseDiagram-POWQR4AR-B6252cbq.js} +1 -1
  263. package/studio/web/assets/{vendor-core-BdkdbUek.js → vendor-core-6LhfJlRC.js} +1 -1
  264. package/studio/web/assets/vendor-datadog-ozKf-pts.js +6 -0
  265. package/studio/web/assets/{vendor-react-izWchTRL.js → vendor-react-BOliS0BL.js} +1 -1
  266. package/studio/web/assets/vendor-tanstack-Bntfka-M.js +2 -0
  267. package/studio/web/assets/vendor-ui-9EYYDgoN.js +41 -0
  268. package/studio/web/assets/{vennDiagram-UO4OBE2U-BKYAZUh_.js → vennDiagram-UO4OBE2U-DZTsDA4k.js} +1 -1
  269. package/studio/web/assets/{wardley-WFR3VGLG-BO7f36ci.js → wardley-WFR3VGLG-Cfqoe6z4.js} +1 -1
  270. package/studio/web/assets/{wardleyDiagram-VNRHLVJA-Djb0JDQc.js → wardleyDiagram-VNRHLVJA-qu_f7Tvl.js} +1 -1
  271. package/studio/web/assets/{workers-CCvmDLH3.js → workers-BfZlUNVI.js} +3 -3
  272. package/studio/web/assets/{xml-06pZp00U.js → xml-BHd6qGH7.js} +1 -1
  273. package/studio/web/assets/{xychartDiagram-PMCCYNJV-BQh9ubvb.js → xychartDiagram-PMCCYNJV-UrOKRsmR.js} +1 -1
  274. package/studio/web/assets/{yaml-iSnWMVlV.js → yaml-C53R8OQq.js} +1 -1
  275. package/studio/web/assets/{yaml.worker-DAK2o_H1.js → yaml.worker-D9JekGdp.js} +183 -183
  276. package/studio/web/index.html +15 -15
  277. package/utility/operation_authorization.ts +27 -7
  278. package/utility/signalling.ts +3 -0
  279. package/validation/searchValidator.ts +22 -13
  280. package/studio/web/assets/FloatingChat-D4560T0p.js +0 -23
  281. package/studio/web/assets/alertDialog-UrbiMgQt.js +0 -1
  282. package/studio/web/assets/apiToken-BEvbFPMc.js +0 -1
  283. package/studio/web/assets/applications-CSUVTH4E.js +0 -296
  284. package/studio/web/assets/architecture-7GRP2DOG-11l4Ny1l.js +0 -1
  285. package/studio/web/assets/authStore-5jSS5pTW.js +0 -3
  286. package/studio/web/assets/channel-BDtouPd6.js +0 -1
  287. package/studio/web/assets/dialog-DTepachC.js +0 -1
  288. package/studio/web/assets/editor.worker-CkkvdXvO.js +0 -33
  289. package/studio/web/assets/eventmodeling-NTZA5JFV-CFb03e0o.js +0 -1
  290. package/studio/web/assets/flowDiagram-KWPJA3E3-Cidi00_Y.js +0 -1
  291. package/studio/web/assets/index-CPoDzQTe.css +0 -1
  292. package/studio/web/assets/index-DGRAzvO4.js +0 -824
  293. package/studio/web/assets/index.lazy-vgSic7et.js +0 -2
  294. package/studio/web/assets/json.worker-CSi2hF-a.js +0 -65
  295. package/studio/web/assets/notifications-BeWcX04m.js +0 -1
  296. package/studio/web/assets/notifications-DUGWrWoO.js +0 -1
  297. package/studio/web/assets/profile-BvUEDBzW.js +0 -1
  298. package/studio/web/assets/railroad-abnf-HS5TGJTU-CLMVZvH0.js +0 -1
  299. package/studio/web/assets/railroad-ebnf-LZEXJU2U--tlwFoVB.js +0 -1
  300. package/studio/web/assets/railroad-peg-WCYAUIDC-Dpuslblm.js +0 -1
  301. package/studio/web/assets/regions-CB-_2m7M.js +0 -1
  302. package/studio/web/assets/register-1w1Zr3b2.js +0 -848
  303. package/studio/web/assets/register-jjEx9u7D.css +0 -1
  304. package/studio/web/assets/setLocalStorage-D_kflv4U.js +0 -1
  305. package/studio/web/assets/status-CI0wOdOE.js +0 -61
  306. package/studio/web/assets/swimlanesDiagram-TC7HE7FX-BBk4t4hO.js +0 -8
  307. package/studio/web/assets/tabs-CnQ_zenf.js +0 -1
  308. package/studio/web/assets/toggleHighContrast--ixms01u.css +0 -1
  309. package/studio/web/assets/toggleHighContrast-BsAE4jPe.js +0 -49
  310. package/studio/web/assets/useLocalStorage-BYoZF60G.js +0 -1
  311. package/studio/web/assets/vendor-datadog-fCQhBHGk.js +0 -6
  312. package/studio/web/assets/vendor-tanstack-CQ1aRjVa.js +0 -2
  313. package/studio/web/assets/vendor-ui-aE1tHcW7.js +0 -41
  314. package/studio/web/assets/x-vYntCxm4.js +0 -1
@@ -0,0 +1,6 @@
1
+ import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var ee=x.prototype=new b;ee.constructor=x,_(ee,y.prototype),ee.isPureReactComponent=!0;var te=Array.isArray;function ne(){}var S={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function C(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return C(e.type,t,e.props)}function ae(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function oe(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var se=/\/+/g;function ce(e,t){return typeof e==`object`&&e&&e.key!=null?oe(``+e.key):t.toString(36)}function le(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ne,ne):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ue(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ue(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ce(e,0):a,te(o)?(i=``,c!=null&&(i=c.replace(se,`$&/`)+`/`),ue(o,r,i,``,function(e){return e})):o!=null&&(ae(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(se,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(te(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ce(a,u),c+=ue(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ce(a,u++),c+=ue(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ue(le(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function de(e,t,n){if(e==null)return e;var r=[],i=0;return ue(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function fe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var pe=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function me(e){var t=S.T,n={};n.types=t===null?null:t.types,S.T=n;try{var r=e(),i=S.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(ne,pe)}catch(e){pe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),S.T=t}}function he(e){var t=S.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else me(he.bind(null,e))}var ge={map:de,forEach:function(e,t,n){de(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return de(e,function(){t++}),t},toArray:function(e){return de(e,function(e){return e})||[]},only:function(e){if(!ae(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ge,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.addTransitionType=he,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!re.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return C(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)re.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return C(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ae,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:fe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=me,e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return S.H.useTransition()},e.version=`19.3.0`})),i=n(((e,t)=>{t.exports=r()})),a=`modulepreload`,o=function(e){return`/`+e},s={},c=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),c=i?.nonce||i?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=l(t.map(t=>{if(t=o(t,n),t=u(t),t in s)return;s[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:a,r||(i.as=`script`),i.crossOrigin=``,i.href=t,c&&i.setAttribute(`nonce`,c),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function l(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function u(e){return l(e)===`object`}function d(e){return typeof e==`number`&&e>=0&&e<=100}function f(e){return typeof e==`string`||e instanceof RegExp||typeof e==`function`}function p(e,t){return m(e,t,_())}function m(e,t,n){if(t===void 0)return e;if(typeof t!=`object`||!t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){let r=Array.isArray(e)?e:[];for(let e=0;e<t.length;++e)r[e]=m(r[e],t[e],n);return r}let r=l(e)===`object`?e:{};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&e!==`__proto__`&&(r[e]=m(r[e],t[e],n));return r}function h(e){return p(void 0,e)}function g(...e){let t;for(let n of e)n!=null&&(t=p(t,n));return t}function _(){let e=new WeakSet;return{hasAlreadyBeenSeen(t){let n=e.has(t);return n||e.add(t),n}}}var v=`https://docs.datadoghq.com`,y=`More details:`,b={log:`log`,debug:`debug`,info:`info`,warn:`warn`,error:`error`},x=console,ee={log:x.log,debug:x.debug,info:x.info,warn:x.warn,error:x.error};function te(e){return{debug:ee.debug.bind(x,e),log:ee.log.bind(x,e),info:ee.info.bind(x,e),warn:ee.warn.bind(x,e),error:ee.error.bind(x,e)}}var ne=!1;function S(e){ne=e}function re(){return ne}var C=globalThis,ie=`WorkerGlobalScope`in C;function ae(e){return ce(e,C.document?.baseURI??C.location?.href).href}function oe(e){try{return!!ce(e)}catch{return!1}}function se(e){let t=ce(e).pathname;return t[0]===`/`?t:`/${t}`}function ce(e,t){let n=ue();try{return t===void 0?new n(e):new n(e,t)}catch(e){throw Error(`Failed to construct URL: ${String(e)}`)}}var le;function ue(){if(!le){let e=!1;try{e=new C.URL(`b`,`http://a`).href===`http://a/b`}catch{}le=e?C.URL:fe().URL}return le}var de;function fe(){if(!de){let e,t;try{e=document.createElement(`iframe`),e.style.display=`none`,document.body.appendChild(e),t=e.contentWindow??C}catch{t=C}de={URL:t.URL},e?.remove()}return de}function pe(e,t){function n(e,t,n){n.value=r(n.value)}function r(e){return function(...t){return i(e,this,t)}}function i(e,t,n){try{return e.apply(t,n)}catch(e){a(e)}}function a(n){let r=t=>{re()&&e.error(`[MONITOR]`,t)};r(n);try{t(n)}catch(e){r(e)}}return{monitored:n,monitor:r,callMonitored:i,monitorError:a}}var me=te(`Datadog SDK:`),he,ge=pe(me,e=>he?.(e)),w=ge.monitor,_e=ge.callMonitored,T=ge.monitorError;function ve(e){return!he&&(he=e,!0)}function ye(e){let t=C.queueMicrotask;typeof t==`function`?t(w(e)):Promise.resolve().then(w(e))}var E=class{constructor(e){this.onFirstSubscribe=e,this.observers=[]}subscribe(e){return this.addObserver(e),{unsubscribe:()=>this.removeObserver(e)}}notify(e){this.observers.forEach(t=>t(e))}addObserver(e){this.observers.push(e),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(e){this.observers=this.observers.filter(t=>e!==t),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}};function be(...e){return new E(t=>{let n=e.map(e=>e.subscribe(e=>t.notify(e)));return()=>n.forEach(e=>e.unsubscribe())})}var xe=class extends E{constructor(e,t){super(),this.maxBufferSize=e,this.onDrop=t,this.buffer=[],this.droppedCount=0}notify(e){this.buffer.push(e),this.buffer.length>this.maxBufferSize&&(this.buffer.shift(),this.droppedCount++),super.notify(e)}subscribe(e){let t=!1;return ye(()=>{for(let n of this.buffer){if(t)return;e(n)}t||this.addObserver(e)}),{unsubscribe:()=>{t=!0,this.removeObserver(e)}}}unbuffer(){ye(()=>{this.droppedCount>0&&this.onDrop&&this.onDrop(this.droppedCount),this.maxBufferSize=this.buffer.length=0})}},Se={GRANTED:`granted`,NOT_GRANTED:`not-granted`};function Ce(e){let t=new E;function n(){return e===Se.GRANTED}return{tryToInit(t){e||=t},onGrantedOnce(e){if(n())e();else{let r=t.subscribe(()=>{n()&&(e(),r.unsubscribe())})}},update(n){e=n,t.notify()},isGranted:n,observable:t}}var we=`datad0g.com`,Te=`datadoghq.com`,Ee=`datadoghq.eu`,De=`ddog-gov.com`,Oe=`us2.ddog-gov.com`,ke=[`ddsource`,`dd-api-key`,`dd-request-id`];function Ae(e){return ke.every(t=>e.includes(t))}var D=1e3,je=60*D,Me=60*je,Ne=31536e6;function Pe(){return new Date().getTime()}function O(){return Pe()}function k(e,t){return t-e}function A(e){return typeof e==`number`?Math.round(e*1e6):e}function Fe(e,t){return e+t}function Ie(){return performance.now()}function j(){return{relative:Ie(),timeStamp:O()}}function Le(){return{relative:0,timeStamp:Ge()}}function Re(e){return{relative:e,timeStamp:Ke(e)}}function ze(e){return{relative:Be(e),timeStamp:e}}function Be(e){return e-Ge()}function Ve(e){return Math.round(Fe(Ge(),e))}function He(e){return e<Ne}function Ue(){return Math.round(Pe()-Fe(Ge(),performance.now()))}var We;function Ge(){return We===void 0&&(We=performance.timing?.navigationStart??performance.timeOrigin),We}function Ke(e){let t=Pe()-performance.now();return t>Ge()?Math.round(Fe(t,e)):Ve(e)}function qe(e,t,n){return{build(r,i){return Ye({proxy:e.proxy,site:e.site,path:`/api/v2/${t}`,parameters:Xe(e,t,r,i,n)})},trackType:t}}function Je({replica:e,proxy:t,source:n},r){if(e)return qe({clientToken:e.clientToken,proxy:t,source:n,site:Te},r,r===`rum`?[`application.id=${e.applicationId}`]:void 0)}function Ye({proxy:e,site:t=Te,path:n,parameters:r=``,subdomain:i}){let a=n;if(r&&(a+=`?${r}`),typeof e==`string`){let t=`${ae(e)}?ddforward=${encodeURIComponent(a)}`;return i&&(t+=`&ddforwardSubdomain=${i}`),t}if(typeof e==`function`)return e({path:n,parameters:r,subdomain:i});let o=t.split(`.`),s=o.pop(),c=`browser-intake-${o.join(`-`)}.${s}`;return i&&(c=`${i}.${c}`),`https://${c}${a}`}function Xe({clientToken:e,source:t=`browser`},n,r,{retry:i,encoding:a},o=[]){let s=[`ddsource=${t}`,`dd-api-key=${e}`,`dd-evp-origin-version=7.14.0`,`dd-evp-origin=browser`,`dd-request-id=${Ze()}`].concat(o);return a&&s.push(`dd-evp-encoding=${a}`),n===`rum`&&(s.push(`batch_time=${O()}`,`_dd.api=${r}`),i&&s.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),s.join(`&`)}function Ze(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,Ze)}var Qe={ALLOW:`allow`,MASK:`mask`,MASK_USER_INPUT:`mask-user-input`,MASK_UNLESS_ALLOWLISTED:`mask-unless-allowlisted`},$e={ALL:`all`,SAMPLED:`sampled`},et={clientToken:{type:`string`,required:!0},service:{type:`string`},env:{type:`string`},version:{type:`string`},site:{type:`site`,default:Te},proxy:{type:`union`,variants:[{type:`string`},{type:`function`,signature:void 0}]},sessionSampleRate:{type:`percentage`,default:100},telemetrySampleRate:{type:`percentage`,default:20},telemetryConfigurationSampleRate:{type:`percentage`,default:5},telemetryUsageSampleRate:{type:`percentage`,default:5},silentMultipleInit:{type:`boolean`,default:!1,strict:!1},storeContextsAcrossPages:{type:`boolean`,default:!1,strict:!1},trackAnonymousUser:{type:`boolean`,default:!0,strict:!1},useSecureSessionCookie:{type:`boolean`,default:!1,strict:!1},usePartitionedCrossSiteSessionCookie:{type:`boolean`,default:!1,strict:!1},trackSessionAcrossSubdomains:{type:`boolean`,default:!1,strict:!1},allowedTrackingOrigins:{type:`match-option`,multiple:!0,strict:!1},trackingConsent:{type:`enum`,values:Se,default:Se.GRANTED},beforeSend:{type:`function`,signature:void 0},source:{type:`enum`,values:[`browser`,`flutter`,`unity`],default:`browser`,strict:!1},sessionPersistence:{type:`enum`,values:[`cookie`,`local-storage`,`memory`],multiple:!0,strict:!1},replica:{type:`schema`,schema:{clientToken:{type:`string`,required:!0},applicationId:{type:`string`}}},datacenter:{type:`string`},sdkVersion:{type:`string`},variant:{type:`string`}};function tt(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:Array.isArray(e.sessionPersistence)?e.sessionPersistence[0]:e.sessionPersistence,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}function M(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,M)}var nt=/(\S+?)\s*=\s*(.*?)(?:;|$)/g;function rt(e,t){for(nt.lastIndex=0;;){let n=nt.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function it(e){let t=new Map;for(nt.lastIndex=0;;){let n=nt.exec(e);if(n){let e=n[1],r=n[2];t.has(e)?t.get(e).push(r):t.set(e,[r])}else break}return t}function at(e){let t=new Map;for(nt.lastIndex=0;;){let n=nt.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function ot(e,t,n=``){let r=e.charCodeAt(t-1),i=r>=55296&&r<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function st(e,t){return t?`${e}-v${t.split(`.`)[0]}`:e}function ct(...e){let t=e.filter(e=>!!e);return t.length>0?t:void 0}function lt(e,t,n=0,r){let i=new Date;i.setTime(i.getTime()+n);let a=`expires=${i.toUTCString()}`,o=r?.crossSite?`none`:`strict`,s=r?.domain?`;domain=${r.domain}`:``,c=r?.secure?`;secure`:``,l=r?.partitioned?`;partitioned`:``;document.cookie=`${e}=${t};${a};path=/;samesite=${o}${s}${c}${l}`}function ut(e){let t=rt(document.cookie,e);if(t!==``)return t}function dt(e){return it(document.cookie).get(e)||[]}var ft;function pt(e){return ft||=at(document.cookie),ft.get(e)}function mt(e,t){lt(e,``,0,t)}var ht;function gt(e=C.location?.hostname??``,t=typeof document<`u`?document.referrer:``){if(typeof document<`u`){if(ht===void 0){let n=_t(e,t);if(n){let e=`dd_site_test_${M()}`,t=n.split(`.`),r=t.pop();for(;t.length&&!ut(e);)r=`${t.pop()}.${r}`,lt(e,`test`,D,{domain:r});mt(e,{domain:r}),ht=r}}return ht}}function _t(e,t){try{return e||ce(t).hostname}catch{}}function vt(e){let t={};if(t.secure=e.useSecureSessionCookie||e.usePartitionedCrossSiteSessionCookie,t.crossSite=e.usePartitionedCrossSiteSessionCookie,t.partitioned=e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){let e=gt();if(!e)return;t.domain=e}return t}var N=te(`Datadog Browser SDK:`),yt=`${v}/real_user_monitoring/browser/troubleshooting`;function bt(e,t,n=!1){return e.some(e=>{try{if(typeof e==`function`)return e(t);if(e instanceof RegExp)return e.lastIndex=0,e.test(t);if(typeof e==`string`)return n?t.startsWith(e):e===t}catch(e){N.error(e)}return!1})}function P(e){return e}var xt=[`chrome-extension://`,`moz-extension://`];function St(e){return xt.some(t=>e.includes(t))}function Ct(e,t=``){return!St(e)&&St(t.split(`
2
+ `).filter(e=>{let t=e.trim();return t.length&&/^at\s+|@/.test(t)})[1]||``)}var wt="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",Tt=`SDK initialized on a non-allowed domain.`;function Et(e,t){let n=P(C.location),r=n?n.origin:``,i=e.allowedTrackingOrigins;if(!i)return!Ct(r,t)||(N.error(wt),!1);let a=bt(i,r);return a||N.error(Tt),a}var Dt=(e,t)=>e===`__proto__`?void 0:t;function Ot(e){try{return JSON.parse(e,Dt)}catch{}}function kt(e){return{...e}}function At(e,t){return Object.keys(e).some(n=>e[n]===t)}function jt(e){return Object.keys(e).length===0}function Mt(e,t){let n={};for(let r of Object.keys(e))n[r]=t(e[r]);return n}var Nt=function(e){return e.SESSION_REPLAY_RECORD_CANVAS=`session_replay_record_canvas`,e.TRACK_INTAKE_REQUESTS=`track_intake_requests`,e.TRACK_WEBSOCKETS=`track_websockets`,e.SOFT_NAVIGATION=`soft_navigation`,e}({}),Pt=new Set;function Ft(e){Array.isArray(e)&&It(e.filter(e=>At(Nt,e)))}function It(e){e.forEach(e=>{Pt.add(e)})}function Lt(e){return Pt.has(e)}function Rt(){return Pt}function zt(e,t){let n=C,r;return n.Zone&&typeof n.Zone.__symbol__==`function`&&(r=e[n.Zone.__symbol__(t)]),r||=e[t],r}function F(e,t){return zt(C,`setTimeout`)(w(e),t)}function I(e){zt(C,`clearTimeout`)(e)}function Bt(e,t){return zt(C,`setInterval`)(w(e),t)}function Vt(e){zt(C,`clearInterval`)(e)}function Ht(e,t,n){let r=n?.leading===void 0||n.leading,i=n?.trailing===void 0||n.trailing,a=!1,o,s;return{throttled:(...n)=>{if(a){o=n;return}r?e(...n):o=n,a=!0,s=F(()=>{i&&o&&e(...o),a=!1,o=void 0},t)},cancel:()=>{I(s),a=!1,o=void 0}}}function L(){}var Ut=`?`;function Wt(e){let t=[],n=rn(e,`stack`),r=String(e);if(n?.startsWith(r)&&(n=n.slice(r.length)),n&&n.split(`
3
+ `).forEach(e=>{let n=Yt(e)||Zt(e)||$t(e)||nn(e);n&&(!n.func&&n.line&&(n.func=Ut),t.push(n))}),t.length>0&&un()&&e instanceof Error){let n=[],r=e;for(;(r=Object.getPrototypeOf(r))&&cn(r);){let e=r.constructor?.name||Ut;n.push(e)}for(let e=n.length-1;e>=0&&t[0]?.func===n[e];e--)t.shift()}return{message:rn(e,`message`),name:rn(e,`name`),stack:t}}var Gt=`((?:blob|native|eval|<anonymous>|[a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/|\\w+\\.|\\/).*?)`,Kt=`(?::(\\d+))`,qt=RegExp(`^\\s*at (.*?) ?\\(${Gt}${Kt}?${Kt}?\\)?\\s*$`,`i`),Jt=RegExp(`\\((\\S*)${Kt}${Kt}\\)`);function Yt(e){let t=qt.exec(e);if(!t)return;let n=t[2]?.indexOf(`native`)===0,r=t[2]?.indexOf(`eval`)===0,i=Jt.exec(t[2]);return r&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Ut,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}var Xt=RegExp(`^\\s*at\\s*(?:(.*)?(?: @))?\\s*${Gt}${Kt}?${Kt}??\\s*$`,`i`);function Zt(e){let t=Xt.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ut,line:t[3]?+t[3]:void 0,url:t[2]}}var Qt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function $t(e){let t=Qt.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ut,line:+t[3],url:t[2]}}var en=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,tn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function nn(e){let t=en.exec(e);if(!t)return;let n=t[3]&&t[3].indexOf(` > eval`)>-1,r=tn.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(`,`):[],column:t[5]?+t[5]:void 0,func:t[1]||Ut,line:t[4]?+t[4]:void 0,url:t[3]}}function rn(e,t){return u(e)&&typeof e[t]==`string`?e[t]:void 0}function an(e,t,n,r){if(t===void 0)return;let{name:i,message:a}=sn(e);return{name:i,message:a,stack:[{url:t,column:r,line:n}]}}var on=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function sn(e){let t,n;return{}.toString.call(e)===`[object String]`&&([,t,n]=on.exec(e)),{name:t,message:n}}function cn(e){return String(e.constructor).startsWith(`class `)}var ln;function un(){if(ln!==void 0)return ln;class e extends Error{constructor(){super(),this.name=`Error`}}let[t,n]=[e,Error].map(e=>new e);return ln=cn(Object.getPrototypeOf(t))&&n.stack!==t.stack,ln}function dn(e){let t=Error(e);t.name=`HandlingStack`;let n;return _e(()=>{let e=Wt(t);e.stack=e.stack.slice(2),n=fn(e)}),n}function fn(e){let t=pn(e);return e.stack.forEach(e=>{let n=e.func===`?`?`<anonymous>`:e.func,r=e.args&&e.args.length>0?`(${e.args.join(`, `)})`:``,i=e.line?`:${e.line}`:``,a=e.line&&e.column?`:${e.column}`:``;t+=`\n at ${n}${r} @ ${e.url}${i}${a}`}),t}function pn(e){return`${e.name||`Error`}: ${e.message}`}function R(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!=`function`){if(t in e&&typeof t==`string`&&t.startsWith(`on`))i=L;else return{stop:L}}let a=!1,{stop:o}=hn(e,t,i,function(){if(a)return i.apply(this,arguments);let e=Array.from(arguments);return _n(n,{target:this,parameters:e,handlingStack:r?dn(`instrumented method`):void 0},()=>i.apply(this,e))});return{stop:()=>{a=!0,o()}}}function mn(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!=`function`||gn(e,t))return{stop:L};let a=!1,o=function(){if(!new.target)return Reflect.apply(i,this,Array.from(arguments));let e=new.target===o?i:new.target;if(a)return Reflect.construct(i,arguments,e);let t=Array.from(arguments);return _n(n,{parameters:t,handlingStack:r?dn(`instrumented constructor`):void 0},()=>Reflect.construct(i,t,e))},s=vn(o,i),{stop:c}=hn(e,t,i,o);return{stop:()=>{a=!0,s(),c()}}}function hn(e,t,n,r){return gn(e,t)?{stop:L}:(e[t]=r,{stop:()=>{e[t]===r&&(e[t]=n)}})}function gn(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return!!n&&!n.writable&&!n.set}function _n(e,t,n){let r;_e(e,null,[{...t,onPostCall:e=>{r=e}}]);let i=n();return r&&_e(r,null,[i]),i}function vn(e,t){for(let n of[].concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t))){let r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r)}let{stop:n}=hn(t.prototype,`constructor`,t.prototype.constructor,e);return n}function yn(e,t,n){let r=Object.getOwnPropertyDescriptor(e,t);if(!r?.set||!r.configurable)return{stop:L};let i=L,a=(e,t)=>{F(()=>{a!==i&&n(e,t)},0)},o=function(e){r.set.call(this,e),a(this,e)};return Object.defineProperty(e,t,{set:o}),{stop:()=>{Object.getOwnPropertyDescriptor(e,t)?.set===o&&Object.defineProperty(e,t,r),a=i}}}var z=function(e){return e.BEFORE_UNLOAD=`beforeunload`,e.CLICK=`click`,e.DBL_CLICK=`dblclick`,e.KEY_DOWN=`keydown`,e.LOAD=`load`,e.POP_STATE=`popstate`,e.SCROLL=`scroll`,e.TOUCH_START=`touchstart`,e.TOUCH_END=`touchend`,e.TOUCH_MOVE=`touchmove`,e.VISIBILITY_CHANGE=`visibilitychange`,e.PAGE_SHOW=`pageshow`,e.FREEZE=`freeze`,e.RESUME=`resume`,e.DOM_CONTENT_LOADED=`DOMContentLoaded`,e.POINTER_DOWN=`pointerdown`,e.POINTER_UP=`pointerup`,e.POINTER_CANCEL=`pointercancel`,e.HASH_CHANGE=`hashchange`,e.PAGE_HIDE=`pagehide`,e.MOUSE_DOWN=`mousedown`,e.MOUSE_UP=`mouseup`,e.MOUSE_MOVE=`mousemove`,e.FOCUS=`focus`,e.BLUR=`blur`,e.CONTEXT_MENU=`contextmenu`,e.RESIZE=`resize`,e.CHANGE=`change`,e.INPUT=`input`,e.PLAY=`play`,e.PAUSE=`pause`,e.SECURITY_POLICY_VIOLATION=`securitypolicyviolation`,e.SELECTION_CHANGE=`selectionchange`,e.STORAGE=`storage`,e.UNHANDLED_REJECTION=`unhandledrejection`,e}({});function B(e,t,n,r){return bn(e,[t],n,r)}function bn(e,t,n,{once:r,capture:i,passive:a}={}){let o=w(e=>{(e.isTrusted||e.__ddIsTrusted||Sn!==!1)&&(r&&u(),n(e))}),s=a?{capture:i,passive:a}:i,c=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,l=zt(c,`addEventListener`);t.forEach(t=>l.call(e,t,o,s));function u(){let n=zt(c,`removeEventListener`);t.forEach(t=>n.call(e,t,o,s))}return{stop:u}}function xn(e,t){if(!e)return!1;try{return B(e,t,L).stop(),!0}catch{return!1}}var Sn;function Cn(e){Sn!==!0&&(Sn=e??!1)}var wn=1024,Tn=1024*wn,En=/[^\u0000-\u007F]/;function Dn(e){return En.test(e)?new TextEncoder().encode(e).length:e.length}function On(e){if(e.length===1)return e[0];let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function kn(e,t,n){if(typeof e!=`object`||!e)return JSON.stringify(e);let r=An(Object.prototype),i=An(Array.prototype),a=An(Object.getPrototypeOf(e)),o=An(e);try{return JSON.stringify(e,t,n)}catch{return`<error: unable to serialize object>`}finally{r(),i(),a(),o()}}function An(e){let t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):L}var jn=220*wn,Mn=`$`,Nn=3;function V(e,t=jn){let n=An(Object.prototype),r=An(Array.prototype);try{let n=[],r=new WeakMap,i=Pn(e,Mn,void 0,n,r),a=JSON.stringify(i),o=a?a.length:0;if(o>t){zn(t,`discarded`,e);return}for(;n.length>0&&o<t;){let i=n.shift(),a=0;if(Array.isArray(i.source))for(let s=0;s<i.source.length;s++){let c=Pn(i.source[s],i.path,s,n,r);if(o+=c===void 0?4:JSON.stringify(c).length,o+=a,a=1,o>t){zn(t,`truncated`,e);break}i.target[s]=c}else for(let s in i.source)if(Object.prototype.hasOwnProperty.call(i.source,s)){let c=Pn(i.source[s],i.path,s,n,r);if(c!==void 0&&(o+=JSON.stringify(c).length+a+s.length+Nn,a=1),o>t){zn(t,`truncated`,e);break}i.target[s]=c}}return i}finally{n(),r()}}function Pn(e,t,n,r,i){let a=Rn(e);if(!a||typeof a!=`object`)return Fn(a);let o=In(a);if(o!==`[Object]`&&o!==`[Array]`&&o!==`[Error]`)return o;let s=e;if(i.has(s))return`[Reference seen at ${i.get(s)}]`;let c=n===void 0?t:`${t}.${n}`,l=Array.isArray(a)?[]:{};return i.set(s,c),r.push({source:a,target:l,path:c}),l}function Fn(e){return typeof e==`bigint`?`[BigInt] ${e.toString()}`:typeof e==`function`?`[Function] ${e.name||`unknown`}`:typeof e==`symbol`?`[Symbol] ${e.description||e.toString()}`:e}function In(e){try{if(e instanceof Event)return Ln(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;let t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t?.[1])return`[${t[1]}]`}catch{}return`[Unserializable]`}function Ln(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?In(e.currentTarget):null,target:e.target?In(e.target):null}}function Rn(e){if((typeof e!=`object`||!e)&&typeof e!=`function`)return e;let t=e;if(typeof t.toJSON==`function`)try{return t.toJSON()}catch{}return e}function zn(e,t,n){N.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}var Bn=`No stack, consider using an instance of Error`;function Vn(e){try{return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}catch{return!1}}function Hn(e){let{env:t,service:n,version:r,datacenter:i,sdkVersion:a,variant:o}=e,s=[Un(`sdk_version`,a??`7.14.0`)];return t&&s.push(Un(`env`,t)),n&&s.push(Un(`service`,n)),r&&s.push(Un(`version`,r)),i&&s.push(Un(`datacenter`,i)),o&&s.push(Un(`variant`,o)),s}function Un(e,t){let n=t?`${e}:${t}`:e;return(n.length>200||Gn(n))&&N.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${y} ${v}/getting_started/tagging/#defining-tags`),Wn(n)}function Wn(e){return e.replace(/,/g,`_`)}function Gn(e){return RegExp(`[^\\p{Ll}\\p{Lo}0-9_:./-]`,`u`).test(e)}function Kn(e,t){let n=C.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var qn={AGENT:`agent`,CONSOLE:`console`,CUSTOM:`custom`,LOGGER:`logger`,NETWORK:`network`,SOURCE:`source`,REPORT:`report`},Jn=function(e){return e.UNCAUGHT=`Uncaught`,e.PROVIDED=`Provided`,e}({}),Yn=function(e){return e.HANDLED=`handled`,e.UNHANDLED=`unhandled`,e}({});function Xn(){let{navigator:e}=C;return{status:e?.onLine?`connected`:`not_connected`,interfaces:e?.connection?.type?[e.connection.type]:void 0,effective_type:e?.connection?.effectiveType}}function Zn(e,t){return zt(C,`fetch`)(e,t)}function Qn(e){return e>=500}function $n(e){try{return e.clone()}catch{return}}var er=80*wn,tr=20*Tn,nr=je,rr=D;function ir(e,t,n,r,i,a){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?or(e,t,n,a,{onSuccess:()=>sr(0,t,n,r,i,a),onFailure:()=>{t.queuedPayloads.enqueue(e)||a.notify({type:`queue-full`,bandwidth:t.bandwidthMonitor.stats(),payload:e}),ar(t,n,r,i,a)}}):t.queuedPayloads.enqueue(e)||a.notify({type:`queue-full`,bandwidth:t.bandwidthMonitor.stats(),payload:e})}function ar(e,t,n,r,i){e.transportStatus===2&&F(()=>{or(e.queuedPayloads.first(),e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=rr,sr(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(nr,e.currentBackoffTime*2),ar(e,t,n,r,i)}})},e.currentBackoffTime)}function or(e,t,n,r,{onSuccess:i,onFailure:a}){t.bandwidthMonitor.add(e),n(e,n=>{t.bandwidthMonitor.remove(e),cr(n)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},r.notify({type:`failure`,bandwidth:t.bandwidthMonitor.stats(),payload:e}),a()):(t.transportStatus=0,r.notify({type:`success`,bandwidth:t.bandwidthMonitor.stats(),payload:e}),i())})}function sr(e,t,n,r,i,a){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i(`Reached max ${r} events size queued for upload: ${tr/Tn}MiB`),t.queueFullReported=!0);let o=t.queuedPayloads;for(t.queuedPayloads=ur();o.size()>0;)ir(o.dequeue(),t,n,r,i,a)}function cr(e){return e.type!==`opaque`&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||Qn(e.status))}function lr(){return{transportStatus:0,currentBackoffTime:rr,bandwidthMonitor:dr(),queuedPayloads:ur(),queueFullReported:!1}}function ur(){let e=[];return{bytesCount:0,enqueue(t){return!this.isFull()&&(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){let t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=tr}}}function dr(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=er&&this.ongoingRequestCount<32},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){--this.ongoingRequestCount,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}var fr=16*wn;function pr(e,t,n=fr){let r=new E,i=lr();return{observable:r,send:n=>{for(let a of e)ir(n,i,(e,t)=>{_r(a,e,t)},a.trackType,t,r)},sendOnExit:t=>{for(let r of e)mr(r,n,t)}}}function mr(e,t,n){if(n.bytesCount<t)try{let t=e.build(`beacon`,n);if(navigator.sendBeacon(t,n.data))return}catch(e){gr(e)}_r(e,n)}var hr=!1;function gr(e){hr||(hr=!0,T(e))}function _r(e,t,n){Zn(e.build(`fetch`,t),{method:`POST`,body:t.data,mode:`cors`}).then(w(e=>n?.({status:e.status,type:e.type}))).catch(w(()=>n?.({status:0})))}var vr=function(e){return e.RECORDS=`records`,e.PROFILES=`profiles`,e}({});function yr(){let e=Cr();if(e)return{getCapabilities(){return JSON.parse(e.getCapabilities?.()||`[]`)},getPrivacyLevel(){return e.getPrivacyLevel?.()},getIsTraceSampled(){return JSON.parse(e.getIsTraceSampled?.()||`null`)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){let i=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:i}))}}}function br(e){let t=yr();return!!t&&t.getCapabilities().includes(e)}function xr(e=C.location?.hostname){return yr()?.getAllowedWebViewHosts().some(t=>Sr(e,t))??!1}function Sr(e,t){if(!t.includes(`*`))return e===t||e.endsWith(`.${t}`);let n=t.split(`*`);if(n.length!==2)return N.error(`Invalid WebView host pattern "${t}": only one wildcard (*) is supported.`),!1;let[r,i]=n;return e.length>r.length+i.length&&e.startsWith(r)&&e.endsWith(i)}function Cr(){return C.DatadogEventBridge}function wr(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(t(r,n,e))return r}}function Tr(e){return Object.values(e)}function Er(e){return Object.entries(e)}var Dr={HIDDEN:`visibility_hidden`,UNLOADING:`before_unload`,PAGEHIDE:`page_hide`,FROZEN:`page_frozen`};function Or(){return new E(e=>{let t=C.window;if(!t)return;let{stop:n}=bn(t,[`visibilitychange`,`freeze`],t=>{t.type===`visibilitychange`&&document.visibilityState===`hidden`?e.notify({reason:Dr.HIDDEN}):t.type===`freeze`&&e.notify({reason:Dr.FROZEN})},{capture:!0}),r=B(t,`beforeunload`,()=>{e.notify({reason:Dr.UNLOADING})}).stop;return()=>{n(),r()}})}function kr(e){return Tr(Dr).includes(e)}function Ar(){let e=``,t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){let i=Dn(n);t+=i,e+=n,r&&r(i)},finish(e){e(this.finishSync())},finishSync(){let n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:``};return e=``,t=0,n},estimateEncodedBytesCount(e){return e.length}}}var jr=30*D,Mr=ie?1:50;function Nr({pageMayExitObservable:e}){let t,n=new E,r=e.subscribe(e=>{t=e.reason;try{n.notify(e.reason)}finally{t=void 0}s(e.reason)}),i=new E(()=>()=>{r.unsubscribe()}),a=0,o=0;function s(e){if(o===0)return;let t=o,n=a;o=0,a=0,u(),i.notify({reason:e,messagesCount:t,bytesCount:n})}let c;function l(){c===void 0&&(c=F(()=>{s(`duration_limit`)},jr))}function u(){I(c),c=void 0}return{flushObservable:i,prepareUrgentFlushObservable:n,forceFlush:s,get messagesCount(){return o},notifyBeforeAddMessage(e){a+e>=fr&&s(t??`bytes_limit`),o+=1,a+=e,l()},notifyAfterAddMessage(e=0){a+=e,o>=Mr?s(t??`messages_limit`):a>=fr&&s(t??`bytes_limit`)}}}var Pr=256*wn;function Fr({encoder:e=Ar(),endpoints:t,reportError:n}){let r=P(pr)(t,n),i=P(Or)(),a=P(Nr)({pageMayExitObservable:i}),o={},s=a.flushObservable.subscribe(e=>u(e));function c(t,n,r){if(r!==void 0){let i;o[r]===void 0?(a.notifyBeforeAddMessage(n),i=0):i=n-e.estimateEncodedBytesCount(o[r]),o[r]=t,a.notifyAfterAddMessage(i)}else a.notifyBeforeAddMessage(n),e.write(e.isEmpty?t:`\n${t}`,e=>{a.notifyAfterAddMessage(e-n)})}function l(t,n){let r=kn(t),i=e.estimateEncodedBytesCount(r);if(i>=Pr){N.warn(`Discarded a message whose size was bigger than the maximum allowed size ${Pr/wn}KiB. ${y} ${yt}/#technical-limitations`);return}c(r,i,n)}function u(t){let n=Tr(o).join(`
4
+ `);o={};let i=kr(t.reason),a=i?r.sendOnExit:r.send;if(i&&e.isAsync){let t=e.finishSync();t.outputBytesCount&&a(Ir(t));let r=[t.pendingData,n].filter(Boolean).join(`
5
+ `);r&&a({data:r,bytesCount:Dn(r)})}else n&&e.write(e.isEmpty?n:`\n${n}`),e.finish(e=>{a(Ir(e))})}return{get isEmpty(){return a.messagesCount===0},add:l,upsert:l,prepareUrgentFlushObservable:a.prepareUrgentFlushObservable,forceFlush:a.forceFlush,flushObservable:a.flushObservable,stop:s.unsubscribe}}function Ir(e){let t;return t=typeof e.output==`string`?e.output:new Blob([e.output],{type:`text/plain`}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}var Lr={LOG:`log`,CONFIGURATION:`configuration`,USAGE:`usage`};function Rr(){let e=[];return{register(t){return e.push(t),{unregister(){e=e.filter(e=>e!==t)}}},trigger(t){let n=[];for(let r of e){let e=r(t);if(e===`DISCARDED`)return zr;e!==`SKIPPED`&&n.push(e)}return g(...n)}}}var zr=`DISCARDED`,Br=`SKIPPED`;function Vr(e){return e!==0&&Math.random()*100<=e}var Hr=[`https://www.datadoghq-browser-agent.com`,`https://www.datad0g-browser-agent.com`,`https://d3uc069fcn7uxw.cloudfront.net`,`https://d20xtzwzcl0ceb.cloudfront.net`,`http://localhost`,`<anonymous>`],Ur=function(e){return e.LOGS=`browser-logs-sdk`,e.RUM=`browser-rum-sdk`,e}({}),Wr=function(e){return e.CUSTOMER_DATA_METRIC_NAME=`Customer data measures`,e.REMOTE_CONFIGURATION_METRIC_NAME=`remote configuration metrics`,e.RECORDER_INIT_METRICS_TELEMETRY_NAME=`Recorder init metrics`,e.SEGMENT_METRICS_TELEMETRY_NAME=`Segment network request metrics`,e.SESSION_MANAGER_INIT_METRICS_TELEMETRY_NAME=`Session manager init metrics`,e}({}),Gr=1,Kr=[De,Oe],qr=15,Jr;function Yr(){return Jr||=new xe(100),Jr}function Xr(e,t,n,r){let i=new E,{enabled:a,metricsEnabled:o}=Zr(e,t,n,i,r),{stop:s}=Qr(t,i);return{stop:s,enabled:a,metricsEnabled:o}}function Zr(e,t,n,r,i,a=Gr,o=qr){let s={},c=!Kr.includes(t.site)&&Vr(t.telemetrySampleRate),l={[Lr.LOG]:c,[Lr.CONFIGURATION]:c&&Vr(t.telemetryConfigurationSampleRate),[Lr.USAGE]:c&&Vr(t.telemetryUsageSampleRate),metric:c&&Vr(a)},u=$r(),d=Yr();return d.subscribe(({rawEvent:t,metricName:i})=>{if(i&&!l.metric||!l[t.type])return;let a=i||t.status||t.type,c=s[a];if(c||=s[a]=new Set,c.size>=o)return;let d=kn(t);if(c.has(d))return;let p=n.trigger({startTime:j().relative});if(p===`DISCARDED`)return;let m=f(p,e,t,u);r.notify(m),Kn(`telemetry`,m),c.add(d)}),d.unbuffer(),ve(ni),{enabled:c,metricsEnabled:l.metric};function f(e,n,r,a){return g({type:`telemetry`,date:j().timeStamp,service:n,version:`7.14.0`,source:`browser`,_dd:{format_version:2},telemetry:g(r,{runtime_env:a,connectivity:Xn(),sdk_setup:`npm`,sdk_name:i}),ddtags:Hn(t).join(`,`),experimental_features:Array.from(Rt())},e)}}function Qr(e,t){let n=[];if(xr()){let e=yr(),r=t.subscribe(t=>e.send(`internal_telemetry`,t));n.push(r.unsubscribe)}else{let r=[qe(e,`rum`)],i=Je(e,`rum`);i&&ei(e)&&r.push(i);let a=Fr({endpoints:r,reportError:L});n.push(a.stop);let o=t.subscribe(a.add);n.push(o.unsubscribe)}return{stop:()=>n.forEach(e=>e())}}function $r(){return{is_local_file:C.location?.protocol===`file:`,is_worker:ie}}function ei(e){return e.site===we}function ti(e,t){re()&&N.debug(`[Telemetry]`,e,t),Yr().notify({rawEvent:{type:Lr.LOG,message:e,status:`debug`,...t}})}function ni(e,t){Yr().notify({rawEvent:{type:Lr.LOG,status:`error`,...ai(e),...t}})}function ri(e){Yr().notify({rawEvent:{type:Lr.CONFIGURATION,configuration:e}})}function ii(e,t){Yr().notify({rawEvent:{type:Lr.LOG,message:e,status:`debug`,...t},metricName:e})}function H(e){Yr().notify({rawEvent:{type:Lr.USAGE,usage:e}})}function ai(e){if(Vn(e)){let t=Wt(e);return{error:{kind:t.name,stack:fn(oi(t))},message:t.message}}return{error:{stack:Bn},message:`Uncaught ${kn(e)}`}}function oi(e){return e.stack=e.stack.filter(e=>!e.url||Hr.some(t=>e.url.startsWith(t))),e}var si=new Map,ci=new Set,li=!1;function ui(){let e=C.window?.DD_SOURCE_CODE_CONTEXT;if(!e)return;let t=!1,n=!1,r=!1;for(let[i,a]of Object.entries(e)){if(t||=a.ddDebugId!==void 0,n||=a.service!==void 0,r||=a.version!==void 0,ci.has(i))continue;ci.add(i);let e=Wt({stack:i}).stack[0]?.url;e&&!si.has(e)&&si.set(e,a)}li||(li=!0,H({feature:`source-code-context`,use_debug_id:t,use_service:n,use_version:r}))}function di(e){ui();let t=new Set,n=[];for(let r of e){if(t.has(r))continue;t.add(r);let e=si.get(r)?.ddDebugId;e!==void 0&&n.push({url:r,id:e})}return n.length?n:void 0}function fi(e){return ui(),si.get(e)}function pi({originalError:e,stackTrace:t,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){let a=Vn(e);return{source:n,type:t?t.name:void 0,message:vi(t,a,i,e),stack:t?fn(t):r?Bn:void 0}}function mi(e){return e?.stack.map(e=>e.url).filter(e=>!!e)??[]}function hi(e,t){let n=t.flatMap(({stackTrace:e})=>mi(e));return di(mi(e).concat(n))}function gi(e){let t=[],n=e.cause;for(;n!=null&&t.length<10;){let e=Vn(n),r=e?Wt(n):void 0;t.push({originalError:n,stackTrace:r}),n=e?n.cause:void 0}return t}function _i({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:a,useFallbackStack:o=!0,source:s,handling:c}){let l=e??(Vn(t)?Wt(t):void 0),u=Vn(t)?gi(t):[],d=pi({originalError:t,stackTrace:l,source:s,useFallbackStack:o,nonErrorPrefix:a}),f=u.map(({originalError:e,stackTrace:t})=>pi({originalError:e,stackTrace:t,source:s,useFallbackStack:!1}));return{startClocks:i,handling:c,handlingStack:n,componentStack:r,originalError:t,...d,debugIds:hi(l,u),causes:f.length?f:void 0,fingerprint:yi(t),context:bi(t)}}function vi(e,t,n,r){return e?.message&&e?.name?e.message:t?`Empty message`:n?`${n} ${kn(V(r))}`:kn(V(r))}function yi(e){return Vn(e)&&`dd_fingerprint`in e?String(e.dd_fingerprint):void 0}function bi(e){if(u(e))return e.dd_context}function xi(){return new E(e=>{let t=(t,n)=>{let r=_i({stackTrace:n,originalError:t,startClocks:j(),nonErrorPrefix:`Uncaught`,source:qn.SOURCE,handling:`unhandled`});e.notify(r)},{stop:n}=Si(t),{stop:r}=Ci(t);return()=>{n(),r()}})}function Si(e){return R(C,`onerror`,({parameters:[t,n,r,i,a]})=>{let o;Vn(a)||(o=an(t,n,r,i)),e(a??t,o)})}function Ci(e){return xn(C.window,`unhandledrejection`)?R(C,`onunhandledrejection`,({parameters:[t]})=>{e(t.reason||`Empty reason`)}):{stop:L}}function wi(e,t){return(...n)=>{try{return e(...n)}catch(e){N.error(t,e)}}}function Ti(e){let t={version:`7.14.0`,onReady(e){e()},...e};return Object.defineProperty(t,"_setDebug",{get(){return S},enumerable:!1}),t}function Ei(e,t,n){let r=e[t];r&&!r.q&&r.version&&N.warn(`SDK is loaded more than once. This is unsupported and might have unexpected behavior.`),e[t]=n,r?.q&&r.q.forEach(e=>wi(e,`onReady callback threw an error:`)())}function Di(e,t){t.silentMultipleInit||N.error(`${e} is already initialized.`)}var Oi={intervention:`intervention`,deprecation:`deprecation`,cspViolation:`csp_violation`};function ki(e){let t=[];e.includes(Oi.cspViolation)&&t.push(ji());let n=e.filter(e=>e!==Oi.cspViolation);return n.length&&t.push(Ai(n)),be(...t)}function Ai(e){return new E(t=>{if(!window.ReportingObserver)return;let n=w((e,n)=>e.forEach(e=>t.notify(Mi(e)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function ji(){return new E(e=>{if(!xn(document,`securitypolicyviolation`))return;let{stop:t}=B(document,`securitypolicyviolation`,t=>{e.notify(Ni(t))});return t})}function Mi(e){let{type:t,body:n}=e;return Pi({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:Fi(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber),debugIds:n.sourceFile?di([n.sourceFile]):void 0})}function Ni(e){let t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Pi({type:e.effectiveDirective,message:`${Oi.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:Fi(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${ot(e.originalPolicy,100,`...`)}"`:`no policy`,e.sourceFile,e.lineNumber,e.columnNumber),debugIds:e.sourceFile?di([e.sourceFile]):void 0})}function Pi(e){return{startClocks:j(),source:qn.REPORT,handling:`unhandled`,...e}}function Fi(e,t,n,r,i){return n?fn({name:e,message:t,stack:[{func:`?`,url:n,line:r??void 0,column:i??void 0}]}):void 0}function Ii(e,t){let n=e.indexOf(t);n>=0&&e.splice(n,1)}function Li(e){return Array.isArray(e)&&e.length>0}var Ri=1/0,zi=je,Bi,Vi=new Set;function Hi(){Vi.forEach(e=>e())}function Ui({expireDelay:e,maxEntries:t}){let n=[],r=()=>{if(!e)return;let t=Ie()-e;for(;n.length>0&&n[n.length-1].endTime<t;)n.pop()};e&&(Bi||=Bt(()=>Hi(),zi),Vi.add(r));function i(e,r){let i={value:e,startTime:r,endTime:Ri,remove:()=>{Ii(n,i)},close:e=>{i.endTime=e}};return t&&n.length>=t&&n.pop(),n.unshift(i),i}function a(e=Ri,t={returnInactive:!1}){for(let r of n)if(r.startTime<=e){if(t.returnInactive||e<=r.endTime)return r.value;break}}function o(e){let t=n[0];t?.endTime===Ri&&t.close(e)}function s(e=Ri,t=0){let r=Fe(e,t);return n.filter(t=>t.startTime<=r&&e<=t.endTime).map(e=>e.value)}function c(e=Ri,t=0){let r=Fe(e,t);return n.filter(t=>t.startTime<=r&&e<=t.endTime)}function l(e){return n.filter(t=>t.startTime===e)}function u(){n=[]}function d(){Vi.delete(r),Vi.size===0&&Bi&&(Vt(Bi),Bi=void 0)}return{add:i,find:a,closeActive:o,findAll:s,findAllEntries:c,getEntries:l,reset:u,stop:d}}function Wi(e,t){return e*t/100}var Gi=new Map;function Ki(e,t){if(t===100)return!0;if(t===0)return!1;let n=Gi.get(t);if(e===n?.sessionId)return n.decision;let r=qi(BigInt(`0x${e.split(`-`)[4]}`),t);return Gi.set(t,{sessionId:e,decision:r}),r}function qi(e,t){let n=1n<<64n,r=e*1111111111111111111n%n;return Number(r)<=t/100*Number(n)}var Ji=4*Me,Yi=15*je,Xi=Ne,Zi={COOKIE:`cookie`,MEMORY:`memory`,LOCAL_STORAGE:`local-storage`},Qi=`dd_cookie_test_`;async function $i(e,t){let n=`${Qi}${M()}`,r=`test`,i=e(n,t);try{return await i.getAllAndSet(()=>({value:r,expireDelay:je})),(await i.getAll()).includes(r)}catch(e){return N.error(e),!1}finally{try{await i.delete()}catch{}}}function ea(e,t){let n=P(C.cookieStore),r=new E(()=>B(n,`change`,t=>{(t.changed.some(t=>t.name===e)||t.deleted.some(t=>t.name===e))&&r.notify()}).stop);return{async getAll(){return(await n.getAll(e)).map(e=>e.value)},delete(){return n.delete({name:e,domain:t.domain,path:`/`,partitioned:t.partitioned})},async getAllAndSet(r){let i=await n.getAll(e),{value:a,expireDelay:o}=r(i.map(e=>e.value));try{await n.set({name:e,value:a,expires:Pe()+o,path:`/`,sameSite:t.crossSite?`none`:`strict`,domain:t.domain,secure:t.secure,partitioned:t.partitioned})}catch(n){if(!e.startsWith(`dd_cookie_test_`)){let r=dt(e);ti(`Failed to set cookie using Cookie Store API`,{"error.message":n.message,newValue:a,cookieOptions:{...t},cookies:i.map(e=>({...e})),cookieCount:i.length,documentCookies:r})}}},observable:r}}var ta=D;function na(e,t){let n=dt(e),r=new E(()=>{let t=Bt(()=>{i(dt(e))},ta);return()=>{Vt(t)}});function i(e){String(e)!==String(n)&&(n=e,r.notify())}return{getAll(){return Promise.resolve(dt(e))},async getAllAndSet(n){let{value:r,expireDelay:a}=n(dt(e));lt(e,r,a,t),await Promise.resolve(),i([r])},async delete(){mt(e,t),await Promise.resolve(),i([])},observable:r}}function ra(){let e=P(C.cookieStore);return!!(e&&xn(e,`change`))}var ia=`_dd_s_v2`,aa=`_dd_s`,oa=`_DD_SESSION`;function sa(){return{type:Zi.MEMORY}}function ca(){let e=C;e._DD_SESSION||(e[oa]={});let t=e[oa],n=new E,r=t.onChange;return t.onChange=e=>{r?.(e),n.notify(e)},{async setSessionState(e,n){let r=kt(e(t.state??{}));t.state=r,await Promise.resolve(),t.onChange?.(r)},sessionObservable:n}}var la=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function ua(e){return!!e&&(e.indexOf(`&`)!==-1||la.test(e))}function da(e){return e.created?Number(e.created):void 0}function fa(e){let t=e.expire&&Number(e.expire),n=da(e);if(t&&n)return Math.min(t,n+Ji)}function pa(e,t){let n={isExpired:`1`};return t.trackAnonymousUser&&e?.anonymousId&&(n.anonymousId=e?.anonymousId),n}function ma(e){return jt(e)}function ha(e){return e.isExpired!==void 0||!ga(e)}function ga(e){let t=fa(e);return t?Pe()<t:!1}function _a(e){e.expire=String(Pe()+Yi)}function va(e){return Er(e).map(([e,t])=>e===`anonymousId`?`aid=${t}`:`${e}=${t}`).join(`&`)}function ya(e){let t={};return ua(e)&&e.split(`&`).forEach(e=>{let n=la.exec(e);if(n!==null){let[,e,r]=n;e===`aid`?t.anonymousId=r:t[e]=r}}),t}function ba(e,t){return ma(e)?(t.trackAnonymousUser&&(e.anonymousId=M()),pa(e,t)):e}function xa(e,t){if(ma(e))return e;let n=e;return ha(e)&&(n=pa(e,t)),n.id||(n.id=M(),n.created=String(Pe())),t.trackAnonymousUser&&!n.anonymousId&&(n.anonymousId=M()),delete n.isExpired,_a(n),n}function Sa(e){return ha(e)||ma(e)||!e.id||_a(e),e}async function Ca(e){let t=vt(e);if(t){if(ra()&&await $i(ea,t))return{type:Zi.COOKIE,cookieOptions:t,cookieApi:1};if(await $i(na,t))return{type:Zi.COOKIE,cookieOptions:t,cookieApi:0}}}var wa;function Ta(e,t){let{cookieOptions:n,cookieApi:r}=e,i=new E,a=!!t.trackAnonymousUser,o=Aa(n),s=P(Da)(r,n),c=!0;s.observable.subscribe(()=>{s.getAll().then(e=>{i.notify(Oa(e,o))}).catch(e=>T(Error(`Error while reading session cookies on change: ${e}`)))});function l(e){return s.getAllAndSet(t=>{let r=Oa(t,o);return c&&jt(r)&&(r=Oa(dt(aa),o)),c=!1,{value:ka(e(r),n),expireDelay:a?Xi:Ji}})}return{async setSessionState(e,t){typeof navigator<`u`&&navigator.locks?await navigator.locks.request(ia,()=>l(e)).catch(e=>{if(!Ea(e))throw e}):(wa=(wa??Promise.resolve()).then(()=>l(e)),await wa)},sessionObservable:i}}function Ea(e){return e instanceof Error?e.name===`AbortError`||e.message.includes(`no longer runnable`)||e.message.includes(`Responsible document is not fully active`)||e.message.includes(`The document is not active`):!1}function Da(e,t){return e===1?ea(ia,t):na(ia,t)}function Oa(e,t){let n;for(let r of e.slice().reverse())if(n=ya(r),n.c===t)break;return delete n?.c,n??{}}function ka(e,t){return va(jt(e)?e:{...e,c:Aa(t)})}function Aa(e){let t=e.domain?e.domain.split(`.`).length-1:0,n=0;return n|=0,n|=t<<1,n|=+!!e.crossSite,n.toString(16)}var ja=`_dd_test_`;function Ma(){try{let e=M(),t=`${ja}${e}`;localStorage.setItem(t,e);let n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Zi.LOCAL_STORAGE}:void 0}catch{return}}function Na(){let e=new E(e=>B(window,`storage`,t=>{t.key===`_dd_s_v2`&&t.storageArea===localStorage&&e.notify(ya(t.newValue))}).stop),t=!0;return{async setSessionState(n,r){let i=ya(localStorage.getItem(ia));t&&ma(i)&&(i=ya(localStorage.getItem(aa))),t=!1;let a=n(i);localStorage.setItem(ia,va(a)),await Promise.resolve(),e.notify(a)},sessionObservable:e}}async function Pa(e){let t=Fa(e.sessionPersistence);for(let n of t){let t=await Ia(n,e);if(t!==void 0)return t}}function Fa(e){return e===void 0?ie?[Zi.MEMORY]:[Zi.COOKIE]:e}function Ia(e,t){switch(e){case Zi.COOKIE:return Ca(t);case Zi.LOCAL_STORAGE:return Ma();case Zi.MEMORY:return sa();default:N.error(`Invalid session persistence '${String(e)}'`);return}}function La(e,t){switch(e.type){case Zi.COOKIE:return Ta(e,t);case Zi.LOCAL_STORAGE:return Na();case Zi.MEMORY:return ca()}}var Ra=je,za=1e3,Ba=Me*12,Va=[];async function Ha(e,t){let n=Ie(),r=new E,i=new E,a=await P(Pa)(e);if(!a){N.warn(`No storage available for session. We will not send any data.`);return}let o=P(La)(a,e),s=Ui({maxEntries:za});Va.push(()=>s.stop());let c=!1,{throttled:l,cancel:u}=Ht(()=>{c=!1,o.setSessionState(t=>xa(t,e),`expandOrRenewOnActivity`).catch(T)},D);Va.push(u);let d;Va.push(()=>I(d));let f=!1;Va.push(()=>{f=!0});let p=await m().catch(e=>T(Error(`Error while resolving initial session state: ${e}`)));if(!p||f)return;for(;!t.isGranted();)if(b(),await new Promise(e=>t.onGrantedOnce(e)),f||(p=await m().catch(T),!p||f))return;return s.add(x(p),Le().relative),g(p),h(),_(),ii(`Session manager init metrics`,{metrics:{duration:k(n,Ie())}}),v();async function m(){let t={};return await o.setSessionState(n=>(t=xa(ba(n,e),e),t),`initialize`),t}function h(){let e=o.sessionObservable.subscribe(e=>{g(e),y(e)});Va.push(()=>e.unsubscribe())}function g(n){I(d);let r=fa(n);r&&(d=F(()=>{o.setSessionState(n=>ha(n)?(t.isGranted()||delete n.anonymousId,pa(n,e)):n,`expireOnTimeout`).catch(T)},r-Pe()))}function _(){t.observable.subscribe(()=>{t.isGranted()?(c=!1,o.setSessionState(t=>xa(t,e),`expandOrRenewOnConsent`).catch(T)):b()}),ie||(Wa(()=>{t.isGranted()&&l()}),Ga(()=>{c||o.setSessionState(e=>Sa(e),`expandOnVisibility`).catch(T)}),Ka(()=>{o.setSessionState(t=>ba(t,e),`initializeOnResume`).catch(T)}))}function v(){return{findSession:(e,t)=>s.find(e,t),findTrackedSession:(t,{returnInactive:n=!1,maxAge:r=Ba}={})=>{let i=s.find(t,{returnInactive:n});if(i&&i.id!==`invalid`&&Ki(i.id,e.sessionSampleRate)&&!(Pe()-i.createdAt>r))return i},renewObservable:r,expireObservable:i,expire:b,updateSessionState:e=>{o.setSessionState(t=>({...t,...e}),`updateState`).catch(T)}}}function y(e){let t=s.find(),n=t?.id!==void 0,a=e.id!==void 0,o=n&&a&&t.id!==e.id;if(n&&(!a||o)&&(c=!0,i.notify(),s.closeActive(Ie())),a&&(!n||o)){if(c)return;s.add(x(e),Ie()),r.notify()}else n&&a&&!o&&(t.isReplayForced=!!e.forcedReplay)}function b(){u();let n=pa(s.find(),e);t.isGranted()||delete n.anonymousId,y(n),o.setSessionState(n=>(t.isGranted()||delete n.anonymousId,pa(n,e)),`expire`).catch(T)}function x(e){let t=da(e)??O();return e.id?{id:e.id,isReplayForced:!!e.forcedReplay,anonymousId:e.anonymousId,createdAt:t}:{id:`invalid`,isReplayForced:!1,anonymousId:void 0,createdAt:t}}}function Ua(){let e={id:M(),isReplayForced:!1,anonymousId:void 0,createdAt:O()};return{findSession:()=>e,findTrackedSession:()=>e,renewObservable:new E,expireObservable:new E,expire:L,updateSessionState:t=>{e={...e,...t}}}}function Wa(e){let{stop:t}=bn(window,[`click`,`touchstart`,`keydown`,`scroll`],e,{capture:!0,passive:!0});Va.push(t)}function Ga(e){let t=()=>{document.visibilityState===`visible`&&e()},{stop:n}=B(document,`visibilitychange`,t);Va.push(n);let r=Bt(t,Ra);Va.push(()=>{Vt(r)})}function Ka(e){let{stop:t}=B(window,`resume`,e,{capture:!0});Va.push(t)}var qa=class{constructor(){this.callbacks={}}notify(e,t){let n=this.callbacks[e];n&&n.forEach(e=>e(t))}subscribe(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:()=>{this.callbacks[e]=this.callbacks[e].filter(e=>t!==e)}}}},Ja=3e3;function Ya(e,t,n=Ja){let r=0,i=!1;return{isLimitReached(){if(r===0&&F(()=>{r=0},je),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{t(`Reached max number of ${e}s by minute: ${n}`)}finally{i=!1}}return!0}}}function Xa(){return Qa()===1}var Za;function Qa(){return Za??=$a()}function $a(e=window){let t=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(t)?0:e.navigator.vendor?.indexOf(`Apple`)===0||/safari/i.test(t)&&!/chrome|android/i.test(t)?1:2}function eo(e,t){return document.readyState===e||document.readyState===`complete`?(t(),{stop:L}):B(window,e===`complete`?`load`:`DOMContentLoaded`,t,{once:!0})}function to(e){return new Promise(t=>{eo(e,t)})}var no,ro=new WeakMap;function io(){return no||=ao(),no}function ao(){return`XMLHttpRequest`in C?new E(e=>{let{stop:t}=R(XMLHttpRequest.prototype,`open`,oo),{stop:n}=R(XMLHttpRequest.prototype,`send`,t=>{so(t,e)},{computeHandlingStack:!0}),{stop:r}=R(XMLHttpRequest.prototype,`abort`,co);return()=>{t(),n(),r()}}):new E}function oo({target:e,parameters:[t,n]}){ro.set(e,{state:`open`,method:String(t).toUpperCase(),url:ae(String(n))})}function so({target:e,parameters:[t],handlingStack:n},r){let i=ro.get(e);if(!i)return;let a=i;a.state=`start`,a.startClocks=j(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let o=!1,{stop:s}=R(e,`onreadystatechange`,()=>{e.readyState===XMLHttpRequest.DONE&&c()}),c=()=>{if(l(),s(),o)return;o=!0;let t=i;t.duration=k(a.startClocks.timeStamp,O()),t.status=e.status,typeof e.response==`string`&&(t.responseBody=e.response),r.notify({...t,state:`complete`})},{stop:l}=B(e,`loadend`,c);r.notify(a)}function co({target:e}){let t=ro.get(e);t&&(t.isAborted=!0)}async function lo(e){let t=e.getReader(),n=[];for(;;){let e=await t.read();if(e.done)break;n.push(e.value)}return t.cancel().catch(L),On(n)}var uo=function(e){return e[e.IGNORE=0]=`IGNORE`,e[e.COLLECT=1]=`COLLECT`,e}({}),fo,po=[];function mo({responseBodyAction:e}={}){return e&&po.push(e),fo||=ho(),fo}function ho(){return new E(e=>{if(!C.fetch)return;let{stop:t}=R(C,`fetch`,t=>go(t,e),{computeHandlingStack:!0});return t})}function go({parameters:e,onPostCall:t,handlingStack:n},r){let[i,a]=e,o=a?.method;o===void 0&&i instanceof Request&&(o=i.method);let s=o===void 0?`GET`:String(o).toUpperCase(),c=i instanceof Request?i.url:ae(String(i)),l={state:`start`,init:a,input:i,method:s,startClocks:j(),url:c,handlingStack:n,isAbortedOnStart:i instanceof Request&&i.signal?.aborted||a?.signal?.aborted||!1};r.notify(l),e[0]=l.input,e[1]=l.init,t(e=>{_o(r,e,l).catch(T)})}async function _o(e,t,n){let r=n,i;try{i=await t}catch(t){e.notify({...r,state:`resolve`,status:0,isAborted:r.init?.signal?.aborted||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t});return}if(r.response=i,r.status=i.status,r.responseType=i.type,r.isAborted=!1,po.reduce((e,t)=>Math.max(e,t(r)),0)===1){let e=$n(i);if(e?.body)try{let t=await lo(e.body);r.responseBody=new TextDecoder().decode(t)}catch{}}e.notify({...r,state:`resolve`})}function vo(e){return typeof e.WebSocket==`function`}var yo;function bo(){return yo||=xo(),yo}function xo(){return new E(e=>{if(!vo(C))return;let{stop:t}=mn(C,`WebSocket`,({parameters:t,onPostCall:n})=>{let r=Array.isArray(t[1])?[].concat(t[1]):t[1],i=j();n(t=>{e.notify({state:`connecting`,instance:t,url:t.url,protocols:r,startClocks:i}),So(t,e)})}),{stop:n}=R(C.WebSocket.prototype,`send`,({target:t,parameters:[n],onPostCall:r})=>{let i=Co(n),a=t.bufferedAmount;r(()=>{e.notify({state:`message-out`,instance:t,size:i,bufferedAmountPreSend:a,at:j()})})});return()=>{t(),n()}})}function So(e,t){let{stop:n}=B(e,`open`,()=>{t.notify({state:`open`,instance:e,openClocks:j(),protocol:e.protocol||``}),n()}),{stop:r}=B(e,`message`,n=>{t.notify({state:`message-in`,instance:e,size:Co(n.data),at:j()})}),{stop:i}=B(e,`close`,n=>{t.notify({state:`closed`,instance:e,code:n.code,reason:n.reason,wasClean:n.wasClean,at:j()}),r(),i()})}function Co(e){return typeof e==`string`?Dn(e):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof Blob<`u`&&e instanceof Blob?e.size:0}function wo(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){let n=window.requestIdleCallback(w(e),t);return()=>window.cancelIdleCallback(n)}return To(e)}function To(e){let t=Pe(),n=F(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Pe()-t))})},0);return()=>I(n)}var Eo=D;function Do(){let e=[];function t(t){let r;if(!t||t.didTimeout){let e=performance.now();r=()=>30-(performance.now()-e)}else r=t.timeRemaining.bind(t);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){wo(t,{timeout:Eo})}return{push(t){e.push(t)===1&&n()},stop(){e.length=0}}}function Oo(e){return!!e&&typeof e.then==`function`}var ko={};function Ao(e){return be(...e.map(e=>(ko[e]||(ko[e]=jo(e)),ko[e])))}function jo(e){return new E(t=>{let n=x[e];return x[e]=(...r)=>{n.apply(console,r);let i=dn(`console error`);_e(()=>{t.notify(Mo(r,e,i))})},()=>{x[e]=n}})}function Mo(e,t,n){let r=e.map(e=>No(e)).join(` `);if(t===b.error){let i=_i({originalError:e.find(Vn),handlingStack:n,startClocks:j(),source:qn.CONSOLE,handling:`handled`,nonErrorPrefix:`Provided`,useFallbackStack:!1});return i.message=r,{api:t,message:r,handlingStack:n,error:i}}return{api:t,message:r,error:void 0,handlingStack:n}}function No(e){return typeof e==`string`?V(e):Vn(e)?pn(Wt(e)):kn(V(e),void 0,2)}function Po(e){let t=l(e)===`object`;return t||N.error(`Unsupported context:`,e),t}function Fo(e,t,n){let r={...e};for(let[e,{required:i,type:a}]of Object.entries(t))a===`string`&&!Io(r[e])&&(r[e]=String(r[e])),i&&Io(r[e])&&N.warn(`The property ${e} of ${n} is required; context will not be sent to the intake.`);return r}function Io(e){return e==null||e===``}function Lo(e=``,{propertiesConfig:t={}}={}){let n={},r=new E,i={getContext:()=>h(n),setContext:a=>{Po(a)?n=V(Fo(a,t,e)):i.clearContext(),r.notify()},setContextProperty:(i,a)=>{n=V(Fo({...n,[i]:a},t,e)),r.notify()},removeContextProperty:i=>{delete n[i],Fo(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function U(e,t,n,r){return w((...i)=>(r&&H({feature:r}),e()[t][n](...i)))}function Ro(e,t,n){e.changeObservable.subscribe(()=>{let r=e.getContext();n.notify(e=>e[t].setContext(r))})}var zo=`_dd_c`,Bo=[];function Vo(e,t,n){if(typeof window>`u`||typeof localStorage>`u`)return;let r=Ho(t,n);Bo.push(B(window,`storage`,({key:e})=>{r===e&&a()})),e.changeObservable.subscribe(o);let i=g(s(),e.getContext());jt(i)||e.setContext(i);function a(){e.setContext(s())}function o(){localStorage.setItem(r,JSON.stringify(e.getContext()))}function s(){let e=localStorage.getItem(r);return e?Ot(e)??{}:{}}}function Ho(e,t){return`${zo}_${e}_${t}`}var W={userContext:`userContext`,globalContext:`globalContext`,accountContext:`accountContext`},G={getContext:`getContext`,setContext:`setContext`,setContextProperty:`setContextProperty`,removeContextProperty:`removeContextProperty`,clearContext:`clearContext`};function Uo(e,t,n){let r=Wo();return t.storeContextsAcrossPages&&Vo(r,n,4),e.register(()=>{let e=r.getContext();return jt(e)||!e.id?Br:{account:e}}),r}function Wo(){return Lo(`account`,{propertiesConfig:{id:{type:`string`,required:!0},name:{type:`string`}}})}var Go=`_dd_tab_id`,Ko;function qo(e){let t=Jo();e.register(()=>({tab:{id:t}}))}function Jo(){return Ko||=Yo()??M(),Ko}function Yo(){try{let e=sessionStorage.getItem(Go);if(e)return e;let t=M();return sessionStorage.setItem(Go,t),t}catch{return}}function Xo(e,t,n,r){let i=Zo();return t.storeContextsAcrossPages&&Vo(i,n,2),e.register(()=>{let e=i.getContext();return r?{context:e}:e}),i}function Zo(){return Lo(`global context`)}function Qo(e,t,n,r){let i=$o();return t.storeContextsAcrossPages&&Vo(i,r,1),e.register(({eventType:e,startTime:r})=>{let a=i.getContext(),o=n.findTrackedSession(r);return o?.anonymousId&&!a.anonymous_id&&t.trackAnonymousUser&&(a.anonymous_id=o.anonymousId),jt(a)?Br:{type:e,usr:a}}),i}function $o(){return Lo(`user`,{propertiesConfig:{id:{type:`string`},name:{type:`string`},email:{type:`string`}}})}var es=`datadog-synthetics-`,ts=`${es}public-id`,ns=`${es}result-id`,rs=`${es}injects-rum`,is=`${es}rum-context`;function as(){return!ie&&!!(C._DATADOG_SYNTHETICS_INJECTS_RUM||pt(rs))}function os(){let e=cs();return ls(e)?e:void 0}function ss(){return!!os()}function cs(){let e=C._DATADOG_SYNTHETICS_RUM_CONTEXT;if(e)return e;let t=pt(is);return t?Ot(decodeURIComponent(t)):{test_id:window._DATADOG_SYNTHETICS_PUBLIC_ID||pt(ts),result_id:window._DATADOG_SYNTHETICS_RESULT_ID||pt(ns)}}function ls(e){return typeof e==`object`&&!!e&&typeof e.test_id==`string`&&typeof e.result_id==`string`}var K={DOCUMENT:`document`,XHR:`xhr`,BEACON:`beacon`,FETCH:`fetch`,CSS:`css`,JS:`js`,IMAGE:`image`,FONT:`font`,MEDIA:`media`,WEBSOCKET:`websocket`,OTHER:`other`},us={FETCH:K.FETCH,XHR:K.XHR},ds=500,fs=function(e){return e[e.RUNTIME_ERROR=0]=`RUNTIME_ERROR`,e[e.FETCH=1]=`FETCH`,e[e.XHR=2]=`XHR`,e[e.CONSOLE=3]=`CONSOLE`,e}({});function ps(){let e=new xe(ds,e=>{ti(`Early data collection dropped data on unbuffer`,{count:e})}),t=[];function n(n,r){t.push(r.subscribe(t=>{e.notify({type:n,data:t})}))}return n(0,P(xi)()),n(1,mo()),n(2,io()),n(3,Ao(Object.values(b))),{observable:e,stop:()=>t.forEach(e=>e.unsubscribe())}}function ms(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function hs(e,t){return+e.toFixed(t)}function gs(e){return typeof e==`number`}var _s=function(e){return e[e.REPLAY=1]=`REPLAY`,e[e.RUM=2]=`RUM`,e[e.TELEMETRY=4]=`TELEMETRY`,e[e.PROFILING=6]=`PROFILING`,e}({});function vs(e,t,n){e.register(({startTime:e})=>{let r=t.findTrackedSession(e);return r?{session:{id:r.id},anonymous_id:r.anonymousId,...n}:Br})}function ys(e,t){let n=0,r=[],i,a=!0,o=0,s=[],c=t,{stop:l}=B(e,`message`,({data:e})=>{if(e.type!==`wrote`||e.streamId!==c)return;let t=s[0];t&&(t.id===e.id?(s.shift(),n+=e.additionalBytesCount,r.push(e.result),i=e.trailer,t.writeCallback?t.writeCallback(e.result.byteLength):t.finishCallback&&t.finishCallback()):t.id<e.id&&l())});function u(){let e=r.length===0?new Uint8Array:On(r.concat(i)),t={rawBytesCount:n,output:e,outputBytesCount:e.byteLength,encoding:`deflate`};return n=0,r=[],t}function d(){a||=(e.postMessage({action:`reset`,streamId:t}),!0)}return{isAsync:!0,get isEmpty(){return a},write(n,r){e.postMessage({action:`write`,id:o,data:n,streamId:t}),s.push({id:o,writeCallback:r,data:n}),a=!1,o+=1},finish(e){d(),s.length?(s.forEach(e=>{delete e.writeCallback}),s[s.length-1].finishCallback=()=>e(u())):e(u())},finishSync(){d();let e=s.map(e=>e.data).join(``);return s.length=0,{...u(),pendingData:e}},estimateEncodedBytesCount(e){return e.length/8},stop(){l()}}}function bs({configuredUrl:e,error:t,source:n,scriptType:r}){if(N.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&xs(t.message)){let t;t=e?`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:`Please make sure CSP is correctly configured.`,N.error(`${t} See documentation at ${v}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r===`worker`&&ni(t)}function xs(e){return e.includes(`Content Security Policy`)||e.includes(`requires 'TrustedScriptURL'`)}var Ss=30*D;function Cs(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob([`(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t?.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},D=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},M=!1,j=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},C=j,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},T={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=C,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=T[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?j(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);D(t,t.dyn_ltree,e-1),D(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=O(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t?.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){M||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),M=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t?.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra?.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t?.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(T[n]);if(t.header&&(e=this.strm,a=t.header,e?.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t?.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(T[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch{t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"7.14.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=(new TextEncoder).encode(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();`])))}var q={status:0};function ws(e,t,n){switch(q.status===0&&Es(e,t),q.status){case 1:return q.initializationFailureCallbacks.push(n),q.worker;case 3:return q.worker}}function Ts(){return q.status}function Es(e,t){try{let n=P(Cs)(e),{stop:r}=B(n,`error`,n=>{ks(e,t,n)}),{stop:i}=B(n,`message`,({data:n})=>{n.type===`errored`?ks(e,t,n.error,n.streamId):n.type===`initialized`&&Os(n.version)});n.postMessage({action:`init`}),F(()=>Ds(t),Ss),q={status:1,worker:n,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(n){ks(e,t,n)}}function Ds(e){q.status===1&&(N.error(`${e} failed to start: a timeout occurred while initializing the Worker`),q.initializationFailureCallbacks.forEach(e=>e()),q={status:2})}function Os(e){q.status===1&&(q={status:3,worker:q.worker,stop:q.stop,version:e})}function ks(e,t,n,r){q.status===1||q.status===0?(bs({configuredUrl:e.workerUrl,error:n,source:t,scriptType:`worker`}),q.status===1&&q.initializationFailureCallbacks.forEach(e=>e()),q={status:2}):ni(n,{worker_version:q.status===3&&q.version,stream_id:r})}var As;function js(e){return Ls(e).segments_count}function Ms(e){Ls(e).segments_count+=1}function Ns(e){Ls(e).records_count+=1}function Ps(e){Ls(e).resources_count+=1}function Fs(e,t){Ls(e).segments_total_raw_size+=t}function Is(e){return As?.get(e)}function Ls(e){As||=new Map;let t;return As.has(e)?t=As.get(e):(t={records_count:0,resources_count:0,segments_count:0,segments_total_raw_size:0},As.set(e,t),As.size>1e3&&Rs()),t}function Rs(){if(!As)return;let e=As.keys().next().value;e&&As.delete(e)}var J={ACTION:`action`,ERROR:`error`,LONG_TASK:`long_task`,VIEW:`view`,VIEW_UPDATE:`view_update`,RESOURCE:`resource`,VITAL:`vital`},zs={LONG_TASK:`long-task`,LONG_ANIMATION_FRAME:`long-animation-frame`},Bs={INITIAL_LOAD:`initial_load`,ROUTE_CHANGE:`route_change`,SESSION_RENEWAL:`session_renewal`,BF_CACHE:`bf_cache`},Vs={CLICK:`click`,CUSTOM:`custom`,TAP:`tap`,SCROLL:`scroll`,SWIPE:`swipe`,APPLICATION_START:`application_start`,BACK:`back`},Hs={RAGE_CLICK:`rage_click`,ERROR_CLICK:`error_click`,DEAD_CLICK:`dead_click`},Us={DURATION:`duration`,OPERATION_STEP:`operation_step`};function Ws(e,t){t.lastIndex=0;let n=t.exec(e);if(!n)return;let[r,i]=n;return i||r}function Gs(e){let t=[],n=0,r,i={quote:void 0,escapeSequence:void 0},a=``;for(let o of e){if(r=Qs[n].find(e=>Zs[e](o,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!tc(i.escapeSequence))return[];a+=rc(i.escapeSequence),i.escapeSequence=void 0}$s.includes(r)?a+=o:ec.includes(r)&&a!==``?(t.push(a),a=``):r===12?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${o}`:o:r===8?i.quote=o:r===9&&(i.quote=void 0),n=r}return Qs[n].includes(1)?(a!==``&&t.push(a),t):[]}var Ks=/[a-zA-Z_$]/,qs=/[a-zA-Z0-9_$]/,Js=/[0-9]/,Ys=/[a-fA-F0-9]/,Xs=`'"`,Zs={0:()=>!1,1:()=>!1,2:e=>Ks.test(e),3:e=>qs.test(e),4:e=>e===`.`,5:e=>e===`[`,6:e=>e===`]`,7:e=>Js.test(e),8:e=>Xs.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e===`\\`,12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith(`u`)&&t.escapeSequence.length<5?Ys.test(e):!1},Qs={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},$s=[2,3,7,10],ec=[4,5,6];function tc(e){return`"'/\\bfnrt`.includes(e)||e.startsWith(`u`)&&e.length===5}var nc={'"':`"`,"'":`'`,"/":`/`,"\\":`\\`,b:`\b`,f:`\f`,n:`
6
+ `,r:`\r`,t:` `};function rc(e){return e.startsWith(`u`)?String.fromCharCode(parseInt(e.slice(1),16)):nc[e]}var ic=`dd_rc_`,ac={hit:`success`,miss:`missing`,error:`failure`};function oc(e){return`${ic}${e}`}function sc(e){if(typeof e!=`object`||!e)return!1;let t=`version`in e&&e.version===3,n=`config`in e&&typeof e.config==`object`&&e.config!==null,r=`metadata`in e&&u(e.metadata)&&typeof e.metadata.syncId==`string`&&typeof e.metadata.lastSynced==`number`;return t&&n&&r}function cc(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function lc({remoteConfigurationId:e}){let t=oc(e);return{read(){let e;try{e=localStorage.getItem(t)}catch{return{status:`error`}}if(e===null)return{status:`miss`};let n=Ot(e);return n===void 0||!sc(n)?(this.remove(),{status:`error`}):{status:`hit`,config:n.config,metadata:n.metadata}},remove(){try{localStorage.removeItem(t)}catch{}},write(e,n){let r=this.read();(r.status!==`hit`||JSON.stringify(r.config)!==JSON.stringify(e))&&cc(t,{version:3,config:e,metadata:{lastModified:n,lastSynced:O(),syncId:M()}})},stampFirstApplied(e){if(e.metadata.firstApplied!==void 0)return e.metadata;let n={...e.metadata,firstApplied:O()};return cc(t,{version:3,config:e.config,metadata:n}),n}}}var uc=`v1`,dc=[`applicationId`,`service`,`env`,`version`,`sessionSampleRate`,`sessionReplaySampleRate`,`telemetrySampleRate`,`trackAnonymousUser`,`trackUserInteractions`,`trackResources`,`trackLongTasks`,`traceContextInjection`,`actionNameAttribute`,`defaultPrivacyLevel`,`enablePrivacyForActionName`,`traceSampleRate`,`trackSessionAcrossSubdomains`,`allowedTracingUrls`,`allowedTrackingOrigins`];async function fc(e,t){let n,r=mc(),i=await yc(e);return i.ok?(r.increment(`fetch`,`success`),n=pc(e,i.value,t,r)):(r.increment(`fetch`,`failure`),N.error(i.error)),ii(Wr.REMOTE_CONFIGURATION_METRIC_NAME,{metrics:r.get()}),n}function pc(e,t,n,r){let i={...e};if(t.rum){let e=t.rum;dc.forEach(t=>{t in e&&(i[t]=a(e[t]))}),Object.keys(n).forEach(t=>{e[t]!==void 0&&o(n[t],e[t])})}return t.profiling?.sampleRate!==void 0&&(i.profilingSampleRate=t.profiling.sampleRate),i;function a(e){if(Array.isArray(e))return e.map(a);if(u(e)){if(hc(e)){let t=e.rcSerializedType;switch(t){case`string`:return e.value;case`regex`:return gc(e.value);case`dynamic`:return s(e);default:N.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`);return}}return Mt(e,a)}return e}function o(e,t){t.forEach(({key:t,value:n})=>{e.setContextProperty(t,a(n))})}function s(e){let t=e.strategy,n;switch(t){case`cookie`:n=c(e);break;case`dom`:n=d(e);break;case`js`:n=p(e);break;case`localStorage`:n=l(e);break;default:N.error(`Unsupported remote configuration: "strategy": "${t}"`);return}let r=e.extractor;return r!==void 0&&typeof n==`string`?_c(r,n):n}function c({name:e}){let t=ut(e);return r.increment(`cookie`,t===void 0?`missing`:`success`),t}function l({key:e}){let t;try{t=localStorage.getItem(e)}catch{r.increment(`localStorage`,`failure`);return}return r.increment(`localStorage`,t===null?`missing`:`success`),t??void 0}function d({selector:e,attribute:t}){let n;try{n=document.querySelector(e)}catch{N.error(`Invalid selector in the remote configuration: '${e}'`),r.increment(`dom`,`failure`);return}if(!n){r.increment(`dom`,`missing`);return}if(f(n,t)){N.error(`Forbidden element selected by the remote configuration: '${e}'`),r.increment(`dom`,`failure`);return}let i=t===void 0?n.textContent:n.getAttribute(t);if(i===null){r.increment(`dom`,`missing`);return}return r.increment(`dom`,`success`),i}function f(e,t){return e.getAttribute(`type`)===`password`&&t===`value`}function p({path:e}){let t=window,n=Gs(e);if(n.length===0){N.error(`Invalid JSON path in the remote configuration: '${e}'`),r.increment(`js`,`failure`);return}for(let i of n){if(!(i in t)){r.increment(`js`,`missing`);return}try{t=t[i]}catch(t){N.error(`Error accessing: '${e}'`,t),r.increment(`js`,`failure`);return}}return r.increment(`js`,`success`),t}}function mc(){let e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function hc(e){return`rcSerializedType`in e}function gc(e){try{return new RegExp(e)}catch{N.error(`Invalid regex in the remote configuration: '${e}'`)}}function _c(e,t){let n=gc(e.value);if(n!==void 0)return Ws(t,n)}function vc(e){let t=e.headers?.get(`last-modified`);if(!t)return;let n=new Date(t).getTime();return isNaN(n)?void 0:n}async function yc(e){let t;try{t=await Zn(xc(e))}catch{t=void 0}if(!t?.ok)return{ok:!1,error:Error(`Error fetching the remote configuration.`)};let n=await t.json();return n.rum||n.profiling?{ok:!0,value:n,lastModified:vc(t)}:{ok:!1,error:Error(`No remote configuration for RUM.`)}}function bc(e){return e.remoteConfiguration?.id??e.remoteConfigurationId}function xc(e){if(e.remoteConfigurationProxy)return e.remoteConfigurationProxy;let t=bc(e);return Ye({site:e.site,path:`/${uc}/${encodeURIComponent(t)}.json`,subdomain:`sdk-configuration`})}function Sc(e,t,n){yc(e).then(e=>{e.ok?(n.increment(`fetch`,`success`),t.write(e.value,e.lastModified)):(n.increment(`fetch`,`failure`),N.error(e.error))}).catch(T).finally(()=>{ii(Wr.REMOTE_CONFIGURATION_METRIC_NAME,{metrics:n.get()})})}function Cc(e,t){let n=lc({remoteConfigurationId:bc(e)}),r=mc(),i=n.read();if(r.increment(`cache`,ac[i.status]),Sc(e,n,r),i.status===`hit`)return{metadata:n.stampFirstApplied(i),initConfiguration:pc(e,i.config,t,r)};if(!e.remoteConfiguration?.required)return{initConfiguration:e}}function wc(e,t){switch(t.type){case`string`:return`"${e}" must be a non-empty string`;case`number`:return t.min!==void 0&&t.max!==void 0?`"${e}" must be a number between ${t.min} and ${t.max}`:t.min===void 0?t.max===void 0?`"${e}" must be a finite number`:`"${e}" must be a number less than or equal to ${t.max}`:`"${e}" must be a number greater than or equal to ${t.min}`;case`percentage`:return`"${e}" must be a number between 0 and 100`;case`boolean`:return`"${e}" must be a boolean`;case`site`:return`"${e}" must be a valid Datadog site. ${y} ${v}/getting_started/site/.`;case`match-option`:return`"${e}" must be a string, RegExp, or function`;case`enum`:return`"${e}" must be one of: "${Ac(t.values).join(`", "`)}"`;case`union`:return`"${e}" does not match any expected type`;case`schema`:return`"${e}" is not a valid object`;case`function`:return`"${e}" must be a function`}}function Tc(e,t,n){if(!e||typeof e!=`object`){n.error(`Configuration must be an object`);return}return Ec(t,e,n)}function Ec(e,t,n){let r={};for(let[i,a]of Object.entries(e)){let e=t[i],o=a.multiple?Dc(a,e,n):kc(a,e,n);if(o===void 0){if(e!=null&&e!==``){if(n.error(wc(i,a)),a.required||a.strict!==!1)return}else if(a.required){n.error(`"${i}" is required`);return}r[i]=`default`in a?h(a.default):void 0}else r[i]=o}return r}function Dc(e,t,n){if(t==null)return;if(e.type===`enum`&&e.allowAll&&t===`all`)return Ac(e.values).slice();let r=Array.isArray(t)?t:[t],i=[];for(let t of r){let r=kc(e,t,n);if(r===void 0){if(e.strict!==!1)return}else i.push(r)}if(!(e.strict===!1&&i.length===0&&r.length>0))return i}var Oc=/(datadog|ddog|datad0g|dd0g)/;function kc(e,t,n){if(e.type===`schema`)return typeof t!=`object`||!t?void 0:Ec(e.schema,t,n);if(e.type===`union`){if(t==null)return;for(let r of e.variants){let e=kc(r,t,n);if(e!==void 0)return e}return}if(t!=null)switch(e.type){case`function`:return typeof t==`function`?t:void 0;case`string`:return typeof t==`string`&&t.length>0?t:void 0;case`number`:return typeof t==`number`&&Number.isFinite(t)&&(e.min===void 0||t>=e.min)&&(e.max===void 0||t<=e.max)?t:void 0;case`percentage`:return d(t)?t:void 0;case`boolean`:return typeof t==`boolean`?t:e.strict===!1?!!t:void 0;case`site`:return typeof t!=`string`||!Oc.test(t)?void 0:t;case`match-option`:return f(t)?t:void 0;case`enum`:return typeof t==`string`&&Ac(e.values).includes(t)?t:void 0}}function Ac(e){return jc(e)?e:Object.values(e)}function jc(e){return Array.isArray(e)}var Mc=[`tracecontext`,`datadog`],Nc=[`cache-control`,`etag`,`age`,`expires`,`content-type`,`content-encoding`,`vary`,`content-length`,`server-timing`,`x-cache`,`cf-cache-status`,`x-vercel-cache`],Pc={LOW:`low`,MEDIUM:`medium`,HIGH:`high`},Fc={[Pc.LOW]:{maxFramesPerSecond:1,hashingMaxDimension:50,maxImageDimension:600,encodeQuality:.3},[Pc.MEDIUM]:{maxFramesPerSecond:4,hashingMaxDimension:100,maxImageDimension:1e3,encodeQuality:.5},[Pc.HIGH]:{maxFramesPerSecond:8,hashingMaxDimension:100,maxImageDimension:1280,encodeQuality:.75}};function Ic(e){let t=e&&Fc[e.quality];return Lt(Nt.SESSION_REPLAY_RECORD_CANVAS)&&e?.enable&&t?{enable:!0,...t}:void 0}var Lc={...et,applicationId:{type:`string`,required:!0},actionNameAttribute:{type:`string`},workerUrl:{type:`string`},subdomain:{type:`string`},sessionReplaySampleRate:{type:`percentage`,default:0},traceSampleRate:{type:`percentage`,default:100},profilingSampleRate:{type:`percentage`,default:0},compressIntakeRequests:{type:`boolean`,default:!1},trackUserInteractions:{type:`boolean`,default:!0,strict:!1},trackResources:{type:`boolean`,default:!0,strict:!1},trackLongTasks:{type:`boolean`,default:!0,strict:!1},trackViewsManually:{type:`boolean`,default:!1,strict:!1},betaEnableViewUpdates:{type:`boolean`},betaTrackWebSockets:{type:`boolean`,default:!1,strict:!1},enablePrivacyForActionName:{type:`boolean`,default:!0},propagateTraceBaggage:{type:`boolean`,default:!0},startSessionReplayRecordingManually:{type:`boolean`,default:!1,strict:!1},sessionReplayCanvasRecording:{type:`schema`,schema:{enable:{type:`boolean`,required:!0},quality:{type:`enum`,values:Pc,default:Pc.MEDIUM}}},defaultPrivacyLevel:{type:`enum`,values:Qe,default:Qe.MASK_USER_INPUT,strict:!1},traceContextInjection:{type:`enum`,values:$e,default:$e.SAMPLED,strict:!1},excludedActivityUrls:{type:`match-option`,multiple:!0,default:[]},allowedTracingUrls:{type:`union`,multiple:!0,strict:!1,default:[],variants:[{type:`match-option`},{type:`schema`,schema:{match:{type:`match-option`,required:!0},propagatorTypes:{type:`enum`,values:[`datadog`,`b3`,`b3multi`,`tracecontext`],multiple:!0,strict:!1,default:Mc}}}]},plugins:{type:`schema`,multiple:!0,strict:!1,default:[],schema:{name:{type:`string`,required:!0},getConfigurationTelemetry:{type:`function`,strict:!1,signature:void 0},onInit:{type:`function`,strict:!1,signature:void 0},onRumStart:{type:`function`,strict:!1,signature:void 0}}},trackFeatureFlagsForEvents:{type:`enum`,values:[`vital`,`action`,`long_task`,`resource`],multiple:!0,strict:!1,default:[]}};function Rc(e,t,n){return xr()?!1:e??!1}function zc(e,t){let n=Tc(e,Lc,N);if(!n)return;let r=n.allowedTracingUrls.map(Vc).filter(Boolean);if(r.length>0&&!n.service){N.error(`Service needs to be configured when tracing is enabled`);return}let i=Ic(n.sessionReplayCanvasRecording);return{...n,service:n.service||n.applicationId,sessionReplayCanvasRecording:i,betaEnableViewUpdates:Rc(n.betaEnableViewUpdates,n.proxy,t),allowedTracingUrls:r,beforeSend:n.beforeSend?wi(n.beforeSend,`beforeSend threw an error:`):void 0,rulePsr:gs(e.traceSampleRate)?e.traceSampleRate/100:void 0,trackResourceHeaders:Wc(e),allowedGraphQlUrls:Hc(e),remoteConfigurationId:bc(e)}}function Bc(e){let t=new Set;return Li(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(e=>{Vc(e)?.propagatorTypes.forEach(e=>t.add(e))}),Array.from(t)}function Vc(e){if(f(e))return{match:e,propagatorTypes:Mc};if(u(e)&&f(e.match)&&(e.propagatorTypes===null||e.propagatorTypes===void 0||Array.isArray(e.propagatorTypes)))return{match:e.match,propagatorTypes:e.propagatorTypes||Mc}}function Hc(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return N.warn(`allowedGraphQlUrls should be an array`),[];let t=[];return e.allowedGraphQlUrls.forEach(e=>{f(e)?t.push({match:e,trackPayload:!1,trackResponseErrors:!1}):u(e)&&f(e.match)&&t.push({match:e.match,trackPayload:!!e.trackPayload,trackResponseErrors:!!e.trackResponseErrors})}),t}var Uc=[`request`,`response`,`any`];function Wc(e){let t=e.trackResourceHeaders;if(t===void 0||t===!1)return[];if(t===!0)return Nc.map(e=>({name:e}));if(!Array.isArray(t))return N.warn(`trackResourceHeaders should be true or an array of MatchHeader`),[];if(t.length===0)return N.warn(`trackResourceHeaders is an empty array, no headers will be captured`),[];let n=[];return t.forEach((e,t)=>{if(!u(e)){N.warn(`trackResourceHeaders[${t}] should be a MatchHeader object`);return}if(e.name!==void 0&&!f(e.name)){N.warn(`trackResourceHeaders[${t}].name should be a MatchOption`);return}if(e.url!==void 0&&!f(e.url)){N.warn(`trackResourceHeaders[${t}].url should be a MatchOption`);return}if(e.extractor!==void 0&&!(e.extractor instanceof RegExp)){N.warn(`trackResourceHeaders[${t}].extractor should be a RegExp`);return}if(e.location!==void 0&&(typeof e.location!=`string`||!Uc.includes(e.location))){N.warn(`trackResourceHeaders[${t}].location should be 'request', 'response', or 'any'`);return}let{name:r,...i}=e;n.push({...i,...r===void 0?{}:{name:typeof r==`string`?r.toLowerCase():r}})}),n}function Gc(e){return Li(e)&&e.some(e=>u(e)&&e.trackPayload)}function Kc(e){return Li(e)&&e.some(e=>u(e)&&e.trackResponseErrors)}function qc(e){if(e===!0)return`default_headers`;if(Array.isArray(e))return`custom`}function Jc(e,t,n){let r=tt(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Li(e.allowedTracingUrls),use_allowed_graph_ql_urls:Li(e.allowedGraphQlUrls),use_track_graph_ql_payload:Gc(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Kc(e.allowedGraphQlUrls),selected_tracing_propagators:Bc(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Li(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:e.plugins?.map(e=>({name:e.name,...e.getConfigurationTelemetry?.()})),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:bc(e),remote_configuration:n&&{config_id:bc(e),last_modified:n.lastModified,last_synced:n.lastSynced,first_applied:n.firstApplied,sync_id:n.syncId},profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,track_resource_headers:qc(e.trackResourceHeaders),beta_enable_view_updates:Rc(e.betaEnableViewUpdates,e.proxy,t),beta_track_web_sockets:e.betaTrackWebSockets,...r}}function Yc(){return{assembleEventDefaults:Rr(),assembleTelemetry:Rr(),assembleEvent:Rr()}}function Xc(){let e=Zc();return new E(t=>{let n=new e(w(e=>t.notify(e)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Zc(){let e,t=window;return t.Zone&&(e=zt(t,`MutationObserver`),t.MutationObserver&&e===t.MutationObserver&&(e=zt(new t.MutationObserver(L),`originalInstance`)?.constructor)),e||=t.MutationObserver,e}var Y=function(e){return e[e.AUTO_ACTION_COMPLETED=0]=`AUTO_ACTION_COMPLETED`,e[e.BEFORE_VIEW_CREATED=1]=`BEFORE_VIEW_CREATED`,e[e.VIEW_CREATED=2]=`VIEW_CREATED`,e[e.BEFORE_VIEW_UPDATED=3]=`BEFORE_VIEW_UPDATED`,e[e.VIEW_UPDATED=4]=`VIEW_UPDATED`,e[e.VIEW_ENDED=5]=`VIEW_ENDED`,e[e.AFTER_VIEW_ENDED=6]=`AFTER_VIEW_ENDED`,e[e.REQUEST_STARTED=7]=`REQUEST_STARTED`,e[e.REQUEST_COMPLETED=8]=`REQUEST_COMPLETED`,e[e.WEBSOCKET_COMPLETED=9]=`WEBSOCKET_COMPLETED`,e[e.SESSION_EXPIRED=10]=`SESSION_EXPIRED`,e[e.SESSION_RENEWED=11]=`SESSION_RENEWED`,e[e.PREPARE_URGENT_FLUSH=12]=`PREPARE_URGENT_FLUSH`,e[e.RAW_RUM_EVENT_COLLECTED=13]=`RAW_RUM_EVENT_COLLECTED`,e[e.RUM_EVENT_COLLECTED=14]=`RUM_EVENT_COLLECTED`,e[e.RAW_ERROR_COLLECTED=15]=`RAW_ERROR_COLLECTED`,e[e.ACTION_STARTED=16]=`ACTION_STARTED`,e[e.DURATION_VITAL_STARTED=17]=`DURATION_VITAL_STARTED`,e}({}),Qc=qa,$c=Ji;function el(e){let t=Ui({expireDelay:$c});e.subscribe(1,e=>{t.add(n(e),e.startClocks.relative)}),e.subscribe(6,({endClocks:e})=>{t.closeActive(e.relative)}),e.subscribe(3,e=>{let n=t.find(e.startClocks.relative);n&&(e.name&&(n.name=e.name),e.context&&(n.context=e.context),n.sessionIsActive=e.sessionIsActive)}),e.subscribe(11,()=>{t.reset()});function n(e){return{service:e.service,version:e.version,context:e.context,id:e.id,name:e.name,startClocks:e.startClocks}}return{findView:(e,n)=>t.find(e,n),stop:()=>{t.stop()}}}var tl=[[K.DOCUMENT,e=>e===`navigation`],[K.XHR,e=>e===`xmlhttprequest`],[K.FETCH,e=>e===`fetch`],[K.BEACON,e=>e===`beacon`],[K.CSS,(e,t)=>/\.css$/i.test(t)],[K.JS,(e,t)=>/\.js$/i.test(t)],[K.IMAGE,(e,t)=>[`image`,`img`,`icon`].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[K.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[K.MEDIA,(e,t)=>[`audio`,`video`].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function nl(e){let t=e.name;if(!oe(t))return K.OTHER;let n=se(t);for(let[t,r]of tl)if(r(e.initiatorType,n))return t;return K.OTHER}function rl(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function il(e){return e.initiatorType===`xmlhttprequest`||e.initiatorType===`fetch`}function al(e){let{duration:t,startTime:n,responseEnd:r}=e;return e.initiatorType===`navigation`||t===0&&n<r?k(n,r):t}function ol(e){if(!cl(e))return;let{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:a,domainLookupStart:o,domainLookupEnd:s,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:p}=e,m={download:ul(t,f,p),first_byte:ul(t,d,f)};return 0<r&&r<n&&(m.worker=ul(t,r,n)),n<u&&(m.connect=ul(t,c,u),c<=l&&l<=u&&(m.ssl=ul(t,l,u))),n<s&&(m.dns=ul(t,o,s)),t<a&&(m.redirect=ul(t,i,a)),m}function sl(e){return e.duration>=0}function cl(e){let t=rl(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=!ll(e)||rl(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart);return t&&n}function ll(e){return e.redirectEnd>e.startTime}function ul(e,t,n){if(e<=t&&t<=n)return{duration:A(k(t,n)),start:A(k(e,t))}}function dl(e){return e.nextHopProtocol===``?void 0:e.nextHopProtocol}function fl(e){return e.deliveryType===``?`other`:e.deliveryType}function pl(e){if(e.startTime<e.responseStart){let{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function ml(e){return e&&(!Ae(e)||Lt(Nt.TRACK_INTAKE_REQUESTS))}var hl=/data:(.+)?(;base64)?,/g,gl=24e3;function _l(e,t=gl){if(e.length<=t||!e.startsWith(`data:`))return e;let n=e.substring(0,100).match(hl);return n?`${n[0]}[...]`:e}function vl(e){return e.nodeType===Node.TEXT_NODE}function yl(e){return e.nodeType===Node.COMMENT_NODE}function bl(e){return e.nodeType===Node.ELEMENT_NODE}function xl(e){return bl(e)&&!!e.shadowRoot}function Sl(e){let t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&bl(t.host)}function Cl(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;xl(e)&&t(e.shadowRoot)}function wl(e){return Sl(e)?e.host:e.parentNode}function Tl(e){if(e.parentElement)return e.parentElement;let t=e.parentNode;return t&&Sl(t)?t.host:null}var El=function(e){return e.EVENT=`event`,e.FIRST_INPUT=`first-input`,e.LARGEST_CONTENTFUL_PAINT=`largest-contentful-paint`,e.LAYOUT_SHIFT=`layout-shift`,e.LONG_TASK=`longtask`,e.LONG_ANIMATION_FRAME=`long-animation-frame`,e.NAVIGATION=`navigation`,e.PAINT=`paint`,e.RESOURCE=`resource`,e.SOFT_NAVIGATION=`soft-navigation`,e.INTERACTION_CONTENTFUL_PAINT=`interaction-contentful-paint`,e.VISIBILITY_STATE=`visibility-state`,e}({});function Dl(e){return new E(t=>{let n=e=>{let n=Ml(e);n.length>0&&t.notify(n)},r,i=!0,a=new PerformanceObserver(w(e=>{i?r=F(()=>n(e.getEntries())):n(e.getEntries())}));return a.observe(e),i=!1,kl(),()=>{a.disconnect(),I(r)}})}var Ol;function kl(){!Ol&&Al()&&`addEventListener`in performance&&(Ol=B(performance,`resourcetimingbufferfull`,()=>{performance.clearResourceTimings()}))}function Al(){return window.performance!==void 0&&`getEntries`in performance}function jl(e){return PerformanceObserver.supportedEntryTypes.includes(e)}function Ml(e){return e.filter(e=>!Nl(e))}function Nl(e){return e.entryType===`resource`&&(!ml(e.name)||!sl(e))}var Pl=`data-dd-action-name`,Fl=`Masked Element`,Il=`::shadow `,Ll=[Pl,`data-testid`,`data-test`,`data-qa`,`data-cy`,`data-test-id`,`data-qa-id`,`data-testing`,`data-component`,`data-element`,`data-source-file`],Rl=[ql,Wl],zl=[ql,Gl,Kl];function Bl(e,t){if(!e.isConnected)return;let n=Vl(e),r=[];for(let{rootNode:e,target:i}of n){let n=Hl(i,e,t);if(!n)return;r.push(n)}return r.join(Il)}function Vl(e){let t=[],n=e;for(;n;){let e=n.getRootNode();if(t.push({rootNode:e,target:n}),Sl(e))n=e.host;else break}return t.reverse()}function Hl(e,t,n){let r,i=e;for(;i&&i.nodeName!==`HTML`;){let e=Zl(i,t,Rl,Ql,n,r);if(e)return eu(e,r);r=eu(Zl(i,t,zl,$l,n,r)||Yl(i),r),i=i.parentElement}return r}function Ul(e){return/[0-9]/.test(e)}function Wl(e){if(e.id&&!Ul(e.id))return`#${CSS.escape(e.id)}`}function Gl(e){if(e.tagName===`BODY`)return;let t=e.classList;for(let n=0;n<t.length;n+=1){let r=t[n];if(!Ul(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function Kl(e){return CSS.escape(e.tagName)}function ql(e,t){if(t){let e=n(t);if(e)return e}for(let e of Ll){let t=n(e);if(t)return t}function n(t){if(e.hasAttribute(t))return`${CSS.escape(e.tagName)}${Jl(t,e.getAttribute(t))}`}}function Jl(e,t){return`[${e}="${CSS.escape(t)}"]`}function Yl(e){let t=Xl(e);return`${CSS.escape(e.tagName)}:nth-of-type(${t})`}function Xl(e){let t=e.parentNode.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return n}function Zl(e,t,n,r,i,a){for(let o of n){let n=o(e,i);if(n&&r(e,t,n,a))return n}}function Ql(e,t,n,r){return t.querySelectorAll(eu(n,r)).length===1}function $l(e,t,n,r){let i;if(r===void 0)i=e=>e.matches(n);else{let e=eu(`${n}:scope`,r);i=t=>t.querySelector(e)!==null}let a=e.previousElementSibling;for(;a;){if(i(a))return!1;a=a.previousElementSibling}for(a=e.nextElementSibling;a;){if(i(a))return!1;a=a.nextElementSibling}return!0}function eu(e,t){return t?`${e}>${t}`:e}var X={IGNORE:`ignore`,HIDDEN:`hidden`,ALLOW:Qe.ALLOW,MASK:Qe.MASK,MASK_USER_INPUT:Qe.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Qe.MASK_UNLESS_ALLOWLISTED},tu=`data-dd-privacy`,nu=`hidden`,ru=`dd-privacy-`,iu=`data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`,au={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0};function ou(e){return`[${tu}="${e}"], .${ru}${e}`}function su(e,t,n){if(n?.has(e))return n.get(e);let r=wl(e),i=r?su(r,t,n):t,a=cu(lu(e),i);return n&&n.set(e,a),a}function cu(e,t){switch(t){case X.HIDDEN:case X.IGNORE:return t}switch(e){case X.ALLOW:case X.MASK:case X.MASK_USER_INPUT:case X.MASK_UNLESS_ALLOWLISTED:case X.HIDDEN:case X.IGNORE:return e;default:return t}}function lu(e){if(bl(e)){if(e.tagName===`BASE`)return X.ALLOW;if(e.tagName===`INPUT`){let t=e;if(t.type===`password`||t.type===`email`||t.type===`tel`||t.type===`hidden`)return X.MASK;let n=t.getAttribute(`autocomplete`);if(n&&(n.startsWith(`cc-`)||n.endsWith(`-password`)))return X.MASK}if(e.matches(ou(X.HIDDEN)))return X.HIDDEN;if(e.matches(ou(X.MASK)))return X.MASK;if(e.matches(ou(X.MASK_UNLESS_ALLOWLISTED)))return X.MASK_UNLESS_ALLOWLISTED;if(e.matches(ou(X.MASK_USER_INPUT)))return X.MASK_USER_INPUT;if(e.matches(ou(X.ALLOW)))return X.ALLOW;if(hu(e))return X.IGNORE}}function uu(e,t){switch(t){case X.MASK:case X.HIDDEN:case X.IGNORE:return!0;case X.MASK_UNLESS_ALLOWLISTED:return vl(e)?fu(e.parentNode)?!0:!gu(e.textContent||``):fu(e);case X.MASK_USER_INPUT:return vl(e)?fu(e.parentNode):fu(e);default:return!1}}function du(e,t,n,r,i){if(r!==X.MASK&&r!==X.MASK_UNLESS_ALLOWLISTED||t===`data-dd-privacy`||Ll.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case`title`:case`alt`:case`placeholder`:case`aria-label`:case`name`:return!0}return!!(e===`A`&&t===`href`||e===`IFRAME`&&t===`srcdoc`||n&&t.startsWith(`data-`)||(e===`IMG`||e===`SOURCE`)&&(t===`src`||t===`srcset`))}function fu(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;let t=e;if(t.tagName===`INPUT`)switch(t.type){case`button`:case`color`:case`reset`:case`submit`:return!1}return!!au[t.tagName]}function pu(e){return e.replace(/\S/g,`x`)}function mu(e,t){let n=e.parentElement?.tagName,r=e.textContent||``,i=t;return n===`SCRIPT`||i===X.HIDDEN?r=`***`:uu(e,i)&&(n===`DATALIST`||n===`SELECT`||n===`OPTGROUP`||(r=n===`OPTION`?`***`:pu(r))),n===`HEAD`&&!r.trim()?``:r}function hu(e){if(e.nodeName===`SCRIPT`)return!0;if(e.nodeName===`LINK`){let e=t(`rel`);return/preload|prefetch/i.test(e)&&t(`as`)===`script`||e===`shortcut icon`||e===`icon`}if(e.nodeName===`META`){let n=t(`name`),r=t(`rel`),i=t(`property`);return/^msapplication-tile(image|color)$/.test(n)||n===`application-name`||r===`icon`||r===`apple-touch-icon`||r===`shortcut icon`||n===`keywords`||n===`description`||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n===`pinterest`||n===`robots`||n===`googlebot`||n===`bingbot`||e.hasAttribute(`http-equiv`)||n===`author`||n===`generator`||n===`framework`||n===`publisher`||n===`progid`||/^article:/.test(i)||/^product:/.test(i)||n===`google-site-verification`||n===`yandex-verification`||n===`csrf-token`||n===`p:domain_verify`||n===`verify-v1`||n===`verification`||n===`shopify-checkout-api-token`}function t(t){return(e.getAttribute(t)||``).toLowerCase()}return!1}function gu(e){return!e?.trim()||window.$DD_ALLOW?.has(e.toLocaleLowerCase())||!1}function _u(e,t){return gu(e)?e:t||pu(e)}function vu(){let e,t=window.visualViewport;return e=t?t.pageLeft-t.offsetLeft:window.scrollX===void 0?window.pageXOffset||0:window.scrollX,Math.round(e)}function yu(){let e,t=window.visualViewport;return e=t?t.pageTop-t.offsetTop:window.scrollY===void 0?window.pageYOffset||0:window.scrollY,Math.round(e)}var bu;function xu(){return bu||=Su(),bu}function Su(){return new E(e=>{let{throttled:t}=Ht(()=>{e.notify(Cu())},200);return B(window,z.RESIZE,t,{capture:!0,passive:!0}).stop})}function Cu(){let e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}var wu=function(e){return e[e.OFF=0]=`OFF`,e[e.SAMPLED=1]=`SAMPLED`,e[e.FORCED=2]=`FORCED`,e}({});function Tu(e,t){return xr()?+!!br(vr.RECORDS):Ki(e.id,Wi(t.sessionSampleRate,t.sessionReplaySampleRate))?1:e.isReplayForced?2:0}function Eu(){let e=new E,{stop:t}=R(window,`open`,()=>e.notify());return{observable:e,stop:t}}function Du(e,t,n,r,i){return{get:a=>{let o=n.findView(a),s=i.findUrl(a),c=t.findTrackedSession(a);if(c&&o&&s){let t=r.findActionId(a);return{application_id:e,session_id:c.id,user_action:t?{id:t}:void 0,view:{id:o.id,name:o.name,referrer:s.referrer,url:s.url}}}}}}function Ou(){return Au(64)}function ku(){return Au(63)}function Au(e){let t=crypto.getRandomValues(new Uint32Array(2)),n=BigInt(t[0])+(BigInt(t[1])<<32n);return e===63&&(n&=9223372036854775807n),n}function ju(e){return e.toString(16).padStart(16,`0`)}function Mu(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Nu(e,t,n,r){return{clearTracingIfNeeded:Mu,traceFetch:i=>Pu(e,i,t,n,r,e=>{if(i.input instanceof Request&&!i.init?.headers)i.input=new Request(i.input),Object.keys(e).forEach(t=>{i.input.headers.append(t,e[t])});else{i.init=kt(i.init);let t=[];i.init.headers instanceof Headers?i.init.headers.forEach((e,n)=>{t.push([n,e])}):Array.isArray(i.init.headers)?i.init.headers.forEach(e=>{t.push(e)}):i.init.headers&&Object.keys(i.init.headers).forEach(e=>{t.push([e,i.init.headers[e]])}),i.init.headers=t.concat(Er(e))}}),traceXhr:(i,a)=>Pu(e,i,t,n,r,e=>{try{Object.keys(e).forEach(t=>{a.setRequestHeader(t,e[t])})}catch{}})}}function Pu(e,t,n,r,i,a){let o=n.findTrackedSession();if(!o)return;let s=e.allowedTracingUrls.find(e=>bt([e.match],t.url,!0));if(!s)return;let c=Ki(o.id,Wi(e.sessionSampleRate,e.traceSampleRate)),l=xr()?yr()?.getIsTraceSampled()??c:c;(l||e.traceContextInjection===$e.ALL)&&(t.traceSampled=l,t.traceId=Ou(),t.spanId=ku(),a(Fu(t.traceId,t.spanId,t.traceSampled,o.id,s.propagatorTypes,r,i,e)))}function Fu(e,t,n,r,i,a,o,s){let c={};if(i.forEach(r=>{switch(r){case`datadog`:Object.assign(c,{"x-datadog-origin":`rum`,"x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?`1`:`0`,"x-datadog-trace-id":e.toString()});break;case`tracecontext`:Object.assign(c,{traceparent:`00-0000000000000000${ju(e)}-${ju(t)}-0${n?`1`:`0`}`,tracestate:`dd=s:${n?`1`:`0`};o:rum`});break;case`b3`:Object.assign(c,{b3:`${ju(e)}-${ju(t)}-${n?`1`:`0`}`});break;case`b3multi`:Object.assign(c,{"X-B3-TraceId":ju(e),"X-B3-SpanId":ju(t),"X-B3-Sampled":n?`1`:`0`})}}),s.propagateTraceBaggage){let e={"session.id":r},t=a.getContext().id;typeof t==`string`&&(e[`user.id`]=t);let n=o.getContext().id;typeof n==`string`&&(e[`account.id`]=n);let i=Object.entries(e).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(`,`);i&&(c.baggage=i)}return c}var Iu=32*wn;function Lu(e,t){let n=Bu(e,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){let t=Ru(e.responseBody);t&&(n.error_count=t.length,n.errors=t)}return n}}function Ru(e){let t=Ot(e);if(!t||typeof t!=`object`)return;let n=t;if(Li(n.errors))return n.errors.map(e=>({message:e.message,path:e.path,locations:e.locations,code:e.extensions?.code}))}function zu(e,t){return t.allowedGraphQlUrls.find(t=>bt([t.match],e))}function Bu(e,t=!1){let n;if(e.method===`POST`?n=Vu(e.requestBody):e.method===`GET`&&(n=Hu(e.url)),n)return Uu(n,t)}function Vu(e){if(!e||typeof e!=`string`)return;let t=Ot(e);if(t)return{query:t.query,operationName:t.operationName,variables:t.variables?JSON.stringify(t.variables):void 0,operationType:t.operationType}}function Hu(e){let t=ce(e).searchParams,n=t.get(`variables`),r=n&&Ot(n)!==void 0?n:void 0;return{query:t.get(`query`)||void 0,operationName:t.get(`operationName`)||void 0,variables:r,operationType:t.get(`operationType`)||void 0}}function Uu(e,t){let n,r,i;if(e.query){let i=e.query.trim();n=Wu(i),t&&(r=ot(i,Iu,`...`))}if(!n){let t=e.operationType;(t===`query`||t===`mutation`||t===`subscription`)&&(n=t)}return e.variables&&(i=e.variables),{operationType:n,operationName:e.operationName,variables:i,payload:r}}function Wu(e){return e.match(/^\s*(query|mutation|subscription)\b/i)?.[1]}var Gu=1;function Ku(e,t,n,r,i,a){let o=Nu(t,n,r,i);qu(e,o,a),Ju(e,t,o,a)}function qu(e,t,n){let r=[];return r.push(io().subscribe(e=>{e.state===`start`&&ml(e.url)&&(t.traceXhr(e,e.xhr),Yu(e))})),r.push(n.subscribe(({data:n,type:r})=>{if(r!==fs.XHR)return;let i=n;if(ml(i.url))switch(i.state){case`start`:Yu(i),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case`complete`:t.clearTracingIfNeeded(i),e.notify(8,{...i,type:us.XHR,isAbortedOnStart:!1})}})),{stop:()=>r.forEach(e=>e.unsubscribe())}}function Ju(e,t,n,r){let i=[];return i.push(mo({responseBodyAction:e=>zu(e.url,t)?.trackResponseErrors?uo.COLLECT:uo.IGNORE}).subscribe(e=>{e.state===`start`&&ml(e.url)&&(n.traceFetch(e),Yu(e))})),i.push(r.subscribe(({data:t,type:r})=>{if(r!==fs.FETCH)return;let i=t;if(ml(i.url))switch(i.state){case`start`:Yu(i),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case`resolve`:n.clearTracingIfNeeded(i),e.notify(8,{...i,duration:k(i.startClocks.timeStamp,O()),type:us.FETCH,requestBody:i.init?.body})}})),{stop:()=>i.forEach(e=>e.unsubscribe())}}function Yu(e){e.requestIndex||=Gu++}var Xu=`websocket-connecting`,Zu=`websocket-closed`;function Qu(e,t,n){let r=$u(e,bo(),t,n),i=e.subscribe(10,({endClocks:e})=>{r.flushOpenConnections(`session_end`,e)});return{stop:()=>{i.unsubscribe(),r.flushOpenConnections(`session_end`),r.stop()}}}function $u(e,t,n,r){let i=new Map;function a(t,i,a){let o=nd(t,i,a,n);e.notify(9,o),r({id:M(),name:Zu,type:Us.DURATION,startClocks:o.endClocks,duration:0,context:V({url:o.url,connection_id:o.connectionId})})}let o=t.subscribe(e=>{switch(e.state){case`connecting`:{let t=M(),a=n.findView(e.startClocks.relative)?.id,o=ed(e.url),s={webSocket:e.instance,connectionId:t,url:o,startClocks:e.startClocks,startViewId:a,messagesIn:{count:0,size:0},messagesOut:{count:0,size:0},longestInboundSilence:0,bufferedAmountMax:0};i.set(e.instance,s),r({id:M(),name:Xu,type:Us.DURATION,startClocks:e.startClocks,duration:0,context:V({url:o,connection_id:t})});return}case`open`:{let t=i.get(e.instance);if(!t)return;t.openClocks=e.openClocks,t.protocol=e.protocol,t.setupDuration=k(t.startClocks.timeStamp,e.openClocks.timeStamp);return}case`message-in`:{let t=i.get(e.instance);if(!t)return;t.messagesIn.count+=1,t.messagesIn.size+=e.size,td(t,e.at,`in`);return}case`message-out`:{let t=i.get(e.instance);if(!t)return;e.bufferedAmountPreSend>t.bufferedAmountMax&&(t.bufferedAmountMax=e.bufferedAmountPreSend),t.messagesOut.count+=1,t.messagesOut.size+=e.size,td(t,e.at,`out`);return}case`closed`:{let t=i.get(e.instance);if(!t)return;i.delete(e.instance),a(t,e,`close_event`);return}}});return{flushOpenConnections:(e,t=j())=>{i.forEach(n=>{a(n,{at:t},e)}),i.clear()},stop:()=>{o.unsubscribe(),i.clear()}}}function ed(e){let t=ce(e);return t.search=``,t.href}function td(e,t,n){if(e.openClocks===void 0)return;let r=k(e.openClocks.timeStamp,t.timeStamp);if(n===`in`&&e.firstMessageInOffset===void 0?e.firstMessageInOffset=r:n===`out`&&e.firstMessageOutOffset===void 0&&(e.firstMessageOutOffset=r),n===`in`){if(e.lastMessageInAt!==void 0){let n=k(e.lastMessageInAt,t.timeStamp);n>e.longestInboundSilence&&(e.longestInboundSilence=n)}e.lastMessageInAt=t.timeStamp}}function nd(e,t,n,r){let i=t.at,a=n===`session_end`?r.findView(i.relative,{returnInactive:!0})?.id:r.findView(i.relative)?.id,o=e.lastMessageInAt===void 0?void 0:k(e.lastMessageInAt,i.timeStamp),{openClocks:s,...c}=e;return{...c,endClocks:i,endViewId:a,inboundIdleDurationBeforeClose:o,trackingEndReason:n,handshakeSucceeded:s!==void 0,setupDuration:e.setupDuration??k(e.startClocks.timeStamp,i.timeStamp),closeCode:t.code,closeReason:t.reason,wasClean:t.wasClean}}function rd(e){return gs(e)&&e<0?void 0:e}function id(e,t,n,r,i,a){let o=P(ad)(e,t,n,r),s,c=!1,l=F(w(()=>p({hadActivity:!1})),100),u=a===void 0?void 0:F(w(()=>p({hadActivity:!0,end:O()})),a),d=o.subscribe(({isBusy:e})=>{I(l),I(s);let t=O();e||(s=F(w(()=>p({hadActivity:!0,end:t})),100))}),f=()=>{c=!0,I(l),I(s),I(u),d.unsubscribe()};function p(e){c||(f(),i(e))}return{stop:f}}function ad(e,t,n,r){return new E(i=>{let a=[],o,s=0;return a.push(t.subscribe(e=>{e.every(sd)||c()}),n.subscribe(c),Dl({type:`resource`}).subscribe(e=>{e.some(e=>!od(r,e.name))&&c()}),e.subscribe(7,e=>{od(r,e.url)||(o===void 0&&(o=e.requestIndex),s+=1,c())}),e.subscribe(8,e=>{od(r,e.url)||o===void 0||e.requestIndex<o||(--s,c())})),()=>{a.forEach(e=>e.unsubscribe())};function c(){i.notify({isBusy:s>0})}})}function od(e,t){return bt(e.excludedActivityUrls,t)}function sd(e){let t=e.type===`characterData`?e.target.parentElement:e.target;return!!(t&&bl(t)&&t.matches(`[data-dd-excluded-activity-mutations], [data-dd-excluded-activity-mutations] *`))}function cd({lifeCycle:e,isChildEvent:t,onChange:n=L}){let r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(14,e=>{if(e.type!==`view`&&e.type!==`vital`&&t(e))switch(e.type){case J.ERROR:r.errorCount+=1,n();break;case J.ACTION:r.actionCount+=1,e.action.frustration&&(r.frustrationCount+=e.action.frustration.type.length),n();break;case J.LONG_TASK:r.longTaskCount+=1,n();break;case J.RESOURCE:e._dd?.discarded||(r.resourceCount+=1,n())}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}var ld=5*je;function ud(e){let t=Ui({expireDelay:ld}),n=new Map;function r(e){n.delete(e.key),e.eventCounts?.stop()}function i(){n.forEach(e=>{r(e)}),t.reset()}let a=e.subscribe(11,i);function o(i,a,o,s){let c=M(),l=t.add(c,a.relative),u=n.get(i);u&&r(u);let d={id:c,key:i,startClocks:a,data:o,historyEntry:l,eventCounts:s?.isChildEvent?cd({lifeCycle:e,isChildEvent:s.isChildEvent(c)}):void 0};return n.set(i,d),d}function s(e,t,i){let a=n.get(e);if(!a)return;let o=i?g(a.data,i):a.data;a.historyEntry.close(t.relative);let s=k(a.startClocks.timeStamp,t.timeStamp),c=a.eventCounts?.eventCounts;return r(a),{...o,id:a.id,startClocks:a.startClocks,duration:s,counts:c}}function c(e){let t=n.get(e);if(!t)return;let i=t.eventCounts?.eventCounts;return r(t),t.historyEntry.remove(),{...t.data,id:t.id,startClocks:t.startClocks,counts:i}}function l(e){return t.findAll(e)}function u(e){return n.get(e)?.eventCounts?.eventCounts}function d(){a.unsubscribe(),i(),t.stop()}return{start:o,stop:s,discard:c,getCounts:u,findId:l,stopAll:d}}var dd=[`HTML`,`BODY`],fd=2*wn,pd=Ll.concat([`role`,`type`,`disabled`,`readonly`,`tabindex`,`draggable`,`target`,`rel`,`download`,`method`,`action`,`enctype`,`autocomplete`]);function md(e,t){let n=e.filter(e=>e instanceof Element&&!dd.includes(e.tagName));if(n.length===0)return``;let r=t?[t].concat(pd):pd,i=``;for(let e of n){let t=hd(e,r);if(i+=t,i.length>=fd)return ot(i,fd)}return i}function hd(e,t){let n=Kl(e),r=Wl(e),i=gd(e),a=vd(e,t),o=_d(e);return`${n}${r||``}${a}${i}${o};`}function gd(e){return Array.from(e.classList).filter(e=>!Ul(e)).sort().map(e=>`.${CSS.escape(e)}`).join(``)}function _d(e){let t=Array.from(e.parentNode.children);if(t.length<=1)return``;let n=t.filter(t=>t.tagName===e.tagName),r=t.indexOf(e),i=Xl(e);return`:nth-child(${r+1})${n.length>1?`:nth-of-type(${i})`:``}`}function vd(e,t){let n=[],r=Array.from(e.attributes);for(let e of r)t.includes(e.name)&&n.push(Jl(e.name,e.value));return n.sort().join(``)}var yd=`data-dd-ignore-frustration`,bd=`all`,xd=`rage-click`,Sd=`dead-click`,Cd=`error-click`;function wd(e,t){return(e&t)!==0}function Td(e){let t=0,n=e;for(;n;){let e=n.getAttribute(yd);if(e!==null){let n=e.split(/\s+/);if(e.trim()===``||n.includes(bd))return 7;n.includes(xd)&&(t|=1),n.includes(Sd)&&(t|=2),n.includes(Cd)&&(t|=4)}if(t===7)break;n=Tl(n)}return t}var Ed=D;function Dd(e,t){let n=[],r=0,i;a(e);function a(e){e.stopObservable.subscribe(o),n.push(e),I(i),i=F(s,Ed)}function o(){r===1&&n.every(e=>e.isStopped())&&(r=2,t(n))}function s(){I(i),r===0&&(r=1,o())}return{tryAppend:e=>r===0?n.length>0&&!Od(n[n.length-1],e)?(s(),!1):(a(e),!0):!1,stop:()=>{s()}}}function Od(e,t){return wd(e.ignore,1)===wd(t.ignore,1)&&e.event.target===t.event.target&&kd(e.event,t.event)<=100&&e.event.timeStamp-t.event.timeStamp<=Ed}function kd(e,t){return Math.sqrt((e.clientX-t.clientX)**2+(e.clientY-t.clientY)**2)}function Ad(e,t,n=X.ALLOW){let r=new Map,{actionNameAttribute:i}=t,a=jd(e,`data-dd-action-name`)||i&&jd(e,i);return a?{name:a,nameSource:`custom_attribute`}:n===X.MASK?{name:Fl,nameSource:`mask_placeholder`}:Id(e,Nd,t,r)||Id(e,Pd,t,r)||{name:``,nameSource:`blank`}}function jd(e,t){let n=Md(e,`[${t}]`);if(n)return Rd(Ld(n.getAttribute(t).trim()))}function Md(e,t){let n=e;for(;n;){if(n.matches(t))return n;n=Tl(n)}return null}var Nd=[(e,t,n)=>{if(`labels`in e&&e.labels&&e.labels.length>0)return Vd(e.labels[0],t,n)},e=>{if(e.nodeName===`INPUT`){let t=e,n=t.getAttribute(`type`);if(n===`button`||n===`submit`||n===`reset`)return{name:t.value,nameSource:`text_content`}}},(e,t,n)=>{if(e.nodeName===`BUTTON`||e.nodeName===`LABEL`||e.nodeName===`A`||e.getAttribute(`role`)===`button`||e.getAttribute(`role`)===`link`)return Vd(e,t,n)},(e,t,n)=>Bd(e,`aria-label`,t,n),(e,t,n)=>{let r=e.getAttribute(`aria-labelledby`);if(r)return{name:r.split(/\s+/).map(t=>zd(e,t)).filter(e=>!!e).map(e=>Hd(e,t,n)).join(` `),nameSource:`text_content`}},(e,t,n)=>Bd(e,`alt`,t,n),(e,t,n)=>Bd(e,`name`,t,n),(e,t,n)=>Bd(e,`title`,t,n),(e,t,n)=>Bd(e,`placeholder`,t,n),(e,t,n)=>{if(`options`in e&&e.options.length>0)return Vd(e.options[0],t,n)}],Pd=[(e,t,n)=>Vd(e,t,n)],Fd=10;function Id(e,t,n,r){let i=e,a=0;for(;a<=Fd&&i&&i.nodeName!==`BODY`&&i.nodeName!==`HTML`&&i.nodeName!==`HEAD`;){for(let e of t){let t=e(i,n,r);if(t){let{name:e,nameSource:n}=t,r=e?.trim();if(r)return{name:Rd(Ld(r)),nameSource:n}}}if(i.nodeName===`FORM`)break;i=Tl(i),a+=1}}function Ld(e){return e.replace(/\s+/g,` `)}function Rd(e){return e.length>100?`${ot(e,100)} [...]`:e}function zd(e,t){let n=e.getRootNode();if(n instanceof ShadowRoot){let e=n.getElementById(t);if(e)return e}return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Bd(e,t,n,r){let{enablePrivacyForActionName:i,defaultPrivacyLevel:a}=n,o=e.getAttribute(t);if(o&&i){let i=su(e,a,r);du(e.tagName,t,o,i,n)&&(o=_u(o,Fl))}else o||=``;return{name:o,nameSource:`standard_attribute`}}function Vd(e,t,n){return{name:Hd(e,t,n)||``,nameSource:`text_content`}}function Hd(e,t,n){if(e.isContentEditable)return;let{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:a}=t,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c),s=``;for(;o.nextNode();){let e=o.currentNode;if(bl(e)){(e.nodeName===`BR`||e.nodeName===`P`||[`block`,`flex`,`grid`,`list-item`,`table`,`table-caption`].includes(getComputedStyle(e).display))&&(s+=` `);continue}s+=e.textContent||``}return s.replace(/\s+/g,` `).trim();function c(e){let t=su(e,a,n);if(r&&t&&uu(e,t))return NodeFilter.FILTER_REJECT;if(bl(e)){if(e.hasAttribute(`data-dd-action-name`)||i&&e.hasAttribute(i))return NodeFilter.FILTER_REJECT;let t=getComputedStyle(e);if(t.visibility!==`visible`||t.display===`none`||t.contentVisibility&&t.contentVisibility!==`visible`)return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Ud({onPointerDown:e,onPointerUp:t}){let n,r={selection:!1,input:!1,scroll:!1},i,a=[B(window,z.POINTER_DOWN,t=>{Gd(t)&&(n=Wd(),r={selection:!1,input:!1,scroll:!1},i=e(t))},{capture:!0}),B(window,z.SELECTION_CHANGE,()=>{(!n||!Wd())&&(r.selection=!0)},{capture:!0}),B(window,z.SCROLL,()=>{r.scroll=!0},{capture:!0,passive:!0}),B(window,z.POINTER_UP,e=>{if(Gd(e)&&i){let n=r;t(i,e,()=>n),i=void 0}},{capture:!0}),B(window,z.INPUT,()=>{r.input=!0},{capture:!0})];return{stop:()=>{a.forEach(e=>e.stop())}}}function Wd(){let e=window.getSelection();return!e||e.isCollapsed}function Gd(e){return e.target instanceof Element&&e.isPrimary!==!1}var Kd=3;function qd(e,t){if(Jd(e))return t.addFrustration(Hs.RAGE_CLICK),e.some(Xd)&&t.addFrustration(Hs.DEAD_CLICK),t.hasError&&!wd(t.ignore,4)&&t.addFrustration(Hs.ERROR_CLICK),{isRage:!0};let n=e.some(e=>e.getUserActivity().selection);return e.forEach(e=>{e.hasError&&!wd(e.ignore,4)&&e.addFrustration(Hs.ERROR_CLICK),Xd(e)&&!n&&e.addFrustration(Hs.DEAD_CLICK)}),{isRage:!1}}function Jd(e){if(e.some(e=>wd(e.ignore,1)||e.getUserActivity().selection||e.getUserActivity().scroll))return!1;for(let t=0;t<e.length-2;t+=1)if(e[t+Kd-1].event.timeStamp-e[t].event.timeStamp<=1e3)return!0;return!1}var Yd=`input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *`;function Xd(e){if(wd(e.ignore,2)||e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName===`LABEL`&&t.hasAttribute(`for`)&&(t=document.getElementById(t.getAttribute(`for`))),!t?.matches(Yd)}var Zd=10*D,Qd=new Map;function $d(e){let t=Qd.get(e);return Qd.delete(e),t}function ef(e,t){Qd.set(e,t),Qd.forEach((e,t)=>{k(t,Ie())>Zd&&Qd.delete(t)})}function tf(e){return t=>t.action?.id?.includes(e)??!1}function nf(e,t,n,r){let i=ud(e),a=new E,o;e.subscribe(5,l),e.subscribe(12,l);let{stop:s}=Ud({onPointerDown:i=>rf(r,e,t,i,n),onPointerUp:({clickActionBase:o,ignore:s,hadActivityOnPointerDown:l},u,d)=>{af(r,e,t,n,i,a,c,o,s,u,d,l)}});return{stop:()=>{l(),a.notify(),s(),i.stopAll()},findActionId:i.findId};function c(e){if(!o?.tryAppend(e)){let t=e.clone(),n=Dd(e,e=>{lf(e,t),o===n&&(o=void 0)});o=n}}function l(){o&&o.stop()}}function rf(e,t,n,r,i){let a;if(a=e.enablePrivacyForActionName?su(sf(r),e.defaultPrivacyLevel):X.ALLOW,a===X.HIDDEN)return;let o=of(r,a,e),s=!1;return id(t,n,i,e,e=>{s=e.hadActivity},100),{clickActionBase:o,ignore:Td(sf(r)),hadActivityOnPointerDown:()=>s}}function af(e,t,n,r,i,a,o,s,c,l,u,d){let f=cf(t,i,u,s,c,l);o(f);let p=s?.target?.selector;p&&ef(l.timeStamp,p);let{stop:m}=id(t,n,r,e,e=>{e.hadActivity&&e.end<f.startClocks.timeStamp?f.discard():e.hadActivity?f.stop(e.end):d()?f.stop(f.startClocks.timeStamp):f.stop()},Zd),h=t.subscribe(5,({endClocks:e})=>{f.stop(e.timeStamp)}),g=t.subscribe(12,()=>{f.stop(O())}),_=a.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{g.unsubscribe(),h.unsubscribe(),m(),_.unsubscribe()})}function of(e,t,n){let r=sf(e),i=r.getBoundingClientRect(),a=Bl(r,n.actionNameAttribute),o=md(e.composedPath(),n.actionNameAttribute);a&&ef(e.timeStamp,a);let{name:s,nameSource:c}=Ad(r,n,t);return{type:Vs.CLICK,target:{width:Math.round(i.width),height:Math.round(i.height),selector:a,composedPathSelector:o||void 0},position:{x:Math.round(e.clientX-i.left),y:Math.round(e.clientY-i.top)},name:s,nameSource:c}}function sf(e){if(e.composed&&xl(e.target)&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0&&t[0]instanceof Element)return t[0]}return e.target}function cf(e,t,n,r,i,a){let o=M(),s=Re(a.timeStamp),c=t.start(o,s,r,{isChildEvent:tf});e.notify(16,c);let l=0,u,d=[],f=new E;function p(e){l===0&&(l=1,u=e?t.stop(o,ze(e)):t.discard(o),f.notify())}return{event:a,ignore:i,stop:p,stopObservable:f,get hasError(){let e=u?.counts??t.getCounts(o);return e?e.errorCount>0:!1},get hasPageActivity(){return u&&`duration`in u},getUserActivity:n,addFrustration:e=>{d.push(e)},get startClocks(){return s},isStopped:()=>l===1||l===2,clone:()=>cf(e,t,n,r,i,a),validate:t=>{if(p(),l!==1||!u)return;let n={frustrationTypes:d,events:t??[a],event:a,...u,counts:u.counts};e.notify(0,n),l=2},discard:()=>{p(),l=2}}}function lf(e,t){let{isRage:n}=qd(e,t);n?(e.forEach(e=>e.discard()),t.stop(O()),t.validate(e.map(e=>e.event))):(t.discard(),e.forEach(e=>e.validate()))}function uf(e,t){let n=ud(e);function r(t,r={},i=j()){let a=r.actionKey??t,o=n.start(a,i,{name:t,...r},{isChildEvent:tf});e.notify(16,o)}function i(e,r={},i=j()){let a=r.actionKey??e,o=n.stop(a,i,r);if(!o)return;let s=[];o.counts&&o.counts.errorCount>0&&s.push(Hs.ERROR_CLICK),t({...o,type:o.type||Vs.CUSTOM,frustrationTypes:s})}function a(e){t({id:M(),frustrationTypes:[],...e})}return{addAction:a,startAction:r,stopAction:i,findActionId:n.findId,stop:n.stopAll}}function df(e,t,n,r,i){let{unsubscribe:a}=e.subscribe(0,t=>{e.notify(13,ff(t))}),o=L,s;i.trackUserInteractions&&(s=nf(e,n,r,i));let c=uf(e,t=>{e.notify(13,ff(t))}),l={findActionId:e=>{let t=c.findActionId(e),n=s?.findActionId(e)??[];return t.concat(n)}};return t.assembleEventDefaults.register(({startTime:e,eventType:t})=>{if(t!==J.ERROR&&t!==J.RESOURCE&&t!==J.LONG_TASK)return Br;let n=t===J.LONG_TASK?Fe(e,1):e,r=l.findActionId(n);return r.length?{type:t,action:{id:r}}:Br}),t.assembleTelemetry.register(({startTime:e})=>({action:{id:l.findActionId(e)}})),{addAction:c.addAction,startAction:c.startAction,stopAction:c.stopAction,actionContexts:l,stop:()=>{a(),o(),c.stop(),s?.stop()}}}function ff(e){let t=pf(e),n=rd(A(e.duration));return{rawRumEvent:{type:J.ACTION,date:e.startClocks.timeStamp,action:{id:e.id,target:{name:e.name},type:e.type,...n!==void 0&&{loading_time:n},...e.counts&&{error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},frustration:{type:e.frustrationTypes}},...t?{_dd:{action:{target:{selector:e.target?.selector||void 0,width:e.target?.width||void 0,height:e.target?.height||void 0,composed_path_selector:e.target?.composedPathSelector},position:e.position,name_source:e.nameSource}}}:{context:e.context}},duration:e.duration,startClocks:e.startClocks,domainContext:t?{events:e.events}:{handlingStack:e.handlingStack}}}function pf(e){return`events`in e}function mf(e){let t=ki([Oi.cspViolation,Oi.intervention]).subscribe(t=>e.notify(t));return{stop:()=>{t.unsubscribe()}}}function hf(e,t){let n=new E;return t.subscribe(({data:e,type:t})=>{t===fs.RUNTIME_ERROR?n.notify(e):t===fs.CONSOLE&&e.api===b.error&&n.notify(e.error)}),mf(n),n.subscribe(t=>e.notify(15,{error:t})),gf(e)}function gf(e){return e.subscribe(15,({error:t})=>{e.notify(13,_f(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:a})=>{let o=_i({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:Jn.PROVIDED,source:qn.CUSTOM,handling:Yn.HANDLED});o.context=g(o.context,a),e.notify(15,{error:o})}}}function _f(e){let t={date:e.startClocks.timeStamp,error:{id:M(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:`browser`,fingerprint:e.fingerprint,csp:e.csp},_dd:{debug_ids:e.debugIds},type:J.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startClocks:e.startClocks,domainContext:n}}function vf(e){return!(e.loadEventEnd>0&&e.domComplete<=0)}function yf(){if(jl(`navigation`)){let e=performance.getEntriesByType(`navigation`)[0];if(e&&vf(e))return e}let e=bf(),t={entryType:`navigation`,initiatorType:`navigation`,name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function bf(){let e={},t=performance.timing;for(let n in t)if(gs(t[n])){let r=n,i=t[r];e[r]=i===0?0:Be(i)}return e}function xf(e){return e.responseStart>=0&&e.responseStart<=Ie()?e.responseStart:void 0}function Sf(){if(jl(`resource`))return performance.getEntriesByType(`resource`)}function Cf(e,t){let n=Sf();if(n)return wr(n,n=>n.name===e&&n.startTime<=t)}var wf=2*je;function Tf(e){let t=Ef(e)||Df(e);if(!(!t||t.traceTime<=Ge()-wf))return t.traceId}function Ef(e){let t=e.querySelector(`meta[name=dd-trace-id]`),n=e.querySelector(`meta[name=dd-trace-time]`);return Of(t?.content,n?.content)}function Df(e){let t=kf(e);if(t)return Of(rt(t,`trace-id`),rt(t,`trace-time`))}function Of(e,t){let n=t&&Number(t);if(e&&n)return{traceId:e,traceTime:n}}function kf(e){for(let t=0;t<e.childNodes.length;t+=1){let n=Af(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;--t){let n=e.body.childNodes[t],r=Af(n);if(r)return r;if(!vl(n))break}}function Af(e){if(e&&yl(e)){let t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function jf(e){let t=new Set,n=e.subscribe(8,e=>{t.add(e),t.size>1e3&&t.delete(t.values().next().value)});return{getMatchingRequest(e){let n=1/0,r;for(let i of t){let t=e.startTime-i.startClocks.relative;0<=t&&t<n&&i.url===e.name&&(n=Math.abs(t),r=i)}return r&&t.delete(r),r},stop(){n.unsubscribe()}}}function Mf(e,t){function n(e,n={},r=j()){let i=n.resourceKey??e;t.start(i,r,{url:e,...n})}function r(n,r={},i=j()){let a=r.resourceKey??n,o=t.stop(a,i,{context:r.context,type:r.type});if(!o)return;let s=k(o.startClocks.relative,i.relative),c={date:o.startClocks.timeStamp,type:J.RESOURCE,resource:{id:o.id,type:o.type||K.OTHER,url:_l(o.url),duration:A(s),method:o.method,status_code:r.statusCode,size:r.size},_dd:{},context:o.context};e.notify(13,{rawRumEvent:c,startClocks:o.startClocks,duration:s,domainContext:{isManual:!0}})}return{startResource:n,stopResource:r}}function Nf(e,t){let n=P(Do)(),r=jf(e);e.subscribe(9,n=>{let r=Pf(n,t);r&&e.notify(13,r)});let i=Dl({type:`resource`,buffered:!0}).subscribe(n=>{for(let i of n)il(i)?F(()=>{let n=Ff(i,r.getMatchingRequest(i),t);n&&e.notify(13,n)},50):o(()=>Ff(i,void 0,t))}),{stop:a}=eo(`interactive`,()=>{o(()=>Ff(yf(),void 0,t))});function o(t){n.push(()=>{let n=t();n&&e.notify(13,n)})}let s=ud(e),c=Mf(e,s);return{startResource:c.startResource,stopResource:c.stopResource,stop:()=>{a(),n.stop(),i.unsubscribe(),s.stopAll()}}}function Pf(e,t){let n=k(e.startClocks.timeStamp,e.endClocks.timeStamp),r={date:e.startClocks.timeStamp,type:J.RESOURCE,resource:{id:M(),type:K.WEBSOCKET,url:e.url,duration:A(n),websocket:{connection_id:e.connectionId,handshake_succeeded:e.handshakeSucceeded,start_time:e.startClocks.timeStamp,end_time:e.endClocks.timeStamp,start_view_id:e.startViewId,end_view_id:e.endViewId,tracking_end_reason:e.trackingEndReason,close_code:e.closeCode,close_reason:e.closeReason,was_clean:e.wasClean,messages_in:e.messagesIn,messages_out:e.messagesOut,time_to_first_message_in:A(e.firstMessageInOffset),time_to_first_message_out:A(e.firstMessageOutOffset),last_message_in_at:e.lastMessageInAt,longest_inbound_silence:A(e.longestInboundSilence),inbound_idle_duration_before_close:A(e.inboundIdleDurationBeforeClose),buffered_amount_max:e.bufferedAmountMax,protocol:e.protocol,setup_duration:A(e.setupDuration)}},_dd:{discarded:!t.trackResources}};return{startClocks:e.startClocks,duration:n,rawRumEvent:r,domainContext:{isWebSocket:!0,isManual:!1,webSocket:e.webSocket}}}function Ff(e,t,n){let r=t?zf(t,n):Bf(e,n);if(!n.trackResources&&!r)return;let i=Re(e.startTime),a=al(e),o=Hf(t,n);return{startClocks:i,duration:a,rawRumEvent:g({date:i.timeStamp,resource:{id:M(),duration:A(a),type:nl(e),method:t?.method,status_code:t?t.status:Vf(e.responseStatus),url:t?_l(t.url):e.name,protocol:dl(e),delivery_type:fl(e),graphql:t&&If(t,n),render_blocking_status:e.renderBlockingStatus,...pl(e),...ol(e)},type:J.RESOURCE,_dd:{discarded:!n.trackResources}},r,Lf(e),o),domainContext:Rf(e,t)}}function If(e,t){let n=zu(e.url,t);if(n)return Lu(e,n)}function Lf(e){let t=e.contentType;if(t)return{resource:{response:{headers:{"content-type":t}}}}}function Rf(e,t){return{performanceEntry:e,isManual:!1,isAborted:t?t.isAborted:!1,isWebSocket:!1,handlingStack:t?.handlingStack,requestInit:t?.init,requestInput:t?.input,response:t?.response,error:t?.error,xhr:t?.xhr}}function zf(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function Bf(e,t){if(e.initiatorType!==`navigation`)return;let n=P(Tf)(document);if(n)return{_dd:{trace_id:n,span_id:ku().toString(),rule_psr:t.rulePsr}}}function Vf(e){return e===0?void 0:e}function Hf(e,t){let n=t.trackResourceHeaders;if(n.length===0||!e)return;let r=n.filter(t=>t.url===void 0||bt([t.url],e.url,!0));if(r.length===0)return;let i=r.filter(e=>e.location===void 0||e.location===`any`||e.location===`response`),a=r.filter(e=>e.location===void 0||e.location===`any`||e.location===`request`),o=i.length>0?Uf(e,i):void 0,s=a.length>0?Wf(e,a):void 0;if(o||s)return{resource:{request:s?{headers:s}:void 0,response:o?{headers:o}:void 0}}}function Uf(e,t){if(e.type===us.FETCH&&e.response)return Yf(e.response.headers,t);if(e.type===us.XHR&&e.xhr){let n=e.xhr.getAllResponseHeaders();if(n)try{return Yf(new Headers(Xf(n)),t)}catch{}}}function Wf(e,t){if(e.type!==us.FETCH)return;let n;return e.init?.headers?n=new Headers(e.init.headers):e.input instanceof Request&&(n=e.input.headers),n?Yf(n,t):void 0}var Gf=/(token|cookie|secret|authorization|(api|secret|access|app).?key|(client|connecting|real).?ip|forwarded)/,Kf=100,qf=128,Jf=e=>Nc.includes(e);function Yf(e,t){let n={},r=0,i=!1;return e.forEach((e,a)=>{if(r>=Kf){i||=(N.warn(`Maximum number of headers (${Kf}) has been reached. Further headers are dropped.`),!0);return}let o=a.toLowerCase();if(Gf.test(o))return;let s=t.find(e=>bt([e.name??Jf],o));if(!s)return;let{extractor:c}=s,l=c?Ws(e,c):e;l!==void 0&&(l.length>qf&&N.warn(`Header "${o}" value was truncated from ${l.length} to ${qf} characters.`),n[o]=ot(l,qf),r++)}),r>0?n:void 0}function Xf(e){let t=[],n=e.trim().split(/\r\n/);for(let e of n){let n=e.indexOf(`:`);n>0&&t.push([e.substring(0,n).trim(),e.substring(n+1).trim()])}return t}function Zf(e,t,n){let{stop:r,eventCounts:i}=cd({lifeCycle:e,isChildEvent:e=>e.view.id===t,onChange:n});return{stop:r,eventCounts:i}}var Qf=10*je;function $f(e,t,n,r){let i=1/0,{stop:a}=bn(n,[z.POINTER_DOWN,z.KEY_DOWN],e=>{i=e.timeStamp},{capture:!0,once:!0}),o=0,s=Dl({type:`largest-contentful-paint`,buffered:!0}).subscribe(n=>{let a=wr(n,e=>e.entryType===`largest-contentful-paint`&&e.startTime<i&&e.startTime<t.timeStamp&&e.startTime<Qf&&e.size>o);if(a){let t;a.element&&(t=Bl(a.element,e.actionNameAttribute));let n=ep(a),i=a.startTime,s=tp(n,i,xf(yf()));r({value:i,targetSelector:t,resourceUrl:n,subParts:s}),o=a.size}});return{stop:()=>{a(),s.unsubscribe()}}}function ep(e){return e.url===``?void 0:e.url}function tp(e,t,n){if(n===void 0)return;let r=e?Cf(e,t):void 0,i=r?Math.max(n,r.requestStart||r.startTime):n,a=Math.min(t,Math.max(i,r?.responseEnd||0));return{loadDelay:i-n,loadTime:a-i,renderDelay:t-a}}function np(e,t){let n={},r,i=!1,a=0,o=[],s=Dl({type:`interaction-contentful-paint`,buffered:!0}).subscribe(e=>{r||o.push(...e),l(e)}),c=Dl({type:`soft-navigation`,buffered:!1}).subscribe(e=>{if(r)return;r=e[0],l(o),o.length=0;let t=r.getLargestInteractionContentfulPaint();t&&l([t])});function l(i){if(r)for(let o of i){if(o.interactionId!==r.interactionId||o.largestContentfulPaint.size<=a)continue;a=o.largestContentfulPaint.size;let i=o.largestContentfulPaint,s=i.url||void 0,c={value:i.startTime-r.startTime,targetSelector:i.element?Bl(i.element,e.actionNameAttribute):void 0,resourceUrl:s,subParts:tp(s,i.startTime,r.startTime)};n.largestContentfulPaint=c,t()}}return{initialViewMetrics:n,setViewEnd:()=>{i=!0,c.unsubscribe(),r||s.unsubscribe()},stop:()=>{i||c.unsubscribe(),s.unsubscribe()}}}var rp=10*je;function ip(e,t){return{stop:Dl({type:`paint`,buffered:!0}).subscribe(n=>{let r=n.find(t=>t.name===`first-contentful-paint`&&t.startTime<e.timeStamp&&t.startTime<rp);r&&t(r.startTime)}).unsubscribe}}function ap(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(k(e,Ie()))})})}function op(e){return lp(()=>{let t=P(yf)();cp(t)||e(sp(t))})}function sp(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:xf(e)}}function cp(e){return e.loadEventEnd<=0}function lp(e){let t,{stop:n}=eo(`complete`,()=>{t=F(()=>e())});return{stop:()=>{n(),I(t)}}}function up(e,t=window){if(document.visibilityState===`hidden`)return{timeStamp:0,stop:L};if(jl(`visibility-state`)){let t=performance.getEntriesByType(`visibility-state`).filter(e=>e.name===`hidden`).find(t=>t.startTime>=e.relative);if(t)return{timeStamp:t.startTime,stop:L}}let n=1/0,{stop:r}=bn(t,[z.PAGE_HIDE,z.VISIBILITY_CHANGE],e=>{(e.type===z.PAGE_HIDE||document.visibilityState===`hidden`)&&(n=e.timeStamp,r())},{capture:!0});return{get timeStamp(){return n},stop:r}}function dp(e,t,n,r){let i={},{stop:a}=op(e=>{n(e.loadEvent),i.navigationTimings=e,r()}),o=up(t),{stop:s}=ip(o,e=>{i.firstContentfulPaint=e,r()}),{stop:c}=$f(e,o,window,e=>{i.largestContentfulPaint=e,r()});function l(){a(),s(),c(),o.stop()}return{stop:l,initialViewMetrics:i}}var fp=(e,t)=>e*t,pp=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return n>=i||r>=a?0:fp(i-n,a-r)},mp=e=>{let t=fp(e.previousRect.width,e.previousRect.height),n=fp(e.currentRect.width,e.currentRect.height),r=pp(e.previousRect,e.currentRect);return t+n-r};function hp(e,t,n){if(!xp())return{stop:L};let r=0,i;n({value:0});let a=bp(),o=Dl({type:`layout-shift`,buffered:!0}).subscribe(o=>{for(let s of o){if(s.hadRecentInput||s.startTime<t)continue;let{cumulatedValue:o,isMaxValue:c}=a.update(s);if(c){let e=gp(s.sources);i={target:e?.node?new WeakRef(e.node):void 0,time:k(t,s.startTime),previousRect:e?.previousRect,currentRect:e?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(o>r){r=o;let t=i?.target?.deref();n({value:hs(r,4),targetSelector:t&&Bl(t,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?_p(i.previousRect):void 0,currentRect:i?.currentRect?_p(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function gp(e){let t;for(let n of e)if(n.node&&bl(n.node)){let e=mp(n);(!t||mp(t)<e)&&(t=n)}return t}function _p({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}var vp=5*D,yp=D;function bp(){let e=0,t,n,r=0;return{update:i=>{let a=t===void 0||i.startTime-n>=yp||i.startTime-t>=vp,o;return a?(t=n=i.startTime,r=e=i.value,o=!0):(e+=i.value,n=i.startTime,o=i.value>r,o&&(r=i.value)),{cumulatedValue:e,isMaxValue:o}}}}function xp(){return jl(`layout-shift`)&&`WeakRef`in window}var Sp,Cp=0,wp=1/0,Tp=0;function Ep(){`interactionCount`in performance||Sp||(Sp=new window.PerformanceObserver(w(e=>{e.getEntries().forEach(e=>{let t=e;t.interactionId&&(wp=Math.min(wp,t.interactionId),Tp=Math.max(Tp,t.interactionId),Cp=(Tp-wp)/7+1)})})),Sp.observe({type:`event`,buffered:!0,durationThreshold:0}))}var Dp=()=>Sp?Cp:window.performance.interactionCount||0,Op=10,kp=1*je,Ap=8;function jp(e,t,n){if(!Fp())return{getInteractionToNextPaint:()=>void 0,setViewEnd:L,stop:L};let r=1/0,i,{getViewInteractionCount:a,stopViewInteractionCount:o}=Np(n),s=Mp(a),c=Pp(s),l=Dl({type:`first-input`,buffered:!0}).subscribe(d),u=Dl({type:`event`,durationThreshold:40,buffered:!0}).subscribe(d);function d(e){for(let n of e)n.interactionId&&n.startTime>=t&&n.startTime<=r&&(s.process(n),c.process(n));c.pruneUntracked();let n=s.estimateP98Interaction();n&&f(n)}function f(n){let r=k(t,n.startTime);if(n.duration!==i?.duration||r!==i.startTime){let t=$d(n.startTime);!t&&n.target&&bl(n.target)&&(t=Bl(n.target,e.actionNameAttribute)),i={duration:n.duration,startTime:r,targetSelector:t}}i.subParts=c.computeSubParts(n,Ip(i.duration))}return{getInteractionToNextPaint:()=>{if(i)return{value:Ip(i.duration),targetSelector:i.targetSelector,time:i.startTime,subParts:i.subParts};if(a())return{value:0}},setViewEnd:e=>{r=e,o()},stop:()=>{u.unsubscribe(),l.unsubscribe(),c.stop()}}}function Mp(e){let t=[];function n(){t.sort((e,t)=>t.duration-e.duration).splice(Op)}return{process(e){let r=t.findIndex(t=>e.interactionId===t.interactionId),i=t[t.length-1];r===-1?(t.length<Op||e.duration>i.duration)&&(t.push(e),n()):e.duration>t[r].duration&&(t[r]=e,n())},estimateP98Interaction(){let n=Math.min(t.length-1,Math.floor(e()/50));return t[n]},isTracked(e){return t.some(t=>t.interactionId===e)}}}function Np(e){Ep();let t=e===Bs.INITIAL_LOAD?0:Dp(),n={stopped:!1};function r(){return Dp()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Pp(e){let t=new Map;function n(e,t){e.startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd)}return{process(e){if(e.interactionId===void 0||!e.processingStart||!e.processingEnd)return;let r=e.startTime+e.duration,i=t.get(e.interactionId);if(i){n(i,e);return}for(let[,i]of t.entries())if(Math.abs(r-i.referenceRenderTime)<=Ap){n(i,e),t.set(e.interactionId,i);return}t.set(e.interactionId,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,referenceRenderTime:r})},pruneUntracked(){for(let[n]of t)e.isTracked(n)||t.delete(n)},computeSubParts(e,n){if(!e.processingStart||!e.processingEnd||e.interactionId===void 0)return;let r=t.get(e.interactionId);if(!r)return;let i=Math.max(r.startTime+n,r.processingStart),a=Math.min(r.processingEnd,i);return{inputDelay:k(r.startTime,r.processingStart),processingDuration:k(r.processingStart,a),presentationDelay:k(a,i)}},stop(){t.clear()}}}function Fp(){return jl(`event`)&&window.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype}function Ip(e){return Math.min(e,kp)}function Lp(e,t,n,r,i,a,o){let s=i===Bs.INITIAL_LOAD,c=!0,l=[],u=up(a);function d(){if(!c&&!s&&l.length>0){let e=Math.max(...l);e<u.timeStamp-a.relative&&o(e)}}let{stop:f}=id(e,t,n,r,e=>{c&&(c=!1,e.hadActivity&&l.push(k(a.timeStamp,e.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:e=>{s&&(s=!1,l.push(e),d())}}}var Rp=D;function zp(e,t,n=Vp()){let r=0,i=0,a=0,o=n.subscribe(({scrollDepth:n,scrollTop:o,scrollHeight:s})=>{let c=!1;if(n>r&&(r=n,c=!0),s>i){i=s;let t=Ie();a=k(e.relative,t),c=!0}c&&t({maxDepth:Math.min(r,i),maxDepthScrollTop:o,maxScrollHeight:i,maxScrollHeightTime:a})});return{stop:()=>o.unsubscribe()}}function Bp(){let e=yu(),{height:t}=Cu();return{scrollHeight:Math.round((document.scrollingElement||document.documentElement).scrollHeight),scrollDepth:Math.round(t+e),scrollTop:e}}function Vp(e=Rp){return new E(t=>{function n(){t.notify(Bp())}let r=Ht(n,e,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,a=new ResizeObserver(w(r.throttled));i&&a.observe(i);let o=B(window,z.SCROLL,r.throttled,{passive:!0});return()=>{r.cancel(),a.disconnect(),o.stop()}})}function Hp(e,t,n,r,i,a,o){let s={},c=!1,l=!1,{stop:u,setLoadEvent:d}=Lp(e,t,n,r,a,o,e=>{c||(s.loadingTime=e,i())}),{stop:f}=zp(o,e=>{s.scroll=e}),{stop:p}=hp(r,o.relative,e=>{s.cumulativeLayoutShift=e,i()}),{stop:m,getInteractionToNextPaint:h,setViewEnd:g}=jp(r,o.relative,a);return{stop:()=>{u(),p(),f()},stopINPTracking:m,setLoadEvent:d,setViewEnd:e=>{l=!0,g(e)},getCommonViewMetrics:()=>(s.interactionToNextPaint=h(),s),setLoadingTime:e=>{if(l)return;let t=k(o.timeStamp,e??O());c||u(),c=!0,s.loadingTime=t,i()}}}function Up(e){let{stop:t}=B(window,z.PAGE_SHOW,t=>{t.persisted&&e(t)},{capture:!0});return t}function Wp(e,t,n){ap(e.relative,e=>{t.firstContentfulPaint=e,t.largestContentfulPaint={value:e},n()})}var Gp=3e3,Kp=5*je,qp=5*je;function Jp(e,t,n,r,i,a,o){let s=new Set,c=d(Bs.INITIAL_LOAD,Le(),o),l;f();let u;a&&(u=p(i),l=Up(e=>{c.end();let t=Re(e.timeStamp);c=d(Bs.BF_CACHE,t,void 0)}));function d(i,a,o){let c=Yp(e,t,n,r,i,a,o);return s.add(c),c.stopObservable.subscribe(()=>{s.delete(c)}),c}function f(){e.subscribe(11,()=>{c=d(Bs.SESSION_RENEWAL,void 0,{name:c.name,service:c.service,version:c.version,context:c.contextManager.getContext()})}),e.subscribe(10,({endClocks:e})=>{c.end({sessionIsActive:!1,endClocks:e})})}function p(e){return e.subscribe(({oldLocation:e,newLocation:t})=>{Zp(e,t)&&(c.end(),c=d(Bs.ROUTE_CHANGE))})}return{addTiming:(e,t=O())=>{c.addTiming(e,t)},setLoadingTime:e=>c.setLoadingTime(e),startView:(e,t)=>{c.end({endClocks:t}),c=d(Bs.ROUTE_CHANGE,t,e)},setViewContext:e=>{c.contextManager.setContext(e)},setViewContextProperty:(e,t)=>{c.contextManager.setContextProperty(e,t)},setViewName:e=>{c.setViewName(e)},getViewContext:()=>c.contextManager.getContext(),stop:()=>{u&&u.unsubscribe(),l&&l(),c.end(),s.forEach(e=>e.stop())}}}function Yp(e,t,n,r,i,a=j(),o){let s=M(),c=new E,l={},u=0,d,f=kt(P(window.location)),p=Lo(),m=!0,h=o?.name,g=o?.service||r.service,_=o?.version||r.version,v=o?.context,y=o?.handlingStack;v&&p.setContext(v);let b={id:s,name:h,startClocks:a,service:g,version:_,context:v,url:o?.url};e.notify(1,b),e.notify(2,b);let{throttled:x,cancel:ee}=Ht(he,Gp,{leading:!1}),{setLoadEvent:te,setViewEnd:ne,stop:S,stopINPTracking:re,getCommonViewMetrics:C,setLoadingTime:ie}=Hp(e,t,n,r,me,i,a),ae=i===Bs.INITIAL_LOAD?{...dp(r,a,te,me),setViewEnd:L}:{stop:L,initialViewMetrics:{},setViewEnd:L};i===Bs.ROUTE_CHANGE&&Lt(Nt.SOFT_NAVIGATION)&&jl(`soft-navigation`)&&(ae=np(r,me));let{stop:oe,initialViewMetrics:se,setViewEnd:ce}=ae;i===Bs.BF_CACHE&&Wp(a,se,me);let{stop:le,eventCounts:ue}=Zf(e,s,me),de=Bt(he,Kp),fe=e.subscribe(12,e=>{e===Dr.UNLOADING&&he()});he(),p.changeObservable.subscribe(me);function pe(){e.notify(3,{id:s,name:h,context:p.getContext(),startClocks:a,sessionIsActive:m})}function me(){pe(),x()}function he(){ee(),pe(),u+=1;let t=d===void 0?O():d.timeStamp;e.notify(4,{customTimings:l,documentVersion:u,id:s,name:h,service:g,version:_,context:p.getContext(),loadingType:i,location:f,handlingStack:y,startClocks:a,commonViewMetrics:C(),initialViewMetrics:se,duration:k(a.timeStamp,t),isActive:d===void 0,sessionIsActive:m,eventCounts:ue})}return{get name(){return h},service:g,version:_,contextManager:p,stopObservable:c,end(t={}){d||(d=t.endClocks??j(),m=t.sessionIsActive??!0,e.notify(5,{endClocks:d}),e.notify(6,{endClocks:d}),Vt(de),ne(d.relative),ce(),S(),fe.unsubscribe(),he(),F(()=>{this.stop()},qp))},stop(){oe(),le(),re(),c.notify()},addTiming(e,t){if(d)return;let n=He(t)?t:k(a.timeStamp,t);l[Xp(e)]=n,me()},setLoadingTime:ie,setViewName(e){h=e,he()}}}function Xp(e){let t=e.replace(/[^a-zA-Z0-9-_.@$]/g,`_`);return t!==e&&N.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Zp(e,t){return e.pathname!==t.pathname||!Qp(t.hash)&&$p(t.hash)!==$p(e.hash)}function Qp(e){let t=e.substring(1);return t!==``&&!!document.getElementById(t)}function $p(e){let t=e.indexOf(`?`);return t<0?e:e.slice(0,t)}function em(e,t,n,r,i,a,o,s,c){return e.subscribe(4,t=>e.notify(13,tm(t,n,o))),t.assembleEventDefaults.register(({startTime:e,eventType:t})=>{let n=s.findView(e);return n?{type:t,service:n.service,version:n.version,context:n.context,view:{id:n.id,name:n.name}}:zr}),t.assembleTelemetry.register(({startTime:e})=>({view:{id:s.findView(e)?.id}})),Jp(e,r,i,n,a,!n.trackViewsManually,c)}function tm(e,t,n){let r=n.getReplayStats(e.id),i=e.commonViewMetrics?.cumulativeLayoutShift?.devicePixelRatio,a={_dd:{document_version:e.documentVersion,replay_stats:r,cls:i?{device_pixel_ratio:i}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually,remote_configuration_id:t.remoteConfigurationId}},date:e.startClocks.timeStamp,type:J.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:e.commonViewMetrics.cumulativeLayoutShift?.value,cumulative_layout_shift_time:A(e.commonViewMetrics.cumulativeLayoutShift?.time),cumulative_layout_shift_target_selector:e.commonViewMetrics.cumulativeLayoutShift?.targetSelector,first_byte:A(e.initialViewMetrics.navigationTimings?.firstByte),dom_complete:A(e.initialViewMetrics.navigationTimings?.domComplete),dom_content_loaded:A(e.initialViewMetrics.navigationTimings?.domContentLoaded),dom_interactive:A(e.initialViewMetrics.navigationTimings?.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:A(e.initialViewMetrics.firstContentfulPaint),interaction_to_next_paint:A(e.commonViewMetrics.interactionToNextPaint?.value),interaction_to_next_paint_time:A(e.commonViewMetrics.interactionToNextPaint?.time),interaction_to_next_paint_target_selector:e.commonViewMetrics.interactionToNextPaint?.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:A(e.initialViewMetrics.largestContentfulPaint?.value),largest_contentful_paint_target_selector:e.initialViewMetrics.largestContentfulPaint?.targetSelector,load_event:A(e.initialViewMetrics.navigationTimings?.loadEvent),loading_time:rd(A(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:nm(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:A(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:A(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:ms()}};return jt(e.customTimings)||(a.view.custom_timings=Mt(e.customTimings,A)),{rawRumEvent:a,startClocks:e.startClocks,duration:e.duration,domainContext:{location:e.location,handlingStack:e.handlingStack}}}function nm({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:A(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:A(n)},inp:t&&{duration:A(t.value),timestamp:A(t.time),target_selector:t.targetSelector,sub_parts:t.subParts?{input_delay:A(t.subParts.inputDelay),processing_duration:A(t.subParts.processingDuration),presentation_delay:A(t.subParts.presentationDelay)}:void 0},lcp:r&&{timestamp:A(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl,sub_parts:r.subParts?{load_delay:A(r.subParts.loadDelay),load_time:A(r.subParts.loadTime),render_delay:A(r.subParts.renderDelay)}:void 0}}}function rm(e,t){if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return e===t;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>rm(e,t[n]));if(Array.isArray(e)||Array.isArray(t))return!1;let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>a.includes(e)&&rm(n[e],r[e]))}function im(e,t,n){let r={},i=n?.replaceKeys??new Set,a=n?.appendKeys??new Set,o=n?.ignoreKeys??new Set;for(let n of Object.keys(e)){if(o.has(n))continue;let s=e[n],c=t[n];if(!i.has(n)&&u(s)&&u(c)){let e=im(s,c,{replaceKeys:am(i,n),appendKeys:am(a,n),ignoreKeys:am(o,n)});e&&(r[n]=e)}else a.has(n)&&Array.isArray(s)&&Array.isArray(c)?s.length>c.length&&(r[n]=s.slice(c.length)):rm(s,c)||(r[n]=s)}for(let n of Object.keys(t))n in e||(r[n]=null);return Object.keys(r).length>0?r:void 0}function am(e,t){let n=new Set;for(let r of e)r.startsWith(`${t}.`)&&n.add(r.slice(t.length+1));return n}function om(e,t){let n=im(e,t,{replaceKeys:new Set([`view.custom_timings`,`context`,`connectivity`,`usr`,`device`,`privacy`]),appendKeys:new Set([`_dd.page_states`]),ignoreKeys:new Set([`date`,`type`,`application`,`session`,`view.id`,`view.url`,`_dd.document_version`,`_dd.format_version`])});if(n)return g(n,{type:J.VIEW_UPDATE,date:e.date,application:e.application,session:e.session,view:{id:e.view.id,url:e.view.url},_dd:{document_version:e._dd.document_version,format_version:e._dd.format_version}})}function sm(e,t){let n,r,i=!1,a=0,{unsubscribe:o}=e.flushObservable.subscribe(()=>{i=!1,r=n});return{dispatch:o=>{if(o.type!==J.VIEW){e.add(o);return}if(!t){e.upsert(o,o.view.id);return}let s=o.view.id;if(!o.view.is_active){s===n?.view.id&&(n=void 0,r=void 0,i=!1,a=0),e.upsert(o,s);return}if(s!==n?.view.id){a=0,e.upsert(o,s),n=o,i=!e.isEmpty;return}if(n=o,i){e.upsert(o,s);return}if(a+=1,a>=100){a=0,e.upsert(o,s),i=!e.isEmpty;return}if(r){let t=om(o,r);t&&(Kn(`rum`,t),e.upsert(t,s))}},stop:o}}function cm(e,t,n,r,i){let a=[qe(e,`rum`)],o=Je(e,`rum`);o&&a.push(o);let s=Fr({encoder:i(_s.RUM),endpoints:a,reportError:n});r.subscribe(()=>s.forceFlush(`session_expire`));let{dispatch:c,stop:l}=sm(s,e.betaEnableViewUpdates);t.subscribe(14,c);let u=s.stop.bind(s);return s.stop=()=>{l(),u()},s}function lm(e){let t=yr();e.subscribe(14,e=>{t.send(`rum`,e)})}var um=Ji;function dm(e,t,n){let r=Ui({expireDelay:um}),i;e.subscribe(1,({startClocks:e,url:t})=>{let n=P(C.location).href,a=t===void 0?n:ce(t,n).href;r.add(o({url:a,referrer:i||document.referrer}),e.relative),i=a}),e.subscribe(6,({endClocks:e})=>{r.closeActive(e.relative)});let a=n.subscribe(({newLocation:e})=>{let t=r.find();if(t){let n=Ie();r.closeActive(n),r.add(o({url:e.href,referrer:t.referrer}),n)}});function o({url:e,referrer:t}){return{url:e,referrer:t}}return t.register(({startTime:e,eventType:t})=>{let n=r.find(e);return n?{type:t,view:{url:n.url,referrer:n.referrer}}:zr}),{findUrl:e=>r.find(e),stop:()=>{a.unsubscribe(),r.stop()}}}function fm(){let e=kt(pm());return new E(t=>{let{stop:n}=mm(i),{stop:r}=hm(i);function i(){if(e.href===pm().href)return;let n=kt(pm());t.notify({newLocation:n,oldLocation:e}),e=n}return()=>{n(),r()}})}function pm(){return P(C.location)}function mm(e){let{stop:t}=R(gm(`pushState`),`pushState`,({onPostCall:t})=>{t(e)}),{stop:n}=R(gm(`replaceState`),`replaceState`,({onPostCall:t})=>{t(e)}),{stop:r}=B(window,z.POP_STATE,e);return{stop:()=>{t(),n(),r()}}}function hm(e){return B(window,z.HASH_CHANGE,e)}function gm(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}var _m=Ji;function vm(e,t,n){let r=Ui({expireDelay:_m});return e.subscribe(1,({startClocks:e})=>{r.add({},e.relative)}),e.subscribe(6,({endClocks:e})=>{r.closeActive(e.relative)}),t.register(({startTime:e,eventType:t})=>{if(!n.trackFeatureFlagsForEvents.concat([J.VIEW,J.ERROR]).includes(t))return Br;let i=r.find(e);return!i||jt(i)?Br:{type:t,feature_flags:i}}),{addFeatureFlagEvaluation:(e,t)=>{let n=r.find();n&&(n[e]=t)}}}var ym=10*D,bm,xm;function Sm(e,t,n){e.metricsEnabled&&(Em(),xm=!1,t.subscribe(14,()=>{xm=!0}),n.subscribe(({bytesCount:e,messagesCount:t})=>{xm&&(xm=!1,bm.batchCount+=1,Tm(bm.batchBytesCount,e),Tm(bm.batchMessagesCount,t))}),Bt(Cm,ym))}function Cm(){bm.batchCount!==0&&(ii(Wr.CUSTOMER_DATA_METRIC_NAME,bm),Em())}function wm(){return{min:1/0,max:0,sum:0}}function Tm(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Em(){bm={batchCount:0,batchBytesCount:wm(),batchMessagesCount:wm()}}var Dm=4e3,Om=Ji;function km(e,t=500){let n=Ui({expireDelay:Om,maxEntries:Dm}),r;jl(`visibility-state`)&&performance.getEntriesByType(`visibility-state`).forEach(e=>{a(e.name===`hidden`?`hidden`:`active`,e.startTime)}),a(Mm(),Ie());let{stop:i}=bn(window,[z.PAGE_SHOW,z.FOCUS,z.BLUR,z.VISIBILITY_CHANGE,z.RESUME,z.FREEZE,z.PAGE_HIDE],e=>{a(jm(e),e.timeStamp)},{capture:!0});function a(e,t=Ie()){e!==r&&(r=e,n.closeActive(t),n.add({state:r,startTime:t},t))}function o(e,t,r){return n.findAll(t,r).some(t=>t.state===e)}return e.register(({startTime:e,duration:r=0,eventType:i})=>i===J.VIEW?{type:i,_dd:{page_states:Am(n.findAll(e,r),e,t)}}:i===J.ACTION||i===J.ERROR?{type:i,view:{in_foreground:o(`active`,e,0)}}:Br),{wasInPageStateDuringPeriod:o,addPageState:a,stop:()=>{i(),n.stop()}}}function Am(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:e,startTime:n})=>({state:e,start:A(k(t,n))}))}function jm(e){return e.type===z.FREEZE?`frozen`:e.type===z.PAGE_HIDE?e.persisted?`frozen`:`terminated`:Mm()}function Mm(){return document.visibilityState===`hidden`?`hidden`:document.hasFocus()?`active`:`passive`}function Nm(e){let t,n=requestAnimationFrame(w(()=>{t=Cu()})),r=xu().subscribe(e=>{t=e}).unsubscribe;return e.register(({eventType:e})=>({type:e,display:t?{viewport:t}:void 0})),{stop:()=>{r(),n&&cancelAnimationFrame(n)}}}function Pm(e,t){let n=ud(e);function r(e){return!t.wasInPageStateDuringPeriod(`frozen`,e.startClocks.relative,e.duration)}function i(t){r(t)&&e.notify(13,Fm(t))}function a(t,n,r,i){let{operationKey:a,context:o,description:s,handlingStack:c}=r||{},l={name:t,type:Us.OPERATION_STEP,operationKey:a,failureReason:i,stepType:n,startClocks:j(),context:V(o),description:s,handlingStack:c};e.notify(13,Fm(l))}function o(t,r={},i=j()){let{id:a}=n.start(r.vitalKey??t,i,{name:t,...r});e.notify(17,{id:a,name:t,startClocks:i,...r})}function s(e,t={},r=j()){let a=n.stop(t.vitalKey??e,r,t);a&&i({type:Us.DURATION,...a})}return{addOperationStepVital:a,addDurationVital:i,startDurationVital:o,stopDurationVital:s}}function Fm(e){let{startClocks:t,type:n,name:r,description:i,context:a,handlingStack:o}=e,s={id:(e.type===Us.DURATION?e.id:void 0)??M(),type:n,name:r,description:i,...n===Us.DURATION?{duration:A(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:s,type:J.VITAL,context:a},startClocks:t,duration:n===Us.DURATION?e.duration:void 0,domainContext:o?{handlingStack:o}:{}}}function Im(e,t,n,r,i){e.register(({eventType:e,startTime:a})=>{let o=n.findTrackedSession(a),s=i.findView(a);if(!o||!s)return zr;let c,l,u;return e===J.VIEW?(c=r.getReplayStats(s.id)?!0:void 0,l=Tu(o,t)===1,u=s.sessionIsActive?void 0:!1):c=r.isRecording()?!0:void 0,{type:e,session:{id:o.id,type:`user`,has_replay:c,sampled_for_replay:l,is_active:u}}})}function Lm(e){let t=ra()?Rm():Bm;return new E(n=>t(e,e=>n.notify(e)))}function Rm(){return(e,t)=>B(C.cookieStore,z.CHANGE,n=>{let r=n.changed.find(t=>t.name===e)||n.deleted.find(t=>t.name===e);r&&t(r.value)}).stop}var zm=D;function Bm(e,t){let n=ut(e),r=Bt(()=>{let r=ut(e);r!==n&&(n=r,t(r))},zm);return()=>{Vt(r)}}var Vm=`datadog-ci-visibility-test-execution-id`;function Hm(e,t=Lm(Vm)){let n=pt(`datadog-ci-visibility-test-execution-id`)||Um(),r=t.subscribe(e=>{n=e});return e.register(({eventType:e})=>typeof n==`string`?{type:e,session:{type:`ci_test`},ci_test:{test_execution_id:n}}:Br),{stop:()=>{r.unsubscribe()}}}function Um(){let e=window.Cypress;if(e)try{return e.env(`traceId`)}catch{N.warn(`Failed to read Cypress test execution id via Cypress.env(). Upgrade dd-trace-js to >= 5.88.0 to keep RUM ↔ test correlation working.`);return}}function Wm(e,t){let n=Dl({type:jl(`long-animation-frame`)?`long-animation-frame`:`longtask`,buffered:!0}).subscribe(n=>{for(let r of n){if(!t.trackLongTasks)break;let n=Re(r.startTime),i=Gm(r,n);e.notify(13,{rawRumEvent:i,startClocks:n,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function Gm(e,t){let n=M(),r=A(e.duration),i={date:t.timeStamp,type:J.LONG_TASK,_dd:{discarded:!1}};if(e.entryType===`longtask`)return{...i,long_task:{id:n,entry_type:zs.LONG_TASK,duration:r}};let a=di(e.scripts.map(e=>e.sourceURL).filter(e=>!!e));return{...i,_dd:{discarded:!1,debug_ids:a},long_task:{id:n,entry_type:zs.LONG_ANIMATION_FRAME,duration:r,blocking_duration:A(e.blockingDuration),first_ui_event_timestamp:A(e.firstUIEventTimestamp),render_start:A(e.renderStart),style_and_layout_start:A(e.styleAndLayoutStart),start_time:A(e.startTime),scripts:e.scripts.map(e=>({duration:A(e.duration),pause_duration:A(e.pauseDuration),forced_style_and_layout_duration:A(e.forcedStyleAndLayoutDuration),start_time:A(e.startTime),execution_start:A(e.executionStart),source_url:e.sourceURL,source_function_name:e.sourceFunctionName,source_char_position:e.sourceCharPosition,invoker:e.invoker,invoker_type:e.invokerType,window_attribution:e.windowAttribution}))}}}function Km(e){e.register(({eventType:e})=>ss()?{type:e,session:{type:`synthetics`},synthetics:{...os(),injected:as()}}:Br)}function qm(e,t,n){let r=h(e),i=n(r);return Er(t).forEach(([t,n])=>Jm(e,r,t.split(/\.|(?=\[\])/),n)),i}function Jm(e,t,n,r){let[i,...a]=n;if(i===`[]`){Array.isArray(e)&&Array.isArray(t)&&e.forEach((e,n)=>Jm(e,t[n],a,r));return}if(Xm(e)&&Xm(t)){if(a.length>0)return Jm(e[i],t[i],a,r);Ym(e,i,t[i],r)}}function Ym(e,t,n,r){if(e[t]===n)return;let i=l(n);i===r?e[t]=V(n):r===`object`&&(i===`undefined`||i===`null`)?e[t]={}:r===`array`&&(i===`undefined`||i===`null`)&&(e[t]=[])}function Xm(e){return l(e)===`object`}var Zm={"view.name":`string`,"view.url":`string`,"view.referrer":`string`,context:`object`,service:`string`,version:`string`},Qm={[J.VIEW]:{...Zm,"view.performance.lcp.resource_url":`string`},[J.ERROR]:{...Zm,"error.message":`string`,"error.stack":`string`,"error.handling_stack":`string`,"error.resource.url":`string`,"error.fingerprint":`string`,"_dd.debug_ids":`array`},[J.RESOURCE]:{...Zm,"resource.url":`string`,"resource.graphql.variables":`string`,"resource.request.headers":`object`,"resource.response.headers":`object`,"resource.websocket.close_reason":`string`,"resource.websocket.protocol":`string`},[J.ACTION]:{...Zm,"action.target.name":`string`},[J.LONG_TASK]:{...Zm,"long_task.scripts[].source_url":`string`,"long_task.scripts[].invoker":`string`,"_dd.debug_ids":`array`},[J.VITAL]:Zm};function $m(e,t,n,r,i){let a={[J.ERROR]:Ya(J.ERROR,r,i),[J.ACTION]:Ya(J.ACTION,r,i),[J.VITAL]:Ya(J.VITAL,r,i)};t.subscribe(13,({startClocks:r,duration:i,rawRumEvent:o,domainContext:s})=>{let c={eventType:o.type,rawRumEvent:o,domainContext:s,startTime:r.relative,duration:i},l=n.assembleEventDefaults.trigger(c);if(l===`DISCARDED`)return;let u=n.assembleEvent.trigger(c);if(u===`DISCARDED`)return;let d=g(l,o,u,{ddtags:Hn(e).join(`,`)});eh(d,e.beforeSend,s,a)&&(jt(d.context)&&delete d.context,t.notify(14,d))})}function eh(e,t,n,r){if(t){let r=qm(e,Qm[e.type],e=>t(e,n));if(r===!1&&e.type!==J.VIEW)return!1;r===!1&&N.warn(`Can't dismiss view events using beforeSend!`)}return!r[e.type]?.isLimitReached()}function th(e){e.register(({eventType:e})=>({type:e,connectivity:Xn()}))}function nh(e,t,n){e.register(({eventType:e})=>{let r=t.source;return{type:e,_dd:{format_version:2,drift:Ue(),configuration:{session_sample_rate:hs(t.sessionSampleRate,3),session_replay_sample_rate:hs(t.sessionReplaySampleRate,3),profiling_sample_rate:hs(t.profilingSampleRate,3),trace_sample_rate:hs(t.traceSampleRate,3)},browser_sdk_version:xr()?`7.14.0`:void 0,sdk_name:n},application:{id:t.applicationId},date:O(),source:r}})}var rh=[J.ACTION,J.ERROR,J.LONG_TASK,J.RESOURCE,J.VITAL];function ih(e){return{addEvent:(t,n,r,i)=>{rh.includes(n.type)&&e.notify(13,{startClocks:Re(t),rawRumEvent:n,domainContext:r,duration:i})}}}function ah(e){e.register(({domainContext:e,rawRumEvent:t})=>{let n=oh(e,t);if(!n)return Br;let r=fi(n);return r?{type:t.type,service:r.service,version:r.version}:Br})}function oh(e,t){if(t.type===`long_task`&&t.long_task.entry_type===`long-animation-frame`)return t.long_task.scripts[0]?.source_url;let n;return`handlingStack`in e&&(n=e.handlingStack),t.type===`error`&&t.error.stack&&(n=t.error.stack),Wt({stack:n}).stack[0]?.url}function sh(e,t,n,r,i,a,o,s,c,l){let u=[],d=new Qc;d.subscribe(14,e=>Kn(`rum`,e)),t.expireObservable.subscribe(()=>d.notify(10,{endClocks:j()})),t.renewObservable.subscribe(()=>d.notify(11));let f=e=>{d.notify(15,{error:{message:e,source:qn.AGENT,startClocks:j()}}),ti(`Error reported to customer`,{"error.message":e})};if(xr()){lm(d);let e=Or().subscribe(e=>{d.notify(12,e.reason)});u.push(()=>e.unsubscribe())}else{let n=cm(e,d,f,t.expireObservable,a),r=n.prepareUrgentFlushObservable.subscribe(e=>{d.notify(12,e)});u.push(()=>r.unsubscribe()),u.push(()=>n.stop()),Sm(s,d,n.flushObservable)}let{stop:p,...m}=ch(d,c,e,t,n,i,o,l,f);return u.push(p),o.unbuffer(),u.push(()=>r.stop()),{...m,lifeCycle:d,sessionManager:t,stopSession:()=>t.expire(),telemetry:s,stop:()=>{u.forEach(e=>e())},hooks:c}}function ch(e,t,n,r,i,a,o,s,c){let l=[],u=Xc(),d=fm(),{observable:f,stop:p}=Eu();l.push(p);let{assembleEventDefaults:m}=t;nh(m,n,s);let h=km(m);l.push(()=>h.stop());let g=el(e);l.push(()=>g.stop());let _=dm(e,m,d);l.push(()=>_.stop());let v=vm(e,m,n);Im(m,n,r,i,g),th(m),qo(m);let y=Xo(m,n,`rum`,!0),b=Qo(m,n,r,`rum`),x=Uo(m,n,`rum`),ee=df(e,t,u,f,n);l.push(ee.stop);let te=ih(e),ne=Nm(m);l.push(ne.stop);let S=Hm(m);l.push(S.stop),Km(m),$m(n,e,t,c);let{addTiming:re,setLoadingTime:C,startView:ie,setViewName:ae,setViewContext:oe,setViewContextProperty:se,getViewContext:ce,stop:le}=em(e,t,n,u,f,d,i,g,a);ah(m),l.push(le);let ue=Nf(e,n);l.push(ue.stop);let{stop:de}=Wm(e,n);l.push(de);let{addError:fe}=hf(e,o);Ku(e,n,r,b,x,o);let pe=Pm(e,h);if(n.trackResources&&(n.betaTrackWebSockets||Lt(Nt.TRACK_WEBSOCKETS))){let t=Qu(e,g,pe.addDurationVital);l.push(t.stop)}let me=Du(n.applicationId,r,g,ee.actionContexts,_);return{addAction:ee.addAction,startAction:ee.startAction,stopAction:ee.stopAction,startResource:ue.startResource,stopResource:ue.stopResource,addEvent:te.addEvent,addError:fe,addTiming:re,setLoadingTime:C,addFeatureFlagEvaluation:v.addFeatureFlagEvaluation,startView:ie,setViewContext:oe,setViewContextProperty:se,getViewContext:ce,setViewName:ae,viewHistory:g,sessionManager:r,stopSession:()=>r.expire(),getInternalContext:me.get,startDurationVital:pe.startDurationVital,stopDurationVital:pe.stopDurationVital,addDurationVital:pe.addDurationVital,addOperationStepVital:pe.addOperationStepVital,globalContext:y,userContext:b,accountContext:x,stop:()=>l.forEach(e=>e())}}function lh(e,t){if(!e)return!0;let n=e.map(e=>e.onInit?.(t));return n.some(Oo)?Promise.all(n).then(e=>!e.includes(!1)):!n.includes(!1)}function uh(e,t){for(let n of e??[])n.onRumStart?.(t)}function dh(e,t){e.register(()=>t.isGranted()?Br:zr)}function fh({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t,sdkName:n},r,i){let a=new xe(500,e=>{ti(`preStartRum buffer data lost`,{count:e})}),o=Zo();Ro(o,W.globalContext,a);let s=$o();Ro(s,W.userContext,a);let c=Wo();Ro(c,W.accountContext,a);let l,u,d,f,p,m,h=Yc(),g=r.observable.subscribe(y),_={},v=!1;function y(){if(v||!d||!f||!p||!m)return;g.unsubscribe();let e;if(f.trackViewsManually){if(!l)return;e=l.options}let t=f.trackViewsManually?l?.callback:void 0,n=i(f,p,u,e,m,h);v=!0,a.subscribe(e=>{e!==t&&e(n)}),a.unbuffer()}function b(e,i,a){let o=xr();if(o&&(e=ph(e)),d=e,f){Di(`DD_RUM`,e);return}let s=zc(e,n);s&&Et(s,i??``)&&(s.compressIntakeRequests&&!o&&t&&(u=t(s,`Datadog RUM`,L),!u)||(f=s,r.tryToInit(s.trackingConsent),r.onGrantedOnce(()=>{let{assembleTelemetry:t}=h;if(dh(t,r),m=P(Xr)(Ur.RUM,s,t,n),ie){N.warn(`The RUM SDK is not supported in a web or service worker environment.`);return}let i=r=>{p=r,vs(t,p,{application:{id:s.applicationId}}),ri(Jc(e,n,a)),y()};xr()?i(Ua()):P(Ha)(s,r).then(e=>{e&&i(e)}).catch(T)})))}return{init(t,n,r){if(!t){N.error(`Missing configuration`);return}if(Ft(t.enableExperimentalFeatures),Cn(t.allowUntrustedEvents),d=t,e&&as())return;let i=lh(t.plugins,{initConfiguration:t,publicApi:n,registerAssembleEventHook:h.assembleEvent.register});typeof i==`boolean`?i&&a():i.then(e=>{e&&a()}).catch(T);function a(){if(bc(t)){let e={user:s,context:o};if(t.remoteConfigurationId||t.remoteConfiguration?.sync)fc(t,e).then(e=>{e&&b(e,r)}).catch(T);else{let n=Cc(t,e);n&&b(n.initConfiguration,r,n.metadata)}}else b(t,r)}},get initConfiguration(){return d},getInternalContext:L,stopSession:L,addTiming(e,t=O()){a.notify(n=>n.addTiming(e,t))},setLoadingTime:(e=>{a.notify(t=>t.setLoadingTime(e))}),startView(e,t=j()){let n=n=>{n.startView(e,t)};a.notify(n),l||(l={options:e,callback:n},y())},setViewName(e){a.notify(t=>t.setViewName(e))},setViewContext(e){a.notify(t=>t.setViewContext(e))},setViewContextProperty(e,t){a.notify(n=>n.setViewContextProperty(e,t))},getViewContext:()=>_,globalContext:o,userContext:s,accountContext:c,addAction(e){a.notify(t=>t.addAction(e))},startAction(e,t){let n=j();a.notify(r=>r.startAction(e,t,n))},stopAction(e,t){let n=j();a.notify(r=>r.stopAction(e,t,n))},startResource(e,t){let n=j();a.notify(r=>r.startResource(e,t,n))},stopResource(e,t){let n=j();a.notify(r=>r.stopResource(e,t,n))},addError(e){a.notify(t=>t.addError(e))},addFeatureFlagEvaluation(e,t){a.notify(n=>n.addFeatureFlagEvaluation(e,t))},startDurationVital(e,t){let n=j();a.notify(r=>r.startDurationVital(e,t,n))},stopDurationVital(e,t){let n=j();a.notify(r=>r.stopDurationVital(e,t,n))},addDurationVital(e){a.notify(t=>t.addDurationVital(e))},addOperationStepVital:(e,t,n,r)=>{a.notify(i=>i.addOperationStepVital(V(e),t,V(n),V(r)))}}}function ph(e){return{...e,service:e.service||e.applicationId,applicationId:`00000000-aaaa-0000-aaaa-000000000000`,clientToken:`empty`,sessionSampleRate:100,defaultPrivacyLevel:e.defaultPrivacyLevel??yr()?.getPrivacyLevel()}}function mh(e,t,n={}){let r=Ce(),i=ps(),a=fh(n,r,(r,o,s,c,l,u)=>{let d=s&&n.createDeflateEncoder?e=>n.createDeflateEncoder(s,e):Ar,f=P(sh)(r,o,e,t,c,d,i.observable,l,u,n.sdkName);return e.onRumStart(f.lifeCycle,r,o,f.viewHistory,s,f.telemetry),t.onRumStart(f.lifeCycle,f.hooks,r,o,f.viewHistory,d),a=gh(a,f),uh(r.plugins,{addEvent:f.addEvent,addError:f.addError}),f}),o=()=>a,s=e=>{let t=dn(`view`);_e(()=>{let n=typeof e==`object`?e:{name:e};a.startView({...n,name:hh(n.name,`view name`),service:hh(n.service,`view service`),version:hh(n.version,`view version`),handlingStack:t}),H({feature:`start-view`})})},c=(e,t)=>{let n=dn(`vital`);_e(()=>{H({feature:`add-operation-step-vital`,action_type:`start`}),a.addOperationStepVital(e,`start`,{...t,handlingStack:n})})},l=w((e,t)=>{H({feature:`add-operation-step-vital`,action_type:`succeed`}),a.addOperationStepVital(e,`end`,t)}),u=w((e,t,n)=>{H({feature:`add-operation-step-vital`,action_type:`fail`}),a.addOperationStepVital(e,`end`,n,t)}),d=Ti({init:e=>{let t=Error().stack;_e(()=>a.init(e,d,t))},setTrackingConsent:w(e=>{r.update(e),H({feature:`set-tracking-consent`,tracking_consent:e})}),setViewName:w(e=>{a.setViewName(hh(e,`view name`)),H({feature:`set-view-name`})}),setViewContext:w(e=>{a.setViewContext(e),H({feature:`set-view-context`})}),setViewContextProperty:w((e,t)=>{a.setViewContextProperty(e,t),H({feature:`set-view-context-property`})}),getViewContext:w(()=>(H({feature:`set-view-context-property`}),a.getViewContext())),getInternalContext:w(e=>a.getInternalContext(e)),getInitConfiguration:w(()=>h(a.initConfiguration)),addAction:(e,t)=>{let n=dn(`action`);_e(()=>{a.addAction({name:V(e),context:V(t),startClocks:j(),type:Vs.CUSTOM,handlingStack:n}),H({feature:`add-action`})})},startAction:w((e,t)=>{H({feature:`start-action`}),a.startAction(V(e),{type:V(t?.type),context:V(t?.context),actionKey:t?.actionKey})}),stopAction:w((e,t)=>{H({feature:`stop-action`}),a.stopAction(V(e),{type:V(t?.type),context:V(t?.context),actionKey:t?.actionKey})}),startResource:w((e,t)=>{H({feature:`start-resource`}),a.startResource(V(e),{type:V(t?.type),method:V(t?.method),context:V(t?.context),resourceKey:t?.resourceKey})}),stopResource:w((e,t)=>{H({feature:`stop-resource`}),a.stopResource(V(e),{type:V(t?.type),statusCode:t?.statusCode,size:t?.size,context:V(t?.context),resourceKey:t?.resourceKey})}),addError:(e,t)=>{let n=dn(`error`);_e(()=>{a.addError({error:e,handlingStack:n,context:V(t),startClocks:j()}),H({feature:`add-error`})})},addTiming:w((e,t)=>{a.addTiming(V(e),t)}),setViewLoadingTime:w(()=>{let e=O();a.setLoadingTime(e),H({feature:`addViewLoadingTime`})}),setGlobalContext:U(o,W.globalContext,G.setContext,`set-global-context`),getGlobalContext:U(o,W.globalContext,G.getContext,`get-global-context`),setGlobalContextProperty:U(o,W.globalContext,G.setContextProperty,`set-global-context-property`),removeGlobalContextProperty:U(o,W.globalContext,G.removeContextProperty,`remove-global-context-property`),clearGlobalContext:U(o,W.globalContext,G.clearContext,`clear-global-context`),setUser:U(o,W.userContext,G.setContext,`set-user`),getUser:U(o,W.userContext,G.getContext,`get-user`),setUserProperty:U(o,W.userContext,G.setContextProperty,`set-user-property`),removeUserProperty:U(o,W.userContext,G.removeContextProperty,`remove-user-property`),clearUser:U(o,W.userContext,G.clearContext,`clear-user`),setAccount:U(o,W.accountContext,G.setContext,`set-account`),getAccount:U(o,W.accountContext,G.getContext,`get-account`),setAccountProperty:U(o,W.accountContext,G.setContextProperty,`set-account-property`),removeAccountProperty:U(o,W.accountContext,G.removeContextProperty,`remove-account-property`),clearAccount:U(o,W.accountContext,G.clearContext,`clear-account`),startView:s,stopSession:w(()=>{a.stopSession(),H({feature:`stop-session`})}),addFeatureFlagEvaluation:w((e,t)=>{a.addFeatureFlagEvaluation(V(e),V(t)),H({feature:`add-feature-flag-evaluation`})}),getSessionReplayLink:w(()=>e.getSessionReplayLink()),startSessionReplayRecording:w(t=>{e.start(t),H({feature:`start-session-replay-recording`,force:t?.force})}),stopSessionReplayRecording:w(()=>e.stop()),addDurationVital:(e,t)=>{let n=dn(`vital`);_e(()=>{H({feature:`add-duration-vital`}),a.addDurationVital({id:M(),name:V(e),type:Us.DURATION,startClocks:ze(t.startTime),duration:t.duration,context:V(t?.context),description:V(t?.description),handlingStack:n})})},startDurationVital:(e,t)=>{let n=dn(`vital`);_e(()=>{H({feature:`start-duration-vital`}),a.startDurationVital(V(e),{vitalKey:t?.vitalKey,context:V(t?.context),description:V(t?.description),handlingStack:n})})},stopDurationVital:w((e,t)=>{H({feature:`stop-duration-vital`}),a.stopDurationVital(V(e),{vitalKey:t?.vitalKey,context:V(t?.context),description:V(t?.description)})}),startOperation:c,succeedOperation:l,failOperation:u,startFeatureOperation:c,succeedFeatureOperation:l,failFeatureOperation:u,DEFAULT_TRACKED_RESOURCE_HEADERS:Nc});return d}function hh(e,t){if(e!==void 0){if(typeof e!=`string`){N.warn(`Invalid ${t} provided (expected a string, got ${typeof e}). Ignoring.`);return}return V(e)}}function gh(e,t){return{...e,init:e=>{Di(`DD_RUM`,e)},getInternalContext:t.getInternalContext,stopSession:t.stopSession,getViewContext:t.getViewContext,globalContext:t.globalContext,userContext:t.userContext,accountContext:t.accountContext}}function _h(e,{session:t,viewContext:n,errorType:r}){let i=t?t.id:`no-session-id`,a=[];return r!==void 0&&a.push(`error-type=${r}`),n&&(a.push(`seed=${n.id}`),a.push(`from=${n.startClocks.timeStamp}`)),`${vh(e)}${`/rum/replay/sessions/${i}`}?${a.join(`&`)}`}function vh(e){let t=e.site,n=e.subdomain||yh(e);return`https://${n?`${n}.`:``}${t}`}function yh(e){switch(e.site){case Te:case Ee:return`app`;case we:return`dd`;default:return}}function bh(e,t,n,r){let i=pr([qe(e,`profile`)],e=>{t.notify(15,{error:{message:e,source:qn.AGENT,startClocks:j()}}),ti(`Error reported to customer`,{"error.message":e})}),a=n(r);return{async send({event:e,...t}){let n=new FormData,r=kn(e);if(!r)throw Error(`Failed to serialize event`);n.append(`event`,new Blob([r],{type:`application/json`}),`event.json`);let o=r.length;for(let[e,r]of Er(t)){let t=kn(r);if(!t)throw Error(`Failed to serialize attachment`);let i=await xh(a,t);o+=i.outputBytesCount,n.append(e,new Blob([i.output]),e)}i.send({data:n,bytesCount:o})}}}function xh(e,t){return new Promise(n=>{e.write(t),e.finish(e=>{n(e)})})}function Sh(e,t,n,r){let i=t.findTrackedSession(),a=Ch(e,i,r);return _h(e,{viewContext:n.findView(),errorType:a,session:i})}function Ch(e,t,n){if(!t)return`rum-not-tracked`;if(Tu(t,e)===wu.OFF)return`incorrect-session-plan`;if(!n)return`replay-not-started`}function wh(e,t){if(!e.metricsEnabled)return{stop:L};let n,r,i,{unsubscribe:a}=t.subscribe(e=>{switch(e.type){case`start`:n={forced:e.forced,timestamp:O()},r=void 0,i=void 0;break;case`document-ready`:n&&(r=k(n.timestamp,O()));break;case`recorder-settled`:n&&(i=k(n.timestamp,O()));break;case`aborted`:case`deflate-encoder-load-failed`:case`recorder-load-failed`:case`succeeded`:a(),n&&ii(Wr.RECORDER_INIT_METRICS_TELEMETRY_NAME,{metrics:Th(n.forced,i,k(n.timestamp,O()),e.type,r)})}});return{stop:a}}function Th(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}async function Eh(){try{return await P(Dh)()}catch(e){bs({error:e,source:`Recorder`,scriptType:`module`})}}async function Dh(){return(await c(async()=>{let{startRecording:e}=await Promise.resolve().then(()=>Dv);return{startRecording:e}},void 0)).startRecording}function Oh(e,t,n,r,i,a){let o=0,s;t.subscribe(Y.SESSION_EXPIRED,()=>{(o===2||o===3)&&(d(),o=1)}),t.subscribe(Y.SESSION_RENEWED,()=>{o===1&&u()});let c=new E;wh(a,c);let l=async l=>{c.notify({type:`start`,forced:l});let[u]=await Promise.all([Mh(c,{type:`recorder-settled`},Eh()),Mh(c,{type:`document-ready`},to(`interactive`))]);if(o!==2){c.notify({type:`aborted`});return}if(!u){o=0,c.notify({type:`recorder-load-failed`});return}let d=i();if(!d){o=0,c.notify({type:`deflate-encoder-load-failed`});return}({stop:s}=u(t,e,n,r,d,a)),o=3,c.notify({type:`succeeded`})};function u(t){let r=n.findTrackedSession(),i=r?Tu(r,e):void 0;if(!kh(i,t)){o=1;return}if(Ah(o))return;o=2;let a=jh(i,t)||!1;l(a).catch(T),a&&n.updateSessionState({forcedReplay:`1`})}function d(){o===3&&s?.(),o=0}return{start:u,stop:d,getSessionReplayLink(){return Sh(e,n,r,o!==0)},isRecording:()=>o===3}}function kh(e,t){return e!==void 0&&(e!==wu.OFF||t?.force)}function Ah(e){return e===2||e===3}function jh(e,t){return t&&t.force&&e===wu.OFF}async function Mh(e,t,n){try{return await n}finally{e.notify(t)}}function Nh(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:L},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Ph(){if(xr()&&!br(vr.RECORDS))return{start:L,stop:L,getReplayStats:()=>void 0,onRumStart:L,isRecording:()=>!1,getSessionReplayLink:()=>void 0};let{strategy:e,shouldStartImmediately:t}=Nh();return{start:t=>e.start(t),stop:()=>e.stop(),getSessionReplayLink:()=>e.getSessionReplayLink(),onRumStart:n,isRecording:()=>Ts()===3&&e.isRecording(),getReplayStats:e=>Ts()===3?Is(e):void 0};function n(n,r,i,a,o,s){let c;function l(){return c||(o??=ws(r,`Datadog Session Replay`,()=>e.stop()),o&&(c=ys(o,_s.REPLAY))),c}e=Oh(r,n,i,a,l,s),t(r)&&e.start()}}function Fh(){return C.Profiler!==void 0}function Ih(e){let t={status:`starting`};return e.assembleEventDefaults.register(({eventType:e})=>e!==J.VIEW&&e!==J.LONG_TASK&&e!==J.ACTION&&e!==J.VITAL?Br:{type:e,_dd:{profiling:t}}),{get:()=>t,set:e=>{t=e}}}async function Lh(){try{return await P(Rh)()}catch(e){bs({error:e,source:`Profiler`,scriptType:`module`})}}async function Rh(){return(await c(async()=>{let{createRumProfiler:e}=await Promise.resolve().then(()=>Yv);return{createRumProfiler:e}},void 0)).createRumProfiler}function zh(){let e;function t(t,n,r,i,a,o){let s=i.findTrackedSession();if(!s||!Bh(r,s))return;let c=Ih(n);if(!P(Fh)()){c.set({status:`error`,error_reason:`not-supported-by-browser`});return}P(Lh)().then(n=>{if(!n){c.set({status:`error`,error_reason:`failed-to-lazy-load`});return}e=n(r,t,i,c,o,a,void 0),e.start()}).catch(T)}return{onRumStart:t,stop:()=>{e?.stop()}}}function Bh(e,t){return xr()?br(vr.PROFILES):Ki(t.id,Wi(e.sessionSampleRate,e.profilingSampleRate))}var Vh=mh(Ph(),zh(),{startDeflateWorker:ws,createDeflateEncoder:ys,sdkName:`rum`});Ei(C,`DD_RUM`,Vh);var Hh=e(i(),1),Uh,Wh,Gh,Kh,qh=[],Jh=[];function Yh(e={}){return{name:`react`,onInit({publicApi:t,initConfiguration:n}){Uh=t,Wh=e;for(let e of qh)e(Wh,Uh);e.router&&(n.trackViewsManually=!0)},onRumStart({addError:e}){Gh=e;for(let t of Jh)e&&t(e)},getConfigurationTelemetry(){let t=st(`react`,Hh.version);return{router:!!e.router,integrations:ct(t,e.router&&Kh)}}}}function Xh(e){Gh?e(Gh):Jh.push(e)}function Zh(e,t){let n=dn(`react error`),r=j();Xh(i=>{_e(()=>{i({error:e,handlingStack:n,componentStack:t.componentStack??void 0,startClocks:r,context:{...typeof e==`object`&&e?e.dd_context:void 0,framework:`react`}})})})}var Qh={didCatch:!1,error:null};function $h(e,t=`ErrorBoundary`){let n=class extends Hh.Component{constructor(e){super(e),this.resetError=()=>{this.setState(Qh)},this.state=Qh}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}componentDidCatch(t,n){e(t,n)}render(){return this.state.didCatch?Hh.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}};return n.displayName=t,n}$h(Zh);function eg(){let e=new Set,t=new WeakSet,n=[],r=new WeakMap;function i(e){let t=r.get(e);return t||(t={capturePending:!1},r.set(e,t)),t}function a(e){let t=i(e);t.capturePending=!0;let n=()=>r.get(e)===t;return{lastChangeHash:t.lastChangeHash,isCurrent:n,setLastChangeHash:e=>{n()&&(t.lastChangeHash=e)}}}function o(n){n.isConnected&&!t.has(n)&&e.add(n)}function s(t){e.delete(t)}function c(n){t.add(n),e.delete(n)}return{markCanvas:(e,t)=>{switch(t){case 1:o(e);return;case 0:s(e);return;case 2:c(e);return;default:return}},forgetCanvas:t=>{e.delete(t),r.delete(t)},resetCanvasBitmap:e=>{r.delete(e),o(e)},takeCapturableCanvases:()=>{let n=[];return e.forEach(r=>{r.isConnected?!t.has(r)&&!i(r).capturePending&&(e.delete(r),n.push(r)):e.delete(r)}),n},startCaptureAttempt:a,discardCaptureAttempt:(e,t)=>{t.isCurrent()&&(i(e).capturePending=!1)},retryCanvas:e=>{r.delete(e),o(e)},addCanvasContentMutation:e=>{n.push(e)},takeCanvasContentMutations:()=>{let e=n;n=[];for(let t of e)t.captureAttempt.isCurrent()&&(i(t.canvas).capturePending=!1);return e},reset:()=>{e.clear(),n=[],r=new WeakMap}}}var tg={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9,Change:12},Z={AddString:0,AddNode:1,RemoveNode:2,Attribute:3,Text:4,Size:5,ScrollPosition:6,AddStyleSheet:7,AttachedStyleSheets:8,MediaPlaybackState:9,VisualViewport:10,AddRoleAnnotatedStrings:11,InputValue:12,InputSelection:13,ClearStrings:14,ImageContent:15},Q={Default:0,NodeName:1,AttributeName:2,AttributeValue:3,TextContent:4,FormInput:5,Css:6,Url:7,ResourceId:8},ng={Selected:0,Deselected:1,Indeterminate:2},rg={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},ig={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},ag={Play:0,Pause:1},og={V1:0,Change:1};function sg(e){return lg(void 0,void 0,e)}function cg(e,t,n){return lg(e,t,n)}function lg(e,t,n){let r={container:void 0,parentId:e,previousSiblingId:void 0,nextSiblingId:t},i=e=>r.previousSiblingId===e-1?0:r.nextSiblingId===void 0?r.parentId===void 0?null:e-r.parentId:r.nextSiblingId-e;return{advance(e){let t=n.getOrInsert(e),a=i(t);return r.previousSiblingId=t,{nodeId:t,insertionPoint:a}},ascend(){r.container&&(r=r.container)},descend(){r.previousSiblingId!==void 0&&(r={container:r,parentId:r.previousSiblingId,previousSiblingId:void 0,nextSiblingId:void 0})}}}function $(e,t){return{role:e,string:t}}function ug(e,t,n){return[$(Q.AttributeName,t),$(mg(e,t),n)]}function dg(e,t,n){let r=$(Q.AttributeName,t);return n===null?[r]:[r,$(mg(e,t),n)]}var fg=new Set([`input`,`option`,`select`,`textarea`]),pg=new Set([`action`,`background`,`cite`,`data`,`formaction`,`href`,`longdesc`,`manifest`,`ping`,`poster`,`src`,`srcset`,`xlink:href`]);function mg(e,t){switch(t){case`value`:return fg.has(e)?Q.FormInput:Q.AttributeValue;case`style`:return Q.Css;default:return pg.has(t)?Q.Url:Q.AttributeValue}}function hg(e){let t=[],n=gg(e),r=()=>{n.flushInto(t),n=gg(e)},i=()=>{r(),t.push([Z.ClearStrings]),e.clear()};return{add:(t,r)=>{n.add(t,r),e.size+n.pendingStringCount>=1e6&&i()},flush:()=>{r();let e=t;return t=[],e}}}function gg(e){let t={},n=new Map,r=[],i=0,a=!1,o=t=>{let r=e.get(t);if(r!==void 0)return r;a=!0;let o=n.get(t.role);o||(o={role:t.role,strings:new Map,references:0},n.set(t.role,o)),o.references++;let s=o.strings.get(t.string);if(s)return s;let c={literal:t,id:void 0};return o.strings.set(t.string,c),i++,c},s=e=>{for(let t=0,n=e.length;t<n;t++){let n=e[t];typeof n==`string`?e[t]=o($(Q.Default,n)):Array.isArray(n)?s(n):yg(n)&&(e[t]=o(n))}},c=()=>{if(n.size===0)return;let t=[Z.AddRoleAnnotatedStrings];for(let r of Array.from(n.values()).sort(vg)){let n=[r.role];for(let t of r.strings.values())t.id=e.getOrInsert(t.literal),n.push(t.literal.string);t.push(n)}return t};return{add:(e,n)=>{e in t||(t[e]=[e]),Array.isArray(n)&&(a=!1,s(n),a&&r.push(n)),t[e].push(n)},flushInto:e=>{let n=c();n&&e.push(n);for(let e of r)_g(e);[Z.AddNode,Z.RemoveNode,Z.Attribute,Z.Text,Z.InputValue,Z.InputSelection,Z.Size,Z.ScrollPosition,Z.AddStyleSheet,Z.AttachedStyleSheets,Z.MediaPlaybackState,Z.VisualViewport,Z.ImageContent].forEach(n=>{let r=t[n];r&&e.push(r)})},get pendingStringCount(){return i}}}function _g(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];Array.isArray(n)?_g(n):bg(n)&&(e[t]=n.id)}}function vg(e,t){return t.references-e.references}function yg(e){return typeof e==`object`&&!!e&&`string`in e}function bg(e){return typeof e==`object`&&!!e&&`literal`in e}function xg(){return{cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}}}function Sg(e,t,n){e[t].count+=1,e[t].max=Math.max(e[t].max,n),e[t].sum+=n}function Cg(e,t){for(let n of[`cssText`,`serializationDuration`])e[n].count+=t[n].count,e[n].max=Math.max(e[n].max,t[n].max),e[n].sum+=t[n].sum}function wg(e,t,n,r,i,a){let o=hg(r.stringIds),s=xg(),c={addMetric(e,t){Sg(s,e,t)},addNode(...e){o.add(Z.AddNode,e)},addStyleSheet(e,t,n){n?o.add(Z.AddStyleSheet,[e,t||[],n]):t?o.add(Z.AddStyleSheet,[e,t]):o.add(Z.AddStyleSheet,[e])},attachStyleSheets(e,t){let n=[e];for(let e of t)n.push(e);o.add(Z.AttachedStyleSheets,n)},removeNode(e){o.add(Z.RemoveNode,e)},setAttributes(e){o.add(Z.Attribute,e)},setInputSelection(e,t){let n=[e];for(let e of t)n.push(e);o.add(Z.InputSelection,n)},setInputValue(e,t){o.add(Z.InputValue,[e,t])},setMediaPlaybackState(e,t){o.add(Z.MediaPlaybackState,[e,t])},setScrollPosition(e,t,n){o.add(Z.ScrollPosition,[e,t,n])},setSize(e,t,n){o.add(Z.Size,[e,t,n])},setText(e,t){o.add(Z.Text,[e,t])},setImageContent(e,t){o.add(Z.ImageContent,[e,t])},kind:e,scope:r},l=O();a(c),Sg(s,`serializationDuration`,k(l,O()));let u=o.flush();u.length>0&&t(e===0||e===1?{data:u,format:og.Change,type:tg.FullSnapshot,timestamp:i}:{data:u,type:tg.Change,timestamp:i}),n(s)}function Tg(e,t){let n=e.tagName,r=e.value;if(uu(e,t)){let t=e.type;return n===`INPUT`&&(t===`button`||t===`submit`||t===`reset`)?r:!r||n===`OPTION`?void 0:`***`}if(n===`OPTION`||n===`SELECT`)return e.value;if(n===`INPUT`||n===`TEXTAREA`)return r}var Eg=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Dg=/^[A-Za-z]+:|^\/\//,Og=/^["']?data:.*,/i;function kg(e,t){return e.replace(Eg,(e,n,r,i,a,o)=>{let s=r||a||o;if(!t||!s||Dg.test(s)||Og.test(s))return e;let c=n||i||``;return`url(${c}${Ag(s,t)}${c})`})}function Ag(e,t){try{return ce(e,t).href}catch{return e}}function jg(e){return e.tagName.toLowerCase()}function Mg(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`}var Ng=[`width`,`height`];function Pg(e){return bl(e)&&e.tagName===`CANVAS`}function Fg(e){return Ng.includes(e.toLowerCase())}var Ig=1e6;function Lg(e,t,n,r){if(t===X.HIDDEN)return null;let i=e.getAttribute(n),a=e.tagName;if(du(a,n,i,t,r)){if(a===`IMG`){let t=e;if(t.naturalWidth>0)return Mg(t.naturalWidth,t.naturalHeight);let{width:n,height:r}=e.getBoundingClientRect();return n>0||r>0?Mg(n,r):iu}return a===`SOURCE`?iu:`***`}return i&&_l(i,Ig)}function Rg(e,t,n){if(t===X.HIDDEN)return[];let r=[],i=jg(e);for(let a=0;a<e.attributes.length;a+=1){let o=e.attributes.item(a).name;o!==`value`&&o!==`selected`&&o!==`checked`&&zg(r,e,i,o,t,n)}if(e.value&&(i===`textarea`||i===`select`||i===`option`||i===`input`)){let n=Tg(e,t);n!==void 0&&r.push(ug(i,`value`,n))}else e.hasAttribute(`value`)&&zg(r,e,i,`value`,t,n);i===`option`?e.selected&&!uu(e,t)&&r.push(ug(i,`selected`,``)):e.hasAttribute(`selected`)&&zg(r,e,i,`selected`,t,n);let a=e;return i===`input`&&(a.type===`radio`||a.type===`checkbox`)?a.checked&&!uu(e,t)&&r.push(ug(i,`checked`,``)):e.hasAttribute(`checked`)&&zg(r,e,i,`checked`,t,n),r}function zg(e,t,n,r,i,a){let o=Lg(t,i,r,a.scope.configuration);o!==null&&e.push(ug(n,r,o))}function Bg(e,t,n){if(t===X.HIDDEN)return{};let r={},i=jg(e);if(i===`link`){let t=Vg(e.sheet);t&&(n.addMetric(`cssText`,t.length),r._cssText=t)}if(i===`style`&&e.sheet){let t=Vg(e.sheet);t&&(n.addMetric(`cssText`,t.length),r._cssText=t)}(i===`audio`||i===`video`)&&(r.rr_mediaState=e.paused?`paused`:`played`);let a,o;switch(n.kind){case 0:a=Math.round(e.scrollTop),o=Math.round(e.scrollLeft),(a||o)&&n.scope.elementsScrollPositions.set(e,{scrollTop:a,scrollLeft:o});break;case 1:n.scope.elementsScrollPositions.has(e)&&({scrollTop:a,scrollLeft:o}=n.scope.elementsScrollPositions.get(e))}return o&&(r.rr_scrollLeft=o),a&&(r.rr_scrollTop=a),r}function Vg(e){if(!e)return null;let t;try{t=e.rules||e.cssRules}catch{}return t?kg(Array.from(t,Xa()?Hg:Ug).join(``),e.href):null}function Hg(e){return Gg(e)&&e.selectorText.includes(`:`)?e.cssText.replace(/(\[[\w-]+[^\\])(:[^\]]+\])/g,`$1\\$2`):Ug(e)}function Ug(e){return Wg(e)&&Vg(e.styleSheet)||e.cssText}function Wg(e){return`styleSheet`in e}function Gg(e){return`selectorText`in e}function Kg(e,t,n,r){if(t.parentNode?.nodeName===`STYLE`||n===X.HIDDEN||n===X.IGNORE)return;let i,a=lu(t);if(i=a?cu(a,n):n,i===X.HIDDEN){$g(e,t,r);return}if(i!==X.IGNORE){switch(t.nodeType){case t.CDATA_SECTION_NODE:Qg(e,t,r);break;case t.DOCUMENT_NODE:qg(e,t,r);break;case t.DOCUMENT_FRAGMENT_NODE:Jg(e,t,r);break;case t.DOCUMENT_TYPE_NODE:Yg(e,t,r);break;case t.ELEMENT_NODE:Xg(e,t,i,r);break;case t.TEXT_NODE:Zg(e,t,i,r);break;default:return}switch(t.nodeType){case t.CDATA_SECTION_NODE:case t.DOCUMENT_TYPE_NODE:case t.TEXT_NODE:return}e.descend(),Cl(t,t=>{Kg(e,t,i,r)}),e.ascend()}}function qg(e,t,n){let{nodeId:r,insertionPoint:i}=e.advance(t);n.addNode(i,$(Q.NodeName,`#document`)),n.setScrollPosition(r,vu(),yu()),e_(t.adoptedStyleSheets,r,n)}function Jg(e,t,n){let{nodeId:r,insertionPoint:i}=e.advance(t);if(!Sl(t)){n.addNode(i,$(Q.NodeName,`#document-fragment`));return}n.addNode(i,$(Q.NodeName,`#shadow-root`)),n.scope.shadowRootsController.addShadowRoot(t,n.scope),e_(t.adoptedStyleSheets,r,n)}function Yg(e,t,n){let{insertionPoint:r}=e.advance(t);n.addNode(r,$(Q.NodeName,`#doctype`),$(Q.AttributeValue,t.name),$(Q.AttributeValue,t.publicId),$(Q.Url,t.systemId))}function Xg(e,t,n,r){let{nodeId:i,insertionPoint:a}=e.advance(t),o=Rg(t,n,r);r.addNode(a,n_(t),...o),Pg(t)&&r.scope.canvasManager.markCanvas(t,1);let{_cssText:s,rr_mediaState:c,rr_scrollLeft:l,rr_scrollTop:u}=Bg(t,n,r),d=t;if(s!==void 0&&d.sheet){let e=r.scope.styleSheetIds.getOrInsert(d.sheet);r.addStyleSheet($(Q.Css,s)),r.attachStyleSheets(i,[e])}c===`played`?r.setMediaPlaybackState(i,ag.Play):c===`paused`&&r.setMediaPlaybackState(i,ag.Pause),(l!==void 0||u!==void 0)&&r.setScrollPosition(i,l||0,u||0)}function Zg(e,t,n,r){let{insertionPoint:i}=e.advance(t),a=mu(t,n);r.addNode(i,$(Q.NodeName,`#text`),$(Q.TextContent,a))}function Qg(e,t,n){let{insertionPoint:r}=e.advance(t);n.addNode(r,$(Q.NodeName,`#cdata-section`))}function $g(e,t,n){if(!bl(t))return;let{nodeId:r,insertionPoint:i}=e.advance(t);n.addNode(i,n_(t),ug(jg(t),tu,nu));let{width:a,height:o}=t.getBoundingClientRect();n.setSize(r,a,o)}function e_(e,t,n){e&&e.length!==0&&n.attachStyleSheets(t,e.map(e=>t_(e,n)))}function t_(e,t){let n=Array.from(e.cssRules||e.rules,e=>$(Q.Css,e.cssText)),r=e.media.length>0?Array.from(e.media).map(e=>$(Q.Css,e)):void 0;return t.addMetric(`cssText`,n.reduce((e,t)=>e+t.string.length,0)),t.addStyleSheet(n,r,e.disabled),t.scope.styleSheetIds.getOrInsert(e)}function n_(e){let t=e.nodeName;return r_(e)?$(Q.NodeName,`svg>${t}`):$(Q.NodeName,t)}function r_(e){return e.namespaceURI===`http://www.w3.org/2000/svg`}function i_(e,t,n,r,i,a){a.resetIds(),wg(t,r,i,a,e,e=>{Kg(sg(a.nodeIds),n,a.configuration.defaultPrivacyLevel,e)})}function a_(e,t,n,r,i,a){wg(2,n,i,a,e,e=>o_(t,r,e))}function o_(e,t,n){let r=new Set,i=new Map,a=new Map,o=new Set;for(let t of e)switch(t.type){case`attributes`:{let e=t.target,n=i.get(e);n||(n=new Map,i.set(e,n));let r=t.attributeName;n.has(r)||n.set(r,t.oldValue);break}case`characterData`:a.has(t.target)||a.set(t.target,t.oldValue);break;case`childList`:for(let e=0;e<t.addedNodes.length;e++)r.add(t.addedNodes[e]);for(let e=0;e<t.removedNodes.length;e++)o.add(t.removedNodes[e])}let s=n.scope.nodeIds.nextId,c=new Map;s_(o,n),c_(r,c,n),l_(a,s,c,n),u_(i,s,c,n),d_(c,t,n)}function s_(e,t){let n=t.scope.nodeIds;for(let r of e){let e=n.get(r);e!==void 0&&(p_(r,e=>{Pg(e)&&t.scope.canvasManager.forgetCanvas(e),xl(e)&&t.scope.shadowRootsController.removeShadowRoot(e.shadowRoot),n.delete(e)}),t.removeNode(e))}}function c_(e,t,n){let r=n.scope.nodeIds;for(let i of e){if(!i.isConnected||r.get(i)!==void 0)continue;let e=wl(i);if(!e)continue;let a=r.get(e);if(a===void 0)continue;let o=su(e,n.scope.configuration.defaultPrivacyLevel,t);Kg(cg(a,f_(i,r),r),i,o,n)}}function l_(e,t,n,r){let i=r.scope.nodeIds;for(let[a,o]of e){if(a.textContent===o||!a.isConnected)continue;let e=i.get(a);if(e===void 0||e>=t)continue;let s=wl(a);if(!s)continue;let c=su(s,r.scope.configuration.defaultPrivacyLevel,n);if(c===X.HIDDEN||c===X.IGNORE)continue;let l=mu(a,c);r.setText(e,$(Q.TextContent,l))}}function u_(e,t,n,r){let i=r.scope.nodeIds;for(let[a,o]of e){if(!a.isConnected)continue;let e=i.get(a);if(e===void 0||e>=t)continue;let s=su(a,r.scope.configuration.defaultPrivacyLevel,n);if(s===X.HIDDEN||s===X.IGNORE)continue;let c=jg(a),l=[e];for(let[e,t]of o){if(Pg(a)&&Fg(e)&&r.scope.canvasManager.resetCanvasBitmap(a),a.getAttribute(e)===t)continue;if(e===`value`){let t=Tg(a,s);t!==void 0&&l.push(ug(c,e,t));continue}let n=Lg(a,s,e,r.scope.configuration);l.push(dg(c,e,n))}l.length>1&&r.setAttributes(l)}}function d_(e,t,n){for(let{canvas:r,captureAttempt:i,hash:a,image:o}of n.scope.canvasManager.takeCanvasContentMutations()){if(!i.isCurrent()||!r.isConnected)continue;let s=n.scope.nodeIds.get(r);if(s===void 0){n.scope.canvasManager.forgetCanvas(r);continue}if(su(r,n.scope.configuration.defaultPrivacyLevel,e)!==X.ALLOW){n.scope.canvasManager.markCanvas(r,1);continue}try{t(a,o,()=>{i.isCurrent()&&n.scope.canvasManager.retryCanvas(r)}),n.setImageContent(s,$(Q.ResourceId,a)),i.setLastChangeHash(a)}catch{n.scope.canvasManager.markCanvas(r,1)}}}function f_(e,t){let n=e.nextSibling;for(;n;){let e=t.get(n);if(e!==void 0)return e;n=n.nextSibling}}function p_(e,t){t(e),Cl(e,e=>p_(e,t))}var m_=25;function h_(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>m_||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>m_}var g_=(e,t)=>{let n=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(n)h_(n)?(r.layoutViewportX=Math.round(e+n.offsetLeft),r.layoutViewportY=Math.round(t+n.offsetTop)):(r.visualViewportX=Math.round(e-n.offsetLeft),r.visualViewportY=Math.round(t-n.offsetTop));else return r;return r},__=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function v_(e,t,n,r,i){y_(O(),0,t,n,i);let{unsubscribe:a}=e.subscribe(Y.VIEW_CREATED,e=>{r(),y_(e.startClocks.timeStamp,1,t,n,i)});return{stop:a}}function y_(e,t,n,r,i){let{width:a,height:o}=Cu();n({data:{height:o,href:window.location.href,width:a},type:tg.Meta,timestamp:e}),n({data:{has_focus:document.hasFocus()},type:tg.Focus,timestamp:e}),i_(e,t,document,n,r,i),window.visualViewport&&n({data:__(window.visualViewport),type:tg.VisualViewport,timestamp:e})}function b_(){let e=0,t=x_(),n=e=>t[e.role][e.string];return{clear(){e!==0&&(t=x_(),e=0)},get:n,getOrInsert(r){let i=n(r);return i===void 0&&(i=e++,t[r.role][r.string]=i),i},get size(){return e-0}}}function x_(){return{[Q.Default]:S_(),[Q.NodeName]:S_(),[Q.AttributeName]:S_(),[Q.AttributeValue]:S_(),[Q.TextContent]:S_(),[Q.FormInput]:S_(),[Q.Css]:S_(),[Q.Url]:S_(),[Q.ResourceId]:S_()}}function S_(){return Object.create(null)}function C_(){return E_(1)}function w_(){return E_(0)}function T_(){return E_(0)}function E_(e){return D_(()=>new WeakMap,e)}function D_(e,t){let n=e(),r=t,i=e=>n.get(e);return{clear(){r!==t&&(n=e(),r=t)},delete(e){n.delete(e)},get:i,getOrInsert(e){let t=i(e);return t===void 0&&(t=r++,n.set(e,t)),t},get nextId(){return r},get size(){return r-t}}}function O_(e,t,n,r){let i={resetIds(){i.eventIds.clear(),i.nodeIds.clear(),i.stringIds.clear(),i.styleSheetIds.clear(),i.canvasManager.reset()},canvasManager:e,configuration:t,elementsScrollPositions:n,eventIds:C_(),nodeIds:w_(),shadowRootsController:r,stringIds:b_(),styleSheetIds:T_()};return i}function k_(){let e=new WeakMap;return{set(t,n){(t!==document||document.scrollingElement)&&e.set(t===document?document.scrollingElement:t,n)},get(t){return e.get(t)},has(t){return e.has(t)}}}function A_(e){return!!e.changedTouches}function j_(e){return e.composed===!0&&xl(e.target)?e.composedPath()[0]:e.target}function M_(e,t,n=O()){return{data:{source:e,...t},type:tg.IncrementalSnapshot,timestamp:n}}var N_=50;function P_(e,t){let{throttled:n,cancel:r}=Ht(n=>{let r=j_(n),i=t.nodeIds.get(r);if(i===void 0)return;let a=F_(n);if(!a)return;let o={id:i,timeOffset:0,x:a.x,y:a.y};e(M_(A_(n)?rg.TouchMove:rg.MouseMove,{positions:[o]}))},N_,{trailing:!1}),{stop:i}=bn(document,[z.MOUSE_MOVE,z.TOUCH_MOVE],n,{capture:!0,passive:!0});return{stop:()=>{i(),r()}}}function F_(e){let{clientX:t,clientY:n}=A_(e)?e.changedTouches[0]:e;if(window.visualViewport){let{visualViewportX:e,visualViewportY:r}=g_(t,n);t=e,n=r}if(Number.isFinite(t)&&Number.isFinite(n))return{x:t,y:n}}var I_={[z.POINTER_UP]:ig.MouseUp,[z.MOUSE_DOWN]:ig.MouseDown,[z.CLICK]:ig.Click,[z.CONTEXT_MENU]:ig.ContextMenu,[z.DBL_CLICK]:ig.DblClick,[z.FOCUS]:ig.Focus,[z.BLUR]:ig.Blur,[z.TOUCH_START]:ig.TouchStart,[z.TOUCH_END]:ig.TouchEnd};function L_(e,t){return bn(document,Object.keys(I_),n=>{let r=j_(n),i=t.nodeIds.get(r);if(i===void 0||su(r,t.configuration.defaultPrivacyLevel)===X.HIDDEN)return;let a=I_[n.type],o;if(a!==ig.Blur&&a!==ig.Focus){let e=F_(n);if(!e)return;o={id:i,type:a,x:e.x,y:e.y}}else o={id:i,type:a};e({id:t.eventIds.getOrInsert(n),...M_(rg.MouseInteraction,o)})},{capture:!0,passive:!0})}var R_=100;function z_(e,t,n){let{throttled:r,cancel:i}=Ht(e=>{let r=j_(e);if(!r)return;let i=n.nodeIds.get(r);if(i===void 0||su(r,n.configuration.defaultPrivacyLevel)===X.HIDDEN)return;let a=r===document?{scrollTop:yu(),scrollLeft:vu()}:{scrollTop:Math.round(r.scrollTop),scrollLeft:Math.round(r.scrollLeft)};n.elementsScrollPositions.set(r,a),t(M_(rg.Scroll,{id:i,x:a.scrollLeft,y:a.scrollTop}))},R_),{stop:a}=B(e,z.SCROLL,r,{capture:!0,passive:!0});return{stop:()=>{a(),i()}}}var B_=200;function V_(e){let t=xu().subscribe(t=>{e(M_(rg.ViewportResize,t))});return{stop:()=>{t.unsubscribe()}}}function H_(e){let t=window.visualViewport;if(!t)return{stop:L};let{throttled:n,cancel:r}=Ht(()=>{e({data:__(t),type:tg.VisualViewport,timestamp:O()})},B_,{trailing:!1}),{stop:i}=bn(t,[z.RESIZE,z.SCROLL],n,{capture:!0,passive:!0});return{stop:()=>{i(),r()}}}function U_(e,t){return bn(document,[z.PLAY,z.PAUSE],n=>{let r=j_(n);if(!r)return;let i=t.nodeIds.get(r);i!==void 0&&su(r,t.configuration.defaultPrivacyLevel)!==X.HIDDEN&&e(M_(rg.MediaInteraction,{id:i,type:n.type===z.PLAY?ag.Play:ag.Pause}))},{capture:!0,passive:!0})}function W_(e,t){function n(e,n){if(!e?.ownerNode)return;let r=t.nodeIds.get(e.ownerNode);r!==void 0&&n(r)}let r=[R(CSSStyleSheet.prototype,`insertRule`,({target:t,parameters:[r,i]})=>{n(t,t=>e(M_(rg.StyleSheetRule,{id:t,adds:[{rule:r,index:i}]})))}),R(CSSStyleSheet.prototype,`deleteRule`,({target:t,parameters:[r]})=>{n(t,t=>e(M_(rg.StyleSheetRule,{id:t,removes:[{index:r}]})))})];typeof CSSGroupingRule<`u`?i(CSSGroupingRule):(i(CSSMediaRule),i(CSSSupportsRule));function i(t){r.push(R(t.prototype,`insertRule`,({target:t,parameters:[r,i]})=>{n(t.parentStyleSheet,n=>{let a=G_(t);a&&(a.push(i||0),e(M_(rg.StyleSheetRule,{id:n,adds:[{rule:r,index:a}]})))})}),R(t.prototype,`deleteRule`,({target:t,parameters:[r]})=>{n(t.parentStyleSheet,n=>{let i=G_(t);i&&(i.push(r),e(M_(rg.StyleSheetRule,{id:n,removes:[{index:i}]})))})}))}return{stop:()=>{r.forEach(e=>e.stop())}}}function G_(e){let t=[],n=e;for(;n.parentRule;){let e=Array.from(n.parentRule.cssRules).indexOf(n);t.unshift(e),n=n.parentRule}if(!n.parentStyleSheet)return;let r=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return t.unshift(r),t}function K_(e){return bn(window,[z.FOCUS,z.BLUR],()=>{e({data:{has_focus:document.hasFocus()},type:tg.Focus,timestamp:O()})})}function q_(e,t,n){let r=e.subscribe(Y.VIEW_ENDED,()=>{n(),t({timestamp:O(),type:tg.ViewEnd})});return{stop:()=>{r.unsubscribe()}}}var J_={type:1,selection:ng.Deselected};function Y_(e,t,n,r){let i=r.configuration.defaultPrivacyLevel,a=new WeakMap,o=e.nodeType!==e.DOCUMENT_NODE,s=(o?e.ownerDocument:e).defaultView;if(!s)return{stop:L};let{stop:c}=bn(e,o?[z.CHANGE]:[z.INPUT,z.CHANGE],e=>{let t=j_(e);(t instanceof s.HTMLInputElement||t instanceof s.HTMLTextAreaElement||t instanceof s.HTMLSelectElement)&&u(t)},{capture:!0,passive:!0}),l;if(o)l=L;else{let e=[yn(s.HTMLInputElement.prototype,`value`,u),yn(s.HTMLInputElement.prototype,`checked`,u),yn(s.HTMLSelectElement.prototype,`value`,u),yn(s.HTMLTextAreaElement.prototype,`value`,u),yn(s.HTMLSelectElement.prototype,`selectedIndex`,u)];l=()=>{e.forEach(e=>e.stop())}}return{stop:()=>{l(),c()}};function u(e){let o=su(e,i);if(o===X.HIDDEN)return;let s=e.type,c=e,l;if(s===`radio`||s===`checkbox`){if(uu(e,o))return;l={type:1,selection:Z_(e)}}else if(X_(e)){if(uu(e,o))return;let t=e.options[e.selectedIndex];if(!t)return;c=t,l={type:1,selection:ng.Selected}}else{let t=Tg(e,o);if(t===void 0)return;l={type:0,value:t}}let u=d(c,l),f=[];if(s===`radio`&&e.checked&&Q_(e,e=>{let t=d(e,J_);t!==void 0&&f.push(t)}),X_(e))for(let t=0;t<e.options.length;t++){let n=e.options[t];n!==c&&a.delete(n)}(u!==void 0||f.length!==0)&&wg(2,t,n,r,O(),e=>{u!==void 0&&(l.type===0?e.setInputValue(u,$(Q.FormInput,l.value)):e.setInputSelection(l.selection,[u])),f.length>0&&e.setInputSelection(ng.Deselected,f)})}function d(e,t){let n=r.nodeIds.get(e);if(n===void 0)return;let i=a.get(e);if(!(i&&$_(i,t)))return a.set(e,t),n}}function X_(e){return e.tagName===`SELECT`}function Z_(e){return e.checked?ng.Selected:ng.Deselected}function Q_(e,t){e.name&&e.ownerDocument.querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`).forEach(n=>{let r=n;r!==e&&t(r)})}function $_(e,t){return e.type===0?t.type===0&&e.value===t.value:t.type===1&&e.selection===t.selection}var ev=100;function tv(e){let t=L,n=[],r=!1;function i(){r||(r=!0,t=wo(o,{timeout:ev}))}function a(){t(),r=!1,e(n),n=[]}let{throttled:o,cancel:s}=Ht(a,16,{leading:!1});return{addMutations:e=>{i();for(let t of e)n.push(t)},notifyContentMutated:i,flush:a,stop:()=>{t(),s()}}}function nv(e,t,n,r,i){let a=Zc();if(!a)return{stop:L,flush:L,notifyContentMutated:L};let o=tv(e=>{a_(O(),e.concat(s.takeRecords()),t,n,r,i)}),s=new a(w(o.addMutations));return s.observe(e,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{s.disconnect(),o.stop()},flush:()=>{o.flush()},notifyContentMutated:o.notifyContentMutated}}var rv=[`clearRect`,`fillRect`,`strokeRect`,`fill`,`stroke`,`fillText`,`strokeText`,`drawImage`,`putImageData`,`drawFocusIfNeeded`,`reset`];function iv(e){if(!e.configuration.sessionReplayCanvasRecording?.enable||e.configuration.sessionReplayCanvasRecording.maxFramesPerSecond===0||typeof CanvasRenderingContext2D>`u`)return{stop:L};let t=[];return rv.forEach(n=>{t.push(R(CanvasRenderingContext2D.prototype,n,({target:t,onPostCall:n})=>{n(()=>{e.nodeIds.get(t.canvas)!==void 0&&e.canvasManager.markCanvas(t.canvas,1)})}))}),{stop:()=>t.forEach(e=>e.stop())}}function av(e,t){let n=e.width,r=e.height,i=ov(e,n,r,t);if(i)return{canvasHeight:r,canvasWidth:n,source:i}}function ov(e,t,n,r){let i=Math.min(1,r/Math.max(t,n)),a=Math.max(1,Math.round(t*i)),o=Math.max(1,Math.round(n*i)),s=document.createElement(`canvas`);s.width=a,s.height=o;let c=s.getContext(`2d`);if(c)return c.imageSmoothingQuality=`low`,c.drawImage(e,0,0,a,o),s}function sv(e,t){return new Promise(n=>{try{e.source.toBlob(e=>n(e??void 0),`image/webp`,t)}catch{n(void 0)}})}function cv(e,t){let{height:n,width:r}=e.source,i=Math.max(r,n)<=t?e.source:ov(e.source,r,n,t);if(!i)return Promise.resolve(void 0);let a=i.getContext(`2d`);if(!a)return Promise.resolve(void 0);let o=a.getImageData(0,0,i.width,i.height).data,s=P(C.crypto?.subtle);return s?s.digest(`SHA-256`,o).then(t=>uv(e.canvasWidth,e.canvasHeight,lv(t)),()=>uv(e.canvasWidth,e.canvasHeight,dv(o))):Promise.resolve(uv(e.canvasWidth,e.canvasHeight,dv(o)))}function lv(e){return Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``)}function uv(e,t,n){return`${e}x${t}-${n}`}function dv(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e[n],t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}var fv=(e,t)=>{let n=e.canvasManager,r=e.configuration.sessionReplayCanvasRecording,i=r?.maxFramesPerSecond??0;if(!r?.enable||i===0)return{stop:L};let a=!1,o,s=D/i;function c(e){a||(o=F(()=>{l()},e))}async function l(){let e=performance.now();try{await u()}finally{let t=performance.now()-e;c(Math.max(s-t,s*.5))}}async function u(){let t=n.takeCapturableCanvases();if(!a)for(let r of t){if(e.nodeIds.get(r)===void 0){n.forgetCanvas(r);continue}if(su(r,e.configuration.defaultPrivacyLevel)!==X.ALLOW){n.markCanvas(r,1);continue}await f(r)}}function d(e,t){e.isCurrent()&&n.markCanvas(t,1)}async function f(e){let i=n.startCaptureAttempt(e),o=()=>a||!i.isCurrent();if(!o())try{let a=av(e,r?.maxImageDimension??1e3);if(!a){d(i,e),n.discardCaptureAttempt(e,i);return}let s=await cv(a,r?.hashingMaxDimension??100);if(o())return;if(s===void 0){d(i,e),n.discardCaptureAttempt(e,i);return}if(s===i.lastChangeHash){n.discardCaptureAttempt(e,i);return}let c=await sv(a,r?.encodeQuality??.5);if(o())return;if(!c){d(i,e),n.discardCaptureAttempt(e,i);return}n.addCanvasContentMutation({canvas:e,captureAttempt:i,hash:s,image:c}),t()}catch(t){o()||(n.markCanvas(e,pv(t)?2:1),n.discardCaptureAttempt(e,i))}}return c(s),{stop:()=>{a=!0,I(o)}}};function pv(e){return e instanceof DOMException&&e.name===`SecurityError`}var mv=(e,t,n)=>{let r=new Map;return{addShadowRoot:(i,a)=>{if(r.has(i))return;let o=nv(i,e,t,n,a),s=Y_(i,e,n,a),c=z_(i,e,a);r.set(i,{flush:()=>o.flush(),stop:()=>{o.stop(),s.stop(),c.stop()}})},removeShadowRoot:e=>{let t=r.get(e);t&&(t.stop(),r.delete(e))},stop:()=>{r.forEach(({stop:e})=>e())},flush:()=>{r.forEach(({flush:e})=>e())}}};function hv(e){let{emitRecord:t,emitResource:n,emitStats:r,configuration:i,lifeCycle:a}=e;if(!t||!n||!r)throw Error(`emit functions are required`);let o=n=>{t(n),Kn(`record`,{record:n}),Ns(e.viewHistory.findView().id)},s=(t,r,i)=>{n(t,r,i),Ps(e.viewHistory.findView().id)},c=eg(),l=mv(o,s,r),u=O_(c,i,k_(),l),{stop:d}=v_(a,o,r,f,u);function f(){l.flush(),p.flush()}let p=nv(document,o,s,r,u),m=[p,P_(o,u),L_(o,u),z_(document,o,u),V_(o),Y_(document,o,r,u),U_(o,u),W_(o,u),K_(o),H_(o),q_(a,o,f),iv(u),fv(u,p.notifyContentMutated)];return{stop:()=>{l.stop(),m.forEach(e=>e.stop()),d()},flushMutations:f,shadowRootsController:l}}function gv(e,t,n,r){let i=new FormData;i.append(`segment`,new Blob([e],{type:`application/octet-stream`}),`${t.session.id}-${t.start}`);let a={raw_segment_size:r,compressed_segment_size:e.byteLength,...t},o=JSON.stringify(a);return i.append(`event`,new Blob([o],{type:`application/json`})),{data:i,bytesCount:e.byteLength,cssText:n.cssText,isFullSnapshot:t.index_in_view===0,rawSize:r,recordCount:t.records_count,serializationDuration:n.serializationDuration}}function _v({context:e,creationReason:t,encoder:n}){let r=0,i=e.view.id,a={start:1/0,end:-1/0,creation_reason:t,records_count:0,has_full_snapshot:!1,index_in_view:js(i),source:`browser`,...e},o=xg();Ms(i);function s(e,t){a.start=Math.min(a.start,e.timestamp),a.end=Math.max(a.end,e.timestamp),a.records_count+=1,a.has_full_snapshot||=e.type===tg.FullSnapshot||e.type===tg.Change&&a.index_in_view===0;let i=n.isEmpty?`{"records":[`:`,`;n.write(i+JSON.stringify(e),e=>{r+=e,t(r)})}function c(e){Cg(o,e)}function l(e){if(n.isEmpty)throw Error(`Empty segment flushed`);n.write(`],${JSON.stringify(a).slice(1)}\n`),n.finish(t=>{Fs(a.view.id,t.rawBytesCount),e(a,o,t)})}return{addRecord:s,addStats:c,flush:l}}var vv=5*D;function yv(e,t,n,r,i,a){return bv(e,()=>xv(t.applicationId,n,r),i,a)}function bv(e,t,n,r){let i={status:0,nextSegmentCreationReason:`init`},{unsubscribe:a}=e.subscribe(Y.VIEW_CREATED,()=>{s(`view_change`)}),{unsubscribe:o}=e.subscribe(Y.PREPARE_URGENT_FLUSH,e=>{s(e)});function s(e){i.status===1&&(i.segment.flush((t,r,i)=>{let a=gv(i.output,t,r,i.rawBytesCount);kr(e)&&e!==Dr.HIDDEN?n.sendOnExit(a):n.send(a)}),I(i.expirationTimeoutId)),i=e===`stop`?{status:2}:{status:0,nextSegmentCreationReason:e}}return{addRecord:e=>{if(i.status!==2){if(i.status===0){let e=t();if(!e)return;i={status:1,segment:_v({encoder:r,context:e,creationReason:i.nextSegmentCreationReason}),expirationTimeoutId:F(()=>{s(`segment_duration_limit`)},vv)}}i.segment.addRecord(e,e=>{e>6e4&&s(`segment_bytes_limit`)})}},addStats:e=>{i.status===1&&i.segment.addStats(e)},stop:()=>{s(`stop`),a(),o()}}}function xv(e,t,n){let r=t.findTrackedSession(),i=n.findView();if(r&&i)return{application:{id:e},session:{id:r.id},view:{id:i.id}}}function Sv(e,t){if(!e.metricsEnabled)return{stop:L};let{unsubscribe:n}=t.subscribe(e=>{if(e.type===`failure`||e.type===`queue-full`||e.type===`success`&&e.payload.isFullSnapshot){let t=Cv(e.type,e.bandwidth,e.payload);ii(Wr.SEGMENT_METRICS_TELEMETRY_NAME,{metrics:t})}});return{stop:n}}function Cv(e,t,n){return{cssText:{count:n.cssText.count,max:n.cssText.max,sum:n.cssText.sum},encoding:{fullSnapshot:`change`,incrementalSnapshot:`change`},isFullSnapshot:n.isFullSnapshot,ongoingRequests:{count:t.ongoingRequestCount,totalSize:t.ongoingByteCount},recordCount:n.recordCount,result:e,serializationDuration:{count:n.serializationDuration.count,max:n.serializationDuration.max,sum:n.serializationDuration.sum},size:{compressed:n.bytesCount,raw:n.rawSize}}}function wv(e,t,n){let r=new FormData;r.append(`image`,t,e);let i={application:{id:n},type:`resource`};return r.append(`event`,new Blob([JSON.stringify(i)],{type:`application/json`})),{data:r,bytesCount:t.size,hash:e}}function Tv(e,t,n){let r=new Set,i=new Map,{unsubscribe:a}=n.observable.subscribe(e=>{if(e.type===`success`){let t=i.get(e.payload.hash);i.delete(e.payload.hash),t&&t.onDiscards.clear()}else if(e.type===`queue-full`){let t=i.get(e.payload.hash);i.delete(e.payload.hash),t&&(r.delete(e.payload.hash),t.onDiscards.forEach(e=>e()))}}),{unsubscribe:o}=t.subscribe(Y.PREPARE_URGENT_FLUSH,e=>{kr(e)&&e!==Dr.HIDDEN&&i.forEach(({payload:e})=>n.sendOnExit(e))});return{emitResource:(t,a,o)=>{if(r.has(t)){o&&i.get(t)?.onDiscards.add(o);return}r.add(t);let s=wv(t,a,e),c={payload:s,onDiscards:new Set};o&&c.onDiscards.add(o),i.set(t,c),n.send(s)},stop:()=>{a(),o(),i.clear(),r.clear()}}}function Ev(e){let t=yr();return{addRecord:n=>{let r=e.findView();t.send(`record`,n,r.id)}}}var Dv=t({startRecording:()=>Ov});function Ov(e,t,n,r,i,a,o,s){let c=[],l=t=>{e.notify(Y.RAW_ERROR_COLLECTED,{error:{message:t,source:qn.AGENT,startClocks:j()}}),ti(`Error reported to customer`,{"error.message":t})},u=o||pr([qe(t,`replay`)],l,6e4),d=s||pr([qe(t,`replay`)],l,0),f,p,m=L,h=L,{unsubscribe:g}=e.subscribe(Y.PREPARE_URGENT_FLUSH,()=>h());if(c.push(g),xr())({addRecord:f}=Ev(r)),p=L;else{let o=yv(e,t,n,r,u,i);f=o.addRecord,p=o.addStats,c.push(o.stop);let s=Sv(a,u.observable);c.push(s.stop);let l=Tv(t.applicationId,e,d);m=l.emitResource,c.push(l.stop)}let _=hv({emitRecord:f,emitResource:m,emitStats:p,configuration:t,lifeCycle:e,viewHistory:r});return h=_.flushMutations,{stop:()=>{_.flushMutations(),_.stop(),c.forEach(e=>e())}}}function kv(){let e=yr();return t=>{e.send(`profile`,t)}}function Av(e,t,n){let r=bh(e,t,n,_s.PROFILING);return({profile:e,trace:t})=>{let n={event:e,"wall-time.json":t};r.send(n)}}var jv=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;function Mv(e){return e?e.replace(jv,`/?`):`/`}var Nv=(e,t)=>e||Mv(t);function Pv(e,t,n){let r=Hn(t),i=Fv(e,t.applicationId,n),a=Rv(r);return{...i,attachments:[`wall-time.json`],start:new Date(e.startClocks.timeStamp).toISOString(),end:new Date(e.endClocks.timeStamp).toISOString(),family:`chrome`,runtime:`chrome`,format:`json`,version:4,tags_profiler:a.join(`,`),_dd:{clock_drift:Ue()}}}function Fv(e,t,n){let{ids:r,names:i}=Iv(e.views),a=e.longTasks.map(e=>e.id).filter(e=>e!==void 0),o=e.actions?.map(e=>e.id).filter(e=>e!==void 0)??[],{ids:s,labels:c}=Lv(e.vitals),l={application:{id:t}};return n&&(l.session={id:n}),r.length&&(l.view={id:r,name:i}),a.length&&(l.long_task={id:a}),o.length&&(l.action={id:o,label:[]}),s.length&&(l.vital={id:s,label:c}),l}function Iv(e){let t={ids:[],names:[]};for(let n of e)t.ids.push(n.viewId),n.viewName&&t.names.push(n.viewName);return t.names=Array.from(new Set(t.names)),t}function Lv(e){let t={ids:[],labels:[]};if(!e)return t;for(let n of e)t.ids.push(n.id),t.labels.push(n.label);return t.labels=Array.from(new Set(t.labels)),t}function Rv(e){return e.concat([`language:javascript`,`runtime:chrome`,`family:chrome`,`host:browser`])}var zv=Ji;function Bv(e){let t=Ui({expireDelay:zv});return e.subscribe(Y.RAW_RUM_EVENT_COLLECTED,({rawRumEvent:e,startClocks:n,duration:r})=>{e.type===`long_task`&&t.add({id:e.long_task.id,startClocks:n,duration:r,entryType:e.long_task.entry_type===zs.LONG_TASK?El.LONG_TASK:El.LONG_ANIMATION_FRAME},n.relative).close(Fe(n.relative,r))}),t}var Vv=Ji;function Hv(e){let t=Ui({expireDelay:Vv});return e.subscribe(Y.ACTION_STARTED,e=>{t.add({id:e.id,label:``,startClocks:e.startClocks,duration:void 0},e.startClocks.relative)}),e.subscribe(Y.RAW_RUM_EVENT_COLLECTED,({rawRumEvent:e,startClocks:n,duration:r})=>{if(e.type===`action`){let i=t.getEntries(n.relative).find(t=>t.value.id===e.action.id),a=r??0;i?(i.value.duration=a,i.close(Fe(n.relative,a))):t.add({id:e.action.id,label:``,startClocks:n,duration:r},n.relative).close(Fe(n.relative,a))}}),t}var Uv=Ji;function Wv(e){let t=Ui({expireDelay:Uv});return e.subscribe(Y.DURATION_VITAL_STARTED,e=>{t.add({id:e.id,type:Us.DURATION,startClocks:e.startClocks,duration:void 0,label:e.name},e.startClocks.relative)}),e.subscribe(Y.RAW_RUM_EVENT_COLLECTED,({rawRumEvent:e,startClocks:n,duration:r})=>{if(e.type!==`vital`)return;if(e.vital.type===Us.OPERATION_STEP){if(e.vital.step_type===`start`)t.add({id:e.vital.id,type:e.vital.type,operationKey:e.vital.operation_key,startClocks:n,label:e.vital.name},n.relative);else if(e.vital.step_type===`end`){let r=t.findAllEntries().find(t=>t.value.type===Us.OPERATION_STEP&&t.value.label===e.vital.name&&t.value.operationKey===e.vital.operation_key);if(!r)return;r.value.duration=k(r.value.startClocks.relative,n.relative),r.close(n.relative)}return}let i=t.getEntries(n.relative).find(t=>t.value.id===e.vital.id);if(i){i.value.duration=r,i.close(Fe(n.relative,r));return}t.add({id:e.vital.id,type:e.vital.type,operationKey:e.vital.operation_key,startClocks:n,duration:r,label:e.vital.name},n.relative).close(Fe(n.relative,r))}),t}function Gv(e,t){let n=e?.data?.attributes;if(!n||typeof n.admitted!=`boolean`||typeof n.reason!=`string`)return t;let r=n.reason===`backend_client_not_initialized`?`backend_unavailable`:n.reason;return{decision:n.admitted?`quota_ok`:`quota_ko`,reason:r}}function Kv(e,t){return Ye({proxy:e.proxy,site:e.site,path:`/api/v2/profiling/quota`,parameters:`session_id=${t}`,subdomain:`quota`})}function qv(e,t,n=5e3){let r=Kv(e,t),i=new AbortController,a,o=Zn(r,{credentials:`omit`,signal:i.signal,headers:new Headers({"DD-CLIENT-TOKEN":e.clientToken})}).then(e=>{let t=e.status===429?{decision:`quota_ko`,reason:`quota_exceeded`}:{decision:`quota_ok`,reason:`api-error`};return e.json().then(e=>(I(a),Gv(e,t)),()=>(I(a),t))}).catch(()=>(I(a),{decision:`quota_ok`,reason:`api-error`})),s=new Promise(e=>{a=F(()=>{i.abort(),e({decision:`quota_ok`,reason:`timeout`})},n)});return Promise.race([o,s])}function Jv(e){let t=new Map(di(e)?.map(e=>[e.url,e.id])),n=[];return e.forEach((e,r)=>{let i=t.get(e);i!==void 0&&n.push({resourceId:r,debugId:i})}),n.length?n:void 0}var Yv=t({DEFAULT_RUM_PROFILER_CONFIGURATION:()=>Xv,createRumProfiler:()=>Zv}),Xv={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3};function Zv(e,t,n,r,i,a,o=Xv){let s=xr()?P(kv)():P(Av)(e,t,i),c,l=[],u=P(Bv)(t),d=P(Hv)(t),f=P(Wv)(t),p={state:`stopped`,stateReason:`initializing`},m=0;t.subscribe(Y.SESSION_EXPIRED,()=>{v(`session-expired`)}),t.subscribe(Y.SESSION_RENEWED,()=>{if(p.state===`stopped`&&(p.stateReason===`session-expired`||p.stateReason===`quota_ko`)){let t=n.findTrackedSession();if(!t||!Ki(t.id,Wi(e.sessionSampleRate,e.profilingSampleRate)))return;h()}});function h(){if(p.state===`running`)return;let e=a.findView();c=e?{startClocks:e.startClocks,viewId:e.id,viewName:Nv(e.name,document.location.pathname)}:void 0,l.push(B(window,z.VISIBILITY_CHANGE,ie).stop,B(window,z.BEFORE_UNLOAD,ae).stop),b(),g()}function g(){if(xr())return;let t=++m,r=n.findTrackedSession()?.id;r&&P(qv)(e,r).then(e=>{t===m&&(p.state===`running`||p.state===`paused`)&&e.decision===`quota_ko`&&v(`quota_ko`,e.reason)}).catch(T)}function _(){v(`stopped-by-user`)}function v(e,t){ee(e),l.forEach(e=>e()),l.length=0,r.set({status:`stopped`,error_reason:void 0,quota_reason:t})}function y(e){if(e.state===`running`)return{cleanupTasks:e.cleanupTasks};let n=[],r=t.subscribe(Y.VIEW_CREATED,e=>{let t={viewId:e.id,viewName:Nv(e.name,document.location.pathname),startClocks:e.startClocks};ne(t),c=t});return n.push(r.unsubscribe),{cleanupTasks:n}}function b(){let e=C.Profiler;if(!e)throw r.set({status:`error`,error_reason:`not-supported-by-browser`}),Error(`RUM Profiler is not supported in this browser.`);p.state===`running`&&x(p);let{cleanupTasks:t}=y(p),i;try{i=new e({sampleInterval:o.sampleIntervalMs,maxBufferSize:Math.round(o.collectIntervalMs*1.5/o.sampleIntervalMs)})}catch(e){e instanceof Error&&e.message.includes(`disabled by Document Policy`)?(N.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",e),r.set({status:`error`,error_reason:`missing-document-policy-header`})):r.set({status:`error`,error_reason:`unexpected-exception`});return}r.set({status:`running`,error_reason:void 0}),p={state:`running`,startClocks:j(),profiler:i,timeoutId:F(b,o.collectIntervalMs),views:[],cleanupTasks:t,longTasks:[],sessionId:n.findTrackedSession()?.id},ne(c),i.addEventListener(`samplebufferfull`,re)}function x(e){I(e.timeoutId),e.profiler.removeEventListener(`samplebufferfull`,re);let{startClocks:t,views:n,sessionId:r}=e;e.profiler.stop().then(e=>{let i=j(),a=k(t.relative,i.relative),s=u.findAll(t.relative,a),c=d.findAll(t.relative,a),l=f.findAll(t.relative,a).map(e=>({id:e.id,label:e.label,startClocks:e.startClocks,duration:e.duration})),p=a<o.minProfileDurationMs;s.length===0&&p||S(Object.assign({},e,{startClocks:t,endClocks:i,clocksOrigin:Le(),longTasks:s,actions:c,vitals:l,views:n,sampleInterval:o.sampleIntervalMs,debugIds:Jv(e.resources)}),r)}).catch(T)}function ee(e){if(p.state!==`running`){(p.state===`paused`||p.state===`stopped`&&e===`stopped-by-user`)&&(p={state:`stopped`,stateReason:e});return}let t=p;p={state:`stopped`,stateReason:e},t.cleanupTasks.forEach(e=>e()),e===`quota_ko`?(I(t.timeoutId),t.profiler.removeEventListener(`samplebufferfull`,re),t.profiler.stop().catch(T)):x(t)}function te(){if(p.state!==`running`)return;let e=p;p={state:`paused`},e.cleanupTasks.forEach(e=>e()),x(e)}function ne(e){p.state===`running`&&e&&p.views.push(e)}function S(t,n){let r={profile:Pv(t,e,n),trace:t};s(r)}function re(){b()}function ie(){document.visibilityState===`hidden`&&p.state===`running`?te():document.visibilityState===`visible`&&p.state===`paused`&&b()}function ae(){b()}function oe(){return p.state===`stopped`}function se(){return p.state===`running`}function ce(){return p.state===`paused`}return{start:h,stop:_,isStopped:oe,isRunning:se,isPaused:ce}}export{i as a,c as i,Yh as n,Vh as r,Zh as t};