@openhands/agent-canvas 1.0.0-rc.9 → 1.0.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 (595) hide show
  1. package/README.md +46 -31
  2. package/README.windows.md +2 -2
  3. package/bin/agent-canvas.mjs +3 -1
  4. package/build/assets/Trans-CBypf0vt.js +1 -0
  5. package/build/assets/{acp-providers-Dzb4nxxB.js → acp-providers-BMyF5WII.js} +1 -1
  6. package/build/assets/active-backend-context-Cy_Ui5d7.js +1 -0
  7. package/build/assets/add-backend-modal-CUw7x0zm.js +1 -0
  8. package/build/assets/{agent-server-client-options-wXLeJYeM.js → agent-server-client-options-FoO1qgAQ.js} +1 -1
  9. package/build/assets/agent-server-conversation-service.api-D6Cmbnhd.js +5 -0
  10. package/build/assets/{agent-settings-Blipgztd.js → agent-settings-DW4vwOaz.js} +2 -2
  11. package/build/assets/{alert-banner-Bsvys-hT.js → alert-banner-BHmoArV2.js} +1 -1
  12. package/build/assets/{analytics-consent-form-modal-Cujm1lCj.js → analytics-consent-form-modal-BNK0yu4L.js} +1 -1
  13. package/build/assets/api-key-entry-screen-BjVajIjf.js +1 -0
  14. package/build/assets/app-settings-C-5X6RzZ.js +1 -0
  15. package/build/assets/automation-detail-uDMoYmAc.js +1 -0
  16. package/build/assets/automations-list-DBCKCbId.js +1 -0
  17. package/build/assets/{back-nav-button-D20Avel_.js → back-nav-button-Bckz5Wh6.js} +1 -1
  18. package/build/assets/backend-form-modal-D2-XqJA4.js +1 -0
  19. package/build/assets/{backend-synced-settings-badge-Da0G6Lwv.js → backend-synced-settings-badge-Dx16CR_k.js} +1 -1
  20. package/build/assets/{base-modal-DvuGYyu1.js → base-modal-7QRNzf6r.js} +1 -1
  21. package/build/assets/{brand-button-9SOzmqPP.js → brand-button-CKLvirxz.js} +1 -1
  22. package/build/assets/browser-D1ZybR7v.js +5 -0
  23. package/build/assets/browser-store-hzasvz9c.js +1 -0
  24. package/build/assets/{browser-tab-bveyJhG9.js → browser-tab-iOQjXzmI.js} +1 -1
  25. package/build/assets/chat-send-button-_Uc9iFpG.js +1 -0
  26. package/build/assets/check-DfvhVBub.js +1 -0
  27. package/build/assets/{checkmark--JWAesua.js → checkmark-BHPhb50L.js} +1 -1
  28. package/build/assets/{chevron-down-B9j6lcFg.js → chevron-down-CMkqyPEY.js} +1 -1
  29. package/build/assets/{circle-plus-check-toggle-AO9DWyDX.js → circle-plus-check-toggle-ChmnRlpR.js} +1 -1
  30. package/build/assets/{close--W-tHn1h.js → close-DBs90sI6.js} +1 -1
  31. package/build/assets/{code-tag-chmctf4w.js → code-tag-BtHOqHwB.js} +1 -1
  32. package/build/assets/{color-themes-0biOprdo.js → color-themes-CBikRn3w.js} +1 -1
  33. package/build/assets/{combobox-caret-C9BNHfSu.js → combobox-caret-evUAh6YW.js} +1 -1
  34. package/build/assets/{command-store-UzKGSUC2.js → command-store-DZfR8QtE.js} +1 -1
  35. package/build/assets/condenser-settings-0tw3yXX8.js +1 -0
  36. package/build/assets/{confirmation-modal-Cq3eqvqH.js → confirmation-modal-DWuxe1zG.js} +1 -1
  37. package/build/assets/{context-menu-list-item-BQU0jZPq.js → context-menu-list-item-BbHFxHaq.js} +1 -1
  38. package/build/assets/conversation-B1v96pQf.js +19 -0
  39. package/build/assets/conversation-DgfcjCPm.js +1 -0
  40. package/build/assets/{conversation-local-storage-an3MiIiJ.js → conversation-local-storage-Btum2xBJ.js} +1 -1
  41. package/build/assets/conversation-panel-TJ7swm6a.js +1 -0
  42. package/build/assets/conversation-service.api-DXawvmNN.js +1 -0
  43. package/build/assets/conversation-state-store-DmuPn875.js +1 -0
  44. package/build/assets/{conversation-store-FQmakEd-.js → conversation-store-Bu89Yxg1.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-C8tztloo.js → conversation-tab-empty-state-7js7FjYM.js} +1 -1
  46. package/build/assets/{copy-CdKN5rtJ.js → copy-B0SkXenR.js} +1 -1
  47. package/build/assets/copy-to-clipboard-button-CfH2EQz9.js +1 -0
  48. package/build/assets/{createLucideIcon-CkGTf9Qj.js → createLucideIcon-Bazr-V-B.js} +1 -1
  49. package/build/assets/declaration-Cn-NXHEy.js +1 -0
  50. package/build/assets/{device-verify-YuGXnpRk.js → device-verify-CWKyQ680.js} +1 -1
  51. package/build/assets/{dist-5dObF4p4.js → dist-Cbu6eGx8.js} +1 -1
  52. package/build/assets/dist-Dg2JWLGc.js +1 -0
  53. package/build/assets/{dropdown-classes-CVp0kVdt.js → dropdown-classes-BI1bI1ho.js} +1 -1
  54. package/build/assets/edit-automation-modal-DdAG6kFZ.js +1 -0
  55. package/build/assets/{ellipsis-button-k7HLwYth.js → ellipsis-button-DdCsOBHV.js} +1 -1
  56. package/build/assets/entry.client-DXyvKj5G.js +2 -0
  57. package/build/assets/{enum-filter-dropdown-COqUq3mB.js → enum-filter-dropdown-WROAIeys.js} +1 -1
  58. package/build/assets/{environment-switch-overlay-wB5LxfYZ.js → environment-switch-overlay-Dv0imPE6.js} +1 -1
  59. package/build/assets/{extensions-hub-BYCLWP3d.js → extensions-hub-CkyDPXvn.js} +1 -1
  60. package/build/assets/{extensions-navigation-3FLKfb6g.js → extensions-navigation-gMR-la1J.js} +1 -1
  61. package/build/assets/{external-link-BATfjnkz.js → external-link-FsutnU75.js} +1 -1
  62. package/build/assets/files-tab-DNUoveJZ.js +1 -0
  63. package/build/assets/files-tab-store-SyvkH3ic.js +1 -0
  64. package/build/assets/{folder-DPTBlxWb.js → folder-DusyBXDE.js} +1 -1
  65. package/build/assets/{globe-Dpgjreyy.js → globe-BUcin4kT.js} +1 -1
  66. package/build/assets/home-D809jWVS.js +1 -0
  67. package/build/assets/{iconBase-BVhFI-0E.js → iconBase-B6CXDDaE.js} +1 -1
  68. package/build/assets/index-redirect-nMYgOTBX.js +1 -0
  69. package/build/assets/install-server-modal-D92Qy57I.js +1 -0
  70. package/build/assets/{launch-CMZknx1e.js → launch-BnCG2g2a.js} +1 -1
  71. package/build/assets/lesson-plan-j-ZaE8vK.js +3 -0
  72. package/build/assets/{lightbulb-S616sGEL.js → lightbulb-BJ5tWmAh.js} +1 -1
  73. package/build/assets/{link-external-ooNztGLp.js → link-external-DUtmHAHi.js} +1 -1
  74. package/build/assets/{list-todo-nCa9zxVE.js → list-todo-C-gekh-4.js} +1 -1
  75. package/build/assets/{llm-client-D6EtdLBs.js → llm-client-BZUkZYlc.js} +1 -1
  76. package/build/assets/llm-not-configured-banner-PlvJ99rE.js +27 -0
  77. package/build/assets/llm-settings-Dgk32xRW.js +1 -0
  78. package/build/assets/llm-settings-Dxo7owKm.js +1 -0
  79. package/build/assets/llm-subscription-Bvu8BLXc.js +1 -0
  80. package/build/assets/llm-subscription-service-Bq6z3Wkv.js +1 -0
  81. package/build/assets/loader-circle-Cw7_q9hg.js +1 -0
  82. package/build/assets/{loading-spinner-D7bOU6I7.js → loading-spinner-RF3IlMF5.js} +1 -1
  83. package/build/assets/manage-backends-modal-BT66a6e0.js +1 -0
  84. package/build/assets/manifest-b8402d59.js +1 -0
  85. package/build/assets/markdown-renderer-Tw6FR2ad.js +2 -0
  86. package/build/assets/mcp-B_pA7vZg.js +9 -0
  87. package/build/assets/mcp-client-ppbYplKX.js +1 -0
  88. package/build/assets/messages-Cg9aNVi6.js +41 -0
  89. package/build/assets/{modal-backdrop-_VbcKk5K.js → modal-backdrop-DRpBVVW5.js} +1 -1
  90. package/build/assets/{modal-body-Cd-PtMHr.js → modal-body-CEV2O67p.js} +1 -1
  91. package/build/assets/{modal-classes-CNm4ovfm.js → modal-classes-B2DuQ9qD.js} +1 -1
  92. package/build/assets/{modal-close-button-Dbo0NAMt.js → modal-close-button-gtb7RHFB.js} +1 -1
  93. package/build/assets/model-selector-CAv3RrJ3.js +1 -0
  94. package/build/assets/{mouse-pointer-click-D0QNGSIo.js → mouse-pointer-click-B3i6HcaF.js} +1 -1
  95. package/build/assets/{navigation-context-BpAOh_t5.js → navigation-context-CM9JmTvm.js} +1 -1
  96. package/build/assets/{navigation-link-Dci7Nuyf.js → navigation-link-FmXzqR1J.js} +1 -1
  97. package/build/assets/onboarding-Q9CzuVWy.js +1 -0
  98. package/build/assets/{openhands-logo-Dzm-d_V_.js → openhands-logo-B4aEO2sf.js} +1 -1
  99. package/build/assets/option-service.api-C-s2BYZp.js +1 -0
  100. package/build/assets/organization-service.api-CXTKpFnV.js +1 -0
  101. package/build/assets/{path-utils-DKu3CNkH.js → path-utils-CE98fIFP.js} +1 -1
  102. package/build/assets/{pencil-DPEtl5QD.js → pencil-bWrxRWlr.js} +1 -1
  103. package/build/assets/{plan-components-CutRBi0G.js → plan-components-BF-X7vnQ.js} +1 -1
  104. package/build/assets/{planner-tab-YkOp7QXt.js → planner-tab-jkyaGiRc.js} +1 -1
  105. package/build/assets/plus-BTCK8WtR.js +1 -0
  106. package/build/assets/{profiles-client-BjUo3q05.js → profiles-client-CQ9L1yHR.js} +1 -1
  107. package/build/assets/providers-B3hkV58J.js +1 -0
  108. package/build/assets/proxy-BOcEWkCD.js +1 -0
  109. package/build/assets/{react-dom-hVBnwgwZ.js → react-dom-BBXlXOZX.js} +1 -1
  110. package/build/assets/{react-CM_dJw1Z.js → react-uQK8du1l.js} +1 -1
  111. package/build/assets/{react-Dy05vyj5.js → react-x84lbX6s.js} +1 -1
  112. package/build/assets/{recommended-automations-launcher-WxaZcjRD.js → recommended-automations-launcher-DMk35aFI.js} +11 -11
  113. package/build/assets/root-CV0kyxfP.js +2 -0
  114. package/build/assets/root-PB2Jnj61.css +1 -0
  115. package/build/assets/root-layout-Bl4Qzg5J.js +2 -0
  116. package/build/assets/{runtime-waiting-state-8i0Z3A_i.js → runtime-waiting-state-C1hJpXxl.js} +1 -1
  117. package/build/assets/sdk-section-page-DHbC2_j3.js +1 -0
  118. package/build/assets/sdk-settings-schema-z51bBmMl.js +1 -0
  119. package/build/assets/{search-C_l_XW4e.js → search-Dxm1MUMi.js} +1 -1
  120. package/build/assets/{secrets-service-Skzza9sx.js → secrets-service-DlScPUwy.js} +1 -1
  121. package/build/assets/secrets-settings-B97-JKBe.js +1 -0
  122. package/build/assets/settings-BpmooyBV.js +1 -0
  123. package/build/assets/{settings-dropdown-input-BP-arqjU.js → settings-dropdown-input-hIIAlmHb.js} +1 -1
  124. package/build/assets/{settings-gear-f-zWpxfI.js → settings-gear-DQLTCnFx.js} +1 -1
  125. package/build/assets/{settings-index-BLfmrKRl.js → settings-index-kKASonWk.js} +1 -1
  126. package/build/assets/{settings-input-BM8ANxDb.js → settings-input-BlOzCtP3.js} +1 -1
  127. package/build/assets/{settings-list-classes-B9uo5WES.js → settings-list-classes-BFRbCy4U.js} +1 -1
  128. package/build/assets/settings-modal-C4pZwj-l.js +1 -0
  129. package/build/assets/{settings-section-header-context-Cid25HM2.js → settings-section-header-context-iz4Go0dL.js} +1 -1
  130. package/build/assets/settings-service.api-DVLwi82B.js +1 -0
  131. package/build/assets/{settings-switch-xa6q4M6j.js → settings-switch-6cXIH-UE.js} +1 -1
  132. package/build/assets/{settings-utils--H_EvFjx.js → settings-utils-CfScEaPn.js} +1 -1
  133. package/build/assets/shared-conversation-CLkayApe.js +1 -0
  134. package/build/assets/sidebar-mobile-menu-toggle-C8uT4Mhd.js +1 -0
  135. package/build/assets/{sidebar-nav-link-BekRAssb.js → sidebar-nav-link-BKZiAQxQ.js} +1 -1
  136. package/build/assets/{skill-card-pill-row-DeodrwPG.js → skill-card-pill-row-D13WRKIE.js} +1 -1
  137. package/build/assets/{skills-BE5HJuGM.js → skills-NpRk6v79.js} +1 -1
  138. package/build/assets/{skills-client-CgraS-wA.js → skills-client-DsqwQEwj.js} +1 -1
  139. package/build/assets/{skills-plugins-rIza_fUf.js → skills-plugins-bkwxItAw.js} +1 -1
  140. package/build/assets/{skills-settings-Dvl7gpEx.js → skills-settings-DMbrlB2b.js} +2 -2
  141. package/build/assets/{square-chevron-right-BWAB7NPp.js → square-chevron-right-DxZKcVq4.js} +1 -1
  142. package/build/assets/{styled-tooltip-X61SEwqk.js → styled-tooltip-DG1ofAcS.js} +1 -1
  143. package/build/assets/suspense-sOGeme-f.js +1 -0
  144. package/build/assets/{switch-skeleton-BbIWemkK.js → switch-skeleton-CZ6XCVZk.js} +1 -1
  145. package/build/assets/{task-list-tab-BFnyHGsn.js → task-list-tab-CddMPNCD.js} +1 -1
  146. package/build/assets/telemetry-CX4mTZUw.js +2 -0
  147. package/build/assets/{terminal-BFypysgZ.js → terminal-BOAVxAej.js} +1 -1
  148. package/build/assets/{terminal-B92mACR5.js → terminal-DbtwHqt4.js} +1 -1
  149. package/build/assets/{toggle-switch-CL_wRiGs.js → toggle-switch-C0t6ge2m.js} +1 -1
  150. package/build/assets/{trash-2-C-RvV8WA.js → trash-2-Dmprz0A0.js} +1 -1
  151. package/build/assets/{typography-BLSEGjph.js → typography-CNHbO1eE.js} +1 -1
  152. package/build/assets/{u-check-circle-dG_VJqx5.js → u-check-circle-CX66WzfT.js} +1 -1
  153. package/build/assets/{u-check-circle-half-D-5ZPRnd.js → u-check-circle-half-Bj853Ub0.js} +1 -1
  154. package/build/assets/{u-circuit-BXoisXOA.js → u-circuit-B9bLCP7N.js} +1 -1
  155. package/build/assets/{u-edit-DIgADxLH.js → u-edit-D7JyvoWm.js} +1 -1
  156. package/build/assets/use-acp-credential-form-Cj_oUYd5.js +1 -0
  157. package/build/assets/{use-active-conversation-BkohEtaN.js → use-active-conversation-B64-yy2X.js} +1 -1
  158. package/build/assets/use-agent-settings-schema-BzbQYEzb.js +1 -0
  159. package/build/assets/{use-agent-state-DITv5qV7.js → use-agent-state-DxFk391r.js} +1 -1
  160. package/build/assets/{use-breakpoint-DpxHDmuH.js → use-breakpoint-Cent5lpI.js} +1 -1
  161. package/build/assets/{use-click-outside-element-DhxCUyWl.js → use-click-outside-element-DOYR26nw.js} +1 -1
  162. package/build/assets/{use-cloud-current-user-id-CSm3kgqy.js → use-cloud-current-user-id-BVf7pb8n.js} +1 -1
  163. package/build/assets/use-config-CvdJUq4E.js +1 -0
  164. package/build/assets/use-create-conversation-Cnouynop.js +1 -0
  165. package/build/assets/{use-create-secret-LObNBU3M.js → use-create-secret-Cgu4uxyr.js} +1 -1
  166. package/build/assets/{use-event-store-DNSmyzUh.js → use-event-store-Nv92IYMU.js} +1 -1
  167. package/build/assets/use-handle-plan-click-C7824bbe.js +1 -0
  168. package/build/assets/use-is-authed-mnJtd2bw.js +1 -0
  169. package/build/assets/{use-launch-skill-in-chat-BTgXIu3N.js → use-launch-skill-in-chat-NDUo_UCA.js} +1 -1
  170. package/build/assets/use-llm-profiles-9eH3Y3Ef.js +1 -0
  171. package/build/assets/use-runtime-is-ready-DEnxJH7W.js +1 -0
  172. package/build/assets/use-save-settings-DrClHnX7.js +1 -0
  173. package/build/assets/use-settings-BNAoCX93.js +1 -0
  174. package/build/assets/{use-settings-nav-items-ykMjd_NG.js → use-settings-nav-items-CLIW2p2n.js} +2 -2
  175. package/build/assets/{use-skills-_unimM2d.js → use-skills-B9gOHrOj.js} +1 -1
  176. package/build/assets/{use-task-list-E5t-jtgs.js → use-task-list-DLKPnq3I.js} +1 -1
  177. package/build/assets/{use-tracking-C9P88zSo.js → use-tracking-Dph_dRlL.js} +1 -1
  178. package/build/assets/{use-user-conversation-2jZZ-MLA.js → use-user-conversation-leIsQH1B.js} +1 -1
  179. package/build/assets/useMutation-cXADjWAv.js +1 -0
  180. package/build/assets/useQuery-BQr6A6ry.js +1 -0
  181. package/build/assets/useTranslation-Bp1btAjp.js +1 -0
  182. package/build/assets/{utils-eXk6yerZ.js → utils-o-OXNtEy.js} +1 -1
  183. package/build/assets/v4-DOSjXdIn.js +1 -0
  184. package/build/assets/{vendor~browser-tab-BGJDGHyS.js → vendor~browser-tab-642bOcE1.js} +1 -1
  185. package/build/assets/{vendor~conversation-panel~conversation-D98u43rl.js → vendor~conversation-panel~conversation-DqmbnXRn.js} +1 -1
  186. package/build/assets/{vendor~conversation-panel~conversation~alert-banner-CtjHOMO_.js → vendor~conversation-panel~conversation~alert-banner-CSDVP1nw.js} +1 -1
  187. package/build/assets/{vendor~conversation-panel~conversation~index-BXt2-3Cc.js → vendor~conversation-panel~conversation~index-DITarr3F.js} +1 -1
  188. package/build/assets/{vendor~entry.client-DrAdOKqA.js → vendor~entry.client-CQ77DucR.js} +1 -1
  189. package/build/assets/{vendor~entry.client-EcEhmoJW.js → vendor~entry.client-ePAFmSwg.js} +1 -1
  190. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~f0pn7nss-DUk-MwlC.js +177 -0
  191. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~lb3qbbk3-BvmOva8I.js +1 -0
  192. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-Cl4h-NSi.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BkQQxq_q.js} +1 -1
  193. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-8xF3WeB9.js} +1 -1
  194. package/build/assets/{vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js → vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~nyk4vv4g-UzR6fe3Y.js} +1 -1
  195. package/build/assets/{vendor~files-tab--640YzQO.js → vendor~files-tab-Cko7Kr5k.js} +1 -1
  196. package/build/assets/{vendor~home~conversation-panel~conversation-dhKA2JVJ.js → vendor~home~conversation-panel~conversation-D3otw5Jn.js} +1 -1
  197. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DMOoHVBy.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CMdKUYP2.js} +1 -1
  198. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BoE6JRJj.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DSR6Mugx.js} +1 -1
  199. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dqpi2xyZ.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DdOzMvB1.js} +1 -1
  200. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DX2CmDJ0.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dj2eezvL.js} +1 -1
  201. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BNExlCqT.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DyN8jeZz.js} +1 -1
  202. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DCn1M97v.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-lpEWrbMA.js} +1 -1
  203. package/build/assets/{vendor~launch-C0VvUe2W.js → vendor~launch-DoYO54df.js} +1 -1
  204. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-COLUW-6M.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-BGwU2SbU.js} +1 -1
  205. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js → vendor~root-layout~home~conversation-panel~conversation-Iqs0j4Wo.js} +1 -1
  206. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-7eqKdLSQ.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BdS6bbw9.js} +1 -1
  207. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BP3MGAAY.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Fd3F3jth.js} +1 -1
  208. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Dkd2wxJA.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Cg0AqwMN.js} +2 -2
  209. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-BlsbqRyZ.js} +1 -1
  210. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~ec6pk3ix-CBICqfKC.js +48 -0
  211. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DavKsAvB.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~nv6afr11-BYNoKMU0.js} +97 -69
  212. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BspUuSsP.js} +1 -1
  213. package/build/assets/{vendor~root-layout~home~mcp~automations-list-D40jgugf.js → vendor~root-layout~home~mcp~automations-list-C9U_eOqU.js} +1 -1
  214. package/build/assets/{vendor~root-layout~home~mcp~automations-list-cNHi83v_.js → vendor~root-layout~home~mcp~automations-list-DhQ3LPVw.js} +1 -1
  215. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-xCM3k6Rd.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BEbhHQYg.js} +1 -1
  216. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-DdgDNzMc.js} +2 -2
  217. package/build/assets/{verification-settings-EUkt_CkZ.js → verification-settings-D7R-Ne6L.js} +1 -1
  218. package/build/assets/x-DCZg87p7.js +1 -0
  219. package/build/assets/{x-mark-C42svtnu.js → x-mark-jrBTJbnP.js} +1 -1
  220. package/build/index.html +4 -4
  221. package/build/locales/ar/openhands.json +22 -0
  222. package/build/locales/ca/openhands.json +22 -0
  223. package/build/locales/de/openhands.json +22 -0
  224. package/build/locales/en/openhands.json +22 -0
  225. package/build/locales/es/openhands.json +22 -0
  226. package/build/locales/fr/openhands.json +22 -0
  227. package/build/locales/it/openhands.json +22 -0
  228. package/build/locales/ja/openhands.json +22 -0
  229. package/build/locales/ko-KR/openhands.json +22 -0
  230. package/build/locales/no/openhands.json +22 -0
  231. package/build/locales/pt/openhands.json +22 -0
  232. package/build/locales/tr/openhands.json +22 -0
  233. package/build/locales/uk/openhands.json +22 -0
  234. package/build/locales/zh-CN/openhands.json +22 -0
  235. package/build/locales/zh-TW/openhands.json +22 -0
  236. package/config/defaults.json +4 -2
  237. package/dist/api/agent-server-adapter.cjs +3 -3
  238. package/dist/api/agent-server-adapter.cjs.map +1 -1
  239. package/dist/api/agent-server-adapter.d.ts +8 -0
  240. package/dist/api/agent-server-adapter.js +82 -80
  241. package/dist/api/agent-server-adapter.js.map +1 -1
  242. package/dist/api/agent-server-compatibility.cjs +1 -1
  243. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  244. package/dist/api/agent-server-compatibility.d.ts +10 -0
  245. package/dist/api/agent-server-compatibility.js +69 -25
  246. package/dist/api/agent-server-compatibility.js.map +1 -1
  247. package/dist/api/backend-registry/default-backend.cjs +1 -1
  248. package/dist/api/backend-registry/default-backend.cjs.map +1 -1
  249. package/dist/api/backend-registry/default-backend.d.ts +6 -5
  250. package/dist/api/backend-registry/default-backend.js +1 -1
  251. package/dist/api/backend-registry/default-backend.js.map +1 -1
  252. package/dist/api/backend-registry/storage.cjs +1 -1
  253. package/dist/api/backend-registry/storage.cjs.map +1 -1
  254. package/dist/api/backend-registry/storage.js +38 -68
  255. package/dist/api/backend-registry/storage.js.map +1 -1
  256. package/dist/api/cloud/proxy.cjs +1 -1
  257. package/dist/api/cloud/proxy.cjs.map +1 -1
  258. package/dist/api/cloud/proxy.d.ts +3 -16
  259. package/dist/api/cloud/proxy.js +1 -1
  260. package/dist/api/cloud/proxy.js.map +1 -1
  261. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  262. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  263. package/dist/api/conversation-service/agent-server-conversation-service.api.js +75 -75
  264. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  265. package/dist/api/llm-subscription-service.cjs +2 -0
  266. package/dist/api/llm-subscription-service.cjs.map +1 -0
  267. package/dist/api/llm-subscription-service.d.ts +23 -0
  268. package/dist/api/llm-subscription-service.js +109 -0
  269. package/dist/api/llm-subscription-service.js.map +1 -0
  270. package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
  271. package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
  272. package/dist/api/mcp-service/mcp-service.api.d.ts +2 -3
  273. package/dist/api/mcp-service/mcp-service.api.js +38 -13
  274. package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
  275. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  276. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  277. package/dist/api/settings-service/settings-service.api.js +41 -42
  278. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  279. package/dist/components/conversation-events/chat/messages.cjs +1 -1
  280. package/dist/components/conversation-events/chat/messages.cjs.map +1 -1
  281. package/dist/components/conversation-events/chat/messages.js +4 -4
  282. package/dist/components/conversation-events/chat/messages.js.map +1 -1
  283. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  284. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  285. package/dist/components/features/backends/backend-form-modal.js +136 -135
  286. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  287. package/dist/components/features/backends/backend-selector.cjs +1 -1
  288. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  289. package/dist/components/features/backends/backend-selector.js +103 -91
  290. package/dist/components/features/backends/backend-selector.js.map +1 -1
  291. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  292. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  293. package/dist/components/features/backends/manage-backends-modal.js +14 -8
  294. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  295. package/dist/components/features/chat/path-component.cjs +1 -1
  296. package/dist/components/features/chat/path-component.cjs.map +1 -1
  297. package/dist/components/features/chat/path-component.js +1 -1
  298. package/dist/components/features/chat/path-component.js.map +1 -1
  299. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs +1 -1
  300. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs.map +1 -1
  301. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js +77 -66
  302. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js.map +1 -1
  303. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  304. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  305. package/dist/components/features/mcp-page/custom-server-editor.js +1 -0
  306. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  307. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  308. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  309. package/dist/components/features/mcp-page/install-server-modal.js +73 -46
  310. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  311. package/dist/components/features/mcp-page/marketplace-card.cjs +1 -1
  312. package/dist/components/features/mcp-page/marketplace-card.cjs.map +1 -1
  313. package/dist/components/features/mcp-page/marketplace-card.js +6 -2
  314. package/dist/components/features/mcp-page/marketplace-card.js.map +1 -1
  315. package/dist/components/features/settings/brand-button.cjs +1 -1
  316. package/dist/components/features/settings/brand-button.cjs.map +1 -1
  317. package/dist/components/features/settings/brand-button.js +1 -1
  318. package/dist/components/features/settings/brand-button.js.map +1 -1
  319. package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.cjs +2 -0
  320. package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.cjs.map +1 -0
  321. package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.d.ts +5 -0
  322. package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.js +167 -0
  323. package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.js.map +1 -0
  324. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  325. package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
  326. package/dist/components/shared/modals/settings/model-selector.d.ts +1 -2
  327. package/dist/components/shared/modals/settings/model-selector.js +59 -65
  328. package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
  329. package/dist/components/shared/modals/settings/settings-form.cjs +1 -1
  330. package/dist/components/shared/modals/settings/settings-form.cjs.map +1 -1
  331. package/dist/components/shared/modals/settings/settings-form.js +1 -2
  332. package/dist/components/shared/modals/settings/settings-form.js.map +1 -1
  333. package/dist/config/defaults.cjs +2 -0
  334. package/dist/config/defaults.cjs.map +1 -0
  335. package/dist/config/defaults.js +35 -0
  336. package/dist/config/defaults.js.map +1 -0
  337. package/dist/constants/llm-subscription.cjs +2 -0
  338. package/dist/constants/llm-subscription.cjs.map +1 -0
  339. package/dist/constants/llm-subscription.d.ts +16 -0
  340. package/dist/constants/llm-subscription.js +47 -0
  341. package/dist/constants/llm-subscription.js.map +1 -0
  342. package/dist/contexts/conversation-websocket-context.cjs +1 -1
  343. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  344. package/dist/contexts/conversation-websocket-context.js +1 -1
  345. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  346. package/dist/hooks/mutation/use-llm-subscription-auth.cjs +2 -0
  347. package/dist/hooks/mutation/use-llm-subscription-auth.cjs.map +1 -0
  348. package/dist/hooks/mutation/use-llm-subscription-auth.d.ts +3 -0
  349. package/dist/hooks/mutation/use-llm-subscription-auth.js +30 -0
  350. package/dist/hooks/mutation/use-llm-subscription-auth.js.map +1 -0
  351. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs +1 -1
  352. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs.map +1 -1
  353. package/dist/hooks/mutation/use-save-fields-as-secrets.d.ts +8 -6
  354. package/dist/hooks/mutation/use-save-fields-as-secrets.js +1 -1
  355. package/dist/hooks/mutation/use-save-fields-as-secrets.js.map +1 -1
  356. package/dist/hooks/mutation/use-test-mcp-server.d.ts +1 -1
  357. package/dist/hooks/query/query-keys.cjs +1 -1
  358. package/dist/hooks/query/query-keys.cjs.map +1 -1
  359. package/dist/hooks/query/query-keys.d.ts +5 -0
  360. package/dist/hooks/query/query-keys.js +14 -2
  361. package/dist/hooks/query/query-keys.js.map +1 -1
  362. package/dist/hooks/query/use-agent-settings-schema.cjs +1 -1
  363. package/dist/hooks/query/use-agent-settings-schema.cjs.map +1 -1
  364. package/dist/hooks/query/use-agent-settings-schema.d.ts +2 -2
  365. package/dist/hooks/query/use-agent-settings-schema.js +21 -19
  366. package/dist/hooks/query/use-agent-settings-schema.js.map +1 -1
  367. package/dist/hooks/query/use-backends-health.cjs +1 -1
  368. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  369. package/dist/hooks/query/use-backends-health.js +38 -36
  370. package/dist/hooks/query/use-backends-health.js.map +1 -1
  371. package/dist/hooks/query/use-llm-subscription-models.cjs +2 -0
  372. package/dist/hooks/query/use-llm-subscription-models.cjs.map +1 -0
  373. package/dist/hooks/query/use-llm-subscription-models.d.ts +3 -0
  374. package/dist/hooks/query/use-llm-subscription-models.js +19 -0
  375. package/dist/hooks/query/use-llm-subscription-models.js.map +1 -0
  376. package/dist/hooks/query/use-llm-subscription-status.cjs +2 -0
  377. package/dist/hooks/query/use-llm-subscription-status.cjs.map +1 -0
  378. package/dist/hooks/query/use-llm-subscription-status.d.ts +3 -0
  379. package/dist/hooks/query/use-llm-subscription-status.js +19 -0
  380. package/dist/hooks/query/use-llm-subscription-status.js.map +1 -0
  381. package/dist/hooks/use-websocket.cjs +1 -1
  382. package/dist/hooks/use-websocket.cjs.map +1 -1
  383. package/dist/hooks/use-websocket.d.ts +0 -1
  384. package/dist/hooks/use-websocket.js +37 -38
  385. package/dist/hooks/use-websocket.js.map +1 -1
  386. package/dist/i18n/declaration.cjs +1 -1
  387. package/dist/i18n/declaration.cjs.map +1 -1
  388. package/dist/i18n/declaration.d.ts +22 -0
  389. package/dist/i18n/declaration.js +1 -1
  390. package/dist/i18n/declaration.js.map +1 -1
  391. package/dist/i18n/translation.cjs +2 -2
  392. package/dist/i18n/translation.cjs.map +1 -1
  393. package/dist/i18n/translation.js +374 -0
  394. package/dist/i18n/translation.js.map +1 -1
  395. package/dist/locales/ar/openhands.json +22 -0
  396. package/dist/locales/ca/openhands.json +22 -0
  397. package/dist/locales/de/openhands.json +22 -0
  398. package/dist/locales/en/openhands.json +22 -0
  399. package/dist/locales/es/openhands.json +22 -0
  400. package/dist/locales/fr/openhands.json +22 -0
  401. package/dist/locales/it/openhands.json +22 -0
  402. package/dist/locales/ja/openhands.json +22 -0
  403. package/dist/locales/ko-KR/openhands.json +22 -0
  404. package/dist/locales/no/openhands.json +22 -0
  405. package/dist/locales/pt/openhands.json +22 -0
  406. package/dist/locales/tr/openhands.json +22 -0
  407. package/dist/locales/uk/openhands.json +22 -0
  408. package/dist/locales/zh-CN/openhands.json +22 -0
  409. package/dist/locales/zh-TW/openhands.json +22 -0
  410. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +1 -1
  411. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -1
  412. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +10 -22
  413. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -1
  414. package/dist/node_modules/@openhands/extensions/skills/index.cjs +97 -69
  415. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  416. package/dist/node_modules/@openhands/extensions/skills/index.js +3 -3
  417. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  418. package/dist/package.cjs +1 -1
  419. package/dist/package.cjs.map +1 -1
  420. package/dist/package.js +3 -5
  421. package/dist/package.js.map +1 -1
  422. package/dist/routes/files-tab.cjs +1 -1
  423. package/dist/routes/files-tab.cjs.map +1 -1
  424. package/dist/routes/files-tab.js +28 -17
  425. package/dist/routes/files-tab.js.map +1 -1
  426. package/dist/routes/llm-settings.cjs +1 -1
  427. package/dist/routes/llm-settings.cjs.map +1 -1
  428. package/dist/routes/llm-settings.js +142 -85
  429. package/dist/routes/llm-settings.js.map +1 -1
  430. package/dist/services/canvas-ui.cjs +1 -1
  431. package/dist/services/canvas-ui.cjs.map +1 -1
  432. package/dist/services/canvas-ui.d.ts +1 -1
  433. package/dist/services/canvas-ui.js +2 -2
  434. package/dist/services/canvas-ui.js.map +1 -1
  435. package/dist/stores/files-tab-store.cjs +1 -1
  436. package/dist/stores/files-tab-store.cjs.map +1 -1
  437. package/dist/stores/files-tab-store.d.ts +2 -1
  438. package/dist/stores/files-tab-store.js +5 -1
  439. package/dist/stores/files-tab-store.js.map +1 -1
  440. package/dist/stores/use-event-store.cjs +1 -1
  441. package/dist/stores/use-event-store.cjs.map +1 -1
  442. package/dist/stores/use-event-store.js +39 -34
  443. package/dist/stores/use-event-store.js.map +1 -1
  444. package/dist/types/mcp-server.d.ts +21 -0
  445. package/dist/ui/dropdown/dropdown.cjs +1 -1
  446. package/dist/ui/dropdown/dropdown.cjs.map +1 -1
  447. package/dist/ui/dropdown/dropdown.js +6 -2
  448. package/dist/ui/dropdown/dropdown.js.map +1 -1
  449. package/dist/utils/handle-event-for-ui.cjs +1 -1
  450. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  451. package/dist/utils/handle-event-for-ui.d.ts +2 -0
  452. package/dist/utils/handle-event-for-ui.js +1 -1
  453. package/dist/utils/handle-event-for-ui.js.map +1 -1
  454. package/dist/utils/llm-subscription-schema.cjs +2 -0
  455. package/dist/utils/llm-subscription-schema.cjs.map +1 -0
  456. package/dist/utils/llm-subscription-schema.d.ts +2 -0
  457. package/dist/utils/llm-subscription-schema.js +22 -0
  458. package/dist/utils/llm-subscription-schema.js.map +1 -0
  459. package/dist/utils/mcp-config.cjs +1 -1
  460. package/dist/utils/mcp-config.cjs.map +1 -1
  461. package/dist/utils/mcp-config.js +32 -17
  462. package/dist/utils/mcp-config.js.map +1 -1
  463. package/dist/utils/mcp-credential-validation.cjs +2 -0
  464. package/dist/utils/mcp-credential-validation.cjs.map +1 -0
  465. package/dist/utils/mcp-credential-validation.d.ts +22 -0
  466. package/dist/utils/mcp-credential-validation.js +31 -0
  467. package/dist/utils/mcp-credential-validation.js.map +1 -0
  468. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  469. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  470. package/dist/utils/mcp-marketplace-utils.d.ts +7 -2
  471. package/dist/utils/mcp-marketplace-utils.js +33 -48
  472. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  473. package/dist/utils/sdk-settings-schema.cjs +1 -1
  474. package/dist/utils/sdk-settings-schema.cjs.map +1 -1
  475. package/dist/utils/sdk-settings-schema.js +64 -61
  476. package/dist/utils/sdk-settings-schema.js.map +1 -1
  477. package/package.json +3 -5
  478. package/scripts/check-sdk-version-sync.mjs +9 -27
  479. package/scripts/dev-with-automation.mjs +1 -3
  480. package/scripts/docker-build.mjs +0 -4
  481. package/scripts/run-staged-typecheck.mjs +44 -0
  482. package/build/assets/QueryClientProvider-XcSjsfpb.js +0 -1
  483. package/build/assets/Trans-sy4l4TyQ.js +0 -1
  484. package/build/assets/active-backend-context-B2OSC-qe.js +0 -1
  485. package/build/assets/add-backend-modal-lG8XDYjr.js +0 -1
  486. package/build/assets/agent-server-adapter-BPpZcLOE.js +0 -5
  487. package/build/assets/agent-server-conversation-service.api-C4Fc9Jnp.js +0 -1
  488. package/build/assets/api-key-entry-screen-BarZU9nr.js +0 -1
  489. package/build/assets/app-settings-CofRfixq.js +0 -1
  490. package/build/assets/automation-detail-BV4Cn0O8.js +0 -1
  491. package/build/assets/automations-list-BaJ61q7P.js +0 -1
  492. package/build/assets/backend-form-modal-B3BCZDPq.js +0 -1
  493. package/build/assets/browser-store-JRrcGdlk.js +0 -1
  494. package/build/assets/browser-wz8UzRmF.js +0 -5
  495. package/build/assets/chat-send-button-DzRpAQr4.js +0 -1
  496. package/build/assets/check-BhnsMsWy.js +0 -1
  497. package/build/assets/condenser-settings-Bo07FAEi.js +0 -1
  498. package/build/assets/context-CI9FqkUp.js +0 -1
  499. package/build/assets/conversation-DDdRyW4z.js +0 -19
  500. package/build/assets/conversation-panel-Dww2uJOd.js +0 -1
  501. package/build/assets/conversation-rGQV1Eym.js +0 -1
  502. package/build/assets/conversation-service.api-ByRiRU1e.js +0 -1
  503. package/build/assets/conversation-state-store-NEktJKfL.js +0 -1
  504. package/build/assets/declaration-D9ucT0fq.js +0 -1
  505. package/build/assets/dist-BCpEDEJq.js +0 -1
  506. package/build/assets/edit-automation-modal-CpA_JKLY.js +0 -1
  507. package/build/assets/entry.client-DUpefbBp.js +0 -2
  508. package/build/assets/files-tab-CBUPwSV1.js +0 -1
  509. package/build/assets/files-tab-store-DSKUhziI.js +0 -1
  510. package/build/assets/home-BDCL0Psk.js +0 -1
  511. package/build/assets/index-redirect-BQ_55qN6.js +0 -1
  512. package/build/assets/install-server-modal-CWZhBKwH.js +0 -1
  513. package/build/assets/lesson-plan-y520IDs6.js +0 -3
  514. package/build/assets/llm-not-configured-banner-CJyURBCm.js +0 -27
  515. package/build/assets/llm-settings-BW6yW2Go.js +0 -1
  516. package/build/assets/llm-settings-CiY22Wzi.js +0 -1
  517. package/build/assets/loader-circle-1XB9nbwF.js +0 -1
  518. package/build/assets/manage-backends-modal-v5POMal5.js +0 -1
  519. package/build/assets/manifest-eccb7f46.js +0 -1
  520. package/build/assets/markdown-renderer-z446oW0Z.js +0 -2
  521. package/build/assets/mcp-DgPFZ_Dv.js +0 -9
  522. package/build/assets/mcp-settings-redirect-l3Zbmc0F.js +0 -1
  523. package/build/assets/messages-Dq6AQ8mp.js +0 -41
  524. package/build/assets/model-selector-CdZs21EZ.js +0 -1
  525. package/build/assets/onboarding-Cdwu8QIy.js +0 -1
  526. package/build/assets/option-service.api-CdYnKVsu.js +0 -1
  527. package/build/assets/organization-service.api-CzMvXIQT.js +0 -1
  528. package/build/assets/plus-DKUID4kd.js +0 -1
  529. package/build/assets/providers-CbpQft-X.js +0 -1
  530. package/build/assets/proxy-Bx3NeKeo.js +0 -1
  531. package/build/assets/query-client-config-Ca3tW1AH.js +0 -1
  532. package/build/assets/root-CRkz_h2T.css +0 -1
  533. package/build/assets/root-CiNoOVrb.js +0 -2
  534. package/build/assets/root-layout-DUw-s9LS.js +0 -2
  535. package/build/assets/sdk-section-page-DPBwwLle.js +0 -1
  536. package/build/assets/sdk-settings-schema-Big50zDH.js +0 -1
  537. package/build/assets/secrets-settings-DmpsTC9V.js +0 -1
  538. package/build/assets/settings-ChsRtIJQ.js +0 -1
  539. package/build/assets/settings-modal-Cth7Zb-I.js +0 -1
  540. package/build/assets/settings-service.api-CcpckquT.js +0 -1
  541. package/build/assets/shared-conversation-Y0C8zqdr.js +0 -1
  542. package/build/assets/sidebar-mobile-menu-toggle-BvcBXvLY.js +0 -1
  543. package/build/assets/suspense-Bqb0V0q1.js +0 -1
  544. package/build/assets/telemetry-CAWBJ_rB.js +0 -2
  545. package/build/assets/use-acp-credential-form-Dj7Jkhgp.js +0 -1
  546. package/build/assets/use-agent-settings-schema-Lf_lBAky.js +0 -1
  547. package/build/assets/use-config-DVU9HaPf.js +0 -1
  548. package/build/assets/use-create-conversation-CJUAOf1q.js +0 -1
  549. package/build/assets/use-handle-plan-click-BdcdMWbv.js +0 -1
  550. package/build/assets/use-is-authed-B8eLO-Xq.js +0 -1
  551. package/build/assets/use-llm-profiles-BBTR-OsK.js +0 -1
  552. package/build/assets/use-runtime-is-ready-BOQpqCvp.js +0 -1
  553. package/build/assets/use-save-settings-7_MLft-Y.js +0 -1
  554. package/build/assets/use-settings-CNsxccvQ.js +0 -1
  555. package/build/assets/useMutation-Dm84WAKR.js +0 -1
  556. package/build/assets/useQuery-DGRSm7IT.js +0 -1
  557. package/build/assets/useTranslation-CL6FTf1b.js +0 -1
  558. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js +0 -1
  559. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js +0 -177
  560. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-DQE89epK.js +0 -48
  561. package/build/assets/x-CCfDppg5.js +0 -1
  562. package/dist/api/settings-service/legacy-app-preferences-migration.cjs +0 -2
  563. package/dist/api/settings-service/legacy-app-preferences-migration.cjs.map +0 -1
  564. package/dist/api/settings-service/legacy-app-preferences-migration.d.ts +0 -34
  565. package/dist/api/settings-service/legacy-app-preferences-migration.js +0 -52
  566. package/dist/api/settings-service/legacy-app-preferences-migration.js.map +0 -1
  567. package/dist/hooks/query/use-openhands-verified-models.cjs +0 -2
  568. package/dist/hooks/query/use-openhands-verified-models.cjs.map +0 -1
  569. package/dist/hooks/query/use-openhands-verified-models.d.ts +0 -1
  570. package/dist/hooks/query/use-openhands-verified-models.js +0 -14
  571. package/dist/hooks/query/use-openhands-verified-models.js.map +0 -1
  572. package/dist/utils/normalize-display-model.cjs +0 -2
  573. package/dist/utils/normalize-display-model.cjs.map +0 -1
  574. package/dist/utils/normalize-display-model.d.ts +0 -9
  575. package/dist/utils/normalize-display-model.js +0 -13
  576. package/dist/utils/normalize-display-model.js.map +0 -1
  577. package/dist/utils/openhands-llm.cjs +0 -2
  578. package/dist/utils/openhands-llm.cjs.map +0 -1
  579. package/dist/utils/openhands-llm.d.ts +0 -15
  580. package/dist/utils/openhands-llm.js +0 -15
  581. package/dist/utils/openhands-llm.js.map +0 -1
  582. /package/build/assets/{agent-server-ui-style-scope-BwIZYdC1.js → agent-server-ui-style-scope-1MuaCC1k.js} +0 -0
  583. /package/build/assets/{common-Dh7OqABE.js → common-DqjLSBOt.js} +0 -0
  584. /package/build/assets/{environment-switch-store-CiurvTtK.js → environment-switch-store-CBXkf5bS.js} +0 -0
  585. /package/build/assets/{extension-module-card-classes-DP5J6ngE.js → extension-module-card-classes-CVGfXtoL.js} +0 -0
  586. /package/build/assets/{git-status-mapper-BI8FyUVp.js → git-status-mapper-DVFXF1_X.js} +0 -0
  587. /package/build/assets/{handle-capture-consent-CPMXU29K.js → handle-capture-consent-BTvatyfE.js} +0 -0
  588. /package/build/assets/{map-provider-BM2SJarp.js → map-provider-COgsZR9p.js} +0 -0
  589. /package/build/assets/{objectWithoutPropertiesLoose-DSQKyRhw.js → objectWithoutPropertiesLoose-B80nTzVc.js} +0 -0
  590. /package/build/assets/{preload-helper-CT1Z6Pdu.js → preload-helper-D_sPnjeL.js} +0 -0
  591. /package/build/assets/{rolldown-runtime-BFRubm34.js → rolldown-runtime-wFmyQBCi.js} +0 -0
  592. /package/build/assets/{sdk-settings-field-metadata-p2GVlft7.js → sdk-settings-field-metadata-Cc4D-ut7.js} +0 -0
  593. /package/build/assets/{settings-wh2sLLJM.js → settings-1287uR2J.js} +0 -0
  594. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~cg1m3bv7-aUIHudsf.js} +0 -0
  595. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-BmZcy_kH.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DPPGSgT1.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-BFRubm34.js";var t=e({Compression:()=>hi,DisplaySurveyType:()=>ci,PostHog:()=>Ha,ProductTourEventName:()=>li,ProductTourEventProperties:()=>ui,SurveyEventName:()=>oi,SurveyEventProperties:()=>si,SurveyEventType:()=>ii,SurveyType:()=>ai,default:()=>Cs,posthog:()=>Cs}),n=typeof window<`u`?window:void 0,r=typeof globalThis<`u`?globalThis:n;typeof self>`u`&&(r.self=r),typeof File>`u`&&(r.File=function(){});var i=r?.navigator,a=r?.document,o=r?.location,s=r?.fetch,c=r!=null&&r.XMLHttpRequest&&`withCredentials`in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,l=r?.AbortController,u=r?.CompressionStream,d=i?.userAgent,f=n??{},p=`1.372.6`,m={DEBUG:!1,LIB_VERSION:p,LIB_NAME:`web`,JS_SDK_VERSION:p};function h(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){h(a,r,i,o,s,`next`,e)}function s(e){h(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(null,arguments)}function v(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function y(){return y=g((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream(`gzip`),i=r.writable.getWriter(),a=i.write(new TextEncoder().encode(e)).then((()=>i.close())).catch(function(){var e=g((function*(e){try{yield i.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),o=new Response(r.readable).blob(),[s]=yield Promise.all([o,a]);return s}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),y.apply(this,arguments)}var b=`amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider`.split(`,`),x=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return b.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))},S=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`];function C(e,t){return e.indexOf(t)!==-1}var w=function(e){return e.trim()},T=function(e){return e.replace(/^\$/,``)},E=Object.prototype,ee=E.hasOwnProperty,D=E.toString,O=Array.isArray||function(e){return D.call(e)===`[object Array]`},k=e=>typeof e==`function`,A=e=>e===Object(e)&&!O(e),j=e=>{if(A(e)){for(var t in e)if(ee.call(e,t))return!1;return!0}return!1},M=e=>e===void 0,N=e=>D.call(e)==`[object String]`,te=e=>N(e)&&e.trim().length===0,P=e=>e===null,F=e=>M(e)||P(e),I=e=>D.call(e)==`[object Number]`&&e==e,ne=e=>I(e)&&e>0,L=e=>D.call(e)===`[object Boolean]`,R=e=>e instanceof FormData,re=e=>C(S,e);function ie(e){return typeof e!=`object`||!e}function ae(e,t){return{}.toString.call(e)===`[object `+t+`]`}function oe(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var se=[!0,`true`,1,`1`,`yes`],ce=e=>C(se,e),le=[!1,`false`,0,`0`,`no`];function ue(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),I(e)?e>n?(r.warn(` cannot be greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),ue(i||n,t,n,r))}var de=class{constructor(e){this.$t={},this.zt=e.zt,this.Ut=ue(e.bucketSize,0,100,e.Gt),this.Wt=ue(e.refillRate,0,this.Ut,e.Gt),this.Xt=ue(e.refillInterval,0,864e5,e.Gt)}Jt(e,t){var n=Math.floor((t-e.lastAccess)/this.Xt);n>0&&(e.tokens=Math.min(e.tokens+n*this.Wt,this.Ut),e.lastAccess+=n*this.Xt)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.$t[r];return i?this.Jt(i,n):this.$t[r]=i={tokens:this.Ut,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.zt)==null||t.call(this,e)),i.tokens===0)}stop(){this.$t={}}},fe,pe,me,he=(e,t,n)=>{function r(r){for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];t((()=>{(0,n[r])(e,...a)}))}return{debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`error`,...t)},critical(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];n.error(e,...r)},createLogger:r=>he(e+` `+r,t,n)}},z=`Mobile`,ge=`iOS`,_e=`Android`,ve=`Tablet`,ye=_e+` `+ve,be=`iPad`,xe=`Apple`,Se=xe+` Watch`,Ce=`Safari`,we=`BlackBerry`,Te=`Samsung`,Ee=Te+`Browser`,De=Te+` Internet`,Oe=`Chrome`,ke=Oe+` OS`,Ae=Oe+` `+ge,je=`Internet Explorer`,Me=je+` `+z,Ne=`Opera`,Pe=Ne+` Mini`,Fe=`Edge`,Ie=`Microsoft `+Fe,Le=`Firefox`,Re=Le+` `+ge,ze=`Nintendo`,Be=`PlayStation`,Ve=`Xbox`,He=_e+` `+z,Ue=z+` `+Ce,We=`Windows`,Ge=We+` Phone`,Ke=`Nokia`,qe=`Ouya`,Je=`Generic`,Ye=Je+` `+z.toLowerCase(),Xe=Je+` `+ve.toLowerCase(),Ze=`Konqueror`,B=`(\\d+(\\.\\d+)?)`,Qe=RegExp(`Version/`+B),$e=new RegExp(Ve,`i`),et=RegExp(Be+` \\w+`,`i`),tt=RegExp(ze+` \\w+`,`i`),nt=RegExp(we+`|PlayBook|BB10`,`i`),rt={"NT3.51":`NT 3.11`,"NT4.0":`NT 4.0`,"5.0":`2000`,5.1:`XP`,5.2:`XP`,"6.0":`Vista`,6.1:`7`,6.2:`8`,6.3:`8.1`,6.4:`10`,"10.0":`10`},it=function(e,t){return t||=``,C(e,` OPR/`)&&C(e,`Mini`)?Pe:C(e,` OPR/`)?Ne:nt.test(e)?we:C(e,`IE`+z)||C(e,`WPDesktop`)?Me:C(e,Ee)?De:C(e,Fe)||C(e,`Edg/`)?Ie:C(e,`FBIOS`)?`Facebook `+z:C(e,`UCWEB`)||C(e,`UCBrowser`)?`UC Browser`:C(e,`CriOS`)?Ae:C(e,`CrMo`)||C(e,Oe)?Oe:C(e,_e)&&C(e,Ce)?He:C(e,`FxiOS`)?Re:C(e.toLowerCase(),Ze.toLowerCase())?Ze:((e,t)=>t&&C(t,xe)||function(e){return C(e,Ce)&&!C(e,Oe)&&!C(e,_e)}(e))(e,t)?C(e,z)?Ue:Ce:C(e,Le)?Le:C(e,`MSIE`)||C(e,`Trident/`)?je:C(e,`Gecko`)?Le:``},at={[Me]:[RegExp(`rv:`+B)],[Ie]:[RegExp(Fe+`?\\/`+B)],[Oe]:[RegExp(`(`+Oe+`|CrMo)\\/`+B)],[Ae]:[RegExp(`CriOS\\/`+B)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+B)],[Ce]:[Qe],[Ue]:[Qe],[Ne]:[RegExp(`(Opera|OPR)\\/`+B)],[Le]:[RegExp(Le+`\\/`+B)],[Re]:[RegExp(`FxiOS\\/`+B)],[Ze]:[RegExp(`Konqueror[:/]?`+B,`i`)],[we]:[RegExp(we+` `+B),Qe],[He]:[RegExp(`android\\s`+B,`i`)],[De]:[RegExp(Ee+`\\/`+B)],[je]:[RegExp(`(rv:|MSIE )`+B)],Mozilla:[RegExp(`rv:`+B)]},ot=function(e,t){var n=at[it(e,t)];if(M(n))return null;for(var r=0;n.length>r;r++){var i=e.match(n[r]);if(i)return parseFloat(i[i.length-2])}return null},st=[[RegExp(Ve+`; `+Ve+` (.*?)[);]`,`i`),e=>[Ve,e&&e[1]||``]],[new RegExp(ze,`i`),[ze,``]],[new RegExp(Be,`i`),[Be,``]],[nt,[we,``]],[new RegExp(We,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ge,``];if(new RegExp(z).test(t)&&!/IEMobile\b/.test(t))return[We+` `+z,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=rt[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[We,r]}return[We,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ge,[e[3],e[4],e[5]||`0`].join(`.`)]:[ge,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=M(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+_e+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+_e+`)`,`i`),e=>e&&e[2]?[_e,[e[2],e[3],e[4]||`0`].join(`.`)]:[_e,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[ke,``]],[/Linux|debian/i,[`Linux`,``]]],ct=function(e){return tt.test(e)?ze:et.test(e)?Be:$e.test(e)?Ve:new RegExp(qe,`i`).test(e)?qe:RegExp(`(`+Ge+`|WPDesktop)`,`i`).test(e)?Ge:/iPad/.test(e)?be:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Se:nt.test(e)?we:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(Ke,`i`).test(e)?Ke:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(z).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?_e:ye:RegExp(`(pda|`+z+`)`,`i`).test(e)?Ye:new RegExp(ve,`i`).test(e)&&!RegExp(ve+` pc`,`i`).test(e)?Xe:``},lt=e=>e instanceof Error,ut={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},dt=ut.info;function ft(e){if(L(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(O(e))return{arrayValue:{values:e.map((e=>ft(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function pt(e){var t=[];for(var n in e){var r=e[n];P(r)||M(r)||t.push({key:n,value:ft(r)})}return t}function mt(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return me&&n.length===pe||(pe=n.length,me=n.reduce(((n,r)=>{fe||={};var i=fe[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,fe[r]=[s,c];break}}return n}),{})),me}}var ht=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return g((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&O(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),_({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return g((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,_({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:mt(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return _({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},gt=`?`;function _t(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?gt:n,in_app:!0};return M(r)||(a.lineno=r),M(i)||(a.colno=i),a}var vt=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?gt:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},yt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,bt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xt=/\((\S*)(?::(\d+))(?::(\d+))\)/,St=(e,t)=>{var n=yt.exec(e);if(n){var[,r,i,a]=n;return _t(t,r,gt,+i,+a)}var o=bt.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=xt.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=vt(o[1]||gt,o[2]);return _t(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Ct=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Tt=(e,t)=>{var n=Ct.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=wt.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||gt;return[a,i]=vt(a,i),_t(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Et=/\(error: (.*)\)/,Dt=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=N(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?`DOMError`:`DOMException`}getValue(e){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return ae(e,`DOMException`)}isDOMError(e){return ae(e,`DOMError`)}},Ot=class{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},kt=class{constructor(){}match(e){return ae(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},At=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,jt=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(At);return r&&(t=r[1],n=r[2]),[t,n]}},Mt=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function Nt(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var Pt=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){return oe(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+Nt(e)}isSeverityLevel(e){return N(e)&&!te(e)&&Mt.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(lt(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Ft=class{match(e){return oe(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+Nt(e),stack:t.syntheticException?.stack,synthetic:!0}}},It=class{match(e){return ie(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},Lt=class{match(e){return ae(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!oe(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return ie(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},Rt=`$message`,zt=`$timestamp`,Bt=new Set([Rt,zt]),Vt={enabled:!0,max_bytes:32768};function Ht(e){return e?{enabled:e.enabled??Vt.enabled,max_bytes:Wt(e.max_bytes,Vt.max_bytes)}:_({},Vt)}var Ut=class{constructor(e){this.Kt=[],this.Qt=0,this.Bt=Ht(e)}setConfig(e){this.Bt=Ht(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Date)return n.toISOString();if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n}}))}catch{return}}(e);if(t)try{var n=JSON.parse(t);if(!A(n))return;var r=n,i=r[Rt],a=r[zt];return!N(i)||i.trim().length===0||!N(a)&&!I(a)?void 0:{step:r,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Bt.max_bytes||(this.Kt.push({step:t.step,bytes:n}),this.Qt+=n,this.er())}}getAttachable(){return this.Kt.map((e=>e.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var e=this.Kt.shift();e&&(this.Qt-=e.bytes)}}};function Wt(e,t){if(!I(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Gt=function(e,t){var{debugEnabled:r}=t===void 0?{}:t,i={C(t){if(n&&(m.DEBUG||f.POSTHOG_DEBUG||r)&&!M(n.console)&&n.console){for(var i=(`__rrweb_original__`in n.console[t])?n.console[t].__rrweb_original__:n.console[t],a=arguments.length,o=Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];i(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`error`,...t)},critical(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling `+e)},createLogger:(t,n)=>Gt(e+` `+t,n)};return i},V=Gt(`[PostHog.js]`),H=V.createLogger,Kt=H(`[ExternalScriptsLoader]`),qt=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Kt.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=a?.querySelectorAll(`script`);if(r){for(var i,o=function(){if(r[s].src===t){var e=r[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},s=0;r.length>s;s++)if(i=o())return i.v}var c=()=>{if(!a)return n(`document not found`);var r=a.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,n(void 0,e)},r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)a.head.appendChild(r);else{var i,o=a.querySelectorAll(`body > script`);o.length>0?(i=o[0].parentNode)==null||i.insertBefore(r,o[0]):a.body.appendChild(r)}};a!=null&&a.body?c():a?.addEventListener(`DOMContentLoaded`,c)};f.__PosthogExtensions__=f.__PosthogExtensions__||{},f.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}qt(e,r,n)}else qt(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},f.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{qt(e,e.requestRouter.endpointFor(`api`,t),n)};var Jt=`$people_distinct_id`,Yt=`$device_id`,Xt=`__alias`,Zt=`__timers`,Qt=`$autocapture_disabled_server_side`,$t=`$heatmaps_enabled_server_side`,en=`$exception_capture_enabled_server_side`,tn=`$error_tracking_suppression_rules`,nn=`$error_tracking_capture_extension_exceptions`,rn=`$web_vitals_enabled_server_side`,an=`$dead_clicks_enabled_server_side`,on=`$product_tours_enabled_server_side`,sn=`$web_vitals_allowed_metrics`,cn=`$session_recording_remote_config`,ln=`$replay_override_sampling`,un=`$replay_override_linked_flag`,dn=`$replay_override_url_trigger`,fn=`$replay_override_event_trigger`,pn=`$sesid`,mn=`$session_is_sampled`,hn=`$enabled_feature_flags`,gn=`$active_feature_flags`,_n=`$early_access_features`,vn=`$feature_flag_details`,yn=`$feature_flag_payloads`,bn=`$feature_flag_request_id`,xn=`$override_feature_flags`,Sn=`$override_feature_flag_payloads`,Cn=`$stored_person_properties`,wn=`$stored_group_properties`,Tn=`$surveys`,En=`$surveys_activated`,Dn=`ph_product_tours`,On=`$flag_call_reported`,kn=`$flag_call_reported_session_id`,An=`$feature_flag_errors`,jn=`$feature_flag_evaluated_at`,Mn=`$user_state`,Nn=`$client_session_props`,Pn=`$capture_rate_limit`,Fn=`$initial_campaign_params`,In=`$initial_referrer_info`,Ln=`$initial_person_info`,Rn=`$epp`,zn=`__POSTHOG_TOOLBAR__`,Bn=`$posthog_cookieless`,Vn=`$sdk_debug_extensions_init_method`,Hn=`$sdk_debug_extensions_init_time_ms`,Un=`$sdk_debug_recording_script_not_loaded`,Wn=`PostHog loadExternalDependency extension not found.`,Gn=`on_reject`,Kn=`always`,qn=`anonymous`,Jn=`identified`,Yn=`identified_only`,Xn=`visibilitychange`,Zn=`beforeunload`,Qn=`$pageview`,$n=`$pageleave`,er=`$identify`,tr=`$groupidentify`;function nr(e,t){O(e)&&e.forEach(t)}function U(e,t){if(!F(e))if(O(e))e.forEach(t);else if(R(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)ee.call(e,n)&&t(e[n],n)}var W=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function rr(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var ir=function(e){try{return e()}catch{return}},ar=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){V.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),V.critical(e)}}},or=function(e){var t={};return U(e,(function(e,n){(N(e)&&e.length>0||I(e))&&(t[n]=e)})),t},sr=[`herokuapp.com`,`vercel.app`,`netlify.app`];function cr(e){var t=e?.hostname;if(!N(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of sr)if(n===r)return!1;return!0}function G(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function lr(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return I(e)&&isFinite(e)&&Math.floor(e)===e});var ur=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},dr=class{constructor(){this.I=0,this.S=0,this.k=new mr}generate(){var e=this.generateOrAbort();if(M(e)){this.I=0;var t=this.generateOrAbort();if(M(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(this.I>=e+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return ur.fromFieldsV7(this.I,Math.trunc(this.S/2**30),this.S&2**30-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}},fr,pr=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};n&&!M(n.crypto)&&crypto.getRandomValues&&(pr=e=>crypto.getRandomValues(e));var mr=class{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(pr(this.T),this.N=0),this.T[this.N++]}},hr=()=>gr().toString(),gr=()=>(fr||=new dr).generate(),_r=``,vr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,yr={R:()=>!!a,B(e){V.error(`cookieStore error: `+e)},O(e){if(a){try{for(var t=e+`=`,n=a.cookie.split(`;`).filter((e=>e.length)),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==` `;)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(yr.O(e))||{}}catch{}return t},M(e,t,n,r,i){if(a)try{var o=``,s=``,c=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=a),_r)return _r;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+hr();!_r&&r--;){var o=n.slice(r).join(`.`),s=i+`=1;domain=.`+o+`;path=/`;t.cookie=s+`;max-age=3`,t.cookie.includes(i)&&(t.cookie=s+`;max-age=0`,_r=o)}return _r}(e);if(!n){var r=(e=>{var t=e.match(vr);return t?t[0]:``})(e);r!==n&&V.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}(a.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o=`; expires=`+l.toUTCString()}i&&(s=`; secure`);var u=e+`=`+encodeURIComponent(JSON.stringify(t))+o+`; SameSite=Lax; path=/`+c+s;return u.length>3686.4&&V.warn(`cookieStore warning: large cookie, len=`+u.length),a.cookie=u,u}catch{return}},F(e,t){if(a!=null&&a.cookie)try{yr.M(e,``,-1,t)}catch{return}}},br=null,K={R(){if(!P(br))return br;var e=!0;if(M(n))e=!1;else try{var t=`__mplssupport__`;K.M(t,`xyz`),K.O(t)!==`"xyz"`&&(e=!1),K.F(t)}catch{e=!1}return e||V.error(`localStorage unsupported; falling back to cookie store`),br=e,e},B(e){V.error(`localStorage error: `+e)},O(e){try{return n?.localStorage.getItem(e)}catch(e){K.B(e)}return null},Z(e){try{return JSON.parse(K.O(e))||{}}catch{}return null},M(e,t){try{n?.localStorage.setItem(e,JSON.stringify(t))}catch(e){K.B(e)}},F(e){try{n?.localStorage.removeItem(e)}catch(e){K.B(e)}}},xr=[Yt,`distinct_id`,pn,mn,Rn,Ln,Mn],Sr={},Cr={R:()=>!0,B(e){V.error(`memoryStorage error: `+e)},O:e=>Sr[e]||null,Z:e=>Sr[e]||null,M(e,t){Sr[e]=t},F(e){delete Sr[e]}},wr=null,q={R(){if(!P(wr))return wr;if(wr=!0,M(n))wr=!1;else try{var e=`__support__`;q.M(e,`xyz`),q.O(e)!==`"xyz"`&&(wr=!1),q.F(e)}catch{wr=!1}return wr},B(e){V.error(`sessionStorage error: `,e)},O(e){try{return n?.sessionStorage.getItem(e)}catch(e){q.B(e)}return null},Z(e){try{return JSON.parse(q.O(e))||null}catch{}return null},M(e,t){try{n?.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){q.B(e)}},F(e){try{n?.sessionStorage.removeItem(e)}catch(e){q.B(e)}}},Tr=class{constructor(e){this._instance=e}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===Kn||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Gn}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(e){this.nr.M(this.sr,+!!e,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get ir(){var e=this.nr.O(this.sr);return ce(e)?1:C(le,e)?0:-1}get nr(){var e=this.Bt.opt_out_capturing_persistence_type,t=e===`localStorage`?K:yr;if(!this.ar||this.ar!==t){this.ar=t;var n=e===`localStorage`?yr:K;n.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(ce(n.O(this.sr))),n.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[i?.doNotTrack,i?.msDoNotTrack,f.doNotTrack].some((e=>ce(e)))}},Er=H(`[Dead Clicks]`),Dr=()=>!0,Or=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(an)),r=e.instance.config.capture_dead_clicks;return L(r)?r:!!A(r)||n},kr=class{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[an]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?Er.error(`failed to load script`,t):e()}))}hr(){var e;if(a){if(!this.lr&&(e=f.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=A(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=f.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(a),Er.info(`starting...`)}}else Er.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,Er.info(`stopping...`))}},Ar=H(`[SegmentIntegration]`),jr=`posthog-js`;function Mr(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>_({},e,{stacktrace:e.stacktrace?_({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>_({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var Nr=class{constructor(e,t,n,r,i,a){this.name=jr,this.setupOnce=function(o){o(Mr(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},Pr=class{constructor(e){this.cr=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(V.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){this.pr=this._instance.sessionManager?.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(e,t){var r=this.gr(e,t);return this.dr={pathname:n?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){return this.gr(e,this.dr?.pageViewId)}doEvent(){return{$pageview_id:this.dr?.pageViewId}}gr(e,t){var n=this.dr;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;if(!(M(a)||M(o)||M(s)||M(c)||M(l)||M(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?ue(o/a,0,1,V):1,f=a>1?ue(s/a,0,1,V):1,p=c>1?ue(l/c,0,1,V):1,m=c>1?ue(u/c,0,1,V):1;r=W(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Fr={[Jt]:{exposure:`hidden`},[Xt]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Zt]:{exposure:`hidden`},[Qt]:{exposure:`event`},[$t]:{exposure:`hidden`},[en]:{exposure:`event`},[tn]:{exposure:`hidden`},[nn]:{exposure:`event`},[rn]:{exposure:`event`},[an]:{exposure:`event`},[on]:{exposure:`hidden`},[sn]:{exposure:`event`},[cn]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[pn]:{exposure:`hidden`},[mn]:{exposure:`event`},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},[hn]:{exposure:`derived`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!A(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[gn]:{exposure:`event`},[_n]:{exposure:`hidden`},[vn]:{exposure:`hidden`},[yn]:{exposure:`event`},[bn]:{exposure:`event`},[xn]:{exposure:`event`},[Sn]:{exposure:`hidden`},[Cn]:{exposure:`hidden`},[wn]:{exposure:`hidden`},[Tn]:{exposure:`hidden`},[En]:{exposure:`event`},[Dn]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[On]:{exposure:`hidden`},[kn]:{exposure:`hidden`},[An]:{exposure:`hidden`},[jn]:{exposure:`hidden`},[Mn]:{exposure:`hidden`},[Nn]:{exposure:`hidden`},[Pn]:{exposure:`hidden`},[Fn]:{exposure:`hidden`},[In]:{exposure:`hidden`},[Ln]:{exposure:`hidden`},[Rn]:{exposure:`hidden`},[ln]:{exposure:`event`},[un]:{exposure:`event`},[dn]:{exposure:`event`},[fn]:{exposure:`event`},[Vn]:{exposure:`event`},[Hn]:{exposure:`event`},[Un]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Ir=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],Lr=e=>{var t=a?.createElement(`a`);return M(t)?null:(t.href=e,t)},Rr=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!O(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{V.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},zr=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);O(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},Br=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Vr=`https?://(.*)`,Hr=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],Ur=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...Hr],Wr=`<masked>`,Gr=[`li_fat_id`];function Kr(e,t,n){if(!a)return{};var r,i=t?[...Hr,...n||[]]:[],o=qr(zr(a.URL,i,Wr),e);return W((r={},U(Gr,(function(e){var t=yr.O(e);r[e]=t||null})),r),o)}function qr(e,t){var n=Ur.concat(t||[]),r={};return U(n,(function(t){r[t]=Rr(e,t)||null})),r}function Jr(e){var t=function(e){return e?e.search(Vr+`google.([^/?]*)`)===0?`google`:e.search(Vr+`bing.com`)===0?`bing`:e.search(Vr+`yahoo.com`)===0?`yahoo`:e.search(Vr+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,r={};if(!P(t)){r.$search_engine=t;var i=a?Rr(a.referrer,n):``;i.length&&(r.ph_keyword=i)}return r}function Yr(){return navigator.language||navigator.userLanguage}var Xr=`$direct`;function Zr(){return a?.referrer||Xr}function Qr(e,t){var n=e?[...Hr,...t||[]]:[],r=o?.href.substring(0,1e3);return{r:Zr().substring(0,1e3),u:r?zr(r,n,Wr):void 0}}function $r(e){var{r:t,u:n}=e,r={$referrer:t,$referring_domain:t==null?void 0:t==Xr?Xr:Lr(t)?.host};if(n){r.$current_url=n;var i=Lr(n);r.$host=i?.host,r.$pathname=i?.pathname,W(r,qr(n))}return t&&W(r,Jr(t)),r}function ei(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ti(){try{return new Date().getTimezoneOffset()}catch{return}}var ni=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],ri=class{constructor(e,t){this.Bt=e,this.props={},this.mr=!1,this.yr=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(e),this.nr=this.br(e),this.load(),e.debug&&V.info(`Persistence loaded`,e.persistence,_({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wr}br(e){ni.indexOf(e.persistence.toLowerCase())===-1&&(V.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t=function(e){e===void 0&&(e=[]);var t=[...xr,...e];return _({},K,{Z(e){try{var t={};try{t=yr.Z(e)||{}}catch{}var n=W(t,JSON.parse(K.O(e)||`{}`));return K.M(e,n),n}catch{}return null},M(e,n,r,i,a,o){try{K.M(e,n,void 0,void 0,o);var s={};t.forEach((e=>{n[e]&&(s[e]=n[e])})),Object.keys(s).length&&yr.M(e,s,r,i,a,o)}catch(e){K.B(e)}},F(e,t){try{n?.localStorage.removeItem(e),yr.F(e,t)}catch(e){K.B(e)}}})}(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r===`localstorage`&&K.R()?K:r===`localstorage+cookie`&&t.R()?t:r===`sessionstorage`&&q.R()?q:r===`memory`?Cr:r===`cookie`?yr:t.R()?t:yr}_r(e){var t=e??this.Bt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[jn];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return U(this.props,((t,n)=>{var r=(e=>{var t=Fr[e];if(t)return t;for(var[n,r]of Ir)if(e.indexOf(n)===0)return r})(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===hn?()=>this._r():()=>!1))return;r.transformToEventProperties&&W(e,r.transformToEventProperties(t))}else r&&r.exposure!==`event`||(e[n]=t)})),e}load(){if(!this.wr){var e=this.nr.Z(this.yr);e&&(this.props=W({},e))}}save(){this.wr||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(A(e)){M(t)&&(t=`None`),this.Ir=M(n)?this.kr:n;var r=!1;if(U(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Tr(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(A(e)){this.Ir=M(t)?this.kr:t;var n=!1;if(U(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Tr(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ar(e),this.save())}update_campaign_params(){if(!this.mr){var e=Kr(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);j(or(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=a?.referrer)?Jr(e):{})}update_referrer_info(){this.register_once({$referrer:Zr(),$referring_domain:a!=null&&a.referrer&&Lr(a.referrer)?.host||Xr},void 0)}set_initial_person_info(){this.props[Fn]||this.props[In]||this.register_once({[Ln]:Qr(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};U([In,Fn],(t=>{var n=this.props[t];n&&U(n,(function(t,n){e[`$initial_`+T(n)]=t}))}));var t,n,r=this.props[Ln];return r&&W(e,(t=$r(r),n={},U(t,(function(e,t){n[`$initial_`+T(t)]=e})),n)),e}safe_merge(e){return U(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){if(this.kr=this.Ir=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.br(e),i=this.props;this.clear(),this.nr=r,this.props=i,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_secure(e){e!==this.Sr&&(this.Sr=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[Zt]||{};n[e]=t,this.Tr(Zt,n),this.save()}remove_event_timer(e){var t=this.props[Zt]||{},n=t[e];return M(n)||(delete t[e],this.Tr(Zt,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Ar(e){delete this.props[e]}},ii={Activation:`events`,Cancellation:`cancelEvents`},ai={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},oi={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},si={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},ci={Popover:`popover`,Inline:`inline`},li={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},ui={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},di=H(`[RateLimiter]`),fi=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{di.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){di.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(Pn)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(Pn,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},pi=H(`[RemoteConfig]`),mi=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=f._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Er(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}Rr(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return pi.info(`Using preloaded remote config`,this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void pi.warn(`Remote config is disabled. Falling back to local config.`);this.Er((e=>{if(!e)return pi.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.Rr((e=>{this.Nr(e),this.Mr()}));this.Nr(e),this.Mr()}))}catch(e){pi.error(`Error loading remote config`,e)}}stop(){this.Or&&=(clearInterval(this.Or),void 0)}refresh(){this._instance.Fr()||a?.visibilityState===`hidden`||this._instance.reloadFeatureFlags()}Mr(){if(!this.Or){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.Or=setInterval((()=>{this.refresh()}),e))}}Nr(e){var t;e||pi.error(`Failed to fetch remote config from PostHog.`),this._instance.Nr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},hi={GZipJS:`gzip-js`,Base64:`base64`},J=Uint8Array,Y=Uint16Array,gi=Uint32Array,_i=new J([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,0,0,0]),vi=new J([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,0,0]),yi=new J([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bi=function(e,t){for(var n=new Y(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new gi(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},xi=bi(_i,2),Si=xi[1];xi[0][28]=258,Si[258]=28;for(var Ci=bi(vi,0)[1],wi=new Y(32768),X=0;32768>X;++X){var Ti=(43690&X)>>>1|(21845&X)<<1;wi[X]=((65280&(Ti=(61680&(Ti=(52428&Ti)>>>2|(13107&Ti)<<2))>>>4|(3855&Ti)<<4))>>>8|(255&Ti)<<8)>>>1}var Ei=function(e,t,n){for(var r=e.length,i=0,a=new Y(t);r>i;++i)++a[e[i]-1];var o,s=new Y(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new Y(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[wi[d]>>>c]=l}else for(o=new Y(r),i=0;r>i;++i)o[i]=wi[s[e[i]-1]++]>>>15-e[i];return o},Di=new J(288);for(X=0;144>X;++X)Di[X]=8;for(X=144;256>X;++X)Di[X]=9;for(X=256;280>X;++X)Di[X]=7;for(X=280;288>X;++X)Di[X]=8;var Oi=new J(32);for(X=0;32>X;++X)Oi[X]=5;var ki=Ei(Di,9,0),Ai=Ei(Oi,5,0),ji=function(e){return(e/8>>0)+(7&e&&1)},Mi=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Y?Y:e instanceof gi?gi:J)(n-t);return r.set(e.subarray(t,n)),r},Ni=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Pi=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Fi=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new J(0),0];if(i==1){var o=new J(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new Y(f+1),m=Ii(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new J(p),m]},Ii=function(e,t,n){return e.s==-1?Math.max(Ii(e.l,t,n+1),Ii(e.r,t,n+1)):t[e.s]=n},Li=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Y(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Ri=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},zi=function(e,t,n){var r=n.length,i=ji(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Bi=function(e,t,n,r,i,a,o,s,c,l,u){Ni(t,u++,n),++i[256];for(var d=Fi(i,15),f=d[0],p=d[1],m=Fi(a,15),h=m[0],g=m[1],_=Li(f),v=_[0],y=_[1],b=Li(h),x=b[0],S=b[1],C=new Y(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var T=Fi(C,7),E=T[0],ee=T[1],D=19;D>4&&!E[yi[D-1]];--D);var O,k,A,j,M=l+5<<3,N=Ri(i,Di)+Ri(a,Oi)+o,te=Ri(i,f)+Ri(a,h)+o+14+3*D+Ri(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(N>=M&&te>=M)return zi(t,u,e.subarray(c,c+l));if(Ni(t,u,1+(N>te)),u+=2,N>te){O=Ei(f,p,0),k=f,A=Ei(h,g,0),j=h;var P=Ei(E,ee,0);for(Ni(t,u,y-257),Ni(t,u+5,S-1),Ni(t,u+10,D-4),u+=14,w=0;D>w;++w)Ni(t,u+3*w,E[yi[w]]);u+=3*D;for(var F=[v,x],I=0;2>I;++I){var ne=F[I];for(w=0;ne.length>w;++w)Ni(t,u,P[L=31&ne[w]]),u+=E[L],L>15&&(Ni(t,u,ne[w]>>>5&127),u+=ne[w]>>>12)}}else O=ki,k=Di,A=Ai,j=Oi;for(w=0;s>w;++w)if(r[w]>255){var L;Pi(t,u,O[257+(L=r[w]>>>18&31)]),u+=k[L+257],L>7&&(Ni(t,u,r[w]>>>23&31),u+=_i[L]);var R=31&r[w];Pi(t,u,A[R]),u+=j[R],R>3&&(Pi(t,u,r[w]>>>5&8191),u+=vi[R])}else Pi(t,u,O[r[w]]),u+=k[r[w]];return Pi(t,u,O[256]),u+k[256]},Vi=new gi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Hi=function(){for(var e=new gi(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ui=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Wi(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=Hi[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new J(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=zi(c,l,e.subarray(u,d)):(c[u]=!0,l=zi(c,l,e.subarray(u,o)))}else{for(var f=Vi[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new Y(32768),_=new Y(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new gi(25e3),S=new Y(288),C=new Y(32),w=0,T=0,E=(u=0,0),ee=0,D=0;o>u;++u){var O=b(u),k=32767&u,A=_[O];if(g[k]=A,_[O]=k,u>=ee){var j=o-u;if((w>7e3||E>24576)&&j>423){l=Bi(e,c,0,x,S,C,T,E,D,u-D,l),E=w=T=0,D=u;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)C[M]=0}var N=2,te=0,P=m,F=k-A&32767;if(j>2&&O==b(u-F))for(var I=Math.min(p,j)-1,ne=Math.min(32767,u),L=Math.min(258,j);ne>=F&&--P&&k!=A;){if(e[u+N]==e[u+N-F]){for(var R=0;L>R&&e[u+R]==e[u+R-F];++R);if(R>N){if(N=R,te=F,R>I)break;var re=Math.min(F,R-2),ie=0;for(M=0;re>M;++M){var ae=u-F+M+32768&32767,oe=ae-g[ae]+32768&32767;oe>ie&&(ie=oe,A=ae)}}}F+=(k=A)-(A=g[k])+32768&32767}if(te){x[E++]=268435456|Si[N]<<18|Ci[te];var se=31&Si[N],ce=31&Ci[te];T+=_i[se]+vi[ce],++S[257+se],++C[ce],ee=u+N,++w}else x[E++]=e[u],++S[e[u]]}}l=Bi(e,c,!0,x,S,C,T,E,D,u-D,l)}return Mi(s,0,r+ji(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Ui(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Ui(l,u-8,n.d()),Ui(l,u-4,r),l}var Gi=!!c||!!s,Ki=`text/plain`,qi=!1,Ji=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=_({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return U(e,(function(e,t){M(e)||M(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},Yi=(e,t)=>JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t),Xi=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===hi.GZipJS){var r=Wi(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new J(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new J(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return Mi(r,0,i)}(Yi(t)),{mtime:0});return{contentType:Ki,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===hi.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:Yi(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(Yi(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=Yi(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},Zi=function(){var e=g((function*(e){var t=yield function(e,t,n){return y.apply(this,arguments)}(Yi(e.data),m.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return _({},e,{tr:{contentType:Ki,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Qi=(e,t)=>Ji(e,{_:new Date().getTime().toString(),ver:m.JS_SDK_VERSION,compression:t}),$i=[];s&&$i.push({transport:`fetch`,method(e){var{contentType:t,body:n,estimatedSize:r}=Xi(e)??{},i=new Headers;U(e.headers,(function(e,t){i.append(t,e)})),t&&i.append(`Content-Type`,t);var a=e.url,o=null;if(l){var c=new l;o={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}s(a,_({method:e?.method||`GET`,headers:i,keepalive:e.method===`POST`&&52428.8>(r||0),body:n,signal:o?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){V.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{V.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>o?clearTimeout(o.timeout):null))}}),c&&$i.push({transport:`XHR`,method(e){var t=new c;t.open(e.method||`GET`,e.url,!0);var{contentType:n,body:r}=Xi(e)??{};U(e.headers,(function(e,n){t.setRequestHeader(n,e)})),n&&t.setRequestHeader(`Content-Type`,n),e.timeout&&(t.timeout=e.timeout),e.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}e.callback==null||e.callback(n)}},t.send(r)}}),i!=null&&i.sendBeacon&&$i.push({transport:`sendBeacon`,method(e){var t=Ji(e.url,{beacon:`1`});try{var{contentType:n,body:r}=Xi(e)??{};if(!r)return;var a=r instanceof Blob?r:new Blob([r],{type:n});i.sendBeacon(t,a)}catch{}}});var ea=3e3,ta=class{constructor(e,t){this.Pr=!0,this.Lr=[],this.Dr=ue(t?.flush_interval_ms||ea,250,5e3,V.createLogger(`flush interval`),ea),this.Br=e}enqueue(e){this.Lr.push(e),this.jr||this.$r()}unload(){this.qr();var e=this.Lr.length>0?this.Zr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Br(_({},e,{transport:`sendBeacon`}))}))}enable(){this.Pr=!1,this.$r()}$r(){var e=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var t=this.Zr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&O(n.data)&&U(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Br(n)};for(var r in t)n()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var e={};return U(this.Lr,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;M(e[i])&&(e[i]=_({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.Lr=[],e}},na=[`retriesPerformedSoFar`],ra=class{constructor(e){this.Hr=!1,this.Vr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.zr=!0,!M(n)&&`onLine`in n.navigator&&(this.zr=n.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},G(n,`online`,this.Ur),G(n,`offline`,this.Gr))}get length(){return this.Lr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=v(e,na);ne(t)&&(n.url=Ji(n.url,{retry_count:t})),this._instance._send_request(_({},n,{callback:e=>{e.statusCode===200||e.statusCode>=400&&500>e.statusCode||(t??0)>=10?n.callback==null||n.callback(e):this.Wr(_({retriesPerformedSoFar:t},n))}}))}Wr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this.Lr.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),V.warn(i),this.Hr||(this.Hr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Hr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Vr)}Yr(){var e=Date.now(),t=[],n=this.Lr.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.Lr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Jr&&=(clearTimeout(this.Jr),void 0),this.Hr=!1,M(n)||(this.Ur&&=(n.removeEventListener(`online`,this.Ur),void 0),this.Gr&&=(n.removeEventListener(`offline`,this.Gr),void 0)),this.Lr))try{this._instance._send_request(_({},e,{transport:`sendBeacon`}))}catch(e){V.error(e)}this.Lr=[]}},ia=class{constructor(e){this.Kr=()=>{this.Qr||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(t),this.Qr.maxScrollY=Math.max(t,this.Qr.maxScrollY??0),this.Qr.maxScrollHeight=Math.max(n,this.Qr.maxScrollHeight??0),this.Qr.lastContentY=r,this.Qr.maxContentY=Math.max(r,this.Qr.maxContentY??0),this.Qr.maxContentHeight=Math.max(i,this.Qr.maxContentHeight??0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Kr,0),e}startMeasuringScrollPosition(){G(n,`scroll`,this.Kr,{capture:!0}),G(n,`scrollend`,this.Kr,{capture:!0}),G(n,`resize`,this.Kr)}scrollElement(){if(!this.ei)return n?.document.documentElement;for(var e of O(this.ei)?this.ei:[this.ei]){var t=n?.document.querySelector(e);if(t)return t}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return n&&(n.scrollY||n.pageYOffset||n.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return n&&(n.scrollX||n.pageXOffset||n.document.documentElement.scrollLeft)||0}},aa=e=>Qr(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),oa=class{constructor(e,t,n,r){this.ti=e=>{var t=this.ri();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.ii(this._instance)};this.ni.register({[Nn]:n})}},this._instance=e,this.si=t,this.ni=n,this.ii=r||aa,this.si.onSessionId(this.ti)}ri(){return this.ni.props[Nn]}getSetOnceProps(){var e=this.ri()?.props;return e?`r`in e?$r(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return U(or(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+T(n)]=t})),e}},sa=class{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.oi[e]||[])n(t);for(var r of this.oi[`*`]||[])r(e,t)}},ca=H(`[SessionId]`),la=class{on(e,t){return this.ai.on(e,t)}constructor(e,t,n){var r;if(this.li=[],this.ui=void 0,this.ai=new sa,this.hi=(e,t)=>!(!ne(e)||!ne(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Kn)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Bt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||hr,this.fi=n||hr;var i=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*ue(this.Bt.session_idle_timeout_seconds||1800,60,36e3,ca.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi=`ph_`+i+`_window_id`,this.mi=`ph_`+i+`_primary_window_exists`,this.yi()){var a=q.Z(this.gi),o=q.Z(this.mi);a&&!o?this.ci=a:q.F(this.gi),q.M(this.mi,!0)}if((r=this.Bt.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Bt.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),s)}catch(e){ca.error(`Invalid sessionID in bootstrap`,e)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return M(this.li)&&(this.li=[]),this.li.push(e),this.di&&e(this.di,this.ci),()=>{this.li=this.li.filter((t=>t!==e))}}yi(){return this.Bt.persistence!==`memory`&&!this.ni.wr&&q.R()}Ii(e){e!==this.ci&&(this.ci=e,this.yi()&&q.M(this.gi,e))}Ci(){return this.ci?this.ci:this.yi()?q.Z(this.gi):null}bi(e,t,n){e===this.di&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[pn]:[t,e,n]}))}Si(){var e=this.ni.props[pn];return O(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&n&&(n.removeEventListener(Zn,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&q.F(this.mi)},G(n,Zn,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Bt.cookieless_mode===Kn)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[r,i,a]=this.Si(),o=this.Ci(),s=ne(a)&&Math.abs(n-a)>864e5,c=!1,l=!i,u=!l&&!e&&this.hi(n,r);l||u||s?(i=this.vi(),o=this.fi(),ca.info(`new session ID generated`,{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}}),a=n,c=!0):o||(o=this.fi(),c=!0);var d=ne(r)&&e&&!s?r:n,f=ne(a)?a:new Date().getTime();return this.Ii(o),this.bi(i,d,f),e||this.pi(),c&&this.li.forEach((e=>e(i,o,c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:r}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[e]=this.Si();if(this.hi(new Date().getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit(`forcedIdleReset`,{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}},ua=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&x(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>x(e?.brand,t))))return!0}catch{}return!!e.webdriver},da=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function fa(e,t,n){return Yi({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var pa={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>da(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!da(t,e))))),icontains:(e,t)=>t.map(ma).some((t=>e.map(ma).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(ma).every((t=>e.map(ma).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},ma=e=>e.toLowerCase();function ha(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(M(i)||P(i))return!1;var a=[String(i)],o=pa[r.operator];return!!o&&o(r.values,a)}))}var ga,_a,va=`custom`,ya=`i.posthog.com`,ba=/^\/static\//,xa=class{constructor(e){this.ki={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+ya,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:va),this.ki[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t==`string`&&ba.test(e))return t.trim().replace(/\/$/,``)||void 0}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.Ti(t);if(n)return``+n+t}if(this.region===va)return this.apiHost+t;var r=ya+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}};ga===void 0&&(ga=e=>e()),_a===void 0&&(_a=console),_a.log.bind(_a),_a.warn.bind(_a),_a.error.bind(_a),_a.debug.bind(_a);var Z=H(`[Surveys]`),Sa=`seenSurvey_`,Ca=[ai.Popover,ai.Widget,ai.API],wa={ignoreConditions:!1,ignoreDelay:!1,displayType:ci.Popover},Ta=H(`[PostHog ExternalIntegrations]`),Ea={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},Da=class{constructor(e){this._instance=e}ur(e,t){var n;(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Ta.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=f.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.ur(Ea[t],(()=>{var n;(n=f.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=f.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=f.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},Oa,ka={},Aa=0,ja=()=>{},Ma=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,Na=`Surveys module not available`,Pa=`sanitize_properties is deprecated. Use before_send instead`,Fa=`Invalid value for property_denylist config: `,Ia=`posthog`,La=!Gi&&d?.indexOf(`MSIE`)===-1&&d?.indexOf(`Mozilla`)===-1,Ra=e=>{var t;return _({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,token:``,autocapture:!0,cross_subdomain_cookie:cr(a?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:ja,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:e??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:o&&N(o?.search)&&o.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(n==null||(t=n.location)==null?void 0:t.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){V.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Yn,before_send:void 0,request_queue_config:{flush_interval_ms:ea},error_tracking:{},_onCapture:ja,__preview_eager_load_replay:!1},(e=>({rageclick:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},za=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],Ba=e=>{var t={};for(var[n,r]of za)M(e[n])||(t[r]=e[n]);var i=W({},t,e);return O(e.property_blacklist)&&(M(e.property_denylist)?i.property_denylist=e.property_blacklist:O(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:V.error(Fa+e.property_denylist)),i},Va=class{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(e){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ha=class e{Ei(e,t){if(e){var n=this.Ri.indexOf(e);n!==-1&&this.Ri.splice(n,1)}return this.Ri.push(t),t.initialize==null||t.initialize(),t}Ni(){return this.config.cookieless_mode===Kn||this.config.cookieless_mode===Gn&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new Va,this.Mi=!1,this.version=m.LIB_VERSION,this.Fi=new sa,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ra(),this.SentryIntegration=Nr,this.sentryIntegration=e=>function(e,t){var n=Mr(e,t);return{name:jr,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new ia(this),this.pageViewManager=new Pr(this),this.rateLimiter=new fi(this),this.requestRouter=new xa(this),this.consent=new Tr(this),this.externalIntegrations=new Da(this);var t=e.__defaultExtensionClasses??{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,n)=>{var r=N(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=N(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>V.info(`send "`+e?.event+`"`,e)))}init(t,n,r){if(r&&r!==Ia){var i=ka[r]??new e;return i._init(t,n,r),ka[r]=i,ka[Ia][r]=i,i}return this._init(t,n,r)}_init(e,t,r){var i;if(t===void 0&&(t={}),M(e)||te(e))return V.critical(`PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()`),this;if(this.__loaded)return console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},t.debug=this.Bi(t.debug),this.ji=t,this.$i=[],t.person_profiles?this.Li=t.person_profiles:t.process_person&&(this.Li=t.process_person),this.set_config(W({},Ra(t.defaults),Ba(t),{name:r,token:e})),this.config.on_xhr_error&&V.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=t.disable_compression?void 0:hi.GZipJS;var a=this.qi();this.persistence=new ri(this.config,a),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new ri(_({},this.config,{persistence:`sessionStorage`}),a);var o=_({},this.persistence.props),s=_({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new ta((e=>this.Hi(e)),this.config.request_queue_config),this.Vi=new ra(this),this.__request_queue=[];var c=this.Ni();if(c||(this.sessionManager=new la(this),this.sessionPropsManager=new oa(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.zi(c)}),0)):(V.info(`Initializing extensions synchronously`),this.zi(c)),m.DEBUG=m.DEBUG||this.config.debug,m.DEBUG&&V.info(`Starting in debug mode`,{this:this,config:t,thisC:_({},this.config),p:o,s}),!this.config.identity_distinct_id||(i=t.bootstrap)!=null&&i.distinctID||(t.bootstrap=_({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),t.bootstrap?.distinctID!==void 0){var l=t.bootstrap.distinctID,u=this.get_distinct_id(),d=this.persistence.get_property(Mn);if(t.bootstrap.isIdentifiedID&&u!=null&&u!==l&&d===qn)this.identify(l);else if(t.bootstrap.isIdentifiedID&&u!=null&&u!==l&&d===Jn)V.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var f=this.config.get_device_id(hr()),p=t.bootstrap.isIdentifiedID?f:l;this.persistence.set_property(Mn,t.bootstrap.isIdentifiedID?Jn:qn),this.register({distinct_id:l,$device_id:p})}}if(c)this.register_once({distinct_id:Bn,$device_id:null},``);else if(!this.get_distinct_id()){var h=this.config.get_device_id(hr());this.register_once({distinct_id:h,$device_id:h},``),this.persistence.set_property(Mn,qn)}return G(n,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||hr();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Mn,Jn)),t()},i=n.user();`then`in i&&k(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Ar.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Ar.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ar.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Qn),identify:e=>t(e,er),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.Ui())):this.Ui(),k(this.config._onCapture)&&this.config._onCapture!==ja&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&V.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(t){var n=performance.now(),r=_({},e.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Ri.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Ri.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Ri.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Ri.push(new r.tracingHeaders(this)),r.siteApps&&this.Ri.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.Ri.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Ri.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Ri.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Ri.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Ri.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Ri.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Ri.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Ri.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Or)),r.toolbar&&this.Ri.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Ri.push(this.experiments=this.experiments??new r.experiments(this)),this.Ri.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Nr(e)}})),this.Gi(i,n)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Gi(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){V.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Vn]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Hn]:r}),this.config.__preview_deferred_init_extensions&&V.info(`PostHog extensions initialized (`+r+`ms)`)}Nr(e){var t;if(!a||!a.body)return V.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.Nr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.Wi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=C(e.supportedCompression,hi.GZipJS)?hi.GZipJS:C(e.supportedCompression,hi.Base64)?hi.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:Yn}),this.Ri.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}Ui(){try{this.config.loaded(this)}catch(e){V.critical("`loaded` function failed",e)}if(this.Xi(),this.config.internal_or_test_user_hostname&&o!=null&&o.hostname){var e=o.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new mi(this),this.Ki.load()}Xi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&nr(this.__request_queue,(e=>this.Hi(e))),this.__request_queue=[],this.Xi()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture($n),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.Zi)==null||n.unload(),(r=this.Vi)==null||r.unload()):this.Qi()&&this.capture($n,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded&&(La?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Ji(e.url,{ip:+!!this.config.ip}),e.headers=_({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=_({},e);t.timeout=t.timeout||6e4,t.url=Qi(t.url,t.compression);var n=t.transport??`fetch`,r=$i.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===hi.GZipJS&&u&&!qi?Zi(t).then((e=>{i(e)})).catch((n=>{if((e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`)(n))return qi=!0,void i(_({},t,{compression:void 0,url:Qi(e.url,void 0)}));i(t)})):i(t)})(_({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))))}Hi(e){this.Vi?this.Vi.retriableRequest(e):this._send_request(e)}_execute_array(e){Aa++;try{var t,n=[],r=[],i=[];nr(e,(e=>{e&&(O(t=e[0])?i.push(e):k(e)?e.call(this):O(e)&&t===`alias`?n.push(e):O(e)&&t.indexOf(`capture`)!==-1&&k(this[t])?i.push(e):r.push(e))}));var a=function(e,t){nr(e,(function(e){if(O(e[0])){var n=t;U(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};a(n,this),a(r,this),a(i,this)}finally{Aa--}}push(t){if(Aa>0&&O(t)&&N(t[0])){var n=e.prototype[t[0]];k(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!M(e)&&N(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!N(t?.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.en||V.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=hr(),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Qn&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p,m,h,g=this.tn(n?.$set_once,e!==tr,e===er);if(g&&(f.$set_once=g),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>N(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),O(t)?(r=[],nr(t,(t=>{r.push(e(t))}))):(r={},U(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,M(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===oi.DISMISSED||e===oi.SENT){var v=t?.[si.SURVEY_ID],y=t?.[si.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>{var n=``+Sa+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+Sa+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){Z.error(`Failed to persist survey seen state`,e)}})({id:v,current_iteration:y}),f.$set=_({},f.$set,{[(p={id:v,current_iteration:y},m=e===oi.SENT?`responded`:`dismissed`,h=`$survey_`+m+`/`+p.id,p.current_iteration&&p.current_iteration>0&&(h=`$survey_`+m+`/`+p.id+`/`+p.current_iteration),h)]:!0})}else e===oi.SHOWN&&(f.$set=_({},f.$set,{[si.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===li.SHOWN){var b=t?.[ui.TOUR_TYPE];b&&(f.$set=_({},f.$set,{[ui.TOUR_LAST_SEEN_DATE+`/`+b]:new Date().toISOString()}))}var x=_({},f.properties.$set,f.$set);if(j(x)||this.setPersonPropertiesForFlags(x),!F(this.config.before_send)){var S=this.rn(f);if(!S)return;f=S}this.Fi.emit(`eventCaptured`,f);var C={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Hi(C):this.Zi.enqueue(C),f}V.critical(`This capture call is ignored due to client rate limiting.`)}}else V.error(`No event name provided to posthog.capture`)}else V.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}calculateEventProperties(e,t,r,i,s){if(r||=new Date,!this.persistence||!this.sessionPersistence)return t;var c=s?void 0:this.persistence.remove_event_timer(e),l=_({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.Ni()&&(l.$cookieless_mode=!0),e===`$snapshot`){var u=_({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!N(l.distinct_id)&&!I(l.distinct_id)||te(l.distinct_id))&&V.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),l}var f,p=function(e,t){var r,i,a;if(!d)return{};var s,c,l,u,f=e?[...Hr,...t||[]]:[],[p,h]=function(e){for(var t=0;st.length>t;t++){var[n,r]=st[t],i=n.exec(e),a=i&&(k(r)?r(i,e):r);if(a)return a}return[``,``]}(d);return W(or({$os:p,$os_version:h,$browser:it(d,navigator.vendor),$device:ct(d),$device_type:(c=d,l={userAgentDataPlatform:(r=navigator)==null||(r=r.userAgentData)==null?void 0:r.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:n==null||(i=n.screen)==null?void 0:i.width,screenHeight:n==null||(a=n.screen)==null?void 0:a.height,devicePixelRatio:n?.devicePixelRatio},u=ct(c),u===be||u===ye||u===`Kobo`||u===`Kindle Fire`||u===Xe?ve:u===ze||u===Ve||u===Be||u===qe?`Console`:u===Se?`Wearable`:u?z:l?.userAgentDataPlatform===`Android`&&(l?.maxTouchPoints??0)>0?600>Math.min(l?.screenWidth??0,l?.screenHeight??0)/(l?.devicePixelRatio??1)?z:ve:`Desktop`),$timezone:ei(),$timezone_offset:ti()}),{$current_url:zr(o?.href,f,Wr),$host:o?.host,$pathname:o?.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+`...`:d,$browser_version:ot(d,navigator.vendor),$browser_language:Yr(),$browser_language_prefix:(s=Yr(),typeof s==`string`?s.split(`-`)[0]:void 0),$screen_height:n?.screen.height,$screen_width:n?.screen.width,$viewport_height:n?.innerHeight,$viewport_width:n?.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());l.$session_id=h,l.$window_id=g}this.sessionPropsManager&&W(l,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&W(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=this.Vi?.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===va&&(l.$lib_custom_api_host=this.config.api_host),f=e!==Qn||s?e!==$n||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),l=W(l,f),e===Qn&&a&&(l.title=a.title),!M(c)){var v=r.getTime()-c;l.$duration=parseFloat((v/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?`bot`:`browser`),(l=W({},p,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),O(this.config.property_denylist)?U(this.config.property_denylist,(function(e){delete l[e]})):V.error(Fa+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(V.error(Pa),l=y(l,e));var b=this.nn();return l.$process_person_profile=b,b&&!s&&this.sn(`_calculate_event_properties`),l}tn(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.nn()||this.Mi&&!n)return e;var r=W({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(V.error(Pa),r=i(r,`$set_once`)),t&&(this.Mi=!0),j(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}an(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Fi.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Na}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Na})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Na})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=wa),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:Na}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:Na})}ln(e){return!e||te(e)?(V.critical(`Unique user id has not been set in posthog.identify`),!1):e===Bn?(V.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(V.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return V.uninitializedWarning(`posthog.identify`);if(I(e)&&(e=e.toString(),V.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.ln(e)&&this.sn(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Yt)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(Xt)&&(this.unregister(Xt),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Mn)||qn)===qn;e!==r&&a?(this.persistence.set_property(Mn,Jn),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(er,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Di=fa(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(On))}}setPersonProperties(e,t){if((e||t)&&this.sn(`posthog.setPersonProperties`)){var n=fa(this.get_distinct_id(),e,t);this.Di===n?V.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Di=n)}}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:_({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(tr,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else V.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.sn(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c;if(V.info(`reset`),!this.__loaded)return V.uninitializedWarning(`posthog.reset`);var l=this.get_property(Yt);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),(r=this.surveys)==null||r.reset(),(i=this.Ki)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.persistence)==null||s.set_property(Mn,qn),(c=this.sessionManager)==null||c.resetSessionId(),this.Di=null,this.config.cookieless_mode===Kn)this.register_once({distinct_id:Bn,$device_id:null},``);else{var u=this.config.get_device_id(hr());this.register_once({distinct_id:u,$device_id:e?u:l},``)}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.un()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.hn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Jt)?(V.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.sn(`posthog.alias`)?(M(t)&&(t=this.get_distinct_id()),e===t?(V.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.an(Xt,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=_({},this.config);if(A(e)){var n,r,i,a,o,s,c,l,u,d;W(this.config,Ba(e));var f=this.qi();(n=this.persistence)==null||n.update_config(this.config,t,f),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new ri(_({},this.config,{persistence:`sessionStorage`}),f);var p=this.Bi(this.config.debug);L(p)&&(this.config.debug=p),L(this.config.debug)&&(this.config.debug?(m.DEBUG=!0,K.R()&&K.M(`ph_debug`,!0),V.info(`set_config`,{config:e,oldConfig:t,newConfig:_({},this.config)})):(m.DEBUG=!1,K.R()&&K.F(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(l=this.deadClicksAutocapture)==null||l.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.cn(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){m.LIB_NAME=e,m.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(_({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??e.dn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??Ia;return e!==Ia&&(e=Ia+`.`+e),e}_isIdentified(){return this.persistence?.get_property(Mn)===Jn||this.sessionPersistence?.get_property(Mn)===Jn}nn(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Yn&&!this._isIdentified()&&j(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Xt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Rn]))}Qi(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.nn()||this.sn(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return this.config.person_profiles===`never`?(V.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.an(Rn,!0),!0)}qi(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Gn)}cn(){var e,t,n=this.qi();return this.persistence?.wr!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.wr!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==Kn){if(this.Ni()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new la(this),this.pageViewManager=new Pr(this),this.persistence&&(this.sessionPropsManager=new oa(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??e.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.Ei(this.sessionRecording,new o(this)),this.Wi&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.Wi)))}var s;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Gn&&((s=this.surveys)==null||s.loadIfEnabled()),(M(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture(t?.captureEventName??`$opt_in`,t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else V.warn(Ma)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Kn?V.warn(Ma):(this.config.cookieless_mode===Gn&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Gn&&(this.register({distinct_id:Bn,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(t=this.pageViewManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Ji()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Kn||(this.config.cookieless_mode===Gn?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return i?ua(i,this.config.custom_blocked_useragents):void 0}Ji(){a&&(a.visibilityState===`visible`?this.Oi||(this.Oi=!0,this.capture(Qn,{title:a.title},{send_instantly:!0}),this.Pi&&=(a.removeEventListener(Xn,this.Pi),null)):this.Pi||(this.Pi=this.Ji.bind(this),G(a,Xn,this.Pi)))}debug(e){!1===e?(n?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(n?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var e,t,n,r,i,a,o=this.ji||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(V.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):(n=`advanced_disable_decide`,r=V,i=(t=`advanced_disable_flags`)in(e=o)&&!F(e[t]),a=n in e&&!F(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}rn(e){if(F(this.config.before_send))return e;var t=O(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),F(n)){var i=`Event '`+e.event+`' was rejected in beforeSend function`;return re(e.event)?V.warn(i+`. This can cause unexpected behavior.`):V.info(i),null}n.properties&&!j(n.properties)||V.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}return n}getPageViewId(){return this.pageViewManager.dr?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Bi(e){var t=L(e)&&!e,n=K.R()&&K.O(`ph_debug`)===`true`;return!t&&(!!n||e)}};Ha.__defaultExtensionClasses={},Ha.dn={trace:Oa=()=>{},debug:Oa,info:Oa,warn:Oa,error:Oa,fatal:Oa},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=ar(e.prototype[t[n]])}(Ha,[`identify`]);var Ua=1,Wa=3,Ga=11;function Ka(e){return e instanceof Element&&(e.id===zn||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function qa(e){return!!e&&e.nodeType===Ua}function Ja(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ya(e){return!!e&&e.nodeType===Wa}function Xa(e){return!!e&&e.nodeType===Ga&&qa(e.host)}function Za(e){return e?w(e).split(/\s+/):[]}function Qa(e){var t=n?.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function $a(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return Za(t)}function eo(e){return F(e)?null:w(e).split(/(\s+)/).filter((e=>yo(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function to(e){var t=``;return uo(e)&&!fo(e)&&e.childNodes&&e.childNodes.length&&U(e.childNodes,(function(e){Ya(e)&&e.textContent&&(t+=eo(e.textContent)??``)})),w(t)}function no(e){return M(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ro=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function io(e,t){if(M(t))return!0;var n,r=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function ao(e){var t=e.parentNode;return!(!t||!qa(t))&&t}var oo=[`next`,`previous`,`prev`,`>`,`<`],so=[`.ph-no-rageclick`,`.ph-no-capture`],co=e=>!e||Ja(e,`html`)||!qa(e),lo=(e,t)=>{if(!n||co(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],a=e;a.parentNode&&!Ja(a,`body`);)if(Xa(a.parentNode))i.push(a.parentNode.host),a=a.parentNode.host;else{var o=ao(a);if(!o)break;if(t||ro.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=n.getComputedStyle(o);s&&s.getPropertyValue(`cursor`)===`pointer`&&(r=!0)}i.push(o),a=o}return{parentIsUsefulElement:r,targetElementList:i}};function uo(e){for(var t=e;t.parentNode&&!Ja(t,`body`);t=t.parentNode){var n=$a(t);if(C(n,`ph-sensitive`)||C(n,`ph-no-capture`))return!1}if(C($a(e),`ph-include`))return!0;var r=e.type||``;if(N(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!N(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``))}function fo(e){return!!(Ja(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Ja(e,`select`)||Ja(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var po=`(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})`,mo=RegExp(`^(?:`+po+`)$`),ho=new RegExp(po),go=`\\d{3}-?\\d{2}-?\\d{4}`,_o=RegExp(`^(`+go+`)$`),vo=RegExp(`(`+go+`)`);function yo(e,t){return t===void 0&&(t=!0),!(F(e)||N(e)&&(e=w(e),(t?mo:ho).test((e||``).replace(/[- ]/g,``))||(t?_o:vo).test(e)))}function bo(e){var t=to(e);return yo(t=(t+` `+xo(e)).trim())?t:``}function xo(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&U(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=to(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+xo(e)).trim())}catch(e){V.error(`[AutoCapture]`,e)}})),t}function So(e){return e.replace(/"|\\"/g,`\\"`)}function Co(e){var t=e.attr__class;return t?O(t)?t:Za(t):void 0}var wo=class{constructor(e){this.disabled=!1===e;var t=A(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},To=`$copy_autocapture`,Eo=H(`[AutoCapture]`);function Do(e,t){return t.length>e?t.slice(0,e)+`...`:t}function Oo(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!qa(t));return t}function ko(e,t){var r,{e:i,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:s,elementsChainAsString:c}=t;if(!qa(e))return{props:{}};for(var l=[e],u=e;u.parentNode&&!Ja(u,`body`);)if(Xa(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!qa(u.parentNode))break;l.push(u.parentNode),u=u.parentNode}var d,f,p=[],m={},h=!1,g=!1;if(U(l,(e=>{var t=uo(e);if(Ja(e,`a`)){var n=e.getAttribute(`href`);h=t&&!!n&&yo(n)&&n}C($a(e),`ph-no-capture`)&&(g=!0),p.push(function(e,t,n,r){var i=e.tagName.toLowerCase(),a={tag_name:i};ro.indexOf(i)>-1&&!n&&(a.$el_text=i.toLowerCase()===`a`||i.toLowerCase()===`button`?Do(1024,bo(e)):Do(1024,to(e)));var o=$a(e);o.length>0&&(a.classes=o.filter((function(e){return e!==``}))),U(e.attributes,(function(n){var i;if((!fo(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&yo(n.value)&&(!N(i=n.name)||i.substring(0,10)!==`_ngcontent`&&i.substring(0,7)!==`_nghost`)){var o=n.value;n.name===`class`&&(o=Za(o).join(` `)),a[`attr__`+n.name]=Do(1024,o)}}));for(var s=1,c=1,l=e;l=Oo(l);)s++,l.tagName===e.tagName&&c++;return a.nth_child=s,a.nth_of_type=c,a}(e,a,o,s)),W(m,function(e){if(!uo(e))return{};var t={};return U(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&yo(r)&&(t[n]=r)}})),t}(e))})),g)return{props:{},explicitNoCapture:g};if(o||(p[0].$el_text=Ja(e,`a`)||Ja(e,`button`)?bo(e):to(e)),h){var v;p[0].attr__href=h;var y=Lr(h)?.host,b=n==null||(v=n.location)==null?void 0:v.host;y&&b&&y!==b&&(d=h)}return{props:W({$event_type:i.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:(f=p,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=_({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return rr(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[So(t.toString())]=So(n.toString())})),(t+=`:`)+rr(i).map((e=>{var[t,n]=e;return t+`="`+n+`"`})).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:Co(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return rr(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(f)))},(r=p[0])!=null&&r.$el_text?{$el_text:p[0]?.$el_text}:{},d&&i.type===`click`?{$external_click_url:d}:{},m)}}var Ao=H(`[ExceptionAutocapture]`);function jo(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return k(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Mo=H(`[TracingHeaders]`),No=H(`[Web Vitals]`),Po=9e5,Fo=`disabled`,Io=`lazy_loading`,Lo=`awaiting_config`,Ro=`missing_config`;H(`[SessionRecording]`),H(`[SessionRecording]`);var zo=`[SessionRecording]`,Bo=H(zo),Vo=H(`[Heatmaps]`);function Ho(e){return A(e)&&`clientX`in e&&`clientY`in e&&I(e.clientX)&&I(e.clientY)}var Uo=H(`[Product Tours]`),Wo=[`$set_once`,`$set`],Go=H(`[SiteApps]`),Ko=`Error while initializing PostHog app with config id `;function qo(e,t,n){if(F(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Jo=class{constructor(e){this.vn=new sa,this.fn=(e,t)=>this.pn(e,t)&&this.gn(e,t)&&this.mn(e,t)&&this.yn(e,t),this.pn=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.bn=new Set,this.wn=new Set}init(){var e;M(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!M(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.wn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.bn)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.bn.has(e)||this.bn.has(t?.event))&&this.wn&&this.wn?.size>0&&this.wn.forEach((e=>{this._n(t,e)&&this.vn.emit(`actionCaptured`,e.name)}))}In(e){this.onAction(`actionCaptured`,(t=>e(t)))}_n(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.fn(e,n))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!qo(r,t.url,t.url_matching||`contains`))return!1}return!0}mn(e,t){return!!this.Cn(e,t)&&!!this.Sn(e,t)&&!!this.xn(e,t)}Cn(e,t){var n;if(t==null||!t.href)return!0;var r=this.kn(e);if(r.length>0)return r.some((e=>qo(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&qo((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}Sn(e,t){var n;if(t==null||!t.text)return!0;var r=this.kn(e);if(r.length>0)return r.some((e=>qo(e.text,t.text,t.text_matching||`exact`)||qo(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!F(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>qo(e,a,o))))}xn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}kn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}yn(e,t){return t==null||!t.properties||t.properties.length===0||ha(t.properties.reduce(((e,t)=>{var n=O(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},Yo=class{constructor(e){this._instance=e,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(e,t){return!!e&&ha(e.propertyFilters,t?.properties)}Nn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}Mn(e,t,n){var r=(n===ii.Activation?this.Tn:this.An).get(e),i=[];return this.Fn((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Rn(a,t)}))}register(e){M(this._instance?._addCaptureHook)||(this.On(e),this.Pn(e))}Pn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Ln??(this.Ln=new Jo(this._instance),this.Ln.init(),this.Ln.In((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Ln)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.En.get(t.name);n&&n.push(e.id),this.En.set(t.name,n||[e.id])}})))})))}On(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Tn=this.Nn(e,ii.Activation),this.An=this.Nn(e,ii.Cancellation))}onEvent(e,t){var n,r=this.le(),i=this.Dn(),a=this.Bn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[i])||[];if(a===e&&t&&o.length>0){var s,c;r.info(`event matched, removing item from activated items`,{event:e,eventPayload:t,existingActivatedItems:o});var l=(t==null||(s=t.properties)==null?void 0:s.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(l){var u=o.indexOf(l);0>u||(o.splice(u,1),this.jn(o))}}else{if(this.An.has(e)){var d=this.Mn(e,t,ii.Cancellation);d.length>0&&(r.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.$n(e.id)})),this.jn(o))}if(this.Tn.has(e)){r.info(`event name matched`,{event:e,eventPayload:t,items:this.Tn.get(e)});var f=this.Mn(e,t,ii.Activation);this.jn(o.concat(f.map((e=>e.id))||[]))}}}onAction(e){var t,n=this.Dn(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[];this.En.has(e)&&this.jn(r.concat(this.En.get(e)||[]))}jn(e){var t=this.le(),n=[...new Set(e)].filter((e=>!this.qn(e)));t.info(`updating activated items`,{activatedItems:n}),this.Zn(n)}getActivatedIds(){var e,t=this.Dn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Hn(){return this.Ln}},Xo=class extends Yo{constructor(e){super(e)}Dn(){return En}Bn(){return oi.SHOWN}Fn(e){var t;(t=this._instance)==null||t.getSurveys(e)}$n(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return Z}Zn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[En]:e})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Zo=`SDK is not enabled or survey functionality is not yet loaded`,Qo=`Disabled. Not loading surveys.`,$o=n!=null&&n.location?Br(n.location.hash,`__posthog`)||Br(location.hash,`state`):null,es=`_postHogToolbarParams`,ts=H(`[Toolbar]`),Q=H(`[FeatureFlags]`),ns=H(`[FeatureFlags]`,{debugEnabled:!0}),rs=`" failed. Feature flags didn't load in time.`,is=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},as=e=>{var t={};for(var[n,r]of rr(e||{}))r&&(t[n]=r);return t},os=H(`[Error tracking]`),ss=`Refusing to render web experiment since the viewer is a likely bot`,cs={icontains:(e,t)=>!!n&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!n&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!n&&da(t.href,e),not_regex:(e,t)=>!!n&&!da(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},ls=class e{get Bt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){t===void 0&&(t=!1),n.getWebExperiments((t=>{e.Vn(`retrieved web experiments from the server`),n.zn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n.zn&&(e.Vn(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n.zn)==null||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);N(i)&&t.variants[i]&&n.Un(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.Yn(o)&&n.Un(t.name,a,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Vn(ss);else if(!this.Bt.disable_web_experiments){if(F(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Vn(`applying feature flags`,t),t.forEach((e=>{var t;if(this.zn&&(t=this.zn)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.zn?.get(e);n&&r!=null&&r.variants[n]&&this.Un(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=Rr(t?.search,`__experiment_id`),r=Rr(t?.search,`__experiment_variant`);n&&r&&(e.Vn(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Gn(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.Bt.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.Bt.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Gn(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.Vn(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Un(i[0].name,n,i[0].variants[n].transforms))}static Yn(t){return!F(t.conditions)&&e.Wn(t)&&e.Xn(t)}static Wn(t){if(F(t.conditions)||F(t.conditions?.url))return!0;var n,r=e.getWindowLocation();return!!r&&((n=t.conditions)==null||!n.url||cs[t.conditions?.urlMatchType??`icontains`](t.conditions.url,r))}static getWindowLocation(){return n?.location}static Xn(e){if(F(e.conditions)||F(e.conditions?.utm))return!0;var t=Kr();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Vn(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];V.info(`[WebExperiments] `+e,n)}Un(t,n,r){this._is_bot()?e.Vn(ss):n===`control`?e.Vn(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.Vn(`applying transform of variant `+n+` for experiment `+t+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return i&&this._instance?ua(i,this.Bt.custom_blocked_useragents):void 0}},$=H(`[Conversations]`),us=`Conversations not available yet.`,ds={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e;return(e=this.ni?._r(this.Bt.feature_flag_cache_ttl_ms))!=null&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,Q.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}hs(){var e=this.Bt.evaluation_contexts??this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(Q.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.ns=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||Q.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}cs(){return this.hs().length>0}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},i=n!=null&&n.merge?this.getFlagPayloads():{},a=_({},r,e),o=_({},i,t),s={};for(var[c,l]of Object.entries(a)){var u=typeof l==`string`;s[c]={key:c,enabled:!!u||!!l,variant:u?l:void 0,reason:void 0,metadata:M(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:s})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(vn),t=this.os(xn),n=this.os(Sn);if(!n&&!t)return e||{};var r=W({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=M(c)?(a=s?.enabled)!=null&&a:!!c,u=M(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=_({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=_({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Jn||=(Q.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getFlagVariants(){var e=this.os(hn),t=this.os(xn);if(!t)return e||{};for(var n=W({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(Q.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.os(yn),t=this.os(Sn);if(!t)return e||{};for(var n=W({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(Q.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit(`featureFlagsReloading`,!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var t=this.Bt.token,n=this.os(Yt),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_({},this.ni?.get_initial_props()||{},this.os(Cn)||{}),group_properties:this.os(wn),timezone:ei()};P(n)||M(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.cs()&&(r.evaluation_contexts=this.hs());var i=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Bt.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Qn=!0,this._instance._send_request({method:`POST`,url:i,data:r,compression:this.Bt.disable_compression?void 0:hi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,a=!0;if(e.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),a=!1),this.Qn=!1,!r.disable_flags||this.ts){this.rs=!a;var o=[];e.error?e.error instanceof Error?o.push(e.error.name===`AbortError`?`timeout`:`connection_error`):o.push(`unknown_error`):e.statusCode!==200&&o.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&o.push(`errors_while_computing_flags`);var s=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));s&&o.push(`quota_limited`),(i=this.ni)==null||i.register({[An]:o}),s?Q.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},a,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else Q.warn(`getFeatureFlag for key "`+e+rs)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.os(bn)||void 0,c=this.os(jn)||void 0,l=this.os(On)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.os(kn);d&&d!==f&&(l={},(u=this.ni)==null||u.register({[On]:l,[kn]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b;O(l[e])?l[e].push(o):l[e]=[o],(p=this.ni)==null||p.register({[On]:l});var x=this.getFeatureFlagDetails(e),S=[...this.os(An)??[]];M(i)&&S.push(`flag_missing`);var C={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Bt.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Bt.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.rs};M(x==null||(g=x.metadata)==null?void 0:g.version)||(C.$feature_flag_version=x.metadata.version);var w,T=(x==null||(_=x.reason)==null?void 0:_.description)??(x==null||(v=x.reason)==null?void 0:v.code);T&&(C.$feature_flag_reason=T),x!=null&&(y=x.metadata)!=null&&y.id&&(C.$feature_flag_id=x.metadata.id),M(x?.original_variant)&&M(x?.original_enabled)||(C.$feature_flag_original_response=M(x.original_variant)?x.original_enabled:x.original_variant),x!=null&&(b=x.metadata)!=null&&b.original_payload&&(C.$feature_flag_original_payload=x==null||(w=x.metadata)==null?void 0:w.original_payload),S.length&&(C.$feature_flag_error=S.join(`,`)),this._instance.capture(`$feature_flag_called`,C)}if(r){var E=a;if(!M(a))try{E=JSON.parse(a)}catch{}return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:E}}}}else Q.warn(`getFeatureFlagResult for key "`+e+rs)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Bt.disable_compression?void 0:hi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return M(n)?void 0:!!n}Q.warn(`isFeatureEnabled for key "`+e+rs)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):Q.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(O(c)){Q.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[gn]:c,[hn]:f})}else{var m=c,h=l,g=s;if(a!=null&&a.partialResponse)m=_({},n,m),h=_({},r,h),g=_({},i,g);else if(e.errorsWhileComputingFlags)if(s){var v=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=_({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return v.has(t)})))),h=_({},r,Object.fromEntries(Object.entries(h||{}).filter((e=>{var[t]=e;return v.has(t)})))),g=_({},i,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return v.has(t)}))))}else m=_({},n,m),h=_({},r,h),g=_({},i,g);t&&t.register(_({[gn]:Object.keys(as(m)),[hn]:m||{},[yn]:h||{},[vn]:g||{}},u?{[bn]:u}:{},d?{[jn]:d}:{}))}}})(e,this.ni,r,i,a,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Q.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Q.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.ni.unregister(xn),this.ni.unregister(Sn),this.ps(),ns.info(`All overrides cleared`);if(O(e)){var t=is(e);return this.ni.register({[xn]:t}),this.ps(),ns.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.ni.unregister(xn),ns.info(`Flag overrides cleared`);else if(r.flags){if(O(r.flags)){var i=is(r.flags);this.ni.register({[xn]:i})}else this.ni.register({[xn]:r.flags});ns.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.ni.unregister(Sn),ns.info(`Payload overrides cleared`)):r.payloads&&(this.ni.register({[Sn]:r.payloads}),ns.info(`Payload overrides set`,{payloads:r.payloads}))),this.ps();return}if(e&&typeof e==`object`)return this.ni.register({[xn]:e}),this.ps(),ns.info(`Flag overrides set`,{flags:e});Q.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.os(_n)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=_({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[gn]:Object.keys(as(s)),[hn]:s}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(_n),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Bt.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.ni)==null||n.unregister(_n),(r=this.ni)==null||r.register({[_n]:i}),e(i)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Cn)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[Cn]:_({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Cn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(wn)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=_({},n[t],e[t]),delete e[t]})),this._instance.register({[wn]:_({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(wn)||{};this._instance.register({[wn]:_({},t,{[e]:{}})})}else this._instance.unregister(wn)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},fs={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){return this.bs===Lo||this.bs===Ro?this.bs:this.ys?.status??this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=Fo,this.ws=void 0,this._instance=e,!this._instance.sessionManager)throw Bo.error(`started without valid sessionManager`),Error(zo+` started without valid sessionManager. This is a bug.`);if(this.Bt.cookieless_mode===Kn)throw Error(zo+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get _s(){var e,t=!((e=this._instance.get_property(cn))==null||!e.enabled),r=!this.Bt.disable_session_recording,i=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return n&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._s||(t=this.ys)==null||!t.isStarted){var n=!M(Object.assign)&&!M(Array.from);this._s&&n?(this.Is(e),Bo.info(`starting`)):(this.bs=Fo,this.stopRecording())}}Is(e){var t,n,r;this._s&&(this.bs!==Lo&&this.bs!==Ro&&(this.bs=Io),f!=null&&(t=f.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=f.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=f.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return Bo.error(`could not load recorder`,t);this.Cs(e)})))}stopRecording(){var e,t;(e=this.ws)==null||e.call(this),this.ws=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this.ws)==null||e.call(this),this.ws=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(mn)}Ts(e,t){if(F(e))return null;var n,r=I(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Bo.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}As(e){if(this.ni){var t,n=this.ni,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ts(this.Bt.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ts(t?.sampleRate,`remote config sampleRate`),a=r??i;F(a)&&this.ks();var o=t?.minimumDurationMilliseconds;n.register({[cn]:_({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:_({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:M(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.ws)==null||t.call(this),this.ws=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.As(e),this.xs()):(this.As(e),this.startIfEnabledOrStop()):(this.bs===Lo&&(this.bs=Ro,Bo.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Bo.warn(`log called before recorder was ready`)}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(cn);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Es(){var e=this._instance.get_property(cn);if(!e)return!1;var t=(typeof e==`object`?e:JSON.parse(e)).cache_timestamp??Date.now();return 36e5>=Date.now()-t}Cs(e){var t;if((t=f.__PosthogExtensions__)==null||!t.initSessionRecording)return Bo.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Un]:!0});if(this.ys||(this.ys=f.__PosthogExtensions__?.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es()){if(this.bs===Ro||this.bs===Lo)return;this.bs=Lo,Bo.info(`persisted remote config is stale, requesting fresh config before starting`),new mi(this._instance).load();return}this.bs=Io,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[un]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[ln]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e===`url`?dn:fn]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.ys?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},ps={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new wo(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e=A(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}Os(){if(this.isBrowserSupported()){if(n&&a){var e=e=>{e||=n?.event;try{this.Ps(e)}catch(e){Eo.error(`Failed to capture event`,e)}};if(G(a,`submit`,e,{capture:!0}),G(a,`change`,e,{capture:!0}),G(a,`click`,e,{capture:!0}),this.Bt.capture_copied_text){var t=e=>{e||=n?.event;try{this.Ps(e,To)}catch(e){Eo.error(`Failed to capture copy/cut event`,e)}};G(a,`copy`,t,{capture:!0}),G(a,`cut`,t,{capture:!0})}}}else Eo.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Qt]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((t=>{(a?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Qt];if(P(this.Ns)&&!L(e)&&!this.instance.Fr())return!1;var t=this.Ns??!!e;return!!this.instance.config.autocapture&&!t}Ps(e,t){if(t===void 0&&(t=`$autocapture`),this.isEnabled){var r,i=no(e);Ya(i)&&(i=i.parentNode||null),t===`$autocapture`&&e.type===`click`&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&function(e,t){if(!n||co(e))return!1;var r,i;if(L(t)?(r=!!t&&so,i=void 0):(r=t?.css_selector_ignorelist??so,i=t?.content_ignorelist),!1===r)return!1;var{targetElementList:a}=lo(e,!1);return!function(e,t){if(!1===e||M(e))return!1;var n;if(!0===e)n=oo;else{if(!O(e))return!1;if(e.length>10)return V.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>t.includes(e)||r.includes(e)))}))}(i,a.map((e=>({safeText:to(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!io(a,r)}(i,this.instance.config.rageclick)&&this.Ps(e,`$rageclick`);var a=t===To;if(i&&function(e,t,r,i,a){var o,s,c;if(r===void 0&&(r=void 0),!n||co(e)||(o=r)!=null&&o.url_allowlist&&!Qa(r.url_allowlist)||(s=r)!=null&&s.url_ignorelist&&Qa(r.url_ignorelist))return!1;if((c=r)!=null&&c.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=lo(e,i);if(!function(e,t){var n=t?.element_allowlist;if(M(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(d,r)||!io(d,r?.css_selector_allowlist))return!1;var f=n.getComputedStyle(e);if(f&&f.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0;var p=e.tagName.toLowerCase();switch(p){case`html`:return!1;case`form`:return(a||[`submit`]).indexOf(t.type)>=0;case`input`:case`select`:case`textarea`:return(a||[`change`,`click`]).indexOf(t.type)>=0;default:return u?(a||[`click`]).indexOf(t.type)>=0:(a||[`click`]).indexOf(t.type)>=0&&(ro.indexOf(p)>-1||e.getAttribute(`contenteditable`)===`true`)}}(i,e,this.Bt,a,a?[`copy`,`cut`]:void 0)){var{props:o,explicitNoCapture:s}=ko(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(s)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(o.$element_selectors=c),t===To){var l,u=eo(n==null||(l=n.getSelection())==null?void 0:l.toString()),d=e.type||`clipboard`;if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return k(a?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(n==null||(t=n.location)==null?void 0:t.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(V.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,V.info(`History API monitoring stopped`)}monitorHistoryChanges(){var e,t;if(n&&n.history){var r=this;(e=n.history.pushState)!=null&&e.__posthog_wrapped__||jo(n.history,`pushState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Bs(`pushState`)})),(t=n.history.replaceState)!=null&&t.__posthog_wrapped__||jo(n.history,`replaceState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Bs(`replaceState`)})),this.js()}}Bs(e){try{var t,r=n==null||(t=n.location)==null?void 0:t.pathname;if(!r)return;r!==this.Ls&&this.isEnabled&&this._instance.capture(Qn,{navigation_type:e}),this.Ls=r}catch(t){V.error(`Error capturing `+e+` pageview`,t)}}js(){if(!this.Ds){var e=()=>{this.Bs(`popstate`)};G(n,`popstate`,e),this.Ds=()=>{n&&n.removeEventListener(`popstate`,e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[$t]),this.rageclicks=new wo(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return A(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return F(this.Bt.capture_heatmaps)?F(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:!1!==this.Bt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Vo.info(`starting...`),this.Zs(),this.Lt()}else clearInterval(this.qs??void 0),this.Hs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$t]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Vs(e){this.Tt(e.originalEvent,`deadclick`)}Lt(){this.qs&&clearInterval(this.qs),this.qs=a?.visibilityState===`visible`?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){n&&a&&(this.zs=this.Yr.bind(this),G(n,Zn,this.zs),this.Us=e=>this.Tt(e||n?.event),G(a,`click`,this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||n?.event),G(a,`mousemove`,this.Ys,{capture:!0}),this.Ws=new kr(this.instance,Dr,this.Vs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Lt.bind(this),G(a,Xn,this.Xs),this.Rs=!0)}Hs(){var e;n&&a&&(this.zs&&n.removeEventListener(Zn,this.zs),this.Us&&a.removeEventListener(`click`,this.Us,{capture:!0}),this.Ys&&a.removeEventListener(`mousemove`,this.Ys,{capture:!0}),this.Xs&&a.removeEventListener(Xn,this.Xs),clearTimeout(this.Js),(e=this.Ws)==null||e.stop(),this.Rs=!1)}Ks(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var i=e;i&&qa(i)&&!Ja(i,`body`);){if(i===r)return!1;if(C(t,n?.getComputedStyle(i).position))return!0;i=ao(i)}return!1}(no(e),[`fixed`,`sticky`],a);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:r),target_fixed:o,type:t}}Tt(e,t){var n;if(t===void 0&&(t=`click`),!Ka(e.target)&&Ho(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(_({},r,{type:`rageclick`})),this.Qs(r)}}Gs(e){!Ka(e.target)&&Ho(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,`mousemove`))}),500))}Qs(e){if(n){var t=n.location.href,r=this.Bt.custom_personal_data_properties,i=zr(t,this.Bt.mask_personal_data_properties?[...Hr,...r||[]]:[],Wr);this.T=this.T||{},this.T[i]||(this.T[i]=[]),this.T[i].push(e)}}Yr(){this.T&&!j(this.T)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:kr,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.T.metrics.reduce(((e,t)=>_({},e,{[`$web_vitals_`+t.name+`_event`]:_({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{var t=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0);if(M(t))No.error(`Could not read session ID. Dropping metrics!`);else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();M(n)||(F(e?.name)||F(e?.value)?No.error(`Invalid metric received`,e):!this.no||this.no>e.value?(this.T.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),M(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=M(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.T.metrics.push(_({},e,{$current_url:n,$session_id:t.sessionId,$window_id:t.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):No.error(`Ignoring metric with value >= `+this.no,e))}},this.so=()=>{if(!this.Rs){var e,t,n,r,i=f.__PosthogExtensions__;M(i)||M(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.ht.bind(this)),this.Rs=!0):No.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[rn]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e=A(this.oo)?this.oo?.web_vitals_allowed_metrics:void 0;return F(e)?this._instance.persistence?.props[sn]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(A(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=A(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=A(this.oo)&&I(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:Po;return e>0&&6e4>=e?Po:e}get isEnabled(){var e=o?.protocol;if(e!==`http:`&&e!==`https:`)return No.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=A(this.oo)?this.oo.web_vitals:L(this.oo)?this.oo:void 0;return L(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(No.info(`enabled, starting...`),this.ur(this.so))}onRemoteConfig(e){if(`capturePerformance`in e){var t=A(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=A(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rn]:t}),this._instance.persistence.register({[sn]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?No.error(`failed to load script`,t):e()}))}io(){var e=n?n.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return zr(e,this._instance.config.mask_personal_data_properties?[...Hr,...t||[]]:[],Wr)}No.error(`Could not determine current URL`)}}},ms={exceptionObserver:class{constructor(e){var t;this.so=()=>{var e;if(n&&this.isEnabled&&(e=f.__PosthogExtensions__)!=null&&e.errorWrappingFunctions){var t=f.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=f.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=f.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=t(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=i(this.captureException.bind(this)))}catch(e){Ao.error(`failed to start`,e),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[en]),this.do=new de({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Gt:Ao}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return A(e)?t=_({},t,e):(M(e)?this.co:e)&&(t=_({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ao.info(`enabled`),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return Ao.error(`failed to load script`,t);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[en]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.do.consumeRateLimit(r)?Ao.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.fo=[],this.po=new ht([new Dt,new Lt,new kt,new Ot,new Ft,new Pt,new jt,new It],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
1
+ import{r as e}from"./rolldown-runtime-wFmyQBCi.js";var t=e({Compression:()=>hi,DisplaySurveyType:()=>ci,PostHog:()=>Ha,ProductTourEventName:()=>li,ProductTourEventProperties:()=>ui,SurveyEventName:()=>oi,SurveyEventProperties:()=>si,SurveyEventType:()=>ii,SurveyType:()=>ai,default:()=>Cs,posthog:()=>Cs}),n=typeof window<`u`?window:void 0,r=typeof globalThis<`u`?globalThis:n;typeof self>`u`&&(r.self=r),typeof File>`u`&&(r.File=function(){});var i=r?.navigator,a=r?.document,o=r?.location,s=r?.fetch,c=r!=null&&r.XMLHttpRequest&&`withCredentials`in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,l=r?.AbortController,u=r?.CompressionStream,d=i?.userAgent,f=n??{},p=`1.372.6`,m={DEBUG:!1,LIB_VERSION:p,LIB_NAME:`web`,JS_SDK_VERSION:p};function h(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){h(a,r,i,o,s,`next`,e)}function s(e){h(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(null,arguments)}function v(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function y(){return y=g((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream(`gzip`),i=r.writable.getWriter(),a=i.write(new TextEncoder().encode(e)).then((()=>i.close())).catch(function(){var e=g((function*(e){try{yield i.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),o=new Response(r.readable).blob(),[s]=yield Promise.all([o,a]);return s}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),y.apply(this,arguments)}var b=`amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider`.split(`,`),x=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return b.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))},S=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`];function C(e,t){return e.indexOf(t)!==-1}var w=function(e){return e.trim()},T=function(e){return e.replace(/^\$/,``)},E=Object.prototype,ee=E.hasOwnProperty,D=E.toString,O=Array.isArray||function(e){return D.call(e)===`[object Array]`},k=e=>typeof e==`function`,A=e=>e===Object(e)&&!O(e),j=e=>{if(A(e)){for(var t in e)if(ee.call(e,t))return!1;return!0}return!1},M=e=>e===void 0,N=e=>D.call(e)==`[object String]`,te=e=>N(e)&&e.trim().length===0,P=e=>e===null,F=e=>M(e)||P(e),I=e=>D.call(e)==`[object Number]`&&e==e,ne=e=>I(e)&&e>0,L=e=>D.call(e)===`[object Boolean]`,R=e=>e instanceof FormData,re=e=>C(S,e);function ie(e){return typeof e!=`object`||!e}function ae(e,t){return{}.toString.call(e)===`[object `+t+`]`}function oe(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var se=[!0,`true`,1,`1`,`yes`],ce=e=>C(se,e),le=[!1,`false`,0,`0`,`no`];function ue(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),I(e)?e>n?(r.warn(` cannot be greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),ue(i||n,t,n,r))}var de=class{constructor(e){this.$t={},this.zt=e.zt,this.Ut=ue(e.bucketSize,0,100,e.Gt),this.Wt=ue(e.refillRate,0,this.Ut,e.Gt),this.Xt=ue(e.refillInterval,0,864e5,e.Gt)}Jt(e,t){var n=Math.floor((t-e.lastAccess)/this.Xt);n>0&&(e.tokens=Math.min(e.tokens+n*this.Wt,this.Ut),e.lastAccess+=n*this.Xt)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.$t[r];return i?this.Jt(i,n):this.$t[r]=i={tokens:this.Ut,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.zt)==null||t.call(this,e)),i.tokens===0)}stop(){this.$t={}}},fe,pe,me,he=(e,t,n)=>{function r(r){for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];t((()=>{(0,n[r])(e,...a)}))}return{debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`error`,...t)},critical(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];n.error(e,...r)},createLogger:r=>he(e+` `+r,t,n)}},z=`Mobile`,ge=`iOS`,_e=`Android`,ve=`Tablet`,ye=_e+` `+ve,be=`iPad`,xe=`Apple`,Se=xe+` Watch`,Ce=`Safari`,we=`BlackBerry`,Te=`Samsung`,Ee=Te+`Browser`,De=Te+` Internet`,Oe=`Chrome`,ke=Oe+` OS`,Ae=Oe+` `+ge,je=`Internet Explorer`,Me=je+` `+z,Ne=`Opera`,Pe=Ne+` Mini`,Fe=`Edge`,Ie=`Microsoft `+Fe,Le=`Firefox`,Re=Le+` `+ge,ze=`Nintendo`,Be=`PlayStation`,Ve=`Xbox`,He=_e+` `+z,Ue=z+` `+Ce,We=`Windows`,Ge=We+` Phone`,Ke=`Nokia`,qe=`Ouya`,Je=`Generic`,Ye=Je+` `+z.toLowerCase(),Xe=Je+` `+ve.toLowerCase(),Ze=`Konqueror`,B=`(\\d+(\\.\\d+)?)`,Qe=RegExp(`Version/`+B),$e=new RegExp(Ve,`i`),et=RegExp(Be+` \\w+`,`i`),tt=RegExp(ze+` \\w+`,`i`),nt=RegExp(we+`|PlayBook|BB10`,`i`),rt={"NT3.51":`NT 3.11`,"NT4.0":`NT 4.0`,"5.0":`2000`,5.1:`XP`,5.2:`XP`,"6.0":`Vista`,6.1:`7`,6.2:`8`,6.3:`8.1`,6.4:`10`,"10.0":`10`},it=function(e,t){return t||=``,C(e,` OPR/`)&&C(e,`Mini`)?Pe:C(e,` OPR/`)?Ne:nt.test(e)?we:C(e,`IE`+z)||C(e,`WPDesktop`)?Me:C(e,Ee)?De:C(e,Fe)||C(e,`Edg/`)?Ie:C(e,`FBIOS`)?`Facebook `+z:C(e,`UCWEB`)||C(e,`UCBrowser`)?`UC Browser`:C(e,`CriOS`)?Ae:C(e,`CrMo`)||C(e,Oe)?Oe:C(e,_e)&&C(e,Ce)?He:C(e,`FxiOS`)?Re:C(e.toLowerCase(),Ze.toLowerCase())?Ze:((e,t)=>t&&C(t,xe)||function(e){return C(e,Ce)&&!C(e,Oe)&&!C(e,_e)}(e))(e,t)?C(e,z)?Ue:Ce:C(e,Le)?Le:C(e,`MSIE`)||C(e,`Trident/`)?je:C(e,`Gecko`)?Le:``},at={[Me]:[RegExp(`rv:`+B)],[Ie]:[RegExp(Fe+`?\\/`+B)],[Oe]:[RegExp(`(`+Oe+`|CrMo)\\/`+B)],[Ae]:[RegExp(`CriOS\\/`+B)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+B)],[Ce]:[Qe],[Ue]:[Qe],[Ne]:[RegExp(`(Opera|OPR)\\/`+B)],[Le]:[RegExp(Le+`\\/`+B)],[Re]:[RegExp(`FxiOS\\/`+B)],[Ze]:[RegExp(`Konqueror[:/]?`+B,`i`)],[we]:[RegExp(we+` `+B),Qe],[He]:[RegExp(`android\\s`+B,`i`)],[De]:[RegExp(Ee+`\\/`+B)],[je]:[RegExp(`(rv:|MSIE )`+B)],Mozilla:[RegExp(`rv:`+B)]},ot=function(e,t){var n=at[it(e,t)];if(M(n))return null;for(var r=0;n.length>r;r++){var i=e.match(n[r]);if(i)return parseFloat(i[i.length-2])}return null},st=[[RegExp(Ve+`; `+Ve+` (.*?)[);]`,`i`),e=>[Ve,e&&e[1]||``]],[new RegExp(ze,`i`),[ze,``]],[new RegExp(Be,`i`),[Be,``]],[nt,[we,``]],[new RegExp(We,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ge,``];if(new RegExp(z).test(t)&&!/IEMobile\b/.test(t))return[We+` `+z,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=rt[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[We,r]}return[We,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ge,[e[3],e[4],e[5]||`0`].join(`.`)]:[ge,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=M(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+_e+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+_e+`)`,`i`),e=>e&&e[2]?[_e,[e[2],e[3],e[4]||`0`].join(`.`)]:[_e,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[ke,``]],[/Linux|debian/i,[`Linux`,``]]],ct=function(e){return tt.test(e)?ze:et.test(e)?Be:$e.test(e)?Ve:new RegExp(qe,`i`).test(e)?qe:RegExp(`(`+Ge+`|WPDesktop)`,`i`).test(e)?Ge:/iPad/.test(e)?be:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Se:nt.test(e)?we:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(Ke,`i`).test(e)?Ke:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(z).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?_e:ye:RegExp(`(pda|`+z+`)`,`i`).test(e)?Ye:new RegExp(ve,`i`).test(e)&&!RegExp(ve+` pc`,`i`).test(e)?Xe:``},lt=e=>e instanceof Error,ut={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},dt=ut.info;function ft(e){if(L(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(O(e))return{arrayValue:{values:e.map((e=>ft(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function pt(e){var t=[];for(var n in e){var r=e[n];P(r)||M(r)||t.push({key:n,value:ft(r)})}return t}function mt(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return me&&n.length===pe||(pe=n.length,me=n.reduce(((n,r)=>{fe||={};var i=fe[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,fe[r]=[s,c];break}}return n}),{})),me}}var ht=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return g((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&O(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),_({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return g((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,_({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:mt(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return _({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},gt=`?`;function _t(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?gt:n,in_app:!0};return M(r)||(a.lineno=r),M(i)||(a.colno=i),a}var vt=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?gt:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},yt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,bt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xt=/\((\S*)(?::(\d+))(?::(\d+))\)/,St=(e,t)=>{var n=yt.exec(e);if(n){var[,r,i,a]=n;return _t(t,r,gt,+i,+a)}var o=bt.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=xt.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=vt(o[1]||gt,o[2]);return _t(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Ct=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Tt=(e,t)=>{var n=Ct.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=wt.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||gt;return[a,i]=vt(a,i),_t(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Et=/\(error: (.*)\)/,Dt=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=N(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?`DOMError`:`DOMException`}getValue(e){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return ae(e,`DOMException`)}isDOMError(e){return ae(e,`DOMError`)}},Ot=class{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},kt=class{constructor(){}match(e){return ae(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},At=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,jt=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(At);return r&&(t=r[1],n=r[2]),[t,n]}},Mt=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function Nt(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var Pt=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){return oe(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+Nt(e)}isSeverityLevel(e){return N(e)&&!te(e)&&Mt.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(lt(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Ft=class{match(e){return oe(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+Nt(e),stack:t.syntheticException?.stack,synthetic:!0}}},It=class{match(e){return ie(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},Lt=class{match(e){return ae(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!oe(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return ie(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},Rt=`$message`,zt=`$timestamp`,Bt=new Set([Rt,zt]),Vt={enabled:!0,max_bytes:32768};function Ht(e){return e?{enabled:e.enabled??Vt.enabled,max_bytes:Wt(e.max_bytes,Vt.max_bytes)}:_({},Vt)}var Ut=class{constructor(e){this.Kt=[],this.Qt=0,this.Bt=Ht(e)}setConfig(e){this.Bt=Ht(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Date)return n.toISOString();if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n}}))}catch{return}}(e);if(t)try{var n=JSON.parse(t);if(!A(n))return;var r=n,i=r[Rt],a=r[zt];return!N(i)||i.trim().length===0||!N(a)&&!I(a)?void 0:{step:r,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Bt.max_bytes||(this.Kt.push({step:t.step,bytes:n}),this.Qt+=n,this.er())}}getAttachable(){return this.Kt.map((e=>e.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var e=this.Kt.shift();e&&(this.Qt-=e.bytes)}}};function Wt(e,t){if(!I(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Gt=function(e,t){var{debugEnabled:r}=t===void 0?{}:t,i={C(t){if(n&&(m.DEBUG||f.POSTHOG_DEBUG||r)&&!M(n.console)&&n.console){for(var i=(`__rrweb_original__`in n.console[t])?n.console[t].__rrweb_original__:n.console[t],a=arguments.length,o=Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];i(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`error`,...t)},critical(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling `+e)},createLogger:(t,n)=>Gt(e+` `+t,n)};return i},V=Gt(`[PostHog.js]`),H=V.createLogger,Kt=H(`[ExternalScriptsLoader]`),qt=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Kt.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=a?.querySelectorAll(`script`);if(r){for(var i,o=function(){if(r[s].src===t){var e=r[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},s=0;r.length>s;s++)if(i=o())return i.v}var c=()=>{if(!a)return n(`document not found`);var r=a.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,n(void 0,e)},r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)a.head.appendChild(r);else{var i,o=a.querySelectorAll(`body > script`);o.length>0?(i=o[0].parentNode)==null||i.insertBefore(r,o[0]):a.body.appendChild(r)}};a!=null&&a.body?c():a?.addEventListener(`DOMContentLoaded`,c)};f.__PosthogExtensions__=f.__PosthogExtensions__||{},f.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}qt(e,r,n)}else qt(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},f.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{qt(e,e.requestRouter.endpointFor(`api`,t),n)};var Jt=`$people_distinct_id`,Yt=`$device_id`,Xt=`__alias`,Zt=`__timers`,Qt=`$autocapture_disabled_server_side`,$t=`$heatmaps_enabled_server_side`,en=`$exception_capture_enabled_server_side`,tn=`$error_tracking_suppression_rules`,nn=`$error_tracking_capture_extension_exceptions`,rn=`$web_vitals_enabled_server_side`,an=`$dead_clicks_enabled_server_side`,on=`$product_tours_enabled_server_side`,sn=`$web_vitals_allowed_metrics`,cn=`$session_recording_remote_config`,ln=`$replay_override_sampling`,un=`$replay_override_linked_flag`,dn=`$replay_override_url_trigger`,fn=`$replay_override_event_trigger`,pn=`$sesid`,mn=`$session_is_sampled`,hn=`$enabled_feature_flags`,gn=`$active_feature_flags`,_n=`$early_access_features`,vn=`$feature_flag_details`,yn=`$feature_flag_payloads`,bn=`$feature_flag_request_id`,xn=`$override_feature_flags`,Sn=`$override_feature_flag_payloads`,Cn=`$stored_person_properties`,wn=`$stored_group_properties`,Tn=`$surveys`,En=`$surveys_activated`,Dn=`ph_product_tours`,On=`$flag_call_reported`,kn=`$flag_call_reported_session_id`,An=`$feature_flag_errors`,jn=`$feature_flag_evaluated_at`,Mn=`$user_state`,Nn=`$client_session_props`,Pn=`$capture_rate_limit`,Fn=`$initial_campaign_params`,In=`$initial_referrer_info`,Ln=`$initial_person_info`,Rn=`$epp`,zn=`__POSTHOG_TOOLBAR__`,Bn=`$posthog_cookieless`,Vn=`$sdk_debug_extensions_init_method`,Hn=`$sdk_debug_extensions_init_time_ms`,Un=`$sdk_debug_recording_script_not_loaded`,Wn=`PostHog loadExternalDependency extension not found.`,Gn=`on_reject`,Kn=`always`,qn=`anonymous`,Jn=`identified`,Yn=`identified_only`,Xn=`visibilitychange`,Zn=`beforeunload`,Qn=`$pageview`,$n=`$pageleave`,er=`$identify`,tr=`$groupidentify`;function nr(e,t){O(e)&&e.forEach(t)}function U(e,t){if(!F(e))if(O(e))e.forEach(t);else if(R(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)ee.call(e,n)&&t(e[n],n)}var W=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function rr(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var ir=function(e){try{return e()}catch{return}},ar=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){V.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),V.critical(e)}}},or=function(e){var t={};return U(e,(function(e,n){(N(e)&&e.length>0||I(e))&&(t[n]=e)})),t},sr=[`herokuapp.com`,`vercel.app`,`netlify.app`];function cr(e){var t=e?.hostname;if(!N(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of sr)if(n===r)return!1;return!0}function G(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function lr(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return I(e)&&isFinite(e)&&Math.floor(e)===e});var ur=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},dr=class{constructor(){this.I=0,this.S=0,this.k=new mr}generate(){var e=this.generateOrAbort();if(M(e)){this.I=0;var t=this.generateOrAbort();if(M(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(this.I>=e+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return ur.fromFieldsV7(this.I,Math.trunc(this.S/2**30),this.S&2**30-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}},fr,pr=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};n&&!M(n.crypto)&&crypto.getRandomValues&&(pr=e=>crypto.getRandomValues(e));var mr=class{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(pr(this.T),this.N=0),this.T[this.N++]}},hr=()=>gr().toString(),gr=()=>(fr||=new dr).generate(),_r=``,vr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,yr={R:()=>!!a,B(e){V.error(`cookieStore error: `+e)},O(e){if(a){try{for(var t=e+`=`,n=a.cookie.split(`;`).filter((e=>e.length)),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==` `;)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(yr.O(e))||{}}catch{}return t},M(e,t,n,r,i){if(a)try{var o=``,s=``,c=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=a),_r)return _r;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+hr();!_r&&r--;){var o=n.slice(r).join(`.`),s=i+`=1;domain=.`+o+`;path=/`;t.cookie=s+`;max-age=3`,t.cookie.includes(i)&&(t.cookie=s+`;max-age=0`,_r=o)}return _r}(e);if(!n){var r=(e=>{var t=e.match(vr);return t?t[0]:``})(e);r!==n&&V.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}(a.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o=`; expires=`+l.toUTCString()}i&&(s=`; secure`);var u=e+`=`+encodeURIComponent(JSON.stringify(t))+o+`; SameSite=Lax; path=/`+c+s;return u.length>3686.4&&V.warn(`cookieStore warning: large cookie, len=`+u.length),a.cookie=u,u}catch{return}},F(e,t){if(a!=null&&a.cookie)try{yr.M(e,``,-1,t)}catch{return}}},br=null,K={R(){if(!P(br))return br;var e=!0;if(M(n))e=!1;else try{var t=`__mplssupport__`;K.M(t,`xyz`),K.O(t)!==`"xyz"`&&(e=!1),K.F(t)}catch{e=!1}return e||V.error(`localStorage unsupported; falling back to cookie store`),br=e,e},B(e){V.error(`localStorage error: `+e)},O(e){try{return n?.localStorage.getItem(e)}catch(e){K.B(e)}return null},Z(e){try{return JSON.parse(K.O(e))||{}}catch{}return null},M(e,t){try{n?.localStorage.setItem(e,JSON.stringify(t))}catch(e){K.B(e)}},F(e){try{n?.localStorage.removeItem(e)}catch(e){K.B(e)}}},xr=[Yt,`distinct_id`,pn,mn,Rn,Ln,Mn],Sr={},Cr={R:()=>!0,B(e){V.error(`memoryStorage error: `+e)},O:e=>Sr[e]||null,Z:e=>Sr[e]||null,M(e,t){Sr[e]=t},F(e){delete Sr[e]}},wr=null,q={R(){if(!P(wr))return wr;if(wr=!0,M(n))wr=!1;else try{var e=`__support__`;q.M(e,`xyz`),q.O(e)!==`"xyz"`&&(wr=!1),q.F(e)}catch{wr=!1}return wr},B(e){V.error(`sessionStorage error: `,e)},O(e){try{return n?.sessionStorage.getItem(e)}catch(e){q.B(e)}return null},Z(e){try{return JSON.parse(q.O(e))||null}catch{}return null},M(e,t){try{n?.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){q.B(e)}},F(e){try{n?.sessionStorage.removeItem(e)}catch(e){q.B(e)}}},Tr=class{constructor(e){this._instance=e}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===Kn||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Gn}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(e){this.nr.M(this.sr,+!!e,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get ir(){var e=this.nr.O(this.sr);return ce(e)?1:C(le,e)?0:-1}get nr(){var e=this.Bt.opt_out_capturing_persistence_type,t=e===`localStorage`?K:yr;if(!this.ar||this.ar!==t){this.ar=t;var n=e===`localStorage`?yr:K;n.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(ce(n.O(this.sr))),n.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[i?.doNotTrack,i?.msDoNotTrack,f.doNotTrack].some((e=>ce(e)))}},Er=H(`[Dead Clicks]`),Dr=()=>!0,Or=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(an)),r=e.instance.config.capture_dead_clicks;return L(r)?r:!!A(r)||n},kr=class{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[an]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?Er.error(`failed to load script`,t):e()}))}hr(){var e;if(a){if(!this.lr&&(e=f.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=A(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=f.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(a),Er.info(`starting...`)}}else Er.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,Er.info(`stopping...`))}},Ar=H(`[SegmentIntegration]`),jr=`posthog-js`;function Mr(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>_({},e,{stacktrace:e.stacktrace?_({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>_({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var Nr=class{constructor(e,t,n,r,i,a){this.name=jr,this.setupOnce=function(o){o(Mr(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},Pr=class{constructor(e){this.cr=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(V.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){this.pr=this._instance.sessionManager?.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(e,t){var r=this.gr(e,t);return this.dr={pathname:n?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){return this.gr(e,this.dr?.pageViewId)}doEvent(){return{$pageview_id:this.dr?.pageViewId}}gr(e,t){var n=this.dr;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;if(!(M(a)||M(o)||M(s)||M(c)||M(l)||M(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?ue(o/a,0,1,V):1,f=a>1?ue(s/a,0,1,V):1,p=c>1?ue(l/c,0,1,V):1,m=c>1?ue(u/c,0,1,V):1;r=W(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Fr={[Jt]:{exposure:`hidden`},[Xt]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Zt]:{exposure:`hidden`},[Qt]:{exposure:`event`},[$t]:{exposure:`hidden`},[en]:{exposure:`event`},[tn]:{exposure:`hidden`},[nn]:{exposure:`event`},[rn]:{exposure:`event`},[an]:{exposure:`event`},[on]:{exposure:`hidden`},[sn]:{exposure:`event`},[cn]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[pn]:{exposure:`hidden`},[mn]:{exposure:`event`},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},[hn]:{exposure:`derived`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!A(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[gn]:{exposure:`event`},[_n]:{exposure:`hidden`},[vn]:{exposure:`hidden`},[yn]:{exposure:`event`},[bn]:{exposure:`event`},[xn]:{exposure:`event`},[Sn]:{exposure:`hidden`},[Cn]:{exposure:`hidden`},[wn]:{exposure:`hidden`},[Tn]:{exposure:`hidden`},[En]:{exposure:`event`},[Dn]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[On]:{exposure:`hidden`},[kn]:{exposure:`hidden`},[An]:{exposure:`hidden`},[jn]:{exposure:`hidden`},[Mn]:{exposure:`hidden`},[Nn]:{exposure:`hidden`},[Pn]:{exposure:`hidden`},[Fn]:{exposure:`hidden`},[In]:{exposure:`hidden`},[Ln]:{exposure:`hidden`},[Rn]:{exposure:`hidden`},[ln]:{exposure:`event`},[un]:{exposure:`event`},[dn]:{exposure:`event`},[fn]:{exposure:`event`},[Vn]:{exposure:`event`},[Hn]:{exposure:`event`},[Un]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Ir=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],Lr=e=>{var t=a?.createElement(`a`);return M(t)?null:(t.href=e,t)},Rr=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!O(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{V.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},zr=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);O(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},Br=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Vr=`https?://(.*)`,Hr=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],Ur=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...Hr],Wr=`<masked>`,Gr=[`li_fat_id`];function Kr(e,t,n){if(!a)return{};var r,i=t?[...Hr,...n||[]]:[],o=qr(zr(a.URL,i,Wr),e);return W((r={},U(Gr,(function(e){var t=yr.O(e);r[e]=t||null})),r),o)}function qr(e,t){var n=Ur.concat(t||[]),r={};return U(n,(function(t){r[t]=Rr(e,t)||null})),r}function Jr(e){var t=function(e){return e?e.search(Vr+`google.([^/?]*)`)===0?`google`:e.search(Vr+`bing.com`)===0?`bing`:e.search(Vr+`yahoo.com`)===0?`yahoo`:e.search(Vr+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,r={};if(!P(t)){r.$search_engine=t;var i=a?Rr(a.referrer,n):``;i.length&&(r.ph_keyword=i)}return r}function Yr(){return navigator.language||navigator.userLanguage}var Xr=`$direct`;function Zr(){return a?.referrer||Xr}function Qr(e,t){var n=e?[...Hr,...t||[]]:[],r=o?.href.substring(0,1e3);return{r:Zr().substring(0,1e3),u:r?zr(r,n,Wr):void 0}}function $r(e){var{r:t,u:n}=e,r={$referrer:t,$referring_domain:t==null?void 0:t==Xr?Xr:Lr(t)?.host};if(n){r.$current_url=n;var i=Lr(n);r.$host=i?.host,r.$pathname=i?.pathname,W(r,qr(n))}return t&&W(r,Jr(t)),r}function ei(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ti(){try{return new Date().getTimezoneOffset()}catch{return}}var ni=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],ri=class{constructor(e,t){this.Bt=e,this.props={},this.mr=!1,this.yr=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(e),this.nr=this.br(e),this.load(),e.debug&&V.info(`Persistence loaded`,e.persistence,_({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wr}br(e){ni.indexOf(e.persistence.toLowerCase())===-1&&(V.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t=function(e){e===void 0&&(e=[]);var t=[...xr,...e];return _({},K,{Z(e){try{var t={};try{t=yr.Z(e)||{}}catch{}var n=W(t,JSON.parse(K.O(e)||`{}`));return K.M(e,n),n}catch{}return null},M(e,n,r,i,a,o){try{K.M(e,n,void 0,void 0,o);var s={};t.forEach((e=>{n[e]&&(s[e]=n[e])})),Object.keys(s).length&&yr.M(e,s,r,i,a,o)}catch(e){K.B(e)}},F(e,t){try{n?.localStorage.removeItem(e),yr.F(e,t)}catch(e){K.B(e)}}})}(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r===`localstorage`&&K.R()?K:r===`localstorage+cookie`&&t.R()?t:r===`sessionstorage`&&q.R()?q:r===`memory`?Cr:r===`cookie`?yr:t.R()?t:yr}_r(e){var t=e??this.Bt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[jn];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return U(this.props,((t,n)=>{var r=(e=>{var t=Fr[e];if(t)return t;for(var[n,r]of Ir)if(e.indexOf(n)===0)return r})(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===hn?()=>this._r():()=>!1))return;r.transformToEventProperties&&W(e,r.transformToEventProperties(t))}else r&&r.exposure!==`event`||(e[n]=t)})),e}load(){if(!this.wr){var e=this.nr.Z(this.yr);e&&(this.props=W({},e))}}save(){this.wr||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(A(e)){M(t)&&(t=`None`),this.Ir=M(n)?this.kr:n;var r=!1;if(U(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Tr(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(A(e)){this.Ir=M(t)?this.kr:t;var n=!1;if(U(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Tr(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ar(e),this.save())}update_campaign_params(){if(!this.mr){var e=Kr(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);j(or(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=a?.referrer)?Jr(e):{})}update_referrer_info(){this.register_once({$referrer:Zr(),$referring_domain:a!=null&&a.referrer&&Lr(a.referrer)?.host||Xr},void 0)}set_initial_person_info(){this.props[Fn]||this.props[In]||this.register_once({[Ln]:Qr(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};U([In,Fn],(t=>{var n=this.props[t];n&&U(n,(function(t,n){e[`$initial_`+T(n)]=t}))}));var t,n,r=this.props[Ln];return r&&W(e,(t=$r(r),n={},U(t,(function(e,t){n[`$initial_`+T(t)]=e})),n)),e}safe_merge(e){return U(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){if(this.kr=this.Ir=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.br(e),i=this.props;this.clear(),this.nr=r,this.props=i,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_secure(e){e!==this.Sr&&(this.Sr=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[Zt]||{};n[e]=t,this.Tr(Zt,n),this.save()}remove_event_timer(e){var t=this.props[Zt]||{},n=t[e];return M(n)||(delete t[e],this.Tr(Zt,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Ar(e){delete this.props[e]}},ii={Activation:`events`,Cancellation:`cancelEvents`},ai={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},oi={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},si={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},ci={Popover:`popover`,Inline:`inline`},li={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},ui={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},di=H(`[RateLimiter]`),fi=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{di.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){di.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(Pn)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(Pn,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},pi=H(`[RemoteConfig]`),mi=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=f._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Er(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}Rr(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return pi.info(`Using preloaded remote config`,this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void pi.warn(`Remote config is disabled. Falling back to local config.`);this.Er((e=>{if(!e)return pi.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.Rr((e=>{this.Nr(e),this.Mr()}));this.Nr(e),this.Mr()}))}catch(e){pi.error(`Error loading remote config`,e)}}stop(){this.Or&&=(clearInterval(this.Or),void 0)}refresh(){this._instance.Fr()||a?.visibilityState===`hidden`||this._instance.reloadFeatureFlags()}Mr(){if(!this.Or){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.Or=setInterval((()=>{this.refresh()}),e))}}Nr(e){var t;e||pi.error(`Failed to fetch remote config from PostHog.`),this._instance.Nr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},hi={GZipJS:`gzip-js`,Base64:`base64`},J=Uint8Array,Y=Uint16Array,gi=Uint32Array,_i=new J([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,0,0,0]),vi=new J([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,0,0]),yi=new J([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bi=function(e,t){for(var n=new Y(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new gi(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},xi=bi(_i,2),Si=xi[1];xi[0][28]=258,Si[258]=28;for(var Ci=bi(vi,0)[1],wi=new Y(32768),X=0;32768>X;++X){var Ti=(43690&X)>>>1|(21845&X)<<1;wi[X]=((65280&(Ti=(61680&(Ti=(52428&Ti)>>>2|(13107&Ti)<<2))>>>4|(3855&Ti)<<4))>>>8|(255&Ti)<<8)>>>1}var Ei=function(e,t,n){for(var r=e.length,i=0,a=new Y(t);r>i;++i)++a[e[i]-1];var o,s=new Y(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new Y(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[wi[d]>>>c]=l}else for(o=new Y(r),i=0;r>i;++i)o[i]=wi[s[e[i]-1]++]>>>15-e[i];return o},Di=new J(288);for(X=0;144>X;++X)Di[X]=8;for(X=144;256>X;++X)Di[X]=9;for(X=256;280>X;++X)Di[X]=7;for(X=280;288>X;++X)Di[X]=8;var Oi=new J(32);for(X=0;32>X;++X)Oi[X]=5;var ki=Ei(Di,9,0),Ai=Ei(Oi,5,0),ji=function(e){return(e/8>>0)+(7&e&&1)},Mi=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Y?Y:e instanceof gi?gi:J)(n-t);return r.set(e.subarray(t,n)),r},Ni=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Pi=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Fi=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new J(0),0];if(i==1){var o=new J(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new Y(f+1),m=Ii(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new J(p),m]},Ii=function(e,t,n){return e.s==-1?Math.max(Ii(e.l,t,n+1),Ii(e.r,t,n+1)):t[e.s]=n},Li=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Y(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Ri=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},zi=function(e,t,n){var r=n.length,i=ji(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Bi=function(e,t,n,r,i,a,o,s,c,l,u){Ni(t,u++,n),++i[256];for(var d=Fi(i,15),f=d[0],p=d[1],m=Fi(a,15),h=m[0],g=m[1],_=Li(f),v=_[0],y=_[1],b=Li(h),x=b[0],S=b[1],C=new Y(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var T=Fi(C,7),E=T[0],ee=T[1],D=19;D>4&&!E[yi[D-1]];--D);var O,k,A,j,M=l+5<<3,N=Ri(i,Di)+Ri(a,Oi)+o,te=Ri(i,f)+Ri(a,h)+o+14+3*D+Ri(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(N>=M&&te>=M)return zi(t,u,e.subarray(c,c+l));if(Ni(t,u,1+(N>te)),u+=2,N>te){O=Ei(f,p,0),k=f,A=Ei(h,g,0),j=h;var P=Ei(E,ee,0);for(Ni(t,u,y-257),Ni(t,u+5,S-1),Ni(t,u+10,D-4),u+=14,w=0;D>w;++w)Ni(t,u+3*w,E[yi[w]]);u+=3*D;for(var F=[v,x],I=0;2>I;++I){var ne=F[I];for(w=0;ne.length>w;++w)Ni(t,u,P[L=31&ne[w]]),u+=E[L],L>15&&(Ni(t,u,ne[w]>>>5&127),u+=ne[w]>>>12)}}else O=ki,k=Di,A=Ai,j=Oi;for(w=0;s>w;++w)if(r[w]>255){var L;Pi(t,u,O[257+(L=r[w]>>>18&31)]),u+=k[L+257],L>7&&(Ni(t,u,r[w]>>>23&31),u+=_i[L]);var R=31&r[w];Pi(t,u,A[R]),u+=j[R],R>3&&(Pi(t,u,r[w]>>>5&8191),u+=vi[R])}else Pi(t,u,O[r[w]]),u+=k[r[w]];return Pi(t,u,O[256]),u+k[256]},Vi=new gi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Hi=function(){for(var e=new gi(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ui=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Wi(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=Hi[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new J(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=zi(c,l,e.subarray(u,d)):(c[u]=!0,l=zi(c,l,e.subarray(u,o)))}else{for(var f=Vi[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new Y(32768),_=new Y(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new gi(25e3),S=new Y(288),C=new Y(32),w=0,T=0,E=(u=0,0),ee=0,D=0;o>u;++u){var O=b(u),k=32767&u,A=_[O];if(g[k]=A,_[O]=k,u>=ee){var j=o-u;if((w>7e3||E>24576)&&j>423){l=Bi(e,c,0,x,S,C,T,E,D,u-D,l),E=w=T=0,D=u;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)C[M]=0}var N=2,te=0,P=m,F=k-A&32767;if(j>2&&O==b(u-F))for(var I=Math.min(p,j)-1,ne=Math.min(32767,u),L=Math.min(258,j);ne>=F&&--P&&k!=A;){if(e[u+N]==e[u+N-F]){for(var R=0;L>R&&e[u+R]==e[u+R-F];++R);if(R>N){if(N=R,te=F,R>I)break;var re=Math.min(F,R-2),ie=0;for(M=0;re>M;++M){var ae=u-F+M+32768&32767,oe=ae-g[ae]+32768&32767;oe>ie&&(ie=oe,A=ae)}}}F+=(k=A)-(A=g[k])+32768&32767}if(te){x[E++]=268435456|Si[N]<<18|Ci[te];var se=31&Si[N],ce=31&Ci[te];T+=_i[se]+vi[ce],++S[257+se],++C[ce],ee=u+N,++w}else x[E++]=e[u],++S[e[u]]}}l=Bi(e,c,!0,x,S,C,T,E,D,u-D,l)}return Mi(s,0,r+ji(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Ui(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Ui(l,u-8,n.d()),Ui(l,u-4,r),l}var Gi=!!c||!!s,Ki=`text/plain`,qi=!1,Ji=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=_({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return U(e,(function(e,t){M(e)||M(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},Yi=(e,t)=>JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t),Xi=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===hi.GZipJS){var r=Wi(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new J(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new J(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return Mi(r,0,i)}(Yi(t)),{mtime:0});return{contentType:Ki,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===hi.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:Yi(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(Yi(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=Yi(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},Zi=function(){var e=g((function*(e){var t=yield function(e,t,n){return y.apply(this,arguments)}(Yi(e.data),m.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return _({},e,{tr:{contentType:Ki,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Qi=(e,t)=>Ji(e,{_:new Date().getTime().toString(),ver:m.JS_SDK_VERSION,compression:t}),$i=[];s&&$i.push({transport:`fetch`,method(e){var{contentType:t,body:n,estimatedSize:r}=Xi(e)??{},i=new Headers;U(e.headers,(function(e,t){i.append(t,e)})),t&&i.append(`Content-Type`,t);var a=e.url,o=null;if(l){var c=new l;o={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}s(a,_({method:e?.method||`GET`,headers:i,keepalive:e.method===`POST`&&52428.8>(r||0),body:n,signal:o?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){V.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{V.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>o?clearTimeout(o.timeout):null))}}),c&&$i.push({transport:`XHR`,method(e){var t=new c;t.open(e.method||`GET`,e.url,!0);var{contentType:n,body:r}=Xi(e)??{};U(e.headers,(function(e,n){t.setRequestHeader(n,e)})),n&&t.setRequestHeader(`Content-Type`,n),e.timeout&&(t.timeout=e.timeout),e.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}e.callback==null||e.callback(n)}},t.send(r)}}),i!=null&&i.sendBeacon&&$i.push({transport:`sendBeacon`,method(e){var t=Ji(e.url,{beacon:`1`});try{var{contentType:n,body:r}=Xi(e)??{};if(!r)return;var a=r instanceof Blob?r:new Blob([r],{type:n});i.sendBeacon(t,a)}catch{}}});var ea=3e3,ta=class{constructor(e,t){this.Pr=!0,this.Lr=[],this.Dr=ue(t?.flush_interval_ms||ea,250,5e3,V.createLogger(`flush interval`),ea),this.Br=e}enqueue(e){this.Lr.push(e),this.jr||this.$r()}unload(){this.qr();var e=this.Lr.length>0?this.Zr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Br(_({},e,{transport:`sendBeacon`}))}))}enable(){this.Pr=!1,this.$r()}$r(){var e=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var t=this.Zr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&O(n.data)&&U(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Br(n)};for(var r in t)n()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var e={};return U(this.Lr,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;M(e[i])&&(e[i]=_({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.Lr=[],e}},na=[`retriesPerformedSoFar`],ra=class{constructor(e){this.Hr=!1,this.Vr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.zr=!0,!M(n)&&`onLine`in n.navigator&&(this.zr=n.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},G(n,`online`,this.Ur),G(n,`offline`,this.Gr))}get length(){return this.Lr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=v(e,na);ne(t)&&(n.url=Ji(n.url,{retry_count:t})),this._instance._send_request(_({},n,{callback:e=>{e.statusCode===200||e.statusCode>=400&&500>e.statusCode||(t??0)>=10?n.callback==null||n.callback(e):this.Wr(_({retriesPerformedSoFar:t},n))}}))}Wr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this.Lr.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),V.warn(i),this.Hr||(this.Hr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Hr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Vr)}Yr(){var e=Date.now(),t=[],n=this.Lr.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.Lr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Jr&&=(clearTimeout(this.Jr),void 0),this.Hr=!1,M(n)||(this.Ur&&=(n.removeEventListener(`online`,this.Ur),void 0),this.Gr&&=(n.removeEventListener(`offline`,this.Gr),void 0)),this.Lr))try{this._instance._send_request(_({},e,{transport:`sendBeacon`}))}catch(e){V.error(e)}this.Lr=[]}},ia=class{constructor(e){this.Kr=()=>{this.Qr||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(t),this.Qr.maxScrollY=Math.max(t,this.Qr.maxScrollY??0),this.Qr.maxScrollHeight=Math.max(n,this.Qr.maxScrollHeight??0),this.Qr.lastContentY=r,this.Qr.maxContentY=Math.max(r,this.Qr.maxContentY??0),this.Qr.maxContentHeight=Math.max(i,this.Qr.maxContentHeight??0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Kr,0),e}startMeasuringScrollPosition(){G(n,`scroll`,this.Kr,{capture:!0}),G(n,`scrollend`,this.Kr,{capture:!0}),G(n,`resize`,this.Kr)}scrollElement(){if(!this.ei)return n?.document.documentElement;for(var e of O(this.ei)?this.ei:[this.ei]){var t=n?.document.querySelector(e);if(t)return t}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return n&&(n.scrollY||n.pageYOffset||n.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return n&&(n.scrollX||n.pageXOffset||n.document.documentElement.scrollLeft)||0}},aa=e=>Qr(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),oa=class{constructor(e,t,n,r){this.ti=e=>{var t=this.ri();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.ii(this._instance)};this.ni.register({[Nn]:n})}},this._instance=e,this.si=t,this.ni=n,this.ii=r||aa,this.si.onSessionId(this.ti)}ri(){return this.ni.props[Nn]}getSetOnceProps(){var e=this.ri()?.props;return e?`r`in e?$r(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return U(or(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+T(n)]=t})),e}},sa=class{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.oi[e]||[])n(t);for(var r of this.oi[`*`]||[])r(e,t)}},ca=H(`[SessionId]`),la=class{on(e,t){return this.ai.on(e,t)}constructor(e,t,n){var r;if(this.li=[],this.ui=void 0,this.ai=new sa,this.hi=(e,t)=>!(!ne(e)||!ne(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Kn)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Bt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||hr,this.fi=n||hr;var i=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*ue(this.Bt.session_idle_timeout_seconds||1800,60,36e3,ca.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi=`ph_`+i+`_window_id`,this.mi=`ph_`+i+`_primary_window_exists`,this.yi()){var a=q.Z(this.gi),o=q.Z(this.mi);a&&!o?this.ci=a:q.F(this.gi),q.M(this.mi,!0)}if((r=this.Bt.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Bt.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),s)}catch(e){ca.error(`Invalid sessionID in bootstrap`,e)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return M(this.li)&&(this.li=[]),this.li.push(e),this.di&&e(this.di,this.ci),()=>{this.li=this.li.filter((t=>t!==e))}}yi(){return this.Bt.persistence!==`memory`&&!this.ni.wr&&q.R()}Ii(e){e!==this.ci&&(this.ci=e,this.yi()&&q.M(this.gi,e))}Ci(){return this.ci?this.ci:this.yi()?q.Z(this.gi):null}bi(e,t,n){e===this.di&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[pn]:[t,e,n]}))}Si(){var e=this.ni.props[pn];return O(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&n&&(n.removeEventListener(Zn,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&q.F(this.mi)},G(n,Zn,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Bt.cookieless_mode===Kn)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[r,i,a]=this.Si(),o=this.Ci(),s=ne(a)&&Math.abs(n-a)>864e5,c=!1,l=!i,u=!l&&!e&&this.hi(n,r);l||u||s?(i=this.vi(),o=this.fi(),ca.info(`new session ID generated`,{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}}),a=n,c=!0):o||(o=this.fi(),c=!0);var d=ne(r)&&e&&!s?r:n,f=ne(a)?a:new Date().getTime();return this.Ii(o),this.bi(i,d,f),e||this.pi(),c&&this.li.forEach((e=>e(i,o,c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:r}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[e]=this.Si();if(this.hi(new Date().getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit(`forcedIdleReset`,{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}},ua=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&x(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>x(e?.brand,t))))return!0}catch{}return!!e.webdriver},da=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function fa(e,t,n){return Yi({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var pa={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>da(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!da(t,e))))),icontains:(e,t)=>t.map(ma).some((t=>e.map(ma).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(ma).every((t=>e.map(ma).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},ma=e=>e.toLowerCase();function ha(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(M(i)||P(i))return!1;var a=[String(i)],o=pa[r.operator];return!!o&&o(r.values,a)}))}var ga,_a,va=`custom`,ya=`i.posthog.com`,ba=/^\/static\//,xa=class{constructor(e){this.ki={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+ya,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:va),this.ki[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t==`string`&&ba.test(e))return t.trim().replace(/\/$/,``)||void 0}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.Ti(t);if(n)return``+n+t}if(this.region===va)return this.apiHost+t;var r=ya+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}};ga===void 0&&(ga=e=>e()),_a===void 0&&(_a=console),_a.log.bind(_a),_a.warn.bind(_a),_a.error.bind(_a),_a.debug.bind(_a);var Z=H(`[Surveys]`),Sa=`seenSurvey_`,Ca=[ai.Popover,ai.Widget,ai.API],wa={ignoreConditions:!1,ignoreDelay:!1,displayType:ci.Popover},Ta=H(`[PostHog ExternalIntegrations]`),Ea={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},Da=class{constructor(e){this._instance=e}ur(e,t){var n;(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Ta.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=f.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.ur(Ea[t],(()=>{var n;(n=f.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=f.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=f.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},Oa,ka={},Aa=0,ja=()=>{},Ma=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,Na=`Surveys module not available`,Pa=`sanitize_properties is deprecated. Use before_send instead`,Fa=`Invalid value for property_denylist config: `,Ia=`posthog`,La=!Gi&&d?.indexOf(`MSIE`)===-1&&d?.indexOf(`Mozilla`)===-1,Ra=e=>{var t;return _({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,token:``,autocapture:!0,cross_subdomain_cookie:cr(a?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:ja,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:e??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:o&&N(o?.search)&&o.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(n==null||(t=n.location)==null?void 0:t.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){V.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Yn,before_send:void 0,request_queue_config:{flush_interval_ms:ea},error_tracking:{},_onCapture:ja,__preview_eager_load_replay:!1},(e=>({rageclick:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},za=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],Ba=e=>{var t={};for(var[n,r]of za)M(e[n])||(t[r]=e[n]);var i=W({},t,e);return O(e.property_blacklist)&&(M(e.property_denylist)?i.property_denylist=e.property_blacklist:O(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:V.error(Fa+e.property_denylist)),i},Va=class{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(e){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ha=class e{Ei(e,t){if(e){var n=this.Ri.indexOf(e);n!==-1&&this.Ri.splice(n,1)}return this.Ri.push(t),t.initialize==null||t.initialize(),t}Ni(){return this.config.cookieless_mode===Kn||this.config.cookieless_mode===Gn&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new Va,this.Mi=!1,this.version=m.LIB_VERSION,this.Fi=new sa,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ra(),this.SentryIntegration=Nr,this.sentryIntegration=e=>function(e,t){var n=Mr(e,t);return{name:jr,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new ia(this),this.pageViewManager=new Pr(this),this.rateLimiter=new fi(this),this.requestRouter=new xa(this),this.consent=new Tr(this),this.externalIntegrations=new Da(this);var t=e.__defaultExtensionClasses??{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,n)=>{var r=N(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=N(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>V.info(`send "`+e?.event+`"`,e)))}init(t,n,r){if(r&&r!==Ia){var i=ka[r]??new e;return i._init(t,n,r),ka[r]=i,ka[Ia][r]=i,i}return this._init(t,n,r)}_init(e,t,r){var i;if(t===void 0&&(t={}),M(e)||te(e))return V.critical(`PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()`),this;if(this.__loaded)return console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},t.debug=this.Bi(t.debug),this.ji=t,this.$i=[],t.person_profiles?this.Li=t.person_profiles:t.process_person&&(this.Li=t.process_person),this.set_config(W({},Ra(t.defaults),Ba(t),{name:r,token:e})),this.config.on_xhr_error&&V.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=t.disable_compression?void 0:hi.GZipJS;var a=this.qi();this.persistence=new ri(this.config,a),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new ri(_({},this.config,{persistence:`sessionStorage`}),a);var o=_({},this.persistence.props),s=_({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new ta((e=>this.Hi(e)),this.config.request_queue_config),this.Vi=new ra(this),this.__request_queue=[];var c=this.Ni();if(c||(this.sessionManager=new la(this),this.sessionPropsManager=new oa(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.zi(c)}),0)):(V.info(`Initializing extensions synchronously`),this.zi(c)),m.DEBUG=m.DEBUG||this.config.debug,m.DEBUG&&V.info(`Starting in debug mode`,{this:this,config:t,thisC:_({},this.config),p:o,s}),!this.config.identity_distinct_id||(i=t.bootstrap)!=null&&i.distinctID||(t.bootstrap=_({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),t.bootstrap?.distinctID!==void 0){var l=t.bootstrap.distinctID,u=this.get_distinct_id(),d=this.persistence.get_property(Mn);if(t.bootstrap.isIdentifiedID&&u!=null&&u!==l&&d===qn)this.identify(l);else if(t.bootstrap.isIdentifiedID&&u!=null&&u!==l&&d===Jn)V.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var f=this.config.get_device_id(hr()),p=t.bootstrap.isIdentifiedID?f:l;this.persistence.set_property(Mn,t.bootstrap.isIdentifiedID?Jn:qn),this.register({distinct_id:l,$device_id:p})}}if(c)this.register_once({distinct_id:Bn,$device_id:null},``);else if(!this.get_distinct_id()){var h=this.config.get_device_id(hr());this.register_once({distinct_id:h,$device_id:h},``),this.persistence.set_property(Mn,qn)}return G(n,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||hr();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Mn,Jn)),t()},i=n.user();`then`in i&&k(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Ar.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Ar.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ar.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Qn),identify:e=>t(e,er),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.Ui())):this.Ui(),k(this.config._onCapture)&&this.config._onCapture!==ja&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&V.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(t){var n=performance.now(),r=_({},e.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Ri.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Ri.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Ri.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Ri.push(new r.tracingHeaders(this)),r.siteApps&&this.Ri.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.Ri.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Ri.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Ri.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Ri.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Ri.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Ri.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Ri.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Ri.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Or)),r.toolbar&&this.Ri.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Ri.push(this.experiments=this.experiments??new r.experiments(this)),this.Ri.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Nr(e)}})),this.Gi(i,n)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Gi(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){V.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Vn]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Hn]:r}),this.config.__preview_deferred_init_extensions&&V.info(`PostHog extensions initialized (`+r+`ms)`)}Nr(e){var t;if(!a||!a.body)return V.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.Nr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.Wi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=C(e.supportedCompression,hi.GZipJS)?hi.GZipJS:C(e.supportedCompression,hi.Base64)?hi.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:Yn}),this.Ri.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}Ui(){try{this.config.loaded(this)}catch(e){V.critical("`loaded` function failed",e)}if(this.Xi(),this.config.internal_or_test_user_hostname&&o!=null&&o.hostname){var e=o.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new mi(this),this.Ki.load()}Xi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&nr(this.__request_queue,(e=>this.Hi(e))),this.__request_queue=[],this.Xi()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture($n),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.Zi)==null||n.unload(),(r=this.Vi)==null||r.unload()):this.Qi()&&this.capture($n,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded&&(La?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Ji(e.url,{ip:+!!this.config.ip}),e.headers=_({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=_({},e);t.timeout=t.timeout||6e4,t.url=Qi(t.url,t.compression);var n=t.transport??`fetch`,r=$i.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===hi.GZipJS&&u&&!qi?Zi(t).then((e=>{i(e)})).catch((n=>{if((e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`)(n))return qi=!0,void i(_({},t,{compression:void 0,url:Qi(e.url,void 0)}));i(t)})):i(t)})(_({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))))}Hi(e){this.Vi?this.Vi.retriableRequest(e):this._send_request(e)}_execute_array(e){Aa++;try{var t,n=[],r=[],i=[];nr(e,(e=>{e&&(O(t=e[0])?i.push(e):k(e)?e.call(this):O(e)&&t===`alias`?n.push(e):O(e)&&t.indexOf(`capture`)!==-1&&k(this[t])?i.push(e):r.push(e))}));var a=function(e,t){nr(e,(function(e){if(O(e[0])){var n=t;U(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};a(n,this),a(r,this),a(i,this)}finally{Aa--}}push(t){if(Aa>0&&O(t)&&N(t[0])){var n=e.prototype[t[0]];k(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!M(e)&&N(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!N(t?.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.en||V.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=hr(),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Qn&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p,m,h,g=this.tn(n?.$set_once,e!==tr,e===er);if(g&&(f.$set_once=g),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>N(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),O(t)?(r=[],nr(t,(t=>{r.push(e(t))}))):(r={},U(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,M(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===oi.DISMISSED||e===oi.SENT){var v=t?.[si.SURVEY_ID],y=t?.[si.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>{var n=``+Sa+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+Sa+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){Z.error(`Failed to persist survey seen state`,e)}})({id:v,current_iteration:y}),f.$set=_({},f.$set,{[(p={id:v,current_iteration:y},m=e===oi.SENT?`responded`:`dismissed`,h=`$survey_`+m+`/`+p.id,p.current_iteration&&p.current_iteration>0&&(h=`$survey_`+m+`/`+p.id+`/`+p.current_iteration),h)]:!0})}else e===oi.SHOWN&&(f.$set=_({},f.$set,{[si.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===li.SHOWN){var b=t?.[ui.TOUR_TYPE];b&&(f.$set=_({},f.$set,{[ui.TOUR_LAST_SEEN_DATE+`/`+b]:new Date().toISOString()}))}var x=_({},f.properties.$set,f.$set);if(j(x)||this.setPersonPropertiesForFlags(x),!F(this.config.before_send)){var S=this.rn(f);if(!S)return;f=S}this.Fi.emit(`eventCaptured`,f);var C={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Hi(C):this.Zi.enqueue(C),f}V.critical(`This capture call is ignored due to client rate limiting.`)}}else V.error(`No event name provided to posthog.capture`)}else V.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}calculateEventProperties(e,t,r,i,s){if(r||=new Date,!this.persistence||!this.sessionPersistence)return t;var c=s?void 0:this.persistence.remove_event_timer(e),l=_({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.Ni()&&(l.$cookieless_mode=!0),e===`$snapshot`){var u=_({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!N(l.distinct_id)&&!I(l.distinct_id)||te(l.distinct_id))&&V.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),l}var f,p=function(e,t){var r,i,a;if(!d)return{};var s,c,l,u,f=e?[...Hr,...t||[]]:[],[p,h]=function(e){for(var t=0;st.length>t;t++){var[n,r]=st[t],i=n.exec(e),a=i&&(k(r)?r(i,e):r);if(a)return a}return[``,``]}(d);return W(or({$os:p,$os_version:h,$browser:it(d,navigator.vendor),$device:ct(d),$device_type:(c=d,l={userAgentDataPlatform:(r=navigator)==null||(r=r.userAgentData)==null?void 0:r.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:n==null||(i=n.screen)==null?void 0:i.width,screenHeight:n==null||(a=n.screen)==null?void 0:a.height,devicePixelRatio:n?.devicePixelRatio},u=ct(c),u===be||u===ye||u===`Kobo`||u===`Kindle Fire`||u===Xe?ve:u===ze||u===Ve||u===Be||u===qe?`Console`:u===Se?`Wearable`:u?z:l?.userAgentDataPlatform===`Android`&&(l?.maxTouchPoints??0)>0?600>Math.min(l?.screenWidth??0,l?.screenHeight??0)/(l?.devicePixelRatio??1)?z:ve:`Desktop`),$timezone:ei(),$timezone_offset:ti()}),{$current_url:zr(o?.href,f,Wr),$host:o?.host,$pathname:o?.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+`...`:d,$browser_version:ot(d,navigator.vendor),$browser_language:Yr(),$browser_language_prefix:(s=Yr(),typeof s==`string`?s.split(`-`)[0]:void 0),$screen_height:n?.screen.height,$screen_width:n?.screen.width,$viewport_height:n?.innerHeight,$viewport_width:n?.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());l.$session_id=h,l.$window_id=g}this.sessionPropsManager&&W(l,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&W(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=this.Vi?.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===va&&(l.$lib_custom_api_host=this.config.api_host),f=e!==Qn||s?e!==$n||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),l=W(l,f),e===Qn&&a&&(l.title=a.title),!M(c)){var v=r.getTime()-c;l.$duration=parseFloat((v/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?`bot`:`browser`),(l=W({},p,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),O(this.config.property_denylist)?U(this.config.property_denylist,(function(e){delete l[e]})):V.error(Fa+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(V.error(Pa),l=y(l,e));var b=this.nn();return l.$process_person_profile=b,b&&!s&&this.sn(`_calculate_event_properties`),l}tn(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.nn()||this.Mi&&!n)return e;var r=W({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(V.error(Pa),r=i(r,`$set_once`)),t&&(this.Mi=!0),j(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}an(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Fi.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Na}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Na})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Na})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=wa),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:Na}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:Na})}ln(e){return!e||te(e)?(V.critical(`Unique user id has not been set in posthog.identify`),!1):e===Bn?(V.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(V.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return V.uninitializedWarning(`posthog.identify`);if(I(e)&&(e=e.toString(),V.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.ln(e)&&this.sn(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Yt)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(Xt)&&(this.unregister(Xt),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Mn)||qn)===qn;e!==r&&a?(this.persistence.set_property(Mn,Jn),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(er,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Di=fa(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(On))}}setPersonProperties(e,t){if((e||t)&&this.sn(`posthog.setPersonProperties`)){var n=fa(this.get_distinct_id(),e,t);this.Di===n?V.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Di=n)}}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:_({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(tr,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else V.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.sn(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c;if(V.info(`reset`),!this.__loaded)return V.uninitializedWarning(`posthog.reset`);var l=this.get_property(Yt);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),(r=this.surveys)==null||r.reset(),(i=this.Ki)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.persistence)==null||s.set_property(Mn,qn),(c=this.sessionManager)==null||c.resetSessionId(),this.Di=null,this.config.cookieless_mode===Kn)this.register_once({distinct_id:Bn,$device_id:null},``);else{var u=this.config.get_device_id(hr());this.register_once({distinct_id:u,$device_id:e?u:l},``)}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.un()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.hn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Jt)?(V.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.sn(`posthog.alias`)?(M(t)&&(t=this.get_distinct_id()),e===t?(V.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.an(Xt,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=_({},this.config);if(A(e)){var n,r,i,a,o,s,c,l,u,d;W(this.config,Ba(e));var f=this.qi();(n=this.persistence)==null||n.update_config(this.config,t,f),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new ri(_({},this.config,{persistence:`sessionStorage`}),f);var p=this.Bi(this.config.debug);L(p)&&(this.config.debug=p),L(this.config.debug)&&(this.config.debug?(m.DEBUG=!0,K.R()&&K.M(`ph_debug`,!0),V.info(`set_config`,{config:e,oldConfig:t,newConfig:_({},this.config)})):(m.DEBUG=!1,K.R()&&K.F(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(l=this.deadClicksAutocapture)==null||l.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.cn(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){m.LIB_NAME=e,m.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(_({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??e.dn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??Ia;return e!==Ia&&(e=Ia+`.`+e),e}_isIdentified(){return this.persistence?.get_property(Mn)===Jn||this.sessionPersistence?.get_property(Mn)===Jn}nn(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Yn&&!this._isIdentified()&&j(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Xt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Rn]))}Qi(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.nn()||this.sn(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return this.config.person_profiles===`never`?(V.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.an(Rn,!0),!0)}qi(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Gn)}cn(){var e,t,n=this.qi();return this.persistence?.wr!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.wr!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==Kn){if(this.Ni()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new la(this),this.pageViewManager=new Pr(this),this.persistence&&(this.sessionPropsManager=new oa(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??e.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.Ei(this.sessionRecording,new o(this)),this.Wi&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.Wi)))}var s;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Gn&&((s=this.surveys)==null||s.loadIfEnabled()),(M(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture(t?.captureEventName??`$opt_in`,t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else V.warn(Ma)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Kn?V.warn(Ma):(this.config.cookieless_mode===Gn&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Gn&&(this.register({distinct_id:Bn,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(t=this.pageViewManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Ji()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Kn||(this.config.cookieless_mode===Gn?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return i?ua(i,this.config.custom_blocked_useragents):void 0}Ji(){a&&(a.visibilityState===`visible`?this.Oi||(this.Oi=!0,this.capture(Qn,{title:a.title},{send_instantly:!0}),this.Pi&&=(a.removeEventListener(Xn,this.Pi),null)):this.Pi||(this.Pi=this.Ji.bind(this),G(a,Xn,this.Pi)))}debug(e){!1===e?(n?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(n?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var e,t,n,r,i,a,o=this.ji||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(V.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):(n=`advanced_disable_decide`,r=V,i=(t=`advanced_disable_flags`)in(e=o)&&!F(e[t]),a=n in e&&!F(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}rn(e){if(F(this.config.before_send))return e;var t=O(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),F(n)){var i=`Event '`+e.event+`' was rejected in beforeSend function`;return re(e.event)?V.warn(i+`. This can cause unexpected behavior.`):V.info(i),null}n.properties&&!j(n.properties)||V.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}return n}getPageViewId(){return this.pageViewManager.dr?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Bi(e){var t=L(e)&&!e,n=K.R()&&K.O(`ph_debug`)===`true`;return!t&&(!!n||e)}};Ha.__defaultExtensionClasses={},Ha.dn={trace:Oa=()=>{},debug:Oa,info:Oa,warn:Oa,error:Oa,fatal:Oa},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=ar(e.prototype[t[n]])}(Ha,[`identify`]);var Ua=1,Wa=3,Ga=11;function Ka(e){return e instanceof Element&&(e.id===zn||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function qa(e){return!!e&&e.nodeType===Ua}function Ja(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ya(e){return!!e&&e.nodeType===Wa}function Xa(e){return!!e&&e.nodeType===Ga&&qa(e.host)}function Za(e){return e?w(e).split(/\s+/):[]}function Qa(e){var t=n?.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function $a(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return Za(t)}function eo(e){return F(e)?null:w(e).split(/(\s+)/).filter((e=>yo(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function to(e){var t=``;return uo(e)&&!fo(e)&&e.childNodes&&e.childNodes.length&&U(e.childNodes,(function(e){Ya(e)&&e.textContent&&(t+=eo(e.textContent)??``)})),w(t)}function no(e){return M(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ro=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function io(e,t){if(M(t))return!0;var n,r=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function ao(e){var t=e.parentNode;return!(!t||!qa(t))&&t}var oo=[`next`,`previous`,`prev`,`>`,`<`],so=[`.ph-no-rageclick`,`.ph-no-capture`],co=e=>!e||Ja(e,`html`)||!qa(e),lo=(e,t)=>{if(!n||co(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],a=e;a.parentNode&&!Ja(a,`body`);)if(Xa(a.parentNode))i.push(a.parentNode.host),a=a.parentNode.host;else{var o=ao(a);if(!o)break;if(t||ro.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=n.getComputedStyle(o);s&&s.getPropertyValue(`cursor`)===`pointer`&&(r=!0)}i.push(o),a=o}return{parentIsUsefulElement:r,targetElementList:i}};function uo(e){for(var t=e;t.parentNode&&!Ja(t,`body`);t=t.parentNode){var n=$a(t);if(C(n,`ph-sensitive`)||C(n,`ph-no-capture`))return!1}if(C($a(e),`ph-include`))return!0;var r=e.type||``;if(N(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!N(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``))}function fo(e){return!!(Ja(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Ja(e,`select`)||Ja(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var po=`(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})`,mo=RegExp(`^(?:`+po+`)$`),ho=new RegExp(po),go=`\\d{3}-?\\d{2}-?\\d{4}`,_o=RegExp(`^(`+go+`)$`),vo=RegExp(`(`+go+`)`);function yo(e,t){return t===void 0&&(t=!0),!(F(e)||N(e)&&(e=w(e),(t?mo:ho).test((e||``).replace(/[- ]/g,``))||(t?_o:vo).test(e)))}function bo(e){var t=to(e);return yo(t=(t+` `+xo(e)).trim())?t:``}function xo(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&U(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=to(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+xo(e)).trim())}catch(e){V.error(`[AutoCapture]`,e)}})),t}function So(e){return e.replace(/"|\\"/g,`\\"`)}function Co(e){var t=e.attr__class;return t?O(t)?t:Za(t):void 0}var wo=class{constructor(e){this.disabled=!1===e;var t=A(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},To=`$copy_autocapture`,Eo=H(`[AutoCapture]`);function Do(e,t){return t.length>e?t.slice(0,e)+`...`:t}function Oo(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!qa(t));return t}function ko(e,t){var r,{e:i,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:s,elementsChainAsString:c}=t;if(!qa(e))return{props:{}};for(var l=[e],u=e;u.parentNode&&!Ja(u,`body`);)if(Xa(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!qa(u.parentNode))break;l.push(u.parentNode),u=u.parentNode}var d,f,p=[],m={},h=!1,g=!1;if(U(l,(e=>{var t=uo(e);if(Ja(e,`a`)){var n=e.getAttribute(`href`);h=t&&!!n&&yo(n)&&n}C($a(e),`ph-no-capture`)&&(g=!0),p.push(function(e,t,n,r){var i=e.tagName.toLowerCase(),a={tag_name:i};ro.indexOf(i)>-1&&!n&&(a.$el_text=i.toLowerCase()===`a`||i.toLowerCase()===`button`?Do(1024,bo(e)):Do(1024,to(e)));var o=$a(e);o.length>0&&(a.classes=o.filter((function(e){return e!==``}))),U(e.attributes,(function(n){var i;if((!fo(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&yo(n.value)&&(!N(i=n.name)||i.substring(0,10)!==`_ngcontent`&&i.substring(0,7)!==`_nghost`)){var o=n.value;n.name===`class`&&(o=Za(o).join(` `)),a[`attr__`+n.name]=Do(1024,o)}}));for(var s=1,c=1,l=e;l=Oo(l);)s++,l.tagName===e.tagName&&c++;return a.nth_child=s,a.nth_of_type=c,a}(e,a,o,s)),W(m,function(e){if(!uo(e))return{};var t={};return U(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&yo(r)&&(t[n]=r)}})),t}(e))})),g)return{props:{},explicitNoCapture:g};if(o||(p[0].$el_text=Ja(e,`a`)||Ja(e,`button`)?bo(e):to(e)),h){var v;p[0].attr__href=h;var y=Lr(h)?.host,b=n==null||(v=n.location)==null?void 0:v.host;y&&b&&y!==b&&(d=h)}return{props:W({$event_type:i.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:(f=p,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=_({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return rr(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[So(t.toString())]=So(n.toString())})),(t+=`:`)+rr(i).map((e=>{var[t,n]=e;return t+`="`+n+`"`})).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:Co(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return rr(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(f)))},(r=p[0])!=null&&r.$el_text?{$el_text:p[0]?.$el_text}:{},d&&i.type===`click`?{$external_click_url:d}:{},m)}}var Ao=H(`[ExceptionAutocapture]`);function jo(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return k(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Mo=H(`[TracingHeaders]`),No=H(`[Web Vitals]`),Po=9e5,Fo=`disabled`,Io=`lazy_loading`,Lo=`awaiting_config`,Ro=`missing_config`;H(`[SessionRecording]`),H(`[SessionRecording]`);var zo=`[SessionRecording]`,Bo=H(zo),Vo=H(`[Heatmaps]`);function Ho(e){return A(e)&&`clientX`in e&&`clientY`in e&&I(e.clientX)&&I(e.clientY)}var Uo=H(`[Product Tours]`),Wo=[`$set_once`,`$set`],Go=H(`[SiteApps]`),Ko=`Error while initializing PostHog app with config id `;function qo(e,t,n){if(F(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Jo=class{constructor(e){this.vn=new sa,this.fn=(e,t)=>this.pn(e,t)&&this.gn(e,t)&&this.mn(e,t)&&this.yn(e,t),this.pn=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.bn=new Set,this.wn=new Set}init(){var e;M(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!M(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.wn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.bn)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.bn.has(e)||this.bn.has(t?.event))&&this.wn&&this.wn?.size>0&&this.wn.forEach((e=>{this._n(t,e)&&this.vn.emit(`actionCaptured`,e.name)}))}In(e){this.onAction(`actionCaptured`,(t=>e(t)))}_n(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.fn(e,n))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!qo(r,t.url,t.url_matching||`contains`))return!1}return!0}mn(e,t){return!!this.Cn(e,t)&&!!this.Sn(e,t)&&!!this.xn(e,t)}Cn(e,t){var n;if(t==null||!t.href)return!0;var r=this.kn(e);if(r.length>0)return r.some((e=>qo(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&qo((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}Sn(e,t){var n;if(t==null||!t.text)return!0;var r=this.kn(e);if(r.length>0)return r.some((e=>qo(e.text,t.text,t.text_matching||`exact`)||qo(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!F(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>qo(e,a,o))))}xn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}kn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}yn(e,t){return t==null||!t.properties||t.properties.length===0||ha(t.properties.reduce(((e,t)=>{var n=O(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},Yo=class{constructor(e){this._instance=e,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(e,t){return!!e&&ha(e.propertyFilters,t?.properties)}Nn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}Mn(e,t,n){var r=(n===ii.Activation?this.Tn:this.An).get(e),i=[];return this.Fn((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Rn(a,t)}))}register(e){M(this._instance?._addCaptureHook)||(this.On(e),this.Pn(e))}Pn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Ln??(this.Ln=new Jo(this._instance),this.Ln.init(),this.Ln.In((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Ln)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.En.get(t.name);n&&n.push(e.id),this.En.set(t.name,n||[e.id])}})))})))}On(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Tn=this.Nn(e,ii.Activation),this.An=this.Nn(e,ii.Cancellation))}onEvent(e,t){var n,r=this.le(),i=this.Dn(),a=this.Bn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[i])||[];if(a===e&&t&&o.length>0){var s,c;r.info(`event matched, removing item from activated items`,{event:e,eventPayload:t,existingActivatedItems:o});var l=(t==null||(s=t.properties)==null?void 0:s.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(l){var u=o.indexOf(l);0>u||(o.splice(u,1),this.jn(o))}}else{if(this.An.has(e)){var d=this.Mn(e,t,ii.Cancellation);d.length>0&&(r.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.$n(e.id)})),this.jn(o))}if(this.Tn.has(e)){r.info(`event name matched`,{event:e,eventPayload:t,items:this.Tn.get(e)});var f=this.Mn(e,t,ii.Activation);this.jn(o.concat(f.map((e=>e.id))||[]))}}}onAction(e){var t,n=this.Dn(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[];this.En.has(e)&&this.jn(r.concat(this.En.get(e)||[]))}jn(e){var t=this.le(),n=[...new Set(e)].filter((e=>!this.qn(e)));t.info(`updating activated items`,{activatedItems:n}),this.Zn(n)}getActivatedIds(){var e,t=this.Dn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Hn(){return this.Ln}},Xo=class extends Yo{constructor(e){super(e)}Dn(){return En}Bn(){return oi.SHOWN}Fn(e){var t;(t=this._instance)==null||t.getSurveys(e)}$n(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return Z}Zn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[En]:e})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Zo=`SDK is not enabled or survey functionality is not yet loaded`,Qo=`Disabled. Not loading surveys.`,$o=n!=null&&n.location?Br(n.location.hash,`__posthog`)||Br(location.hash,`state`):null,es=`_postHogToolbarParams`,ts=H(`[Toolbar]`),Q=H(`[FeatureFlags]`),ns=H(`[FeatureFlags]`,{debugEnabled:!0}),rs=`" failed. Feature flags didn't load in time.`,is=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},as=e=>{var t={};for(var[n,r]of rr(e||{}))r&&(t[n]=r);return t},os=H(`[Error tracking]`),ss=`Refusing to render web experiment since the viewer is a likely bot`,cs={icontains:(e,t)=>!!n&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!n&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!n&&da(t.href,e),not_regex:(e,t)=>!!n&&!da(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},ls=class e{get Bt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){t===void 0&&(t=!1),n.getWebExperiments((t=>{e.Vn(`retrieved web experiments from the server`),n.zn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n.zn&&(e.Vn(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n.zn)==null||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);N(i)&&t.variants[i]&&n.Un(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.Yn(o)&&n.Un(t.name,a,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Vn(ss);else if(!this.Bt.disable_web_experiments){if(F(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Vn(`applying feature flags`,t),t.forEach((e=>{var t;if(this.zn&&(t=this.zn)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.zn?.get(e);n&&r!=null&&r.variants[n]&&this.Un(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=Rr(t?.search,`__experiment_id`),r=Rr(t?.search,`__experiment_variant`);n&&r&&(e.Vn(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Gn(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.Bt.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.Bt.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Gn(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.Vn(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Un(i[0].name,n,i[0].variants[n].transforms))}static Yn(t){return!F(t.conditions)&&e.Wn(t)&&e.Xn(t)}static Wn(t){if(F(t.conditions)||F(t.conditions?.url))return!0;var n,r=e.getWindowLocation();return!!r&&((n=t.conditions)==null||!n.url||cs[t.conditions?.urlMatchType??`icontains`](t.conditions.url,r))}static getWindowLocation(){return n?.location}static Xn(e){if(F(e.conditions)||F(e.conditions?.utm))return!0;var t=Kr();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Vn(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];V.info(`[WebExperiments] `+e,n)}Un(t,n,r){this._is_bot()?e.Vn(ss):n===`control`?e.Vn(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.Vn(`applying transform of variant `+n+` for experiment `+t+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return i&&this._instance?ua(i,this.Bt.custom_blocked_useragents):void 0}},$=H(`[Conversations]`),us=`Conversations not available yet.`,ds={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e;return(e=this.ni?._r(this.Bt.feature_flag_cache_ttl_ms))!=null&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,Q.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}hs(){var e=this.Bt.evaluation_contexts??this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(Q.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.ns=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||Q.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}cs(){return this.hs().length>0}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},i=n!=null&&n.merge?this.getFlagPayloads():{},a=_({},r,e),o=_({},i,t),s={};for(var[c,l]of Object.entries(a)){var u=typeof l==`string`;s[c]={key:c,enabled:!!u||!!l,variant:u?l:void 0,reason:void 0,metadata:M(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:s})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(vn),t=this.os(xn),n=this.os(Sn);if(!n&&!t)return e||{};var r=W({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=M(c)?(a=s?.enabled)!=null&&a:!!c,u=M(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=_({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=_({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Jn||=(Q.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getFlagVariants(){var e=this.os(hn),t=this.os(xn);if(!t)return e||{};for(var n=W({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(Q.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.os(yn),t=this.os(Sn);if(!t)return e||{};for(var n=W({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(Q.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit(`featureFlagsReloading`,!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var t=this.Bt.token,n=this.os(Yt),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_({},this.ni?.get_initial_props()||{},this.os(Cn)||{}),group_properties:this.os(wn),timezone:ei()};P(n)||M(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.cs()&&(r.evaluation_contexts=this.hs());var i=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Bt.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Qn=!0,this._instance._send_request({method:`POST`,url:i,data:r,compression:this.Bt.disable_compression?void 0:hi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,a=!0;if(e.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),a=!1),this.Qn=!1,!r.disable_flags||this.ts){this.rs=!a;var o=[];e.error?e.error instanceof Error?o.push(e.error.name===`AbortError`?`timeout`:`connection_error`):o.push(`unknown_error`):e.statusCode!==200&&o.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&o.push(`errors_while_computing_flags`);var s=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));s&&o.push(`quota_limited`),(i=this.ni)==null||i.register({[An]:o}),s?Q.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},a,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else Q.warn(`getFeatureFlag for key "`+e+rs)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.os(bn)||void 0,c=this.os(jn)||void 0,l=this.os(On)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.os(kn);d&&d!==f&&(l={},(u=this.ni)==null||u.register({[On]:l,[kn]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b;O(l[e])?l[e].push(o):l[e]=[o],(p=this.ni)==null||p.register({[On]:l});var x=this.getFeatureFlagDetails(e),S=[...this.os(An)??[]];M(i)&&S.push(`flag_missing`);var C={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Bt.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Bt.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.rs};M(x==null||(g=x.metadata)==null?void 0:g.version)||(C.$feature_flag_version=x.metadata.version);var w,T=(x==null||(_=x.reason)==null?void 0:_.description)??(x==null||(v=x.reason)==null?void 0:v.code);T&&(C.$feature_flag_reason=T),x!=null&&(y=x.metadata)!=null&&y.id&&(C.$feature_flag_id=x.metadata.id),M(x?.original_variant)&&M(x?.original_enabled)||(C.$feature_flag_original_response=M(x.original_variant)?x.original_enabled:x.original_variant),x!=null&&(b=x.metadata)!=null&&b.original_payload&&(C.$feature_flag_original_payload=x==null||(w=x.metadata)==null?void 0:w.original_payload),S.length&&(C.$feature_flag_error=S.join(`,`)),this._instance.capture(`$feature_flag_called`,C)}if(r){var E=a;if(!M(a))try{E=JSON.parse(a)}catch{}return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:E}}}}else Q.warn(`getFeatureFlagResult for key "`+e+rs)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Bt.disable_compression?void 0:hi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return M(n)?void 0:!!n}Q.warn(`isFeatureEnabled for key "`+e+rs)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):Q.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(O(c)){Q.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[gn]:c,[hn]:f})}else{var m=c,h=l,g=s;if(a!=null&&a.partialResponse)m=_({},n,m),h=_({},r,h),g=_({},i,g);else if(e.errorsWhileComputingFlags)if(s){var v=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=_({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return v.has(t)})))),h=_({},r,Object.fromEntries(Object.entries(h||{}).filter((e=>{var[t]=e;return v.has(t)})))),g=_({},i,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return v.has(t)}))))}else m=_({},n,m),h=_({},r,h),g=_({},i,g);t&&t.register(_({[gn]:Object.keys(as(m)),[hn]:m||{},[yn]:h||{},[vn]:g||{}},u?{[bn]:u}:{},d?{[jn]:d}:{}))}}})(e,this.ni,r,i,a,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Q.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Q.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.ni.unregister(xn),this.ni.unregister(Sn),this.ps(),ns.info(`All overrides cleared`);if(O(e)){var t=is(e);return this.ni.register({[xn]:t}),this.ps(),ns.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.ni.unregister(xn),ns.info(`Flag overrides cleared`);else if(r.flags){if(O(r.flags)){var i=is(r.flags);this.ni.register({[xn]:i})}else this.ni.register({[xn]:r.flags});ns.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.ni.unregister(Sn),ns.info(`Payload overrides cleared`)):r.payloads&&(this.ni.register({[Sn]:r.payloads}),ns.info(`Payload overrides set`,{payloads:r.payloads}))),this.ps();return}if(e&&typeof e==`object`)return this.ni.register({[xn]:e}),this.ps(),ns.info(`Flag overrides set`,{flags:e});Q.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.os(_n)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=_({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[gn]:Object.keys(as(s)),[hn]:s}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(_n),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Bt.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.ni)==null||n.unregister(_n),(r=this.ni)==null||r.register({[_n]:i}),e(i)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(Cn)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[Cn]:_({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Cn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(wn)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=_({},n[t],e[t]),delete e[t]})),this._instance.register({[wn]:_({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(wn)||{};this._instance.register({[wn]:_({},t,{[e]:{}})})}else this._instance.unregister(wn)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},fs={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){return this.bs===Lo||this.bs===Ro?this.bs:this.ys?.status??this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=Fo,this.ws=void 0,this._instance=e,!this._instance.sessionManager)throw Bo.error(`started without valid sessionManager`),Error(zo+` started without valid sessionManager. This is a bug.`);if(this.Bt.cookieless_mode===Kn)throw Error(zo+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get _s(){var e,t=!((e=this._instance.get_property(cn))==null||!e.enabled),r=!this.Bt.disable_session_recording,i=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return n&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._s||(t=this.ys)==null||!t.isStarted){var n=!M(Object.assign)&&!M(Array.from);this._s&&n?(this.Is(e),Bo.info(`starting`)):(this.bs=Fo,this.stopRecording())}}Is(e){var t,n,r;this._s&&(this.bs!==Lo&&this.bs!==Ro&&(this.bs=Io),f!=null&&(t=f.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=f.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=f.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return Bo.error(`could not load recorder`,t);this.Cs(e)})))}stopRecording(){var e,t;(e=this.ws)==null||e.call(this),this.ws=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this.ws)==null||e.call(this),this.ws=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(mn)}Ts(e,t){if(F(e))return null;var n,r=I(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Bo.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}As(e){if(this.ni){var t,n=this.ni,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ts(this.Bt.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ts(t?.sampleRate,`remote config sampleRate`),a=r??i;F(a)&&this.ks();var o=t?.minimumDurationMilliseconds;n.register({[cn]:_({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:_({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:M(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.ws)==null||t.call(this),this.ws=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.As(e),this.xs()):(this.As(e),this.startIfEnabledOrStop()):(this.bs===Lo&&(this.bs=Ro,Bo.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Bo.warn(`log called before recorder was ready`)}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(cn);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Es(){var e=this._instance.get_property(cn);if(!e)return!1;var t=(typeof e==`object`?e:JSON.parse(e)).cache_timestamp??Date.now();return 36e5>=Date.now()-t}Cs(e){var t;if((t=f.__PosthogExtensions__)==null||!t.initSessionRecording)return Bo.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Un]:!0});if(this.ys||(this.ys=f.__PosthogExtensions__?.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es()){if(this.bs===Ro||this.bs===Lo)return;this.bs=Lo,Bo.info(`persisted remote config is stale, requesting fresh config before starting`),new mi(this._instance).load();return}this.bs=Io,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[un]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[ln]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e===`url`?dn:fn]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.ys?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},ps={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new wo(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e=A(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}Os(){if(this.isBrowserSupported()){if(n&&a){var e=e=>{e||=n?.event;try{this.Ps(e)}catch(e){Eo.error(`Failed to capture event`,e)}};if(G(a,`submit`,e,{capture:!0}),G(a,`change`,e,{capture:!0}),G(a,`click`,e,{capture:!0}),this.Bt.capture_copied_text){var t=e=>{e||=n?.event;try{this.Ps(e,To)}catch(e){Eo.error(`Failed to capture copy/cut event`,e)}};G(a,`copy`,t,{capture:!0}),G(a,`cut`,t,{capture:!0})}}}else Eo.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Qt]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((t=>{(a?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Qt];if(P(this.Ns)&&!L(e)&&!this.instance.Fr())return!1;var t=this.Ns??!!e;return!!this.instance.config.autocapture&&!t}Ps(e,t){if(t===void 0&&(t=`$autocapture`),this.isEnabled){var r,i=no(e);Ya(i)&&(i=i.parentNode||null),t===`$autocapture`&&e.type===`click`&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&function(e,t){if(!n||co(e))return!1;var r,i;if(L(t)?(r=!!t&&so,i=void 0):(r=t?.css_selector_ignorelist??so,i=t?.content_ignorelist),!1===r)return!1;var{targetElementList:a}=lo(e,!1);return!function(e,t){if(!1===e||M(e))return!1;var n;if(!0===e)n=oo;else{if(!O(e))return!1;if(e.length>10)return V.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>t.includes(e)||r.includes(e)))}))}(i,a.map((e=>({safeText:to(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!io(a,r)}(i,this.instance.config.rageclick)&&this.Ps(e,`$rageclick`);var a=t===To;if(i&&function(e,t,r,i,a){var o,s,c;if(r===void 0&&(r=void 0),!n||co(e)||(o=r)!=null&&o.url_allowlist&&!Qa(r.url_allowlist)||(s=r)!=null&&s.url_ignorelist&&Qa(r.url_ignorelist))return!1;if((c=r)!=null&&c.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=lo(e,i);if(!function(e,t){var n=t?.element_allowlist;if(M(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(d,r)||!io(d,r?.css_selector_allowlist))return!1;var f=n.getComputedStyle(e);if(f&&f.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0;var p=e.tagName.toLowerCase();switch(p){case`html`:return!1;case`form`:return(a||[`submit`]).indexOf(t.type)>=0;case`input`:case`select`:case`textarea`:return(a||[`change`,`click`]).indexOf(t.type)>=0;default:return u?(a||[`click`]).indexOf(t.type)>=0:(a||[`click`]).indexOf(t.type)>=0&&(ro.indexOf(p)>-1||e.getAttribute(`contenteditable`)===`true`)}}(i,e,this.Bt,a,a?[`copy`,`cut`]:void 0)){var{props:o,explicitNoCapture:s}=ko(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(s)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(o.$element_selectors=c),t===To){var l,u=eo(n==null||(l=n.getSelection())==null?void 0:l.toString()),d=e.type||`clipboard`;if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return k(a?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(n==null||(t=n.location)==null?void 0:t.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(V.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,V.info(`History API monitoring stopped`)}monitorHistoryChanges(){var e,t;if(n&&n.history){var r=this;(e=n.history.pushState)!=null&&e.__posthog_wrapped__||jo(n.history,`pushState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Bs(`pushState`)})),(t=n.history.replaceState)!=null&&t.__posthog_wrapped__||jo(n.history,`replaceState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Bs(`replaceState`)})),this.js()}}Bs(e){try{var t,r=n==null||(t=n.location)==null?void 0:t.pathname;if(!r)return;r!==this.Ls&&this.isEnabled&&this._instance.capture(Qn,{navigation_type:e}),this.Ls=r}catch(t){V.error(`Error capturing `+e+` pageview`,t)}}js(){if(!this.Ds){var e=()=>{this.Bs(`popstate`)};G(n,`popstate`,e),this.Ds=()=>{n&&n.removeEventListener(`popstate`,e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[$t]),this.rageclicks=new wo(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return A(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return F(this.Bt.capture_heatmaps)?F(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:!1!==this.Bt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Vo.info(`starting...`),this.Zs(),this.Lt()}else clearInterval(this.qs??void 0),this.Hs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$t]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Vs(e){this.Tt(e.originalEvent,`deadclick`)}Lt(){this.qs&&clearInterval(this.qs),this.qs=a?.visibilityState===`visible`?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){n&&a&&(this.zs=this.Yr.bind(this),G(n,Zn,this.zs),this.Us=e=>this.Tt(e||n?.event),G(a,`click`,this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||n?.event),G(a,`mousemove`,this.Ys,{capture:!0}),this.Ws=new kr(this.instance,Dr,this.Vs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Lt.bind(this),G(a,Xn,this.Xs),this.Rs=!0)}Hs(){var e;n&&a&&(this.zs&&n.removeEventListener(Zn,this.zs),this.Us&&a.removeEventListener(`click`,this.Us,{capture:!0}),this.Ys&&a.removeEventListener(`mousemove`,this.Ys,{capture:!0}),this.Xs&&a.removeEventListener(Xn,this.Xs),clearTimeout(this.Js),(e=this.Ws)==null||e.stop(),this.Rs=!1)}Ks(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var i=e;i&&qa(i)&&!Ja(i,`body`);){if(i===r)return!1;if(C(t,n?.getComputedStyle(i).position))return!0;i=ao(i)}return!1}(no(e),[`fixed`,`sticky`],a);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:r),target_fixed:o,type:t}}Tt(e,t){var n;if(t===void 0&&(t=`click`),!Ka(e.target)&&Ho(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(_({},r,{type:`rageclick`})),this.Qs(r)}}Gs(e){!Ka(e.target)&&Ho(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,`mousemove`))}),500))}Qs(e){if(n){var t=n.location.href,r=this.Bt.custom_personal_data_properties,i=zr(t,this.Bt.mask_personal_data_properties?[...Hr,...r||[]]:[],Wr);this.T=this.T||{},this.T[i]||(this.T[i]=[]),this.T[i].push(e)}}Yr(){this.T&&!j(this.T)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:kr,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.T.metrics.reduce(((e,t)=>_({},e,{[`$web_vitals_`+t.name+`_event`]:_({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{var t=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0);if(M(t))No.error(`Could not read session ID. Dropping metrics!`);else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();M(n)||(F(e?.name)||F(e?.value)?No.error(`Invalid metric received`,e):!this.no||this.no>e.value?(this.T.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),M(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=M(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.T.metrics.push(_({},e,{$current_url:n,$session_id:t.sessionId,$window_id:t.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):No.error(`Ignoring metric with value >= `+this.no,e))}},this.so=()=>{if(!this.Rs){var e,t,n,r,i=f.__PosthogExtensions__;M(i)||M(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.ht.bind(this)),this.Rs=!0):No.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[rn]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e=A(this.oo)?this.oo?.web_vitals_allowed_metrics:void 0;return F(e)?this._instance.persistence?.props[sn]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(A(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=A(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=A(this.oo)&&I(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:Po;return e>0&&6e4>=e?Po:e}get isEnabled(){var e=o?.protocol;if(e!==`http:`&&e!==`https:`)return No.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=A(this.oo)?this.oo.web_vitals:L(this.oo)?this.oo:void 0;return L(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(No.info(`enabled, starting...`),this.ur(this.so))}onRemoteConfig(e){if(`capturePerformance`in e){var t=A(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=A(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rn]:t}),this._instance.persistence.register({[sn]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?No.error(`failed to load script`,t):e()}))}io(){var e=n?n.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return zr(e,this._instance.config.mask_personal_data_properties?[...Hr,...t||[]]:[],Wr)}No.error(`Could not determine current URL`)}}},ms={exceptionObserver:class{constructor(e){var t;this.so=()=>{var e;if(n&&this.isEnabled&&(e=f.__PosthogExtensions__)!=null&&e.errorWrappingFunctions){var t=f.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=f.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=f.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=t(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=i(this.captureException.bind(this)))}catch(e){Ao.error(`failed to start`,e),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[en]),this.do=new de({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Gt:Ao}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return A(e)?t=_({},t,e):(M(e)?this.co:e)&&(t=_({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ao.info(`enabled`),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return Ao.error(`failed to load script`,t);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[en]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.do.consumeRateLimit(r)?Ao.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.fo=[],this.po=new ht([new Dt,new Lt,new kt,new Ot,new Ft,new Pt,new jt,new It],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
2
2
  `),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=Et.test(s)?s.replace(Et,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return _({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||gt});var n}))}(i)}}(`web:javascript`,St,Tt)),this._instance=e,this.fo=this._instance.persistence?.get_property(tn)??[],this.mo=Ht(this.yo()),this.bo=new Ut(this.mo)}onConfigChange(){this.mo=Ht(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.fo=t,this._instance.persistence&&this._instance.persistence.register({[tn]:this.fo,[nn]:n})}}get wo(){var e,t=!!this._instance.get_property(nn);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!N(e)||e.trim().length===0)return void os.warn(`Ignoring exception step because message must be a non-empty string`);var{sanitizedProperties:n,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>Bt.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this._o(t));r.length>0&&os.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.bo.add(_({[Rt]:e,[zt]:new Date().toISOString()},n))}catch(e){os.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So(`Exception dropped: matched a suppression rule`),void os.info(`Skipping exception capture because a suppression rule matched`);if(!this.wo&&this.xo(t))return this.So(`Exception dropped: thrown by a browser extension`),void os.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So(`Exception dropped: thrown by the PostHog SDK`),void os.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.mo.enabled&&F(e.$exception_steps)?this.To(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,en:!0});return r&&this.bo.clear(),r}catch(e){os.error(`Failed to capture exception event. Dropping this exception.`,e),this.bo.clear();return}}catch(e){os.error(`Failed to process exception event. Ignoring this exception.`,e);return}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:_({},e,{$exception_steps:t})}catch(t){return os.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}So(e){this.mo.enabled&&this.bo.add({[Rt]:e,[zt]:new Date().toISOString()})}_o(e){return A(e)?_({},e):{}}yo(){return this._instance.config.error_tracking?.exception_steps??{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return N(n)&&n.length>0&&e.$exception_types.push(n),N(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.fo.some((e=>{var n=e.values.map((e=>{var n=pa[e.operator],r=O(e.value)?e.value:[e.value],i=t[e.key]??[];return r.length>0&&n(r,i)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}xo(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}ko(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}Io(e){return!F(e)&&O(e)}}},hs=_({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){`productTours`in e&&(this.ni&&this.ni.register({[on]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(on)||this.ur((()=>this.Ro()))}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?Uo.error(`Could not load product tours script`,t):e()}))}Ro(){var e;!this.Ao&&(e=f.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ao=f.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!O(this.Eo)||t){var n=this.ni;if(n){var r=n.props[Dn];if(O(r)&&!t)return this.Eo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,callback:t=>{var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;Uo.error(i),e([],{isLoaded:!1,error:i});return}var a=O(t.json.product_tours)?t.json.product_tours:[];this.Eo=a,n&&n.register({[Dn]:a}),e(a,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){F(this.Ao)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ao)==null||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),(t=this.Ao)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ao)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Ao)==null||e.nextStep()}previousStep(){var e;(e=this.Ao)==null||e.previousStep()}clearCache(){var e;this.Eo=null,(e=this.ni)==null||e.unregister(Dn)}resetTour(e){var t;(t=this.Ao)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ao)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ao)==null||t.cancelPendingTour(e)}}},ds),gs={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=f._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var[i,a]of Object.entries(r))t[i]={id:n[i],type:i,properties:a};var{$set_once:o,$set:s}=e;return{event:_({},v(e,Wo),{properties:_({},e.properties,s?{$set:_({},e.properties?.$set??{},s)}:{},o?{$set_once:_({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.No.length&&(Go.info(`Processing `+this.No.length+` events for site app with id `+e.id),this.No.forEach((e=>t.processEvent==null?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.Fo)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Go.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback(e){i(e)}});a&&(t.processEvent=a),r=!0}catch(t){Go.error(Ko+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Go.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}Oo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Po(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(t){Go.error(`Error while processing event `+e.event+` for site app `+n.id,t)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on(`eventCaptured`,(e=>this.Po(e)))):void Go.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.Fo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;f[`__$$ph_site_app_`+e]=i._instance,(t=f.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return Go.error(Ko+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else Go.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},_s={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var e,t,n=this.Bo()||[];M(this.Lo)&&((e=f.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(n,this._instance.get_distinct_id(),this._instance.sessionManager)),M(this.Do)&&((t=f.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchFetch(n,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return Mo.error(`failed to load script`,t);e()}))}Bo(){return this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):((e=this.Lo)==null||e.call(this),(t=this.Do)==null||t.call(this),this.Lo=void 0,this.Do=void 0)}}},vs=_({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(F(t))return Z.warn(`Flags not loaded yet. Not loading surveys.`);var n=O(t);this.jo=n?t.length>0:t,Z.info(`flags response received, isSurveysEnabled: `+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem(`lastSeenSurveyDate`);for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(Sa)||n!=null&&n.startsWith(`inProgressSurvey_`))&&e.push(n)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)Z.info(`Already initializing surveys, skipping...`);else if(this.Bt.disable_surveys)Z.info(Qo);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())Z.info(`Not loading surveys in cookieless mode without consent.`);else{var e=f?.__PosthogExtensions__;if(e){if(!M(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var n=e.generateSurveys;if(n)return void this.Ho(n,t);var r=e.loadExternalDependency;if(!r)return void this.Vo(Wn);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.Vo(`Could not load surveys script`,n):this.Ho(e.generateSurveys,t)}))}catch(e){throw this.Vo(`Error initializing surveys`,e),e}finally{this.$o=!1}}}else Z.error(`PostHog Extensions not found.`)}}Ho(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Xo(this._instance),Z.info(`Surveys loaded successfully`),this.zo({isLoaded:!0})}Vo(e,t){Z.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Bt.disable_surveys)return Z.info(Qo),e([]);var n,r=this._instance.get_property(Tn);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<`u`&&this.Zo?this.Zo.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.Zo=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.Bt.token),method:`GET`,timeout:this.Bt.surveys_request_timeout_ms,callback:t=>{var r;this.Zo=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;Z.error(a);var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[Tn]:c});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Z.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!F(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Z.warn(`init was not called`)}Uo(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}Yo(e){if(F(this._surveyManager))return{eligible:!1,reason:Zo};var t=typeof e==`string`?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(F(this._surveyManager))return Z.warn(`init was not called`),{visible:!1,disabledReason:Zo};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return F(this._surveyManager)?(Z.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:Zo})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.Yo(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var r;if(F(this._surveyManager))Z.warn(`init was not called`);else{var i=typeof e==`string`?this.Uo(e):e;if(i!=null&&i.id)if(Ca.includes(i.type)){var o=a?.querySelector(t);if(o)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(Z.info(`Rendering survey `+i.id+` with delay of `+i.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;Z.info(`Rendering survey `+i.id+` with delay of `+i.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(i,o,n),Z.info(`Survey `+i.id+` rendered`)}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,n);Z.warn(`Survey element not found`)}else Z.warn(`Surveys of type `+i.type+` cannot be rendered in the app`);else Z.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(F(this._surveyManager))Z.warn(`init was not called`);else{var r=this.Uo(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=_({},r,{appearance:_({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==ci.Popover&&t.initialResponses&&Z.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.canRenderSurvey(r);if(!a.visible)return void Z.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===ci.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else Z.warn(`Survey not found`)}}cancelPendingSurvey(e){F(this._surveyManager)?Z.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},ds),ys={toolbar:class{constructor(e){this.instance=e}Go(e){f.ph_toolbar_state=e}Wo(){return f.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),r===void 0&&(r=void 0),lr(this.instance.config)||!n||!a)return!1;e??=n.location,r??=n.history;try{if(!t){try{n.localStorage.setItem(`test`,`test`),n.localStorage.removeItem(`test`)}catch{return!1}t=n?.localStorage}var i,o=$o||Br(e.hash,`__posthog`)||Br(e.hash,`state`),s=o?ir((()=>JSON.parse(atob(decodeURIComponent(o)))))||ir((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action===`ph_authorize`?((i=s).source=`url`,i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,``,e.pathname+e.search):e.hash=``)):((i=JSON.parse(t.getItem(es)||`{}`)).source=`localstorage`,delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch{return!1}}Xo(e){var t=f.ph_load_toolbar||f.ph_load_editor;!F(t)&&k(t)?t(e,this.instance):ts.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(a==null||!a.getElementById(zn));if(!n||t)return!1;var r=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,i=_({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},r?{instrument:!1}:{});if(n.localStorage.setItem(es,JSON.stringify(_({},i,{source:void 0}))),this.Wo()===2)this.Xo(i);else if(this.Wo()===0){var o;this.Go(1),(o=f.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return ts.error(`[Toolbar] Failed to load`,e),void this.Go(0);this.Go(2),this.Xo(i)})),G(n,`turbolinks:load`,(()=>{this.Go(0),this.loadToolbar(i)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},bs=_({experiments:ls},ds),xs=_({},ds,fs,ps,ms,hs,gs,vs,_s,ys,bs,{conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;F(t)||(L(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||lr(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=f?.__PosthogExtensions__;if(e&&!M(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var n=e.loadExternalDependency;if(!n)return void this.ra(Wn);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.ra(`Could not load conversations script`,t):this.ta(e.initConversations),this.Qo=!1}))}catch(e){this.ra(`Error initializing conversations`,e),this.Qo=!1}}else $.error(`Conversations enabled but missing token in remote config.`)}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),$.info(`Conversations loaded successfully`)}catch(e){this.ra(`Error completing conversations initialization`,e)}else $.error(`Cannot complete initialization: remote config is null`)}ra(e,t){$.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():$.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ko&&!P(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return g((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):($.warn(us),null)}))()}getMessages(e,t){var n=this;return g((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):($.warn(us),null)}))()}markAsRead(e){var t=this;return g((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):($.warn(us),null)}))()}getTickets(e){var t=this;return g((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):($.warn(us),null)}))()}requestRestoreLink(e){var t=this;return g((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):($.warn(us),null)}))()}restoreFromToken(e){var t=this;return g((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):($.warn(us),null)}))()}restoreFromUrlToken(){var e=this;return g((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():($.warn(us),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}un(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=H(`[logs]`),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!F(t)&&t&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&=(clearTimeout(this.jr),void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=f?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Gt.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(Wn)}else this.Gt.error(`PostHog Extensions not found.`)}}captureLog(e){if(this._instance.is_capturing())if(e&&e.body){var t=this._instance.config.logs?.flushIntervalMs??3e3,n=this._instance.config.logs?.maxLogsPerInterval??1e3,r=Date.now();if(t>r-this.aa||(this.aa=r,this.oa=0,this.la=!1),n>this.oa){this.oa++;var i=function(e,t){var{text:n,number:r}=ut[e.level||`info`]||dt,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a[`url.full`]=t.currentUrl),t.screenName&&(a[`screen.name`]=t.screenName),t.appState&&(a[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=_({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:pt(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),M(e.trace_flags)||(s.flags=e.trace_flags),s}(e,this.ua());this.sa.push({record:i}),(this._instance.config.logs?.maxBufferSize??100)>this.sa.length?this.ha():this.flushLogs()}else this.la||=(this.Gt.warn(`captureLog dropping logs: exceeded `+n+` logs per `+t+`ms`),!0)}else this.Gt.warn(`captureLog requires a body`)}get logger(){return this.ca||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.ca}flushLogs(e){if(this.jr&&=(clearTimeout(this.jr),void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var n=this._instance.config.logs,r=_({"service.name":n?.serviceName||`unknown_service`},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),i=function(e,t,n,r){return{resourceLogs:[{resource:{attributes:pt(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}(t.map((e=>e.record)),r,m.LIB_NAME,m.LIB_VERSION),a=this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token);this._instance.Hi({method:`POST`,url:a,data:i,compression:`best-available`,batchKey:`logs`,transport:e})}}ha(){this.jr||=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),this._instance.config.logs?.flushIntervalMs??3e3)}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(f!=null&&(e=f.location)!=null&&e.href&&(t.currentUrl=f.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});Ha.__defaultExtensionClasses=_({},xs);var Ss,Cs=(Ss=ka[Ia]=new Ha,function(){function e(){e.done||(e.done=!0,La=!1,U(ka,(function(e){e._dom_loaded()})))}a!=null&&a.addEventListener?a.readyState===`complete`?e():G(a,`DOMContentLoaded`,e,{capture:!1}):n&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Ss);export{t as n,Cs as t};