@scalebun-release/web 2.2.2

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 (1062) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -0
  3. package/dist/bootstrap/FeatureRegistry.d.ts +44 -0
  4. package/dist/bootstrap/FeatureRegistry.d.ts.map +1 -0
  5. package/dist/bootstrap/FeatureRegistry.js +85 -0
  6. package/dist/bootstrap/FeatureRegistry.js.map +1 -0
  7. package/dist/bootstrap/SDKBootstrapper.d.ts +37 -0
  8. package/dist/bootstrap/SDKBootstrapper.d.ts.map +1 -0
  9. package/dist/bootstrap/SDKBootstrapper.js +346 -0
  10. package/dist/bootstrap/SDKBootstrapper.js.map +1 -0
  11. package/dist/browser.d.ts +51 -0
  12. package/dist/browser.d.ts.map +1 -0
  13. package/dist/browser.js +86 -0
  14. package/dist/browser.js.map +1 -0
  15. package/dist/config/endpoints.d.ts +12 -0
  16. package/dist/config/endpoints.d.ts.map +1 -0
  17. package/dist/config/endpoints.js +12 -0
  18. package/dist/config/endpoints.js.map +1 -0
  19. package/dist/config/schema.d.ts +120 -0
  20. package/dist/config/schema.d.ts.map +1 -0
  21. package/dist/config/schema.js +117 -0
  22. package/dist/config/schema.js.map +1 -0
  23. package/dist/core/breadcrumbs.d.ts +56 -0
  24. package/dist/core/breadcrumbs.d.ts.map +1 -0
  25. package/dist/core/breadcrumbs.js +141 -0
  26. package/dist/core/breadcrumbs.js.map +1 -0
  27. package/dist/core/capabilities.d.ts +38 -0
  28. package/dist/core/capabilities.d.ts.map +1 -0
  29. package/dist/core/capabilities.js +78 -0
  30. package/dist/core/capabilities.js.map +1 -0
  31. package/dist/core/consent.d.ts +17 -0
  32. package/dist/core/consent.d.ts.map +1 -0
  33. package/dist/core/consent.js +38 -0
  34. package/dist/core/consent.js.map +1 -0
  35. package/dist/core/csp.d.ts +31 -0
  36. package/dist/core/csp.d.ts.map +1 -0
  37. package/dist/core/csp.js +74 -0
  38. package/dist/core/csp.js.map +1 -0
  39. package/dist/core/evalContext.d.ts +7 -0
  40. package/dist/core/evalContext.d.ts.map +1 -0
  41. package/dist/core/evalContext.js +22 -0
  42. package/dist/core/evalContext.js.map +1 -0
  43. package/dist/core/ids.d.ts +6 -0
  44. package/dist/core/ids.d.ts.map +1 -0
  45. package/dist/core/ids.js +35 -0
  46. package/dist/core/ids.js.map +1 -0
  47. package/dist/core/index.d.ts +16 -0
  48. package/dist/core/index.d.ts.map +1 -0
  49. package/dist/core/index.js +16 -0
  50. package/dist/core/index.js.map +1 -0
  51. package/dist/core/lifecycle.d.ts +4 -0
  52. package/dist/core/lifecycle.d.ts.map +1 -0
  53. package/dist/core/lifecycle.js +24 -0
  54. package/dist/core/lifecycle.js.map +1 -0
  55. package/dist/core/logger.d.ts +12 -0
  56. package/dist/core/logger.d.ts.map +1 -0
  57. package/dist/core/logger.js +14 -0
  58. package/dist/core/logger.js.map +1 -0
  59. package/dist/core/observe.d.ts +3 -0
  60. package/dist/core/observe.d.ts.map +1 -0
  61. package/dist/core/observe.js +22 -0
  62. package/dist/core/observe.js.map +1 -0
  63. package/dist/core/pageContext.d.ts +13 -0
  64. package/dist/core/pageContext.d.ts.map +1 -0
  65. package/dist/core/pageContext.js +90 -0
  66. package/dist/core/pageContext.js.map +1 -0
  67. package/dist/core/prune.d.ts +31 -0
  68. package/dist/core/prune.d.ts.map +1 -0
  69. package/dist/core/prune.js +112 -0
  70. package/dist/core/prune.js.map +1 -0
  71. package/dist/core/redact.d.ts +15 -0
  72. package/dist/core/redact.d.ts.map +1 -0
  73. package/dist/core/redact.js +72 -0
  74. package/dist/core/redact.js.map +1 -0
  75. package/dist/core/replayCoord.d.ts +22 -0
  76. package/dist/core/replayCoord.d.ts.map +1 -0
  77. package/dist/core/replayCoord.js +20 -0
  78. package/dist/core/replayCoord.js.map +1 -0
  79. package/dist/core/retry.d.ts +25 -0
  80. package/dist/core/retry.d.ts.map +1 -0
  81. package/dist/core/retry.js +44 -0
  82. package/dist/core/retry.js.map +1 -0
  83. package/dist/core/runtime.d.ts +28 -0
  84. package/dist/core/runtime.d.ts.map +1 -0
  85. package/dist/core/runtime.js +67 -0
  86. package/dist/core/runtime.js.map +1 -0
  87. package/dist/core/scrollDepth.d.ts +48 -0
  88. package/dist/core/scrollDepth.d.ts.map +1 -0
  89. package/dist/core/scrollDepth.js +63 -0
  90. package/dist/core/scrollDepth.js.map +1 -0
  91. package/dist/core/uiStateReader.d.ts +35 -0
  92. package/dist/core/uiStateReader.d.ts.map +1 -0
  93. package/dist/core/uiStateReader.js +47 -0
  94. package/dist/core/uiStateReader.js.map +1 -0
  95. package/dist/core/version.generated.d.ts +9 -0
  96. package/dist/core/version.generated.d.ts.map +1 -0
  97. package/dist/core/version.generated.js +9 -0
  98. package/dist/core/version.generated.js.map +1 -0
  99. package/dist/debug/index.d.ts +6 -0
  100. package/dist/debug/index.d.ts.map +1 -0
  101. package/dist/debug/index.js +2 -0
  102. package/dist/debug/index.js.map +1 -0
  103. package/dist/features/analytics/AnalyticsFeature.d.ts +123 -0
  104. package/dist/features/analytics/AnalyticsFeature.d.ts.map +1 -0
  105. package/dist/features/analytics/AnalyticsFeature.js +785 -0
  106. package/dist/features/analytics/AnalyticsFeature.js.map +1 -0
  107. package/dist/features/analytics/autocapture.d.ts +13 -0
  108. package/dist/features/analytics/autocapture.d.ts.map +1 -0
  109. package/dist/features/analytics/autocapture.js +436 -0
  110. package/dist/features/analytics/autocapture.js.map +1 -0
  111. package/dist/features/analytics/governance.d.ts +15 -0
  112. package/dist/features/analytics/governance.d.ts.map +1 -0
  113. package/dist/features/analytics/governance.js +30 -0
  114. package/dist/features/analytics/governance.js.map +1 -0
  115. package/dist/features/analytics/revenue.d.ts +77 -0
  116. package/dist/features/analytics/revenue.d.ts.map +1 -0
  117. package/dist/features/analytics/revenue.js +56 -0
  118. package/dist/features/analytics/revenue.js.map +1 -0
  119. package/dist/features/analytics/sampler.d.ts +2 -0
  120. package/dist/features/analytics/sampler.d.ts.map +1 -0
  121. package/dist/features/analytics/sampler.js +24 -0
  122. package/dist/features/analytics/sampler.js.map +1 -0
  123. package/dist/features/analytics/subscription.d.ts +35 -0
  124. package/dist/features/analytics/subscription.d.ts.map +1 -0
  125. package/dist/features/analytics/subscription.js +95 -0
  126. package/dist/features/analytics/subscription.js.map +1 -0
  127. package/dist/features/attention/index.d.ts +29 -0
  128. package/dist/features/attention/index.d.ts.map +1 -0
  129. package/dist/features/attention/index.js +128 -0
  130. package/dist/features/attention/index.js.map +1 -0
  131. package/dist/features/bugreport/BugReportFeature.d.ts +37 -0
  132. package/dist/features/bugreport/BugReportFeature.d.ts.map +1 -0
  133. package/dist/features/bugreport/BugReportFeature.js +56 -0
  134. package/dist/features/bugreport/BugReportFeature.js.map +1 -0
  135. package/dist/features/bugreport/collect.d.ts +33 -0
  136. package/dist/features/bugreport/collect.d.ts.map +1 -0
  137. package/dist/features/bugreport/collect.js +30 -0
  138. package/dist/features/bugreport/collect.js.map +1 -0
  139. package/dist/features/bugreport/widget.d.ts +40 -0
  140. package/dist/features/bugreport/widget.d.ts.map +1 -0
  141. package/dist/features/bugreport/widget.js +145 -0
  142. package/dist/features/bugreport/widget.js.map +1 -0
  143. package/dist/features/coach/CoachmarkFeature.d.ts +78 -0
  144. package/dist/features/coach/CoachmarkFeature.d.ts.map +1 -0
  145. package/dist/features/coach/CoachmarkFeature.js +161 -0
  146. package/dist/features/coach/CoachmarkFeature.js.map +1 -0
  147. package/dist/features/coach/anchor.d.ts +32 -0
  148. package/dist/features/coach/anchor.d.ts.map +1 -0
  149. package/dist/features/coach/anchor.js +128 -0
  150. package/dist/features/coach/anchor.js.map +1 -0
  151. package/dist/features/coach/observers.d.ts +17 -0
  152. package/dist/features/coach/observers.d.ts.map +1 -0
  153. package/dist/features/coach/observers.js +49 -0
  154. package/dist/features/coach/observers.js.map +1 -0
  155. package/dist/features/coach/overlay.d.ts +15 -0
  156. package/dist/features/coach/overlay.d.ts.map +1 -0
  157. package/dist/features/coach/overlay.js +205 -0
  158. package/dist/features/coach/overlay.js.map +1 -0
  159. package/dist/features/coach/position.d.ts +9 -0
  160. package/dist/features/coach/position.d.ts.map +1 -0
  161. package/dist/features/coach/position.js +83 -0
  162. package/dist/features/coach/position.js.map +1 -0
  163. package/dist/features/coach/predicate.d.ts +10 -0
  164. package/dist/features/coach/predicate.d.ts.map +1 -0
  165. package/dist/features/coach/predicate.js +36 -0
  166. package/dist/features/coach/predicate.js.map +1 -0
  167. package/dist/features/coach/tour.d.ts +55 -0
  168. package/dist/features/coach/tour.d.ts.map +1 -0
  169. package/dist/features/coach/tour.js +181 -0
  170. package/dist/features/coach/tour.js.map +1 -0
  171. package/dist/features/coach/types.d.ts +161 -0
  172. package/dist/features/coach/types.d.ts.map +1 -0
  173. package/dist/features/coach/types.js +2 -0
  174. package/dist/features/coach/types.js.map +1 -0
  175. package/dist/features/coach/wait.d.ts +34 -0
  176. package/dist/features/coach/wait.d.ts.map +1 -0
  177. package/dist/features/coach/wait.js +107 -0
  178. package/dist/features/coach/wait.js.map +1 -0
  179. package/dist/features/config/ConfigFeature.d.ts +117 -0
  180. package/dist/features/config/ConfigFeature.d.ts.map +1 -0
  181. package/dist/features/config/ConfigFeature.js +437 -0
  182. package/dist/features/config/ConfigFeature.js.map +1 -0
  183. package/dist/features/config/bucketing.d.ts +20 -0
  184. package/dist/features/config/bucketing.d.ts.map +1 -0
  185. package/dist/features/config/bucketing.js +37 -0
  186. package/dist/features/config/bucketing.js.map +1 -0
  187. package/dist/features/config/configStore.d.ts +11 -0
  188. package/dist/features/config/configStore.d.ts.map +1 -0
  189. package/dist/features/config/configStore.js +66 -0
  190. package/dist/features/config/configStore.js.map +1 -0
  191. package/dist/features/config/targeting.d.ts +11 -0
  192. package/dist/features/config/targeting.d.ts.map +1 -0
  193. package/dist/features/config/targeting.js +57 -0
  194. package/dist/features/config/targeting.js.map +1 -0
  195. package/dist/features/config/types.d.ts +100 -0
  196. package/dist/features/config/types.d.ts.map +1 -0
  197. package/dist/features/config/types.js +9 -0
  198. package/dist/features/config/types.js.map +1 -0
  199. package/dist/features/console/ConsoleFeature.d.ts +31 -0
  200. package/dist/features/console/ConsoleFeature.d.ts.map +1 -0
  201. package/dist/features/console/ConsoleFeature.js +98 -0
  202. package/dist/features/console/ConsoleFeature.js.map +1 -0
  203. package/dist/features/console/normalize.d.ts +18 -0
  204. package/dist/features/console/normalize.d.ts.map +1 -0
  205. package/dist/features/console/normalize.js +64 -0
  206. package/dist/features/console/normalize.js.map +1 -0
  207. package/dist/features/console/serialize.d.ts +24 -0
  208. package/dist/features/console/serialize.d.ts.map +1 -0
  209. package/dist/features/console/serialize.js +99 -0
  210. package/dist/features/console/serialize.js.map +1 -0
  211. package/dist/features/console/throttle.d.ts +27 -0
  212. package/dist/features/console/throttle.d.ts.map +1 -0
  213. package/dist/features/console/throttle.js +37 -0
  214. package/dist/features/console/throttle.js.map +1 -0
  215. package/dist/features/crash/CrashFeature.d.ts +46 -0
  216. package/dist/features/crash/CrashFeature.d.ts.map +1 -0
  217. package/dist/features/crash/CrashFeature.js +173 -0
  218. package/dist/features/crash/CrashFeature.js.map +1 -0
  219. package/dist/features/crash/liveness.d.ts +30 -0
  220. package/dist/features/crash/liveness.d.ts.map +1 -0
  221. package/dist/features/crash/liveness.js +131 -0
  222. package/dist/features/crash/liveness.js.map +1 -0
  223. package/dist/features/engage/EngageFeature.d.ts +67 -0
  224. package/dist/features/engage/EngageFeature.d.ts.map +1 -0
  225. package/dist/features/engage/EngageFeature.js +243 -0
  226. package/dist/features/engage/EngageFeature.js.map +1 -0
  227. package/dist/features/engage/attachments.d.ts +24 -0
  228. package/dist/features/engage/attachments.d.ts.map +1 -0
  229. package/dist/features/engage/attachments.js +209 -0
  230. package/dist/features/engage/attachments.js.map +1 -0
  231. package/dist/features/engage/gameLogic.d.ts +60 -0
  232. package/dist/features/engage/gameLogic.d.ts.map +1 -0
  233. package/dist/features/engage/gameLogic.js +213 -0
  234. package/dist/features/engage/gameLogic.js.map +1 -0
  235. package/dist/features/engage/gameResolver.d.ts +35 -0
  236. package/dist/features/engage/gameResolver.d.ts.map +1 -0
  237. package/dist/features/engage/gameResolver.js +81 -0
  238. package/dist/features/engage/gameResolver.js.map +1 -0
  239. package/dist/features/engage/gameTypes.d.ts +76 -0
  240. package/dist/features/engage/gameTypes.d.ts.map +1 -0
  241. package/dist/features/engage/gameTypes.js +17 -0
  242. package/dist/features/engage/gameTypes.js.map +1 -0
  243. package/dist/features/engage/inappSlots.d.ts +39 -0
  244. package/dist/features/engage/inappSlots.d.ts.map +1 -0
  245. package/dist/features/engage/inappSlots.js +50 -0
  246. package/dist/features/engage/inappSlots.js.map +1 -0
  247. package/dist/features/engage/normalize.d.ts +11 -0
  248. package/dist/features/engage/normalize.d.ts.map +1 -0
  249. package/dist/features/engage/normalize.js +210 -0
  250. package/dist/features/engage/normalize.js.map +1 -0
  251. package/dist/features/engage/richInApp.d.ts +64 -0
  252. package/dist/features/engage/richInApp.d.ts.map +1 -0
  253. package/dist/features/engage/richInApp.js +1082 -0
  254. package/dist/features/engage/richInApp.js.map +1 -0
  255. package/dist/features/engage/runtime.d.ts +89 -0
  256. package/dist/features/engage/runtime.d.ts.map +1 -0
  257. package/dist/features/engage/runtime.js +364 -0
  258. package/dist/features/engage/runtime.js.map +1 -0
  259. package/dist/features/engage/shakeDetector.d.ts +6 -0
  260. package/dist/features/engage/shakeDetector.d.ts.map +1 -0
  261. package/dist/features/engage/shakeDetector.js +105 -0
  262. package/dist/features/engage/shakeDetector.js.map +1 -0
  263. package/dist/features/engage/theme.d.ts +129 -0
  264. package/dist/features/engage/theme.d.ts.map +1 -0
  265. package/dist/features/engage/theme.js +270 -0
  266. package/dist/features/engage/theme.js.map +1 -0
  267. package/dist/features/engage/throttle.d.ts +41 -0
  268. package/dist/features/engage/throttle.d.ts.map +1 -0
  269. package/dist/features/engage/throttle.js +220 -0
  270. package/dist/features/engage/throttle.js.map +1 -0
  271. package/dist/features/engage/transport.d.ts +62 -0
  272. package/dist/features/engage/transport.d.ts.map +1 -0
  273. package/dist/features/engage/transport.js +185 -0
  274. package/dist/features/engage/transport.js.map +1 -0
  275. package/dist/features/engage/triggerEngine.d.ts +39 -0
  276. package/dist/features/engage/triggerEngine.d.ts.map +1 -0
  277. package/dist/features/engage/triggerEngine.js +105 -0
  278. package/dist/features/engage/triggerEngine.js.map +1 -0
  279. package/dist/features/engage/types.d.ts +271 -0
  280. package/dist/features/engage/types.d.ts.map +1 -0
  281. package/dist/features/engage/types.js +3 -0
  282. package/dist/features/engage/types.js.map +1 -0
  283. package/dist/features/engage/widget/InAppWidget.d.ts +10 -0
  284. package/dist/features/engage/widget/InAppWidget.d.ts.map +1 -0
  285. package/dist/features/engage/widget/InAppWidget.js +137 -0
  286. package/dist/features/engage/widget/InAppWidget.js.map +1 -0
  287. package/dist/features/engage/widget/SurveyWidget.d.ts +11 -0
  288. package/dist/features/engage/widget/SurveyWidget.d.ts.map +1 -0
  289. package/dist/features/engage/widget/SurveyWidget.js +547 -0
  290. package/dist/features/engage/widget/SurveyWidget.js.map +1 -0
  291. package/dist/features/errors/ErrorsFeature.d.ts +62 -0
  292. package/dist/features/errors/ErrorsFeature.d.ts.map +1 -0
  293. package/dist/features/errors/ErrorsFeature.js +209 -0
  294. package/dist/features/errors/ErrorsFeature.js.map +1 -0
  295. package/dist/features/errors/causes.d.ts +15 -0
  296. package/dist/features/errors/causes.d.ts.map +1 -0
  297. package/dist/features/errors/causes.js +29 -0
  298. package/dist/features/errors/causes.js.map +1 -0
  299. package/dist/features/errors/dedup.d.ts +28 -0
  300. package/dist/features/errors/dedup.d.ts.map +1 -0
  301. package/dist/features/errors/dedup.js +42 -0
  302. package/dist/features/errors/dedup.js.map +1 -0
  303. package/dist/features/errors/group/fingerprint.d.ts +13 -0
  304. package/dist/features/errors/group/fingerprint.d.ts.map +1 -0
  305. package/dist/features/errors/group/fingerprint.js +45 -0
  306. package/dist/features/errors/group/fingerprint.js.map +1 -0
  307. package/dist/features/errors/lazy.d.ts +8 -0
  308. package/dist/features/errors/lazy.d.ts.map +1 -0
  309. package/dist/features/errors/lazy.js +8 -0
  310. package/dist/features/errors/lazy.js.map +1 -0
  311. package/dist/features/errors/normalize.d.ts +26 -0
  312. package/dist/features/errors/normalize.d.ts.map +1 -0
  313. package/dist/features/errors/normalize.js +58 -0
  314. package/dist/features/errors/normalize.js.map +1 -0
  315. package/dist/features/errors/parse/stacktrace.d.ts +13 -0
  316. package/dist/features/errors/parse/stacktrace.d.ts.map +1 -0
  317. package/dist/features/errors/parse/stacktrace.js +85 -0
  318. package/dist/features/errors/parse/stacktrace.js.map +1 -0
  319. package/dist/features/errors/redact.d.ts +7 -0
  320. package/dist/features/errors/redact.d.ts.map +1 -0
  321. package/dist/features/errors/redact.js +39 -0
  322. package/dist/features/errors/redact.js.map +1 -0
  323. package/dist/features/errors/sampling.d.ts +2 -0
  324. package/dist/features/errors/sampling.d.ts.map +1 -0
  325. package/dist/features/errors/sampling.js +24 -0
  326. package/dist/features/errors/sampling.js.map +1 -0
  327. package/dist/features/errors/scope.d.ts +26 -0
  328. package/dist/features/errors/scope.d.ts.map +1 -0
  329. package/dist/features/errors/scope.js +30 -0
  330. package/dist/features/errors/scope.js.map +1 -0
  331. package/dist/features/exit-intent/ExitIntentFeature.d.ts +16 -0
  332. package/dist/features/exit-intent/ExitIntentFeature.d.ts.map +1 -0
  333. package/dist/features/exit-intent/ExitIntentFeature.js +25 -0
  334. package/dist/features/exit-intent/ExitIntentFeature.js.map +1 -0
  335. package/dist/features/exit-intent/engine.d.ts +127 -0
  336. package/dist/features/exit-intent/engine.d.ts.map +1 -0
  337. package/dist/features/exit-intent/engine.js +227 -0
  338. package/dist/features/exit-intent/engine.js.map +1 -0
  339. package/dist/features/forms/index.d.ts +83 -0
  340. package/dist/features/forms/index.d.ts.map +1 -0
  341. package/dist/features/forms/index.js +405 -0
  342. package/dist/features/forms/index.js.map +1 -0
  343. package/dist/features/inapp/InApp2Feature.d.ts +24 -0
  344. package/dist/features/inapp/InApp2Feature.d.ts.map +1 -0
  345. package/dist/features/inapp/InApp2Feature.js +44 -0
  346. package/dist/features/inapp/InApp2Feature.js.map +1 -0
  347. package/dist/features/inapp/a11y/focus.d.ts +24 -0
  348. package/dist/features/inapp/a11y/focus.d.ts.map +1 -0
  349. package/dist/features/inapp/a11y/focus.js +112 -0
  350. package/dist/features/inapp/a11y/focus.js.map +1 -0
  351. package/dist/features/inapp/anchor/controller.d.ts +64 -0
  352. package/dist/features/inapp/anchor/controller.d.ts.map +1 -0
  353. package/dist/features/inapp/anchor/controller.js +155 -0
  354. package/dist/features/inapp/anchor/controller.js.map +1 -0
  355. package/dist/features/inapp/api.d.ts +28 -0
  356. package/dist/features/inapp/api.d.ts.map +1 -0
  357. package/dist/features/inapp/api.js +41 -0
  358. package/dist/features/inapp/api.js.map +1 -0
  359. package/dist/features/inapp/blocks/blocks.d.ts +65 -0
  360. package/dist/features/inapp/blocks/blocks.d.ts.map +1 -0
  361. package/dist/features/inapp/blocks/blocks.js +196 -0
  362. package/dist/features/inapp/blocks/blocks.js.map +1 -0
  363. package/dist/features/inapp/blocks/feedback.d.ts +13 -0
  364. package/dist/features/inapp/blocks/feedback.d.ts.map +1 -0
  365. package/dist/features/inapp/blocks/feedback.js +154 -0
  366. package/dist/features/inapp/blocks/feedback.js.map +1 -0
  367. package/dist/features/inapp/blocks/heavy/carousel.d.ts +8 -0
  368. package/dist/features/inapp/blocks/heavy/carousel.d.ts.map +1 -0
  369. package/dist/features/inapp/blocks/heavy/carousel.js +67 -0
  370. package/dist/features/inapp/blocks/heavy/carousel.js.map +1 -0
  371. package/dist/features/inapp/blocks/heavy/chart.d.ts +9 -0
  372. package/dist/features/inapp/blocks/heavy/chart.d.ts.map +1 -0
  373. package/dist/features/inapp/blocks/heavy/chart.js +83 -0
  374. package/dist/features/inapp/blocks/heavy/chart.js.map +1 -0
  375. package/dist/features/inapp/blocks/heavy/code.d.ts +8 -0
  376. package/dist/features/inapp/blocks/heavy/code.d.ts.map +1 -0
  377. package/dist/features/inapp/blocks/heavy/code.js +47 -0
  378. package/dist/features/inapp/blocks/heavy/code.js.map +1 -0
  379. package/dist/features/inapp/blocks/heavy/confetti.d.ts +9 -0
  380. package/dist/features/inapp/blocks/heavy/confetti.d.ts.map +1 -0
  381. package/dist/features/inapp/blocks/heavy/confetti.js +76 -0
  382. package/dist/features/inapp/blocks/heavy/confetti.js.map +1 -0
  383. package/dist/features/inapp/blocks/heavy/countdown.d.ts +9 -0
  384. package/dist/features/inapp/blocks/heavy/countdown.d.ts.map +1 -0
  385. package/dist/features/inapp/blocks/heavy/countdown.js +59 -0
  386. package/dist/features/inapp/blocks/heavy/countdown.js.map +1 -0
  387. package/dist/features/inapp/blocks/heavy/index.d.ts +11 -0
  388. package/dist/features/inapp/blocks/heavy/index.d.ts.map +1 -0
  389. package/dist/features/inapp/blocks/heavy/index.js +45 -0
  390. package/dist/features/inapp/blocks/heavy/index.js.map +1 -0
  391. package/dist/features/inapp/blocks/heavy/markdown.d.ts +9 -0
  392. package/dist/features/inapp/blocks/heavy/markdown.d.ts.map +1 -0
  393. package/dist/features/inapp/blocks/heavy/markdown.js +76 -0
  394. package/dist/features/inapp/blocks/heavy/markdown.js.map +1 -0
  395. package/dist/features/inapp/blocks/heavy/productgrid.d.ts +8 -0
  396. package/dist/features/inapp/blocks/heavy/productgrid.d.ts.map +1 -0
  397. package/dist/features/inapp/blocks/heavy/productgrid.js +46 -0
  398. package/dist/features/inapp/blocks/heavy/productgrid.js.map +1 -0
  399. package/dist/features/inapp/blocks/heavy/qr.d.ts +10 -0
  400. package/dist/features/inapp/blocks/heavy/qr.d.ts.map +1 -0
  401. package/dist/features/inapp/blocks/heavy/qr.js +69 -0
  402. package/dist/features/inapp/blocks/heavy/qr.js.map +1 -0
  403. package/dist/features/inapp/blocks/heavy/scratch.d.ts +8 -0
  404. package/dist/features/inapp/blocks/heavy/scratch.d.ts.map +1 -0
  405. package/dist/features/inapp/blocks/heavy/scratch.js +141 -0
  406. package/dist/features/inapp/blocks/heavy/scratch.js.map +1 -0
  407. package/dist/features/inapp/blocks/heavy/slot.d.ts +8 -0
  408. package/dist/features/inapp/blocks/heavy/slot.d.ts.map +1 -0
  409. package/dist/features/inapp/blocks/heavy/slot.js +96 -0
  410. package/dist/features/inapp/blocks/heavy/slot.js.map +1 -0
  411. package/dist/features/inapp/blocks/heavy/spinwheel.d.ts +9 -0
  412. package/dist/features/inapp/blocks/heavy/spinwheel.d.ts.map +1 -0
  413. package/dist/features/inapp/blocks/heavy/spinwheel.js +127 -0
  414. package/dist/features/inapp/blocks/heavy/spinwheel.js.map +1 -0
  415. package/dist/features/inapp/blocks/heavy/steps.d.ts +27 -0
  416. package/dist/features/inapp/blocks/heavy/steps.d.ts.map +1 -0
  417. package/dist/features/inapp/blocks/heavy/steps.js +135 -0
  418. package/dist/features/inapp/blocks/heavy/steps.js.map +1 -0
  419. package/dist/features/inapp/blocks/heavy/streak.d.ts +18 -0
  420. package/dist/features/inapp/blocks/heavy/streak.d.ts.map +1 -0
  421. package/dist/features/inapp/blocks/heavy/streak.js +52 -0
  422. package/dist/features/inapp/blocks/heavy/streak.js.map +1 -0
  423. package/dist/features/inapp/blocks/heavy/table.d.ts +7 -0
  424. package/dist/features/inapp/blocks/heavy/table.d.ts.map +1 -0
  425. package/dist/features/inapp/blocks/heavy/table.js +30 -0
  426. package/dist/features/inapp/blocks/heavy/table.js.map +1 -0
  427. package/dist/features/inapp/blocks/heavy/unavailable.d.ts +28 -0
  428. package/dist/features/inapp/blocks/heavy/unavailable.d.ts.map +1 -0
  429. package/dist/features/inapp/blocks/heavy/unavailable.js +33 -0
  430. package/dist/features/inapp/blocks/heavy/unavailable.js.map +1 -0
  431. package/dist/features/inapp/blocks/heavy/video.d.ts +7 -0
  432. package/dist/features/inapp/blocks/heavy/video.d.ts.map +1 -0
  433. package/dist/features/inapp/blocks/heavy/video.js +38 -0
  434. package/dist/features/inapp/blocks/heavy/video.js.map +1 -0
  435. package/dist/features/inapp/blocks/styles.d.ts +7 -0
  436. package/dist/features/inapp/blocks/styles.d.ts.map +1 -0
  437. package/dist/features/inapp/blocks/styles.js +225 -0
  438. package/dist/features/inapp/blocks/styles.js.map +1 -0
  439. package/dist/features/inapp/center/bridge.d.ts +12 -0
  440. package/dist/features/inapp/center/bridge.d.ts.map +1 -0
  441. package/dist/features/inapp/center/bridge.js +59 -0
  442. package/dist/features/inapp/center/bridge.js.map +1 -0
  443. package/dist/features/inapp/center/panel.d.ts +20 -0
  444. package/dist/features/inapp/center/panel.d.ts.map +1 -0
  445. package/dist/features/inapp/center/panel.js +228 -0
  446. package/dist/features/inapp/center/panel.js.map +1 -0
  447. package/dist/features/inapp/center/store.d.ts +50 -0
  448. package/dist/features/inapp/center/store.d.ts.map +1 -0
  449. package/dist/features/inapp/center/store.js +188 -0
  450. package/dist/features/inapp/center/store.js.map +1 -0
  451. package/dist/features/inapp/center/sync.d.ts +32 -0
  452. package/dist/features/inapp/center/sync.d.ts.map +1 -0
  453. package/dist/features/inapp/center/sync.js +60 -0
  454. package/dist/features/inapp/center/sync.js.map +1 -0
  455. package/dist/features/inapp/center/types.d.ts +46 -0
  456. package/dist/features/inapp/center/types.d.ts.map +1 -0
  457. package/dist/features/inapp/center/types.js +5 -0
  458. package/dist/features/inapp/center/types.js.map +1 -0
  459. package/dist/features/inapp/core/analytics.d.ts +35 -0
  460. package/dist/features/inapp/core/analytics.d.ts.map +1 -0
  461. package/dist/features/inapp/core/analytics.js +70 -0
  462. package/dist/features/inapp/core/analytics.js.map +1 -0
  463. package/dist/features/inapp/core/compat.d.ts +28 -0
  464. package/dist/features/inapp/core/compat.d.ts.map +1 -0
  465. package/dist/features/inapp/core/compat.js +104 -0
  466. package/dist/features/inapp/core/compat.js.map +1 -0
  467. package/dist/features/inapp/core/debugOverlay.d.ts +5 -0
  468. package/dist/features/inapp/core/debugOverlay.d.ts.map +1 -0
  469. package/dist/features/inapp/core/debugOverlay.js +79 -0
  470. package/dist/features/inapp/core/debugOverlay.js.map +1 -0
  471. package/dist/features/inapp/core/engine.d.ts +72 -0
  472. package/dist/features/inapp/core/engine.d.ts.map +1 -0
  473. package/dist/features/inapp/core/engine.js +248 -0
  474. package/dist/features/inapp/core/engine.js.map +1 -0
  475. package/dist/features/inapp/core/environment.d.ts +21 -0
  476. package/dist/features/inapp/core/environment.d.ts.map +1 -0
  477. package/dist/features/inapp/core/environment.js +57 -0
  478. package/dist/features/inapp/core/environment.js.map +1 -0
  479. package/dist/features/inapp/core/host.d.ts +53 -0
  480. package/dist/features/inapp/core/host.d.ts.map +1 -0
  481. package/dist/features/inapp/core/host.js +243 -0
  482. package/dist/features/inapp/core/host.js.map +1 -0
  483. package/dist/features/inapp/core/keyboard.d.ts +27 -0
  484. package/dist/features/inapp/core/keyboard.d.ts.map +1 -0
  485. package/dist/features/inapp/core/keyboard.js +69 -0
  486. package/dist/features/inapp/core/keyboard.js.map +1 -0
  487. package/dist/features/inapp/core/metrics.d.ts +73 -0
  488. package/dist/features/inapp/core/metrics.d.ts.map +1 -0
  489. package/dist/features/inapp/core/metrics.js +125 -0
  490. package/dist/features/inapp/core/metrics.js.map +1 -0
  491. package/dist/features/inapp/core/migration.d.ts +32 -0
  492. package/dist/features/inapp/core/migration.d.ts.map +1 -0
  493. package/dist/features/inapp/core/migration.js +28 -0
  494. package/dist/features/inapp/core/migration.js.map +1 -0
  495. package/dist/features/inapp/core/orchestrator.d.ts +77 -0
  496. package/dist/features/inapp/core/orchestrator.d.ts.map +1 -0
  497. package/dist/features/inapp/core/orchestrator.js +144 -0
  498. package/dist/features/inapp/core/orchestrator.js.map +1 -0
  499. package/dist/features/inapp/core/respect.d.ts +51 -0
  500. package/dist/features/inapp/core/respect.d.ts.map +1 -0
  501. package/dist/features/inapp/core/respect.js +78 -0
  502. package/dist/features/inapp/core/respect.js.map +1 -0
  503. package/dist/features/inapp/core/slots.d.ts +19 -0
  504. package/dist/features/inapp/core/slots.d.ts.map +1 -0
  505. package/dist/features/inapp/core/slots.js +53 -0
  506. package/dist/features/inapp/core/slots.js.map +1 -0
  507. package/dist/features/inapp/core/targeting.d.ts +85 -0
  508. package/dist/features/inapp/core/targeting.d.ts.map +1 -0
  509. package/dist/features/inapp/core/targeting.js +255 -0
  510. package/dist/features/inapp/core/targeting.js.map +1 -0
  511. package/dist/features/inapp/core/transport.d.ts +66 -0
  512. package/dist/features/inapp/core/transport.d.ts.map +1 -0
  513. package/dist/features/inapp/core/transport.js +154 -0
  514. package/dist/features/inapp/core/transport.js.map +1 -0
  515. package/dist/features/inapp/core/triggers.d.ts +94 -0
  516. package/dist/features/inapp/core/triggers.d.ts.map +1 -0
  517. package/dist/features/inapp/core/triggers.js +368 -0
  518. package/dist/features/inapp/core/triggers.js.map +1 -0
  519. package/dist/features/inapp/inappContract.web.d.ts +47 -0
  520. package/dist/features/inapp/inappContract.web.d.ts.map +1 -0
  521. package/dist/features/inapp/inappContract.web.js +230 -0
  522. package/dist/features/inapp/inappContract.web.js.map +1 -0
  523. package/dist/features/inapp/index.d.ts +23 -0
  524. package/dist/features/inapp/index.d.ts.map +1 -0
  525. package/dist/features/inapp/index.js +23 -0
  526. package/dist/features/inapp/index.js.map +1 -0
  527. package/dist/features/inapp/registry.canonical.hash.d.ts +7 -0
  528. package/dist/features/inapp/registry.canonical.hash.d.ts.map +1 -0
  529. package/dist/features/inapp/registry.canonical.hash.js +7 -0
  530. package/dist/features/inapp/registry.canonical.hash.js.map +1 -0
  531. package/dist/features/inapp/registry.web.canonical.d.ts +21 -0
  532. package/dist/features/inapp/registry.web.canonical.d.ts.map +1 -0
  533. package/dist/features/inapp/registry.web.canonical.js +136 -0
  534. package/dist/features/inapp/registry.web.canonical.js.map +1 -0
  535. package/dist/features/inapp/registry.web.catalog.d.ts +12 -0
  536. package/dist/features/inapp/registry.web.catalog.d.ts.map +1 -0
  537. package/dist/features/inapp/registry.web.catalog.js +208 -0
  538. package/dist/features/inapp/registry.web.catalog.js.map +1 -0
  539. package/dist/features/inapp/surfaces/banner.d.ts +7 -0
  540. package/dist/features/inapp/surfaces/banner.d.ts.map +1 -0
  541. package/dist/features/inapp/surfaces/banner.js +30 -0
  542. package/dist/features/inapp/surfaces/banner.js.map +1 -0
  543. package/dist/features/inapp/surfaces/checklist.d.ts +13 -0
  544. package/dist/features/inapp/surfaces/checklist.d.ts.map +1 -0
  545. package/dist/features/inapp/surfaces/checklist.js +127 -0
  546. package/dist/features/inapp/surfaces/checklist.js.map +1 -0
  547. package/dist/features/inapp/surfaces/coachmark.d.ts +10 -0
  548. package/dist/features/inapp/surfaces/coachmark.d.ts.map +1 -0
  549. package/dist/features/inapp/surfaces/coachmark.js +95 -0
  550. package/dist/features/inapp/surfaces/coachmark.js.map +1 -0
  551. package/dist/features/inapp/surfaces/hotspot.d.ts +8 -0
  552. package/dist/features/inapp/surfaces/hotspot.d.ts.map +1 -0
  553. package/dist/features/inapp/surfaces/hotspot.js +91 -0
  554. package/dist/features/inapp/surfaces/hotspot.js.map +1 -0
  555. package/dist/features/inapp/surfaces/inline.d.ts +13 -0
  556. package/dist/features/inapp/surfaces/inline.d.ts.map +1 -0
  557. package/dist/features/inapp/surfaces/inline.js +78 -0
  558. package/dist/features/inapp/surfaces/inline.js.map +1 -0
  559. package/dist/features/inapp/surfaces/launcher.d.ts +9 -0
  560. package/dist/features/inapp/surfaces/launcher.d.ts.map +1 -0
  561. package/dist/features/inapp/surfaces/launcher.js +54 -0
  562. package/dist/features/inapp/surfaces/launcher.js.map +1 -0
  563. package/dist/features/inapp/surfaces/modal.d.ts +8 -0
  564. package/dist/features/inapp/surfaces/modal.d.ts.map +1 -0
  565. package/dist/features/inapp/surfaces/modal.js +70 -0
  566. package/dist/features/inapp/surfaces/modal.js.map +1 -0
  567. package/dist/features/inapp/surfaces/mount.d.ts +19 -0
  568. package/dist/features/inapp/surfaces/mount.d.ts.map +1 -0
  569. package/dist/features/inapp/surfaces/mount.js +29 -0
  570. package/dist/features/inapp/surfaces/mount.js.map +1 -0
  571. package/dist/features/inapp/surfaces/palette.d.ts +9 -0
  572. package/dist/features/inapp/surfaces/palette.d.ts.map +1 -0
  573. package/dist/features/inapp/surfaces/palette.js +127 -0
  574. package/dist/features/inapp/surfaces/palette.js.map +1 -0
  575. package/dist/features/inapp/surfaces/panel.d.ts +14 -0
  576. package/dist/features/inapp/surfaces/panel.d.ts.map +1 -0
  577. package/dist/features/inapp/surfaces/panel.js +91 -0
  578. package/dist/features/inapp/surfaces/panel.js.map +1 -0
  579. package/dist/features/inapp/surfaces/popover.d.ts +10 -0
  580. package/dist/features/inapp/surfaces/popover.d.ts.map +1 -0
  581. package/dist/features/inapp/surfaces/popover.js +69 -0
  582. package/dist/features/inapp/surfaces/popover.js.map +1 -0
  583. package/dist/features/inapp/surfaces/render.d.ts +34 -0
  584. package/dist/features/inapp/surfaces/render.d.ts.map +1 -0
  585. package/dist/features/inapp/surfaces/render.js +56 -0
  586. package/dist/features/inapp/surfaces/render.js.map +1 -0
  587. package/dist/features/inapp/surfaces/slideover.d.ts +9 -0
  588. package/dist/features/inapp/surfaces/slideover.d.ts.map +1 -0
  589. package/dist/features/inapp/surfaces/slideover.js +144 -0
  590. package/dist/features/inapp/surfaces/slideover.js.map +1 -0
  591. package/dist/features/inapp/surfaces/styles.d.ts +7 -0
  592. package/dist/features/inapp/surfaces/styles.d.ts.map +1 -0
  593. package/dist/features/inapp/surfaces/styles.js +235 -0
  594. package/dist/features/inapp/surfaces/styles.js.map +1 -0
  595. package/dist/features/inapp/surfaces/surface.d.ts +69 -0
  596. package/dist/features/inapp/surfaces/surface.d.ts.map +1 -0
  597. package/dist/features/inapp/surfaces/surface.js +80 -0
  598. package/dist/features/inapp/surfaces/surface.js.map +1 -0
  599. package/dist/features/inapp/surfaces/takeover.d.ts +9 -0
  600. package/dist/features/inapp/surfaces/takeover.d.ts.map +1 -0
  601. package/dist/features/inapp/surfaces/takeover.js +60 -0
  602. package/dist/features/inapp/surfaces/takeover.js.map +1 -0
  603. package/dist/features/inapp/surfaces/toast.d.ts +7 -0
  604. package/dist/features/inapp/surfaces/toast.d.ts.map +1 -0
  605. package/dist/features/inapp/surfaces/toast.js +48 -0
  606. package/dist/features/inapp/surfaces/toast.js.map +1 -0
  607. package/dist/features/inapp/surfaces/toolbar.d.ts +8 -0
  608. package/dist/features/inapp/surfaces/toolbar.d.ts.map +1 -0
  609. package/dist/features/inapp/surfaces/toolbar.js +65 -0
  610. package/dist/features/inapp/surfaces/toolbar.js.map +1 -0
  611. package/dist/features/inapp/surfaces/tour.d.ts +14 -0
  612. package/dist/features/inapp/surfaces/tour.d.ts.map +1 -0
  613. package/dist/features/inapp/surfaces/tour.js +202 -0
  614. package/dist/features/inapp/surfaces/tour.js.map +1 -0
  615. package/dist/features/inapp/types.d.ts +165 -0
  616. package/dist/features/inapp/types.d.ts.map +1 -0
  617. package/dist/features/inapp/types.js +12 -0
  618. package/dist/features/inapp/types.js.map +1 -0
  619. package/dist/features/inbox/InboxFeature.d.ts +57 -0
  620. package/dist/features/inbox/InboxFeature.d.ts.map +1 -0
  621. package/dist/features/inbox/InboxFeature.js +225 -0
  622. package/dist/features/inbox/InboxFeature.js.map +1 -0
  623. package/dist/features/inbox/runtime.d.ts +67 -0
  624. package/dist/features/inbox/runtime.d.ts.map +1 -0
  625. package/dist/features/inbox/runtime.js +376 -0
  626. package/dist/features/inbox/runtime.js.map +1 -0
  627. package/dist/features/inbox/store.d.ts +37 -0
  628. package/dist/features/inbox/store.d.ts.map +1 -0
  629. package/dist/features/inbox/store.js +149 -0
  630. package/dist/features/inbox/store.js.map +1 -0
  631. package/dist/features/inbox/sync.d.ts +49 -0
  632. package/dist/features/inbox/sync.d.ts.map +1 -0
  633. package/dist/features/inbox/sync.js +131 -0
  634. package/dist/features/inbox/sync.js.map +1 -0
  635. package/dist/features/inbox/types.d.ts +275 -0
  636. package/dist/features/inbox/types.d.ts.map +1 -0
  637. package/dist/features/inbox/types.js +42 -0
  638. package/dist/features/inbox/types.js.map +1 -0
  639. package/dist/features/inbox/widget/InboxWidget.d.ts +16 -0
  640. package/dist/features/inbox/widget/InboxWidget.d.ts.map +1 -0
  641. package/dist/features/inbox/widget/InboxWidget.js +609 -0
  642. package/dist/features/inbox/widget/InboxWidget.js.map +1 -0
  643. package/dist/features/index.d.ts +21 -0
  644. package/dist/features/index.d.ts.map +1 -0
  645. package/dist/features/index.js +2 -0
  646. package/dist/features/index.js.map +1 -0
  647. package/dist/features/journey/InteractionTracker.d.ts +87 -0
  648. package/dist/features/journey/InteractionTracker.d.ts.map +1 -0
  649. package/dist/features/journey/InteractionTracker.js +466 -0
  650. package/dist/features/journey/InteractionTracker.js.map +1 -0
  651. package/dist/features/journey/JourneyFeature.d.ts +18 -0
  652. package/dist/features/journey/JourneyFeature.d.ts.map +1 -0
  653. package/dist/features/journey/JourneyFeature.js +71 -0
  654. package/dist/features/journey/JourneyFeature.js.map +1 -0
  655. package/dist/features/journey/NavigationTracker.d.ts +16 -0
  656. package/dist/features/journey/NavigationTracker.d.ts.map +1 -0
  657. package/dist/features/journey/NavigationTracker.js +92 -0
  658. package/dist/features/journey/NavigationTracker.js.map +1 -0
  659. package/dist/features/journey/friction.d.ts +28 -0
  660. package/dist/features/journey/friction.d.ts.map +1 -0
  661. package/dist/features/journey/friction.js +64 -0
  662. package/dist/features/journey/friction.js.map +1 -0
  663. package/dist/features/journey/positionContext.d.ts +30 -0
  664. package/dist/features/journey/positionContext.d.ts.map +1 -0
  665. package/dist/features/journey/positionContext.js +116 -0
  666. package/dist/features/journey/positionContext.js.map +1 -0
  667. package/dist/features/journey/uiState.d.ts +44 -0
  668. package/dist/features/journey/uiState.d.ts.map +1 -0
  669. package/dist/features/journey/uiState.js +158 -0
  670. package/dist/features/journey/uiState.js.map +1 -0
  671. package/dist/features/manifest.d.ts +41 -0
  672. package/dist/features/manifest.d.ts.map +1 -0
  673. package/dist/features/manifest.js +93 -0
  674. package/dist/features/manifest.js.map +1 -0
  675. package/dist/features/network/NetworkFeature.d.ts +60 -0
  676. package/dist/features/network/NetworkFeature.d.ts.map +1 -0
  677. package/dist/features/network/NetworkFeature.js +260 -0
  678. package/dist/features/network/NetworkFeature.js.map +1 -0
  679. package/dist/features/network/capture/body.d.ts +31 -0
  680. package/dist/features/network/capture/body.d.ts.map +1 -0
  681. package/dist/features/network/capture/body.js +81 -0
  682. package/dist/features/network/capture/body.js.map +1 -0
  683. package/dist/features/network/classify.d.ts +21 -0
  684. package/dist/features/network/classify.d.ts.map +1 -0
  685. package/dist/features/network/classify.js +50 -0
  686. package/dist/features/network/classify.js.map +1 -0
  687. package/dist/features/network/dedup.d.ts +36 -0
  688. package/dist/features/network/dedup.d.ts.map +1 -0
  689. package/dist/features/network/dedup.js +68 -0
  690. package/dist/features/network/dedup.js.map +1 -0
  691. package/dist/features/network/fetchInterceptor.d.ts +20 -0
  692. package/dist/features/network/fetchInterceptor.d.ts.map +1 -0
  693. package/dist/features/network/fetchInterceptor.js +158 -0
  694. package/dist/features/network/fetchInterceptor.js.map +1 -0
  695. package/dist/features/network/intercept/beacon.d.ts +14 -0
  696. package/dist/features/network/intercept/beacon.d.ts.map +1 -0
  697. package/dist/features/network/intercept/beacon.js +56 -0
  698. package/dist/features/network/intercept/beacon.js.map +1 -0
  699. package/dist/features/network/intercept/sse.d.ts +16 -0
  700. package/dist/features/network/intercept/sse.d.ts.map +1 -0
  701. package/dist/features/network/intercept/sse.js +74 -0
  702. package/dist/features/network/intercept/sse.js.map +1 -0
  703. package/dist/features/network/intercept/streams.d.ts +23 -0
  704. package/dist/features/network/intercept/streams.d.ts.map +1 -0
  705. package/dist/features/network/intercept/streams.js +25 -0
  706. package/dist/features/network/intercept/streams.js.map +1 -0
  707. package/dist/features/network/intercept/websocket.d.ts +14 -0
  708. package/dist/features/network/intercept/websocket.d.ts.map +1 -0
  709. package/dist/features/network/intercept/websocket.js +97 -0
  710. package/dist/features/network/intercept/websocket.js.map +1 -0
  711. package/dist/features/network/lazy.d.ts +23 -0
  712. package/dist/features/network/lazy.d.ts.map +1 -0
  713. package/dist/features/network/lazy.js +65 -0
  714. package/dist/features/network/lazy.js.map +1 -0
  715. package/dist/features/network/normalize.d.ts +9 -0
  716. package/dist/features/network/normalize.d.ts.map +1 -0
  717. package/dist/features/network/normalize.js +49 -0
  718. package/dist/features/network/normalize.js.map +1 -0
  719. package/dist/features/network/parse/graphql.d.ts +17 -0
  720. package/dist/features/network/parse/graphql.d.ts.map +1 -0
  721. package/dist/features/network/parse/graphql.js +106 -0
  722. package/dist/features/network/parse/graphql.js.map +1 -0
  723. package/dist/features/network/parse/url.d.ts +12 -0
  724. package/dist/features/network/parse/url.d.ts.map +1 -0
  725. package/dist/features/network/parse/url.js +52 -0
  726. package/dist/features/network/parse/url.js.map +1 -0
  727. package/dist/features/network/sampler.d.ts +21 -0
  728. package/dist/features/network/sampler.d.ts.map +1 -0
  729. package/dist/features/network/sampler.js +25 -0
  730. package/dist/features/network/sampler.js.map +1 -0
  731. package/dist/features/network/size.d.ts +21 -0
  732. package/dist/features/network/size.d.ts.map +1 -0
  733. package/dist/features/network/size.js +63 -0
  734. package/dist/features/network/size.js.map +1 -0
  735. package/dist/features/network/thirdParty.d.ts +95 -0
  736. package/dist/features/network/thirdParty.d.ts.map +1 -0
  737. package/dist/features/network/thirdParty.js +126 -0
  738. package/dist/features/network/thirdParty.js.map +1 -0
  739. package/dist/features/network/timing.d.ts +41 -0
  740. package/dist/features/network/timing.d.ts.map +1 -0
  741. package/dist/features/network/timing.js +134 -0
  742. package/dist/features/network/timing.js.map +1 -0
  743. package/dist/features/network/tracing.d.ts +18 -0
  744. package/dist/features/network/tracing.d.ts.map +1 -0
  745. package/dist/features/network/tracing.js +46 -0
  746. package/dist/features/network/tracing.js.map +1 -0
  747. package/dist/features/network/types.d.ts +75 -0
  748. package/dist/features/network/types.d.ts.map +1 -0
  749. package/dist/features/network/types.js +2 -0
  750. package/dist/features/network/types.js.map +1 -0
  751. package/dist/features/network/xhrInterceptor.d.ts +12 -0
  752. package/dist/features/network/xhrInterceptor.d.ts.map +1 -0
  753. package/dist/features/network/xhrInterceptor.js +108 -0
  754. package/dist/features/network/xhrInterceptor.js.map +1 -0
  755. package/dist/features/performance/PerformanceFeature.d.ts +76 -0
  756. package/dist/features/performance/PerformanceFeature.d.ts.map +1 -0
  757. package/dist/features/performance/PerformanceFeature.js +265 -0
  758. package/dist/features/performance/PerformanceFeature.js.map +1 -0
  759. package/dist/features/performance/jankTap.d.ts +23 -0
  760. package/dist/features/performance/jankTap.d.ts.map +1 -0
  761. package/dist/features/performance/jankTap.js +20 -0
  762. package/dist/features/performance/jankTap.js.map +1 -0
  763. package/dist/features/performance/longTasks.d.ts +14 -0
  764. package/dist/features/performance/longTasks.d.ts.map +1 -0
  765. package/dist/features/performance/longTasks.js +55 -0
  766. package/dist/features/performance/longTasks.js.map +1 -0
  767. package/dist/features/performance/normalize.d.ts +15 -0
  768. package/dist/features/performance/normalize.d.ts.map +1 -0
  769. package/dist/features/performance/normalize.js +30 -0
  770. package/dist/features/performance/normalize.js.map +1 -0
  771. package/dist/features/performance/resources.d.ts +19 -0
  772. package/dist/features/performance/resources.d.ts.map +1 -0
  773. package/dist/features/performance/resources.js +78 -0
  774. package/dist/features/performance/resources.js.map +1 -0
  775. package/dist/features/performance/sampler.d.ts +10 -0
  776. package/dist/features/performance/sampler.d.ts.map +1 -0
  777. package/dist/features/performance/sampler.js +23 -0
  778. package/dist/features/performance/sampler.js.map +1 -0
  779. package/dist/features/performance/spa.d.ts +2 -0
  780. package/dist/features/performance/spa.d.ts.map +1 -0
  781. package/dist/features/performance/spa.js +40 -0
  782. package/dist/features/performance/spa.js.map +1 -0
  783. package/dist/features/performance/throttle.d.ts +21 -0
  784. package/dist/features/performance/throttle.d.ts.map +1 -0
  785. package/dist/features/performance/throttle.js +26 -0
  786. package/dist/features/performance/throttle.js.map +1 -0
  787. package/dist/features/performance/trace/context.d.ts +17 -0
  788. package/dist/features/performance/trace/context.d.ts.map +1 -0
  789. package/dist/features/performance/trace/context.js +33 -0
  790. package/dist/features/performance/trace/context.js.map +1 -0
  791. package/dist/features/performance/trace/index.d.ts +7 -0
  792. package/dist/features/performance/trace/index.d.ts.map +1 -0
  793. package/dist/features/performance/trace/index.js +6 -0
  794. package/dist/features/performance/trace/index.js.map +1 -0
  795. package/dist/features/performance/trace/pageload.d.ts +3 -0
  796. package/dist/features/performance/trace/pageload.d.ts.map +1 -0
  797. package/dist/features/performance/trace/pageload.js +34 -0
  798. package/dist/features/performance/trace/pageload.js.map +1 -0
  799. package/dist/features/performance/trace/transaction.d.ts +61 -0
  800. package/dist/features/performance/trace/transaction.d.ts.map +1 -0
  801. package/dist/features/performance/trace/transaction.js +90 -0
  802. package/dist/features/performance/trace/transaction.js.map +1 -0
  803. package/dist/features/performance/trace/types.d.ts +23 -0
  804. package/dist/features/performance/trace/types.d.ts.map +1 -0
  805. package/dist/features/performance/trace/types.js +10 -0
  806. package/dist/features/performance/trace/types.js.map +1 -0
  807. package/dist/features/performance/traces.d.ts +36 -0
  808. package/dist/features/performance/traces.d.ts.map +1 -0
  809. package/dist/features/performance/traces.js +50 -0
  810. package/dist/features/performance/traces.js.map +1 -0
  811. package/dist/features/profiler/ProfilerFeature.d.ts +28 -0
  812. package/dist/features/profiler/ProfilerFeature.d.ts.map +1 -0
  813. package/dist/features/profiler/ProfilerFeature.js +82 -0
  814. package/dist/features/profiler/ProfilerFeature.js.map +1 -0
  815. package/dist/features/profiler/capture.d.ts +8 -0
  816. package/dist/features/profiler/capture.d.ts.map +1 -0
  817. package/dist/features/profiler/capture.js +21 -0
  818. package/dist/features/profiler/capture.js.map +1 -0
  819. package/dist/features/push/PushFeature.d.ts +120 -0
  820. package/dist/features/push/PushFeature.d.ts.map +1 -0
  821. package/dist/features/push/PushFeature.js +319 -0
  822. package/dist/features/push/PushFeature.js.map +1 -0
  823. package/dist/features/push/diagnostics.d.ts +55 -0
  824. package/dist/features/push/diagnostics.d.ts.map +1 -0
  825. package/dist/features/push/diagnostics.js +383 -0
  826. package/dist/features/push/diagnostics.js.map +1 -0
  827. package/dist/features/push/pushState.d.ts +58 -0
  828. package/dist/features/push/pushState.d.ts.map +1 -0
  829. package/dist/features/push/pushState.js +75 -0
  830. package/dist/features/push/pushState.js.map +1 -0
  831. package/dist/features/push/softAsk.d.ts +68 -0
  832. package/dist/features/push/softAsk.d.ts.map +1 -0
  833. package/dist/features/push/softAsk.js +142 -0
  834. package/dist/features/push/softAsk.js.map +1 -0
  835. package/dist/features/replay/ReplayFeature.d.ts +52 -0
  836. package/dist/features/replay/ReplayFeature.d.ts.map +1 -0
  837. package/dist/features/replay/ReplayFeature.js +282 -0
  838. package/dist/features/replay/ReplayFeature.js.map +1 -0
  839. package/dist/features/replay/engine/canvas.d.ts +45 -0
  840. package/dist/features/replay/engine/canvas.d.ts.map +1 -0
  841. package/dist/features/replay/engine/canvas.js +122 -0
  842. package/dist/features/replay/engine/canvas.js.map +1 -0
  843. package/dist/features/replay/engine/crossOrigin.d.ts +23 -0
  844. package/dist/features/replay/engine/crossOrigin.d.ts.map +1 -0
  845. package/dist/features/replay/engine/crossOrigin.js +108 -0
  846. package/dist/features/replay/engine/crossOrigin.js.map +1 -0
  847. package/dist/features/replay/engine/cssom.d.ts +31 -0
  848. package/dist/features/replay/engine/cssom.d.ts.map +1 -0
  849. package/dist/features/replay/engine/cssom.js +128 -0
  850. package/dist/features/replay/engine/cssom.js.map +1 -0
  851. package/dist/features/replay/engine/iframe.d.ts +65 -0
  852. package/dist/features/replay/engine/iframe.d.ts.map +1 -0
  853. package/dist/features/replay/engine/iframe.js +186 -0
  854. package/dist/features/replay/engine/iframe.js.map +1 -0
  855. package/dist/features/replay/engine/interactions.d.ts +172 -0
  856. package/dist/features/replay/engine/interactions.d.ts.map +1 -0
  857. package/dist/features/replay/engine/interactions.js +437 -0
  858. package/dist/features/replay/engine/interactions.js.map +1 -0
  859. package/dist/features/replay/engine/mutations.d.ts +65 -0
  860. package/dist/features/replay/engine/mutations.d.ts.map +1 -0
  861. package/dist/features/replay/engine/mutations.js +304 -0
  862. package/dist/features/replay/engine/mutations.js.map +1 -0
  863. package/dist/features/replay/engine/nodeRegistry.d.ts +23 -0
  864. package/dist/features/replay/engine/nodeRegistry.d.ts.map +1 -0
  865. package/dist/features/replay/engine/nodeRegistry.js +51 -0
  866. package/dist/features/replay/engine/nodeRegistry.js.map +1 -0
  867. package/dist/features/replay/engine/player.d.ts +11 -0
  868. package/dist/features/replay/engine/player.d.ts.map +1 -0
  869. package/dist/features/replay/engine/player.js +284 -0
  870. package/dist/features/replay/engine/player.js.map +1 -0
  871. package/dist/features/replay/engine/rebuild.d.ts +8 -0
  872. package/dist/features/replay/engine/rebuild.d.ts.map +1 -0
  873. package/dist/features/replay/engine/rebuild.js +46 -0
  874. package/dist/features/replay/engine/rebuild.js.map +1 -0
  875. package/dist/features/replay/engine/replayWorker.d.ts +33 -0
  876. package/dist/features/replay/engine/replayWorker.d.ts.map +1 -0
  877. package/dist/features/replay/engine/replayWorker.js +175 -0
  878. package/dist/features/replay/engine/replayWorker.js.map +1 -0
  879. package/dist/features/replay/engine/resources.d.ts +52 -0
  880. package/dist/features/replay/engine/resources.d.ts.map +1 -0
  881. package/dist/features/replay/engine/resources.js +132 -0
  882. package/dist/features/replay/engine/resources.js.map +1 -0
  883. package/dist/features/replay/engine/snapshot.d.ts +103 -0
  884. package/dist/features/replay/engine/snapshot.d.ts.map +1 -0
  885. package/dist/features/replay/engine/snapshot.js +459 -0
  886. package/dist/features/replay/engine/snapshot.js.map +1 -0
  887. package/dist/features/replay/engine/traverse.d.ts +19 -0
  888. package/dist/features/replay/engine/traverse.d.ts.map +1 -0
  889. package/dist/features/replay/engine/traverse.js +39 -0
  890. package/dist/features/replay/engine/traverse.js.map +1 -0
  891. package/dist/features/replay/engine/types.d.ts +149 -0
  892. package/dist/features/replay/engine/types.d.ts.map +1 -0
  893. package/dist/features/replay/engine/types.js +6 -0
  894. package/dist/features/replay/engine/types.js.map +1 -0
  895. package/dist/features/replay/engine/webglPatch.d.ts +26 -0
  896. package/dist/features/replay/engine/webglPatch.d.ts.map +1 -0
  897. package/dist/features/replay/engine/webglPatch.js +83 -0
  898. package/dist/features/replay/engine/webglPatch.js.map +1 -0
  899. package/dist/features/replay/lifecycle/adaptive.d.ts +38 -0
  900. package/dist/features/replay/lifecycle/adaptive.d.ts.map +1 -0
  901. package/dist/features/replay/lifecycle/adaptive.js +90 -0
  902. package/dist/features/replay/lifecycle/adaptive.js.map +1 -0
  903. package/dist/features/replay/lifecycle/cadence.d.ts +35 -0
  904. package/dist/features/replay/lifecycle/cadence.d.ts.map +1 -0
  905. package/dist/features/replay/lifecycle/cadence.js +149 -0
  906. package/dist/features/replay/lifecycle/cadence.js.map +1 -0
  907. package/dist/features/replay/lifecycle/deltaBatcher.d.ts +31 -0
  908. package/dist/features/replay/lifecycle/deltaBatcher.d.ts.map +1 -0
  909. package/dist/features/replay/lifecycle/deltaBatcher.js +32 -0
  910. package/dist/features/replay/lifecycle/deltaBatcher.js.map +1 -0
  911. package/dist/features/replay/lifecycle/deviceSignals.d.ts +35 -0
  912. package/dist/features/replay/lifecycle/deviceSignals.d.ts.map +1 -0
  913. package/dist/features/replay/lifecycle/deviceSignals.js +61 -0
  914. package/dist/features/replay/lifecycle/deviceSignals.js.map +1 -0
  915. package/dist/features/replay/lifecycle/offloadDomFrames.d.ts +69 -0
  916. package/dist/features/replay/lifecycle/offloadDomFrames.d.ts.map +1 -0
  917. package/dist/features/replay/lifecycle/offloadDomFrames.js +107 -0
  918. package/dist/features/replay/lifecycle/offloadDomFrames.js.map +1 -0
  919. package/dist/features/replay/lifecycle/pii.d.ts +14 -0
  920. package/dist/features/replay/lifecycle/pii.d.ts.map +1 -0
  921. package/dist/features/replay/lifecycle/pii.js +52 -0
  922. package/dist/features/replay/lifecycle/pii.js.map +1 -0
  923. package/dist/features/replay/lifecycle/recorder.d.ts +178 -0
  924. package/dist/features/replay/lifecycle/recorder.d.ts.map +1 -0
  925. package/dist/features/replay/lifecycle/recorder.js +644 -0
  926. package/dist/features/replay/lifecycle/recorder.js.map +1 -0
  927. package/dist/features/replay/lifecycle/sampling.d.ts +28 -0
  928. package/dist/features/replay/lifecycle/sampling.d.ts.map +1 -0
  929. package/dist/features/replay/lifecycle/sampling.js +31 -0
  930. package/dist/features/replay/lifecycle/sampling.js.map +1 -0
  931. package/dist/features/replay/lifecycle/segmentBuffer.d.ts +75 -0
  932. package/dist/features/replay/lifecycle/segmentBuffer.d.ts.map +1 -0
  933. package/dist/features/replay/lifecycle/segmentBuffer.js +130 -0
  934. package/dist/features/replay/lifecycle/segmentBuffer.js.map +1 -0
  935. package/dist/features/replay/lifecycle/viewContext.d.ts +7 -0
  936. package/dist/features/replay/lifecycle/viewContext.d.ts.map +1 -0
  937. package/dist/features/replay/lifecycle/viewContext.js +51 -0
  938. package/dist/features/replay/lifecycle/viewContext.js.map +1 -0
  939. package/dist/features/scroll/index.d.ts +33 -0
  940. package/dist/features/scroll/index.d.ts.map +1 -0
  941. package/dist/features/scroll/index.js +106 -0
  942. package/dist/features/scroll/index.js.map +1 -0
  943. package/dist/features/session/sessionManager.d.ts +41 -0
  944. package/dist/features/session/sessionManager.d.ts.map +1 -0
  945. package/dist/features/session/sessionManager.js +67 -0
  946. package/dist/features/session/sessionManager.js.map +1 -0
  947. package/dist/features/session/sessionStore.d.ts +137 -0
  948. package/dist/features/session/sessionStore.d.ts.map +1 -0
  949. package/dist/features/session/sessionStore.js +323 -0
  950. package/dist/features/session/sessionStore.js.map +1 -0
  951. package/dist/features/watchdog/WatchdogFeature.d.ts +23 -0
  952. package/dist/features/watchdog/WatchdogFeature.d.ts.map +1 -0
  953. package/dist/features/watchdog/WatchdogFeature.js +29 -0
  954. package/dist/features/watchdog/WatchdogFeature.js.map +1 -0
  955. package/dist/features/watchdog/collectors.d.ts +18 -0
  956. package/dist/features/watchdog/collectors.d.ts.map +1 -0
  957. package/dist/features/watchdog/collectors.js +107 -0
  958. package/dist/features/watchdog/collectors.js.map +1 -0
  959. package/dist/features/watchdog/config.d.ts +51 -0
  960. package/dist/features/watchdog/config.d.ts.map +1 -0
  961. package/dist/features/watchdog/config.js +28 -0
  962. package/dist/features/watchdog/config.js.map +1 -0
  963. package/dist/features/watchdog/engine.d.ts +22 -0
  964. package/dist/features/watchdog/engine.d.ts.map +1 -0
  965. package/dist/features/watchdog/engine.js +123 -0
  966. package/dist/features/watchdog/engine.js.map +1 -0
  967. package/dist/features/watchdog/incidents.d.ts +79 -0
  968. package/dist/features/watchdog/incidents.d.ts.map +1 -0
  969. package/dist/features/watchdog/incidents.js +204 -0
  970. package/dist/features/watchdog/incidents.js.map +1 -0
  971. package/dist/features/watchdog/rollup.d.ts +41 -0
  972. package/dist/features/watchdog/rollup.d.ts.map +1 -0
  973. package/dist/features/watchdog/rollup.js +76 -0
  974. package/dist/features/watchdog/rollup.js.map +1 -0
  975. package/dist/features/webVitals/WebVitalsFeature.d.ts +46 -0
  976. package/dist/features/webVitals/WebVitalsFeature.d.ts.map +1 -0
  977. package/dist/features/webVitals/WebVitalsFeature.js +252 -0
  978. package/dist/features/webVitals/WebVitalsFeature.js.map +1 -0
  979. package/dist/features/webVitals/attribution.d.ts +50 -0
  980. package/dist/features/webVitals/attribution.d.ts.map +1 -0
  981. package/dist/features/webVitals/attribution.js +186 -0
  982. package/dist/features/webVitals/attribution.js.map +1 -0
  983. package/dist/features/webVitals/observe.d.ts +6 -0
  984. package/dist/features/webVitals/observe.d.ts.map +1 -0
  985. package/dist/features/webVitals/observe.js +6 -0
  986. package/dist/features/webVitals/observe.js.map +1 -0
  987. package/dist/features/webVitals/vitals.d.ts +99 -0
  988. package/dist/features/webVitals/vitals.d.ts.map +1 -0
  989. package/dist/features/webVitals/vitals.js +166 -0
  990. package/dist/features/webVitals/vitals.js.map +1 -0
  991. package/dist/features/webperf/WebPerfFeature.d.ts +19 -0
  992. package/dist/features/webperf/WebPerfFeature.d.ts.map +1 -0
  993. package/dist/features/webperf/WebPerfFeature.js +48 -0
  994. package/dist/features/webperf/WebPerfFeature.js.map +1 -0
  995. package/dist/features/webperf/collectors.d.ts +3 -0
  996. package/dist/features/webperf/collectors.d.ts.map +1 -0
  997. package/dist/features/webperf/collectors.js +118 -0
  998. package/dist/features/webperf/collectors.js.map +1 -0
  999. package/dist/features/webperf/math.d.ts +12 -0
  1000. package/dist/features/webperf/math.d.ts.map +1 -0
  1001. package/dist/features/webperf/math.js +26 -0
  1002. package/dist/features/webperf/math.js.map +1 -0
  1003. package/dist/inapp.d.ts +6 -0
  1004. package/dist/inapp.d.ts.map +1 -0
  1005. package/dist/inapp.js +6 -0
  1006. package/dist/inapp.js.map +1 -0
  1007. package/dist/index.d.ts +34 -0
  1008. package/dist/index.d.ts.map +1 -0
  1009. package/dist/index.js +12 -0
  1010. package/dist/index.js.map +1 -0
  1011. package/dist/integrations/index.d.ts +7 -0
  1012. package/dist/integrations/index.d.ts.map +1 -0
  1013. package/dist/integrations/index.js +2 -0
  1014. package/dist/integrations/index.js.map +1 -0
  1015. package/dist/pipeline/index.d.ts +3 -0
  1016. package/dist/pipeline/index.d.ts.map +1 -0
  1017. package/dist/pipeline/index.js +3 -0
  1018. package/dist/pipeline/index.js.map +1 -0
  1019. package/dist/pipeline/pipeline.d.ts +263 -0
  1020. package/dist/pipeline/pipeline.d.ts.map +1 -0
  1021. package/dist/pipeline/pipeline.js +783 -0
  1022. package/dist/pipeline/pipeline.js.map +1 -0
  1023. package/dist/public/ScaleBunFacade.d.ts +436 -0
  1024. package/dist/public/ScaleBunFacade.d.ts.map +1 -0
  1025. package/dist/public/ScaleBunFacade.js +857 -0
  1026. package/dist/public/ScaleBunFacade.js.map +1 -0
  1027. package/dist/public/index.d.ts +5 -0
  1028. package/dist/public/index.d.ts.map +1 -0
  1029. package/dist/public/index.js +4 -0
  1030. package/dist/public/index.js.map +1 -0
  1031. package/dist/public/typedTracker.d.ts +91 -0
  1032. package/dist/public/typedTracker.d.ts.map +1 -0
  1033. package/dist/public/typedTracker.js +60 -0
  1034. package/dist/public/typedTracker.js.map +1 -0
  1035. package/dist/scalebun-push-sw.js +236 -0
  1036. package/dist/scalebun.min.js +717 -0
  1037. package/dist/scalebun.min.js.map +7 -0
  1038. package/dist/storage/idb.d.ts +16 -0
  1039. package/dist/storage/idb.d.ts.map +1 -0
  1040. package/dist/storage/idb.js +76 -0
  1041. package/dist/storage/idb.js.map +1 -0
  1042. package/dist/storage/index.d.ts +3 -0
  1043. package/dist/storage/index.d.ts.map +1 -0
  1044. package/dist/storage/index.js +3 -0
  1045. package/dist/storage/index.js.map +1 -0
  1046. package/dist/transport/gzip.d.ts +2 -0
  1047. package/dist/transport/gzip.d.ts.map +1 -0
  1048. package/dist/transport/gzip.js +20 -0
  1049. package/dist/transport/gzip.js.map +1 -0
  1050. package/dist/transport/httpClient.d.ts +156 -0
  1051. package/dist/transport/httpClient.d.ts.map +1 -0
  1052. package/dist/transport/httpClient.js +277 -0
  1053. package/dist/transport/httpClient.js.map +1 -0
  1054. package/dist/transport/index.d.ts +3 -0
  1055. package/dist/transport/index.d.ts.map +1 -0
  1056. package/dist/transport/index.js +3 -0
  1057. package/dist/transport/index.js.map +1 -0
  1058. package/dist/transport/sign.d.ts +25 -0
  1059. package/dist/transport/sign.d.ts.map +1 -0
  1060. package/dist/transport/sign.js +58 -0
  1061. package/dist/transport/sign.js.map +1 -0
  1062. package/package.json +67 -0
@@ -0,0 +1,717 @@
1
+ "use strict";(()=>{var _g=Object.defineProperty;var S=(n,e)=>()=>(n&&(e=n(n=0)),e);var _=(n,e)=>{for(var t in e)_g(n,t,{get:e[t],enumerable:!0})};function q(){let n=typeof crypto!="undefined"?crypto:void 0;if(n&&typeof n.randomUUID=="function")return n.randomUUID();let e=typeof performance!="undefined"?performance.now():0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=(Math.floor(e)+Math.floor(Math.random()*16))%16;return(t==="x"?r:r&3|8).toString(16)})}function L(){return Date.now()}function oc(){try{if(typeof localStorage!="undefined"){let n=localStorage.getItem(ic);if(n)return n;let e=`web_${q()}`;return localStorage.setItem(ic,e),e}}catch{}return`web_${q()}`}var ic,ac=S(()=>{"use strict";ic="scalebun_device_id"});function cc(n){return(...e)=>{n&&typeof console!="undefined"&&console.info(Bs,...e)}}var Bs,Fs=S(()=>{"use strict";Bs="[scalebun]"});var lc=S(()=>{"use strict"});var dc=S(()=>{"use strict"});function uc(){return{platform:"web",renderer:"dom",sdk:{name:Fg,version:Ds}}}function pc(n){let e=typeof navigator!="undefined"?navigator.userAgent:"",{browser:t,os:r}=Dg(e);return{id:n,browser:t.name,browserVersion:t.version,os:r.name,osVersion:r.version}}function fc(n){return{version:n.appVersion,environment:n.environment,release:n.release}}function mc(){let n={};try{typeof navigator!="undefined"&&(n.locale=navigator.language),n.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,typeof location!="undefined"&&(n.url=location.href),typeof window!="undefined"&&(n.viewport={width:window.innerWidth,height:window.innerHeight});let e=navigator==null?void 0:navigator.connection;e!=null&&e.effectiveType&&(n.networkType=e.effectiveType)}catch{}return n}function Dg(n){var s,i,o,a,c,l,u,d,p;let e={},t={},r=(s=/(Edg|OPR)\/([\d.]+)/.exec(n))!=null?s:/(Chrome|Firefox|Safari)\/([\d.]+)/.exec(n);return r&&r[1]&&(e.name=(i={Edg:"Edge",OPR:"Opera"}[r[1]])!=null?i:r[1],e.version=(o=r[2])==null?void 0:o.split(".")[0]),/Windows NT ([\d.]+)/.test(n)?(t.name="Windows",t.version=(a=/Windows NT ([\d.]+)/.exec(n))==null?void 0:a[1]):/Mac OS X ([\d_]+)/.test(n)?(t.name="macOS",t.version=(l=(c=/Mac OS X ([\d_]+)/.exec(n))==null?void 0:c[1])==null?void 0:l.replace(/_/g,".")):/Android ([\d.]+)/.test(n)?(t.name="Android",t.version=(u=/Android ([\d.]+)/.exec(n))==null?void 0:u[1]):/(iPhone|iPad).+OS ([\d_]+)/.test(n)?(t.name="iOS",t.version=(p=(d=/OS ([\d_]+)/.exec(n))==null?void 0:d[1])==null?void 0:p.replace(/_/g,".")):/Linux/.test(n)&&(t.name="Linux"),{browser:e,os:t}}var Fg,Ds,hc=S(()=>{"use strict";dc();Fg="@scalebun/web",Ds="2.2.2"});function K(n){return n.replace(/[\w.+-]+@[\w-]+\.[\w.-]+/g,"[email]").replace(/\b[A-Za-z0-9_-]{24,}\b/g,"[token]")}function zg(n){return n.replace(gc,"[email]").replace(Hg,"[redacted]")}function ht(n,e=0){if(n==null||e>4)return n;if(typeof n=="string")return zg(n);if(Array.isArray(n))return n.slice(0,1e3).map(t=>ht(t,e+1));if(typeof n=="object"){let t={},r=0;for(let s in n){if(r++>200)break;if(!Object.prototype.hasOwnProperty.call(n,s))continue;let i=n[s];t[s]=qg.test(s)?"[redacted]":$g.test(s)&&typeof i=="string"?i.replace(gc,"[email]"):ht(i,e+1)}return t}return n}var qg,gc,Hg,$g,qs=S(()=>{"use strict";qg=/pass(word|wd)?|secret|token|api[_-]?key|authorization|auth|ssn|social|credit|card[_-]?(number|num)|cardnum|cvv|cvc/i,gc=/[\w.+-]+@[\w-]+\.[\w.-]+/g,Hg=/\b\d[\d -]{11,18}\d\b/g,$g=/^utm_/i});function bc(n){try{let e=yc()[n];if(!e)return!1;let t="__scalebun_probe__";return e.setItem(t,"1"),e.removeItem(t),!0}catch{return!1}}function Ug(){try{return typeof Request!="undefined"&&"keepalive"in new Request("https://scalebun.invalid",{})}catch{return!1}}function Vg(){let n=typeof document!="undefined";return{dom:n,storage:bc("localStorage"),session:bc("sessionStorage"),indexedDB:gt("indexedDB"),history:typeof history!="undefined"&&typeof history.pushState=="function",network:typeof fetch!="undefined",beacon:typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function",keepalive:Ug(),performance:typeof performance!="undefined"&&typeof performance.now=="function",performanceObserver:gt("PerformanceObserver"),mutationObserver:gt("MutationObserver"),intersectionObserver:gt("IntersectionObserver"),resizeObserver:gt("ResizeObserver"),visibility:n&&typeof document.visibilityState!="undefined",raf:typeof requestAnimationFrame!="undefined",crypto:typeof crypto!="undefined"&&typeof crypto.subtle!="undefined",webWorker:gt("Worker")}}function Wg(){return Hs===null&&(Hs=Vg()),Hs}function ot(n){return Wg()[n]}var yc,gt,Hs,$s=S(()=>{"use strict";yc=()=>globalThis,gt=n=>typeof yc()[n]!="undefined";Hs=null});function Pe(n,e,t){if(!ot("performanceObserver"))return()=>{};try{let r=new PerformanceObserver(s=>e(s.getEntries()));return r.observe({type:n,buffered:!0,...t}),()=>{try{r.disconnect()}catch{}}}catch{return()=>{}}}var zs=S(()=>{"use strict";$s()});var xn,vc=S(()=>{"use strict";xn=class{constructor(e="unknown"){this.onGrant=new Set;this.status=e}get value(){return this.status}get granted(){return this.status==="granted"}set(e){let t=e==="granted"&&this.status!=="granted";if(this.status=e,t){let r=[...this.onGrant];this.onGrant.clear();for(let s of r)try{s()}catch{}}}whenGranted(e){if(this.granted){e();return}this.onGrant.add(e)}}});function bt(n){return n.length>wc?n.slice(0,wc):n}function Gg(n){return n.replace(/[?#].*$/,"")}function Yg(n){return n==="warn"?"warning":n==="debug"||n==="info"||n==="error"?n:"info"}function xc(n){let e={},t=!1;for(let r in n)n[r]!==void 0&&n[r]!==null&&(e[r]=n[r],t=!0);return t?e:void 0}function Xg(n){var t;if(n.kind==="frame"||n.kind==="performance")return null;let e=typeof n.timestamp=="number"?n.timestamp:Date.now();switch(n.kind){case"log":return{ts:e,category:"console",level:Yg(n.level),message:bt(K(n.message))};case"network":{let r=n.status;return{ts:e,category:"network",type:"http",level:typeof r=="number"&&r>=400?"error":"info",message:bt(K(`${n.method} ${Gg(n.url)}`)),data:xc({status:r,duration:n.duration})}}case"event":return Jg(n.name,(t=n.props)!=null?t:{},e);case"error":return{ts:e,category:"error",type:n.type,level:"error",message:bt(K(n.message))};default:return null}}function Jg(n,e,t){var r,s,i,o;if(n==="SCREEN_VIEW")return{ts:t,category:"navigation",message:`${(r=e.from)!=null?r:"?"} \u2192 ${(s=e.to)!=null?s:"?"}`};if(n==="USER_ACTION"){let a=typeof e.action=="string"?e.action:"action";return{ts:t,category:`ui.${a}`,message:bt(K(String((o=(i=e.selector)!=null?i:e.label)!=null?o:a))),data:xc({dead:e.dead,rage:e.rage})}}return{ts:t,category:"custom",type:"event",message:bt(K(n))}}function Sc(n){Vs=n}function kc(n){if(!Vs)return n;try{return Vs(n)}catch{return n}}function Ec(n){let e=n.message?{...n,message:bt(K(n.message))}:n,t=kc(e);t&&We.add(t)}function Ic(n){let e=Xg(n);if(!e)return;let t=kc(e);t&&We.add(t)}function Ws(){We.clear()}var Kg,jg,wc,Us,We,Vs,Cc=S(()=>{"use strict";qs();Kg=50,jg=200,wc=256;Us=class{constructor(){this.ring=[];this.max=Kg}setMax(e){this.max=Math.max(1,Math.min(jg,Math.floor(e))),this.trim()}add(e){var r;let t=this.ring[this.ring.length-1];if(t&&t.category===e.category&&t.message===e.message&&t.level===e.level){t.count=((r=t.count)!=null?r:1)+1,t.ts=e.ts;return}this.ring.push(e),this.trim()}snapshot(){return this.ring.slice()}clear(){this.ring=[]}trim(){for(;this.ring.length>this.max;)this.ring.shift()}},We=new Us});function Ac(n){n.kind==="frame"&&(typeof n.seq=="number"&&(Sn=n.seq),n.frameType==="keyframe"&&n.frameId&&(kn=n.frameId))}function Z(){return Sn!=null||kn!=null?{seq:Sn,segmentId:kn}:void 0}function Ks(){Sn=void 0,kn=void 0}var Sn,kn,Tc=S(()=>{"use strict"});function Rc(n){js=n}function Mc(){try{return js?js():void 0}catch{return}}var js,Pc=S(()=>{"use strict";js=null});function Oe(n){n&&typeof n=="object"&&(Ut={...Ut,...n})}function yt(){return Ut}function Lc(){let n=Ut.deviceId;Ut=n!=null?{deviceId:n}:{}}var Ut,_c=S(()=>{"use strict";Ut={}});function Qg(){var s;let n=globalThis;if(typeof window!="undefined"&&typeof document!="undefined")return"browser";let e=n.navigator,t=n.caches;if(typeof n.EdgeRuntime!="undefined"||(e==null?void 0:e.userAgent)==="Cloudflare-Workers"||typeof n.WebSocketPair!="undefined"||t!==void 0&&typeof t.default!="undefined")return"edge";if(typeof n.importScripts=="function"||typeof n.ServiceWorkerGlobalScope!="undefined")return"worker";let r=n.process;return(s=r==null?void 0:r.versions)!=null&&s.node?"ssr-node":"unknown"}function Ys(){return Gs===null&&(Gs=Qg()),Gs}function Zg(){return Ys()==="browser"}function Oc(){return!Zg()}var Gs,Nc=S(()=>{"use strict";Gs=null});function En(n){n&&(Xs=n)}function vt(n){if(Xs)try{n.nonce=Xs}catch{}return n}function Ne(n,e){var o,a,c,l;if(typeof CSSStyleSheet!="undefined"&&"adoptedStyleSheets"in n&&(n instanceof Document||typeof ShadowRoot!="undefined"&&n instanceof ShadowRoot))try{let u=new CSSStyleSheet;u.replaceSync(e);let d=n;d.adoptedStyleSheets=[...d.adoptedStyleSheets,u];return}catch{}let r=n instanceof Document?n:(o=n.ownerDocument)!=null?o:typeof document!="undefined"?document:null;if(!r)return;let s=vt(r.createElement("style"));s.textContent=e,(n instanceof Document&&(l=(c=(a=n.head)!=null?a:n.documentElement)!=null?c:r.body)!=null?l:n).appendChild(s)}var Xs,Bc=S(()=>{"use strict";Xs=null});var z=S(()=>{"use strict";ac();Fs();lc();hc();qs();zs();vc();Cc();Tc();Pc();_c();Nc();$s();Bc()});function Wt(){try{let n=typeof sessionStorage!="undefined"&&sessionStorage.getItem(Qs);if(!n)return null;let e=JSON.parse(n);if(!Array.isArray(e)||typeof e[0]!="string"||!e[0]||typeof e[2]!="number")return null;let t=typeof e[1]=="number"&&isFinite(e[1])&&e[1]>0?e[1]:e[2];return{id:e[0],startedAt:t,lastSeenAt:e[2],seq:e[3]>0?e[3]:0}}catch{return null}}function wt(n){Qe=n;try{typeof sessionStorage!="undefined"&&sessionStorage.setItem(Qs,JSON.stringify([n.id,n.startedAt,n.lastSeenAt,n.seq]))}catch{}}function Zs(n=xt,e=In){let t=L(),r=Wt();if(r&&Math.max(0,t-r.lastSeenAt)<=n&&Math.max(0,t-r.startedAt)<=e)return r.lastSeenAt=t,wt(r),Qe=r,r;let s={id:`sess_${q()}`,startedAt:t,lastSeenAt:t,seq:0};return wt(s),Qe=s,s}function Fc(n=xt,e=In){var s;let t=(s=Wt())!=null?s:Qe;if(!t)return!1;let r=L();return Math.max(0,r-t.lastSeenAt)>n||Math.max(0,r-t.startedAt)>e}function Dc(){if(typeof document!="undefined"&&document.visibilityState==="hidden")return;let n=L();if(Qe)try{if(typeof sessionStorage!="undefined"&&sessionStorage.getItem(Qs)===null){Qe.lastSeenAt=n,wt(Qe),Js=n;return}}catch{}if(n-Js<6e4)return;Js=n;let e=Wt();e&&(e.lastSeenAt=n,wt(e),Qe=e)}function ei(n=1){let e=Wt();if(!e){let r=Vt;return Vt+=n,r}let t=e.seq;return e.seq=t+n,wt(e),t}function qc(n){let e=Wt();return e?(e.seq<n&&(e.seq=n,wt(e)),e.seq):(Vt<n&&(Vt=n),Vt)}var Qs,xt,In,Qe,Js,Vt,Cn=S(()=>{"use strict";z();Qs="scalebun_session",xt=30*60*1e3,In=4*60*60*1e3;Qe=null,Js=0,Vt=0});var ni={};_(ni,{SDK_SIGNING_VERSION:()=>Hc,signBody:()=>$c,signatureHeaders:()=>nb});function eb(n,e){let t=ti.get(e);return t||(t=n.importKey("raw",new TextEncoder().encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),t.catch(()=>ti.delete(e)),ti.set(e,t)),t}function tb(n){let e="";for(let t=0;t<n.length;t++)e+=n[t].toString(16).padStart(2,"0");return e}async function $c(n,e){var t;try{let r=(t=globalThis.crypto)==null?void 0:t.subtle;if(!r||!n)return null;let s=await eb(r,n),i=await r.sign("HMAC",s,new TextEncoder().encode(e));return tb(new Uint8Array(i))}catch{return null}}async function nb(n,e){let t=await $c(n,e);return t?{"x-scalebun-signature":t,"x-scalebun-sdk-version":Hc}:{}}var Hc,ti,ri=S(()=>{"use strict";Hc="1",ti=new Map});var zc={};_(zc,{gzipString:()=>rb});async function rb(n){if(typeof CompressionStream=="undefined")return null;try{let e=new CompressionStream("gzip"),t=e.writable.getWriter();return t.write(new TextEncoder().encode(n)),t.close(),await new Response(e.readable).arrayBuffer()}catch{return null}}var Uc=S(()=>{"use strict"});function ab(){return new Promise(n=>{try{if(typeof indexedDB=="undefined")return n(null);let e=indexedDB.open(ib,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(St)||t.createObjectStore(St)},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null)}catch{n(null)}})}var ib,St,ob,Be,Kt=S(()=>{"use strict";ib="scalebun",St="queue",ob="pending";Be=class{constructor(e=ob){this.key=e;this.dbp=null}db(){return this.dbp||(this.dbp=ab()),this.dbp}async load(){let e=await this.db();return e?new Promise(t=>{try{let r=e.transaction(St,"readonly").objectStore(St).get(this.key);r.onsuccess=()=>t(Array.isArray(r.result)?r.result:[]),r.onerror=()=>t([])}catch{t([])}}):[]}async save(e){let t=await this.db();if(t)return new Promise(r=>{try{let s=t.transaction(St,"readwrite");s.objectStore(St).put(e,this.key),s.oncomplete=()=>r(),s.onerror=()=>r()}catch{r()}})}async clear(){return this.save([])}}});function at(){return typeof navigator=="undefined"||navigator.onLine!==!1}function Vc(n){return typeof window=="undefined"?()=>{}:(window.addEventListener("online",n),()=>window.removeEventListener("online",n))}var cb,lb,kt,Mn=S(()=>{"use strict";cb=1e3,lb=3e4,kt=class{constructor(){this.fails=0;this.nextAt=0}ready(e){return e>=this.nextAt}fail(e){let t=Math.min(lb,cb*2**this.fails++);this.nextAt=e+Math.random()*t}reset(){this.fails=0,this.nextAt=0}}});function Pn(n,e,t){return n.filter(r=>{let s=e(r);return s==null||t-s<=864e5})}function Et(n,e,t){let r=n.map(c=>({it:c,n:db(c),gone:!1})),s=r.reduce((c,l)=>c+l.n,0);if(s<=2e6)return n.slice();let i=c=>{for(let l of r){if(s<=2e6)return;l.gone||!c(l.it)||(l.gone=!0,s-=l.n)}};if(e&&t){let c=r.reduce((l,u)=>l+(t(u.it)?1:0),0);for(let l of r){if(s<=2e6)break;if(l.gone||!e(l.it))continue;let u=t(l.it);u&&c<=1||(l.gone=!0,s-=l.n,u&&c--)}}else e&&i(e);i(()=>!0);let o=r.filter(c=>!c.gone).map(c=>c.it);if(!e||!t)return o;let a=!1;return o.filter(c=>e(c)?t(c)?(a=!0,!0):a:!0)}var db,Ln=S(()=>{"use strict";db=n=>JSON.stringify(n).length+1});var Kc={};_(Kc,{domPayloadOf:()=>Wc,offloadDomFrames:()=>pb});function Wc(n){var e,t,r,s,i,o;return{snapshot:(e=n.snapshot)!=null?e:null,mutations:(t=n.mutations)!=null?t:null,events:(r=n.events)!=null?r:null,adoptedStyles:(s=n.adoptedStyles)!=null?s:null,viewport:(i=n.viewport)!=null?i:null,href:(o=n.href)!=null?o:null}}function ub(n){let e=n;return!!e&&e.kind==="frame"&&e.renderer==="dom"&&!e.domStorageKey&&(e.snapshot!=null||e.mutations!=null&&e.mutations.length>0)&&typeof e.frameId=="string"&&!!e.frameId}async function pb(n,e){var o;let t=n.filter(ub);if(t.length===0)return 0;let r;try{r=await e.presign(e.sessionId,t.map(a=>({frameId:a.frameId,payloadKind:"dom"})))}catch{return 0}if(!r||!r.enabled||!((o=r.frames)!=null&&o.length))return 0;let s=new Map(r.frames.map(a=>[a.frameId,a])),i=0;return await Promise.all(t.map(async a=>{let c=s.get(a.frameId);if(!c)return;let l;try{l=JSON.stringify(Wc(a))}catch{return}await e.put(c.uploadUrl,l,c.contentType)&&(a.domStorageKey=c.storageKey,a.sizeBytes=l.length,delete a.snapshot,delete a.mutations,delete a.adoptedStyles,i+=1)})),i}var jc=S(()=>{"use strict"});function si(n){return/dynamically imported module|module script failed|error loading dynamically/i.test(n)}var Nn,ii=S(()=>{"use strict";Nn=class{constructor(){this.features=new Map}add(e){this.features.set(e.name,e)}get(e){return this.features.get(e)}async setupAll(e){var t;for(let r of this.features.values())try{await r.setup(e)}catch(s){e.log(`[scalebun] feature "${r.name}" failed to set up:`,s);try{let i=s,o=String((t=i==null?void 0:i.message)!=null?t:s).slice(0,300);e.trackEvent("sdk_feature_setup_failed",{feature:r.name,error:(i==null?void 0:i.name)||"Error",message:o,moduleLoad:si(o)})}catch{}}}teardownAll(){for(let e of this.features.values())try{e.teardown()}catch{}this.features.clear()}}});function Ee(n){let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619);return e>>>0}function Le(n,e){return Ee(`${n}:${e}`)%100}function oi(n,e,t){if(!t.length)return null;let r=Le(n,e),s=0;for(let i of t)if(s+=i.allocationPct,r<s)return i.key;return t[t.length-1].key}var Fe=S(()=>{"use strict"});function ai(n,e){return!(n>0)||!(e>0)?!1:n-e>e*.01}function It(n,e,t){if(!(e>0)||!ai(e,t))return 100;let r=e-t,s=Math.min(Math.max(n,0),r)+t;return Math.min(100,Math.max(0,Math.round(s/e*100)))}function Zc(n){return n>=100?100:n>=75?75:n>=50?50:n>=25?25:0}var Bn=S(()=>{"use strict"});var al={};_(al,{anchorOf:()=>ol,fieldKeyOf:()=>sl,fieldLabelOf:()=>il,formIdOf:()=>Fn,installFormAnalytics:()=>Ab,isSensitiveField:()=>nl,isTrackableField:()=>rl,stepOf:()=>jt});function nl(n){let e=(n.getAttribute("type")||"").toLowerCase();if(vb.has(e))return!0;let t=n.getAttribute("autocomplete")||"";return wb.test(t)}function rl(n){if(!n||typeof n.matches!="function"||!n.matches(Sb))return!1;let e=(n.getAttribute("type")||"").toLowerCase();return xb.has(e)?!1:!nl(n)}function sl(n,e){let t=n.getAttribute("name");if(t)return t;if(n.id)return n.id;let r=(n.getAttribute("type")||n.tagName).toLowerCase(),s=-1;try{s=Array.prototype.indexOf.call(e.elements,n)}catch{}return s>=0?`${r}[${s}]`:r}function il(n){var r,s,i,o,a;let e="";try{if(e=n.getAttribute("aria-label")||"",!e){let c=n.getAttribute("id"),l=n.ownerDocument;if(c&&l&&(e=((r=l.querySelector(`label[for="${c}"]`))==null?void 0:r.textContent)||""),e||(e=((i=(s=n.closest)==null?void 0:s.call(n,"label"))==null?void 0:i.textContent)||""),!e){let u=n.getAttribute("aria-labelledby");u&&l&&(e=((a=l.getElementById((o=u.split(/\s+/)[0])!=null?o:""))==null?void 0:a.textContent)||"")}}}catch{}let t=K(e.replace(/\s+/g," ").trim());if(t)return t.length>el?`${t.slice(0,el-1)}\u2026`:t}function Ib(n){let e=5381;for(let t=0;t<n.length;t++)e=(e<<5)+e+n.charCodeAt(t)|0;return(e>>>0).toString(36)}function Fn(n){var s,i;if(n.id)return n.id;let e=n.getAttribute("name");if(e)return e;let t="";try{t=(s=(n.getAttribute("action")||"").split("?")[0])!=null?s:""}catch{}let r=[];try{for(let o of Array.from(n.elements)){let a=(i=o.getAttribute)==null?void 0:i.call(o,"name");a&&r.push(a)}}catch{}return`form_${Ib(`${n.tagName}|${t}|${r.sort().join(",")}`)}`}function jt(n){var e,t;try{let r=(t=(e=n.closest)==null?void 0:e.call(n,"[data-scalebun-step]"))==null?void 0:t.getAttribute("data-scalebun-step");return r||void 0}catch{return}}function ol(n){var e,t,r;try{let s=(e=n.getBoundingClientRect)==null?void 0:e.call(n);if(!s||s.width===0&&s.height===0)return;let i={ex:s.x|0,ey:s.y|0,ew:s.width|0,eh:s.height|0},o=(r=(t=n.closest)==null?void 0:t.call(n,"[data-scalebun-component]"))==null?void 0:r.getAttribute("data-scalebun-component");return o&&(i.component=o),i}catch{return}}function Cb(n){let e=n.validity;return e?e.valueMissing?"required":e.typeMismatch?"type":e.patternMismatch?"pattern":e.tooShort?"too_short":e.tooLong?"too_long":e.rangeUnderflow||e.rangeOverflow||e.stepMismatch?"range":e.badInput?"bad_input":e.customError?"custom":"invalid":"invalid"}function Ab(n){if(typeof document=="undefined")return{onSubmit:()=>({}),stop:()=>{}};let e=!0,t=new Map,r=m=>{let h=t.get(m);return h||(t.size>=Eb?null:(h={startedAt:ct(),lastField:null,order:0,fields:new Map},t.set(m,h),n.onEvent({name:"$form_start",props:{form_id:Fn(m),form_name:m.getAttribute("name")||void 0,field_count:s(m),step:jt(m)}}),h))},s=m=>{try{return m.elements?m.elements.length:0}catch{return 0}},i=m=>Array.from(m.fields.entries()).slice(0,kb).map(([h,b])=>({key:h,ms:Math.round(b.ms),changed:b.changed,errored:b.errored,order:b.order,...b.label?{label:b.label}:{}})),o=m=>{if(!e)return null;let h=m.target;if(!rl(h))return null;let b=h.form;if(!b||tl(b)||tl(h))return null;let k=r(b);return k?{form:b,el:h,key:sl(h,b),st:k}:null},a=m=>{let h=o(m);if(!h)return;let{st:b,key:k}=h,x=b.fields.get(k);x||(x={ms:0,changed:!1,errored:!1,order:b.order++,focusedAt:null,label:il(h.el)},b.fields.set(k,x)),x.focusedAt=ct(),b.lastField=k},c=m=>{let h=o(m);if(!h)return;let b=h.st.fields.get(h.key);!b||b.focusedAt==null||(b.ms+=ct()-b.focusedAt,b.focusedAt=null)},l=m=>{let h=o(m);if(!h)return;let b=h.st.fields.get(h.key);b&&!b.changed&&(b.changed=!0)},u=m=>{var k;let h=o(m);if(!h)return;let b=h.st.fields.get(h.key);b&&(b.errored=!0),n.onEvent({name:"$form_error",props:{form_id:Fn(h.form),field_key:h.key,error_type:Cb(h.el),step:jt(h.form),...(k=ol(h.el))!=null?k:{}}})},d=(m,h)=>{var b;for(let k of h.fields.values())k.focusedAt!=null&&(k.ms+=ct()-k.focusedAt,k.focusedAt=null);n.onEvent({name:"$form_abandon",props:{form_id:Fn(m),last_field:(b=h.lastField)!=null?b:void 0,time_ms:Math.round(ct()-h.startedAt),fields_touched:h.fields.size,field_stats:i(h),step:jt(m)}})},p=()=>{if(!(!e||!t.size)){for(let[m,h]of t)d(m,h);t.clear()}},f=()=>{document.visibilityState==="hidden"&&p()};return document.addEventListener("focusin",a,!0),document.addEventListener("focusout",c,!0),document.addEventListener("input",l,!0),document.addEventListener("invalid",u,!0),document.addEventListener("visibilitychange",f),window.addEventListener("pagehide",p),{onSubmit(m){let h=t.get(m);if(!h)return{};t.delete(m);for(let b of h.fields.values())b.focusedAt!=null&&(b.ms+=ct()-b.focusedAt,b.focusedAt=null);return{duration_ms:Math.round(ct()-h.startedAt),fields_touched:h.fields.size,field_stats:i(h),step:jt(m)}},stop(){e=!1,document.removeEventListener("focusin",a,!0),document.removeEventListener("focusout",c,!0),document.removeEventListener("input",l,!0),document.removeEventListener("invalid",u,!0),document.removeEventListener("visibilitychange",f),window.removeEventListener("pagehide",p),t.clear()}}}var vb,wb,xb,Sb,kb,Eb,el,tl,ct,cl=S(()=>{"use strict";z();vb=new Set(["password","hidden"]),wb=/(^|\s|-)(cc-|new-password|current-password|one-time-code)/i,xb=new Set(["submit","button","reset","image"]),Sb="input, select, textarea",kb=30,Eb=20;el=60;tl=n=>!!n&&typeof n.closest=="function"&&!!n.closest("[data-scalebun-no-capture]");ct=()=>typeof performance!="undefined"?performance.now():Date.now()});var ll={};_(ll,{installScrollTracker:()=>Tb});function Tb(){if(typeof window=="undefined"||typeof document=="undefined")return{summary:()=>Rb(),reset:()=>{},stop:()=>{}};let n=0,e=0,t=0,r=0,s=()=>document.documentElement,i=()=>{try{let l=s();e=Math.max(e,l.scrollHeight),t=window.innerWidth||l.clientWidth||0,r=window.innerHeight||l.clientHeight||0}catch{}},o=()=>{let l=window.scrollY||window.pageYOffset||0;l>n&&(n=l)},a;if(typeof ResizeObserver!="undefined")try{a=new ResizeObserver(()=>i()),a.observe(s())}catch{a=void 0}return i(),window.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",i,{passive:!0}),{summary:()=>{i();let l=e||0,u=r||0,d=It(n,l,u);return{scroll_depth_pct:d,max_scroll_px:Math.round(n),doc_h:Math.round(l),viewport_w:Math.round(t),viewport_h:Math.round(u),max_bucket:Zc(d),scrollable:ai(l,u)}},reset:()=>{n=0,e=0,t=window.innerWidth||0,r=window.innerHeight||0},stop:()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",i),a==null||a.disconnect()}}}function Rb(){return{scroll_depth_pct:0,max_scroll_px:0,doc_h:0,viewport_w:0,viewport_h:0,max_bucket:0,scrollable:!1}}var dl=S(()=>{"use strict";Bn()});var pl={};_(pl,{ATTENTION_BANDS:()=>Mb,bandFractions:()=>ul,installAttentionTracker:()=>Pb});function ul(n,e,t,r){let s=new Array(r).fill(0);if(t<=0||e<=0||r<=0)return s;let i=t/r,o=Math.max(0,n),a=Math.min(t,n+e);for(let c=0;c<r;c++){let l=c*i,u=(c+1)*i,d=Math.max(0,Math.min(a,u)-Math.max(o,l));s[c]=i>0?d/i:0}return s}function Pb(){if(typeof window=="undefined"||typeof document=="undefined")return{summary:()=>Lb(),reset:()=>{},stop:()=>{}};let n=new Array(10).fill(0),e=0,t=0,r=lt(),s=lt(),i=!1,o=()=>document.documentElement,a=()=>{try{e=Math.max(e,o().scrollHeight),t=window.innerHeight||o().clientHeight||0}catch{}},c=()=>{var x,y;if(i)return;let m=lt(),h=m-r;if(r=m,h<=0||typeof document.visibilityState=="string"&&document.visibilityState!=="visible"||m-s>15e3)return;let b=window.scrollY||window.pageYOffset||0,k=ul(b,t,e,10);for(let g=0;g<10;g++)n[g]=((x=n[g])!=null?x:0)+h*((y=k[g])!=null?y:0)},l=()=>{s=lt()},u=()=>{document.visibilityState==="visible"?r=lt():c()},d,p;if(typeof ResizeObserver!="undefined")try{p=new ResizeObserver(()=>a()),p.observe(o())}catch{p=void 0}return a(),d=setInterval(c,500),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("pointermove",l,{passive:!0}),window.addEventListener("keydown",l,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),document.addEventListener("visibilitychange",u),{summary:()=>{a(),c();let m=n.map(h=>Math.round(h));return{attention_bands:m,attention_active_ms:m.reduce((h,b)=>h+b,0),attention_bands_n:10}},reset:()=>{n.fill(0),e=0,t=0,r=lt(),s=lt(),a()},stop:()=>{i=!0,d&&clearInterval(d),window.removeEventListener("scroll",l),window.removeEventListener("pointermove",l),window.removeEventListener("keydown",l),window.removeEventListener("resize",a),document.removeEventListener("visibilitychange",u),p==null||p.disconnect()}}}function Lb(){return{attention_bands:new Array(10).fill(0),attention_active_ms:0,attention_bands_n:10}}var Mb,lt,fl=S(()=>{"use strict";Mb=10;lt=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now()});var bl={};_(bl,{describeElement:()=>qn,installAutocapture:()=>Hb});function Bb(n){let e=n.tagName.toLowerCase();n.id&&(e+=`#${n.id}`);let t=(n.getAttribute("class")||"").trim().split(/\s+/).filter(Boolean).slice(0,2);return t.length&&(e+="."+t.join(".")),e}function qn(n,e=!1){var d,p;let t={tag:n.tagName.toLowerCase(),selector:Bb(n)},r=n.tagName,s=(d=n.closest("[contenteditable]"))==null?void 0:d.getAttribute("contenteditable"),o=r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||n.isContentEditable===!0||s!=null&&s!=="false"?"":(n.textContent||"").trim().slice(0,80);o&&(t.text=e?gl:o),n.id&&(t.el_id=n.id);let a=(n.getAttribute("class")||"").trim().split(/\s+/).filter(Boolean).slice(0,3);a.length&&(t.classes=a);let c=n.getAttribute("href");c&&!/^\s*javascript:/i.test(c)&&(t.href=c);let l=n.getAttribute("name");l&&(t.name=l);let u=(p=n.closest("[data-scalebun-variant]"))==null?void 0:p.getAttribute("data-scalebun-variant");return u&&(t.variant=u),t}function Fb(n,e){for(let t of e)if(t instanceof Element&&typeof t.matches=="function"&&t.matches(ml))return t;return n&&typeof n.closest=="function"?n.closest(ml):null}function Db(n){return Nb.has(n.tagName)?!1:n.id||(n.getAttribute("class")||"").trim()?!0:!!(n.textContent||"").trim()}function qb(n){try{return new URL(n,location.href)}catch{return null}}function hl(){try{return location.pathname}catch{return""}}function Hb(n){if(typeof document=="undefined"||typeof window=="undefined")return()=>{};let e=!0,t;Promise.resolve().then(()=>(cl(),al)).then(T=>{e&&(t=T.installFormAnalytics(n))}).catch(()=>{});let r;Promise.resolve().then(()=>(dl(),ll)).then(T=>{e&&(r=T.installScrollTracker())}).catch(()=>{});let s;Promise.resolve().then(()=>(fl(),pl)).then(T=>{e&&(s=T.installAttentionTracker())}).catch(()=>{});let i=T=>{var ce;if(!e)return;let A=T.target,P=typeof T.composedPath=="function"?T.composedPath():[],$=Fb(A,P),D=$!=null?$:A&&Db(A)?A:null;if(!D||Dn(D))return;let ne={...qn(D,n.maskText===!0),event:"click",path:location.pathname,interactive:$!=null};n.onEvent({name:"$autocapture",props:ne});let J=(ce=D.getAttribute)==null?void 0:ce.call(D,"href");if(!J||/^\s*javascript:/i.test(J))return;let Q=qb(J);if(!Q)return;D.hasAttribute("download")||Ob.test(Q.pathname+Q.search)?n.onEvent({name:"$download",props:{url:Q.href,file:Q.pathname.split("/").pop()||Q.pathname,path:location.pathname}}):Q.host&&Q.host!==location.host&&n.onEvent({name:"$outbound_link",props:{url:Q.href,host:Q.host,path:location.pathname}})},o=T=>{var $;if(!e)return;let A=T.target;if(!A||typeof A.matches!="function"||!A.matches(_b)||Dn(A))return;let P={...qn(A,n.maskText===!0),event:"change",path:location.pathname};if(A instanceof HTMLSelectElement){let D=($=A.selectedOptions)==null?void 0:$[0];P.option_value=A.value,P.option_index=A.selectedIndex,D&&(P.option_text=n.maskText===!0?gl:D.text),P.multiple=A.multiple||void 0}else A instanceof HTMLInputElement&&(P.checked=A.checked,P.input_type=A.type,A.value&&A.value!=="on"&&(P.option_value=A.value));n.onEvent({name:"$change",props:P})},a=T=>{var P;if(!e)return;let A=T.target;!A||A.tagName!=="FORM"||Dn(A)||n.onEvent({name:"$submit",props:{form_id:A.id||void 0,action:A.getAttribute("action")||void 0,fields:A.elements?A.elements.length:0,...(P=t==null?void 0:t.onSubmit(A))!=null?P:{}}})},c=0,l=null,u=0,d=hl(),p=!1,f=!1,m=()=>typeof performance!="undefined"?performance.now():0,h=()=>document.visibilityState!=="hidden"&&(typeof document.hasFocus!="function"||document.hasFocus()),b=()=>{e&&l==null&&h()&&(l=m())},k=()=>{l!=null&&(c+=m()-l,l=null)},x=()=>{if(e)try{let T=document.documentElement,A=It(window.scrollY,T.scrollHeight,window.innerHeight||T.clientHeight);A>u&&(u=A)}catch{}},y=()=>{var T,A;!p||f||(k(),f=!0,n.onEvent({name:"$pageleave",props:{path:d,engagement_ms:Math.round(c),scroll_depth_pct:u,...(T=r==null?void 0:r.summary())!=null?T:{},...(A=s==null?void 0:s.summary())!=null?A:{}}}))},g=()=>{document.visibilityState==="hidden"?y():b()},w=new WeakSet,v;typeof IntersectionObserver!="undefined"&&(v=new IntersectionObserver(T=>{if(e)for(let A of T){let P=A.target;A.isIntersecting&&A.intersectionRatio>=.5&&!w.has(P)&&(w.add(P),v.unobserve(P),Dn(P)||n.onEvent({name:"$impression",props:{...qn(P),path:location.pathname}}))}},{threshold:[.5]}));let E=()=>{if(!(!v||!e))try{document.querySelectorAll("[data-scalebun-track-impression]").forEach(T=>{w.has(T)||v.observe(T)})}catch{}},C=()=>{if(e){y();try{n.onEvent({name:"$pageview",props:{path:location.pathname,search:location.search||void 0}})}catch{}c=0,l=null,u=0,r==null||r.reset(),s==null||s.reset(),d=hl(),p=!0,f=!1,b(),E()}};document.addEventListener("click",i,!0),document.addEventListener("submit",a,!0),document.addEventListener("change",o,!0),document.addEventListener("visibilitychange",g),window.addEventListener("scroll",x,{passive:!0}),window.addEventListener("focus",b),window.addEventListener("blur",k),window.addEventListener("popstate",C);let I=history.pushState,R=history.replaceState;return history.pushState=function(...T){I.apply(this,T),C()},history.replaceState=function(...T){R.apply(this,T),C()},C(),()=>{e=!1,t==null||t.stop(),r==null||r.stop(),s==null||s.stop(),document.removeEventListener("click",i,!0),document.removeEventListener("submit",a,!0),document.removeEventListener("change",o,!0),document.removeEventListener("visibilitychange",g),window.removeEventListener("scroll",x),window.removeEventListener("focus",b),window.removeEventListener("blur",k),window.removeEventListener("popstate",C),v==null||v.disconnect(),history.pushState!==I&&history.pushState.toString().includes("pageview")}}var ml,_b,Ob,Nb,gl,Dn,yl=S(()=>{"use strict";Bn();ml='button, a, [role="button"], input[type="submit"], input[type="button"], [data-scalebun-capture]',_b='select, input[type="checkbox"], input[type="radio"]',Ob=/\.(pdf|zip|gz|tar|rar|7z|csv|tsv|xlsx?|docx?|pptx?|dmg|pkg|exe|msi|apk|ipa|mp3|mp4|mov|avi|wav|svg|png|jpe?g|gif|webp|txt|json|xml)(\?|#|$)/i,Nb=new Set(["HTML","BODY","MAIN","SECTION","HEADER","FOOTER","NAV"]),gl="[masked]";Dn=n=>!!n&&typeof n.closest=="function"&&!!n.closest("[data-scalebun-no-capture]")});function ci(n){return n=n.trim(),/^[a-z]{3}$/i.test(n)?n.toUpperCase():""}function Hn(n){return typeof n=="number"&&Math.abs(n)<1e10}function vl(n){n=n||{};let{revenue:e,currency:t,transactionId:r,type:s,productId:i,productName:o,quantity:a,recurrence:c,...l}=n,u=typeof t=="string"?ci(t):"",d=typeof r=="string"?r.trim():"";if(!Hn(e)||!u||!d||d.length>256)return null;let p=s!=null?s:"one_time";if(!/^(one_time|subscription|refund|dispute|adjustment)$/.test(p))return null;let m=p==="refund"||p==="dispute"?-Math.abs(e):e,h={...l,transaction_id:d,revenue_type:p},b=typeof i=="string"?i.trim():"",k=typeof o=="string"?o.trim():"";b&&b.length<=256&&(h.product_id=b),k&&k.length<=512&&(h.product_name=k),a!=null&&(h.quantity=a),c&&(h.recurrence=c);for(let x of $b){let y=n[x];if(y!==void 0){if(!Hn(y))return null;h[x]=Math.abs(y)}}return{revenue:m,currency:u,props:h}}var $b,li=S(()=>{"use strict";$b=["tax","fee","discount"]});var kl={};_(kl,{SUBSCRIPTION_SCHEMA_VERSION:()=>Sl,normalizeSubscription:()=>Wb});function xl(n,e){if(n===void 0)return;if(typeof n=="string"?n.length>64:!(n instanceof Date))return null;let t=new Date(n);return+t<=Date.now()+e?t.toISOString():null}function Vb(n){let e=n||{},t=typeof e.currency=="string"?ci(e.currency):"",r=e.intervalCount;if(!Hn(e.amount)||e.amount<0||!t||!/^(day|week|month|year)$/.test(e.interval)||r!==void 0&&(r!==(r|0)||r<=0||r>1e3))return null;let s=typeof e.id=="string"?e.id.trim():"",i=typeof e.name=="string"?e.name.trim():"";return{amount:e.amount,currency:t,interval:e.interval,...r===void 0?{}:{intervalCount:r},...s&&s.length<=256?{id:s}:{},...i&&i.length<=512?{name:i}:{}}}function Wb(n){var p;n=n||{};let e=typeof n.subscriptionId=="string"?n.subscriptionId.trim():"",t=typeof n.subscriptionEventId=="string"?n.subscriptionEventId.trim():n.subscriptionEventId,r=n.status,s=Ub.indexOf(r);if(!wl.test(e)||t!==void 0&&(typeof t!="string"||!wl.test(t))||s<0)return null;let i=n.cancellationReason,o=typeof n.cancellationComment=="string"?n.cancellationComment.trim():n.cancellationComment;if((i!==void 0||o!==void 0)&&!(r==="cancel_scheduled"||r==="canceled"||r==="expired")||i!==void 0&&!zb.includes(i)||o!==void 0&&(typeof o!="string"||!o||o.length>500))return null;let c=n.plan,l=c===void 0?void 0:Vb(c);if(!l&&(s<4||c!==void 0))return null;let u=xl(n.trialEndAt,316224e6),d=xl(n.effectiveAt,864e5);return u===null||d===null?null:{...(p=n.properties)!=null?p:{},schemaVersion:Sl,subscriptionId:e,...t===void 0?{}:{subscriptionEventId:t},status:r,...i===void 0?{}:{cancellationReason:i},...o===void 0?{}:{cancellationComment:o},plan:l,trialEndAt:u,effectiveAt:d}}var Sl,wl,zb,Ub,El=S(()=>{"use strict";li();Sl=3,wl=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/,zb=["too_expensive","no_longer_needed","competitive_offer","missing_features","poor_experience","payment_issue","other"],Ub=["trial_started","trial_converted","started","plan_changed","renewed","cancel_scheduled","resumed","canceled","expired","payment_failed","refunded"]});function yi(n){return n.replace(/[?#].*$/,"").trim()}function ly(n){return!(!n||n.includes("node_modules")||n==="<anonymous>"||n==="native"||n==="[native code]"||/^(chrome|moz|safari|webkit)-extension:\/\//.test(n))}function Wl(n){var r,s,i,o,a;if(n=n.trim(),!n)return null;if(n==="<anonymous>"||n==="native"||n==="[native code]")return{file:n};let e=/^(.*):(\d+):(\d+)$/.exec(n);if(e)return{file:yi((r=e[1])!=null?r:""),line:+((s=e[2])!=null?s:0),col:+((i=e[3])!=null?i:0)};let t=/^(.*):(\d+)$/.exec(n);return t?{file:yi((o=t[1])!=null?o:""),line:+((a=t[2])!=null?a:0)}:{file:yi(n)}}function Kl(n,e){let t={};return n&&n!=="<anonymous>"&&(t.function=n),e.file&&(t.file=e.file),e.line!=null&&(t.line=e.line),e.col!=null&&(t.col=e.col),t.inApp=ly(e.file),t}function dy(n){let e=n.trim();if(!e)return null;if(e.indexOf("at ")===0){let r=e.slice(3).trim().replace(/^async\s+/,""),s,i=r.indexOf(" (");i!==-1&&r.endsWith(")")&&(s=r.slice(0,i).trim()||void 0,r=r.slice(i+2,-1));let o=Wl(r);return o?Kl(s,o):null}let t=e.lastIndexOf("@");if(t!==-1){let r=e.slice(0,t).trim()||void 0,s=Wl(e.slice(t+1));if(s&&s.file)return Kl(r,s)}return null}function jl(n){var r;if(!n)return[];let e=[],t=n.split(`
2
+ `);for(let s=0;s<t.length&&e.length<50;s++){let i=dy((r=t[s])!=null?r:"");i&&e.push(i)}return e}var Gl=S(()=>{"use strict"});function py(n){if(!n)return"";let e=/^[a-z]+:\/\/[^/]+(\/.*)$/i.exec(n);return e&&e[1]?e[1]:n}function fy(n){var i;if(!n||!n.length)return"";let e=n.filter(o=>o.inApp),t=e.length?e:n,r=[],s="";for(let o of t){let a=`${(i=o.function)!=null?i:"<anonymous>"}@${py(o.file)}`;if(a!==s&&(r.push(a),s=a,r.length>=uy))break}return r.join(">")}function my(n){return n.replace(/0x[0-9a-f]+/gi,"0x?").replace(/\b[0-9a-f]{8,}\b/gi,"H").replace(/\d+/g,"N").replace(/(['"]).*?\1/g,"S").trim().slice(0,200)}function Yl(n,e,t){let r=fy(e),s=r?`${n}|${r}`:`${n}|${my(t)}`;return Ee(s).toString(36)}var uy,Xl=S(()=>{"use strict";Fe();uy=5});function Jl(n,e){let t=[],r=new Set,s=a=>{var u;if(!a||typeof a!="object"||r.has(a)||t.length>=5)return;r.add(a);let c=a,l=e(c.stack);t.push({type:c.name,message:String((u=c.message)!=null?u:a),...l.length?{frames:l}:{}})},i=n==null?void 0:n.errors;if(Array.isArray(i))for(let a of i)s(a);let o=n==null?void 0:n.cause;for(;o&&t.length<5&&!r.has(o);)s(o),o=o==null?void 0:o.cause;return t}var Ql=S(()=>{"use strict"});var Zl={};_(Zl,{computeFingerprint:()=>Yl,extractCauses:()=>Jl,parseStack:()=>jl});var ed=S(()=>{"use strict";Gl();Xl();Ql()});function fd(n){try{if(typeof n=="string")return n.length;if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))return n.byteLength;if(typeof Blob!="undefined"&&n instanceof Blob)return n.size}catch{}return 0}function wi(n,e,t){let r=n.WebSocket;if(typeof r!="function")return()=>{};function s(i,o){let a=o!==void 0?new r(i,o):new r(i),c=String(i);if(t(c))return a;let l=Date.now(),u=0,d=0,p=0,f=0,m=!1,h=!1,b=a.send.bind(a);a.send=function(y){return u++,p+=fd(y),b(y)},a.addEventListener("message",x=>{d++,f+=fd(x.data)}),a.addEventListener("error",()=>{m=!0});let k=(x,y)=>{if(h)return;h=!0;let g={protocol:"ws",method:"GET",url:c,status:m&&x===void 0?0:void 0,startedAt:l,duration:Date.now()-l,error:m?"websocket error":void 0,ws:{messagesSent:u,messagesReceived:d,bytesSent:p,bytesReceived:f,...x!==void 0?{closeCode:x}:{},...y?{closeReason:y}:{}}};e(g)};return a.addEventListener("close",x=>k(x.code,x.reason)),a}s.prototype=r.prototype;try{Object.defineProperties(s,{CONNECTING:{value:r.CONNECTING},OPEN:{value:r.OPEN},CLOSING:{value:r.CLOSING},CLOSED:{value:r.CLOSED}})}catch{}return n.WebSocket=s,()=>{n.WebSocket=r}}var md=S(()=>{"use strict"});function xi(n,e,t){let r=n.EventSource;if(typeof r!="function")return()=>{};function s(i,o){let a=o!==void 0?new r(i,o):new r(i),c=String(i);if(t(c))return a;let l=Date.now(),u=0,d=0,p=!1,f=!1,m=()=>{if(f)return;f=!0;let b={protocol:"sse",method:"GET",url:c,status:p?0:void 0,startedAt:l,duration:Date.now()-l,error:p?"eventsource error":void 0,ws:{messagesReceived:u,bytesReceived:d,messagesSent:0,bytesSent:0}};e(b)};a.addEventListener("message",b=>{u++,d+=typeof b.data=="string"?b.data.length:0}),a.addEventListener("error",()=>{a.readyState===2&&(p=!0,m())});let h=a.close.bind(a);return a.close=function(){return m(),h()},a}s.prototype=r.prototype;try{Object.defineProperties(s,{CONNECTING:{value:r.CONNECTING},OPEN:{value:r.OPEN},CLOSED:{value:r.CLOSED}})}catch{}return n.EventSource=s,()=>{n.EventSource=r}}var hd=S(()=>{"use strict"});function Fy(n){try{if(n==null)return 0;if(typeof n=="string")return n.length;if(typeof Blob!="undefined"&&n instanceof Blob)return n.size;if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))return n.byteLength;if(typeof URLSearchParams!="undefined"&&n instanceof URLSearchParams)return n.toString().length}catch{}}function Si(n,e,t){let r=n.sendBeacon;return typeof r!="function"?()=>{}:(n.sendBeacon=function(i,o){let a=String(i);if(t(a))return r.call(n,i,o!=null?o:void 0);let c=Date.now(),l=r.call(n,i,o!=null?o:void 0),u={protocol:"beacon",method:"POST",url:a,status:l?void 0:0,startedAt:c,duration:Date.now()-c,requestSize:Fy(o),error:l?void 0:"beacon not queued"};return e(u),l},()=>{n.sendBeacon=r})}var gd=S(()=>{"use strict"});var bd={};_(bd,{installBeacon:()=>Si,installEventSource:()=>xi,installStreams:()=>Dy,installWebSocket:()=>wi});function Dy(n,e,t,r,s){let i=[];return s.ws&&typeof n.WebSocket=="function"&&i.push(wi(n,t,r)),s.sse&&typeof n.EventSource=="function"&&i.push(xi(n,t,r)),s.beacon&&e&&typeof e.sendBeacon=="function"&&i.push(Si(e,t,r)),i}var yd=S(()=>{"use strict";md();hd();gd()});function ki(n,e){if(/graphql/i.test(n))return!0;if(!e)return!1;let t=e.slice(0,200);return/["']?query["']?\s*[:=]/.test(t)||/^\s*(query|mutation|subscription)\b/.test(t)}function Ei(n){if(!n)return;let e=n.trim();if(e.startsWith("[")){let t=wd(e);if(Array.isArray(t)&&t.length){let r=t[0],s=r?vd(r):void 0;return{...s!=null?s:{},batched:!0}}return}if(e.startsWith("{")){let t=wd(e);return t&&("query"in t||"operationName"in t)?vd(t):void 0}if(xd.test(e))return Hy(e)}function er(n){if(!n||typeof n!="object")return!1;if(Array.isArray(n))return n.some(t=>er(t));let e=n.errors;return Array.isArray(e)&&e.length>0}function vd(n){let e={},t=n.operationName;typeof t=="string"&&t&&(e.operationName=t);let r=typeof n.query=="string"?n.query:void 0;if(r){let s=Sd(r);if(s&&(e.operationType=s),!e.operationName){let i=kd(r);i&&(e.operationName=i)}}return e}function Hy(n){let e={},t=Sd(n);t&&(e.operationType=t);let r=kd(n);return r&&(e.operationName=r),e}function Sd(n){let e=n.trimStart();if(e.startsWith("{"))return"query";let t=xd.exec(e.slice(0,64));return t?t[1]:void 0}function kd(n){let e=qy.exec(n);return e&&e[2]?e[2]:void 0}function wd(n){try{return JSON.parse(n)}catch{return}}var xd,qy,Ed=S(()=>{"use strict";xd=/\b(query|mutation|subscription)\b/,qy=/\b(query|mutation|subscription)\s+([A-Za-z_][A-Za-z0-9_]*)/});function Ii(n,e){if(!n)return!1;let t=n.toLowerCase();return e.some(r=>t.startsWith(r.toLowerCase()))}function Ci(n,e){let t=n;return t.length>e&&(t=t.slice(0,e)+"\u2026[truncated]"),K(t)}var WI,Id=S(()=>{"use strict";z();WI=64*1024});var Cd={};_(Cd,{enrichHttpCapture:()=>$y,graphqlResponseHasErrors:()=>er,looksLikeGraphql:()=>ki,parseGraphqlRequest:()=>Ei});async function $y(n,e){var s,i,o;let t,r=async()=>(t===void 0&&(t=n.readResponseText?await n.readResponseText():null),t);if(e.graphql)try{if(ki(n.url,n.reqBody)){let a=(s=Ei(n.reqBody))!=null?s:{};if(n.status&&n.status>=200&&n.status<300){let c=await r();if(c)try{a.hasErrors=er(JSON.parse(c))}catch{}}Object.keys(a).length&&(n.graphql=a)}}catch{}if(e.body){let a=e.body;try{if(n.reqBody&&Ii(n.reqContentType,a.contentTypeAllowlist)&&(n.request={...(i=n.request)!=null?i:{},body:Ci(n.reqBody,a.bodyMaxBytes)}),Ii(n.resContentType,a.contentTypeAllowlist)){let c=await r();c!=null&&(n.response={...(o=n.response)!=null?o:{},body:Ci(c,a.bodyMaxBytes)})}}catch{}}}var Ad=S(()=>{"use strict";Ed();Id()});function Vd(n){if(sr.size)for(let e of sr)try{e(n)}catch{}}function Wd(n){return sr.add(n),()=>{sr.delete(n)}}var sr,Li=S(()=>{"use strict";sr=new Set});var or,ar,cr=S(()=>{"use strict";or={startChild:()=>or,finish(){},setData(){}},ar={startSpan:()=>or,finish(){}}});function Qd(n){var r;let e=new Uint8Array(n);if(typeof crypto!="undefined"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let s=0;s<n;s++)e[s]=Date.now()+s*2654435761&255;let t="";for(let s=0;s<n;s++)t+=((r=e[s])!=null?r:0).toString(16).padStart(2,"0");return t}function Tt(){return Qd(16)}function Ke(){return Qd(8)}function Zd(n){return`00-${n.traceId}-${n.spanId}-${n.sampled?"01":"00"}`}function eu(n){var t,r,s;let e=Jy.exec(n.trim().toLowerCase());return e?{traceId:(t=e[1])!=null?t:"",spanId:(r=e[2])!=null?r:"",sampled:(parseInt((s=e[3])!=null?s:"0",16)&1)===1}:null}var Jy,lr=S(()=>{"use strict";Jy=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/});var dr,tu=S(()=>{"use strict";lr();cr();dr=class{constructor(e,t){this.name=e;this.traceId=Tt();this.rootSpanId=Ke();this.spans=[];this.dropped=0;this.errors=0;var r,s;this.clock=t.clock,this.maxSpans=(r=t.maxSpans)!=null?r:1e3,this.sampled=(s=t.sampled)!=null?s:!0,this.onFinish=t.onFinish,this.startMs=this.clock()}open(e,t,r){if(this.endMs!=null||this.spans.length>=this.maxSpans)return this.dropped++,or;let s={spanId:Ke(),parentSpanId:t,op:e,description:r,startMs:this.clock()};this.spans.push(s);let i=this.clock;return{startChild:(o,a)=>this.open(o,s.spanId,a),finish:(o=i())=>{s.endMs==null&&(s.endMs=o)},setData:(o,a)=>{var c;((c=s.data)!=null?c:s.data={})[o]=a}}}startSpan(e,t){return this.open(e,this.rootSpanId,t)}addSpan(e,t,r,s){if(this.endMs!=null||this.spans.length>=this.maxSpans){this.dropped++;return}this.spans.push({spanId:Ke(),parentSpanId:this.rootSpanId,op:e,startMs:Math.round(t),endMs:Math.round(r),...s?{data:s}:{}})}finish(e=this.clock()){this.endMs==null&&(this.endMs=e,this.onFinish(this))}noteError(){this.endMs==null&&this.errors++}context(){return{traceId:this.traceId,spanId:this.rootSpanId,sampled:this.sampled}}data(){var e;return{name:this.name,traceId:this.traceId,spanId:this.rootSpanId,sampled:this.sampled,startMs:this.startMs,durationMs:Math.max(0,((e=this.endMs)!=null?e:this.startMs)-this.startMs),spans:this.spans.slice(),...this.dropped>0?{droppedSpans:this.dropped}:{},...this.errors>0?{errorCount:this.errors}:{}}}}});function nu(n,e){let t=Tt(),r=Ke(),s=[],i=(o,a,c)=>{a>0&&c>a&&s.push({spanId:Ke(),parentSpanId:r,op:o,startMs:Oi(a),endMs:Oi(c)})};return i("dns",n.domainLookupStart,n.domainLookupEnd),i("connect",n.connectStart,n.connectEnd),n.secureConnectionStart>0&&i("tls",n.secureConnectionStart,n.connectEnd),i("request",n.requestStart,n.responseStart),i("response",n.responseStart,n.responseEnd),i("dom",n.responseEnd,n.domContentLoadedEventEnd),i("load",n.domContentLoadedEventEnd,n.loadEventEnd),{name:`pageload ${e}`,traceId:t,spanId:r,sampled:!0,startMs:0,durationMs:Oi(n.loadEventEnd||n.duration),spans:s}}var Oi,ru=S(()=>{"use strict";lr();Oi=n=>Math.round(n)});var su={};_(su,{Transaction:()=>dr,buildPageload:()=>nu,formatTraceparent:()=>Zd,newSpanId:()=>Ke,newTraceId:()=>Tt,parseTraceparent:()=>eu});var iu=S(()=>{"use strict";tu();lr();ru()});var hu={};_(hu,{createBugReportWidget:()=>vv});function bv(n){let e=n.startsWith("top")?"top: 16px;":"bottom: 16px;",t=n.endsWith("right")?"right: 16px;":"left: 16px;";return e+t}function yv(n){return`[data-scalebun-bugreport]{position:fixed;${bv(n)}z-index:${gv};font-family:system-ui,sans-serif}[data-scalebun-bugreport] .sbbr-launch{cursor:pointer;border:none;border-radius:9999px;padding:10px 16px;font-size:13px;font-weight:600;color:#fff;background:#ef4444;box-shadow:0 2px 8px rgba(0,0,0,.2)}[data-scalebun-bugreport].sbbr-expanded .sbbr-launch{display:none}[data-scalebun-bugreport] .sbbr-panel{display:none;width:min(300px,calc(100vw - 32px));background:#fff;color:#111827;border:1px solid #e5e7eb;border-radius:12px;padding:14px;box-shadow:0 8px 30px rgba(0,0,0,.18);margin-top:8px}[data-scalebun-bugreport] .sbbr-panel.sbbr-open{display:block}[data-scalebun-bugreport] .sbbr-title{font-size:14px;font-weight:700;margin-bottom:8px}[data-scalebun-bugreport] .sbbr-field{width:100%;box-sizing:border-box;font:inherit;font-size:13px;padding:8px;border:1px solid #e5e7eb;border-radius:8px}[data-scalebun-bugreport] textarea.sbbr-field{resize:vertical}[data-scalebun-bugreport] .sbbr-email{margin-top:8px}[data-scalebun-bugreport] .sbbr-status{font-size:12px;color:#6b7280;min-height:16px;margin-top:8px}[data-scalebun-bugreport] .sbbr-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}[data-scalebun-bugreport] .sbbr-btn{cursor:pointer;font:inherit;font-size:13px;padding:6px 12px;border-radius:8px}[data-scalebun-bugreport] .sbbr-cancel{border:1px solid #e5e7eb;background:#fff}[data-scalebun-bugreport] .sbbr-send{font-weight:600;border:none;background:#ef4444;color:#fff}@media(prefers-color-scheme:dark){[data-scalebun-bugreport] .sbbr-panel{background:#17161c;color:#ececf1;border-color:#2e2c36;box-shadow:0 8px 30px rgba(0,0,0,.5)}[data-scalebun-bugreport] .sbbr-field{background:#111016;color:#ececf1;border-color:#2e2c36}[data-scalebun-bugreport] .sbbr-field::placeholder{color:#8b8796}[data-scalebun-bugreport] .sbbr-status{color:#a5a1b0}[data-scalebun-bugreport] .sbbr-cancel{background:#221f2b;color:#ececf1;border-color:#2e2c36}}`}function vv(n){if(typeof document=="undefined")return{destroy:()=>{}};let e=document.createElement("div");e.setAttribute("data-scalebun-bugreport",""),e.setAttribute("data-scalebun",""),Ne(document,yv(n.position));let t=document.createElement("button");t.type="button",t.className="sbbr-launch",t.textContent=n.label;let r=document.createElement("div");r.className="sbbr-panel",r.innerHTML=`
3
+ <div class="sbbr-title">Report a bug</div>
4
+ <textarea data-scalebun-msg class="sbbr-field" placeholder="What went wrong?" rows="4"></textarea>
5
+ <input data-scalebun-email class="sbbr-field sbbr-email" type="email" placeholder="Your email (optional)" />
6
+ <div data-scalebun-status class="sbbr-status"></div>
7
+ <div class="sbbr-actions">
8
+ <button type="button" data-scalebun-cancel class="sbbr-btn sbbr-cancel">Cancel</button>
9
+ <button type="button" data-scalebun-send class="sbbr-btn sbbr-send">Send</button>
10
+ </div>`,e.appendChild(t),e.appendChild(r),document.body.appendChild(e);let s=r.querySelector("[data-scalebun-msg]"),i=r.querySelector("[data-scalebun-email]"),o=r.querySelector("[data-scalebun-status]"),a=r.querySelector("[data-scalebun-send]"),c=r.querySelector("[data-scalebun-cancel]"),l=!1,u=m=>{l=m,r.classList.toggle("sbbr-open",m),e.classList.toggle("sbbr-expanded",m),m&&s.focus()},d=()=>u(!l),p=()=>u(!1),f=async()=>{let m=s.value.trim();if(!m){o.textContent="Please describe the bug.";return}a.disabled=!0,o.textContent="Sending\u2026";let h=null,b;try{let k=await n.onSubmit({message:m,email:i.value.trim()||void 0});k&&typeof k=="object"?b=k.e:h=k!=null?k:null}catch{h=null,b="send"}a.disabled=!1,h?(o.textContent="Thanks \u2014 your report was sent.",s.value="",i.value="",setTimeout(()=>{l&&u(!1),o.textContent=""},1500)):o.textContent=b?mu[b]:mu.send};return t.addEventListener("click",d),c.addEventListener("click",p),a.addEventListener("click",f),{destroy:()=>{t.removeEventListener("click",d),c.removeEventListener("click",p),a.removeEventListener("click",f),e.remove()}}}var mu,gv,gu=S(()=>{"use strict";z();mu={init:"Reporting isn\u2019t ready yet. Reload the page and try again.",off:"Bug reporting is turned off for this site.",empty:"Please describe the bug.",consent:"Reporting is paused until you accept the privacy notice on this page.",send:"Couldn\u2019t reach the server. Check your connection and try again."},gv=2147483e3});var Au={};_(Au,{normalizeConfig:()=>Ui});function ku(n){let e=_e(n),t=je({showOnce:ut(e.showOnce),cooldownHours:Ie(e.cooldownHours),maxImpressions:Ie(e.maxImpressions),maxImpressionsPerSession:Ie(e.maxImpressionsPerSession),samplePct:Ie(e.samplePct)});return Object.keys(t).length?t:void 0}function Eu(n){let e=_e(n),t=je({event:U(e.event),action:U(e.action),seconds:Ie(e.seconds),sessions:Ie(e.sessions),slowMs:Ie(e.slowMs),screen:U(e.screen),delaySeconds:Ie(e.delaySeconds)});return Object.keys(t).length?t:void 0}function Iu(n){let e=_e(n),t=je({platforms:zi(e.platforms),minAppVersion:U(e.minAppVersion),segments:zi(e.segments),userProps:e.userProps&&typeof e.userProps=="object"&&!Array.isArray(e.userProps)?e.userProps:void 0});return Object.keys(t).length?t:void 0}function Cv(n){var t;let e=[];for(let r of $i(n)){let s=_e(r),i=U(s.key),o=U(s.kind);!i||!o||!Iv.has(o)||e.push(je({key:i,kind:o,label:(t=U(s.prompt))!=null?t:U(s.label),choices:zi(s.choices),scaleMax:Ie(s.scaleMax),required:typeof s.required=="boolean"?s.required:void 0,pageBreakBefore:s.pageBreakBefore===!0?!0:void 0}))}return e.length?e:void 0}function Av(n){let e=_e(n),t=U(e.label),r=U(e.action);if(!(!t||!r||!Ev.has(r)))return je({label:t,action:r,deepLink:U(e.deepLink)})}function Cu(n){let e=_e(n),t=U(e.body);if(!t)return null;let r=_e(e.secondaryCta),s=e.style&&typeof e.style=="object"&&!Array.isArray(e.style)?e.style:void 0,i=e.ext&&typeof e.ext=="object"&&!Array.isArray(e.ext)?e.ext:void 0;return je({title:U(e.title),body:t,imageUrl:U(e.imageUrl),cta:Av(e.cta),secondaryCta:U(r.label)?{label:U(r.label),action:"dismiss"}:void 0,dark:ut(e.dark),rtl:ut(e.rtl),coupon:U(e.coupon),style:s,ext:i})}function Tv(n){let e=_e(n);if(!("enabled"in e)&&!("variantB"in e)&&!("split"in e))return;let t=Cu(e.variantB);return je({enabled:ut(e.enabled),split:Ie(e.split),variantB:t!=null?t:void 0})}function Rv(n){var s,i,o;let e=_e(n),t=U(e.id),r=U(e.type);return!t||!r?null:je({id:t,type:r,name:(s=U(e.name))!=null?s:t,question:(i=U(e.question))!=null?i:"",questions:Cv(e.questions),scale:Ie(e.scale),trigger:U(e.trigger),targetScreen:U(e.targetScreen),triggerConfig:Eu(e.triggerConfig),targeting:Iu(e.targeting),throttle:ku(e.throttle),enabled:(o=ut(e.enabled))!=null?o:!0,revision:U(e.revision),style:e.style&&typeof e.style=="object"&&!Array.isArray(e.style)?e.style:void 0,startScreen:U(e.startScreen),thankYouScreen:U(e.thankYouScreen)})}function Mv(n){let e=_e(n),t=U(e.id),r=Cu(e.spec);if(!t||!r)return null;let s=U(e.layout);return je({id:t,layout:s&&kv.includes(s)?s:"modal",trigger:U(e.trigger),delaySeconds:Ie(e.delaySeconds),targetScreen:U(e.targetScreen),triggerConfig:Eu(e.triggerConfig),targeting:Iu(e.targeting),throttle:ku(e.throttle),spec:r,revision:U(e.revision),experiment:Tv(e.experiment),variantId:U(e.variantId),variantKey:U(e.variantKey),preview:ut(e.preview),previewId:U(e.previewId),isTest:ut(e.isTest),testRunId:U(e.testRunId),createdAt:U(e.createdAt)})}function Ui(n){var t,r;let e=_e(n);return{configVersion:(t=Ie(e.configVersion))!=null?t:0,serverTime:(r=U(e.serverTime))!=null?r:new Date().toISOString(),campaigns:$i(e.campaigns).map(Rv).filter(s=>s!==null),inAppMessages:$i(e.inAppMessages).map(Mv).filter(s=>s!==null)}}var _e,$i,U,Ie,ut,zi,je,kv,Ev,Iv,Vi=S(()=>{"use strict";_e=n=>n&&typeof n=="object"&&!Array.isArray(n)?n:{},$i=n=>Array.isArray(n)?n:[],U=n=>typeof n=="string"?n:void 0,Ie=n=>typeof n=="number"&&Number.isFinite(n)?n:void 0,ut=n=>typeof n=="boolean"?n:void 0,zi=n=>{if(!Array.isArray(n))return;let e=n.filter(t=>typeof t=="string");return e.length?e:void 0},je=n=>{for(let e of Object.keys(n))n[e]===void 0&&delete n[e];return n},kv=["modal","fullscreen","bottom_sheet","top_banner","bottom_banner","tooltip","toast"],Ev=new Set(["dismiss","link","custom"]),Iv=new Set(["scale","text","single","multi","emoji","boolean","screenshot","voice"])});var Pv,nn,Tu=S(()=>{"use strict";Pv={rage:["rage_tap"],dead:["dead_tap"],error:["after_crash","js_error"],network_error:["network_error"],slow_screen:["slow_screen"],shake:["shake_device"]},nn=class{constructor(e){this.fire=e;this.items=[];this.timers=new Set;this.currentScreen=""}setItems(e){this.items=e,this.scheduleTimers()}onScreenView(e,t=0){let r=this.currentScreen;if(r&&r!==e)for(let s of this.items)s.trigger==="screen_exit"&&this.candidate(s,r,t);this.currentScreen=e;for(let s of this.items)s.trigger==="screen_view"&&this.candidate(s,e,t)}onSignal(e,t=0){let r=Pv[e];if(r)for(let s of this.items)s.trigger&&r.includes(s.trigger)&&this.candidate(s,this.currentScreen,t)}onCustomEvent(e,t=0){var r,s,i;for(let o of this.items)o.trigger==="custom_event"&&((s=(r=o.triggerConfig)==null?void 0:r.event)!=null?s:e)===e?this.candidate(o,this.currentScreen,t):o.trigger==="after_purchase"&&e==="purchase"?this.candidate(o,this.currentScreen,t):o.trigger==="failed_action"&&(((i=o.triggerConfig)==null?void 0:i.action)===e||e==="failed_action")&&this.candidate(o,this.currentScreen,t)}onLifecycle(e,t,r=0){var s;for(let i of this.items)if(i.trigger===e){if(e==="n_sessions"){let o=(s=i.triggerConfig)==null?void 0:s.sessions;if(typeof o=="number"&&o!==t)continue}this.candidate(i,this.currentScreen,r)}}candidate(e,t,r=0){var o,a,c;if(e.targetScreen&&t&&e.targetScreen!==t)return;let s=(c=(a=(o=e.triggerConfig)==null?void 0:o.delaySeconds)!=null?a:e.delaySeconds)!=null?c:0,i=Math.max(0,s-r/1e3);if(i>0){let l=setTimeout(()=>{this.timers.delete(l),this.fire(e)},i*1e3);this.timers.add(l)}else this.fire(e)}scheduleTimers(){var e;for(let t of this.items){let r=(e=t.triggerConfig)==null?void 0:e.seconds;if(t.trigger==="time_in_app"&&typeof r=="number"&&r>0){let s=setTimeout(()=>{this.timers.delete(s),this.candidate(t,this.currentScreen)},r*1e3);this.timers.add(s)}}}stop(){for(let e of this.timers)clearTimeout(e);this.timers.clear()}}});var Nu={};_(Nu,{clearEngageState:()=>Nv,hasTestSeen:()=>Gi,markTestSeen:()=>Yi,passesThrottle:()=>Tr,readState:()=>Wi,recordCompleted:()=>Mr,recordShown:()=>Rr});function rn(){try{return typeof localStorage!="undefined"?localStorage:null}catch{return null}}function Wi(n){let e=rn();if(!e)return{...Cr};try{let t=e.getItem(Mu(n));if(!t)return{...Cr};let r=JSON.parse(t);return{impressions:typeof r.impressions=="number"?r.impressions:0,lastShownAt:typeof r.lastShownAt=="number"?r.lastShownAt:0,completed:r.completed===!0,revision:typeof r.revision=="string"?r.revision:void 0}}catch{return{...Cr}}}function Pu(n,e){let t=rn();if(t)try{t.setItem(Mu(n),JSON.stringify(e))}catch{}}function Lu(n){let e=Wi(n.id);return n.revision&&e.revision&&e.revision!==n.revision?{...Cr,revision:n.revision}:e}function ji(){try{return typeof sessionStorage!="undefined"?sessionStorage:null}catch{return null}}function _u(n){let e=ji();if(!e)return{sid:n,counts:{}};try{let t=e.getItem(Ki);if(!t)return{sid:n,counts:{}};let r=JSON.parse(t);return r.sid!==n||!r.counts||typeof r.counts!="object"?{sid:n,counts:{}}:{sid:n,counts:r.counts}}catch{return{sid:n,counts:{}}}}function _v(n){let e=ji();if(e)try{e.setItem(Ki,JSON.stringify(n))}catch{}}function Ou(n,e){let t=_u(e).counts[n.id];return!t||n.revision&&t.rev&&t.rev!==n.revision?0:typeof t.n=="number"?t.n:0}function Tr(n,e,t=""){var o;let r=n.throttle,s=Lu(n);if(s.completed)return!1;let i=(o=r==null?void 0:r.maxImpressionsPerSession)!=null?o:r?0:Lv;return i>0&&Ou(n,t)>=i?!1:r?!(r.showOnce&&s.impressions>0||typeof r.maxImpressions=="number"&&s.impressions>=r.maxImpressions||typeof r.cooldownHours=="number"&&e-s.lastShownAt<r.cooldownHours*36e5):!0}function Rr(n,e,t=""){let r=Lu(n);Pu(n.id,{impressions:r.impressions+1,lastShownAt:e,completed:r.completed,revision:n.revision});let s=_u(t);s.counts[n.id]={n:Ou(n,t)+1,rev:n.revision},_v(s)}function Mr(n){var t;let e=Wi(n.id);Pu(n.id,{...e,completed:!0,revision:(t=n.revision)!=null?t:e.revision})}function Gi(n){var t;let e=rn();if(!e)return!1;try{let r=JSON.parse((t=e.getItem(Ar))!=null?t:"[]");return Array.isArray(r)&&r.includes(n)}catch{return!1}}function Yi(n){var t;let e=rn();if(e)try{let r=JSON.parse((t=e.getItem(Ar))!=null?t:"[]").filter(s=>typeof s=="string");if(r.includes(n))return;for(r.push(n);r.length>Ov;)r.shift();e.setItem(Ar,JSON.stringify(r))}catch{}}function Nv(){var e;let n=rn();if(n)try{let t=[];for(let r=0;r<n.length;r++){let s=n.key(r);s&&(s.startsWith(Ru)||s==="scalebun_engage_sessions"||s===Ar)&&t.push(s)}for(let r of t)n.removeItem(r);(e=ji())==null||e.removeItem(Ki)}catch{}}var Ru,Mu,Cr,Lv,Ki,Ar,Ov,Xi=S(()=>{"use strict";Ru="scalebun_engage_throttle:";Mu=n=>`${Ru}${n}`,Cr={impressions:0,lastShownAt:0,completed:!1};Lv=1,Ki="scalebun_engage_session_shows";Ar="scalebun_engage_test_seen",Ov=50});function qu(n){if(typeof n!="string")return!1;let e=n.trim();return!e||e.length>32?!1:Du.test(e)||Hv.test(e)||$v.test(e)||zv.has(e.toLowerCase())}function Ji(n,e={}){let t={};if(!n||typeof n!="object"||Array.isArray(n))return t;let r=n;for(let s of Object.keys(r)){if(!Fu.includes(s)){e.keepUnknown&&typeof r[s]=="string"&&(t[s]=r[s]);continue}qu(r[s])&&(t[s]=r[s].trim())}return t}function Uv(n){let e=Vv(n);if(!e)return null;let t=r=>{let s=r/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4};return .2126*t(e[0])+.7152*t(e[1])+.0722*t(e[2])}function Vv(n){let e=n.trim();if(Du.test(e)){let r=e.slice(1);return(r.length===3||r.length===4)&&(r=r.slice(0,3).split("").map(s=>s+s).join("")),r.length>=6?[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]:null}let t=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})/i.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function Qi(n,e){if(e&&qu(e))return e;let t=Uv(n);return t==null?"#ffffff":t>.55?"#111827":"#ffffff"}function Yv(n){let e={};if(!n||typeof n!="object"||Array.isArray(n))return e;let t=n;for(let r of Object.keys(Bu)){let s=t[r];typeof s=="string"&&Bu[r].includes(s)&&(e[r]=s)}return e}function Hu(n,e={}){var u,d;let t=e.dark?Fv:Bv,r=e.dark?qv:Dv,s=Ji(n),i={};for(let p of Fu)i[p]=(u=s[p])!=null?u:t[p];let o=(d=s.accent)!=null?d:t.accent;i.ctaText=Qi(o,s.ctaText);for(let[p,f]of Object.entries(r))i[p]=f;let a={...Wv,...Yv(n)},c=Kv[a.density];return i.pad=c.pad,i.gap=c.gap,i.qGap=c.qGap,i.radius=jv[a.radius],i.maxWidth=Gv[a.width],{vars:Object.entries(i).map(([p,f])=>`--sb-${p}:${f}`).join(";"),values:i,appearance:a}}var Fu,Bv,Fv,Dv,qv,Du,Hv,$v,zv,Bu,Wv,Kv,jv,Gv,Zi=S(()=>{"use strict";Fu=["accent","cardBg","titleColor","bodyColor","backdrop","ctaText","couponBg","couponFg","couponBorder"],Bv={accent:"#111827",cardBg:"#ffffff",titleColor:"#111827",bodyColor:"#111827",backdrop:"rgba(0,0,0,.28)",ctaText:"#ffffff",couponBg:"#ecfdf5",couponFg:"#065f46",couponBorder:"#10b981"},Fv={accent:"#8b7ff0",cardBg:"#1b1922",titleColor:"#edeaf2",bodyColor:"#edeaf2",backdrop:"rgba(0,0,0,.55)",ctaText:"#ffffff",couponBg:"#12241d",couponFg:"#7ee2bd",couponBorder:"#00c48c"},Dv={muted:"#6b7280",border:"#d1d5db",disabledBg:"#e5e7eb",disabledFg:"#9ca3af",fieldBg:"#ffffff"},qv={muted:"#9a95a6",border:"rgba(255,255,255,.16)",disabledBg:"#2e2940",disabledFg:"#6b6578",fieldBg:"#262131"},Du=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Hv=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(?:,\s*(?:0|1|0?\.\d+)\s*)?\)$/i,$v=/^hsla?\(\s*\d{1,3}(?:deg)?\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*(?:,\s*(?:0|1|0?\.\d+)\s*)?\)$/i,zv=new Set(["transparent","black","white","red","green","blue","yellow","orange","purple","gray","grey","navy","teal","olive","maroon","silver","lime","aqua","fuchsia"]);Bu={separators:["none","line","card"],density:["compact","cosy","roomy"],radius:["sharp","soft","round"],width:["narrow","standard","wide"],position:["bottom","center","corner"]},Wv={separators:"none",density:"cosy",radius:"soft",width:"standard",position:"bottom"},Kv={compact:{pad:"14px",gap:"9px",qGap:"10px"},cosy:{pad:"20px",gap:"14px",qGap:"14px"},roomy:{pad:"26px",gap:"18px",qGap:"22px"}},jv={sharp:"4px",soft:"16px",round:"26px"},Gv={narrow:"340px",standard:"420px",wide:"540px"}});var $u=S(()=>{"use strict"});var no={};_(no,{CssomRecorder:()=>to,adoptedSheetId:()=>Pr});function Pr(n){let e=zu.get(n);return e==null&&(e=Xv++,zu.set(n,e)),e}function Uu(n){try{return Array.from(n.cssRules).map(e=>e.cssText)}catch{return[]}}var zu,Xv,eo,to,Lr=S(()=>{"use strict";zu=new WeakMap,Xv=1;eo="__scalebun_cssom_patched__",to=class{constructor(e,t){this.reg=e;this.onMutations=t;this.installed=!1;this.pending=[];this.scheduled=!1}install(){if(typeof CSSStyleSheet=="undefined")return;let e=CSSStyleSheet.prototype;if(e[eo])return;let t=this;this.origInsert=e.insertRule,e.insertRule=function(r,s){let i=t.origInsert.call(this,r,s),o=t.ref(this);return o&&t.record({op:"sheet",sheet:o,action:"insert",rule:r,index:i}),i},this.origDelete=e.deleteRule,e.deleteRule=function(r){t.origDelete.call(this,r);let s=t.ref(this);s&&t.record({op:"sheet",sheet:s,action:"delete",index:r})},typeof e.replaceSync=="function"&&(this.origReplaceSync=e.replaceSync,e.replaceSync=function(r){t.origReplaceSync.call(this,r);let s=t.ref(this);s&&t.record({op:"sheet",sheet:s,action:"replace",rules:Uu(this)})}),typeof e.replace=="function"&&(this.origReplace=e.replace,e.replace=function(r){let s=t.origReplace.call(this,r);return Promise.resolve(s).then(()=>{let i=t.ref(this);i&&t.record({op:"sheet",sheet:i,action:"replace",rules:Uu(this)})}),s}),e[eo]=!0,this.installed=!0}disconnect(){if(!this.installed)return;let e=CSSStyleSheet.prototype;this.origInsert&&(e.insertRule=this.origInsert),this.origDelete&&(e.deleteRule=this.origDelete),this.origReplaceSync&&(e.replaceSync=this.origReplaceSync),this.origReplace&&(e.replace=this.origReplace),delete e[eo],this.installed=!1,this.pending=[]}ref(e){let t=e.ownerNode;if(t){let r=this.reg.getId(t);return r!=null?{node:r}:null}return{adopted:Pr(e)}}record(e){this.pending.push(e),this.scheduled||(this.scheduled=!0,queueMicrotask(()=>this.flush()))}flush(){if(this.scheduled=!1,!this.pending.length)return;let e=this.pending;this.pending=[],this.onMutations(e)}}});var qr={};_(qr,{MAX_INLINED_CSS_BYTES:()=>Vu,NO_MASK_TEXT_PARENTS:()=>Or,SENSITIVE_ATTRS:()=>Nr,UNRESOLVED_SHEET_ATTR:()=>Wu,absUrl:()=>qe,absolutizeAttrValue:()=>Dr,absolutizeCssUrls:()=>sn,absolutizeSrcset:()=>Gu,isMaskedSubtree:()=>Br,isPasswordField:()=>Rt,maskSecret:()=>Mt,maskText:()=>Ge,resolveSnapshotOpts:()=>et,serializeNode:()=>Ye,serializeShadow:()=>Fr,takeSnapshot:()=>ew});function Zv(n){let e=(n!=null?n:[]).filter(r=>typeof r=="string"&&r.trim()),t=e.length?`${ro},${e.join(",")}`:ro;try{return typeof document!="undefined"&&document.documentElement.matches(t),t}catch{return ro}}function Br(n,e){if(!n||!e)return!1;try{return!!n.closest(e)}catch{return!1}}function et(n={}){var e,t;return{maskAllText:(e=n.maskAllText)!=null?e:!0,maskAllInputs:(t=n.maskAllInputs)!=null?t:!0,maskSel:Zv(n.maskSelectors),cssBudget:{used:0}}}function ew(n,e,t={}){var r;return(r=Ye(n,e,et(t)))!=null?r:{t:"doc",id:e.add(n),children:[]}}function Ye(n,e,t){var r,s;switch(n.nodeType){case 9:{let o={t:"doc",id:e.add(n),children:_r(n,e,t)},a=ju(n,n.baseURI);return a.length&&(o.adoptedStyles=a),o}case 10:{let i=n;return{t:"dt",id:e.add(n),name:i.name,publicId:i.publicId,systemId:i.systemId}}case 1:{let i=n;if(tw(i))return rw(i,e,t,t.cssBudget);let o=e.add(n),a=i.tagName.toLowerCase(),c=i.namespaceURI===Jv?"svg":i.namespaceURI===Qv?"math":void 0,l=a==="style"?sw(i,e):_r(a==="template"?i.content:i,e,t),u={t:"el",id:o,tag:a,attrs:Ku(i,t),children:l};c&&(u.ns=c);let d=i.scrollLeft|0,p=i.scrollTop|0;d&&(u.sx=d),p&&(u.sy=p);let f=i.shadowRoot;return f&&(u.shadow=Fr(f,e,t)),u}case 3:{let i=(s=(r=n.parentNode)==null?void 0:r.nodeName)!=null?s:"",o=n.data,c=(t.maskAllText||Br(n.parentElement,t.maskSel))&&!Or.has(i)?Ge(o):o;return{t:"tx",id:e.add(n),value:c}}case 8:return{t:"cm",id:e.add(n),value:n.data};case 4:return{t:"tx",id:e.add(n),value:n.data};default:return null}}function _r(n,e,t){let r=[];return n.childNodes.forEach(s=>{let i=Ye(s,e,t);i&&r.push(i)}),r}function tw(n){var t;if(n.tagName.toLowerCase()!=="link")return!1;let e=((t=n.getAttribute("rel"))!=null?t:"").toLowerCase();return e.split(/\s+/).includes("stylesheet")&&!e.includes("alternate")}function nw(n){var e;try{let t=(e=n.sheet)==null?void 0:e.cssRules;return!t||t.length===0?null:Array.from(t).map(r=>r.cssText).join("")}catch{return null}}function rw(n,e,t,r){let s=e.add(n),i=nw(n);if(i&&r.used+i.length<=Vu){r.used+=i.length;let a=sn(i,n.ownerDocument.baseURI),c=n.ownerDocument.createTextNode(""),l={},u=n.getAttribute("media");u&&(l.media=u);let d=n.getAttribute("href");return d&&(l["data-scalebun-href"]=qe(d,n.ownerDocument.baseURI)),{t:"el",id:s,tag:"style",attrs:l,children:[{t:"tx",id:e.add(c),value:a}]}}let o=Ku(n,t);return o[Wu]=i?"budget":"cors",{t:"el",id:s,tag:"link",attrs:o,children:[]}}function sw(n,e){var s,i,o;let t="";try{let a=(s=n.sheet)==null?void 0:s.cssRules;a&&a.length&&(t=Array.from(a).map(c=>c.cssText).join(""))}catch{}if(t||(t=(i=n.textContent)!=null?i:""),!t)return[];t=sn(t,n.ownerDocument.baseURI);let r=(o=n.firstChild)!=null?o:n.ownerDocument.createTextNode("");return[{t:"tx",id:e.add(r),value:t}]}function Rt(n){var t,r;let e=(t=n.tagName)==null?void 0:t.toLowerCase();return e!=="input"&&e!=="textarea"?!1:(((r=n.getAttribute)==null?void 0:r.call(n,"type"))||"").toLowerCase()==="password"}function Ku(n,e){var i,o,a,c;let t={};for(let l of Array.from(n.attributes))t[l.name]=e.maskAllInputs&&Nr.has(l.name)?Ge(l.value):l.value;let r=n.tagName.toLowerCase();if(r==="input"||r==="textarea"){let l=(o=(i=n.value)!=null?i:t.value)!=null?o:"";Rt(n)?t.value=Mt(l):t.value=e.maskAllInputs?Ge(l):l}r==="input"?n.checked?t.checked="":delete t.checked:r==="option"&&(n.selected?t.selected="":delete t.selected),t.loading==="lazy"&&(r==="img"||r==="iframe")&&(t.loading="eager");let s=(c=(a=n.ownerDocument)==null?void 0:a.baseURI)!=null?c:"";for(let l of ow){let u=t[l];u!=null&&(t[l]=Dr(l,u,r,s))}return t}function Fr(n,e,t){var a,c,l;let s={mode:"open",id:e.add(n),children:_r(n,e,t)},i=(l=(c=(a=n.host)==null?void 0:a.ownerDocument)==null?void 0:c.baseURI)!=null?l:"",o=ju(n,i);return o.length&&(s.adoptedStyles=o),s}function ju(n,e){try{let t=n.adoptedStyleSheets;if(!t||!t.length)return[];let r=[];for(let s of t)try{let i=Array.from(s.cssRules).map(o=>o.cssText).join("");i&&r.push({id:Pr(s),css:sn(i,e)})}catch{}return r}catch{return[]}}function Ge(n){return n.replace(/\S/g,"*")}function Mt(n){return"*".repeat(n.length)}function qe(n,e){let t=n.trim();if(!t||!e||iw.test(t))return n;try{return new URL(t,e).href}catch{return n}}function sn(n,e){if(!n||!e)return n;let t=n.replace(/url\(\s*(['"]?)([^'")]*)\1\s*\)/gi,(r,s,i)=>`url(${s}${qe(i,e)}${s})`);return t=t.replace(/@import\s+(['"])([^'"]+)\1/gi,(r,s,i)=>`@import ${s}${qe(i,e)}${s}`),t}function Dr(n,e,t,r){if(!e||!r)return e;switch(n){case"src":case"poster":return qe(e,r);case"srcset":return Gu(e,r);case"style":return sn(e,r);case"href":return t==="link"||t==="use"||t==="image"?qe(e,r):e;case"xlink:href":return t==="use"||t==="image"?qe(e,r):e;case"data":return t==="object"?qe(e,r):e;default:return e}}function Gu(n,e){return!n||!e||/data:/i.test(n)?n:n.split(",").map(t=>{let r=t.trim();if(!r)return r;let s=r.search(/\s/);return s===-1?qe(r,e):qe(r.slice(0,s),e)+r.slice(s)}).join(", ")}var Or,Nr,Jv,Qv,ro,Vu,Wu,iw,ow,tt=S(()=>{"use strict";Lr();Or=new Set(["STYLE","SCRIPT"]),Nr=new Set(["value","placeholder","alt","title","aria-label","srcdoc"]),Jv="http://www.w3.org/2000/svg",Qv="http://www.w3.org/1998/Math/MathML",ro='[data-scalebun-mask],[contenteditable=""],[contenteditable="true"]';Vu=2*1024*1024,Wu="data-scalebun-sheet-unresolved";iw=/^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i;ow=["src","srcset","poster","style","href","xlink:href","data"]});var Hr={};_(Hr,{NodeRegistry:()=>on});var on,an=S(()=>{"use strict";on=class{constructor(e=1){this.idToNode=new Map;this.nodeToId=new WeakMap;this.counter=e}add(e){let t=this.nodeToId.get(e);if(t!=null)return t;let r=this.counter++;return this.nodeToId.set(e,r),this.idToNode.set(r,e),r}set(e,t){this.nodeToId.set(t,e),this.idToNode.set(e,t),e>=this.counter&&(this.counter=e+1)}getId(e){return this.nodeToId.get(e)}getNode(e){return this.idToNode.get(e)}has(e){return this.nodeToId.has(e)}remove(e){let t=this.nodeToId.get(e);t!=null&&(this.nodeToId.delete(e),this.idToNode.delete(t))}get size(){return this.idToNode.size}}});var so={};_(so,{captureScreenshot:()=>aw,startVoiceRecording:()=>dw});async function aw(n){if(typeof document=="undefined")return null;try{let[{takeSnapshot:e},{NodeRegistry:t}]=await Promise.all([Promise.resolve().then(()=>(tt(),qr)),Promise.resolve().then(()=>(an(),Hr))]),r=e(document,new t,{maskAllText:n,maskAllInputs:n});return{kind:"screenshot",blob:new Blob([JSON.stringify(r)],{type:Xu}),contentType:Xu,width:typeof window!="undefined"?window.innerWidth:void 0,height:typeof window!="undefined"?window.innerHeight:void 0,masked:n}}catch{return null}}function lw(n){var t;let e=typeof MediaRecorder!="undefined"?MediaRecorder:void 0;if(!e)return null;for(let r of cw)if(!(r&&!((t=e.isTypeSupported)!=null&&t.call(e,r))))try{let s=new e(n,r?{mimeType:r}:void 0),i=[];return s.ondataavailable=o=>{o.data&&o.data.size&&i.push(o.data)},s.start(),{rec:s,mime:r||s.mimeType||"",chunks:i}}catch{}return null}async function dw(){var h,b,k;if(typeof navigator=="undefined"||!((h=navigator.mediaDevices)!=null&&h.getUserMedia)||typeof MediaRecorder=="undefined")return null;let n;try{n=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return null}let e=lw(n);if(!e){for(let x of n.getTracks())x.stop();return null}let{rec:t,mime:r,chunks:s}=e,i=Date.now(),o,a,c;try{let x=(b=globalThis.AudioContext)!=null?b:globalThis.webkitAudioContext;if(x&&typeof requestAnimationFrame=="function"){a=new x;let y=a.createAnalyser();y.fftSize=512,a.createMediaStreamSource(n).connect(y);let g=new Float32Array(y.fftSize),w=()=>{y.getFloatTimeDomainData(g);let v=0;for(let E=0;E<g.length;E++)v+=g[E]*g[E];o==null||o(Math.sqrt(v/g.length)),c=requestAnimationFrame(w)};c=requestAnimationFrame(w)}}catch{}let l="",u,d=(k=globalThis.SpeechRecognition)!=null?k:globalThis.webkitSpeechRecognition,p;if(typeof d=="function")try{let x=new d;x.continuous=!0,x.interimResults=!0,x.onresult=y=>{let g=y.results,w="";for(let v=0;v<g.length;v++)w+=g[v][0].transcript;l=w,u==null||u(l)};try{let y=d.available;if(typeof y=="function"){let g=typeof navigator!="undefined"&&navigator.language||"en-US";await y({langs:[g],processLocally:!0})==="available"&&(x.processLocally=!0)}}catch{}x.start(),p=x}catch{}let f=()=>{try{p==null||p.stop()}catch{}c!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(c);try{a==null||a.close()}catch{}for(let x of n.getTracks())x.stop()},m=setTimeout(()=>{t.state!=="inactive"&&t.stop()},3e4);return{onInterim(x){u=x},onLevel(x){o=x},cancel(){clearTimeout(m);try{t.state!=="inactive"&&t.stop()}catch{}f()},stop(){return clearTimeout(m),new Promise(x=>{var y;t.onstop=()=>{f();let g=Math.min(29999,Date.now()-i);if(!s.length){x(null);return}let w=r||s[0].type||"audio/webm";x({kind:"voice",blob:new Blob(s,{type:w}),contentType:w,durationMs:g,transcript:l||void 0,transcriptApproved:!1})},t.state!=="inactive"?t.stop():(y=t.onstop)==null||y.call(t,new Event("stop"))})}}}var Xu,cw,io=S(()=>{"use strict";$u();Xu="application/scalebun-snapshot+json";cw=["audio/mp4;codecs=mp4a.40.2","audio/mp4","audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus",""]});function uw(n){var e,t;if(n.questions&&n.questions.length)return n.questions;switch(n.type){case"NPS":return[{key:"score",kind:"scale",scaleMax:(e=n.scale)!=null?e:10,label:n.question}];case"CSAT":case"RATINGS_PROMPT":return[{key:"score",kind:"scale",scaleMax:(t=n.scale)!=null?t:5,label:n.question}];case"FEEDBACK":return[{key:"text",kind:"text",label:n.question}];default:return[{key:"text",kind:"text",label:n.question}]}}function fw(n){let e=[];for(let t of n)(!e.length||t.pageBreakBefore&&e[e.length-1].length)&&e.push([]),e[e.length-1].push(t);return e.length?e:[[]]}function Ju(n,e){var Se,le;let t=document.createElement("div");t.setAttribute("data-scalebun-engage",""),t.setAttribute("data-scalebun","");let r=t.attachShadow({mode:"open"}),s=((Se=n.style)==null?void 0:Se.dark)===!0,i=((le=n.style)==null?void 0:le.rtl)===!0,o=Hu(n.style,{dark:s});t.setAttribute("dir",i?"rtl":"ltr");for(let[H,V]of Object.entries(o.appearance))t.setAttribute(`data-${H}`,V);document.body.appendChild(t);let a=uw(n),c=new Map,l=!1,u=()=>{var H;l||(l=!0,(H=e.onStarted)==null||H.call(e))};Ne(r,`:host{${o.vars}}
11
+ ${mw}`);let d=document.createElement("div");d.className="ov";let p=document.createElement("div");p.className="card",p.setAttribute("role","dialog"),p.setAttribute("aria-modal","true"),p.setAttribute("aria-label",n.name||"Survey"),d.appendChild(p),r.appendChild(d);let f=document.createElement("div");p.appendChild(f);let m=["text","screenshot","voice"],h=new Map,b=fw(a),k=0,x=b.length-1,y=H=>c.has(H.key)||m.includes(H.kind),g=H=>{var V;return((V=b[H])!=null?V:[]).every(j=>j.required===!1?!0:y(j))},w=()=>{A.disabled=!g(k),A.textContent=k===x?"Submit":"Next",T.style.display=k>0?"":"none",E.textContent=b.length>1?`Page ${k+1} of ${b.length}`:""},v=()=>{var H,V;C.replaceChildren();for(let j of(H=b[k])!=null?H:[]){let de=document.createElement("div");de.className="qb";let me=document.createElement("div");me.className="q",me.textContent=j.label||n.question,de.appendChild(me),hw(de,j,se=>{c.set(j.key,se),u(),w()},se=>{se?h.set(j.key,se):h.delete(j.key),u(),w()},c.get(j.key)),C.appendChild(de)}w(),(V=C.querySelector("textarea, .opt, .emoji"))==null||V.focus()},E=document.createElement("div");E.className="pg",f.appendChild(E);let C=document.createElement("div");f.appendChild(C);let I=document.createElement("div");I.className="foot";let R=document.createElement("button");R.className="x",R.textContent="Dismiss";let T=document.createElement("button");T.className="back",T.type="button",T.textContent="Back",T.style.display="none";let A=document.createElement("button");A.className="go",A.textContent="Submit",I.append(R,T,A),f.appendChild(I),v();let P=()=>{t.remove(),document.removeEventListener("keydown",fe)},$=()=>{e.onDismiss(),P()},D=typeof n.thankYouScreen=="string"?n.thankYouScreen.trim():"",ne=()=>{if(e.onSubmit(gw(a,c,[...h.values()])),!D){P();return}f.remove();let H=document.createElement("div");H.className="thanks";let V=document.createElement("div");V.className="q",V.textContent=D,H.appendChild(V),p.appendChild(H),setTimeout(()=>d.addEventListener("click",P),0),setTimeout(P,2200)},J=()=>{if(k<x){k+=1,u(),v();return}ne()},Q=()=>{k!==0&&(k-=1,v())},fe=H=>{H.key==="Escape"&&$()};R.addEventListener("click",$),A.addEventListener("click",J),T.addEventListener("click",Q),d.addEventListener("click",H=>{H.target===d&&$()}),document.addEventListener("keydown",fe);let ce=typeof n.startScreen=="string"?n.startScreen.trim():"",xe=()=>{var H;(H=C.querySelector("textarea, .opt, .emoji"))==null||H.focus()};if(ce){f.style.display="none";let H=document.createElement("div"),V=document.createElement("div");V.className="q",V.textContent=ce;let j=document.createElement("div");j.className="lede",j.textContent=`${a.length} quick question${a.length===1?"":"s"}`;let de=document.createElement("div");de.className="foot";let me=document.createElement("button");me.className="x",me.textContent="Dismiss";let se=document.createElement("button");se.className="go",se.textContent="Start",de.append(me,se),H.append(V,j,de),p.insertBefore(H,f),me.addEventListener("click",$),se.addEventListener("click",()=>{H.remove(),f.style.display="",u(),xe()}),se.focus()}else xe();return{close:P}}function hw(n,e,t,r,s){var i,o;if(e.kind==="screenshot"){let a=document.createElement("div");a.className="att";let c=document.createElement("button");c.className="attbtn",c.type="button",c.textContent="\u{1F4F7} Attach screenshot",c.addEventListener("click",async()=>{c.disabled=!0;try{let{captureScreenshot:l}=await Promise.resolve().then(()=>(io(),so)),u=await l(!0);u?(r(u),c.textContent="\u2713 Screenshot attached",c.setAttribute("data-done","true")):c.textContent="Screenshot unavailable"}finally{c.disabled=!1}}),a.appendChild(c),n.appendChild(a);return}if(e.kind==="voice"){let a=document.createElement("div");a.className="att";let c=document.createElement("button");c.className="attbtn",c.type="button",c.textContent="\u{1F399} Record voice";let l=document.createElement("textarea");l.placeholder="Transcript (editable)\u2026",l.style.display="none";let u=null;c.addEventListener("click",async()=>{if(u){let d=u;u=null,c.disabled=!0;let p=await d.stop();c.disabled=!1,p?(p.transcript=l.value||p.transcript,p.transcriptApproved=!0,r(p),c.textContent="\u2713 Voice attached",c.setAttribute("data-done","true")):c.textContent="\u{1F399} Record voice"}else{c.disabled=!0;let{startVoiceRecording:d}=await Promise.resolve().then(()=>(io(),so));if(u=await d(),c.disabled=!1,!u){c.textContent="Mic unavailable";return}l.style.display="block",u.onInterim(p=>{l.value=p}),c.textContent="\u23F9 Stop"}}),a.appendChild(c),n.appendChild(a),n.appendChild(l);return}if(e.kind==="text"){let a=document.createElement("textarea");typeof s=="string"&&(a.value=s),a.addEventListener("input",()=>t(a.value)),n.appendChild(a);return}if(e.kind==="scale"){let a=(i=e.scaleMax)!=null?i:5,c=a>=10?0:1,l=document.createElement("div");l.className="row";let u=[];for(let d=c;d<=a;d++){let p=document.createElement("button");p.className="opt",p.type="button",p.textContent=String(d),p.setAttribute("aria-pressed",s===d?"true":"false"),p.addEventListener("click",()=>{u.forEach(f=>f.setAttribute("aria-pressed","false")),p.setAttribute("aria-pressed","true"),t(d)}),u.push(p),l.appendChild(p)}n.appendChild(l);return}if(e.kind==="emoji"){let a=document.createElement("div");a.className="row";let c=[];pw.forEach((l,u)=>{let d=document.createElement("button");d.className="emoji",d.type="button",d.textContent=l,d.setAttribute("aria-pressed",s===u+1?"true":"false"),d.setAttribute("aria-label",`${u+1}`),d.addEventListener("click",()=>{c.forEach(p=>p.setAttribute("aria-pressed","false")),d.setAttribute("aria-pressed","true"),t(u+1)}),c.push(d),a.appendChild(d)}),n.appendChild(a);return}if(e.kind==="boolean"||e.kind==="single"||e.kind==="multi"){let a=e.kind==="boolean"?["Yes","No"]:(o=e.choices)!=null?o:[],c=e.kind==="multi",l=new Set(c&&Array.isArray(s)?s:[]),u=document.createElement("div");u.className="row";for(let d of a){let p=document.createElement("button");p.className="opt",p.type="button",p.textContent=d,p.setAttribute("aria-pressed",(c?l.has(d):s===d)?"true":"false"),p.addEventListener("click",()=>{c?(l.has(d)?l.delete(d):l.add(d),p.setAttribute("aria-pressed",l.has(d)?"true":"false"),t([...l])):(u.querySelectorAll(".opt").forEach(f=>f.setAttribute("aria-pressed","false")),p.setAttribute("aria-pressed","true"),t(d))}),u.appendChild(p)}n.appendChild(u)}}function gw(n,e,t){let r=[],s,i;for(let o of n){let a=e.get(o.key);if(a==null)continue;let c=Array.isArray(a)?a.join(", "):a;r.push({key:o.key,value:c}),s===void 0&&typeof a=="number"&&(s=a),i===void 0&&typeof a=="string"&&(i=a)}return{score:s,text:i,answers:r,...t.length?{attachments:t}:{}}}var pw,mw,Qu=S(()=>{"use strict";z();Zi();pw=["\u{1F621}","\u{1F641}","\u{1F610}","\u{1F642}","\u{1F60D}"];mw=`
12
+ :host{all:initial}
13
+ .ov{position:fixed;inset:0;display:flex;align-items:flex-end;justify-content:center;
14
+ background:var(--sb-backdrop);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;pointer-events:auto}
15
+ @media(min-width:640px){.ov{align-items:center}}
16
+ .card{background:var(--sb-cardBg);color:var(--sb-bodyColor);width:100%;max-width:var(--sb-maxWidth);
17
+ border-radius:var(--sb-radius) var(--sb-radius) 0 0;
18
+ padding:var(--sb-pad);box-shadow:0 -8px 40px rgba(0,0,0,.2);box-sizing:border-box}
19
+ @media(min-width:640px){.card{border-radius:var(--sb-radius);margin:16px}}
20
+ .q{font-size:15px;font-weight:600;margin:0 0 var(--sb-gap);color:var(--sb-titleColor)}
21
+
22
+ /* \u2500\u2500 Appearance: position \u2500\u2500
23
+ Centre and corner are WEB placements. The bottom sheet stays the default and the mobile-width
24
+ behaviour is untouched: below 640px a corner toast would cover most of the screen anyway, so it
25
+ falls back to the sheet rather than pretending to be something it can't be at that size. */
26
+ :host([data-position=center]) .ov{align-items:center}
27
+ :host([data-position=center]) .card{border-radius:var(--sb-radius);margin:16px}
28
+ @media(min-width:640px){
29
+ :host([data-position=corner]) .ov{align-items:flex-end;justify-content:flex-end;background:transparent;
30
+ pointer-events:none;padding:20px}
31
+ :host([data-position=corner]) .card{border-radius:var(--sb-radius);pointer-events:auto;
32
+ max-width:min(var(--sb-maxWidth),380px);box-shadow:0 12px 44px rgba(0,0,0,.24)}
33
+ }
34
+
35
+ /* \u2500\u2500 Appearance: separators \u2500\u2500
36
+ The reason this exists: stacked questions ran together as one form with no visual break. Applied
37
+ between question BLOCKS only (never above the first), so a single-question survey is unchanged. */
38
+ .qb + .qb{margin-top:var(--sb-qGap)}
39
+ :host([data-separators=line]) .qb + .qb{border-top:1px solid var(--sb-border);padding-top:var(--sb-qGap)}
40
+ :host([data-separators=card]) .qb{border:1px solid var(--sb-border);border-radius:calc(var(--sb-radius) / 2);
41
+ padding:var(--sb-gap);background:var(--sb-fieldBg)}
42
+
43
+ /* Page position, shown only when there is more than one page \u2014 a "1 of 1" is noise. */
44
+ .pg{font-size:12px;color:var(--sb-muted);margin:0 0 var(--sb-gap)}
45
+ .back{background:none;border:none;color:var(--sb-muted);font-size:13px;cursor:pointer;padding:0}
46
+ .row{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
47
+ .opt{flex:1 1 auto;min-width:34px;padding:9px 6px;border:1px solid var(--sb-border);border-radius:9px;
48
+ background:var(--sb-fieldBg);font-size:14px;cursor:pointer;text-align:center;color:var(--sb-bodyColor)}
49
+ .opt[aria-pressed=true]{background:var(--sb-accent);color:var(--sb-ctaText);border-color:var(--sb-accent)}
50
+ .emoji{font-size:24px;border:none;background:none;cursor:pointer;flex:1;opacity:.55}
51
+ .emoji[aria-pressed=true]{opacity:1;transform:scale(1.15)}
52
+ textarea{width:100%;min-height:72px;border:1px solid var(--sb-border);border-radius:9px;padding:9px;font-size:14px;
53
+ box-sizing:border-box;resize:vertical;color:var(--sb-bodyColor);background:var(--sb-fieldBg)}
54
+ .foot{display:flex;gap:10px;justify-content:flex-end;align-items:center;margin-top:4px}
55
+ .x{margin-inline-end:auto;background:none;border:none;color:var(--sb-muted);font-size:13px;cursor:pointer}
56
+ .go{background:var(--sb-accent);color:var(--sb-ctaText);border:none;border-radius:9px;padding:9px 18px;
57
+ font-size:14px;font-weight:600;cursor:pointer}
58
+ .go:disabled{background:var(--sb-disabledBg);color:var(--sb-disabledFg);cursor:default}
59
+ .scale-labels{display:flex;justify-content:space-between;font-size:11px;color:var(--sb-disabledFg);margin:-8px 0 14px}
60
+ .att{display:flex;gap:8px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
61
+ .attbtn{padding:9px 14px;border:1px solid var(--sb-border);border-radius:9px;background:var(--sb-fieldBg);
62
+ font-size:14px;cursor:pointer;color:var(--sb-bodyColor)}
63
+ .attbtn[data-done=true]{background:var(--sb-couponBg);border-color:var(--sb-couponBorder);color:var(--sb-couponFg)}
64
+ .atthint{font-size:12px;color:var(--sb-disabledFg)}
65
+ /* Intro + thank-you states. The dashboard has authored startScreen / thankYouScreen since the
66
+ builder shipped, and its preview has always drawn both \u2014 but no renderer existed on either SDK, so
67
+ the copy was stored and silently dropped. Optional: a campaign without them behaves exactly as
68
+ before, opening straight onto the first question.
69
+ (No backticks in this comment \u2014 it lives inside a template literal.) */
70
+ .lede{font-size:13px;color:var(--sb-muted);margin:-8px 0 16px}
71
+ .thanks{text-align:center;padding:6px 0 2px}
72
+ .thanks .q{margin-bottom:0}
73
+ `});function yw(n){switch(n){case"modal":return".ov{align-items:center;justify-content:center}.card{max-width:380px;border-radius:16px;margin:16px}";case"fullscreen":return".ov{align-items:stretch;justify-content:stretch}.card{border-radius:0;width:100%}";case"bottom_sheet":return".ov{align-items:flex-end;justify-content:center}.card{width:100%;max-width:480px;border-radius:16px 16px 0 0}";case"top_banner":return".ov{align-items:flex-start;justify-content:stretch}.card{width:100%;border-radius:0}";case"bottom_banner":return".ov{align-items:flex-end;justify-content:stretch}.card{width:100%;border-radius:0}";case"toast":return".ov{align-items:flex-end;justify-content:flex-end}.card{max-width:320px;border-radius:12px;margin:16px}";case"tooltip":return".ov{align-items:flex-start;justify-content:center}.card{max-width:280px;border-radius:12px;margin:12px}"}}function oo(n,e,t){var y,g,w,v,E,C;let r=document.createElement("div");r.setAttribute("data-scalebun-engage",""),r.setAttribute("data-scalebun","");let s=r.attachShadow({mode:"open"});document.body.appendChild(r);let i=e.dark===!0,o=(g=(y=e.style)==null?void 0:y.cardBg)!=null?g:i?"#1f2937":"#ffffff",a=(v=(w=e.style)==null?void 0:w.text)!=null?v:i?"#f9fafb":"#111827",c=(C=(E=e.style)==null?void 0:E.accent)!=null?C:"#111827",l=bw.includes(n),u=vt(document.createElement("style"));u.textContent=`
74
+ :host{all:initial}
75
+ .ov{position:fixed;inset:0;display:flex;z-index:2147483600;
76
+ background:${l?"rgba(0,0,0,.28)":"transparent"};
77
+ pointer-events:${l?"auto":"none"};
78
+ font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
79
+ .card{pointer-events:auto;background:${o};color:${a};box-sizing:border-box;padding:16px 18px;
80
+ box-shadow:0 8px 40px rgba(0,0,0,.22);position:relative}
81
+ img{width:100%;border-radius:8px;margin-bottom:10px;display:block}
82
+ .t{font-size:16px;font-weight:700;margin:0 0 6px}
83
+ .b{font-size:14px;line-height:1.45;margin:0 0 12px}
84
+ .coupon{display:inline-block;font-family:monospace;font-size:13px;border:1px dashed ${c};
85
+ border-radius:6px;padding:4px 10px;margin:0 0 12px}
86
+ .acts{display:flex;gap:10px;justify-content:flex-end;align-items:center}
87
+ .x{position:absolute;top:8px;right:10px;background:none;border:none;color:${a};opacity:.5;font-size:18px;cursor:pointer;line-height:1}
88
+ .sec{background:none;border:none;color:${a};opacity:.7;font-size:13px;cursor:pointer}
89
+ .cta{background:${c};color:#fff;border:none;border-radius:9px;padding:9px 16px;font-size:14px;font-weight:600;cursor:pointer}
90
+ ${yw(n)}`,s.appendChild(u);let d=document.createElement("div");d.className="ov";let p=document.createElement("div");p.className="card",p.setAttribute("role","dialog"),p.setAttribute("aria-label",e.title||"Message"),e.rtl&&p.setAttribute("dir","rtl"),d.appendChild(p),s.appendChild(d);let f=()=>{r.remove(),document.removeEventListener("keydown",h)},m=()=>{t.onDismiss(),f()},h=I=>{I.key==="Escape"&&m()},b=document.createElement("button");if(b.className="x",b.textContent="\xD7",b.setAttribute("aria-label","Close"),b.addEventListener("click",m),p.appendChild(b),e.imageUrl){let I=document.createElement("img");I.src=e.imageUrl,I.alt="",p.appendChild(I)}if(e.title){let I=document.createElement("div");I.className="t",I.textContent=e.title,p.appendChild(I)}let k=document.createElement("div");if(k.className="b",k.textContent=e.body,p.appendChild(k),e.coupon){let I=document.createElement("div");I.className="coupon",I.textContent=e.coupon,p.appendChild(I)}let x=document.createElement("div");if(x.className="acts",e.secondaryCta){let I=document.createElement("button");I.className="sec",I.textContent=e.secondaryCta.label,I.addEventListener("click",m),x.appendChild(I)}if(e.cta){let I=document.createElement("button");I.className="cta",I.textContent=e.cta.label,I.addEventListener("click",()=>{t.onClick(e.cta),f()}),x.appendChild(I)}return x.childNodes.length&&p.appendChild(x),l&&d.addEventListener("click",I=>{I.target===d&&m()}),document.addEventListener("keydown",h),{close:f}}var bw,Zu=S(()=>{"use strict";z();bw=["modal","fullscreen","bottom_sheet"]});function ao(n){return typeof n=="string"&&Object.prototype.hasOwnProperty.call(ep,n)}function tp(n){return ao(n)?ep[n]:null}function np(n){let e=pt(n),r=[e.outcomes,e.rewards,e.segments].flatMap(s=>(Array.isArray(s)?s:[]).map(i=>{var a,c;let o=pt(i);return be((c=(a=o.id)!=null?a:o.value)!=null?c:o.code)}));return[...new Set(r.filter(Boolean))]}function rp(n){var t;let e={campaignId:n.campaignId,gameKey:n.gameKey,attemptId:n.attemptId,attempt:Math.max(1,Math.floor(n.attempt)),...n.payload?{input:n.payload}:{},...(t=n.allowedOutcomeIds)!=null&&t.length?{allowedOutcomeIds:n.allowedOutcomeIds}:{}};switch(n.variantKey){case"spin_wheel":case"scratch_card":case"slot_reward":case"mystery_box":return{...e,variantKey:n.variantKey,action:"play"};case"progress_unlock":case"streak_reward":return{...e,variantKey:n.variantKey,action:"load"};case"daily_check_in":return{...e,variantKey:n.variantKey,action:"check_in"};case"quiz_card":return{...e,variantKey:n.variantKey,action:"submit_quiz"}}}function co(n,e){var f;let t=pt(e);if(be(t.attemptId)!==n.attemptId)throw new Error("Game result attemptId does not match the request");if(t.status==="unavailable")return{attemptId:n.attemptId,status:"unavailable",...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...be(t.message)?{message:be(t.message)}:{}};if(t.status!=="resolved")throw new Error("Game result status is invalid");let r=pt(t.outcome),s=be(r.id);if(!s)throw new Error("Game result outcome.id is required");let i=be(r.segmentId),o=r.segmentIndex;if(o!==void 0&&(typeof o!="number"||!Number.isInteger(o)||o<0))throw new Error("Game result segmentIndex is invalid");let a=(f=n.allowedOutcomeIds)!=null?f:[],c=typeof o=="number"?a[o]:void 0;if(a.length>0&&!a.includes(i||c||s))throw new Error("Game result is not one of the authored outcomes");let l=Array.isArray(r.symbols)?r.symbols.map(be).filter(Boolean):void 0;if(r.symbols!==void 0&&(!l||l.length===0||l.length>3))throw new Error("Game result symbols are invalid");let u=r.state;if(u!==void 0&&(u===null||typeof u!="object"||Array.isArray(u)))throw new Error("Game result state is invalid");let d=r.value,p=typeof d=="string"||typeof d=="number"||typeof d=="boolean";return{attemptId:n.attemptId,status:"resolved",outcome:{id:s,...be(r.label)?{label:be(r.label)}:{},...i?{segmentId:i}:{},...typeof o=="number"?{segmentIndex:o}:{},...l?{symbols:l}:{},...u?{state:u}:{},...p?{value:d}:{},...be(r.receiptId)?{receiptId:be(r.receiptId)}:{}}}}function sp(n,e){var a,c,l,u,d,p,f,m,h,b,k,x,y,g,w,v,E,C,I,R,T;let t=pt(e),r=pt((c=(a=t.resultState)!=null?a:t.result)!=null?c:t.reward),s=be((b=(h=(m=(f=(p=(d=(u=(l=t.rewardValue)!=null?l:t.prize)!=null?u:t.rewardResult)!=null?d:t.resultReward)!=null?p:t.reward)!=null?f:r.label)!=null?m:r.title)!=null?h:r.name)!=null?b:t.resultState),i=be((w=(g=(y=(x=(k=t.outcomeId)!=null?k:t.resultId)!=null?x:t.winningId)!=null?y:t.segmentId)!=null?g:r.id)!=null?w:r.value),o=null;switch(n.variantKey){case"spin_wheel":{let A=[t.winningIndex,t.resultIndex,t.selectedIndex,r.index].find(D=>typeof D=="number"&&Number.isInteger(D)&&D>=0),P=typeof A=="number"&&Array.isArray(t.segments)?pt(t.segments[A]):{},$=be((T=(R=(I=(C=(E=(v=t.winningId)!=null?v:t.segmentId)!=null?E:r.segmentId)!=null?C:r.id)!=null?I:P.id)!=null?R:P.value)!=null?T:P.code);if(!$&&A===void 0&&!s)return null;o={id:i||$||`preview_segment_${A}`,...s?{label:s}:{},...$?{segmentId:$}:{},...typeof A=="number"?{segmentIndex:A}:{}};break}case"slot_reward":{let A=Array.isArray(t.resultSymbols)?t.resultSymbols.map(be).filter(Boolean):[];if(A.length===0)return null;o={id:i||`preview_${A.join("_")}`,symbols:A,...s?{label:s}:{}};break}case"scratch_card":case"mystery_box":if(!s&&!i)return null;o={id:i||"preview_reward",...s?{label:s}:{}};break;case"progress_unlock":case"streak_reward":case"daily_check_in":o={id:i||"preview_state",...s?{label:s}:{},state:{...t}};break;case"quiz_card":if(!i&&!s)return null;o={id:i||"preview_quiz",...s?{label:s}:{}};break}return co(n,{attemptId:n.attemptId,status:"resolved",outcome:o})}function ip(n,e,t,r){let s=`${e}:${Math.max(1,Math.floor(t))}`,i=n.get(s);if(i)return i;let o=`scalebun_game_${Date.now().toString(36)}_${r().toString(36)}`;return n.set(s,o),o}var ep,pt,be,lo=S(()=>{"use strict";ep={spin_wheel:"play",scratch_card:"play",slot_reward:"play",mystery_box:"play",progress_unlock:"load",streak_reward:"load",daily_check_in:"check_in",quiz_card:"submit_quiz"},pt=n=>n!==null&&typeof n=="object"&&!Array.isArray(n)?n:{},be=n=>typeof n=="string"?n.trim():""});function ap(n){if(!ao(n.variantKey))return null;let e=n.variantKey,t=new Map;return async(r,s)=>{try{let i=vw(n.ext.gameKey);if(!n.preview&&!i)return{ok:!1,message:"This game is not configured.",retryable:!1};let o=rp({campaignId:n.campaignId,gameKey:i||`preview:${e}`,variantKey:e,attemptId:ip(t,e,r,()=>ww+=1),attempt:r,...s?{payload:s}:{},allowedOutcomeIds:np(n.ext)});if(n.preview){let a=sp(o,n.ext);return a?op(a):{ok:!1,message:"No preview outcome is configured for this campaign.",retryable:!1}}return n.handler?op(co(o,await n.handler(o))):{ok:!1,message:"Rewards are unavailable right now.",retryable:!1}}catch{return{ok:!1,message:"Rewards are unavailable right now.",retryable:!0}}}}function op(n){var t;if(n.status==="unavailable")return{ok:!1,...n.message?{message:n.message}:{message:"Rewards are unavailable right now."},retryable:n.retryable!==!1};let e=n.outcome;return{ok:!0,...e.label?{label:e.label}:{},...typeof e.segmentIndex=="number"?{index:e.segmentIndex}:{},...(t=e.symbols)!=null&&t.length?{symbols:e.symbols}:{},...e.state?{state:e.state}:{}}}var vw,ww,cp=S(()=>{"use strict";lo();vw=n=>typeof n=="string"?n.trim():"",ww=0});var Pt,uo=S(()=>{"use strict";Pt=class{constructor(){this.slots=new Map;this.waiters=new Map}register(e,t){this.slots.set(e,t);let r=this.waiters.get(e);if(r){this.waiters.delete(e);for(let s of r)try{s(t)}catch{}}}unregister(e){this.slots.delete(e)}get(e){return this.slots.get(e)}whenAvailable(e,t){let r=this.slots.get(e);if(r)return t(r),()=>{};let s=this.waiters.get(e);return s||this.waiters.set(e,s=new Set),s.add(t),()=>{var i;return(i=this.waiters.get(e))==null?void 0:i.delete(t)}}clear(){this.slots.clear(),this.waiters.clear()}}});var lp={};_(lp,{engageSlots:()=>Lt,hasInAppSlot:()=>po,registerInAppSlot:()=>xw,slotNameFor:()=>$r});function xw(n,e){return!n||!e?()=>{}:(Lt.register(n,e),()=>Lt.unregister(n))}function $r(n){var t;let e=(t=n.placementKey)!=null?t:n.slot;return typeof e=="string"&&e?e:void 0}function po(n){let e=$r(n);return!!e&&!!Lt.get(e)}var Lt,fo=S(()=>{"use strict";uo();Lt=new Pt});function _t(n){var e,t,r,s,i;return n.surface==="banner"?((e=n.surfaceOptions)==null?void 0:e.placement)==="bottom"?"bottom-banner":"top-banner":n.surface==="panel"?((t=n.surfaceOptions)==null?void 0:t.placement)==="left"?"side-left":"side-right":n.surface==="slideover"?((r=n.surfaceOptions)==null?void 0:r.placement)==="left"?"side-left":"side-right":n.surface==="inline"?`inline:${(i=(s=n.surfaceOptions)==null?void 0:s.slot)!=null?i:"default"}`:Aw[n.surface]}function Rw(n){var o,a,c,l,u;let e=[],t=(d,p)=>e.push({path:d,message:p});if(!n||typeof n!="object")return[{path:"",message:"variant is not an object"}];if((!n.id||!Tw.test(n.id))&&t("id","missing or malformed id"),n.key||t("key","missing key"),kw.includes(n.surface)||t("surface",`unknown surface "${n.surface}"`),Ew.includes(n.priority)||t("priority",`unknown priority "${n.priority}"`),!Array.isArray(n.platforms)||n.platforms.length===0)t("platforms","at least one platform required");else for(let d of n.platforms)Sw.includes(d)||t("platforms",`unknown platform "${d}"`);!Array.isArray(n.blocks)||n.blocks.length===0?t("blocks","at least one block required"):n.blocks.forEach((d,p)=>{(!d||!Cw.includes(d.kind))&&t(`blocks[${p}].kind`,`unknown block kind "${d==null?void 0:d.kind}"`)}),!Array.isArray(n.triggers)||n.triggers.length===0?t("triggers","at least one trigger required"):n.triggers.forEach((d,p)=>{(!d||!Iw.includes(d.type))&&t(`triggers[${p}].type`,`unknown trigger "${d==null?void 0:d.type}"`),((d==null?void 0:d.type)==="element"||(d==null?void 0:d.type)==="hover")&&!d.match&&t(`triggers[${p}].match`,`${d.type} trigger requires a selector`),(d==null?void 0:d.type)==="idle"&&(typeof d.arg!="number"||d.arg<=0)&&t(`triggers[${p}].arg`,"idle trigger requires a positive ms arg")}),["popover","coachmark","hotspot","toolbar"].includes(n.surface)&&((o=n.targeting)!=null&&o.element||((a=n.triggers)!=null?a:[]).some(p=>p.match&&(p.type==="element"||p.type==="hover"))||t("targeting.element",`${n.surface} requires an anchor selector`));let s=(l=(c=n.contract)==null?void 0:c.requiredBlocks)!=null?l:[],i=new Set(((u=n.blocks)!=null?u:[]).map(d=>d==null?void 0:d.kind));for(let d of s)i.has(d)||t("contract.requiredBlocks",`missing required block "${d}"`);return e}function dp(n){return Rw(n).length===0}var Sw,kw,Ew,Iw,Cw,Aw,mo,ho,Tw,zr=S(()=>{"use strict";Sw=["web","ios","android"],kw=["modal","slideover","panel","popover","coachmark","tour","hotspot","inline","banner","toast","center","launcher","palette","checklist","takeover","toolbar"],Ew=["critical","high","normal","low","passive"],Iw=["manual","route","event","idle","element","hover","selection","keyboard","right-click","schedule","no-data","exit-intent"],Cw=["heading","text","richtext","markdown","image","illustration","video","lottie","code","playground","embed","chart","sparkline","stat","table","form","nps","rating","poll","quiz","emoji","steps","checklist","progress","timeline","list","feature-grid","plan-cards","cta","shortcut","avatar","testimonial","social-proof","callout","badge","divider","spacer","countdown","carousel","qr","confetti","product-grid","spinwheel","scratch","slot"],Aw={takeover:"takeover",modal:"modal",banner:"top-banner",toast:"toast",slideover:"side-right",panel:"side-left",popover:"anchored",coachmark:"anchored",tour:"anchored",hotspot:"anchored",toolbar:"anchored",launcher:"launcher",palette:"palette",center:"center",inline:"inline:default",checklist:"launcher"},mo={takeover:"focus-stealing",modal:"focus-stealing",banner:"ambient",toast:"ambient",slideover:"ambient",panel:"ambient",popover:"ambient",coachmark:"ambient",tour:"ambient",hotspot:"ambient",toolbar:"ambient",launcher:"always-available",palette:"on-demand",center:"none",inline:"in-flow",checklist:"ambient"},ho={takeover:5,modal:3,tour:2,banner:1,toast:.5,slideover:0,panel:0,popover:0,coachmark:0,hotspot:0,toolbar:0,inline:0,center:0,launcher:0,palette:0,checklist:0};Tw=/^[a-z0-9][a-z0-9_-]*$/i});var Ur,go=S(()=>{"use strict";Ur=`
91
+ /* Text must be BREAKABLE. Real in-app copy carries runs with no space in them \u2014 a support URL, a
92
+ deploy hash, a pasted id, a German compound \u2014 and nothing here could break one, so it ran
93
+ straight out of its container. Sweeping the catalog with a single long URL took the count from 6
94
+ variants to 86 of 100, on every surface at once; it was invisible only because the catalog writes
95
+ its own short copy. overflow-wrap:anywhere over break-word on purpose: it also shrinks the box's
96
+ min-content width, which is what stops a panel being forced wider than the viewport and pushing
97
+ the whole page sideways. */
98
+ .scalebun-h, .scalebun-text, .scalebun-rich, .scalebun-list, .scalebun-callout,
99
+ .scalebun-checklist-item, .scalebun-checklist-label, .scalebun-steps-title, .scalebun-steps-body,
100
+ .scalebun-md-h, .scalebun-md-p, .scalebun-md-ul, .scalebun-stat-value, .scalebun-stat-label,
101
+ .scalebun-poll-q, .scalebun-poll-opt, .scalebun-quiz-opt,
102
+ .scalebun-table th, .scalebun-table td{ overflow-wrap:anywhere; min-width:0; }
103
+
104
+ .scalebun-h{ font-size:17px; font-weight:700; margin:0 0 6px; color:var(--scalebun-fg); }
105
+ .scalebun-text{ font-size:14px; line-height:1.5; margin:0 0 6px; color:var(--scalebun-fg); }
106
+ .scalebun-rich{ font-size:14px; line-height:1.5; color:var(--scalebun-fg); }
107
+ .scalebun-img{ display:block; max-width:100%; height:auto; border-radius:8px; margin:0 0 10px; }
108
+ .scalebun-list{ margin:0 0 8px; padding-left:18px; color:var(--scalebun-fg); font-size:14px; }
109
+ .scalebun-list li{ margin:2px 0; }
110
+ .scalebun-callout{ display:flex; gap:8px; align-items:flex-start; background:color-mix(in srgb, var(--scalebun-accent) 10%, transparent);
111
+ border:1px solid var(--scalebun-border); border-radius:8px; padding:8px 10px; font-size:13.5px; color:var(--scalebun-fg); margin:0 0 8px; }
112
+ .scalebun-badge{ display:inline-block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px;
113
+ background:var(--scalebun-accent); color:var(--scalebun-accent-fg); border-radius:999px; padding:2px 8px; }
114
+ .scalebun-divider{ border:0; border-top:1px solid var(--scalebun-border); margin:10px 0; }
115
+ .scalebun-progress{ height:8px; border-radius:4px; background:color-mix(in srgb, var(--scalebun-fg) 10%, transparent); overflow:hidden; margin:8px 0; }
116
+ .scalebun-progress-fill{ height:100%; background:var(--scalebun-accent); border-radius:4px; transition:width .3s ease; }
117
+ .scalebun-spacer{ height:8px; }
118
+ /* The row already wraps between buttons; what it could not do is let a SINGLE button be narrower
119
+ than its own label. A button is a flex item, and a flex item's min-width defaults to its content,
120
+ so one long label pushed the row past the card edge no matter how much room the row had to wrap
121
+ into. min-width:0 plus a breakable label is what lets an over-long action fit the surface instead
122
+ of widening it \u2014 80 of the clipped findings were this one row. */
123
+ /* NO min-width:0 on the row. Adding it let the banner's flex layout squeeze the row to ~40px, and
124
+ overflow-wrap:anywhere on the button then split "OK" into "O" over "K". The row keeps its
125
+ automatic minimum so a CTA cannot be crushed by the text beside it; the banner's .scalebun-body
126
+ carries min-width:0 and absorbs the squeeze instead, which is the right priority \u2014 the button is
127
+ the part that has to stay clickable and readable. */
128
+ .scalebun-cta-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
129
+ /* The floor must NOT be relative: min(100%, 5em) resolves 100% against the already-squeezed row, so
130
+ it evaluated to the squeezed width and provided no floor whatsoever (measured: still 31px). An
131
+ absolute floor is what actually holds, and it also gives the row a real min-content width \u2014
132
+ overflow-wrap:anywhere would otherwise let the row's minimum collapse to one character. */
133
+ .scalebun-btn{ font:inherit; font-size:13.5px; font-weight:600; border-radius:8px; padding:8px 14px; cursor:pointer;
134
+ border:1px solid transparent; transition:filter .12s ease; min-width:5em; max-width:100%; overflow-wrap:anywhere; }
135
+ .scalebun-btn:hover{ filter:brightness(1.06); }
136
+ .scalebun-btn:focus-visible{ outline:2px solid var(--scalebun-accent); outline-offset:2px; }
137
+ .scalebun-btn-primary{ background:var(--scalebun-accent); color:var(--scalebun-accent-fg); }
138
+ .scalebun-btn-secondary{ background:transparent; color:var(--scalebun-fg); border-color:var(--scalebun-border); }
139
+ .scalebun-btn-ghost{ background:transparent; color:var(--scalebun-fg); }
140
+ .scalebun-btn-link{ background:transparent; color:var(--scalebun-accent); border:0; padding:8px 4px; text-decoration:underline; }
141
+ .scalebun-btn-dismiss{ background:transparent; color:var(--scalebun-muted); border:0; }
142
+
143
+ /* Checklist \u2014 state-reflecting, never state-granting (the mark comes from the server). */
144
+ .scalebun-checklist{ list-style:none; margin:8px 0; padding:0; display:flex; flex-direction:column; gap:7px; }
145
+ .scalebun-checklist-item{ display:flex; align-items:flex-start; gap:9px; font-size:14px; line-height:1.45; }
146
+ .scalebun-checklist-mark{ flex-shrink:0; width:18px; height:18px; border-radius:50%; margin-top:1px;
147
+ border:1.5px solid var(--scalebun-border); display:grid; place-items:center;
148
+ font-size:11px; font-weight:700; line-height:1; }
149
+ .scalebun-checklist-item[data-done="true"] .scalebun-checklist-mark{
150
+ background:var(--scalebun-accent); border-color:var(--scalebun-accent); color:var(--scalebun-accent-fg); }
151
+ /* Done items recede but stay readable \u2014 struck-through text fails contrast for many readers. */
152
+ .scalebun-checklist-item[data-done="true"] .scalebun-checklist-label{ color:var(--scalebun-muted); }
153
+
154
+ /* The engage theme contract names titleColor and bodyColor separately while IAM carries one
155
+ foreground. Headings read their own var, which FALLS BACK to --scalebun-fg \u2014 so nothing changes
156
+ unless a campaign actually set a distinct title colour. */
157
+ .scalebun-h{ color:var(--scalebun-title, var(--scalebun-fg)); }
158
+
159
+ /* multiStepSheet wizard paging. Buttons reuse .scalebun-btn-* above rather than restyling. */
160
+ .scalebun-steps{ display:flex; flex-direction:column; gap:12px; }
161
+ .scalebun-steps-rail{ display:flex; gap:6px; align-items:center; }
162
+ .scalebun-steps-dot{ height:4px; flex:1; border-radius:99px; background:var(--scalebun-border);
163
+ transition:background .18s ease; }
164
+ .scalebun-steps-dot[data-state="current"], .scalebun-steps-dot[data-state="done"]{ background:var(--scalebun-accent); }
165
+ .scalebun-steps-dot[data-state="todo"]{ opacity:.55; }
166
+ .scalebun-steps-title{ font-size:16px; font-weight:700; }
167
+ .scalebun-steps-body{ font-size:14px; line-height:1.5; color:var(--scalebun-muted); }
168
+ /* Back sits left, the primary action right; margin-left:auto on the forward button keeps that
169
+ split stable when Back/Skip are hidden on the first and last steps. */
170
+ .scalebun-steps-nav{ display:flex; gap:8px; align-items:center; margin-top:2px; }
171
+ .scalebun-steps-nav .scalebun-btn-primary{ margin-left:auto; }
172
+ @media (prefers-reduced-motion: reduce){ .scalebun-steps-dot{ transition:none; } }
173
+
174
+ /* heavy blocks (P3.6) \u2014 styles live with the light sheet (adopted once); the renderers are lazy */
175
+ .scalebun-md-h{ font-weight:700; margin:8px 0 6px; }
176
+ .scalebun-md-p{ font-size:14px; line-height:1.5; margin:0 0 8px; }
177
+ .scalebun-md-ul{ margin:0 0 8px; padding-left:18px; font-size:14px; }
178
+ .scalebun-md code, .scalebun-code code{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
179
+ .scalebun-md code{ background:color-mix(in srgb, var(--scalebun-fg) 8%, transparent); padding:1px 5px; border-radius:5px; font-size:12.5px; }
180
+ .scalebun-code{ border:1px solid var(--scalebun-border); border-radius:10px; overflow:hidden; margin:0 0 8px; }
181
+ .scalebun-code-bar{ display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; padding:6px 10px;
182
+ background:color-mix(in srgb, var(--scalebun-fg) 6%, transparent); border-bottom:1px solid var(--scalebun-border); }
183
+ .scalebun-code-lang{ overflow-wrap:anywhere; min-width:0; font-size:11px; color:var(--scalebun-muted); text-transform:uppercase; letter-spacing:.04em; }
184
+ .scalebun-code-copy{ background:none; border:0; color:var(--scalebun-accent); cursor:pointer; font:inherit; font-size:11.5px; }
185
+ .scalebun-code-pre{ margin:0; padding:12px; overflow-x:auto; font-size:12.5px; line-height:1.5; }
186
+ .scalebun-stat{ display:inline-flex; flex-direction:column; }
187
+ .scalebun-stat-value{ font-size:26px; font-weight:800; line-height:1; }
188
+ .scalebun-stat-label{ font-size:12px; color:var(--scalebun-muted); margin-top:3px; }
189
+ .scalebun-stat-delta{ font-size:12px; font-weight:700; margin-top:2px; }
190
+ .scalebun-stat-delta.up{ color:#2fa96b; } .scalebun-stat-delta.down{ color:#e0483d; }
191
+ .scalebun-table{ width:100%; border-collapse:collapse; font-size:13px; margin:0 0 8px; }
192
+ .scalebun-table th, .scalebun-table td{ text-align:left; padding:7px 10px; border-bottom:1px solid var(--scalebun-border); }
193
+ .scalebun-table th{ color:var(--scalebun-muted); font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:.03em; }
194
+ .scalebun-video{ position:relative; border-radius:10px; overflow:hidden; }
195
+ .scalebun-video-poster{ display:block; position:relative; width:100%; padding:0; border:0; cursor:pointer; background:#000; }
196
+ .scalebun-video-poster img{ display:block; width:100%; height:auto; opacity:.85; }
197
+ .scalebun-video-play{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:34px; }
198
+ .scalebun-video-el{ display:block; width:100%; height:auto; }
199
+
200
+ /* mechanic blocks \u2014 countdown */
201
+ .scalebun-countdown{ display:flex; gap:8px; justify-content:center; margin:10px 0; }
202
+ .scalebun-cd-cell{ min-width:52px; text-align:center; background:color-mix(in srgb, var(--scalebun-fg) 8%, transparent);
203
+ border:1px solid var(--scalebun-border); border-radius:10px; padding:8px 6px; }
204
+ .scalebun-cd-num{ font-size:22px; font-weight:800; font-variant-numeric:tabular-nums; line-height:1; }
205
+ .scalebun-cd-lab{ font-size:10px; color:var(--scalebun-muted); text-transform:uppercase; letter-spacing:.05em; margin-top:4px; }
206
+ /* carousel */
207
+ .scalebun-carousel{ margin:0 0 8px; }
208
+ .scalebun-car-track{ display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; padding-bottom:4px; }
209
+ .scalebun-car-track::-webkit-scrollbar{ display:none; }
210
+ .scalebun-car-slide{ flex:0 0 100%; scroll-snap-align:center; }
211
+ .scalebun-car-img{ width:100%; height:auto; border-radius:10px; display:block; margin-bottom:8px; }
212
+ .scalebun-car-title{ font-weight:700; font-size:14px; margin-bottom:4px; }
213
+ .scalebun-car-text{ font-size:13px; color:var(--scalebun-muted); }
214
+ .scalebun-car-dots{ display:flex; gap:6px; justify-content:center; margin-top:8px; }
215
+ .scalebun-car-dot{ width:7px; height:7px; padding:0; border:0; border-radius:50%; cursor:pointer;
216
+ background:color-mix(in srgb, var(--scalebun-fg) 25%, transparent); }
217
+ .scalebun-car-dot.on{ background:var(--scalebun-accent); }
218
+ /* product grid */
219
+ .scalebun-pgrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; margin:0 0 8px; }
220
+ .scalebun-pcard{ position:relative; text-align:left; background:var(--scalebun-bg); border:1px solid var(--scalebun-border);
221
+ border-radius:10px; padding:8px; cursor:pointer; font:inherit; color:var(--scalebun-fg); }
222
+ .scalebun-pcard:hover{ border-color:var(--scalebun-accent); }
223
+ .scalebun-pcard-img{ width:100%; height:auto; border-radius:6px; display:block; margin-bottom:6px; }
224
+ .scalebun-pcard-badge{ position:absolute; top:6px; left:6px; font-size:10px; font-weight:700; background:var(--scalebun-accent);
225
+ color:var(--scalebun-accent-fg); border-radius:6px; padding:1px 6px; }
226
+ .scalebun-pcard-title{ font-size:12.5px; font-weight:600; }
227
+ .scalebun-pcard-price{ font-size:13px; font-weight:800; color:var(--scalebun-accent); margin-top:2px; }
228
+ /* confetti */
229
+ .scalebun-confetti{ position:absolute; inset:0; pointer-events:none; overflow:hidden; }
230
+ .scalebun-confetti-canvas{ position:absolute; inset:0; width:100%; height:100%; }
231
+ .scalebun-confetti-static{ position:static; display:flex; align-items:center; justify-content:center; font-size:40px; }
232
+ /* spin wheel */
233
+ .scalebun-wheel{ position:relative; display:flex; flex-direction:column; align-items:center; gap:12px; margin:8px 0; }
234
+ .scalebun-wheel-svg{ display:block; transform-origin:50% 50%; }
235
+ .scalebun-wheel-pointer{ position:absolute; top:-2px; left:50%; transform:translateX(-50%); width:0; height:0;
236
+ border-left:9px solid transparent; border-right:9px solid transparent; border-top:14px solid var(--scalebun-fg); z-index:2; }
237
+ .scalebun-wheel-spin{ font:inherit; font-weight:800; font-size:13px; letter-spacing:.04em; padding:9px 20px; border-radius:999px;
238
+ border:0; background:var(--scalebun-accent); color:var(--scalebun-accent-fg); cursor:pointer; }
239
+ /* scratch card */
240
+ .scalebun-scratch{ position:relative; width:300px; max-width:100%; height:90px; margin:8px auto; border-radius:10px; overflow:hidden;
241
+ border:1px dashed var(--scalebun-border); }
242
+ .scalebun-scratch-prize{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:800;
243
+ font-size:18px; color:var(--scalebun-accent); }
244
+ .scalebun-scratch-cover{ position:absolute; inset:0; width:100%; height:100%; cursor:crosshair; touch-action:none; }
245
+ /* Mystery box: a lid you TAP, not a surface you drag. Same block, same server-decided prize. */
246
+ .scalebun-scratch-box{ height:120px; }
247
+ .scalebun-scratch-lid{ position:absolute; inset:0; width:100%; height:100%; border:0; cursor:pointer;
248
+ display:grid; place-items:center; font-size:40px; line-height:1;
249
+ background:linear-gradient(160deg, var(--scalebun-accent), color-mix(in srgb, var(--scalebun-accent) 60%, #000));
250
+ transition:transform .3s ease, opacity .3s ease; }
251
+ .scalebun-scratch-lid:focus-visible{ outline:2px solid var(--scalebun-accent); outline-offset:2px; }
252
+ .scalebun-scratch-lid[data-open="true"]{ transform:translateY(-100%) rotate(-6deg); opacity:0; pointer-events:none; }
253
+ @media (prefers-reduced-motion: reduce){ .scalebun-scratch-lid{ transition:none; } }
254
+ /* Gamified failure state \u2014 one presentation across every mechanic. */
255
+ .scalebun-game-note{ display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap;
256
+ margin:10px 0 0; padding:9px 12px; border-radius:10px; font-size:13px; line-height:1.4; text-align:center;
257
+ background:color-mix(in srgb, var(--scalebun-fg) 6%, transparent); color:var(--scalebun-muted); }
258
+ .scalebun-game-retry{ border:0; cursor:pointer; font:inherit; font-weight:600; padding:5px 12px; border-radius:8px;
259
+ background:var(--scalebun-accent); color:var(--scalebun-accent-fg, #fff); }
260
+ .scalebun-game-retry:focus-visible{ outline:2px solid var(--scalebun-accent); outline-offset:2px; }
261
+ /* streak / daily check-in: a run of day cells. Wraps, so a 31-day month does not overflow. */
262
+ .scalebun-streak{ display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
263
+ .scalebun-streak-day{ flex:0 0 auto; min-width:38px; padding:7px 4px; border-radius:9px; border:0;
264
+ display:flex; flex-direction:column; align-items:center; gap:3px; font:inherit;
265
+ background:color-mix(in srgb, var(--scalebun-fg) 7%, transparent); color:var(--scalebun-muted); }
266
+ .scalebun-streak-mark{ font-size:16px; line-height:1.1; min-height:18px; }
267
+ .scalebun-streak-label{ font-size:10px; letter-spacing:.02em; text-transform:uppercase; }
268
+ .scalebun-streak-day[data-done="true"]{ background:color-mix(in srgb, var(--scalebun-accent) 18%, transparent);
269
+ color:var(--scalebun-accent); }
270
+ /* Today is the only actionable cell, so it is the only one that looks pressable. */
271
+ .scalebun-streak-day[data-today="true"]{ cursor:pointer; color:var(--scalebun-fg);
272
+ box-shadow:inset 0 0 0 2px var(--scalebun-accent); }
273
+ .scalebun-streak-day[data-today="true"]:focus-visible{ outline:2px solid var(--scalebun-accent); outline-offset:2px; }
274
+ /* slot machine */
275
+ .scalebun-slot{ display:flex; flex-direction:column; align-items:center; gap:12px; margin:8px 0; }
276
+ .scalebun-slot-reels{ display:flex; gap:8px; }
277
+ .scalebun-slot-reel{ width:48px; height:44px; overflow:hidden; border:1px solid var(--scalebun-border); border-radius:8px;
278
+ background:color-mix(in srgb, var(--scalebun-fg) 6%, transparent); }
279
+ .scalebun-slot-strip{ display:flex; flex-direction:column; transform:translateY(0); }
280
+ .scalebun-slot-cell{ height:44px; display:flex; align-items:center; justify-content:center; font-size:24px; }
281
+ .scalebun-slot-spin{ padding:8px 18px; }
282
+ /* qr */
283
+ .scalebun-qr{ display:flex; flex-direction:column; align-items:center; gap:8px; margin:8px 0; }
284
+ .scalebun-qr-svg{ border-radius:8px; }
285
+ .scalebun-qr-cap{ font-size:11.5px; color:var(--scalebun-muted); word-break:break-all; text-align:center; max-width:220px; }
286
+
287
+ /* feedback / mechanic blocks (P4.2) */
288
+ .scalebun-nps{ display:flex; gap:4px; flex-wrap:wrap; margin:6px 0; }
289
+ .scalebun-nps-btn{ width:30px; height:30px; border:1px solid var(--scalebun-border); border-radius:7px; background:transparent;
290
+ color:var(--scalebun-fg); cursor:pointer; font:inherit; font-size:12.5px; }
291
+ .scalebun-nps-btn:hover{ background:var(--scalebun-accent); color:var(--scalebun-accent-fg); border-color:transparent; }
292
+ .scalebun-rating{ display:flex; gap:2px; }
293
+ .scalebun-star{ background:none; border:0; cursor:pointer; font-size:22px; color:var(--scalebun-border); padding:0 2px; }
294
+ .scalebun-star.on{ color:#f5b301; }
295
+ .scalebun-emoji{ display:flex; gap:8px; }
296
+ .scalebun-emoji-btn{ background:none; border:0; cursor:pointer; font-size:24px; padding:2px; border-radius:8px; }
297
+ .scalebun-emoji-btn:hover{ background:color-mix(in srgb, var(--scalebun-fg) 8%, transparent); }
298
+ .scalebun-poll-q, .scalebun-quiz .scalebun-poll-q{ font-weight:600; font-size:13.5px; margin:0 0 8px; }
299
+ .scalebun-poll-opt, .scalebun-quiz-opt{ position:relative; display:flex; align-items:center; width:100%; text-align:left;
300
+ border:1px solid var(--scalebun-border); border-radius:8px; background:transparent; color:var(--scalebun-fg);
301
+ padding:9px 12px; margin:0 0 6px; cursor:pointer; font:inherit; font-size:13.5px; overflow:hidden; }
302
+ .scalebun-poll-opt:hover, .scalebun-quiz-opt:hover{ border-color:var(--scalebun-accent); }
303
+ .scalebun-poll-label{ position:relative; z-index:1; flex:1; }
304
+ .scalebun-poll-bar{ position:absolute; left:0; top:0; bottom:0; background:color-mix(in srgb, var(--scalebun-accent) 22%, transparent); }
305
+ .scalebun-poll-pct{ position:relative; z-index:1; font-size:12px; color:var(--scalebun-muted); }
306
+ .scalebun-quiz-opt.correct{ border-color:#2fa96b; background:color-mix(in srgb, #2fa96b 14%, transparent); }
307
+ .scalebun-quiz-opt.incorrect{ border-color:#e0483d; background:color-mix(in srgb, #e0483d 14%, transparent); }
308
+ `});var up,pp=S(()=>{"use strict";up=`
309
+ /* shared close button */
310
+ .scalebun-x{ background:none; border:0; color:var(--scalebun-muted); cursor:pointer; font-size:16px; line-height:1;
311
+ padding:4px 6px; border-radius:6px; }
312
+ .scalebun-x:hover{ background:color-mix(in srgb, var(--scalebun-fg) 12%, transparent); color:var(--scalebun-fg); }
313
+ .scalebun-x:focus-visible{ outline:2px solid var(--scalebun-accent); outline-offset:2px; }
314
+
315
+ /* --scalebun-anim-in carries the variant's AUTHORED entrance animation, mapped from a fixed
316
+ dictionary in richInApp (never interpolated). Each use falls back to that surface's own
317
+ long-standing default, so a variant that authored nothing renders byte-identically to before.
318
+ The reduced-motion rule in host.ts is marked important and still wins over anything set here. */
319
+
320
+ /* S9 \u2014 banner */
321
+ /* WRAPS rather than overflows. A banner carrying a heading, body, a stat and a CTA measures 407px of
322
+ content, so on any phone it ran past the screen edge and took the page's horizontal scroll with it
323
+ \u2014 the one remaining defect that reproduced with the catalog's OWN copy, not stressed content.
324
+ Wrapping to a second row was chosen over dropping the stat or scrolling horizontally: nothing is
325
+ lost, and a banner is already variable-height, so no other surface has to change to allow it. */
326
+ .scalebun-banner{ display:flex; align-items:center; gap:12px; padding:10px 16px; flex-wrap:wrap;
327
+ background:var(--scalebun-bg); color:var(--scalebun-fg); border-bottom:1px solid var(--scalebun-border);
328
+ box-shadow:var(--scalebun-shadow); animation:var(--scalebun-anim-in, scalebun-slidedown .18s ease); }
329
+ .scalebun-banner-bottom{ border-bottom:0; border-top:1px solid var(--scalebun-border); animation:var(--scalebun-anim-in, scalebun-slideup .18s ease); }
330
+ .scalebun-banner .scalebun-body{ flex:1; display:flex; align-items:center; gap:12px; min-width:0; flex-wrap:wrap; }
331
+ .scalebun-banner .scalebun-body>*{ margin:0; }
332
+ .scalebun-banner .scalebun-cta-row{ margin:0; }
333
+ @keyframes scalebun-slidedown{ from{ transform:translateY(-100%); } to{ transform:none; } }
334
+
335
+ /* S10 \u2014 toast */
336
+ .scalebun-toast{ background:var(--scalebun-bg); color:var(--scalebun-fg); border:1px solid var(--scalebun-border);
337
+ border-radius:var(--scalebun-radius); box-shadow:var(--scalebun-shadow); padding:12px 14px; max-width:340px;
338
+ display:flex; gap:10px; align-items:flex-start; animation:var(--scalebun-anim-in, scalebun-slideup .18s ease); }
339
+ .scalebun-toast .scalebun-body{ flex:1; min-width:0; }
340
+ .scalebun-toast .scalebun-body>*:last-child{ margin-bottom:0; }
341
+ @keyframes scalebun-slideup{ from{ transform:translateY(8px); opacity:0; } to{ transform:none; opacity:1; } }
342
+
343
+ /* S1 \u2014 modal */
344
+ /* pointer-events:auto is load-bearing \u2014 the zone is click-transparent (see host.ts BASE_CSS docblock) */
345
+ .scalebun-backdrop{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:auto;
346
+ background:rgba(15,18,26,.55); padding:24px; animation:scalebun-fade .15s ease; }
347
+ .scalebun-modal-card{ position:relative; background:var(--scalebun-bg); color:var(--scalebun-fg);
348
+ border:1px solid var(--scalebun-border); border-radius:var(--scalebun-radius); box-shadow:var(--scalebun-shadow);
349
+ padding:22px; width:100%; max-height:calc(100vh - 48px); overflow:auto; animation:var(--scalebun-anim-in, scalebun-pop .16s ease); }
350
+ .scalebun-modal-card[data-size="sm"]{ max-width:360px; }
351
+ .scalebun-modal-card[data-size="md"]{ max-width:460px; }
352
+ .scalebun-modal-card[data-size="lg"]{ max-width:620px; }
353
+ .scalebun-modal-card[data-size="xl"]{ max-width:820px; }
354
+ .scalebun-modal-x{ position:absolute; top:10px; inset-inline-end:10px; }
355
+ @keyframes scalebun-fade{ from{ opacity:0; } to{ opacity:1; } }
356
+ @keyframes scalebun-pop{ from{ transform:scale(.96); opacity:0; } to{ transform:none; opacity:1; } }
357
+
358
+ /* S2 \u2014 slide-over */
359
+ .scalebun-slideover{ position:absolute; top:0; bottom:0; width:380px; background:var(--scalebun-bg); color:var(--scalebun-fg);
360
+ box-shadow:var(--scalebun-shadow); display:flex; flex-direction:column; overflow:hidden; }
361
+ .scalebun-slideover-right{ right:0; border-left:1px solid var(--scalebun-border); animation:var(--scalebun-anim-in, scalebun-slide-in-r .2s ease); }
362
+ .scalebun-slideover-left{ left:0; border-right:1px solid var(--scalebun-border); animation:var(--scalebun-anim-in, scalebun-slide-in-l .2s ease); }
363
+ /* BOTTOM SHEET. bottom_sheet is one of the seven legacy layouts and richInApp has always mapped it
364
+ to slideover with placement 'bottom' \u2014 but only -right/-left existed, and the surface treated any
365
+ non-'left' placement as right. So every bottom-sheet campaign rendered as a full-height RIGHT panel.
366
+ Overrides the base's top/bottom/width, which describe a vertical edge panel. */
367
+ .scalebun-slideover-bottom{ top:auto; left:0; right:0; bottom:0; width:auto; max-height:82vh;
368
+ border-top:1px solid var(--scalebun-border); border-radius:16px 16px 0 0;
369
+ animation:var(--scalebun-anim-in, scalebun-slideup .22s ease); }
370
+ .scalebun-so-header{ display:flex; justify-content:flex-end; gap:4px; padding:8px 8px 0; }
371
+ /* A grab handle reads as "this came from the bottom edge" \u2014 the affordance a sheet has and a side
372
+ panel doesn't. Decorative only; the \xD7 button remains the accessible dismiss. */
373
+ .scalebun-slideover-bottom .scalebun-so-header::before{ content:''; position:absolute; top:8px;
374
+ left:50%; transform:translateX(-50%); width:36px; height:4px; border-radius:99px;
375
+ background:var(--scalebun-border); }
376
+ .scalebun-slideover-bottom .scalebun-so-header{ padding-top:16px; }
377
+ .scalebun-so-body{ padding:8px 18px 18px; overflow:auto; flex:1; }
378
+ .scalebun-so-resize{ position:absolute; top:0; bottom:0; width:6px; cursor:ew-resize; }
379
+ .scalebun-slideover-right .scalebun-so-resize{ left:0; }
380
+ .scalebun-slideover-left .scalebun-so-resize{ right:0; }
381
+ .scalebun-so-resize:hover{ background:color-mix(in srgb, var(--scalebun-accent) 40%, transparent); }
382
+ @keyframes scalebun-slide-in-r{ from{ transform:translateX(100%); } to{ transform:none; } }
383
+ @keyframes scalebun-slide-in-l{ from{ transform:translateX(-100%); } to{ transform:none; } }
384
+
385
+ /* S4 \u2014 anchored popover */
386
+ .scalebun-popover{ position:absolute; background:var(--scalebun-bg); color:var(--scalebun-fg); border:1px solid var(--scalebun-border);
387
+ border-radius:var(--scalebun-radius); box-shadow:var(--scalebun-shadow); padding:14px 16px; max-width:320px;
388
+ animation:scalebun-pop .14s ease; }
389
+ .scalebun-pop-body>*:last-child{ margin-bottom:0; }
390
+ .scalebun-pop-x{ position:absolute; top:6px; inset-inline-end:6px; }
391
+ /* A close button is out of flow, so nothing stops a heading running underneath it \u2014 the \xD7 then
392
+ lands on a word of the title. Reserving the space is the same thing .scalebun-toolbar-callout
393
+ already did with its right padding. Every surface that pairs an absolute \xD7 with a heading needs
394
+ it, which the stressed sweep put at nine of them, not the three the authored copy revealed.
395
+
396
+ LOGICAL, not physical. This was padding-right, correct only while text runs left-to-right: in
397
+ RTL a line ENDS on the left and STARTS under the close button, so the reserved gap sat on the
398
+ side the text was leaving and the \xD7 landed on the first word instead of the last. The buttons
399
+ use inset-inline-end for the same reason. Caught by sweeping the catalog in Arabic. */
400
+ .scalebun-popover .scalebun-h,
401
+ .scalebun-coachmark .scalebun-h,
402
+ .scalebun-modal-card .scalebun-h,
403
+ .scalebun-inline .scalebun-h,
404
+ .scalebun-toast .scalebun-h,
405
+ .scalebun-banner .scalebun-h,
406
+ .scalebun-takeover-inner .scalebun-h,
407
+ .scalebun-toolbar-callout .scalebun-h{ padding-inline-end:24px; }
408
+
409
+ /* S5 \u2014 coachmark + spotlight */
410
+ .scalebun-coach-spot{ position:fixed; border-radius:8px; box-shadow:0 0 0 9999px rgba(12,10,20,.55);
411
+ pointer-events:none; transition:top .18s ease,left .18s ease,width .18s ease,height .18s ease; }
412
+ .scalebun-coachmark{ position:absolute; pointer-events:auto; background:var(--scalebun-bg); color:var(--scalebun-fg);
413
+ border:1px solid var(--scalebun-border); border-radius:var(--scalebun-radius); box-shadow:var(--scalebun-shadow);
414
+ padding:14px 16px; max-width:300px; animation:scalebun-pop .14s ease; }
415
+
416
+ /* S6 \u2014 product tour. The same three phone-only defects fixed in coach/overlay.ts, which carries the
417
+ full reasoning: width is EXPLICIT because a fixed box with left:50% and no width shrink-wraps to
418
+ half the viewport; the heading reserves the space .scalebun-pop-x is absolutely positioned in; and
419
+ the nav's items are flex:none so an overflowing footer wraps intact instead of collapsing the
420
+ progress counter into a one-character column. */
421
+ .scalebun-tour-card{ width:min(320px, calc(100vw - 32px)); }
422
+ .scalebun-tour-card .scalebun-h{ padding-right:20px; }
423
+ /* Centred by transform, and ANIMATED by transform \u2014 so the entrance clobbered the centring.
424
+ .scalebun-coachmark carries animation:scalebun-pop, whose keyframes set transform:scale(.96) then
425
+ transform:none. An animated property REPLACES the declared one for the whole run, so for the
426
+ animation's 140ms this card was drawn at left:50%/top:50% with NO translate \u2014 sitting half its own
427
+ width down and to the right \u2014 then snapped into place when the animation finished. That is the
428
+ visible jump on opening a tour and on every Next.
429
+ The fix keeps the translate inside the keyframes so the centring survives the run. The individual
430
+ translate property would be tidier, but it silently breaks centring where unsupported, and a card
431
+ that never centres is worse than one that briefly animates. */
432
+ .scalebun-tour-center{ top:50%; left:50%; transform:translate(-50%,-50%); animation-name:scalebun-pop-center; }
433
+ @keyframes scalebun-pop-center{
434
+ from{ transform:translate(-50%,-50%) scale(.96); opacity:0; }
435
+ to{ transform:translate(-50%,-50%); opacity:1; } }
436
+ .scalebun-tour-nav{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:14px; flex-wrap:wrap; }
437
+ .scalebun-tour-prog{ font-size:11.5px; color:var(--scalebun-muted); font-variant-numeric:tabular-nums; flex:none; white-space:nowrap; }
438
+ .scalebun-tour-btns{ display:flex; gap:6px; flex:none; }
439
+ .scalebun-tour-btns .scalebun-btn{ padding:6px 12px; font-size:12.5px; }
440
+
441
+ /* S7 \u2014 hotspot / beacon */
442
+ .scalebun-beacon{ position:absolute; width:14px; height:14px; padding:0; border:0; border-radius:50%;
443
+ background:var(--scalebun-accent); cursor:pointer; pointer-events:auto; box-shadow:0 0 0 4px color-mix(in srgb, var(--scalebun-accent) 30%, transparent); }
444
+ .scalebun-beacon::after{ content:''; position:absolute; inset:0; border-radius:50%; background:var(--scalebun-accent);
445
+ animation:scalebun-pulse 1.8s ease-out infinite; }
446
+ .scalebun-beacon:focus-visible{ outline:2px solid var(--scalebun-accent); outline-offset:3px; }
447
+ @keyframes scalebun-pulse{ 0%{ transform:scale(1); opacity:.6; } 100%{ transform:scale(2.6); opacity:0; } }
448
+ .scalebun-beacon-card{ position:absolute; pointer-events:auto; background:var(--scalebun-bg); color:var(--scalebun-fg);
449
+ border:1px solid var(--scalebun-border); border-radius:var(--scalebun-radius); box-shadow:var(--scalebun-shadow);
450
+ padding:12px 14px; max-width:260px; font-size:13px; }
451
+ .scalebun-beacon-card[hidden]{ display:none; }
452
+
453
+ /* S16 \u2014 toolbar / menu callout */
454
+ .scalebun-toolbar-callout{ position:absolute; pointer-events:auto; background:var(--scalebun-bg); color:var(--scalebun-fg);
455
+ border:1px solid var(--scalebun-border); border-radius:10px; box-shadow:var(--scalebun-shadow);
456
+ padding:10px 30px 10px 12px; max-width:240px; font-size:13px; animation:scalebun-pop .14s ease; }
457
+
458
+ /* S13 \u2014 command palette */
459
+ .scalebun-palette-backdrop{ position:absolute; inset:0; display:flex; align-items:flex-start; justify-content:center; pointer-events:auto;
460
+ padding-top:12vh; background:rgba(15,18,26,.45); }
461
+ .scalebun-palette{ width:min(560px, 92%); background:var(--scalebun-bg); color:var(--scalebun-fg); border:1px solid var(--scalebun-border);
462
+ border-radius:14px; box-shadow:var(--scalebun-shadow); overflow:hidden; animation:scalebun-pop .14s ease; }
463
+ .scalebun-palette-input{ width:100%; box-sizing:border-box; border:0; border-bottom:1px solid var(--scalebun-border);
464
+ padding:16px 18px; font:inherit; font-size:15px; background:transparent; color:var(--scalebun-fg); outline:none; }
465
+ .scalebun-palette-list{ list-style:none; margin:0; padding:6px; max-height:50vh; overflow-y:auto; }
466
+ .scalebun-palette-item{ display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:8px; cursor:pointer; }
467
+ .scalebun-palette-item.active{ background:var(--scalebun-accent); color:var(--scalebun-accent-fg); }
468
+ .scalebun-palette-label{ flex:1; font-size:13.5px; }
469
+ .scalebun-palette-hint{ font-size:11.5px; opacity:.7; }
470
+ .scalebun-palette-empty{ padding:16px; text-align:center; color:var(--scalebun-muted); font-size:13px; }
471
+
472
+ /* Every flex ROW below holds text, and a flex item's min-width defaults to its CONTENT \u2014 so a single
473
+ unbreakable run (a support URL, a deploy hash) forces the row wider than the surface that contains
474
+ it, no matter that the text itself is allowed to wrap. This is the same defect already fixed on
475
+ .scalebun-cta-row; these are the remaining rows, and between them they were 84 of the sweep's last
476
+ 112 findings. The text children already carry overflow-wrap from BLOCKS_CSS \u2014 this is what lets
477
+ them actually use it. */
478
+ .scalebun-panel-head, .scalebun-panel-title, .scalebun-cl-head, .scalebun-cl-title,
479
+ .scalebun-cl-item, .scalebun-cl-label, .scalebun-palette-item, .scalebun-code-bar,
480
+ .scalebun-code-lang, .scalebun-code-copy{ min-width:0; overflow-wrap:anywhere; }
481
+
482
+ /* S3 \u2014 docked panel + AI shell */
483
+ .scalebun-panel{ position:absolute; top:0; bottom:0; width:360px; display:flex; flex-direction:column;
484
+ background:var(--scalebun-bg); color:var(--scalebun-fg); box-shadow:var(--scalebun-shadow); }
485
+ .scalebun-panel-right{ right:0; border-left:1px solid var(--scalebun-border); }
486
+ .scalebun-panel-left{ left:0; border-right:1px solid var(--scalebun-border); }
487
+ .scalebun-panel-head{ display:flex; align-items:center; gap:8px; padding:12px 14px; border-bottom:1px solid var(--scalebun-border); }
488
+ .scalebun-panel-title{ flex:1; font-weight:700; font-size:14px; }
489
+ .scalebun-panel-thread{ flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:10px; }
490
+ .scalebun-bubble{ max-width:85%; padding:9px 12px; border-radius:12px; font-size:13.5px; line-height:1.45; white-space:pre-wrap; }
491
+ .scalebun-bubble-user{ align-self:flex-end; background:var(--scalebun-accent); color:var(--scalebun-accent-fg); border-bottom-right-radius:4px; }
492
+ .scalebun-bubble-assistant{ align-self:flex-start; background:color-mix(in srgb, var(--scalebun-fg) 7%, transparent); border-bottom-left-radius:4px; }
493
+ .scalebun-bubble.streaming::after{ content:'\u258D'; animation:scalebun-blink 1s step-end infinite; }
494
+ @keyframes scalebun-blink{ 50%{ opacity:0; } }
495
+ .scalebun-panel-composer{ display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--scalebun-border); align-items:flex-end; }
496
+ .scalebun-panel-input{ flex:1; resize:none; border:1px solid var(--scalebun-border); border-radius:10px; padding:9px 11px;
497
+ font:inherit; font-size:13.5px; background:transparent; color:var(--scalebun-fg); max-height:120px; }
498
+ .scalebun-panel-send{ padding:9px 14px; }
499
+
500
+ /* S14 \u2014 checklist / onboarding widget */
501
+ .scalebun-checklist{ position:absolute; bottom:16px; right:16px; width:320px; background:var(--scalebun-bg); color:var(--scalebun-fg);
502
+ border:1px solid var(--scalebun-border); border-radius:14px; box-shadow:var(--scalebun-shadow); padding:14px 16px; }
503
+ .scalebun-checklist.complete{ border-color:var(--scalebun-accent); }
504
+ .scalebun-cl-head{ display:flex; align-items:center; gap:6px; margin-bottom:10px; }
505
+ .scalebun-cl-title{ flex:1; font-weight:700; font-size:14px; }
506
+ .scalebun-cl-dock{ font-size:14px; }
507
+ .scalebun-cl-bar{ height:6px; border-radius:3px; background:color-mix(in srgb, var(--scalebun-fg) 10%, transparent); overflow:hidden; }
508
+ .scalebun-cl-fill{ height:100%; background:var(--scalebun-accent); transition:width .25s ease; }
509
+ .scalebun-cl-count{ font-size:11.5px; color:var(--scalebun-muted); margin:6px 0 10px; }
510
+ .scalebun-checklist.collapsed .scalebun-cl-bar, .scalebun-checklist.collapsed .scalebun-cl-count, .scalebun-checklist.collapsed .scalebun-cl-list{ display:none; }
511
+ .scalebun-cl-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
512
+ .scalebun-cl-item{ display:flex; align-items:center; gap:10px; padding:6px 4px; font-size:13.5px; }
513
+ .scalebun-cl-item.done .scalebun-cl-label{ color:var(--scalebun-muted); text-decoration:line-through; }
514
+ .scalebun-cl-check{ width:20px; height:20px; flex:0 0 auto; border-radius:6px; border:1.5px solid var(--scalebun-border);
515
+ background:transparent; color:var(--scalebun-accent-fg); cursor:pointer; font-size:12px; line-height:1; }
516
+ .scalebun-cl-item.done .scalebun-cl-check{ background:var(--scalebun-accent); border-color:var(--scalebun-accent); }
517
+ .scalebun-cl-label{ flex:1; }
518
+
519
+ /* S15 \u2014 full-page takeover */
520
+ .scalebun-takeover{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:auto;
521
+ background:var(--scalebun-bg); color:var(--scalebun-fg); padding:32px; overflow:auto; animation:var(--scalebun-anim-in, scalebun-fade .2s ease); }
522
+ .scalebun-takeover-inner{ position:relative; max-width:640px; width:100%; text-align:center; }
523
+ .scalebun-takeover-x{ position:absolute; top:-8px; inset-inline-end:-8px; }
524
+
525
+ /* S12 \u2014 floating launcher */
526
+ .scalebun-launcher{ position:absolute; bottom:0; right:0; display:flex; flex-direction:column; align-items:flex-end; gap:10px; }
527
+ .scalebun-launcher-fab{ width:52px; height:52px; border-radius:50%; border:0; background:var(--scalebun-accent); color:var(--scalebun-accent-fg);
528
+ font-size:22px; cursor:pointer; box-shadow:var(--scalebun-shadow); }
529
+ .scalebun-launcher-menu{ display:flex; flex-direction:column; gap:2px; background:var(--scalebun-bg); color:var(--scalebun-fg);
530
+ border:1px solid var(--scalebun-border); border-radius:12px; box-shadow:var(--scalebun-shadow); padding:6px; min-width:180px;
531
+ animation:scalebun-pop .14s ease; }
532
+ .scalebun-launcher-menu[hidden]{ display:none; }
533
+ .scalebun-launcher-item{ text-align:left; background:none; border:0; color:var(--scalebun-fg); cursor:pointer; font:inherit;
534
+ font-size:13.5px; padding:9px 12px; border-radius:8px; }
535
+ .scalebun-launcher-item:hover{ background:color-mix(in srgb, var(--scalebun-fg) 7%, transparent); }
536
+ `});var fp,bo,mp,hp,gp,bp,yp,vp,wp=S(()=>{"use strict";fp=(n,e="")=>typeof n=="string"?n:n==null?e:String(n),bo=n=>Array.isArray(n)?n:[],mp=n=>bo(n).map(e=>typeof e=="string"?{id:e,label:e}:e),hp=(n,e)=>{let t=e.doc.createElement("div");t.className="scalebun-nps";for(let r=0;r<=10;r++){let s=e.doc.createElement("button");s.type="button",s.className="scalebun-nps-btn",s.textContent=String(r),s.addEventListener("click",()=>{var i;return(i=e.onInteraction)==null?void 0:i.call(e,`nps:${r}`)}),t.appendChild(s)}return t},gp=(n,e)=>{var s;let t=Number((s=n.props)==null?void 0:s.max)||5,r=e.doc.createElement("div");r.className="scalebun-rating";for(let i=1;i<=t;i++){let o=e.doc.createElement("button");o.type="button",o.className="scalebun-star",o.setAttribute("aria-label",`${i} of ${t}`),o.textContent="\u2605",o.addEventListener("click",()=>{var a;Array.from(r.children).forEach((c,l)=>c.classList.toggle("on",l<i)),(a=e.onInteraction)==null||a.call(e,`rating:${i}`)}),r.appendChild(o)}return r},bp=(n,e)=>{var s,i;let t=bo((s=n.props)==null?void 0:s.emojis).length?bo((i=n.props)==null?void 0:i.emojis):["\u{1F61E}","\u{1F610}","\u{1F642}","\u{1F604}"],r=e.doc.createElement("div");r.className="scalebun-emoji";for(let o of t){let a=e.doc.createElement("button");a.type="button",a.className="scalebun-emoji-btn",a.textContent=o,a.addEventListener("click",()=>{var c;return(c=e.onInteraction)==null?void 0:c.call(e,`emoji:${o}`)}),r.appendChild(a)}return r},yp=(n,e)=>{var o,a,c,l,u;let t=e.doc.createElement("div");t.className="scalebun-poll";let r=fp((o=n.props)==null?void 0:o.question);if(r){let d=e.doc.createElement("div");d.className="scalebun-poll-q",d.textContent=r,t.appendChild(d)}let s=(c=(a=n.props)==null?void 0:a.results)!=null?c:void 0,i=s?Object.values(s).reduce((d,p)=>d+p,0)||1:0;for(let d of mp((l=n.props)==null?void 0:l.options)){let p=e.doc.createElement("button");p.type="button",p.className="scalebun-poll-opt";let f=e.doc.createElement("span");if(f.className="scalebun-poll-label",f.textContent=d.label,p.appendChild(f),s){let m=Math.round(((u=s[d.id])!=null?u:0)/i*100),h=e.doc.createElement("span");h.className="scalebun-poll-bar",h.style.width=`${m}%`;let b=e.doc.createElement("span");b.className="scalebun-poll-pct",b.textContent=`${m}%`,p.append(h,b),p.disabled=!0}p.addEventListener("click",()=>{var m;return(m=e.onInteraction)==null?void 0:m.call(e,`poll_vote:${d.id}`)}),t.appendChild(p)}return t},vp=(n,e)=>{var c,l,u;let t=e.doc.createElement("div");t.className="scalebun-quiz";let r=fp((c=n.props)==null?void 0:c.question);if(r){let d=e.doc.createElement("div");d.className="scalebun-poll-q",d.textContent=r,t.appendChild(d)}let s=(l=n.props)==null?void 0:l.outcome,i=new Map,o=!1,a=(d,p)=>{for(let[f,m]of i)m.disabled=!0,p&&f===p?m.classList.add("correct"):f===d&&f!==p&&m.classList.add("incorrect")};for(let d of mp((u=n.props)==null?void 0:u.options)){let p=e.doc.createElement("button");p.type="button",p.className="scalebun-quiz-opt",p.textContent=d.label,i.set(d.id,p),p.addEventListener("click",()=>{var f;if((f=e.onInteraction)==null||f.call(e,`quiz_answer:${d.id}`),!(!e.requestOutcome||o)){o=!0;for(let m of i.values())m.disabled=!0;e.requestOutcome(1,{answeredId:d.id}).then(m=>{var b,k;if(!m.ok){o=!1;for(let y of i.values())y.disabled=!1;let x=e.doc.createElement("div");x.className="scalebun-quiz-note",x.textContent=(b=m.message)!=null?b:"Could not check that answer.",t.appendChild(x);return}let h=(k=m.state)!=null?k:{};a(d.id,typeof h.correctId=="string"?h.correctId:void 0)})}}),t.appendChild(p)}return s!=null&&s.answeredId&&a(s.answeredId,s.correctId),t}});function Sp(n,e,t){e.split(`
537
+ `).forEach((s,i)=>{i>0&&n.appendChild(t.createElement("br")),n.appendChild(t.createTextNode(s))})}function Wr(n,e){let t=[];for(let r of n){let s=Vr[r.kind];if(s)try{let i=s(r,e);i&&t.push(i)}catch{}}return t}var ye,ve,Mw,Pw,Lw,xp,_w,Ow,Nw,Bw,Fw,Dw,qw,Hw,$w,Vr,Kr=S(()=>{"use strict";wp();ye=(n,e="")=>typeof n=="string"?n:n==null?e:String(n);ve=(n,e,t)=>{let r=n.createElement(e);return r.className=t,r},Mw=(n,e)=>{var r;let t=ve(e.doc,"h2","scalebun-h");return t.textContent=ye((r=n.props)==null?void 0:r.text),t},Pw=(n,e)=>{var r;let t=ve(e.doc,"p","scalebun-text");return Sp(t,ye((r=n.props)==null?void 0:r.text),e.doc),t},Lw=(n,e)=>{var r,s,i;let t=ve(e.doc,"div","scalebun-rich");return Sp(t,ye((i=(r=n.props)==null?void 0:r.text)!=null?i:(s=n.props)==null?void 0:s.markdown),e.doc),t},xp=(n,e)=>{var s,i;let t=e.doc.createElement("img");t.className="scalebun-img";let r=ye((s=n.props)==null?void 0:s.src);return r?(t.src=r,t.alt=ye((i=n.props)==null?void 0:i.alt),t.loading="lazy",t.decoding="async",t):null},_w=(n,e)=>{var s;let t=Array.isArray((s=n.props)==null?void 0:s.items)?n.props.items:[];if(t.length===0)return null;let r=ve(e.doc,"ul","scalebun-checklist");return r.setAttribute("role","list"),t.forEach((i,o)=>{var f,m;let a=i&&typeof i=="object"?i:{},c=typeof i=="string"?i:ye((m=(f=a.label)!=null?f:a.text)!=null?m:a.title),l=a.done===!0||a.checked===!0||a.complete===!0,u=e.doc.createElement("li");u.className="scalebun-checklist-item",u.setAttribute("data-done",l?"true":"false");let d=e.doc.createElement("span");d.className="scalebun-checklist-mark",d.setAttribute("aria-hidden","true"),d.textContent=l?"\u2713":"";let p=e.doc.createElement("span");p.className="scalebun-checklist-label",p.textContent=c,u.appendChild(d),u.appendChild(p),u.setAttribute("aria-label",`${c} \u2014 ${l?"done":"not done"}`),u.addEventListener("click",()=>{var h;return(h=e.onInteraction)==null?void 0:h.call(e,`checklist_item:${o}`)}),r.appendChild(u)}),r},Ow=(n,e)=>{var s;let t=Array.isArray((s=n.props)==null?void 0:s.items)?n.props.items:[];if(t.length===0)return null;let r=ve(e.doc,"ul","scalebun-list");return t.forEach((i,o)=>{var l;let a=e.doc.createElement("li"),c=typeof i=="string"?i:ye((l=i==null?void 0:i.text)!=null?l:i==null?void 0:i.label);a.textContent=c,a.addEventListener("click",()=>{var u;return(u=e.onInteraction)==null?void 0:u.call(e,`list_item:${o}`)}),r.appendChild(a)}),r},Nw=(n,e)=>{var s,i;let t=ve(e.doc,"div","scalebun-callout");if((s=n.props)!=null&&s.icon){let o=ve(e.doc,"span","scalebun-callout-ic");o.textContent=ye(n.props.icon),t.appendChild(o)}let r=ve(e.doc,"span","scalebun-callout-t");return r.textContent=ye((i=n.props)==null?void 0:i.text),t.appendChild(r),t},Bw=(n,e)=>{var r;let t=ve(e.doc,"span","scalebun-badge");return t.textContent=ye((r=n.props)==null?void 0:r.text),t},Fw=(n,e)=>{var i;let t=Math.max(0,Math.min(100,Number((i=n.props)==null?void 0:i.value)||0)),r=ve(e.doc,"div","scalebun-progress"),s=ve(e.doc,"div","scalebun-progress-fill");return s.style.width=`${t}%`,r.appendChild(s),r},Dw=(n,e)=>ve(e.doc,"hr","scalebun-divider"),qw=(n,e)=>{var s;let t=ve(e.doc,"div","scalebun-spacer"),r=Number((s=n.props)==null?void 0:s.height);return!Number.isNaN(r)&&r>0&&(t.style.height=`${r}px`),t},Hw=new Set(["primary","secondary","link","ghost","dismiss"]),$w=(n,e)=>{var s;let t=Array.isArray((s=n.props)==null?void 0:s.actions)?n.props.actions:[];if(t.length===0)return null;let r=ve(e.doc,"div","scalebun-cta-row");for(let i of t){let o=Hw.has(ye(i.variant))?ye(i.variant):"primary",a=e.doc.createElement("button");a.type="button",a.className=`scalebun-btn scalebun-btn-${o}`,a.textContent=ye(i.label,"OK"),a.setAttribute("data-action",ye(i.action,"dismiss")),a.addEventListener("click",()=>e.onAction({...i,variant:o})),r.appendChild(a)}return r},Vr={heading:Mw,text:Pw,richtext:Lw,image:xp,illustration:xp,list:Ow,checklist:_w,callout:Nw,badge:Bw,progress:Fw,divider:Dw,spacer:qw,cta:$w,nps:hp,rating:gp,emoji:bp,poll:yp,quiz:vp}});async function kp(n){var e;try{if(typeof navigator!="undefined"&&((e=navigator.clipboard)!=null&&e.writeText))return await navigator.clipboard.writeText(n),!0}catch{}try{if(typeof document=="undefined")return!1;let t=document.createElement("textarea");t.value=n,t.style.position="fixed",t.style.opacity="0",t.setAttribute("aria-hidden","true"),document.body.appendChild(t),t.select();let r=typeof document.execCommand=="function"?document.execCommand("copy"):!1;return t.remove(),r}catch{return!1}}var Ep=S(()=>{"use strict"});function yo(n){return{doc:n.doc,onInteraction:e=>n.hooks.onInteraction(e),...n.hooks.requestOutcome?{requestOutcome:n.hooks.requestOutcome}:{},onAction:e=>{if(e.action==="dismiss"){n.requestClose("cta");return}if(n.hooks.onCtaClick(e.action),e.action==="copy"&&e.deepLink){kp(e.deepLink);return}if(e.action==="link"&&e.deepLink)try{typeof window!="undefined"&&window.location.assign(e.deepLink)}catch{}}}}function oe(n){return Wr(n.variant.blocks,yo(n))}function jr(n,e,t=1e3){let r=!1,s=null,i=null,o=()=>{s!=null&&(clearTimeout(s),s=null)},a=()=>{r||(r=!0,o(),i==null||i.disconnect(),e())},c=()=>{s==null&&!r&&(s=setTimeout(a,t))};return typeof IntersectionObserver=="undefined"?(c(),()=>o()):(i=new IntersectionObserver(l=>{for(let u of l)u.isIntersecting&&u.intersectionRatio>=.5?c():o()},{threshold:[0,.5,1]}),i.observe(n),()=>{o(),i==null||i.disconnect()})}var Re=S(()=>{"use strict";Kr();Ep()});function Ip(n,e,t,r,s){var p;n.addStyles("scalebun-blocks",Ur),n.addStyles("scalebun-surfaces",up);let i=n.zone(_t(e)),o=i.ownerDocument,a=null,c=()=>{},l=!1,u=f=>{l||!a||(l=!0,c(),r.onDismiss(f),a.destroy())};return a=t({variant:e,host:n,doc:o,hooks:r,requestClose:u,metrics:s}),i.appendChild(a.el),(p=a.afterMount)==null||p.call(a),r.onImpression(),c=jr(a.el,r.onView),{variantId:e.id,el:a.el,close:u}}var Cp=S(()=>{"use strict";zr();go();pp();Re()});var Ap={};_(Ap,{markdownRenderer:()=>zw});function vo(n,e){var o;let t=[],r=/(\*\*([^*]+)\*\*)|(\*([^*]+)\*)|(`([^`]+)`)|(\[([^\]]+)\]\(([^)]+)\))/g,s=0,i;for(;i=r.exec(n);){if(i.index>s&&t.push(e.createTextNode(n.slice(s,i.index))),i[2])t.push(wo(e,"strong",i[2]));else if(i[4])t.push(wo(e,"em",i[4]));else if(i[6])t.push(wo(e,"code",i[6]));else if(i[8]){let a=e.createElement("a");a.textContent=i[8];let c=(o=i[9])!=null?o:"";/^(https?:|\/|#|mailto:)/i.test(c)&&(a.href=c,a.rel="noopener noreferrer",a.target="_blank"),t.push(a)}s=r.lastIndex}return s<n.length&&t.push(e.createTextNode(n.slice(s))),t}function wo(n,e,t){let r=n.createElement(e);return r.textContent=t,r}var zw,Tp=S(()=>{"use strict";zw=(n,e)=>{var i,o;let t=typeof((i=n.props)==null?void 0:i.text)=="string"?n.props.text:typeof((o=n.props)==null?void 0:o.markdown)=="string"?n.props.markdown:"",r=e.doc.createElement("div");r.className="scalebun-md";let s=null;for(let a of t.split(`
538
+ `)){let c=a.trimEnd(),l=c.match(/^(#{1,4})\s+(.*)$/),u=c.match(/^\s*[-*]\s+(.*)$/);if(l){s=null;let d=e.doc.createElement(`h${l[1].length}`);d.className="scalebun-md-h",vo(l[2],e.doc).forEach(p=>d.appendChild(p)),r.appendChild(d)}else if(u){s||(s=e.doc.createElement("ul"),s.className="scalebun-md-ul",r.appendChild(s));let d=e.doc.createElement("li");vo(u[1],e.doc).forEach(p=>d.appendChild(p)),s.appendChild(d)}else if(c){s=null;let d=e.doc.createElement("p");d.className="scalebun-md-p",vo(c,e.doc).forEach(p=>d.appendChild(p)),r.appendChild(d)}else s=null}return r}});var Rp={};_(Rp,{codeRenderer:()=>Uw});var Uw,Mp=S(()=>{"use strict";Uw=(n,e)=>{var u,d,p;let t=typeof((u=n.props)==null?void 0:u.code)=="string"?n.props.code:typeof((d=n.props)==null?void 0:d.text)=="string"?n.props.text:"",r=typeof((p=n.props)==null?void 0:p.language)=="string"?n.props.language:"",s=e.doc.createElement("div");s.className="scalebun-code";let i=e.doc.createElement("div");i.className="scalebun-code-bar";let o=e.doc.createElement("span");o.className="scalebun-code-lang",o.textContent=r||"code";let a=e.doc.createElement("button");a.type="button",a.className="scalebun-code-copy",a.textContent="Copy",a.addEventListener("click",async()=>{var m,h,b;let f=!1;try{typeof navigator!="undefined"&&navigator.clipboard&&(await navigator.clipboard.writeText(t),f=!0)}catch{f=!1}if(!f){let k=e.doc.createRange();k.selectNodeContents(c);let x=(h=(m=e.doc).getSelection)==null?void 0:h.call(m);x==null||x.removeAllRanges(),x==null||x.addRange(k)}a.textContent=f?"Copied":"Select all",(b=e.onInteraction)==null||b.call(e,"code_copy"),setTimeout(()=>a.textContent="Copy",1500)}),i.append(o,a);let c=e.doc.createElement("pre");c.className="scalebun-code-pre";let l=e.doc.createElement("code");return l.textContent=t,c.appendChild(l),s.append(i,c),s}});var Gr={};_(Gr,{chartRenderer:()=>Kw,sparklineRenderer:()=>Vw,statRenderer:()=>Ww});function Lp(n,e,t){let r=n.createElementNS(xo,"svg");return r.setAttribute("viewBox",`0 0 ${e} ${t}`),r.setAttribute("width",String(e)),r.setAttribute("height",String(t)),r}var xo,Pp,Vw,Ww,Kw,Yr=S(()=>{"use strict";xo="http://www.w3.org/2000/svg",Pp=n=>Array.isArray(n)?n.map(Number).filter(e=>Number.isFinite(e)):[];Vw=(n,e)=>{var p;let t=Pp((p=n.props)==null?void 0:p.values),r=e.doc.createElement("div");if(r.className="scalebun-spark",t.length<2)return r;let s=160,i=40,o=Math.min(...t),c=Math.max(...t)-o||1,l=t.map((f,m)=>`${m/(t.length-1)*s},${i-(f-o)/c*(i-4)-2}`).join(" "),u=Lp(e.doc,s,i),d=e.doc.createElementNS(xo,"polyline");return d.setAttribute("points",l),d.setAttribute("fill","none"),d.setAttribute("stroke","var(--scalebun-accent)"),d.setAttribute("stroke-width","2"),d.setAttribute("stroke-linejoin","round"),u.appendChild(d),r.appendChild(u),r},Ww=(n,e)=>{var i,o,a,c;let t=e.doc.createElement("div");t.className="scalebun-stat";let r=e.doc.createElement("div");if(r.className="scalebun-stat-value",r.textContent=String((o=(i=n.props)==null?void 0:i.value)!=null?o:"\u2014"),t.appendChild(r),((a=n.props)==null?void 0:a.label)!=null){let l=e.doc.createElement("div");l.className="scalebun-stat-label",l.textContent=String(n.props.label),t.appendChild(l)}let s=(c=n.props)==null?void 0:c.delta;if(s!=null){let l=e.doc.createElement("div"),u=Number(s);l.className="scalebun-stat-delta "+(u>=0?"up":"down"),l.textContent=`${u>=0?"\u25B2":"\u25BC"} ${Math.abs(u)}`,t.appendChild(l)}return t},Kw=(n,e)=>{var l;let t=Pp((l=n.props)==null?void 0:l.values),r=e.doc.createElement("div");if(r.className="scalebun-chart",t.length===0)return r;let s=240,i=100,o=Math.max(...t)||1,a=s/t.length,c=Lp(e.doc,s,i);return t.forEach((u,d)=>{let p=e.doc.createElementNS(xo,"rect"),f=u/o*(i-4);p.setAttribute("x",String(d*a+2)),p.setAttribute("y",String(i-f)),p.setAttribute("width",String(a-4)),p.setAttribute("height",String(f)),p.setAttribute("rx","2"),p.setAttribute("fill","var(--scalebun-accent)"),c.appendChild(p)}),r.appendChild(c),r}});var _p={};_(_p,{tableRenderer:()=>jw});var jw,Op=S(()=>{"use strict";jw=(n,e)=>{var o,a;let t=Array.isArray((o=n.props)==null?void 0:o.columns)?n.props.columns.map(String):[],r=Array.isArray((a=n.props)==null?void 0:a.rows)?n.props.rows:[],s=e.doc.createElement("table");if(s.className="scalebun-table",t.length){let c=e.doc.createElement("thead"),l=e.doc.createElement("tr");for(let u of t){let d=e.doc.createElement("th");d.textContent=u,l.appendChild(d)}c.appendChild(l),s.appendChild(c)}let i=e.doc.createElement("tbody");for(let c of r){let l=e.doc.createElement("tr");for(let u of Array.isArray(c)?c:[c]){let d=e.doc.createElement("td");d.textContent=u==null?"":String(u),l.appendChild(d)}i.appendChild(l)}return s.appendChild(i),s}});var Np={};_(Np,{videoRenderer:()=>Gw});var Gw,Bp=S(()=>{"use strict";Gw=(n,e)=>{var c,l;let t=typeof((c=n.props)==null?void 0:c.src)=="string"?n.props.src:"",r=typeof((l=n.props)==null?void 0:l.poster)=="string"?n.props.poster:"",s=e.doc.createElement("div");if(s.className="scalebun-video",!t)return s;let i=()=>{var d;s.replaceChildren();let u=e.doc.createElement("video");u.className="scalebun-video-el",u.src=t,u.controls=!0,u.autoplay=!0,u.playsInline=!0,s.appendChild(u),(d=e.onInteraction)==null||d.call(e,"video_play")},o=e.doc.createElement("button");if(o.type="button",o.className="scalebun-video-poster",o.setAttribute("aria-label","Play video"),r){let u=e.doc.createElement("img");u.src=r,u.alt="",u.loading="lazy",o.appendChild(u)}let a=e.doc.createElement("span");return a.className="scalebun-video-play",a.textContent="\u25B6",o.appendChild(a),o.addEventListener("click",i),s.appendChild(o),s}});var Fp={};_(Fp,{countdownRenderer:()=>Xw});function Yw(n,e){let t=n==null?void 0:n.target;if(typeof t=="number")return t;if(typeof t=="string"){let s=Date.parse(t);if(!Number.isNaN(s))return s}let r=Number(n==null?void 0:n.durationMs);return e+(Number.isFinite(r)&&r>0?r:24*36e5)}var Xr,Xw,Dp=S(()=>{"use strict";Xr=n=>String(Math.max(0,n)).padStart(2,"0"),Xw=(n,e)=>{let t=e.doc.createElement("div");t.className="scalebun-countdown";let r=()=>typeof Date!="undefined"?Date.now():0,s=Yw(n.props,r()),i=[];for(let a of["Days","Hrs","Min","Sec"]){let c=e.doc.createElement("div");c.className="scalebun-cd-cell";let l=e.doc.createElement("div");l.className="scalebun-cd-num",l.textContent="00";let u=e.doc.createElement("div");u.className="scalebun-cd-lab",u.textContent=a,c.append(l,u),t.appendChild(c),i.push([a,l])}let o=()=>{let a=Math.max(0,s-r()),c=Math.floor(a/864e5);a-=c*864e5;let l=Math.floor(a/36e5);a-=l*36e5;let u=Math.floor(a/6e4);a-=u*6e4;let d=Math.floor(a/1e3);i[0][1].textContent=Xr(c),i[1][1].textContent=Xr(l),i[2][1].textContent=Xr(u),i[3][1].textContent=Xr(d)};if(o(),typeof setInterval!="undefined"){let a=setInterval(()=>{if(!t.isConnected){clearInterval(a);return}o()},1e3)}return t}});var qp={};_(qp,{carouselRenderer:()=>Jw});var So,Jw,Hp=S(()=>{"use strict";So=n=>typeof n=="string"&&n?n:void 0,Jw=(n,e)=>{var c,l;let t=Array.isArray((c=n.props)==null?void 0:c.slides)?n.props.slides:[],r=e.doc.createElement("div");if(r.className="scalebun-carousel",t.length===0)return r;let s=e.doc.createElement("div");s.className="scalebun-car-track";let i=[];for(let u of t){let d=e.doc.createElement("div");d.className="scalebun-car-slide";let p=So(u.image);if(p){let f=e.doc.createElement("img");f.className="scalebun-car-img",f.src=p,f.alt="",f.loading="lazy",d.appendChild(f)}if(So(u.title)){let f=e.doc.createElement("div");f.className="scalebun-car-title",f.textContent=u.title,d.appendChild(f)}if(So(u.text)){let f=e.doc.createElement("div");f.className="scalebun-car-text",f.textContent=u.text,d.appendChild(f)}s.appendChild(d),i.push(d)}r.appendChild(s);let o=e.doc.createElement("div");o.className="scalebun-car-dots";let a=t.map((u,d)=>{let p=e.doc.createElement("button");return p.type="button",p.className="scalebun-car-dot"+(d===0?" on":""),p.setAttribute("aria-label",`Slide ${d+1}`),p.addEventListener("click",()=>i[d].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})),o.appendChild(p),p});if(r.appendChild(o),typeof IntersectionObserver!="undefined"){let u=new IntersectionObserver(d=>{for(let p of d)if(p.isIntersecting){let f=i.indexOf(p.target);a.forEach((m,h)=>m.classList.toggle("on",h===f))}},{root:s,threshold:.6});i.forEach(d=>u.observe(d))}return(l=e.onInteraction)==null||l.call(e,"carousel_view"),r}});var $p={};_($p,{productGridRenderer:()=>Qw});var Jr,Qw,zp=S(()=>{"use strict";Jr=n=>n==null?void 0:String(n),Qw=(n,e)=>{var s,i;let t=Array.isArray((s=n.props)==null?void 0:s.products)?n.props.products:Array.isArray((i=n.props)==null?void 0:i.items)?n.props.items:[],r=e.doc.createElement("div");return r.className="scalebun-pgrid",t.length===0||t.forEach((o,a)=>{var d;let c=e.doc.createElement("button");c.type="button",c.className="scalebun-pcard";let l=Jr(o.image);if(l){let p=e.doc.createElement("img");p.className="scalebun-pcard-img",p.src=l,p.alt="",p.loading="lazy",c.appendChild(p)}if(o.badge){let p=e.doc.createElement("span");p.className="scalebun-pcard-badge",p.textContent=Jr(o.badge),c.appendChild(p)}let u=e.doc.createElement("div");if(u.className="scalebun-pcard-title",u.textContent=(d=Jr(o.title))!=null?d:"",c.appendChild(u),o.price!=null){let p=e.doc.createElement("div");p.className="scalebun-pcard-price",p.textContent=Jr(o.price),c.appendChild(p)}c.addEventListener("click",()=>{var p,f;return(f=e.onInteraction)==null?void 0:f.call(e,`product_select:${(p=o.id)!=null?p:a}`)}),r.appendChild(c)}),r}});var Vp={};_(Vp,{confettiRenderer:()=>ex});function Zw(){try{return typeof matchMedia!="undefined"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Up,ex,Wp=S(()=>{"use strict";Up=["#6C5CE7","#f5b301","#2fa96b","#e0483d","#7c9dff","#ff8fab"];ex=(n,e)=>{var d,p;let t=e.doc.createElement("div");if(t.className="scalebun-confetti",Zw()||typeof requestAnimationFrame=="undefined")return t.classList.add("scalebun-confetti-static"),t.textContent="\u{1F389}",t;let r=e.doc.createElement("canvas");r.className="scalebun-confetti-canvas",t.appendChild(r);let s=r.getContext("2d");if(!s)return t;let i=Math.min(240,Math.max(40,Number((d=n.props)==null?void 0:d.count)||140)),o=[],a=()=>{let f=r.width;o=Array.from({length:i},(m,h)=>({x:f/2+(h-i/2),y:r.height*.25,vx:(h%20-10)*.6,vy:-4-h%7,rot:h,vr:(h%5-2)*.3,c:Up[h%Up.length],s:5+h%4}))};(()=>{var m;let f=(m=t.parentElement)!=null?m:t;r.width=f.clientWidth||360,r.height=f.clientHeight||240})(),a();let l=0,u=()=>{if(!t.isConnected)return;s.clearRect(0,0,r.width,r.height);let f=0;for(let m of o)m.vy+=.16,m.x+=m.vx,m.y+=m.vy,m.rot+=m.vr,m.y<r.height+12&&f++,s.save(),s.translate(m.x,m.y),s.rotate(m.rot),s.fillStyle=m.c,s.fillRect(-m.s/2,-m.s/2,m.s,m.s*.6),s.restore();l++,f>0&&l<240?requestAnimationFrame(u):s.clearRect(0,0,r.width,r.height)};return requestAnimationFrame(u),(p=e.onInteraction)==null||p.call(e,"celebration"),t}});function Ot(n,e,t,r={}){var o,a,c;(o=n.querySelector(".scalebun-game-note"))==null||o.remove();let s=e.createElement("div");s.className="scalebun-game-note",s.setAttribute("role","status");let i=e.createElement("span");if(i.textContent=(a=t.message)!=null?a:"Rewards are unavailable right now.",s.appendChild(i),t.retryable&&r.onRetry){let l=e.createElement("button");l.type="button",l.className="scalebun-game-retry",l.textContent=(c=r.retryLabel)!=null?c:"Try again",l.addEventListener("click",()=>{var u;s.remove(),(u=r.onRetry)==null||u.call(r)},{once:!0}),s.appendChild(l)}n.appendChild(s)}function Nt(n){var e;(e=n.querySelector(".scalebun-game-note"))==null||e.remove()}var Qr=S(()=>{"use strict"});var Gp={};_(Gp,{spinwheelRenderer:()=>rx});function Eo(n,e,t,r){let s=(r-90)*Math.PI/180;return{x:n+t*Math.cos(s),y:e+t*Math.sin(s)}}function nx(n,e,t,r,s){let i=Eo(n,e,t,s),o=Eo(n,e,t,r),a=s-r<=180?0:1;return`M ${n} ${e} L ${i.x} ${i.y} A ${t} ${t} 0 ${a} 0 ${o.x} ${o.y} Z`}function jp(){try{return typeof matchMedia!="undefined"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Kp,tx,ko,rx,Yp=S(()=>{"use strict";Qr();Kp=["#6C5CE7","#8b7bff","#5b4bd6","#a99cff","#4c3fb0","#7c6ef0"],tx=n=>{var e;return typeof n=="string"?n:String((e=n==null?void 0:n.label)!=null?e:"")};ko="http://www.w3.org/2000/svg",rx=(n,e)=>{var x,y;let t=(Array.isArray((x=n.props)==null?void 0:x.segments)?n.props.segments:[]).map(tx).filter(Boolean),r=t.length?t:["10% off","Free ship","Try again","20% off","$5 credit","Jackpot"],s=r.length,i=Math.max(0,Math.min(s-1,Number((y=n.props)==null?void 0:y.resultIndex)||0)),o=e.doc.createElement("div");o.className="scalebun-wheel";let a=220,c=a/2,l=a/2-4,u=360/s,d=e.doc.createElementNS(ko,"svg");d.setAttribute("viewBox",`0 0 ${a} ${a}`),d.setAttribute("width",String(a)),d.setAttribute("height",String(a)),d.setAttribute("class","scalebun-wheel-svg"),r.forEach((g,w)=>{let v=e.doc.createElementNS(ko,"path");v.setAttribute("d",nx(c,c,l,w*u,(w+1)*u)),v.setAttribute("fill",Kp[w%Kp.length]),d.appendChild(v);let E=Eo(c,c,l*.62,w*u+u/2),C=e.doc.createElementNS(ko,"text");C.setAttribute("x",String(E.x)),C.setAttribute("y",String(E.y)),C.setAttribute("fill","#fff"),C.setAttribute("font-size","10"),C.setAttribute("text-anchor","middle"),C.setAttribute("transform",`rotate(${w*u+u/2} ${E.x} ${E.y})`),C.textContent=g.slice(0,12),d.appendChild(C)});let p=e.doc.createElement("div");p.className="scalebun-wheel-pointer";let f=e.doc.createElement("button");f.type="button",f.className="scalebun-wheel-spin",f.textContent="SPIN";let m=!1,h=g=>360*5-(g*u+u/2),b=(g,w)=>{var C;let v=((C=w!=null?w:r[g])!=null?C:"").slice(0,14);if(jp()){d.style.transform=`rotate(${-(g*u+u/2)}deg)`,f.textContent=v;return}d.style.transition="transform 3.4s cubic-bezier(.17,.67,.16,.99)",d.style.transform=`rotate(${h(g)}deg)`;let E=()=>{f.textContent=v};d.addEventListener("transitionend",E,{once:!0}),setTimeout(E,3600)},k=g=>{m=!0,f.disabled=!0,Nt(o),jp()||(d.style.transition="transform 1.1s linear",d.style.transform="rotate(400deg)"),e.requestOutcome(g).then(w=>{var E,C,I;if(!w.ok){d.style.transition="",d.style.transform="",m=!1,f.disabled=!1,Ot(o,e.doc,w,{onRetry:()=>k(g+1)}),(E=e.onInteraction)==null||E.call(e,"spin_unavailable");return}let v=Math.max(0,Math.min(s-1,Number((C=w.index)!=null?C:0)));(I=e.onInteraction)==null||I.call(e,`spin:${v}`),b(v,w.label)})};return f.addEventListener("click",()=>{var g;if(!m){if(e.requestOutcome){k(1);return}m=!0,(g=e.onInteraction)==null||g.call(e,`spin:${i}`),b(i)}}),o.append(p,d,f),o}});var Jp={};_(Jp,{scratchRenderer:()=>sx});function Xp(){try{return typeof matchMedia!="undefined"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var sx,Qp=S(()=>{"use strict";Qr();sx=(n,e)=>{var k,x;let t=typeof((k=n.props)==null?void 0:k.prize)=="string"?n.props.prize:"You won a prize!",r=((x=n.props)==null?void 0:x.reveal)==="box",s=e.doc.createElement("div");s.className=r?"scalebun-scratch scalebun-scratch-box":"scalebun-scratch";let i=e.doc.createElement("div");i.className="scalebun-scratch-prize",i.textContent=t,s.appendChild(i);let o=!1,a=()=>{o||!e.requestOutcome||(o=!0,e.requestOutcome(1).then(y=>{var g;if(y.ok){Nt(s),y.label&&(i.textContent=y.label);return}i.textContent="\u2014",Ot(s,e.doc,y,{onRetry:()=>{o=!1,a()}}),(g=e.onInteraction)==null||g.call(e,"reveal_unavailable")}))};if(r){if(Xp())return s;let y=e.doc.createElement("button");return y.type="button",y.className="scalebun-scratch-lid",y.setAttribute("aria-label","Open the mystery box"),y.textContent="\u{1F381}",y.addEventListener("click",()=>{var g;a(),y.setAttribute("data-open","true"),setTimeout(()=>y.remove(),320),(g=e.onInteraction)==null||g.call(e,"mystery_box_opened")},{once:!0}),s.appendChild(y),s}let c=e.doc.createElement("canvas");c.className="scalebun-scratch-cover";let l=c.getContext("2d");if(Xp()||!l)return c.remove(),s;s.appendChild(c);let u=300,d=90;c.width=u,c.height=d,l.fillStyle="#9aa3b2",l.fillRect(0,0,u,d),l.fillStyle="#6b7280",l.font="13px sans-serif",l.textAlign="center",l.fillText("Scratch here",u/2,d/2+4),l.globalCompositeOperation="destination-out";let p=!1,f=!1,m=(y,g)=>{l.beginPath(),l.arc(y,g,16,0,Math.PI*2),l.fill()},h=y=>{let g=c.getBoundingClientRect();return{x:(y.clientX-g.left)/g.width*u,y:(y.clientY-g.top)/g.height*d}},b=y=>{var w;if(!p)return;let g=h(y);m(g.x,g.y),f||(f=!0,a(),(w=e.onInteraction)==null||w.call(e,"scratch_reveal"))};return c.addEventListener("mousedown",y=>{p=!0;let g=h(y);m(g.x,g.y)}),e.doc.addEventListener("mouseup",()=>p=!1),c.addEventListener("mousemove",b),c.addEventListener("touchmove",y=>{var w;let g=y.touches[0];if(g){let v=h(g);m(v.x,v.y),f||(f=!0,a(),(w=e.onInteraction)==null||w.call(e,"scratch_reveal"))}}),s}});var Zp={};_(Zp,{slotRenderer:()=>ax});function ox(){try{return typeof matchMedia!="undefined"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var ix,ax,ef=S(()=>{"use strict";Qr();ix=["\u{1F352}","\u{1F514}","\u2B50","7\uFE0F\u20E3","\u{1F48E}","\u{1F340}"];ax=(n,e)=>{var p,f,m;let t=(Array.isArray((p=n.props)==null?void 0:p.symbols)?n.props.symbols.map(String):[]).filter(Boolean),r=t.length?t:ix,s=Array.isArray((f=n.props)==null?void 0:f.result)?n.props.result.slice(0,3).map(String):[r[0],r[0],r[0]],i=e.doc.createElement("div");i.className="scalebun-slot";let o=e.doc.createElement("div");o.className="scalebun-slot-reels";let a=[];for(let h=0;h<3;h++){let b=e.doc.createElement("div");b.className="scalebun-slot-reel";let k=e.doc.createElement("div");k.className="scalebun-slot-strip";for(let x of[...r,...r,(m=s[h])!=null?m:r[0]]){let y=e.doc.createElement("div");y.className="scalebun-slot-cell",y.textContent=x,k.appendChild(y)}b.appendChild(k),a.push(k),o.appendChild(b)}i.appendChild(o);let c=e.doc.createElement("button");c.type="button",c.className="scalebun-slot-spin scalebun-btn scalebun-btn-primary",c.textContent="Spin";let l=!1,u=()=>{a.forEach((b,k)=>{let x=(b.children.length-1)*44;ox()||(b.style.transition=`transform ${1.6+k*.35}s cubic-bezier(.15,.7,.15,1)`),b.style.transform=`translateY(-${x}px)`})},d=h=>{l=!0,c.disabled=!0,Nt(i),e.requestOutcome(h).then(b=>{var x,y,g;if(!b.ok){l=!1,c.disabled=!1,Ot(i,e.doc,b,{onRetry:()=>d(h+1)}),(x=e.onInteraction)==null||x.call(e,"slot_unavailable");return}let k=(y=b.symbols)!=null&&y.length?b.symbols:s;a.forEach((w,v)=>{var C,I;let E=w.children[w.children.length-1];E&&(E.textContent=(I=(C=k[v])!=null?C:s[v])!=null?I:r[0])}),(g=e.onInteraction)==null||g.call(e,`slot:${k.join("")}`),u()})};return c.addEventListener("click",()=>{var h;if(!l){if(e.requestOutcome){d(1);return}l=!0,(h=e.onInteraction)==null||h.call(e,`slot:${s.join("")}`),u()}}),i.appendChild(c),i}});var tf={};_(tf,{qrRenderer:()=>ux});function cx(n,e,t){let r=2166136261^e*73856093^t*19349663;for(let s=0;s<n.length;s++)r=(r^n.charCodeAt(s))*16777619;return((r>>>13^r)&1)===1}function lx(n,e){let t=(r,s)=>n>=r&&n<r+7&&e>=s&&e<s+7;return t(0,0)||t(18,0)||t(0,18)}function dx(n,e){let t=n<7?n:n>=18?n-18:-1,r=e<7?e:e>=18?e-18:-1;if(t<0||r<0)return!1;let s=t===0||t===6||r===0||r===6,i=t>=2&&t<=4&&r>=2&&r<=4;return s||i}var Io,ux,nf=S(()=>{"use strict";Io="http://www.w3.org/2000/svg";ux=(n,e)=>{var d;let t=typeof((d=n.props)==null?void 0:d.value)=="string"&&n.props.value?n.props.value:"https://app.example.com",r=e.doc.createElement("div");r.className="scalebun-qr";let s=160,i=2,o=25+i*2,a=s/o,c=e.doc.createElementNS(Io,"svg");c.setAttribute("viewBox",`0 0 ${s} ${s}`),c.setAttribute("width",String(s)),c.setAttribute("height",String(s)),c.setAttribute("class","scalebun-qr-svg");let l=e.doc.createElementNS(Io,"rect");l.setAttribute("width",String(s)),l.setAttribute("height",String(s)),l.setAttribute("fill","#ffffff"),c.appendChild(l);for(let p=0;p<25;p++)for(let f=0;f<25;f++){let m;if(lx(f,p)?m=dx(f,p):f===6||p===6?m=(f+p)%2===0:m=cx(t,f,p),!m)continue;let h=e.doc.createElementNS(Io,"rect");h.setAttribute("x",String((f+i)*a)),h.setAttribute("y",String((p+i)*a)),h.setAttribute("width",String(a+.5)),h.setAttribute("height",String(a+.5)),h.setAttribute("fill","#0b0d12"),c.appendChild(h)}r.appendChild(c);let u=e.doc.createElement("div");return u.className="scalebun-qr-cap",u.textContent=t.length>40?t.slice(0,39)+"\u2026":t,r.appendChild(u),r}});var rf={};_(rf,{streakRenderer:()=>px});var Co,px,sf=S(()=>{"use strict";Co=(n,e)=>{let t=Number(n);return Number.isFinite(t)?Math.trunc(t):e},px=(n,e)=>{var l;let t=(l=n.props)!=null?l:{},r=t.mode==="checkin",s=Array.isArray(t.labels)?t.labels.map(u=>String(u!=null?u:"")):[],i=Math.max(1,Math.min(31,Co(t.days,s.length||7))),o=Math.max(0,Math.min(i,Co(t.filled,0))),a=r?Math.max(0,Math.min(i,Co(t.today,o+1))):0,c=e.doc.createElement("div");c.className=r?"scalebun-streak scalebun-streak-checkin":"scalebun-streak",c.setAttribute("role","group"),c.setAttribute("aria-label",r?`Checked in ${o} of ${i} days`:`${o} day streak of ${i}`);for(let u=1;u<=i;u++){let d=u<=o,p=u===a&&!d,f=e.doc.createElement(p?"button":"div");f.className="scalebun-streak-day",f.setAttribute("data-done",d?"true":"false"),p&&(f.type="button",f.setAttribute("data-today","true"));let m=e.doc.createElement("span");m.className="scalebun-streak-mark",m.setAttribute("aria-hidden","true"),m.textContent=d?r?"\u2713":"\u{1F525}":"",f.appendChild(m);let h=s[u-1];if(h){let b=e.doc.createElement("span");b.className="scalebun-streak-label",b.textContent=h,f.appendChild(b)}f.setAttribute("aria-label",`${h||`Day ${u}`} \u2014 ${d?"done":p?"today":"not done"}`),p&&f.addEventListener("click",()=>{var b;return(b=e.onInteraction)==null?void 0:b.call(e,`check_in:${u}`)},{once:!0}),c.appendChild(f)}return c}});var cf={};_(cf,{nextStepIndex:()=>af,stepLabels:()=>of,stepsRenderer:()=>mx});function of(n){var t,r,s,i,o,a;let e=n!=null?n:{};return{back:(t=He(e.backLabel))!=null?t:"Back",skip:(s=(r=He(e.skipLabel))!=null?r:He(e.secondaryLabel))!=null?s:"Skip",next:(i=He(e.nextLabel))!=null?i:"Next",finish:(a=(o=He(e.finalLabel))!=null?o:He(e.ctaLabel))!=null?a:"Finish"}}function af(n,e,t){return e<=0?0:Math.max(0,Math.min(n+(t==="next"?1:-1),e-1))}function fx(n){let e=n==null?void 0:n.steps,r=(Array.isArray(e)?e:[]).map(s=>{var o,a;if(typeof s=="string")return{title:s};let i=s&&typeof s=="object"?s:{};return{title:(o=He(i.title))!=null?o:He(i.label),body:(a=He(i.body))!=null?a:He(i.text)}});return r.length?r:[{}]}var He,mx,lf=S(()=>{"use strict";He=n=>typeof n=="string"&&n.trim()?n.trim():void 0;mx=(n,e)=>{let t=n.props,r=fx(t),s=of(t),i=e.doc,o=0,a=i.createElement("div");a.className="scalebun-steps";let c=i.createElement("div");c.className="scalebun-steps-rail",c.setAttribute("role","progressbar"),c.setAttribute("aria-valuemin","1"),c.setAttribute("aria-valuemax",String(r.length));let l=r.map(()=>{let g=i.createElement("span");return g.className="scalebun-steps-dot",c.appendChild(g),g});a.appendChild(c);let u=i.createElement("div");u.className="scalebun-steps-page";let d=i.createElement("div");d.className="scalebun-steps-title";let p=i.createElement("div");p.className="scalebun-steps-body",u.appendChild(d),u.appendChild(p),a.appendChild(u);let f=i.createElement("div");f.className="scalebun-steps-nav";let m=(g,w)=>{let v=i.createElement("button");return v.type="button",v.className=`scalebun-btn ${w}`,v.textContent=g,f.appendChild(v),v},h=m(s.back,"scalebun-btn-ghost"),b=m(s.skip,"scalebun-btn-ghost"),k=m(s.next,"scalebun-btn-primary");a.appendChild(f);let x=()=>{var v,E,C;let g=(v=r[o])!=null?v:{};d.textContent=(E=g.title)!=null?E:"",d.style.display=g.title?"":"none",p.textContent=(C=g.body)!=null?C:"",p.style.display=g.body?"":"none";let w=o+1>=r.length;k.textContent=w?s.finish:s.next,h.hidden=o===0,b.hidden=w,c.setAttribute("aria-valuenow",String(o+1)),c.setAttribute("aria-label",`Step ${o+1} of ${r.length}`),l.forEach((I,R)=>{I.setAttribute("data-state",R<o?"done":R===o?"current":"todo"),R===o?I.setAttribute("aria-current","step"):I.removeAttribute("aria-current")})},y=g=>{var v;let w=af(o,r.length,g);w!==o&&(o=w,x(),(v=e.onInteraction)==null||v.call(e,`step-${o+1}`))};return h.addEventListener("click",()=>y("back")),b.addEventListener("click",()=>{var g;return(g=e.onInteraction)==null?void 0:g.call(e,"step-skip")}),k.addEventListener("click",()=>{var g;if(o+1>=r.length){(g=e.onInteraction)==null||g.call(e,"step-finish");return}y("next")}),x(),a}});async function df(n){let e=new Set;for(let t of n)Ao[t]&&!Vr[t]&&e.add(t);await Promise.all([...e].map(async t=>{try{Vr[t]=await Ao[t]()}catch{}}))}var Ao,rT,uf=S(()=>{"use strict";Kr();Ao={markdown:()=>Promise.resolve().then(()=>(Tp(),Ap)).then(n=>n.markdownRenderer),code:()=>Promise.resolve().then(()=>(Mp(),Rp)).then(n=>n.codeRenderer),chart:()=>Promise.resolve().then(()=>(Yr(),Gr)).then(n=>n.chartRenderer),sparkline:()=>Promise.resolve().then(()=>(Yr(),Gr)).then(n=>n.sparklineRenderer),stat:()=>Promise.resolve().then(()=>(Yr(),Gr)).then(n=>n.statRenderer),table:()=>Promise.resolve().then(()=>(Op(),_p)).then(n=>n.tableRenderer),video:()=>Promise.resolve().then(()=>(Bp(),Np)).then(n=>n.videoRenderer),countdown:()=>Promise.resolve().then(()=>(Dp(),Fp)).then(n=>n.countdownRenderer),carousel:()=>Promise.resolve().then(()=>(Hp(),qp)).then(n=>n.carouselRenderer),"product-grid":()=>Promise.resolve().then(()=>(zp(),$p)).then(n=>n.productGridRenderer),confetti:()=>Promise.resolve().then(()=>(Wp(),Vp)).then(n=>n.confettiRenderer),spinwheel:()=>Promise.resolve().then(()=>(Yp(),Gp)).then(n=>n.spinwheelRenderer),scratch:()=>Promise.resolve().then(()=>(Qp(),Jp)).then(n=>n.scratchRenderer),slot:()=>Promise.resolve().then(()=>(ef(),Zp)).then(n=>n.slotRenderer),qr:()=>Promise.resolve().then(()=>(nf(),tf)).then(n=>n.qrRenderer),streak:()=>Promise.resolve().then(()=>(sf(),rf)).then(n=>n.streakRenderer),steps:()=>Promise.resolve().then(()=>(lf(),cf)).then(n=>n.stepsRenderer)},rT=Object.keys(Ao)});var pf={};_(pf,{bannerSurface:()=>hx});function hx(n){var o,a,c,l,u,d,p;let{doc:e,variant:t}=n,r=((o=t.surfaceOptions)==null?void 0:o.placement)==="bottom",s=e.createElement("div");s.className="scalebun-banner"+(r?" scalebun-banner-bottom":""),s.setAttribute("role",(c=(a=t.a11y)==null?void 0:a.role)!=null?c:"region"),s.setAttribute("aria-live",(u=(l=t.a11y)==null?void 0:l.liveRegion)!=null?u:"polite"),(d=t.a11y)!=null&&d.labelledBy&&s.setAttribute("aria-label",t.a11y.labelledBy);let i=e.createElement("div");i.className="scalebun-body";for(let f of oe(n))i.appendChild(f);if(s.appendChild(i),((p=t.dismiss)==null?void 0:p.xButton)!==!1){let f=e.createElement("button");f.type="button",f.className="scalebun-x",f.setAttribute("aria-label","Dismiss"),f.textContent="\xD7",f.addEventListener("click",()=>n.requestClose("x")),s.appendChild(f)}return{el:s,destroy:()=>s.remove()}}var ff=S(()=>{"use strict";Re()});var mf={};_(mf,{toastSurface:()=>gx});function gx(n){var l,u,d,p,f,m;let{doc:e,variant:t}=n,r=e.createElement("div");r.className="scalebun-toast",r.setAttribute("role",(u=(l=t.a11y)==null?void 0:l.role)!=null?u:"status"),r.setAttribute("aria-live",(p=(d=t.a11y)==null?void 0:d.liveRegion)!=null?p:"polite");let s=e.createElement("div");s.className="scalebun-body";for(let h of oe(n))s.appendChild(h);if(r.appendChild(s),((f=t.dismiss)==null?void 0:f.xButton)!==!1){let h=e.createElement("button");h.type="button",h.className="scalebun-x",h.setAttribute("aria-label","Dismiss"),h.textContent="\xD7",h.addEventListener("click",()=>n.requestClose("x")),r.appendChild(h)}let i=null,o=(m=t.dismiss)==null?void 0:m.autoDismissMs,a=()=>{o&&o>0&&(i=setTimeout(()=>n.requestClose("auto"),o))},c=()=>{i!=null&&(clearTimeout(i),i=null)};return o&&o>0&&(r.addEventListener("mouseenter",c),r.addEventListener("mouseleave",a),a()),{el:r,destroy:()=>{c(),r.remove()}}}var hf=S(()=>{"use strict";Re()});function yx(n){if(n.hasAttribute("hidden")||n.getAttribute("aria-hidden")==="true"||n.closest("[inert]"))return!1;if(typeof getComputedStyle!="undefined"){let e=getComputedStyle(n);if(e.display==="none"||e.visibility==="hidden")return!1}return!0}function gf(n){return Array.from(n.querySelectorAll(bx)).filter(yx)}function vx(n){var t;return(t=n.getRootNode().activeElement)!=null?t:null}function Bt(n,e=document){let t=r=>{if(r.key!=="Tab")return;let s=gf(n);if(s.length===0){r.preventDefault(),n.focus();return}let i=vx(n),o=i?s.indexOf(i):-1;r.preventDefault(),r.shiftKey?o=o<=0?s.length-1:o-1:o=o===-1||o>=s.length-1?0:o+1,s[o].focus()};return n.addEventListener("keydown",t),()=>n.removeEventListener("keydown",t)}function Zr(n){let e=gf(n);e.length?e[0].focus():(n.setAttribute("tabindex","-1"),n.focus())}function es(n,e=document){let t=e.body;if(!t)return()=>{};let r=[];for(let s of Array.from(t.children))s===n||s.contains(n)||(r.push({el:s,hadInert:s.hasAttribute("inert"),ariaWas:s.getAttribute("aria-hidden")}),s.setAttribute("inert",""),s.setAttribute("aria-hidden","true"));return()=>{for(let{el:s,hadInert:i,ariaWas:o}of r)i||s.removeAttribute("inert"),o==null?s.removeAttribute("aria-hidden"):s.setAttribute("aria-hidden",o)}}function Ft(n=document){let e=n.activeElement;return()=>{var t;try{(t=e==null?void 0:e.focus)==null||t.call(e)}catch{}}}var bx,ts=S(()=>{"use strict";bx=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",")});var bf={};_(bf,{modalSurface:()=>xx});function xx(n){var h,b,k,x,y,g,w;let{doc:e,variant:t}=n,r=(h=t.a11y)!=null?h:{},s=(b=t.dismiss)!=null?b:{},i=Ft(e),o=e.createElement("div");o.className="scalebun-backdrop";let a=e.createElement("div");a.className="scalebun-modal-card",a.setAttribute("role",(k=r.role)!=null?k:"dialog"),a.setAttribute("aria-modal","true");let c=(y=(x=t.surfaceOptions)==null?void 0:x.size)!=null?y:"md";a.setAttribute("data-size",c);let l=oe(n),u=l.find(v=>v.classList.contains("scalebun-h"));if(u){let v=`scalebun-mt-${++wx}`;u.id=v,a.setAttribute("aria-labelledby",v)}else a.setAttribute("aria-label",t.name);if(s.xButton!==!1){let v=e.createElement("button");v.type="button",v.className="scalebun-x scalebun-modal-x",v.setAttribute("aria-label","Close dialog"),v.textContent="\xD7",v.addEventListener("click",()=>n.requestClose("x")),a.appendChild(v)}for(let v of l)a.appendChild(v);o.appendChild(a),s.backdropClose&&o.addEventListener("mousedown",v=>{v.target===o&&n.requestClose("backdrop")});let d=v=>{v.key==="Escape"&&s.escClose!==!1&&(v.stopPropagation(),n.requestClose("esc"))};o.addEventListener("keydown",d);let p=Bt(a,e),f=(w=(g=n.host.shadowRoot)==null?void 0:g.host)!=null?w:o,m=es(f,e);return{el:o,afterMount:()=>Zr(a),destroy:()=>{p(),m(),o.removeEventListener("keydown",d),o.remove(),i()}}}var wx,yf=S(()=>{"use strict";Re();ts();wx=0});var Sf={};_(Sf,{slideoverSurface:()=>Ex});function Sx(n,e){try{let t=localStorage.getItem(xf(n)),r=t?Number(t):NaN;return Number.isFinite(r)?Math.min(wf,Math.max(vf,r)):e}catch{return e}}function kx(n,e){try{localStorage.setItem(xf(n),String(Math.round(e)))}catch{}}function Ex(n){var b,k,x,y,g,w,v,E,C,I;let{doc:e,variant:t}=n,r=(b=t.surfaceOptions)==null?void 0:b.placement,s=r==="bottom",i=r==="left",o=!s&&((k=t.surfaceOptions)==null?void 0:k.resizable)!==!1,a=!!((x=t.surfaceOptions)!=null&&x.pinnable),c=e.createElement("div");c.className="scalebun-slideover "+(s?"scalebun-slideover-bottom":i?"scalebun-slideover-left":"scalebun-slideover-right"),c.setAttribute("role",(g=(y=t.a11y)==null?void 0:y.role)!=null?g:s?"dialog":"complementary"),c.setAttribute("aria-label",(v=(w=t.a11y)==null?void 0:w.labelledBy)!=null?v:t.name);let l=Sx(t.id,(C=(E=t.surfaceOptions)==null?void 0:E.maxWidth)!=null?C:380),u=()=>{s||(c.style.width=`${l}px`)};u();let d=e.createElement("div");if(d.className="scalebun-so-header",a){let R=e.createElement("button");R.type="button",R.className="scalebun-x scalebun-so-pin";let T=`scalebun_inapp_slideover_pin_${t.id}`,A=!1;try{A=localStorage.getItem(T)==="1"}catch{}let P=()=>{c.setAttribute("data-pinned",A?"true":"false"),R.setAttribute("aria-pressed",A?"true":"false"),R.title=A?"Unpin":"Pin",R.textContent=A?"\u{1F4CC}":"\u{1F4CD}"};R.addEventListener("click",()=>{A=!A;try{localStorage.setItem(T,A?"1":"0")}catch{}P()}),P(),d.appendChild(R)}if(((I=t.dismiss)==null?void 0:I.xButton)!==!1){let R=e.createElement("button");R.type="button",R.className="scalebun-x",R.setAttribute("aria-label","Close panel"),R.textContent="\xD7",R.addEventListener("click",()=>n.requestClose("x")),d.appendChild(R)}c.appendChild(d);let p=e.createElement("div");p.className="scalebun-so-body";for(let R of oe(n))p.appendChild(R);c.appendChild(p);let f=null,m=null;if(o){let R=e.createElement("div");R.className="scalebun-so-resize",R.setAttribute("role","separator"),R.setAttribute("aria-orientation","vertical"),R.addEventListener("mousedown",T=>{T.preventDefault();let A=T.clientX,P=l;f=$=>{let D=i?$.clientX-A:A-$.clientX;l=Math.min(wf,Math.max(vf,P+D)),u()},m=()=>{kx(t.id,l),h()},e.addEventListener("mousemove",f),e.addEventListener("mouseup",m)}),c.appendChild(R)}let h=()=>{f&&e.removeEventListener("mousemove",f),m&&e.removeEventListener("mouseup",m),f=m=null};return{el:c,destroy:()=>{h(),c.remove()}}}var vf,wf,xf,kf=S(()=>{"use strict";Re();vf=280,wf=640,xf=n=>`scalebun_inapp_slideover_${n}`});function Ef(n){return typeof CSS!="undefined"&&CSS.escape?CSS.escape(n):n.replace(/["\\]/g,"\\$&")}function cn(n,e,t,r=[]){try{for(let s of[...n.querySelectorAll(e)])r.push(s)}catch{}if(t)for(let s of[...n.querySelectorAll("*")]){let i=s.shadowRoot;i&&cn(i,e,t,r)}return r}function To(n,e,t){let r=null;try{r=n.querySelector(e)}catch{return null}if(r)return r;if(!t)return null;for(let s of[...n.querySelectorAll("*")]){let i=s.shadowRoot;if(i){let o=To(i,e,!0);if(o)return o}}return null}function Ix(n,e,t,r){let s=e.trim(),i=cn(n,t!=null?t:"*",r).filter(o=>{var a;return((a=o.textContent)!=null?a:"").trim()===s});return i.length?i.reduce((o,a)=>a.querySelectorAll("*").length<o.querySelectorAll("*").length?a:o):null}function Cx(n,e,t,r){var a,c;let s=e?`[role="${Ef(e)}"]`:"button,a,[role],input,select,textarea,summary",i=cn(n,s,r);if(!t)return(a=i[0])!=null?a:null;let o=t.trim();return(c=i.find(l=>{var u,d;return((d=(u=l.getAttribute("aria-label"))!=null?u:l.textContent)!=null?d:"").trim()===o}))!=null?c:null}function Ax(n){var e;if(typeof document=="undefined"||!document.evaluate)return null;try{return(e=document.evaluate(n,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue)!=null?e:null}catch{return null}}function Tx(n,e,t){var r;switch(n.kind){case"selector":return To(e,n.value,t);case"data-attr":return To(e,`[data-scalebun-anchor="${Ef(n.value)}"]`,t);case"nth":return(r=cn(e,n.selector,t)[n.index])!=null?r:null;case"text":return Ix(e,n.value,n.scope,t);case"aria":return Cx(e,n.role,n.name,t);case"xpath":return Ax(n.value)}}function If(n=typeof document!="undefined"?document:void 0,e=200){var r;if(!n)return[];let t=new Set;for(let s of cn(n,"[data-scalebun-anchor]",!0)){let i=(r=s.getAttribute("data-scalebun-anchor"))==null?void 0:r.trim();if(i&&t.add(i),t.size>=e)break}return[...t].sort()}function ft(n,e=typeof document!="undefined"?document:void 0){let t=n.shadowPiercing!==!1,r=0;for(let s=0;s<n.strategies.length;s++){r++;let i=e?Tx(n.strategies[s],e,t):null;if(i)return{el:i,strategyIndex:s,strategiesTried:r}}return{el:null,strategyIndex:-1,strategiesTried:r}}function Cf(n){return n.el!=null&&n.strategyIndex>0}var ns=S(()=>{"use strict"});function Ro(n,e,t){switch(n){case"top":return e.y-t.y;case"bottom":return t.y+t.height-(e.y+e.height);case"left":return e.x-t.x;case"right":return t.x+t.width-(e.x+e.width)}}function Af(n,e,t,r,s){let i=(ln(n)?t.height:t.width)+s;return Ro(n,e,r)>=i}function rs(n,e,t){return t<e?e:Math.min(t,Math.max(e,n))}function ss(n){var h,b,k,x;let e=(h=n.offset)!=null?h:8,t=(b=n.padding)!=null?b:8,r=(k=n.arrowSize)!=null?k:8,s=n.anchor,i=n.tooltip,o=n.boundary,a=(x=n.preferred)!=null?x:{side:"bottom",align:"center"},c=a.side,l=!1;if(!Af(c,s,i,o,e)){let y=Rx[c];(Af(y,s,i,o,e)||Ro(y,s,o)>Ro(c,s,o))&&(c=y,l=!0)}let u=a.align;n.rtl&&ln(c)&&(u=u==="start"?"end":u==="end"?"start":"center");let d=0,p=0;ln(c)?(p=c==="top"?s.y-i.height-e:s.y+s.height+e,d=u==="start"?s.x:u==="end"?s.x+s.width-i.width:s.x+s.width/2-i.width/2):(d=c==="left"?s.x-i.width-e:s.x+s.width+e,p=u==="start"?s.y:u==="end"?s.y+s.height-i.height:s.y+s.height/2-i.height/2);let f=!1;if(ln(c)){let y=rs(d,o.x+t,o.x+o.width-t-i.width);y!==d&&(f=!0,d=y)}else{let y=rs(p,o.y+t,o.y+o.height-t-i.height);y!==p&&(f=!0,p=y)}let m={x:0,y:0};return ln(c)?(m.x=rs(s.x+s.width/2-d,r,i.width-r),m.y=c==="top"?i.height:0):(m.y=rs(s.y+s.height/2-p,r,i.height-r),m.x=c==="left"?i.width:0),{placement:{side:c,align:u},x:d,y:p,arrow:m,flipped:l,shifted:f}}var Rx,ln,Mo=S(()=>{"use strict";Rx={top:"bottom",bottom:"top",left:"right",right:"left"},ln=n=>n==="top"||n==="bottom"});var nt,is=S(()=>{"use strict";nt=class{constructor(){this.mo=null;this.subs=new Set;this.scheduled=!1}start(){this.mo||typeof MutationObserver=="undefined"||typeof document=="undefined"||(this.mo=new MutationObserver(()=>this.notify()),this.mo.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0}))}onChange(e){return this.subs.add(e),this.start(),()=>{this.subs.delete(e),this.subs.size||this.dispose()}}notify(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1;for(let e of[...this.subs])try{e()}catch{}}))}dispose(){var e;(e=this.mo)==null||e.disconnect(),this.mo=null,this.subs.clear()}}});function Mx(){return{x:0,y:0,width:typeof innerWidth!="undefined"?innerWidth:1024,height:typeof innerHeight!="undefined"?innerHeight:768}}function $e(n){let e=[{kind:"selector",value:n}],t=n.match(/^\[data-scalebun-anchor=["']?([^"'\]]+)["']?\]$/);return t&&e.push({kind:"data-attr",value:t[1]}),{strategies:e,shadowPiercing:!0}}function Tf(n){var r,s,i,o;let e=(r=n==null?void 0:n.strategies)!=null?r:[],t=(s=e.find(a=>a.kind==="selector"))!=null?s:e[0];if(!t)return"";switch(t.kind){case"selector":case"data-attr":case"text":case"xpath":return t.value;case"nth":return`${t.selector}[${t.index}]`;case"aria":return`aria:${(i=t.role)!=null?i:"*"}/${(o=t.name)!=null?o:"*"}`}}var Me,Dt=S(()=>{"use strict";ns();Mo();is();Me=class{constructor(e){this.opts=e;this.raf=null;this.lostTimer=null;this.lastStrategy=-1;this.hadEl=!1;this.missed=!1;var t,r;this.hub=(t=e.hub)!=null?t:new nt,this.ownHub=!e.hub,this.now=(r=e.now)!=null?r:()=>Date.now()}start(){this.reposition(),this.unsubMo=this.hub.onChange(()=>this.reposition()),this.onScrollResize=()=>this.schedule(),typeof window!="undefined"&&(window.addEventListener("scroll",this.onScrollResize,!0),window.addEventListener("resize",this.onScrollResize))}reposition(){var t,r,s,i,o,a;let e=ft(this.opts.spec);if(e.el){this.clearLost(),this.hadEl||(r=(t=this.opts.hooks).onFound)==null||r.call(t,e.el),Cf(e)&&e.strategyIndex!==this.lastStrategy&&((i=(s=this.opts.hooks).onHeal)==null||i.call(s,e.strategyIndex)),this.lastStrategy=e.strategyIndex,this.hadEl=!0,this.missed=!1;let c=e.el.getBoundingClientRect(),l=ss({anchor:{x:c.x,y:c.y,width:c.width,height:c.height},tooltip:this.opts.size(),boundary:Mx(),preferred:this.opts.preferred,offset:this.opts.offset});this.opts.hooks.onReposition(l,e.el)}else this.missed||(this.missed=!0,(a=(o=this.opts.hooks).onMiss)==null||a.call(o)),this.hadEl=!1,this.armLost()}schedule(){if(this.raf!=null)return;let e=()=>{this.raf=null,this.reposition()};this.raf=typeof requestAnimationFrame!="undefined"?requestAnimationFrame(e):setTimeout(e,16)}armLost(){var e;this.lostTimer==null&&(this.lostTimer=setTimeout(()=>{var t,r;this.lostTimer=null,ft(this.opts.spec).el==null&&(this.hadEl=!1,(r=(t=this.opts.hooks).onLost)==null||r.call(t,"not-found"))},(e=this.opts.graceMs)!=null?e:1500))}clearLost(){this.lostTimer!=null&&(clearTimeout(this.lostTimer),this.lostTimer=null)}stop(){var e;(e=this.unsubMo)==null||e.call(this),this.unsubMo=void 0,this.onScrollResize&&typeof window!="undefined"&&(window.removeEventListener("scroll",this.onScrollResize,!0),window.removeEventListener("resize",this.onScrollResize)),this.onScrollResize=void 0,this.raf!=null&&typeof cancelAnimationFrame!="undefined"&&cancelAnimationFrame(this.raf),this.raf=null,this.clearLost(),this.ownHub&&this.hub.dispose()}}});var Rf={};_(Rf,{popoverSurface:()=>_x});function Px(n){var e,t,r;return(r=(e=n.variant.targeting)==null?void 0:e.element)!=null?r:(t=n.variant.triggers.find(s=>(s.type==="element"||s.type==="hover")&&s.match))==null?void 0:t.match}function Lx(n){var t;let e=(t=n.variant.surfaceOptions)==null?void 0:t.placement;return e==="top"||e==="left"||e==="right"?e:"bottom"}function _x(n){var c,l,u,d,p;let{doc:e,variant:t}=n,r=Px(n),s=e.createElement("div");s.className="scalebun-popover",s.setAttribute("role",(l=(c=t.a11y)==null?void 0:c.role)!=null?l:"dialog"),s.setAttribute("aria-label",t.name),s.style.position="absolute";let i=(u=t.surfaceOptions)==null?void 0:u.maxWidth;if(i&&(s.style.maxWidth=`${i}px`),((d=t.dismiss)==null?void 0:d.xButton)!==!1){let f=e.createElement("button");f.type="button",f.className="scalebun-x scalebun-pop-x",f.setAttribute("aria-label","Dismiss"),f.textContent="\xD7",f.addEventListener("click",()=>n.requestClose("x")),s.appendChild(f)}let o=e.createElement("div");o.className="scalebun-pop-body";for(let f of oe(n))o.appendChild(f);s.appendChild(o);let a=r?new Me({spec:$e(r),size:()=>({width:s.offsetWidth||320,height:s.offsetHeight||120}),preferred:{side:Lx(n),align:"center"},offset:(p=t.surfaceOptions)==null?void 0:p.offset,hooks:{onReposition:f=>{s.style.top=`${f.y}px`,s.style.left=`${f.x}px`,s.setAttribute("data-placement",f.placement.side)},onHeal:()=>{var f;return(f=n.metrics)==null?void 0:f.recordAnchorRetry()},onMiss:()=>{var f;return(f=n.metrics)==null?void 0:f.recordFailedSelector(r)},onLost:()=>n.requestClose("auto")}}):null;return{el:s,afterMount:()=>a==null?void 0:a.start(),destroy:()=>{a==null||a.stop(),s.remove()}}}var Mf=S(()=>{"use strict";Re();Dt()});var Pf={};_(Pf,{coachmarkSurface:()=>Bx});function Ox(n){var e,t,r;return(r=(e=n.variant.targeting)==null?void 0:e.element)!=null?r:(t=n.variant.triggers.find(s=>(s.type==="element"||s.type==="hover")&&s.match))==null?void 0:t.match}function Nx(n){var t;let e=(t=n.variant.surfaceOptions)==null?void 0:t.placement;return e==="top"||e==="left"||e==="right"?e:"bottom"}function Bx(n){var p,f,m,h,b,k;let{doc:e,variant:t}=n,r=Ox(n),s=((p=t.surfaceOptions)==null?void 0:p.spotlight)!==!1,i=e.createElement("div");i.className="scalebun-coach-root";let o=s?e.createElement("div"):null;o&&(o.className="scalebun-coach-spot",i.appendChild(o));let a=e.createElement("div");a.className="scalebun-coachmark",a.setAttribute("role",(m=(f=t.a11y)==null?void 0:f.role)!=null?m:"dialog"),a.setAttribute("aria-label",t.name),a.style.position="absolute";let c=(h=t.surfaceOptions)==null?void 0:h.maxWidth;if(c&&(a.style.maxWidth=`${c}px`),((b=t.dismiss)==null?void 0:b.xButton)!==!1){let x=e.createElement("button");x.type="button",x.className="scalebun-x scalebun-pop-x",x.setAttribute("aria-label","Dismiss"),x.textContent="\xD7",x.addEventListener("click",()=>n.requestClose("x")),a.appendChild(x)}let l=e.createElement("div");l.className="scalebun-pop-body";for(let x of oe(n))l.appendChild(x);a.appendChild(l),i.appendChild(a);let u=6,d=r?new Me({spec:$e(r),size:()=>({width:a.offsetWidth||300,height:a.offsetHeight||120}),preferred:{side:Nx(n),align:"center"},offset:(k=t.surfaceOptions)==null?void 0:k.offset,hooks:{onReposition:(x,y)=>{if(a.style.top=`${x.y}px`,a.style.left=`${x.x}px`,a.setAttribute("data-placement",x.placement.side),o){let g=y.getBoundingClientRect();o.style.top=`${g.y-u}px`,o.style.left=`${g.x-u}px`,o.style.width=`${g.width+u*2}px`,o.style.height=`${g.height+u*2}px`}},onHeal:()=>{var x;return(x=n.metrics)==null?void 0:x.recordAnchorRetry()},onMiss:()=>{var x;return(x=n.metrics)==null?void 0:x.recordFailedSelector(r)},onLost:x=>{var y;(y=n.metrics)==null||y.recordFailedSelector(r),n.hooks.onInteraction(`anchor-lost:${x}`),n.requestClose("auto")}}}):null;return{el:i,afterMount:()=>d==null?void 0:d.start(),destroy:()=>{d==null||d.stop(),i.remove()}}}var Lf=S(()=>{"use strict";Re();Dt()});function qt(n,e){var i,o,a,c;if("all"in n)return n.all.every(l=>qt(l,e));if("any"in n)return n.any.some(l=>qt(l,e));if("not"in n)return!qt(n.not,e);if("flag"in n)return!!((i=e.flags)!=null&&i[n.flag])===((o=n.is)!=null?o:!0);let t=(a=e.props)==null?void 0:a[n.prop],r=(c=n.op)!=null?c:"exists",s=typeof t=="number"&&typeof n.value=="number";switch(r){case"exists":return t!=null;case"eq":return t===n.value;case"ne":return t!==n.value;case"gt":return s&&t>n.value;case"lt":return s&&t<n.value;case"gte":return s&&t>=n.value;case"lte":return s&&t<=n.value;case"in":return Array.isArray(n.value)&&n.value.includes(t);default:return!1}}function _f(n,e){if(typeof n=="string")return n;if(Array.isArray(n)){for(let t of n)if(!t.when||qt(t.when,e))return t.to}return null}var Of=S(()=>{"use strict"});var Ht,Po=S(()=>{"use strict";Of();Ht=class{constructor(e){this.deps=e;this.tour=null;this.index=0;this.status="idle";this.startedAt=0;this.token=0;this.stepCleanup=null;this.pendingEvent=null;this.context={}}get state(){var e,t;return{tourId:(t=(e=this.tour)==null?void 0:e.id)!=null?t:null,index:this.index,status:this.status}}start(e,t){var s,i,o,a,c;this.status==="running"&&this.end("abandoned","superseded"),this.tour=e,this.context=(s=t==null?void 0:t.context)!=null?s:{},this.status="running",this.startedAt=this.deps.now();let r=!!(t!=null&&t.resume);this.index=r&&(a=(o=(i=this.deps).loadIndex)==null?void 0:o.call(i,e.id))!=null?a:0,(this.index>=e.steps.length||this.index<0)&&(this.index=0),this.deps.emit("$coachmark_tour_started",{tourId:e.id,version:(c=e.version)!=null?c:1,resumed:r&&this.index>0,steps:e.steps.length}),this.enter(this.index)}next(){this.status==="running"&&this.completeStep("next")}back(){if(this.status==="running"&&this.index>0){let e=this.tour.steps[this.index];this.deps.emit("$coachmark_step_back",{tourId:this.tour.id,stepId:e.id,index:this.index}),this.enter(this.index-1)}}skip(){if(this.status!=="running")return;let e=this.tour.steps[this.index];this.deps.emit("$coachmark_step_skipped",{tourId:this.tour.id,stepId:e.id,index:this.index,bySystem:!1}),this.enter(this.index+1)}notify(e){this.status==="running"&&this.pendingEvent===e&&this.completeStep("event")}end(e="abandoned",t="api"){var s,i,o;if(this.status!=="running")return;let r=this.tour;if(this.clearStep(),this.status=e,this.deps.hide(),(i=(s=this.deps).persist)==null||i.call(s,r.id,-1),e==="completed")this.deps.emit("$coachmark_tour_completed",{tourId:r.id,version:(o=r.version)!=null?o:1,steps:r.steps.length,totalMs:this.deps.now()-this.startedAt});else{let a=r.steps[this.index];this.deps.emit("$coachmark_tour_abandoned",{tourId:r.id,stepId:a==null?void 0:a.id,index:this.index,method:t})}}async enter(e){var o,a,c,l;this.clearStep();let t=this.tour;if(!t||this.status!=="running")return;if(e>=t.steps.length)return this.end("completed");this.index=e;let r=++this.token,s=t.steps[e];if(s.skipIf&&qt(s.skipIf,this.context))return this.deps.emit("$coachmark_step_skipped",{tourId:t.id,stepId:s.id,index:e,bySystem:!0,reason:"skipIf"}),void this.enter(e+1);(a=(o=this.deps).persist)==null||a.call(o,t.id,e);let i=null;if(s.anchor){let u=(c=s.waitConditions)!=null?c:["exists","visible"],d=()=>this.deps.resolveAnchor(s.anchor).el,p=await this.deps.waitFor(d,{conditions:u,timeoutMs:(l=s.timeoutMs)!=null?l:5e3},this.deps.hub);if(r!==this.token||this.status!=="running")return;if(!p.ok)return this.deps.emit("$coachmark_anchor_failed",{tourId:t.id,stepId:s.id,index:e,reason:p.reason,strategiesTried:this.deps.resolveAnchor(s.anchor).strategiesTried}),this.applyFallback(s,e);let f=this.deps.resolveAnchor(s.anchor);f.strategyIndex>0&&this.deps.emit("$coachmark_anchor_healed",{tourId:t.id,stepId:s.id,index:e,winningStrategy:f.strategyIndex}),i=p.el}this.paint(s,i,e,!1)}applyFallback(e,t){var s;let r=(s=e.fallback)!=null?s:"modal";if(this.deps.emit("$coachmark_step_fallback",{tourId:this.tour.id,stepId:e.id,index:t,fallback:r,reason:"anchor-fail"}),r==="skip")return void this.enter(t+1);if(r==="end")return this.end("abandoned","anchor-fail");this.paint(e,null,t,!0)}paint(e,t,r,s){this.deps.render({step:e,el:t,index:r,total:this.tour.steps.length,degraded:s,controls:this.controls()}),this.deps.emit("$coachmark_step_entered",{tourId:this.tour.id,stepId:e.id,index:r,anchored:!!t,degraded:s}),this.armAdvance(e,t)}armAdvance(e,t){var s;let r=(s=e.advance)!=null?s:"next";if(this.pendingEvent=null,r!=="next")if(r==="anchor-click"&&t){let i=()=>this.completeStep("click");t.addEventListener("click",i,{once:!0}),this.stepCleanup=()=>t.removeEventListener("click",i)}else if(r==="anchor-gone"&&e.anchor){let i=this.token,o=()=>this.deps.resolveAnchor(e.anchor).el;this.deps.waitFor(o,{conditions:["gone"],timeoutMs:36e5},this.deps.hub).then(a=>{a.ok&&i===this.token&&this.status==="running"&&this.completeStep("gone")})}else if(typeof r=="object"&&"timer"in r){let i=setTimeout(()=>this.completeStep("timer"),r.timer);this.stepCleanup=()=>clearTimeout(i)}else typeof r=="object"&&"event"in r&&(this.pendingEvent=r.event)}completeStep(e){if(this.status!=="running"||!this.tour)return;let t=this.tour.steps[this.index];this.deps.emit("$coachmark_step_completed",{tourId:this.tour.id,stepId:t.id,index:this.index,advanceBy:e});let r=_f(t.next,this.context);if(r){let s=this.tour.steps.findIndex(i=>i.id===r);if(s>=0)return this.deps.emit("$coachmark_branched",{tourId:this.tour.id,fromStep:t.id,toStep:r,index:s}),void this.enter(s)}this.enter(this.index+1)}controls(){return{next:()=>this.next(),back:()=>this.back(),skip:()=>this.skip(),close:()=>this.end("abandoned","dismiss")}}clearStep(){var e;(e=this.stepCleanup)==null||e.call(this),this.stepCleanup=null,this.pendingEvent=null,this.token++}dispose(){this.clearStep(),this.status="idle",this.tour=null}}});function _o(n,e){let t=n.width*n.height;if(t<=0)return 0;let r=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),s=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return r*s/t}function Lo(n){let e=n.getBoundingClientRect();return{x:e.left,y:e.top,width:e.width,height:e.height}}function Nf(n){if(n)return n;let e=typeof window!="undefined"?window.innerWidth:0,t=typeof window!="undefined"?window.innerHeight:0;return{x:0,y:0,width:e,height:t}}function Bf(n){if(n.disabled)return!1;let e=n.getBoundingClientRect();if(e.width===0||e.height===0)return!1;let t=typeof document!="undefined"&&document.elementFromPoint?document.elementFromPoint(e.left+e.width/2,e.top+e.height/2):null;return t?n===t||n.contains(t)||t.contains(n):!1}function Fx(n,e,t,r){var s,i;if(e.conditions.includes("gone"))return n==null;if(!n||e.conditions.includes("visible")&&_o(Lo(n),Nf(e.boundary))<((s=e.minVisibleRatio)!=null?s:.5)||e.conditions.includes("clickable")&&!Bf(n))return!1;if(e.conditions.includes("stable")){let o=JSON.stringify(Lo(n));if(o!==t.v)return t.v=o,r.n=0,!1;if(r.n+=1,r.n<((i=e.stableFrames)!=null?i:2))return!1}return!0}function Dx(n,e){var t;return e.conditions.includes("gone")?"timeout":n?e.conditions.includes("visible")&&_o(Lo(n),Nf(e.boundary))<((t=e.minVisibleRatio)!=null?t:.5)?"not-visible":e.conditions.includes("clickable")&&!Bf(n)?"not-clickable":"timeout":"not-found"}function os(n,e,t){return new Promise(r=>{var p,f;let s=!1,i=()=>{},o,a,c={v:""},l={n:0},u=(m,h,b)=>{s||(s=!0,i(),o&&clearTimeout(o),a&&clearInterval(a),r({ok:m,el:h,reason:b}))},d=()=>{if(s)return;let m=n();Fx(m,e,c,l)&&u(!0,e.conditions.includes("gone")?null:m)};i=t.onChange(d),a=setInterval(d,(p=e.pollMs)!=null?p:100),o=setTimeout(()=>{let m=n();u(!1,m,Dx(m,e))},(f=e.timeoutMs)!=null?f:5e3),d()})}var as=S(()=>{"use strict"});var Ff={};_(Ff,{tourSurface:()=>Hx});function qx(n){var t;let e=n.placement==="top"||n.placement==="left"||n.placement==="right"?n.placement:"bottom";return{id:n.id,anchor:n.anchor?$e(n.anchor):void 0,title:n.title,body:n.body,placement:n.anchor?{side:e,align:"center"}:void 0,advance:(t=n.advance)!=null?t:"next",fallback:"modal"}}function Hx(n){var u,d;let{doc:e,variant:t}=n,r=(d=(u=t.surfaceOptions)==null?void 0:u.steps)!=null?d:[],s=new nt,i=e.createElement("div");i.className="scalebun-tour-root";let o=()=>{},a=p=>{var v;let f=e.createElement("div");if(f.className="scalebun-coachmark scalebun-tour-card",f.setAttribute("role","dialog"),f.setAttribute("aria-label",(v=p.step.title)!=null?v:t.name),f.style.position=p.el?"absolute":"fixed",p.step.title){let E=e.createElement("h2");E.className="scalebun-h",E.textContent=p.step.title,f.appendChild(E)}if(p.step.body){let E=e.createElement("p");E.className="scalebun-text",E.textContent=p.step.body,f.appendChild(E)}let m=e.createElement("div");m.className="scalebun-tour-nav";let h=e.createElement("span");h.className="scalebun-tour-prog",h.textContent=`${p.index+1} / ${p.total}`,m.appendChild(h);let b=e.createElement("span");b.className="scalebun-tour-btns";let k=(E,C,I)=>{let R=e.createElement("button");return R.type="button",R.className=`scalebun-btn ${C}`,R.textContent=E,R.addEventListener("click",I),R};p.index>0&&b.appendChild(k("Back","scalebun-btn-ghost",p.controls.back)),b.appendChild(k("Skip","scalebun-btn-ghost",p.controls.skip)),b.appendChild(k(p.index+1>=p.total?"Done":"Next","scalebun-btn-primary",p.controls.next)),m.appendChild(b),f.appendChild(m);let x=e.createElement("button");x.type="button",x.className="scalebun-x scalebun-pop-x",x.setAttribute("aria-label","End tour"),x.textContent="\xD7",x.addEventListener("click",p.controls.close),f.appendChild(x),i.appendChild(f);let y=null,g=null,w=()=>{g==null||g.stop(),g=null,y==null||y.remove(),y=null,f.style.position="fixed",f.style.top="",f.style.left="",f.removeAttribute("data-placement"),f.classList.add("scalebun-tour-center")};if(p.el&&p.step.anchor){let E=Tf(p.step.anchor);y=e.createElement("div"),y.className="scalebun-coach-spot",i.appendChild(y);let C=6;g=new Me({spec:p.step.anchor,size:()=>({width:f.offsetWidth||300,height:f.offsetHeight||120}),preferred:p.step.placement,hooks:{onReposition:(I,R)=>{f.style.top=`${I.y}px`,f.style.left=`${I.x}px`,f.setAttribute("data-placement",I.placement.side);let T=R.getBoundingClientRect();y.style.top=`${T.y-C}px`,y.style.left=`${T.x-C}px`,y.style.width=`${T.width+C*2}px`,y.style.height=`${T.height+C*2}px`},onHeal:()=>{var I;return(I=n.metrics)==null?void 0:I.recordAnchorRetry()},onMiss:()=>{var I;return(I=n.metrics)==null?void 0:I.recordFailedSelector(E)},onLost:I=>{var R;w(),(R=n.metrics)==null||R.recordFailedSelector(E),n.hooks.onInteraction(`anchor-lost:${I}`)}}}),g.start()}else f.classList.add("scalebun-tour-center");return()=>{g==null||g.stop(),y==null||y.remove(),f.remove()}},c=new Ht({hub:s,resolveAnchor:ft,waitFor:os,render:p=>{o(),o=a(p)},hide:()=>{o(),o=()=>{}},emit:p=>n.hooks.onInteraction(p),now:()=>Date.now(),persist:(p,f)=>{try{f<0?localStorage.removeItem(Oo(p)):localStorage.setItem(Oo(p),String(f))}catch{}},loadIndex:p=>{try{let f=localStorage.getItem(Oo(p));return f!=null?Number(f):void 0}catch{return}}}),l={id:t.id,version:1,steps:r.map(qx)};return{el:i,afterMount:()=>c.start(l,{resume:!0}),destroy:()=>{o(),c.dispose(),s.dispose(),i.remove()}}}var Oo,Df=S(()=>{"use strict";Po();ns();as();is();Dt();Oo=n=>`scalebun_inapp_tour_${n}`});var qf={};_(qf,{hotspotSurface:()=>Ux});function $x(n){var e,t,r;return(r=(e=n.variant.targeting)==null?void 0:e.element)!=null?r:(t=n.variant.triggers.find(s=>(s.type==="element"||s.type==="hover")&&s.match))==null?void 0:t.match}function zx(n){var t;let e=(t=n.variant.surfaceOptions)==null?void 0:t.placement;return e==="top"||e==="left"||e==="right"?e:"bottom"}function Ux(n){let{doc:e,variant:t}=n,r=$x(n),s=e.createElement("div");s.className="scalebun-hotspot-root";let i=e.createElement("button");i.type="button",i.className="scalebun-beacon",i.setAttribute("aria-label",t.name),i.setAttribute("aria-expanded","false"),s.appendChild(i);let o=e.createElement("div");o.className="scalebun-beacon-card",o.setAttribute("role","tooltip"),o.hidden=!0;for(let d of oe(n))o.appendChild(d);s.appendChild(o);let a=!1,c=d=>{a!==d&&(a=d,o.hidden=!d,i.setAttribute("aria-expanded",String(d)),d&&n.hooks.onInteraction("hotspot_reveal"))};i.addEventListener("mouseenter",()=>c(!0)),i.addEventListener("focus",()=>c(!0)),i.addEventListener("click",()=>c(!a));let l=!1;o.addEventListener("mouseenter",()=>l=!0),o.addEventListener("mouseleave",()=>{l=!1,c(!1)}),i.addEventListener("mouseleave",()=>setTimeout(()=>!l&&c(!1),120));let u=r?new Me({spec:$e(r),size:()=>({width:o.offsetWidth||240,height:o.offsetHeight||90}),preferred:{side:zx(n),align:"center"},hooks:{onReposition:(d,p)=>{let f=p.getBoundingClientRect();i.style.top=`${f.y-5}px`,i.style.left=`${f.x+f.width-5}px`,o.style.top=`${d.y}px`,o.style.left=`${d.x}px`,o.setAttribute("data-placement",d.placement.side)},onHeal:()=>{var d;return(d=n.metrics)==null?void 0:d.recordAnchorRetry()},onMiss:()=>{var d;return(d=n.metrics)==null?void 0:d.recordFailedSelector(r)},onLost:d=>{var p;(p=n.metrics)==null||p.recordFailedSelector(r),n.hooks.onInteraction(`anchor-lost:${d}`),n.requestClose("auto")}}}):null;return{el:s,afterMount:()=>u==null?void 0:u.start(),destroy:()=>{u==null||u.stop(),s.remove()}}}var Hf=S(()=>{"use strict";Re();Dt()});var $f={};_($f,{toolbarSurface:()=>Kx});function Vx(n){var e,t,r;return(r=(e=n.variant.targeting)==null?void 0:e.element)!=null?r:(t=n.variant.triggers.find(s=>(s.type==="element"||s.type==="hover")&&s.match))==null?void 0:t.match}function Wx(n){var t;let e=(t=n.variant.surfaceOptions)==null?void 0:t.placement;return e==="top"||e==="left"||e==="right"?e:"bottom"}function Kx(n){var a,c,l,u;let{doc:e,variant:t}=n,r=Vx(n),s=e.createElement("div");s.className="scalebun-toolbar-callout",s.setAttribute("role",(c=(a=t.a11y)==null?void 0:a.role)!=null?c:"dialog"),s.setAttribute("aria-label",t.name),s.style.position="absolute";let i=e.createElement("div");i.className="scalebun-pop-body";for(let d of oe(n))i.appendChild(d);if(s.appendChild(i),((l=t.dismiss)==null?void 0:l.xButton)!==!1){let d=e.createElement("button");d.type="button",d.className="scalebun-x scalebun-pop-x",d.setAttribute("aria-label","Dismiss"),d.textContent="\xD7",d.addEventListener("click",()=>n.requestClose("x")),s.appendChild(d)}let o=r?new Me({spec:$e(r),size:()=>({width:s.offsetWidth||220,height:s.offsetHeight||80}),preferred:{side:Wx(n),align:"center"},offset:(u=t.surfaceOptions)==null?void 0:u.offset,hooks:{onReposition:d=>{s.style.top=`${d.y}px`,s.style.left=`${d.x}px`,s.setAttribute("data-placement",d.placement.side)},onHeal:()=>{var d;return(d=n.metrics)==null?void 0:d.recordAnchorRetry()},onMiss:()=>{var d;return(d=n.metrics)==null?void 0:d.recordFailedSelector(r)},onLost:()=>n.requestClose("auto")}}):null;return{el:s,afterMount:()=>o==null?void 0:o.start(),destroy:()=>{o==null||o.stop(),s.remove()}}}var zf=S(()=>{"use strict";Re();Dt()});var Uf={};_(Uf,{paletteSurface:()=>jx});function jx(n){var k,x,y;let{doc:e,variant:t}=n,r=(x=(k=t.surfaceOptions)==null?void 0:k.commands)!=null?x:[],s=Ft(e),i=e.createElement("div");i.className="scalebun-palette-backdrop";let o=e.createElement("div");o.className="scalebun-palette",o.setAttribute("role","dialog"),o.setAttribute("aria-label",t.name);let a=e.createElement("input");a.className="scalebun-palette-input",a.type="text",a.setAttribute("role","combobox"),a.setAttribute("aria-expanded","true"),a.placeholder="Type a command or search\u2026",o.appendChild(a);let c=e.createElement("ul");c.className="scalebun-palette-list",c.setAttribute("role","listbox"),o.appendChild(c),i.appendChild(o);let l=r.slice(),u=0,d=g=>{if(g){if(n.hooks.onCtaClick(g.action),n.hooks.onInteraction(`palette_select:${g.id}`),g.action==="link"&&g.value)try{typeof window!="undefined"&&window.location.assign(g.value)}catch{}n.requestClose("cta")}},p=()=>{if(c.replaceChildren(),l.length===0){let g=e.createElement("li");g.className="scalebun-palette-empty",g.textContent="No matches",c.appendChild(g);return}l.forEach((g,w)=>{let v=e.createElement("li");v.className="scalebun-palette-item"+(w===u?" active":""),v.setAttribute("role","option"),v.setAttribute("aria-selected",String(w===u));let E=e.createElement("span");if(E.className="scalebun-palette-label",E.textContent=g.label,v.appendChild(E),g.hint){let C=e.createElement("span");C.className="scalebun-palette-hint",C.textContent=g.hint,v.appendChild(C)}v.addEventListener("mousemove",()=>{u=w,f()}),v.addEventListener("click",()=>d(g)),c.appendChild(v)})},f=()=>{Array.from(c.children).forEach((g,w)=>{g.classList.toggle("active",w===u),g.setAttribute("aria-selected",String(w===u))})},m=()=>{let g=a.value.trim().toLowerCase();l=g?r.filter(w=>w.label.toLowerCase().includes(g)||w.action.toLowerCase().includes(g)):r.slice(),u=0,p()};a.addEventListener("input",m);let h=g=>{g.key==="Escape"?(g.stopPropagation(),n.requestClose("esc")):g.key==="ArrowDown"?(g.preventDefault(),u=Math.min(l.length-1,u+1),f()):g.key==="ArrowUp"?(g.preventDefault(),u=Math.max(0,u-1),f()):g.key==="Enter"&&(g.preventDefault(),d(l[u]))};o.addEventListener("keydown",h),((y=t.dismiss)==null?void 0:y.backdropClose)!==!1&&i.addEventListener("mousedown",g=>{g.target===i&&n.requestClose("backdrop")});let b=Bt(o,e);return p(),{el:i,afterMount:()=>a.focus(),destroy:()=>{b(),o.removeEventListener("keydown",h),i.remove(),s()}}}var Vf=S(()=>{"use strict";ts()});var Wf={};_(Wf,{panelSurface:()=>Gx});function Gx(n){var b,k,x,y,g,w;let{doc:e,variant:t}=n,r=((b=t.surfaceOptions)==null?void 0:b.placement)==="left",s=e.createElement("div");s.className="scalebun-panel "+(r?"scalebun-panel-left":"scalebun-panel-right"),s.setAttribute("role",(x=(k=t.a11y)==null?void 0:k.role)!=null?x:"complementary"),s.setAttribute("aria-label",t.name);let i=e.createElement("div");i.className="scalebun-panel-head";let o=e.createElement("div");if(o.className="scalebun-panel-title",o.textContent=t.name,i.appendChild(o),((y=t.dismiss)==null?void 0:y.xButton)!==!1){let v=e.createElement("button");v.type="button",v.className="scalebun-x",v.setAttribute("aria-label","Close panel"),v.textContent="\xD7",v.addEventListener("click",()=>n.requestClose("x")),i.appendChild(v)}s.appendChild(i);let a=e.createElement("div");a.className="scalebun-panel-thread",a.setAttribute("role","log"),a.setAttribute("aria-live","polite"),s.appendChild(a);let c=(w=(g=t.blocks.find(v=>v.kind==="text"))==null?void 0:g.props)==null?void 0:w.text;typeof c=="string"&&f("assistant",c);let l=e.createElement("form");l.className="scalebun-panel-composer";let u=e.createElement("textarea");u.className="scalebun-panel-input",u.rows=1,u.placeholder="Ask anything\u2026";let d=e.createElement("button");d.type="submit",d.className="scalebun-btn scalebun-btn-primary scalebun-panel-send",d.textContent="Send",l.append(u,d),s.appendChild(l);let p=null;function f(v,E){let C=e.createElement("div");return C.className=`scalebun-bubble scalebun-bubble-${v}`,C.textContent=E,a.appendChild(C),a.scrollTop=a.scrollHeight,C}let m=v=>{v.preventDefault();let E=u.value.trim();E&&(f("user",E),u.value="",n.hooks.onInteraction(`ai_prompt:${E}`),p=f("assistant",""),p.classList.add("streaming"))};l.addEventListener("submit",m);let h={appendAssistant:v=>{var E;p||(p=f("assistant","")),p.textContent=((E=p.textContent)!=null?E:"")+v,a.scrollTop=a.scrollHeight},endAssistant:()=>{p==null||p.classList.remove("streaming"),p=null}};return s.scalebunStream=h,{el:s,destroy:()=>{l.removeEventListener("submit",m),s.remove()}}}var Kf=S(()=>{"use strict"});var Gf={};_(Gf,{checklistSurface:()=>Yx});function Yx(n){var w,v,E,C,I,R;let{doc:e,variant:t}=n,r=t.blocks.find(T=>T.kind==="checklist"),s=Array.isArray((w=r==null?void 0:r.props)==null?void 0:w.items)?r.props.items.map(T=>typeof T=="string"?{id:T,label:T}:T):[],i=(E=(v=t.blocks.find(T=>T.kind==="heading"))==null?void 0:v.props)==null?void 0:E.text,o=new Set;try{let T=localStorage.getItem(jf(t.id));if(T)for(let A of JSON.parse(T))o.add(A)}catch{}let a=()=>{try{localStorage.setItem(jf(t.id),JSON.stringify([...o]))}catch{}},c=e.createElement("div");c.className="scalebun-checklist",c.setAttribute("role",(I=(C=t.a11y)==null?void 0:C.role)!=null?I:"complementary"),c.setAttribute("aria-label",t.name);let l=e.createElement("div");l.className="scalebun-cl-head";let u=e.createElement("div");u.className="scalebun-cl-title",u.textContent=typeof i=="string"?i:t.name,l.appendChild(u);let d=e.createElement("button");d.type="button",d.className="scalebun-x scalebun-cl-dock",d.setAttribute("aria-label","Minimize"),d.textContent="\u2014";let p=!1;if(d.addEventListener("click",()=>{p=!p,c.classList.toggle("collapsed",p),d.textContent=p?"\u25A2":"\u2014"}),l.appendChild(d),((R=t.dismiss)==null?void 0:R.xButton)!==!1){let T=e.createElement("button");T.type="button",T.className="scalebun-x",T.setAttribute("aria-label","Dismiss"),T.textContent="\xD7",T.addEventListener("click",()=>n.requestClose("x")),l.appendChild(T)}c.appendChild(l);let f=e.createElement("div");f.className="scalebun-cl-bar";let m=e.createElement("div");m.className="scalebun-cl-fill",f.appendChild(m);let h=e.createElement("div");h.className="scalebun-cl-count",c.append(f,h);let b=e.createElement("ul");b.className="scalebun-cl-list",c.appendChild(b);let k=!1,x=()=>{let T=s.length||1,A=s.filter(P=>o.has(P.id)).length;m.style.width=`${Math.round(A/T*100)}%`,h.textContent=`${A} of ${s.length} complete`,b.replaceChildren();for(let P of s){let $=e.createElement("li");$.className="scalebun-cl-item"+(o.has(P.id)?" done":"");let D=e.createElement("button");D.type="button",D.className="scalebun-cl-check",D.setAttribute("role","checkbox"),D.setAttribute("aria-checked",String(o.has(P.id))),D.textContent=o.has(P.id)?"\u2713":"",D.addEventListener("click",()=>y(P.id));let ne=e.createElement("span");ne.className="scalebun-cl-label",ne.textContent=P.label,$.append(D,ne),b.appendChild($)}A>=s.length&&s.length>0&&!k?(k=!0,c.classList.add("complete"),n.hooks.onInteraction("checklist_complete")):A<s.length&&(k=!1,c.classList.remove("complete"))},y=T=>{o.has(T)?o.delete(T):o.add(T),a(),n.hooks.onInteraction(`checklist_step:${T}`),x()},g=T=>{!o.has(T)&&s.some(A=>A.id===T)&&(o.add(T),a(),x())};return c.scalebunChecklist={completeStep:g},x(),{el:c,destroy:()=>c.remove()}}var jf,Yf=S(()=>{"use strict";jf=n=>`scalebun_inapp_checklist_${n}`});var Xf={};_(Xf,{takeoverSurface:()=>Jx});function Jx(n){var m,h,b,k,x;let{doc:e,variant:t}=n,r=(m=t.a11y)!=null?m:{},s=(h=t.dismiss)!=null?h:{},i=Ft(e),o=e.createElement("div");o.className="scalebun-takeover",o.setAttribute("role",(b=r.role)!=null?b:"dialog"),o.setAttribute("aria-modal","true");let a=e.createElement("div");a.className="scalebun-takeover-inner";let c=oe(n),l=c.find(y=>y.classList.contains("scalebun-h"));if(l){let y=`scalebun-tk-${++Xx}`;l.id=y,o.setAttribute("aria-labelledby",y)}else o.setAttribute("aria-label",t.name);if(s.xButton===!0){let y=e.createElement("button");y.type="button",y.className="scalebun-x scalebun-takeover-x",y.setAttribute("aria-label","Close"),y.textContent="\xD7",y.addEventListener("click",()=>n.requestClose("x")),a.appendChild(y)}for(let y of c)a.appendChild(y);o.appendChild(a);let u=y=>{y.key==="Escape"&&s.escClose===!0&&(y.stopPropagation(),n.requestClose("esc"))};o.addEventListener("keydown",u);let d=Bt(o,e),p=(x=(k=n.host.shadowRoot)==null?void 0:k.host)!=null?x:o,f=es(p,e);return{el:o,afterMount:()=>Zr(o),destroy:()=>{d(),f(),o.removeEventListener("keydown",u),o.remove(),i()}}}var Xx,Jf=S(()=>{"use strict";Re();ts();Xx=0});var Qf={};_(Qf,{launcherSurface:()=>Qx});function Qx(n){var u,d,p,f;let{doc:e,variant:t}=n,r=(d=(u=t.surfaceOptions)==null?void 0:u.commands)!=null?d:[],s=(f=(p=t.blocks.find(m=>m.kind==="heading"||m.kind==="text"))==null?void 0:p.props)==null?void 0:f.text,i=e.createElement("div");i.className="scalebun-launcher";let o=e.createElement("div");o.className="scalebun-launcher-menu",o.setAttribute("role","menu"),o.hidden=!0;let a=e.createElement("button");a.type="button",a.className="scalebun-launcher-fab",a.setAttribute("aria-label",typeof s=="string"?s:t.name),a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"),a.textContent="?";let c=!1,l=m=>{c=m,o.hidden=!m,a.setAttribute("aria-expanded",String(m)),a.textContent=m?"\xD7":"?"};a.addEventListener("click",()=>l(!c));for(let m of r){let h=e.createElement("button");h.type="button",h.className="scalebun-launcher-item",h.setAttribute("role","menuitem"),h.textContent=m.label,h.addEventListener("click",()=>{if(n.hooks.onCtaClick(m.action),n.hooks.onInteraction(`launcher_select:${m.id}`),m.action==="link"&&m.value)try{typeof window!="undefined"&&window.location.assign(m.value)}catch{}l(!1)}),o.appendChild(h)}return i.append(o,a),{el:i,destroy:()=>i.remove()}}var Zf=S(()=>{"use strict"});var nm={};_(nm,{ShadowHost:()=>dn,applyThemeVars:()=>cs,resolveScheme:()=>tm});function tm(n){if(n==="light"||n==="dark")return n;try{return typeof matchMedia!="undefined"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function cs(n,e){let t=eS[tm(e)];for(let[r,s]of Object.entries(t))n.style.setProperty(r,s)}var Zx,em,eS,dn,ls=S(()=>{"use strict";z();Zx="scalebun-inapp-host",em=`
539
+ :host{ all: initial; }
540
+ .layer{
541
+ position: fixed; inset: 0; z-index: 2147483600;
542
+ pointer-events: none; /* the layer is transparent to clicks; surfaces opt back in */
543
+ font-family: var(--scalebun-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
544
+ color: var(--scalebun-fg);
545
+ }
546
+ .layer > *{ pointer-events: auto; }
547
+ .zone{ position: absolute; }
548
+ .zone-top-banner{ top: 0; left: 0; right: 0; }
549
+ .zone-bottom-banner{ bottom: 0; left: 0; right: 0; }
550
+ .zone-toast{ bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
551
+ .zone-side-right{ top: 0; right: 0; bottom: 0; }
552
+ .zone-side-left{ top: 0; left: 0; bottom: 0; }
553
+ .zone-launcher{ bottom: 16px; right: 16px; }
554
+ /* full-bleed zones: click-transparent by design \u2014 see the BASE_CSS docblock */
555
+ .zone-modal, .zone-takeover, .zone-palette{ inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
556
+ .zone-anchored{ inset: 0; pointer-events: none; }
557
+ /* 16px in from the corner, like .zone-toast and .zone-launcher \u2014 this alone sat at top:0 right:0.
558
+ The layer is position:fixed inset:0, i.e. exactly the viewport, so a zone flush to the corner
559
+ leaves anything that deliberately overhangs nowhere to go: the bell's unread badge sits at a
560
+ negative offset and was being sliced off by the screen edge. */
561
+ .zone-center{ top: 16px; inset-inline-end: 16px; }
562
+ @media (prefers-reduced-motion: reduce){ .layer *{ animation: none !important; transition: none !important; } }
563
+ `,eS={light:{"--scalebun-bg":"#ffffff","--scalebun-fg":"#111827","--scalebun-muted":"#6b7280","--scalebun-border":"#e5e7eb","--scalebun-accent":"#4f46e5","--scalebun-accent-fg":"#ffffff","--scalebun-shadow":"0 10px 40px rgba(0,0,0,.15)","--scalebun-radius":"12px"},dark:{"--scalebun-bg":"#1f2430","--scalebun-fg":"#f3f4f6","--scalebun-muted":"#9aa3b2","--scalebun-border":"#333b4a","--scalebun-accent":"#7c83ff","--scalebun-accent-fg":"#0b0d12","--scalebun-shadow":"0 10px 40px rgba(0,0,0,.5)","--scalebun-radius":"12px"}};dn=class{constructor(){this.zones=new Map;this.mode="auto";this.adoptedIds=new Set}ensure(){var s,i;if(this.host||typeof document=="undefined")return;let e=document.createElement("div");e.id=Zx,e.setAttribute("data-scalebun","inapp"),e.style.cssText="all: initial; position: static;",this.host=e;let t=e.attachShadow({mode:"open"});if(this.root=t,typeof CSSStyleSheet!="undefined"&&"adoptedStyleSheets"in t)try{let o=new CSSStyleSheet;o.replaceSync(em),t.adoptedStyleSheets=[o],this.sheet=o}catch{this.injectStyleTag(t)}else this.injectStyleTag(t);let r=document.createElement("div");r.className="layer",r.setAttribute("role","presentation"),t.appendChild(r),this.layer=r,document.body.appendChild(e),this.applyTheme(),typeof matchMedia!="undefined"&&(this.mql=matchMedia("(prefers-color-scheme: dark)"),this.onScheme=()=>{this.mode==="auto"&&this.applyTheme()},(i=(s=this.mql).addEventListener)==null||i.call(s,"change",this.onScheme))}injectStyleTag(e){let t=vt(document.createElement("style"));t.textContent=em,e.appendChild(t)}addStyles(e,t){if(this.ensure(),this.adoptedIds.has(e)||!this.root)return;this.adoptedIds.add(e);let r=this.root;if(typeof CSSStyleSheet!="undefined"&&"adoptedStyleSheets"in r)try{let i=new CSSStyleSheet;i.replaceSync(t);let o=r.adoptedStyleSheets;r.adoptedStyleSheets=[...o,i];return}catch{}let s=vt(document.createElement("style"));s.setAttribute("data-scalebun-styles",e),s.textContent=t,r.appendChild(s)}setTheme(e){this.mode=e,this.ensure(),this.applyTheme()}applyTheme(){this.host&&cs(this.host,this.mode)}element(){return this.host}zone(e){var s;this.ensure();let t=this.zones.get(e);if(t)return t;t=document.createElement("div");let r=e.startsWith("inline:")?"inline":e;return t.className=`zone zone-${r}`,t.setAttribute("data-zone",e),(s=this.layer)==null||s.appendChild(t),this.zones.set(e,t),t}destroy(){var e,t,r;this.mql&&this.onScheme&&((t=(e=this.mql).removeEventListener)==null||t.call(e,"change",this.onScheme)),this.onScheme=void 0,this.mql=void 0,this.zones.clear(),(r=this.host)==null||r.remove(),this.host=void 0,this.root=void 0,this.layer=void 0,this.sheet=void 0}get shadowRoot(){return this.root}}});var rm={};_(rm,{mountInline:()=>nS});function nS(n,e,t,r={}){var d,p;let s=(p=(d=e.surfaceOptions)==null?void 0:d.slot)!=null?p:"default",i=null,o=()=>{},a=!1,c=(f="x")=>{a||(a=!0,u(),o(),i&&(t.onDismiss(f),i.remove(),i=null))},l=f=>{var x,y,g,w;if(a||i)return;let m=f.ownerDocument;i=m.createElement("div"),i.className="scalebun-inline-host",cs(i,(x=r.theme)!=null?x:"auto");let h=i.attachShadow({mode:"open"});Ne(h,Ur+tS);let b=m.createElement("div");b.className="scalebun-inline",b.setAttribute("role",(g=(y=e.a11y)==null?void 0:y.role)!=null?g:"region"),b.setAttribute("aria-label",e.name);let k=yo({doc:m,hooks:t,requestClose:v=>c(v)});for(let v of Wr(e.blocks,k))b.appendChild(v);if((w=e.dismiss)!=null&&w.xButton){let v=m.createElement("button");v.type="button",v.className="scalebun-x",v.setAttribute("aria-label","Dismiss"),v.textContent="\xD7",v.addEventListener("click",()=>c("x")),b.appendChild(v)}h.appendChild(b),f.appendChild(i),t.onImpression(),o=jr(b,t.onView)},u=n.whenAvailable(s,l);return{close:()=>c("x"),mounted:()=>i!=null}}var tS,sm=S(()=>{"use strict";z();ls();go();Re();Kr();tS=`
564
+ :host{ display:block; }
565
+ .scalebun-inline{ position:relative; background:var(--scalebun-bg); color:var(--scalebun-fg);
566
+ border:1px solid var(--scalebun-border); border-radius:var(--scalebun-radius); padding:18px; }
567
+ /* inset-inline-end, not right: in RTL the button belongs on the side the text now ends on. */
568
+ .scalebun-inline .scalebun-x{ position:absolute; top:8px; inset-inline-end:8px; background:none; border:0;
569
+ color:var(--scalebun-muted); cursor:pointer; font-size:16px; border-radius:6px; }
570
+ .scalebun-inline .scalebun-h{ padding-inline-end:24px; }
571
+ `});var om={};_(om,{SURFACE_LOADERS:()=>No,isSurfaceSupported:()=>rS,renderVariant:()=>Bo});function rS(n){return n==="inline"||n in No}async function Bo(n,e,t){var a;let r=df(((a=n.blocks)!=null?a:[]).map(c=>c.kind));if(n.surface==="inline"){if(!t.slots)return await r,im(n.id);let[{mountInline:c}]=await Promise.all([Promise.resolve().then(()=>(sm(),rm)),r]),l=c(t.slots,n,e);return{variantId:n.id,close:()=>l.close()}}let s=No[n.surface];if(!s)return await r,im(n.id);let[i]=await Promise.all([s(),r]),o=Ip(t.host,n,i,e,t.metrics);return{variantId:n.id,close:()=>o.close("x")}}function im(n){return{variantId:n,close:()=>{}}}var No,Fo=S(()=>{"use strict";Cp();uf();No={banner:()=>Promise.resolve().then(()=>(ff(),pf)).then(n=>n.bannerSurface),toast:()=>Promise.resolve().then(()=>(hf(),mf)).then(n=>n.toastSurface),modal:()=>Promise.resolve().then(()=>(yf(),bf)).then(n=>n.modalSurface),slideover:()=>Promise.resolve().then(()=>(kf(),Sf)).then(n=>n.slideoverSurface),popover:()=>Promise.resolve().then(()=>(Mf(),Rf)).then(n=>n.popoverSurface),coachmark:()=>Promise.resolve().then(()=>(Lf(),Pf)).then(n=>n.coachmarkSurface),tour:()=>Promise.resolve().then(()=>(Df(),Ff)).then(n=>n.tourSurface),hotspot:()=>Promise.resolve().then(()=>(Hf(),qf)).then(n=>n.hotspotSurface),toolbar:()=>Promise.resolve().then(()=>(zf(),$f)).then(n=>n.toolbarSurface),palette:()=>Promise.resolve().then(()=>(Vf(),Uf)).then(n=>n.paletteSurface),panel:()=>Promise.resolve().then(()=>(Kf(),Wf)).then(n=>n.panelSurface),checklist:()=>Promise.resolve().then(()=>(Yf(),Gf)).then(n=>n.checklistSurface),takeover:()=>Promise.resolve().then(()=>(Jf(),Xf)).then(n=>n.takeoverSurface),launcher:()=>Promise.resolve().then(()=>(Zf(),Qf)).then(n=>n.launcherSurface)}});function lm(n){Ho=n}function $o(n){try{qo==null||qo(n)}catch{}}function dm(n,e){let t=typeof e=="string"&&e?e:null;return t?sS.has(t)?t:null:n&&oS[n]||null}function um(n){var t;let e=(t=n==null?void 0:n.ext)==null?void 0:t.archetype;return typeof e=="string"&&e?e:void 0}function zo(n,e){let t=um(e!=null?e:n.spec);return dm(n.variantKey,t)?!0:t?(aS.has(t)||$o({variantKey:n.variantKey,reason:"unrenderable",archetype:t}),!1):(n.variantKey&&$o({variantKey:n.variantKey,reason:"unmapped"}),!1)}function lS(n){var t;let e=B(n.mountModel);if(!e)return null;if(e==="inline"){let r=$r(n);return!r||!po(n)?($o({reason:"unrenderable",archetype:"inline"}),null):{surface:"inline",surfaceOptions:{slot:r}}}return(t=cS[e])!=null?t:null}function mS(n,e,t,r,s){var i,o,a,c,l,u,d,p,f,m,h,b,k,x,y,g,w,v,E,C,I,R,T,A,P,$,D,ne,J,Q,fe,ce,xe,Se,le,H,V,j,de,me,se,Ue,Ve;switch(n){case"spinWheel":{let G=ue(e,["segments","prizes","rewards"]);return[{kind:"spinwheel",props:{segments:G.map(pe).filter(Boolean),resultIndex:uS(G,e)}}]}case"scratchReveal":return[{kind:"scratch",props:{prize:(u=B((l=(c=(a=(o=(i=e.prize)!=null?i:e.reward)!=null?o:e.rewardValue)!=null?a:e.rewardResult)!=null?c:e.resultReward)!=null?l:e.coupon))!=null?u:"You won!",reveal:r==="mystery_box"?"box":"scratch"}}];case"slotReward":{let G=ue(e,["resultSymbols","result","winningSymbols"]).map(pe).filter(Boolean);return[{kind:"slot",props:{symbols:ue(e,["symbols","reels","slotItems"]).map(pe).filter(Boolean),...G.length?{result:G.slice(0,3)}:{}}}]}case"countdown":return[{kind:"countdown",props:pS(e)}];case"celebration":return[{kind:"confetti",props:{}}];case"qrNfc":return[{kind:"qr",props:{value:(m=(f=(p=(d=B(e.url))!=null?d:B(e.link))!=null?p:B(e.qrValue))!=null?f:B(e.deepLink))!=null?m:"https://app.example.com"}}];case"carouselDeck":{let G=ue(e,["slides","cards","items","steps"]);return[{kind:"carousel",props:{slides:(G.length?G:[{},{},{}]).map(X=>{var te,M,O;let Y=ae(X);return{image:B((te=Y.image)!=null?te:Y.imageUrl),title:pe(X),text:B((O=(M=Y.text)!=null?M:Y.body)!=null?O:Y.subtitle)}})}}]}case"questionFlow":{let G=ue(e,["questions","steps"]),ie=ae(G[0]),X=(w=(g=(y=B((b=(h=e.question)!=null?h:e.promptText)!=null?b:e.prompt))!=null?y:B((x=(k=ie.prompt)!=null?k:ie.question)!=null?x:ie.label))!=null?g:t)!=null?w:"Tell us",Y=ue(e,["options","preferenceOptions","pollOptions","answers","choices","reactions"]),te=Y.length?Y:ue(ie,["options","answers","choices"]),M=(te.length?te:[{label:"Option A"},{label:"Option B"}]).map((O,N)=>({id:String(N),label:pe(O)}));switch(r){case"nps_prompt":return[{kind:"nps",props:{question:X}}];case"rating_request":return[{kind:"rating",props:{question:X,max:Do(Number((v=e.max)!=null?v:e.scale),5)}}];case"emoji_reaction_bar":{let O=ue(e,["emojis","reactions","options"]).map(N=>{var F;return typeof N=="string"?N:(F=B(ae(N).emoji))!=null?F:pe(N)}).filter(Boolean);return[{kind:"emoji",props:{question:X,...O.length?{emojis:O}:{}}}]}case"quiz_card":{let O=ae((E=e.outcome)!=null?E:e.quizOutcome),N=B((C=O.answeredId)!=null?C:e.answeredId),F=B((I=O.correctId)!=null?I:e.correctId);return[{kind:"quiz",props:{question:X,options:M,...N||F?{outcome:{answeredId:N,correctId:F}}:{}}}]}default:return[{kind:"poll",props:{question:X,options:M}}]}}case"checklistProgress":{let G=ue(e,["steps","items","tasks","checklist"]),ie=G.length?G:["Step one","Step two","Step three"],X=ie.map((O,N)=>{let F=ae(O);return{id:String(N),label:pe(O),done:F.done===!0||F.checked===!0||F.complete===!0}}),Y=dS((A=(T=(R=e.progress)!=null?R:e.percent)!=null?T:e.progressValue)!=null?A:e.currentValue,40),te={kind:"progress",props:{value:Y}},M=B(($=(P=e.reward)!=null?P:e.prize)!=null?$:e.rewardValue);switch(r){case"streak_reward":case"daily_check_in":{let O=r==="daily_check_in",N=ue(e,["calendarDays","dayLabels","days"]),F=N.map(pe).filter(Boolean),W=N.filter(Ce=>{let Ae=ae(Ce);return Ae.done===!0||Ae.checked===!0||Ae.complete===!0}).length,re=Do(Number((J=(ne=(D=e.filled)!=null?D:e.currentStreak)!=null?ne:e.streakValue)!=null?J:e.streakValueSource),W),ge=N.findIndex(Ce=>ae(Ce).today===!0),he=[{kind:"streak",props:{mode:O?"checkin":"streak",filled:re,...ge>=0?{today:ge+1}:{},...F.length?{labels:F}:{days:Do(Number((Q=e.days)!=null?Q:e.calendarLength),7)},...O&&e.alreadyCheckedIn===!0?{today:-1}:{}}}];return M&&he.push({kind:"callout",props:{icon:"\u{1F381}",text:M}}),he}case"progress_unlock":{let O=Y>=100,N=[te];return M&&N.push({kind:"callout",props:{icon:O?"\u{1F389}":"\u{1F512}",text:O?M:`Unlock ${M}`}}),N}case"goal_tracker":{let O=Number((ce=(fe=e.currentValue)!=null?fe:e.progressValue)!=null?ce:e.current),N=Number((le=(Se=(xe=e.target)!=null?xe:e.goal)!=null?Se:e.targetValue)!=null?le:e.goalValue),F=[te];return F.push({kind:"stat",props:{value:Number.isFinite(O)?Number.isFinite(N)?`${O} / ${N}`:O:`${Math.round(Y)}%`,label:(j=B((V=(H=e.goalLabel)!=null?H:e.unit)!=null?V:e.goalSource))!=null?j:"Progress"}}),F}case"community_challenge":{let O=Number((me=(de=e.participants)!=null?de:e.members)!=null?me:e.joined),N=[te];return Number.isFinite(O)&&N.push({kind:"stat",props:{value:O,label:(se=B(e.participantsLabel))!=null?se:"taking part"}}),G.length&&N.push({kind:"list",props:{items:X.map(F=>({label:F.label}))}}),N}case"guided_setup_wizard":case"first_session_onboarding":return[{kind:"steps",props:{steps:ie.map(N=>{var W,re;let F=ae(N);return{title:pe(N)||void 0,body:B((re=(W=F.body)!=null?W:F.text)!=null?re:F.subtitle)}}),backLabel:B(e.backLabel),skipLabel:B(e.skipLabel),nextLabel:B(e.nextLabel),finalLabel:B(e.finalLabel)}}];default:return[te,{kind:"checklist",props:{items:X}}]}}case"multiStepSheet":{let G=ue(e,["steps","pages","items","screens"]);return[{kind:"steps",props:{steps:(G.length?G:[{}]).map(X=>{var te,M;let Y=ae(X);return{title:pe(X)||void 0,body:B((M=(te=Y.body)!=null?te:Y.text)!=null?M:Y.subtitle)}}),backLabel:B(e.backLabel),skipLabel:B(e.skipLabel),nextLabel:B(e.nextLabel),finalLabel:B(e.finalLabel)}}]}case"sideSheet":return cm(e,s);case"videoCommerce":{let G=[],ie=B(e.video);ie&&G.push({kind:"video",props:{src:ie}});let X=ue(e,["products","items"]).map(te=>{var O,N,F;let M=ae(te);return{id:String((O=M.id)!=null?O:""),image:B((N=M.image)!=null?N:M.imageUrl),title:pe(te),price:(F=M.price)!=null?F:M.amount}}),Y=B(e.productTitle);return!X.length&&Y&&X.push({id:"product",image:B((Ue=e.productImage)!=null?Ue:e.image),title:Y,price:(Ve=e.price)!=null?Ve:e.amount}),G.push({kind:"product-grid",props:{products:X}}),G}default:return cm(e,s)}}function hS(n,e){var u,d,p,f,m,h,b,k,x,y,g,w,v,E,C,I,R,T,A,P,$,D,ne,J,Q,fe,ce,xe,Se,le;let t=[],r=[],s=B((T=(R=(I=(C=(E=(v=(w=(g=(y=(x=(k=(b=(h=(m=(f=(p=(d=(u=n.benefitMessage)!=null?u:n.segmentExplanation)!=null?d:n.availabilityMessage)!=null?p:n.rewardMessage)!=null?f:n.offerMessage)!=null?m:n.proofMessage)!=null?h:n.valueMessage)!=null?b:n.reviewMessage)!=null?k:n.assistantMessage)!=null?x:n.supportMessage)!=null?y:n.arrivalMessage)!=null?g:n.checkoutMessage)!=null?w:n.instruction)!=null?v:n.instructions)!=null?E:n.closedMessage)!=null?C:n.reasonText)!=null?I:n.motivationalText)!=null?R:n.urgencyNote)!=null?T:n.subtitle);s&&s!==e&&t.push({kind:"text",props:{text:s}});let i=ue(n,["actions","ctas"]).map(H=>{var j;let V=ae(H);return{label:pe(H),action:(j=B(V.action))!=null?j:"dismiss",deepLink:B(V.deepLink),variant:"secondary"}}).filter(H=>H.label);i.length&&r.push({kind:"cta",props:{actions:i}});let o=B((fe=(Q=(J=(ne=(D=($=(P=(A=n.price)!=null?A:n.eventTime)!=null?P:n.dateTime)!=null?$:n.goal)!=null?D:n.documentType)!=null?ne:n.lastOrderDate)!=null?J:n.reward)!=null?Q:n.rewardTitle)!=null?fe:n.resultReward);o&&r.push({kind:"badge",props:{text:o}});let a=B((ce=n.eventTitle)!=null?ce:n.passTitle);a&&a!==e&&t.push({kind:"callout",props:{icon:"\u{1F39F}\uFE0F",text:a}});let c=B((xe=n.avatar)!=null?xe:n.avatarUrl);c&&t.unshift({kind:"image",props:{src:c,alt:""}});let l=B(n.itemName);if(l){let H=B(n.oldPrice),V=B(n.newPrice),j=H&&V?`${H} \u2192 ${V}`:(le=(Se=V!=null?V:H)!=null?Se:B(n.stockStatus))!=null?le:B(n.quantity);r.push({kind:"callout",props:{icon:"\u{1F3F7}\uFE0F",text:j?`${l} \xB7 ${j}`:l}})}return{lead:t,trail:r}}function cm(n,e){let t=[],r=ue(n,["bullets","bulletList","benefits","features","newFeatures","perks","perksList","reasonList","digestItems","contentSections","contentBlocks","suggestedActions","points","highlights","dateTimeOptions","tabs","slots"]).map(pe).filter(Boolean);r.length&&t.push({kind:"list",props:{items:r}});let s=ue(n,["plans","planCards","tiers","pricingTiers","packages"]);s.length&&t.push({kind:"table",props:{columns:["Plan","Price"],rows:s.map(a=>{var l,u;let c=ae(a);return[pe(a),String((u=(l=c.price)!=null?l:c.amount)!=null?u:"")]})}});let i=ue(n,["products","productList","productCards","productImages","crossSellItems","recommendations","bundleItems","cartItems","itemList","relatedItems"]);i.length&&t.push({kind:"product-grid",props:{products:i.map(a=>{var l,u,d;let c=ae(a);return{id:String((l=c.id)!=null?l:""),image:B((u=c.image)!=null?u:c.imageUrl),title:pe(a),price:(d=c.price)!=null?d:c.amount}})}});let o=ue(n,["steps","setupSteps","tasks","checklistItems","checklist"]);return o.length&&t.push({kind:"checklist",props:{items:o.map((a,c)=>({id:String(c),label:pe(a),done:ae(a).done===!0}))}}),t}function gS(n,e){var f,m,h,b,k,x,y,g,w,v,E,C,I,R,T,A,P,$,D,ne,J;let t=(f=dm(n.variantKey,um(e)))!=null?f:"",r=ae(e.ext),s=(b=(h=(m=iS[t])!=null?m:lS(r))!=null?h:am[n.layout])!=null?b:am.modal,i=B((k=r.sidePosition)!=null?k:r.position),o=t==="sideSheet"&&(i==="left"||i==="right")?{...s,surfaceOptions:{...s.surfaceOptions,placement:i}}:s,a=[];e.imageUrl&&a.push({kind:"image",props:{src:e.imageUrl,alt:(x=e.title)!=null?x:""}});let c=B((y=r.eyebrow)!=null?y:r.badge);c&&c!==e.title&&c.length<32&&a.push({kind:"badge",props:{text:c}});let l=(T=B(e.title))!=null?T:B((R=(I=(C=(E=(v=(w=(g=r.eventTitle)!=null?g:r.passTitle)!=null?w:r.expandedTitle)!=null?v:r.subject)!=null?E:r.vipTitle)!=null?C:r.offerTitle)!=null?I:r.bubbleLabel)!=null?R:r.peekLabel),u=(A=B(e.body))!=null?A:B(r.expandedBody);l&&a.push({kind:"heading",props:{text:l}}),u&&a.push({kind:"text",props:{text:u}});let d=hS(r,u);a.push(...d.lead),a.push(...mS(t,r,l,n.variantKey,u)),a.push(...d.trail);let p=[];return(P=e.cta)!=null&&P.label&&p.push({label:e.cta.label,action:($=e.cta.action)!=null?$:"dismiss",deepLink:e.cta.deepLink,variant:"primary"}),(D=e.secondaryCta)!=null&&D.label&&p.push({label:e.secondaryCta.label,action:"dismiss",variant:"dismiss"}),p.length&&a.push({kind:"cta",props:{actions:p}}),a.length===0&&a.push({kind:"text",props:{text:e.body}}),{id:n.id,key:(ne=n.variantKey)!=null?ne:n.id,name:(J=e.title)!=null?J:n.id,category:"misc",platforms:["web"],surface:o.surface,surfaceOptions:o.surfaceOptions,blocks:a,priority:"normal",triggers:[{type:"manual"}],dismiss:{xButton:!0,escClose:!0,backdropClose:!0}}}function yS(n,e){var s;let t=(s=e.ext)==null?void 0:s.animationIn,r=typeof t=="string"?bS[t]:void 0;r&&n.style.setProperty("--scalebun-anim-in",r)}function vS(n,e){let t=Ji(e.style),r=(s,i)=>{i&&n.style.setProperty(s,i)};r("--scalebun-accent",t.accent),r("--scalebun-bg",t.cardBg),r("--scalebun-fg",t.bodyColor),r("--scalebun-title",t.titleColor),t.accent?r("--scalebun-accent-fg",Qi(t.accent,t.ctaText)):r("--scalebun-accent-fg",t.ctaText)}async function pm(n,e,t){var m;let[{renderVariant:r},{ShadowHost:s}]=await Promise.all([Promise.resolve().then(()=>(Fo(),om)),Promise.resolve().then(()=>(ls(),nm))]),i=new s;i.ensure(),e.dark===!0&&i.setTheme("dark");let o=i.element();o&&(vS(o,e),yS(o,e));let a=ae(e.ext),c=ap({campaignId:n.id,variantKey:(m=n.variantKey)!=null?m:"",ext:a,preview:n.preview===!0||n.isTest===!0,...Ho?{handler:Ho}:{}});if(c&&tp(n.variantKey)==="load"){let h=await c(1);h.ok&&h.state&&Object.assign(a,h.state)}let l=gS(n,e),u=!1,d=!1,p=()=>{d||(d=!0,queueMicrotask(()=>{try{i.destroy()}catch{}}))},f=await r(l,{onImpression(){},onView(){},onCtaClick(){u||(u=!0,t.onClick())},onInteraction(){},onDismiss(){u||(u=!0,t.onDismiss()),p()},...c?{requestOutcome:c}:{}},{host:i,slots:Lt});return{close:()=>{try{f.close()}catch{}p()}}}var ae,B,Do,pe,ue,sS,iS,oS,qo,Ho,aS,cS,am,dS,uS,pS,fS,bS,fm=S(()=>{"use strict";Zi();cp();fo();lo();ae=n=>n&&typeof n=="object"&&!Array.isArray(n)?n:{},B=n=>typeof n=="string"&&n.length>0?n:void 0,Do=(n,e)=>typeof n=="number"&&Number.isFinite(n)?n:e,pe=n=>{var t,r,s,i;if(typeof n=="string")return n;let e=ae(n);return(i=(s=(r=(t=B(e.label))!=null?t:B(e.title))!=null?r:B(e.text))!=null?s:B(e.name))!=null?i:""},ue=(n,e)=>{for(let t of e)if(Array.isArray(n[t]))return n[t];return[]},sS=new Set(["spinWheel","scratchReveal","slotReward","carouselDeck","countdown","questionFlow","checklistProgress","qrNfc","videoCommerce","celebration","multiStepSheet","sideSheet"]),iS={sideSheet:{surface:"slideover",surfaceOptions:{placement:"right"}},multiStepSheet:{surface:"slideover",surfaceOptions:{placement:"bottom"}}},oS={spin_wheel:"spinWheel",scratch_card:"scratchReveal",mystery_box:"scratchReveal",slot_reward:"slotReward",carousel_story:"carouselDeck",swipe_deck:"carouselDeck",countdown_offer:"countdown",poll_card:"questionFlow",survey_sheet:"questionFlow",nps_prompt:"questionFlow",quiz_card:"questionFlow",product_finder:"questionFlow",preferences_picker:"questionFlow",feedback_capture:"questionFlow",emoji_reaction_bar:"questionFlow",rating_request:"questionFlow",progress_unlock:"checklistProgress",streak_reward:"checklistProgress",daily_check_in:"checklistProgress",goal_tracker:"checklistProgress",interactive_checklist:"checklistProgress",guided_setup_wizard:"checklistProgress",first_session_onboarding:"checklistProgress",community_challenge:"checklistProgress",milestone_celebration:"celebration",celebration_confetti_full_screen:"celebration",nfc_qr_prompt:"qrNfc",wallet_pass_offer:"qrNfc",video_commerce_card:"videoCommerce"},qo=null,Ho=null;aS=new Set(["modal","sheet","bannerToast","fullscreen","anchored","inline"]),cS={overlay:{surface:"modal",surfaceOptions:{placement:"center",size:"md",backdrop:!0}},sheet:{surface:"slideover",surfaceOptions:{placement:"right",resizable:!0}},banner:{surface:"banner",surfaceOptions:{placement:"top"}},fullscreen:{surface:"takeover"},toast:{surface:"toast",surfaceOptions:{placement:"bottom-right"}},bubble:{surface:"toast",surfaceOptions:{placement:"bottom-right"}},anchored:{surface:"popover",surfaceOptions:{placement:"bottom",maxWidth:320}}};am={modal:{surface:"modal",surfaceOptions:{placement:"center",size:"md",backdrop:!0}},fullscreen:{surface:"takeover"},bottom_sheet:{surface:"slideover",surfaceOptions:{placement:"bottom"}},top_banner:{surface:"banner",surfaceOptions:{placement:"top"}},bottom_banner:{surface:"banner",surfaceOptions:{placement:"bottom"}},tooltip:{surface:"toast",surfaceOptions:{placement:"bottom-right"}},toast:{surface:"toast",surfaceOptions:{placement:"bottom-right"}}},dS=(n,e)=>{let t=Number(n);return Number.isFinite(t)?t>0&&t<=1?t*100:t:e},uS=(n,e)=>{var i,o,a,c,l,u,d;if(!n.length)return 0;for(let p of["resultIndex","winningIndex"]){let f=Number(e[p]);if(Number.isInteger(f)&&f>=0&&f<n.length)return f}let t=p=>{var m,h,b;let f=ae(p);return(b=(h=(m=B(f.id))!=null?m:B(f.segmentId))!=null?h:B(f.key))!=null?b:B(f.value)},r=B((a=(o=(i=e.segmentId)!=null?i:e.winningId)!=null?o:e.resultId)!=null?a:e.outcomeId);if(r){let p=n.findIndex(f=>t(f)===r);if(p>=0)return p}let s=B((d=(u=(l=(c=e.resultState)!=null?c:e.rewardValue)!=null?l:e.prize)!=null?u:e.rewardResult)!=null?d:e.resultReward);if(s){let p=s.trim().toLowerCase(),f=n.findIndex(m=>pe(m).trim().toLowerCase()===p);if(f>=0)return f}return 0},pS=n=>{var r;let e=fS(n);if(e)return{target:e};let t=Number((r=n.durationHours)!=null?r:n.hours);return{durationMs:(Number.isFinite(t)&&t>0?t:24)*36e5}},fS=n=>{var l,u,d,p;let e=(d=(u=(l=B(n.endsAt))!=null?l:B(n.deadline))!=null?u:B(n.to))!=null?d:B(n.endAt);if(e)return e;let t=(p=B(n.expiryTime))!=null?p:B(n.expiresAt);if(!t)return;let r=Date.parse(t);if(Number.isFinite(r))return new Date(r).toISOString();let s=t.split(":").map(f=>Number(f));if(!s.length||s.some(f=>!Number.isFinite(f)))return;let[i=0,o=0,a=0]=s.length===3?s:[0,...s],c=((i*60+o)*60+a)*1e3;return c>0?new Date(Date.now()+c).toISOString():void 0};bS={fade:"scalebun-fade .18s ease",fade_scale:"scalebun-pop .16s ease",slide_up:"scalebun-slideup .2s ease",slide_down:"scalebun-slidedown .18s ease",slide_in_right:"scalebun-slide-in-r .2s ease"}});var hm={};_(hm,{installShakeDetector:()=>SS});function SS(n){if(typeof window=="undefined"||typeof DeviceMotionEvent=="undefined")return()=>{};let e=0,t=!1,r,s=l=>{var h,b,k;let u=l.accelerationIncludingGravity;if(!u)return;let d=((h=u.x)!=null?h:0)/Uo,p=((b=u.y)!=null?b:0)/Uo,f=((k=u.z)!=null?k:0)/Uo;if(Math.sqrt(d*d+p*p+f*f)<wS)return;let m=L();if(!(m-e<xS)){e=m;try{n("shake")}catch{}}},i=()=>{t||(t=!0,window.addEventListener("devicemotion",s))},o=()=>{try{return sessionStorage.getItem(mm)}catch{return null}},a=l=>{try{sessionStorage.setItem(mm,l)}catch{}},c=DeviceMotionEvent.requestPermission;if(typeof c=="function"){if(o()==="denied")return()=>{};let l=()=>{r==null||r(),c().then(u=>{a(u==="granted"?"granted":"denied"),u==="granted"&&i()}).catch(()=>{})};window.addEventListener("click",l),window.addEventListener("touchend",l),r=()=>{window.removeEventListener("click",l),window.removeEventListener("touchend",l)}}else i();return()=>{r==null||r(),r=void 0,t&&window.removeEventListener("devicemotion",s),t=!1}}var wS,xS,Uo,mm,gm=S(()=>{"use strict";z();wS=2.3,xS=1500,Uo=9.80665,mm="scalebun_shake_perm"});var bm={};_(bm,{EngageRuntime:()=>Vo});var Vo,ym=S(()=>{"use strict";Tu();Xi();Qu();Zu();fm();Fe();Vo=class{constructor(e){this.deps=e;this.showing=!1;this.startedAt=0;this.campaignsById=new Map;this.shakeInCampaigns=!1;this.shakeInMessages=!1;var t;this.surveys=new nn(r=>this.tryShow(r)),this.inapp=new nn(r=>this.tryShowInApp(r)),lm((t=e.gameHandler)!=null?t:null)}setCampaigns(e){this.campaignsById=new Map(e.map(t=>[t.id,t])),this.surveys.setItems(e),this.shakeInCampaigns=e.some(t=>t.trigger==="shake_device"),this.syncShake()}setMessages(e){let t=e.filter(r=>r.preview);this.inapp.setItems(e.filter(r=>!r.preview)),t.length&&this.maybeShowPreview(t),this.shakeInMessages=e.some(r=>r.trigger==="shake_device"),this.syncShake()}async syncShake(){let e=(this.shakeInCampaigns||this.shakeInMessages)&&!!this.deps.signal;if(e&&!this.shakeTeardown){let{installShakeDetector:t}=await Promise.resolve().then(()=>(gm(),hm));(this.shakeInCampaigns||this.shakeInMessages)&&this.deps.signal&&!this.shakeTeardown&&(this.shakeTeardown=t(r=>this.deps.signal(r)))}else!e&&this.shakeTeardown&&(this.shakeTeardown(),this.shakeTeardown=void 0)}maybeShowPreview(e){if(this.showing)return;let r=e.filter(o=>!o.testRunId||!Gi(o.testRunId)).sort((o,a)=>{var c,l;return((c=a.createdAt)!=null?c:"").localeCompare((l=o.createdAt)!=null?l:"")})[0];if(!r)return;r.testRunId&&Yi(r.testRunId),this.showing=!0;let{spec:s,variantId:i}=this.resolveSpec(r);if(this.inappEvent(r,"impression",i,!0),zo(r,s)){this.showRich(r,s,i,!0);return}this.active=oo(r.layout,s,{onClick:()=>{this.inappEvent(r,"click",i,!0),this.finishInApp(r,!0)},onDismiss:()=>{this.inappEvent(r,"dismiss",i,!0),this.finishInApp(r,!0)}})}showRich(e,t,r,s=!1){pm(e,t,{onClick:()=>{this.inappEvent(e,"click",r,s);let a=t.cta;if((a==null?void 0:a.action)==="link"&&a.deepLink&&/^https?:\/\//i.test(a.deepLink))try{window.location.href=a.deepLink}catch{}this.finishInApp(e,s)},onDismiss:()=>{this.inappEvent(e,"dismiss",r,s),this.finishInApp(e,s)}}).then(a=>{this.showing?this.active=a:a.close()}).catch(()=>{this.finish()})}onScreenView(e,t=0){this.surveys.onScreenView(e,t),this.inapp.onScreenView(e,t)}onSignal(e,t=0){this.surveys.onSignal(e,t),this.inapp.onSignal(e,t)}onCustomEvent(e,t=0){this.surveys.onCustomEvent(e,t),this.inapp.onCustomEvent(e,t)}onLifecycle(e,t,r=0){this.surveys.onLifecycle(e,t,r),this.inapp.onLifecycle(e,t,r)}stop(){var e,t;this.surveys.stop(),this.inapp.stop(),(e=this.shakeTeardown)==null||e.call(this),this.shakeTeardown=void 0,(t=this.active)==null||t.close(),this.active=void 0,this.showing=!1}resolveSpec(e){let t=e.experiment;return t!=null&&t.enabled&&t.variantB&&typeof t.split=="number"?Ee(`${e.id}:${this.deps.deviceId}`)%100<t.split?{spec:t.variantB,variantId:"B"}:{spec:e.spec,variantId:"A"}:{spec:e.spec,variantId:e.variantId}}finishInApp(e,t){t||Mr(e),this.finish()}tryShowInApp(e){if(this.showing||!Tr(e,this.deps.now(),this.deps.sessionId))return;this.showing=!0,Rr(e,this.deps.now(),this.deps.sessionId);let{spec:t,variantId:r}=this.resolveSpec(e);if(this.inappEvent(e,"impression",r),zo(e,t)){this.showRich(e,t,r);return}this.active=oo(e.layout,t,{onClick:s=>{if(this.inappEvent(e,"click",r),s.action==="link"&&s.deepLink&&/^https?:\/\//i.test(s.deepLink))try{window.location.href=s.deepLink}catch{}this.finishInApp(e,!1)},onDismiss:()=>{this.inappEvent(e,"dismiss",r),this.finishInApp(e,!1)}})}inappEvent(e,t,r,s=!1){let i={eventId:this.deps.uuid(),campaignId:e.id,channel:"inapp",type:t,deviceId:this.deps.deviceId,timestamp:new Date(this.deps.now()).toISOString(),schemaVersion:1,meta:{sessionId:this.deps.sessionId,...r?{variantId:r}:{},...this.deps.replayCoord()?{replay:this.deps.replayCoord()}:{},...s?{isTest:!0,...e.previewId?{previewId:e.previewId}:{}}:{}}};this.deps.transport.postEvents([i])}tryShow(e){this.showing||!Tr(e,this.deps.now(),this.deps.sessionId)||(this.showing=!0,this.startedAt=this.deps.now(),Rr(e,this.deps.now(),this.deps.sessionId),this.beacon(e,"shown"),this.event(e,"impression"),this.active=Ju(e,{onStarted:()=>this.beacon(e,"started"),onSubmit:t=>{this.submit(e,t),this.finish()},onDismiss:()=>{this.event(e,"dismiss"),this.finish()}}))}finish(){this.showing=!1,this.active=void 0}async submit(e,t){var a;Mr(e);let r=this.deps.uuid(),s=(a=t.attachments)!=null&&a.length?await this.uploadAttachments(r,t.attachments):void 0,i={responseId:r,surveyId:e.id,schemaVersion:1,score:t.score,text:t.text,answers:t.answers,...s&&s.length?{attachments:s}:{},durationMs:this.deps.now()-this.startedAt,sessionId:this.deps.sessionId,screen:this.deps.currentScreen(),platform:"web",deviceId:this.deps.deviceId,...this.deps.replayCoord()?{replay:this.deps.replayCoord()}:{},clientTs:new Date(this.deps.now()).toISOString()},o=await this.deps.transport.postResponses([i]);return this.event(e,"completion"),o?"success":"error"}async uploadAttachments(e,t){let r=t.map((a,c)=>({attachmentId:`${e}-att-${c}`,responseId:e,kind:a.kind,contentType:a.contentType})),s=await this.deps.transport.presignAttachments(r);if(!s||!s.enabled)return[];let i=new Map(s.attachments.map(a=>[a.attachmentId,a])),o=[];for(let a=0;a<t.length;a++){let c=t[a],l=i.get(`${e}-att-${a}`);l&&await this.deps.transport.putBlob(l.uploadUrl,c.blob,c.contentType)&&o.push({attachmentId:l.attachmentId,kind:c.kind,storageKey:l.storageKey,mime:c.contentType,byteSize:c.blob.size,...c.width!=null?{width:c.width}:{},...c.height!=null?{height:c.height}:{},...c.durationMs!=null?{durationMs:c.durationMs}:{},...c.transcript?{transcript:c.transcript}:{},...c.transcriptApproved!=null?{transcriptApproved:c.transcriptApproved}:{},...c.masked!=null?{masked:c.masked}:{}})}return o}submitFor(e,t){let r=this.campaignsById.get(e);return r?this.submit(r,t):Promise.resolve("error")}emitRatingEvent(e,t={}){let r={eventId:this.deps.uuid(),type:e,ts:new Date(this.deps.now()).toISOString(),sessionId:this.deps.sessionId,...t.promptId?{promptId:t.promptId}:{},...t.triggerId?{triggerId:t.triggerId}:{},...t.variantId?{variantId:t.variantId}:{},...e==="rating_selected"&&typeof t.stars=="number"?{stars:t.stars}:{},...this.deps.replayCoord()?{replay:this.deps.replayCoord()}:{},dims:{platform:"web"}};this.deps.transport.postRatingEvents([r])}beacon(e,t){let r={beaconId:this.deps.uuid(),surveyId:e.id,stage:t,sessionId:this.deps.sessionId,deviceId:this.deps.deviceId,platform:"web",screen:this.deps.currentScreen(),...this.deps.replayCoord()?{replay:this.deps.replayCoord()}:{},clientTs:new Date(this.deps.now()).toISOString()};this.deps.transport.postImpressions([r])}event(e,t){let r={eventId:this.deps.uuid(),campaignId:e.id,channel:"inapp",type:t,deviceId:this.deps.deviceId,timestamp:new Date(this.deps.now()).toISOString(),schemaVersion:1,meta:{sessionId:this.deps.sessionId,...this.deps.replayCoord()?{replay:this.deps.replayCoord()}:{}}};this.deps.transport.postEvents([r])}}});function Wo(n){return n>=200?"critical":n>=100?"warning":"info"}function Ko(n,e){if(e<=0)return{fps:0,dropped:0};let t=Math.min(60,Math.round(n/e*1e3)),r=Math.round(e/1e3*60);return{fps:t,dropped:Math.max(0,r-n)}}function jo(n){return{value:Math.round(n.loadEventEnd||n.duration),metadata:{kind:"page_load",ttfb:Math.round(n.responseStart),dcl:Math.round(n.domContentLoadedEventEnd),navType:n.type}}}var Go=S(()=>{"use strict"});var Sm={};_(Sm,{startCollectors:()=>TS});function TS(n,e){let t,r,s,i,o,a=()=>{if(e()){try{let d=performance.memory,p=d==null?void 0:d.usedJSHeapSize;typeof p=="number"&&p>0&&n("memory",p,{kind:"js_heap",totalHeap:d==null?void 0:d.totalJSHeapSize,heapLimit:d==null?void 0:d.jsHeapSizeLimit})}catch{}i=setTimeout(a,xm)}},c=()=>{var d;try{let p=(d=performance.getEntriesByType)==null?void 0:d.call(performance,"navigation"),f=p==null?void 0:p[0];if(!f||f.loadEventEnd<=0)return;let m=jo(f);n("screen_load",m.value,m.metadata,m.value)}catch{}},l=()=>{var h;let d=window.PerformanceObserver;if(!d)return;let p=(h=d.supportedEntryTypes)!=null?h:[],f=p.includes("long-animation-frame"),m=!f&&p.includes("longtask");if(!(!f&&!m))try{let b=new d(k=>{var x;for(let y of k.getEntries()){let g=f?(x=y.blockingDuration)!=null?x:0:y.duration;g<AS||n("js_stall",Math.round(g),{kind:f?"loaf":"longtask",severity:Wo(g)},Math.round(y.duration))}});b.observe({type:f?"long-animation-frame":"longtask",buffered:!0}),t=b}catch{}},u=()=>{if(!e())return;if(typeof document!="undefined"&&document.visibilityState!=="visible"||typeof requestAnimationFrame=="undefined"){s=setTimeout(u,Yo);return}let d=0,p=performance.now(),f=()=>{if(!e())return;d++;let m=performance.now()-p;if(m<CS)r=requestAnimationFrame(f);else{let{fps:h,dropped:b}=Ko(d,m);n("frame_metrics",h,{totalFrames:d,dropped:b,windowMs:Math.round(m)}),s=setTimeout(u,Yo)}};r=requestAnimationFrame(f)};return document.readyState==="complete"?setTimeout(c,0):(o=()=>setTimeout(c,0),window.addEventListener("load",o,{once:!0})),l(),s=setTimeout(u,Yo),performance.memory&&(i=setTimeout(a,xm)),()=>{t==null||t.disconnect(),r!=null&&typeof cancelAnimationFrame!="undefined"&&cancelAnimationFrame(r),s&&clearTimeout(s),i&&clearTimeout(i),o&&typeof window!="undefined"&&window.removeEventListener("load",o)}}var CS,Yo,AS,xm,km=S(()=>{"use strict";Go();CS=5e3,Yo=25e3,AS=50,xm=3e4});var Mm={};_(Mm,{EXIT_THRESHOLD:()=>Im,EXIT_WEIGHTS:()=>Em,REVERSAL_DEFAULTS:()=>Jo,ScrollReversalDetector:()=>ps,canFire:()=>Rm,isTopExit:()=>Am,reversalMetrics:()=>Tm,startExitIntent:()=>LS});function Am(n,e,t=Cm){return n&&e<=t}function Tm(n,e){let t=n[n.length-1];if(n.length<2||!t)return null;let r=t;for(let o of n)if(t.t-o.t<=e){r=o;break}let s=t.t-r.t;if(s<=0)return null;let i=r.y-t.y;return{distancePx:i,velocityPxMs:i/s}}function Rm(n,e,t,r={}){var s,i;return!(t>=((s=r.maxFires)!=null?s:PS)||e>0&&n-e<((i=r.cooldownMs)!=null?i:MS))}function LS(n,e){if(typeof window=="undefined"||typeof document=="undefined")return{stop:()=>{},fires:()=>0};let t=0,r=0,s={...Jo,...e!=null?e:{}},i=new ps(s),o=()=>{try{return It(window.scrollY||0,document.documentElement.scrollHeight,window.innerHeight||0)}catch{return 0}},a=(u,d)=>{let p=Em[u];if(p===void 0||p<Im||!Rm(Xo(),r,t))return;t++,r=Xo();let f={confidence:p,trigger:u,path:location.pathname,scroll_depth_pct:o(),...d};n.trackEvent("$exit_intent",f),n.signal("exit_intent",f)},c=u=>{Am(!u.relatedTarget,u.clientY,s.topEdgePx)&&a("top_exit",{x:u.clientX|0,y:u.clientY|0,exit_y:Math.round(u.clientY)})},l=()=>{let u=i.push(window.scrollY||0,Xo(),o(),window.innerHeight||0);u&&a("scroll_reversal",{velocity_px_ms:Math.round(u.velocityPxMs*1e3)/1e3,distance_px:Math.round(u.distancePx)})};return document.addEventListener("mouseout",c),window.addEventListener("scroll",l,{passive:!0}),{fires:()=>t,stop:()=>{document.removeEventListener("mouseout",c),window.removeEventListener("scroll",l)}}}var Em,Im,MS,PS,Cm,Jo,ps,Xo,Pm=S(()=>{"use strict";Bn();Em={top_exit:.8,scroll_reversal:.5},Im=.5,MS=3e4,PS=3,Cm=40,Jo={windowMs:120,minDistancePx:80,minVelocityPxMs:.7,minDepthPct:25,sustainSamples:3,topEdgePx:Cm};ps=class{constructor(e=Jo){this.tuning=e;this.buf=[];this.sustained=0;this.maxY=0;this.latched=!1}get maxScrollY(){return this.maxY}get sustainedSamples(){return this.sustained}push(e,t,r,s){for(e>this.maxY&&(this.maxY=e),this.buf.push({y:e,t});this.buf.length>2&&t-this.buf[1].t>this.tuning.windowMs;)this.buf.shift();let i=Tm(this.buf,this.tuning.windowMs);return i!==null&&i.distancePx>=this.tuning.minDistancePx&&i.velocityPxMs>=this.tuning.minVelocityPxMs?(this.sustained+=1,this.latched||this.sustained<this.tuning.sustainSamples||this.maxY<=s||r<this.tuning.minDepthPct?null:(this.latched=!0,i)):(this.sustained=0,this.latched=!1,null)}};Xo=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now()});function Lm(n,e){let t={...OS,...n},r=Le(e,_S),s=i=>r<Math.max(0,Math.min(1,i))*100;switch(t.mode){case"off":return{record:!1,streamFromStart:!1,bucket:r,reason:"off"};case"always":return{record:!0,streamFromStart:!0,bucket:r,reason:"always"};case"sampled":return s(t.sampleRate)?{record:!0,streamFromStart:!0,bucket:r,reason:"sampled-in"}:{record:!1,streamFromStart:!1,bucket:r,reason:"sampled-out"};case"onError":default:return s(t.onErrorSampleRate)?{record:!0,streamFromStart:!1,bucket:r,reason:"onerror-armed"}:{record:!1,streamFromStart:!1,bucket:r,reason:"onerror-out"}}}var _S,OS,_m=S(()=>{"use strict";Fe();_S="wzb-replay-v1",OS={mode:"sampled",sampleRate:1,onErrorSampleRate:1}});var Zo={};_(Zo,{SegmentBuffer:()=>Qo,approxBytes:()=>$t});function $t(n){var i,o;let e=64,t=n.snapshot;if(typeof t=="string")e+=t.length;else if(t)try{e+=JSON.stringify(t).length}catch{e+=4096}let r=n.mutations;if(Array.isArray(r))for(let a of r){e+=40;let c=(o=(i=a.value)!=null?i:a.data)!=null?o:a.css;typeof c=="string"&&(e+=c.length),(a.node||a.doc)&&(e+=256),Array.isArray(a.rules)&&(e+=a.rules.reduce((l,u)=>l+u.length,0))}let s=n.events;return Array.isArray(s)&&(e+=s.length*48),e}var Qo,ms=S(()=>{"use strict";Qo=class{constructor(e,t=1/0){this.maxSegments=e;this.maxBytes=t;this.sealed=[];this.current=null;this.droppedSegments=0;this.accumBytes=0}openSegment(e){var r;this.current&&this.sealed.push(this.current);let t=$t(e);this.current={keyframeId:(r=e.frameId)!=null?r:"",frames:[e],bytes:t},this.accumBytes+=t,this.evict()}append(e){if(!this.current)return!1;let t=$t(e);return this.current.frames.push(e),this.current.bytes+=t,this.accumBytes+=t,this.evict(),!0}evict(){for(;this.sealed.length>0&&(this.sealed.length+1>this.maxSegments||this.accumBytes>this.maxBytes);){let e=this.sealed.shift();this.accumBytes-=e.bytes,this.droppedSegments++}}drainFrames(){let e=[];for(let t of this.sealed)e.push(...t.frames);return this.current&&e.push(...this.current.frames),e}clear(){this.sealed=[],this.current=null,this.accumBytes=0}get currentFrameCount(){var e,t;return(t=(e=this.current)==null?void 0:e.frames.length)!=null?t:0}get currentBytes(){var e,t;return(t=(e=this.current)==null?void 0:e.bytes)!=null?t:0}get totalBytes(){return this.accumBytes}get segmentCount(){return this.sealed.length+(this.current?1:0)}get frameCount(){var e,t;return this.sealed.reduce((r,s)=>r+s.frames.length,0)+((t=(e=this.current)==null?void 0:e.frames.length)!=null?t:0)}get dropped(){return this.droppedSegments}get hasOpenSegment(){return this.current!==null}}});var hs,Om=S(()=>{"use strict";hs=class{constructor(e,t){this.windowMs=e;this.emit=t;this.pending=[];this.timer=null}append(e){e.length&&(this.pending.push(...e),this.timer==null&&(this.timer=setTimeout(()=>this.flush(),this.windowMs)))}flush(){if(this.timer!=null&&(clearTimeout(this.timer),this.timer=null),!this.pending.length)return;let e=this.pending;this.pending=[],this.emit(e)}dispose(){this.flush()}}});function NS(n,e){return n>700||e>800?3:n>350||e>400?2:n>150||e>100?1:0}function Nm(n,e){if(e===0)return n;let t=n.mutations;if(e>=1&&Array.isArray(t)&&t.length>0&&t.every(s=>s.op==="canvas"))return null;let r=n.events;if(Array.isArray(r)&&r.length>0){let s=r.filter(i=>!(e>=2&&i.k==="move"));if(s.length===0)return null;s.length!==r.length&&(n.events=s)}return n}var gs,Bm=S(()=>{"use strict";gs=class{constructor(e){this.egressPending=e;this.longTaskMs=0;this._level=0;if(typeof PerformanceObserver!="undefined")try{this.po=new PerformanceObserver(t=>{for(let r of t.getEntries())this.longTaskMs+=r.duration}),this.po.observe({type:"longtask",buffered:!1})}catch{}typeof setInterval=="function"&&(this.timer=setInterval(()=>this.sample(),1e3))}sample(){var t,r;let e=this.longTaskMs;this.longTaskMs=0,this._level=NS(e,(r=(t=this.egressPending)==null?void 0:t.call(this))!=null?r:0)}get level(){return this._level}dispose(){var e;this.timer&&clearInterval(this.timer),(e=this.po)==null||e.disconnect(),this.po=void 0}}});function ea(n){let e=n;for(let t of FS)e=e.replace(t,BS);return e}function Fm(n){let e=n.snapshot;e&&typeof e=="object"&&bs(e);let t=n.mutations;if(Array.isArray(t))for(let r of t)DS(r)}function bs(n){var e;if(n.t==="tx"||n.t==="cm"){typeof n.value=="string"&&(n.value=ea(n.value));return}if(n.attrs)for(let t in n.attrs)typeof n.attrs[t]=="string"&&(n.attrs[t]=ea(n.attrs[t]));if(Array.isArray(n.children))for(let t of n.children)bs(t);if((e=n.shadow)!=null&&e.children)for(let t of n.shadow.children)bs(t)}function DS(n){(n.op==="text"||n.op==="attr")&&typeof n.value=="string"&&(n.value=ea(n.value)),n.op==="add"&&n.node&&bs(n.node)}var BS,FS,Dm=S(()=>{"use strict";BS="[redacted]",FS=[/\b[\w.+-]+@[\w-]+\.[\w.-]+\b/g,/\b[A-Z]{2}\d{2}[A-Z0-9]{10,30}\b/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b(?:\d[ -]?){13,18}\d\b/g,/(?:\+\d{1,3}[\s.-]?)?\(?\d{2,4}\)?[\s.-]\d{2,4}[\s.-]\d{2,4}(?:[\s.-]\d{2,4})?/g]});var $m={};_($m,{deviceMemoryGB:()=>Hm,networkHint:()=>qm,shouldDeferHeavyEgress:()=>ta,userOptedOutOfTracking:()=>HS});function qS(){if(typeof navigator!="undefined")return navigator.connection}function qm(){let n=qS(),e=typeof(n==null?void 0:n.effectiveType)=="string"?n.effectiveType:void 0;return{saveData:(n==null?void 0:n.saveData)===!0,slow:e==="2g"||e==="slow-2g",effectiveType:e}}function HS(){var t;if(typeof navigator=="undefined")return!1;let n=navigator;if(n.globalPrivacyControl===!0)return!0;let e=(t=n.doNotTrack)!=null?t:typeof window!="undefined"?window.doNotTrack:void 0;return e==="1"||e==="yes"}function Hm(){if(typeof navigator=="undefined")return;let n=navigator.deviceMemory;return typeof n=="number"?n:void 0}function ta(){let n=qm();if(n.saveData||n.slow)return!0;let e=Hm();return typeof e=="number"&&e<=1}var na=S(()=>{"use strict"});function ra(){try{if(typeof sessionStorage!="undefined"){let n=sessionStorage.getItem(zm);return n||(n=`t_${q()}`,sessionStorage.setItem(zm,n)),n}}catch{}return ys!=null?ys:ys=`t_${q()}`}function sa(){try{return typeof location!="undefined"?location.pathname+location.search:void 0}catch{return}}function ia(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}var zm,ys,Um=S(()=>{"use strict";z();zm="scalebun_replay_tab"});var aa={};_(aa,{GZ_PREFIX:()=>un,ReplayEncoder:()=>oa,decodeSnapshotValue:()=>zS,gunzipBase64:()=>Wm,gzipBase64:()=>Vm});async function Vm(n){let e=new CompressionStream("gzip"),t=e.writable.getWriter();t.write(new TextEncoder().encode(n)),t.close();let r=await new Response(e.readable).arrayBuffer();return US(new Uint8Array(r))}async function Wm(n){let e=atob(n),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);let r=new DecompressionStream("gzip"),s=r.writable.getWriter();return s.write(t),s.close(),await new Response(r.readable).text()}async function zS(n){return typeof n=="string"&&n.startsWith(un)?JSON.parse(await Wm(n.slice(un.length))):n}function US(n){let e="";for(let r=0;r<n.length;r+=32768)e+=String.fromCharCode.apply(null,Array.from(n.subarray(r,r+32768)));return btoa(e)}var un,$S,oa,ca=S(()=>{"use strict";un="gz:",$S=`
572
+ self.onmessage = async (e) => {
573
+ const { id, json } = e.data;
574
+ try {
575
+ const cs = new CompressionStream('gzip');
576
+ const w = cs.writable.getWriter();
577
+ w.write(new TextEncoder().encode(json)); w.close();
578
+ const ab = await new Response(cs.readable).arrayBuffer();
579
+ const bytes = new Uint8Array(ab);
580
+ let bin = ''; const CH = 0x8000;
581
+ for (let i = 0; i < bytes.length; i += CH) bin += String.fromCharCode.apply(null, bytes.subarray(i, i + CH));
582
+ self.postMessage({ id, out: btoa(bin) });
583
+ } catch (err) {
584
+ self.postMessage({ id, err: String(err) });
585
+ }
586
+ };
587
+ `,oa=class{constructor(){this.worker=null;this.url=null;this.nextId=1;this.pending=new Map;this.tryInitWorker()}tryInitWorker(){if(!(typeof Worker=="undefined"||typeof Blob=="undefined"||typeof URL=="undefined")&&typeof CompressionStream!="undefined")try{let e=new Blob([$S],{type:"application/javascript"});this.url=URL.createObjectURL(e),this.worker=new Worker(this.url),this.worker.onmessage=t=>{let{id:r,out:s,err:i}=t.data,o=this.pending.get(r);o&&(this.pending.delete(r),i!=null?o.reject(new Error(i)):o.resolve(s))},this.worker.onerror=()=>this.disableWorker()}catch{this.disableWorker()}}disableWorker(){var e;try{(e=this.worker)==null||e.terminate()}catch{}if(this.worker=null,this.url){try{URL.revokeObjectURL(this.url)}catch{}this.url=null}for(let t of this.pending.values())t.reject(new Error("worker disabled"));this.pending.clear()}async encodeSnapshot(e){let t;try{t=JSON.stringify(e)}catch{return e}if(this.worker)try{return un+await this.viaWorker(t)}catch{this.disableWorker()}if(typeof CompressionStream!="undefined")try{return un+await Vm(t)}catch{}return e}viaWorker(e){return new Promise((t,r)=>{let s=this.nextId++,i=setTimeout(()=>{this.pending.delete(s)&&r(new Error("worker timeout"))},5e3);this.pending.set(s,{resolve:o=>{clearTimeout(i),t(o)},reject:o=>{clearTimeout(i),r(o)}}),this.worker.postMessage({id:s,json:e})})}dispose(){this.disableWorker()}}});function Km(n){var e;return(e=n.shadowRoot)!=null?e:null}function vs(n,e){e.remove(n);let t=Km(n);t&&t.childNodes.forEach(r=>vs(r,e)),n.childNodes.forEach(r=>vs(r,e))}function ws(n,e=[]){let t=Km(n);return t&&(e.push(t),t.childNodes.forEach(r=>ws(r,e))),n.childNodes.forEach(r=>ws(r,e)),e}function la(n,e){e.add(n),n.childNodes.forEach(t=>la(t,e))}var jm=S(()=>{"use strict"});var da={};_(da,{MutationRecorder:()=>mt,buildMutations:()=>Gm});function VS(n){xs.add(n),!(zt||typeof Element=="undefined"||typeof Element.prototype.attachShadow!="function")&&(zt=Element.prototype.attachShadow,Element.prototype.attachShadow=function(e){let t=zt.call(this,e);if(e&&e.mode==="open")for(let r of xs)try{r(this,t)}catch{}return t})}function WS(n){xs.delete(n),xs.size===0&&zt&&(Element.prototype.attachShadow=zt,zt=null)}function Ss(n,e){n.childNodes.forEach(t=>{if(t.nodeType!==1)return;let r=t,s=r.shadowRoot;s&&(e(r,s),Ss(s,e)),Ss(r,e)})}function Gm(n,e,t){var p,f,m,h,b,k,x,y;let r=new Map,s=new Map,i=[],o=[];for(let g of n)if(g.type==="attributes"){if(!g.attributeName)continue;let w=g.target.getAttribute(g.attributeName);if(w!=null&&t.maskAllInputs&&Nr.has(g.attributeName)&&(w=Ge(w)),w!=null&&g.attributeName==="value"&&Rt(g.target)&&(w=Mt(w)),w!=null){let E=g.target;w=Dr(g.attributeName,w,(f=(p=E.tagName)==null?void 0:p.toLowerCase())!=null?f:"",(h=(m=E.ownerDocument)==null?void 0:m.baseURI)!=null?h:"")}let v=r.get(g.target);v||r.set(g.target,v=new Map),v.set(g.attributeName,w)}else if(g.type==="characterData"){let w=(k=(b=g.target.parentNode)==null?void 0:b.nodeName)!=null?k:"",v=g.target.data,E=t.maskAllText||Br(g.target.parentElement,t.maskSel);s.set(g.target,E&&!Or.has(w)?Ge(v):v)}else g.type==="childList"&&(g.removedNodes.forEach(w=>i.push({node:w,parent:g.target})),g.addedNodes.forEach(w=>o.push({node:w,parent:g.target,next:g.nextSibling})));let a=[];for(let{node:g,parent:w}of i){let v=e.getId(g);v!=null&&(a.push({op:"remove",parent:(x=e.getId(w))!=null?x:0,id:v}),vs(g,e))}let c=new Set,l=[];for(let{node:g,parent:w,next:v}of o){if(c.has(g)||!g.isConnected)continue;let E=e.getId(w);if(E==null)continue;let C=Ye(g,e,t);C&&(la(g,c),l.push({op:"add",parent:E,next:v&&(y=e.getId(v))!=null?y:null,node:C}))}let u=[];for(let[g,w]of r){let v=e.getId(g);if(v!=null)for(let[E,C]of w)u.push({op:"attr",id:v,key:E,value:C})}let d=[];for(let[g,w]of s){let v=e.getId(g);v!=null&&d.push({op:"text",id:v,value:w})}return[...a,...l,...u,...d]}var xs,zt,mt,pn=S(()=>{"use strict";tt();jm();xs=new Set,zt=null;mt=class{constructor(e,t,r={}){this.reg=e;this.onMutations=t;this.observer=null;this.queued=[];this.scheduled=!1;this.rafId=null;this.shadowObservers=new Map;this.shadowHandler=null;this.observedDoc=null;this.o=et(r)}observe(e){var t;typeof MutationObserver!="undefined"&&(this.observer=new MutationObserver(r=>this.enqueue(r)),this.observer.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),this.observedDoc=(t=e.ownerDocument)!=null?t:e,Ss(e,(r,s)=>this.observeShadowRoot(s)),this.shadowHandler=(r,s)=>{if(r.ownerDocument!==this.observedDoc)return;let i=!this.shadowObservers.has(s);this.observeShadowRoot(s);let o=this.reg.getId(r);i&&o!=null&&this.onMutations([{op:"shadow",host:o,shadow:Fr(s,this.reg,this.o)}])},VS(this.shadowHandler))}observeShadowRoot(e){if(this.shadowObservers.has(e)||typeof MutationObserver=="undefined")return;let t=new MutationObserver(r=>this.enqueue(r));t.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),this.shadowObservers.set(e,t),Ss(e,(r,s)=>this.observeShadowRoot(s))}enqueue(e){this.queued.push(...e),!this.scheduled&&(this.scheduled=!0,typeof requestAnimationFrame=="function"?this.rafId=requestAnimationFrame(()=>this.drain()):queueMicrotask(()=>this.drain()))}drain(){this.scheduled=!1,this.rafId=null,this.observer&&this.queued.push(...this.observer.takeRecords()),this.takeShadowRecords();let e=this.queued;this.queued=[],this.process(e)}flush(){this.rafId!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.scheduled=!1,this.rafId=null,this.observer&&this.queued.push(...this.observer.takeRecords()),this.takeShadowRecords();let e=this.queued;this.queued=[],this.process(e)}disconnect(){var e;this.rafId!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),(e=this.observer)==null||e.disconnect(),this.observer=null;for(let t of this.shadowObservers.values())t.disconnect();this.shadowObservers.clear(),this.shadowHandler&&(WS(this.shadowHandler),this.shadowHandler=null),this.observedDoc=null,this.queued=[],this.scheduled=!1,this.rafId=null}takeShadowRecords(){for(let e of this.shadowObservers.values())this.queued.push(...e.takeRecords())}process(e){if(!e.length)return;this.releaseRemovedShadowRoots(e);let t=Gm(e,this.reg,this.o);t.length&&this.onMutations(t)}releaseRemovedShadowRoots(e){if(this.shadowObservers.size!==0)for(let t of e)t.type==="childList"&&t.removedNodes.forEach(r=>{if(!r.isConnected)for(let s of ws(r)){let i=this.shadowObservers.get(s);i&&(i.disconnect(),this.shadowObservers.delete(s))}})}}});var pa={};_(pa,{InteractionRecorder:()=>ua});function Ym(){try{return typeof location!="undefined"?location.href:""}catch{return""}}function GS(n){var r;let e=(r=n.getAttribute)==null?void 0:r.call(n,"role");if(e)return e;let t=n.tagName.toLowerCase();if(t==="a")return"link";if(t==="button"||t==="summary")return"button";if(t==="input"||t==="select"||t==="textarea"||t==="label")return"input"}function YS(n,e){var s,i,o,a,c,l,u;let t=d=>d&&d.trim()?d.trim():"",r=t((s=n.getAttribute)==null?void 0:s.call(n,"aria-label"))||t((i=n.getAttribute)==null?void 0:i.call(n,"title"))||t((o=n.getAttribute)==null?void 0:o.call(n,"alt"))||t((a=n.getAttribute)==null?void 0:a.call(n,"name"))||t((c=n.getAttribute)==null?void 0:c.call(n,"placeholder"));if(!r&&!e&&(r=t(n.innerText||n.textContent)),!r){let d=t((l=n.getAttribute)==null?void 0:l.call(n,"id")),p=t((((u=n.getAttribute)==null?void 0:u.call(n,"class"))||"").split(/\s+/)[0]);r=d?`#${d}`:p?`.${p}`:""}return r=r.replace(/\s+/g," ").trim(),r?r.slice(0,40):void 0}function XS(n,e){var t,r;try{let s=n;if(s&&s.nodeType!==1&&(s=s.parentElement),!s||s.nodeType!==1)return;let i=s,o=(r=(t=i.closest)==null?void 0:t.call(i,jS))!=null?r:null,a=o!=null?o:i;return{tag:a.tagName.toLowerCase(),interactive:!!o,role:o?GS(a):void 0,label:YS(a,e)}}catch{return}}function Xm(n){for(let e=0;e<n.length;e++)if(n[e].nodeType===1)return!0;return!1}function JS(n,e){var s,i,o;let t=n,r=0;for(;t&&r++<500;){if(t===e)return!0;let a=(i=t.parentNode)!=null?i:(s=t.getRootNode)==null?void 0:s.call(t);t=a&&a!==t?(o=a.host)!=null?o:a:null}return!1}var KS,ua,jS,fa=S(()=>{"use strict";tt();KS={moveThrottleMs:50,scrollThrottleMs:100,flushMs:100,moveFlushMs:300,deadMs:700,rageWindowMs:800,rageRadius:30,rageMin:3,maskInputs:!0,maskText:!0},ua=class{constructor(e,t,r={}){this.reg=e;this.onEvents=t;this.pending=[];this.listeners=[];this.timer=null;this.deadTimers=new Set;this.deadObservers=new Set;this.lastMoveT=0;this.lastScrollT=0;this.lastActivityT=0;this.clickHistory=[];this.startHref="";this.frameOffsets=new Map;this.pendingSince=0;this.onTick=()=>{this.pending.length&&(this.pending.every(e=>e.k==="move")&&Date.now()-this.pendingSince<this.o.moveFlushMs||this.flush())};this.onMove=e=>{let t=e,r=Date.now();if(r-this.lastMoveT<this.o.moveThrottleMs)return;this.lastMoveT=r;let s=this.offsetFor(e.target),i=this.rootScroll(e.target);this.queue({k:"move",x:t.clientX+s.x,y:t.clientY+s.y,sx:i.sx,sy:i.sy,t:r},"move")};this.onClick=e=>{var h,b;let t=e,r=Date.now(),s=e.target,i=(h=s==null?void 0:s.hasAttribute)!=null&&h.call(s,"data-scalebun")?null:(b=e.composedPath)==null?void 0:b.call(e)[0],o=i!=null&&i.tagName?i:s,a=this.reg.getId(o),c=this.offsetFor(o),l=this.rootScroll(o),u=t.clientX+c.x,d=t.clientY+c.y;this.clickHistory=this.clickHistory.filter(k=>r-k.t<this.o.rageWindowMs);let p=this.clickHistory.filter(k=>Math.hypot(k.x-u,k.y-d)<=this.o.rageRadius);this.clickHistory.push({x:u,y:d,t:r});let f=p.length+1>=this.o.rageMin,m=XS(o,this.o.maskText);this.queue({k:"click",x:u,y:d,sx:l.sx,sy:l.sy,id:a,t:r,...f?{rage:!0}:{},...m?{el:m}:{}},"immediate"),this.armDeadCheck(o,{x:u,y:d,sx:l.sx,sy:l.sy,id:a,at:r,el:m})};this.onScroll=e=>{var o,a,c,l;let t=Date.now();if(t-this.lastScrollT<this.o.scrollThrottleMs)return;this.lastScrollT=t;let r=e.target,s=(o=r.documentElement)!=null?o:r,i=(a=this.reg.getId(s))!=null?a:0;this.queue({k:"scroll",id:i,x:(c=s.scrollLeft)!=null?c:0,y:(l=s.scrollTop)!=null?l:0,t},"fast")};this.onInput=e=>{var a,c,l;let t=e.target,r=this.reg.getId(t);if(r==null)return;let s=(a=t.value)!=null?a:"";Rt(t)?s=Mt(s):this.o.maskInputs&&(s=Ge(s));let i=((l=(c=t.getAttribute)==null?void 0:c.call(t,"type"))!=null?l:"").toLowerCase(),o=t.tagName==="INPUT"&&(i==="checkbox"||i==="radio");this.queue({k:"input",id:r,value:s,t:Date.now(),...o?{checked:!!t.checked}:{}},"fast")};this.onResize=()=>{this.queue({k:"viewport",w:window.innerWidth,h:window.innerHeight,t:Date.now()},"fast")};this.o={...KS,...r}}notifyDomActivity(e=Date.now()){this.lastActivityT=e}observe(){typeof document!="undefined"&&(this.startHref=Ym(),this.add(document,"mousemove",this.onMove,!0),this.add(document,"click",this.onClick,!0),this.add(document,"scroll",this.onScroll,!0),this.add(document,"input",this.onInput,!0),typeof window!="undefined"&&this.add(window,"resize",this.onResize,!0),this.timer=setInterval(this.onTick,this.o.flushMs))}queue(e,t){var r,s;if(this.pending.length||(this.pendingSince=Date.now()),this.pending.push(e),t==="immediate"){try{(s=(r=this.o).beforeImmediateFlush)==null||s.call(r)}catch{}this.flush()}}observeFrame(e,t){this.frameOffsets.has(e)||(this.frameOffsets.set(e,t),this.add(e,"mousemove",this.onMove,!0),this.add(e,"click",this.onClick,!0),this.add(e,"scroll",this.onScroll,!0),this.add(e,"input",this.onInput,!0))}unobserveFrame(e){this.frameOffsets.delete(e)&&(this.listeners=this.listeners.filter(t=>{if(t.target===e){try{t.target.removeEventListener(t.type,t.fn,t.capture)}catch{}return!1}return!0}))}rootScroll(e){var t,r,s,i,o,a,c,l,u,d;try{let p=e&&e.ownerDocument||(typeof document!="undefined"?document:null);if(!p)return{sx:0,sy:0};let f=p.defaultView,m=(o=(i=(r=f==null?void 0:f.scrollX)!=null?r:(t=p.documentElement)==null?void 0:t.scrollLeft)!=null?i:(s=p.body)==null?void 0:s.scrollLeft)!=null?o:0,h=(d=(u=(c=f==null?void 0:f.scrollY)!=null?c:(a=p.documentElement)==null?void 0:a.scrollTop)!=null?u:(l=p.body)==null?void 0:l.scrollTop)!=null?d:0;return{sx:Math.round(m),sy:Math.round(h)}}catch{return{sx:0,sy:0}}}offsetFor(e){let t=e&&e.ownerDocument||null,r=t?this.frameOffsets.get(t):void 0;if(!r)return{x:0,y:0};try{return r()}catch{return{x:0,y:0}}}flush(){if(!this.pending.length)return;let e=this.pending;this.pending=[],this.onEvents(e)}disconnect(){for(let e of this.listeners)e.target.removeEventListener(e.type,e.fn,e.capture);this.listeners=[],this.timer&&clearInterval(this.timer),this.timer=null;for(let e of this.deadTimers)clearTimeout(e);this.deadTimers.clear();for(let e of this.deadObservers)try{e.disconnect()}catch{}this.deadObservers.clear(),this.frameOffsets.clear(),this.pending=[]}add(e,t,r,s){e.addEventListener(t,r,s),this.listeners.push({target:e,type:t,fn:r,capture:s})}armDeadCheck(e,t){let{x:r,y:s,id:i,at:o,el:a}=t,c=e&&e.nodeType===1&&e.isConnected?e:null,l=!1,u=null,d=()=>{if(u){try{u.disconnect()}catch{}this.deadObservers.delete(u),u=null}};if(typeof MutationObserver!="undefined"&&typeof document!="undefined")try{u=new MutationObserver(f=>{for(let m of f){let h=c?JS(m.target,c):!1,b=m.type==="childList"&&(Xm(m.addedNodes)||Xm(m.removedNodes));if(h||b){l=!0;break}}l&&d()}),u.observe(document,{subtree:!0,childList:!0}),c&&u.observe(c,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),this.deadObservers.add(u)}catch{l=!0}else l=!0;let p=setTimeout(()=>{this.deadTimers.delete(p),d(),!l&&Ym()===this.startHref&&this.queue({k:"deadclick",x:r,y:s,sx:t.sx,sy:t.sy,id:i,t:o,...a?{el:a}:{}},"immediate")},this.o.deadMs);this.deadTimers.add(p)}};jS='a[href],button,input,select,textarea,label,summary,[role=button],[role=link],[role=menuitem],[role=tab],[role=checkbox],[role=radio],[role=switch],[contenteditable=""],[contenteditable=true],[tabindex]:not([tabindex="-1"])'});var th={};_(th,{bridgeCrossOriginFrame:()=>ma,installChildSatellite:()=>QS,nodeIdBaseFor:()=>ha});function QS(n,e={}){if(typeof window=="undefined"||window.parent===window)return()=>{};let t=et(e),r,s=!1,i=o=>{let a=o.data;if(!a||a.scalebun!==Jm||s||!eh(o.origin,n))return;s=!0;let c=new on(typeof a.nodeIdBase=="number"?a.nodeIdBase:1),l=d=>{var p;try{(p=o.source)==null||p.postMessage(d,o.origin)}catch{}},u=Ye(document,c,t);u&&l({scalebun:Qm,doc:u}),r=new mt(c,d=>l({scalebun:Zm,mutations:d}),e),r.observe(document.documentElement)};return window.addEventListener("message",i),()=>{window.removeEventListener("message",i),r==null||r.disconnect()}}function ma(n,e,t){let r=n.contentWindow;if(!r)return()=>{};let s=a=>{if(a.source!==r||!eh(a.origin,t.allowedChildOrigins))return;let c=a.data;c&&(c.scalebun===Qm&&c.doc?t.emit([{op:"iframe",id:e,doc:c.doc}]):c.scalebun===Zm&&Array.isArray(c.mutations)&&t.emit(c.mutations))};window.addEventListener("message",s);let i="*";try{i=new URL(n.src,location.href).origin}catch{}let o=()=>{try{r.postMessage({scalebun:Jm,nodeIdBase:t.nodeIdBase},i)}catch{}};return o(),n.addEventListener("load",o),()=>{window.removeEventListener("message",s),n.removeEventListener("load",o)}}var Jm,Qm,Zm,eh,ha,ga=S(()=>{"use strict";an();tt();pn();Jm="scalebun:frame-init",Qm="scalebun:frame-key",Zm="scalebun:frame-mut",eh=(n,e)=>e.includes("*")||e.includes(n);ha=n=>n*1e6});var ya={};_(ya,{IframeManager:()=>ba});var ba,va=S(()=>{"use strict";tt();pn();ga();ba=class{constructor(e,t,r={},s={}){this.reg=e;this.onMutations=t;this.attached=new Map;this.loadListeners=[];this.bridges=new Map;this.started=!1;var i,o;this.o=et(r),this.onFrame=s.onFrame,this.onUnframe=s.onUnframe,this.maxDepth=(i=s.maxDepth)!=null?i:3,this.frameOrigins=(o=s.frameOrigins)!=null?o:[]}start(){this.started||typeof document=="undefined"||(this.started=!0,this.installLoad(document,0),this.scan(document,0))}scan(e,t){if(!(t>this.maxDepth)){this.sweep();try{e.querySelectorAll("iframe").forEach(r=>this.attach(r,t))}catch{}}}sweep(){var e;if(this.attached.size)for(let[t,{doc:r,rec:s}]of this.attached)t.isConnected||(s.disconnect(),(e=this.onUnframe)==null||e.call(this,r),this.attached.delete(t));if(this.bridges.size)for(let[t,r]of this.bridges)t.isConnected||(r(),this.bridges.delete(t))}installLoad(e,t){let r=s=>{let i=s.target;i&&i.tagName==="IFRAME"&&this.attach(i,t)};try{e.addEventListener("load",r,!0),this.loadListeners.push({doc:e,fn:r})}catch{}}attach(e,t){var c,l;if(t>this.maxDepth)return;let r=null;try{r=e.contentDocument}catch{this.bridgeCrossOrigin(e);return}if(!r||!r.documentElement){this.bridgeCrossOrigin(e);return}let s=this.attached.get(e);if(s){if(s.doc===r)return;s.rec.disconnect(),(c=this.onUnframe)==null||c.call(this,s.doc),this.attached.delete(e)}let i=this.reg.getId(e);if(i==null)return;let o=Ye(r,this.reg,this.o);o&&this.onMutations([{op:"iframe",id:i,doc:o}]);let a=new mt(this.reg,this.onMutations,this.o);a.observe(r.documentElement),this.attached.set(e,{doc:r,rec:a}),(l=this.onFrame)==null||l.call(this,r,()=>{try{let u=e.getBoundingClientRect();return{x:u.left,y:u.top}}catch{return{x:0,y:0}}}),t<this.maxDepth&&(this.installLoad(r,t+1),this.scan(r,t+1))}bridgeCrossOrigin(e){if(!this.frameOrigins.length||this.bridges.has(e))return;let t=this.reg.getId(e);if(t==null)return;let r=ma(e,t,{nodeIdBase:ha(t),allowedChildOrigins:this.frameOrigins,emit:this.onMutations});this.bridges.set(e,r)}subDocuments(){return this.sweep(),[...this.attached.values()].map(e=>e.doc)}disconnect(){for(let{rec:e}of this.attached.values())e.disconnect();this.attached.clear();for(let e of this.bridges.values())e();this.bridges.clear();for(let{doc:e,fn:t}of this.loadListeners)try{e.removeEventListener("load",t,!0)}catch{}this.loadListeners=[],this.started=!1}}});var nh={};_(nh,{CanvasRecorder:()=>wa});var ZS,wa,rh=S(()=>{"use strict";ZS="data-scalebun-block",wa=class{constructor(e,t,r=()=>{},s={}){this.reg=e;this.onMutations=t;this.log=r;this.timer=null;this.last=new Map;this.tainted=new Set;this.scratch=null;var i,o,a;this.intervalMs=Math.max(50,Math.round(1e3/((i=s.fps)!=null?i:3))),this.maxDim=(o=s.maxDim)!=null?o:1024,this.quality=(a=s.quality)!=null?a:.6,this.getDocs=s.getDocs}start(){typeof document!="undefined"&&(this.capture(),this.timer=setInterval(()=>this.capture(),this.intervalMs))}disconnect(){this.timer&&clearInterval(this.timer),this.timer=null,this.last.clear(),this.tainted.clear(),this.scratch=null}capture(){let e=this.getDocs?this.getDocs():typeof document!="undefined"?[document]:[],t=[],r=new Set;for(let s of e){let i;try{i=s.querySelectorAll("canvas")}catch{continue}i.forEach(o=>{let a=this.reg.getId(o);if(a==null||(r.add(a),o.hasAttribute(ZS)))return;let c=o.width,l=o.height;if(!c||!l)return;let u;try{u=this.encode(o,c,l)}catch{this.tainted.has(a)||(this.tainted.add(a),this.log("[scalebun] canvas not capturable (tainted / cross-origin)"));return}this.last.get(a)!==u&&(this.last.set(a,u),t.push({op:"canvas",id:a,data:u,w:c,h:l}))})}if(this.last.size>r.size)for(let s of this.last.keys())r.has(s)||this.last.delete(s);if(this.tainted.size)for(let s of this.tainted)r.has(s)||this.tainted.delete(s);t.length&&this.onMutations(t)}encode(e,t,r){var i;let s=Math.min(1,this.maxDim/Math.max(t,r));if(s<1){let o=(i=this.scratch)!=null?i:this.scratch=document.createElement("canvas");o.width=Math.max(1,Math.round(t*s)),o.height=Math.max(1,Math.round(r*s));let a=o.getContext("2d");if(!a)throw new Error("no 2d context");return a.clearRect(0,0,o.width,o.height),a.drawImage(e,0,0,o.width,o.height),o.toDataURL("image/webp",this.quality)}return e.toDataURL("image/webp",this.quality)}}});var sh={};_(sh,{installCadence:()=>tk});function tk(n){var r;let e=[];if(n.keyframeIntervalMs>0&&n.keyframeIntervalMs!==1/0){let s=setInterval(()=>n.onCheckpoint("time"),n.keyframeIntervalMs);e.push(()=>clearInterval(s))}if(typeof document!="undefined"){let s=()=>{document.visibilityState==="visible"&&n.onCheckpoint("visible")};document.addEventListener("visibilitychange",s),e.push(()=>document.removeEventListener("visibilitychange",s))}if(typeof window!="undefined"&&typeof history!="undefined"&&typeof location!="undefined"){let s=location.href,i=()=>{location.href!==s&&(s=location.href,n.onCheckpoint("url"))};window.addEventListener("popstate",i),window.addEventListener("hashchange",i);let o=history.pushState,a=history.replaceState;history.pushState=function(...c){let l=o.apply(this,c);return i(),l},history.replaceState=function(...c){let l=a.apply(this,c);return i(),l},e.push(()=>{window.removeEventListener("popstate",i),window.removeEventListener("hashchange",i),history.pushState!==o&&(history.pushState=o),history.replaceState!==a&&(history.replaceState=a)})}let t=(r=n.uiStateSignature)!=null?r:Mc;if(t&&typeof MutationObserver!="undefined"&&typeof document!="undefined"){let s=t(),i,o=()=>{i=void 0;let c=t();c!==s&&(s=c,n.onCheckpoint("ui-state"))},a=new MutationObserver(()=>{var c;i!==void 0&&clearTimeout(i),i=setTimeout(o,(c=n.uiStateSettleMs)!=null?c:ek)});a.observe(document.documentElement,{subtree:!0,attributes:!0,attributeFilter:["aria-expanded","open"]}),e.push(()=>{i!==void 0&&clearTimeout(i),a.disconnect()})}return()=>{for(let s of e)try{s()}catch{}}}var ek,ih=S(()=>{"use strict";z();ek=250});var lh={};_(lh,{RecorderController:()=>Es,createRecorder:()=>dk});function lk(n){if(n.frameType==="keyframe")return"keyframe";let e=n.mutations;if(e!=null&&e.length)return e.every(r=>r.op==="canvas")?"canvas":"mutation";let t=n.events;return t!=null&&t.length?t.some(r=>r.k==="click"||r.k==="deadclick"||r.k==="input")?"interaction":t.some(r=>r.k==="scroll"||r.k==="viewport")?"scroll":"move":"other"}async function dk(n,e){let t=new Es(n,e);return await t.init(),t}function ah(){try{return typeof window!="undefined"?{width:window.innerWidth,height:window.innerHeight}:void 0}catch{return}}function ch(){try{return typeof location!="undefined"?location.href:void 0}catch{return}}var oh,ks,rk,sk,ik,ok,ak,ck,Es,dh=S(()=>{"use strict";z();Kt();Ln();ms();Om();Bm();Dm();na();Um();Cn();oh=120,ks=2e5,rk=8,sk=2e6,ik=3e4,ok=5*6e4,ak=100,ck=300;Es=class{constructor(e,t){this.ctx=e;this.decision=t;this.active=!1;this.seq=ei(0);this.keyframeId="";this.checkpointing=!1;this.dirtySinceKeyframe=!1;this.lastKeyframeAt=0;this.streamChainBytes=0;this.streamChainFrames=0;this.lastShed=0;this.pendingEncodes=new Set;this.shed=0;this.producerCounts={};this.redactPII=!1;this.paused=!1;var r,s;this.streaming=t.streamFromStart,this.streaming&&ta()&&(this.streaming=!1,e.log("[replay] save-data/slow \u2192 buffered")),this.persistBuffer=!!((r=e.replaySampling)!=null&&r.persistBuffer)&&!this.streaming,this.maskText=(s=e.maskReplayText)!=null?s:!1}nextSeq(){let e=ei(1);return this.seq=e+1,e}get isActive(){return this.active}stats(){var t,r,s,i,o,a;let e=this.segBuf;return{recording:this.active&&!this.paused,paused:this.paused,streaming:this.streaming,sampleReason:this.decision.reason,sampleBucket:this.decision.bucket,qualityLevel:(r=(t=this.adaptive)==null?void 0:t.level)!=null?r:0,segments:(s=e==null?void 0:e.segmentCount)!=null?s:0,frames:(i=e==null?void 0:e.frameCount)!=null?i:0,captured:!!this.keyframeId,bufferBytes:(o=e==null?void 0:e.totalBytes)!=null?o:0,droppedSegments:(a=e==null?void 0:e.dropped)!=null?a:0,shedFrames:this.shed,producers:Object.fromEntries(Object.entries(this.producerCounts).map(([c,l])=>[c,{...l}]))}}forceCheckpoint(e){this.checkpoint(e)}async init(){let[{ReplayEncoder:e},{SegmentBuffer:t}]=await Promise.all([Promise.resolve().then(()=>(ca(),aa)),Promise.resolve().then(()=>(ms(),Zo))]);this.segBuf=new t(rk,sk),this.persistBuffer&&(this.replayStore=new Be("pending-replay"),await this.recoverPriorPreRoll(),this.installPersistGuards()),this.encoder=new e,this.disposeEncoder=()=>{var r;return(r=this.encoder)==null?void 0:r.dispose()},await this.arm(),this.unsubSignal=this.ctx.onSignal(()=>this.flush()),this.active=!0}async arm(){var x,y,g,w,v,E;if(typeof document=="undefined")return;let e=this.ctx,[{NodeRegistry:t},{takeSnapshot:r},{MutationRecorder:s},{InteractionRecorder:i},{CssomRecorder:o},{IframeManager:a}]=await Promise.all([Promise.resolve().then(()=>(an(),Hr)),Promise.resolve().then(()=>(tt(),qr)),Promise.resolve().then(()=>(pn(),da)),Promise.resolve().then(()=>(fa(),pa)),Promise.resolve().then(()=>(Lr(),no)),Promise.resolve().then(()=>(va(),ya))]);this.lastShed=(y=(x=e.egressDropped)==null?void 0:x.call(e))!=null?y:0;let c=new t,l={maskAllText:this.maskText,maskAllInputs:(g=e.maskInputs)!=null?g:!0,maskSelectors:e.maskSelectors};this.redactPII=((w=e.replaySampling)==null?void 0:w.privacyLevel)==="strict"&&!l.maskAllText,this.reg=c,this.snapOpts=l,this.takeSnapshotFn=r;let u=r(document,c,l);this.keyframeId=`f_${q()}`;let d={kind:"frame",renderer:"dom",frameType:"keyframe",frameId:this.keyframeId,snapshot:u,viewport:ah(),href:ch(),tabId:ra(),viewId:ia(),route:sa(),masked:!0,timestamp:L()};this.push(d),this.compressInPlace(d,u),this.persistPreRoll(),this.dirtySinceKeyframe=!1,this.lastKeyframeAt=L();let p=new hs(ak,C=>this.push(this.delta({mutations:C})));this.deltaBatcher=p;let f=new i(c,C=>{this.push(this.delta({events:C}))},{maskText:!!l.maskAllText,moveFlushMs:ck,beforeImmediateFlush:()=>p.flush()}),m=new s(c,C=>{f.notifyDomActivity(),p.append(C)},l),h=new o(c,C=>{f.notifyDomActivity(),p.append(C)}),b=new a(c,C=>{f.notifyDomActivity(),p.append(C)},l,{onFrame:(C,I)=>f.observeFrame(C,I),onUnframe:C=>f.unobserveFrame(C),frameOrigins:(v=e.replayFrameOrigins)!=null?v:[]});if(((E=e.replayFrameOrigins)!=null?E:[]).length&&Promise.resolve().then(()=>(ga(),th)).then(({installChildSatellite:C})=>{var I;this.childSatelliteStop=C((I=e.replayFrameOrigins)!=null?I:[],l)}),this.mutationRec=m,this.cssomRec=h,m.observe(document.documentElement),f.observe(),h.install(),b.start(),this.disconnectRecorder=()=>m.disconnect(),this.disconnectInteractions=()=>f.disconnect(),this.disconnectCssom=()=>h.disconnect(),this.disconnectIframes=()=>b.disconnect(),e.replayCanvas){let{CanvasRecorder:C}=await Promise.resolve().then(()=>(rh(),nh)),I=new C(c,R=>{f.notifyDomActivity(),this.push(this.delta({mutations:R}))},(...R)=>e.log(...R));I.start(),this.disconnectCanvas=()=>I.disconnect()}this.adaptive=new gs(e.egressPending);let{installCadence:k}=await Promise.resolve().then(()=>(ih(),sh));this.disconnectCadence=k({keyframeIntervalMs:ik,onCheckpoint:C=>this.checkpoint(C)})}disarm(){var e,t,r,s,i,o,a,c,l,u,d;try{(e=this.mutationRec)==null||e.flush(),(t=this.cssomRec)==null||t.flush(),(r=this.deltaBatcher)==null||r.dispose()}catch{}this.deltaBatcher=void 0,(s=this.disconnectRecorder)==null||s.call(this),(i=this.disconnectInteractions)==null||i.call(this),(o=this.disconnectCssom)==null||o.call(this),(a=this.disconnectCanvas)==null||a.call(this),(c=this.disconnectIframes)==null||c.call(this),(l=this.childSatelliteStop)==null||l.call(this),(u=this.disconnectCadence)==null||u.call(this),(d=this.adaptive)==null||d.dispose(),this.disconnectRecorder=void 0,this.disconnectInteractions=void 0,this.disconnectCssom=void 0,this.disconnectCanvas=void 0,this.disconnectIframes=void 0,this.childSatelliteStop=void 0,this.disconnectCadence=void 0,this.adaptive=void 0,this.reg=void 0,this.mutationRec=void 0,this.cssomRec=void 0,this.takeSnapshotFn=void 0,this.snapOpts=void 0}pause(){!this.active||this.paused||(this.disarm(),this.paused=!0,this.ctx.log("[replay] paused"))}resume(){!this.active||!this.paused||(this.paused=!1,this.arm().then(()=>this.ctx.log("[replay] resumed")))}setPrivacy(e){typeof(e==null?void 0:e.maskAllText)!="boolean"||e.maskAllText===this.maskText||(this.maskText=e.maskAllText,this.active&&!this.paused&&(this.disarm(),this.arm()),this.ctx.log("[replay] privacy set: maskAllText="+this.maskText))}delta(e){return{kind:"frame",renderer:"dom",frameType:"delta",frameId:`f_${q()}`,baseFrameId:this.keyframeId,...e,tabId:ra(),viewId:ia(),route:sa(),masked:!0,timestamp:L()}}push(e){var i,o,a,c,l;if(e.frameType==="delta"&&(this.dirtySinceKeyframe=!0),this.redactPII&&Fm(e),e.frameType==="delta"&&this.adaptive&&this.adaptive.level>0){let u=Nm(e,this.adaptive.level);if(!u){this.shed++;return}e=u}e.seq=this.nextSeq();let t=lk(e),r=(o=(i=this.producerCounts)[t])!=null?o:i[t]={frames:0,bytes:0};if(r.frames++,r.bytes+=$t(e),this.streaming){this.ctx.emit(e);let u=(l=(c=(a=this.ctx).egressDropped)==null?void 0:c.call(a))!=null?l:0;u>this.lastShed&&(this.lastShed=u,this.checkpoint("shed")),e.frameType==="delta"&&(this.streamChainBytes+=$t(e),this.streamChainFrames++,!this.checkpointing&&(this.streamChainFrames>=oh||this.streamChainBytes>=ks)&&this.checkpoint(this.streamChainBytes>=ks?"segment-bytes":"segment-frames"));return}let s=this.segBuf;s&&(e.frameType==="keyframe"?s.openSegment(e):s.append(e),!this.checkpointing&&e.frameType==="delta"&&(s.currentFrameCount>=oh||s.currentBytes>=ks)&&this.checkpoint(s.currentBytes>=ks?"segment-bytes":"segment-frames"))}checkpoint(e){var t,r,s;if(!(this.checkpointing||!this.reg||!this.takeSnapshotFn||typeof document=="undefined")){this.checkpointing=!0;try{if((t=this.mutationRec)==null||t.flush(),(r=this.cssomRec)==null||r.flush(),(s=this.deltaBatcher)==null||s.flush(),(e==="time"||e==="visible")&&!this.dirtySinceKeyframe&&L()-this.lastKeyframeAt<ok)return;let i=this.takeSnapshotFn(document,this.reg,this.snapOpts),o=`f_${q()}`;this.keyframeId=o,this.streamChainBytes=0,this.streamChainFrames=0;let a={kind:"frame",renderer:"dom",frameType:"keyframe",frameId:o,snapshot:i,viewport:ah(),href:ch(),masked:!0,trigger:e,timestamp:L()};this.push(a),this.compressInPlace(a,i),this.persistPreRoll(),this.dirtySinceKeyframe=!1,this.lastKeyframeAt=L()}finally{this.checkpointing=!1}}}async recoverPriorPreRoll(){var e;if(this.replayStore)try{let t=await this.replayStore.load();if(Array.isArray(t)&&t.length){let r=0;for(let s of t)this.ctx.emit(s),r=Math.max(r,(e=s.seq)!=null?e:0);this.seq=qc(r+1),await this.replayStore.clear()}}catch{}}persistPreRoll(){!this.replayStore||!this.segBuf||this.streaming||this.replayStore.save(Et(this.segBuf.drainFrames(),()=>!0,e=>e.frameType==="keyframe"))}installPersistGuards(){typeof window!="undefined"&&(this.onPageHide=()=>{var e;return void((e=this.replayStore)==null?void 0:e.clear())},window.addEventListener("pagehide",this.onPageHide),this.onVisHidden=()=>{typeof document!="undefined"&&document.visibilityState==="hidden"&&this.persistPreRoll()},typeof document!="undefined"&&document.addEventListener("visibilitychange",this.onVisHidden))}compressInPlace(e,t){let r=this.encoder;if(!r)return;let s=r.encodeSnapshot(t).then(i=>{e.snapshot=i}).catch(()=>{}).finally(()=>{this.pendingEncodes.delete(s)});this.pendingEncodes.add(s)}flush(){var e,t,r,s,i;if((e=this.mutationRec)==null||e.flush(),(t=this.cssomRec)==null||t.flush(),(r=this.deltaBatcher)==null||r.flush(),this.segBuf)for(let o of this.segBuf.drainFrames())this.ctx.emit(o);(s=this.segBuf)==null||s.clear(),this.streaming=!0,(i=this.replayStore)==null||i.clear()}teardown(){var e,t,r,s;this.disarm(),(e=this.disposeEncoder)==null||e.call(this),this.onPageHide&&typeof window!="undefined"&&window.removeEventListener("pagehide",this.onPageHide),this.onPageHide=void 0,this.onVisHidden&&typeof document!="undefined"&&document.removeEventListener("visibilitychange",this.onVisHidden),this.onVisHidden=void 0,(t=this.replayStore)==null||t.clear(),this.replayStore=void 0,(r=this.unsubSignal)==null||r.call(this),(s=this.segBuf)==null||s.clear(),this.segBuf=void 0,this.encoder=void 0,this.pendingEncodes.clear(),this.streaming=!1,this.checkpointing=!1,this.paused=!1,this.active=!1}}});var ph={};_(ph,{installWebGLPreserve:()=>pk});function uh(n){if(!n||typeof n.getContext!="function")return null;let e=n;if(e[xa])return null;let t=n.getContext,r=function(s,i){if(typeof s=="string"&&uk.has(s)){let o={...i!=null?i:{},preserveDrawingBuffer:!0};return t.call(this,s,o)}return t.call(this,s,i)};return n.getContext=r,e[xa]=!0,()=>{n.getContext===r&&(n.getContext=t),delete e[xa]}}function pk(){if(typeof HTMLCanvasElement=="undefined")return()=>{};let n=[];try{let e=uh(HTMLCanvasElement.prototype);if(e&&n.push(e),typeof OffscreenCanvas!="undefined"){let t=uh(OffscreenCanvas.prototype);t&&n.push(t)}}catch{}return()=>{for(let e of n)try{e()}catch{}}}var xa,uk,fh=S(()=>{"use strict";xa="__scalebunWebglPatched",uk=new Set(["webgl","webgl2","experimental-webgl","experimental-webgl2"])});var hh={};_(hh,{ReplayFeature:()=>Sa});var fk,Is,mk,mh,Sa,gh=S(()=>{"use strict";_m();ii();fk=400,Is="sdk_replay_capture_failed",mk=5e3,mh=()=>Promise.resolve().then(()=>(dh(),lh)),Sa=class{constructor(){this.name="replay"}get isActive(){var e,t;return(t=(e=this.controller)==null?void 0:e.isActive)!=null?t:!1}async setup(e){var r;if(typeof document=="undefined"||typeof MutationObserver=="undefined"){e.trackEvent(Is,{stage:"init",reason:"ENV_UNSUPPORTED"});return}let t=Lm(e.replaySampling,(r=e.sessionId)!=null?r:"");if(e.log("[replay] sampling:",t.reason,"(bucket",t.bucket+")"),!!t.record){if(e.respectDnt){let{userOptedOutOfTracking:s}=await Promise.resolve().then(()=>(na(),$m));if(s()){e.log("[replay] dnt: skip"),e.trackEvent(Is,{stage:"init",reason:"DNT_OPTED_OUT"});return}}if(e.replayCanvas){let{installWebGLPreserve:s}=await Promise.resolve().then(()=>(fh(),ph));this.uninstallWebGL=s()}this.armed=this.arm(e,t)}}async arm(e,t){var r;try{await this.load(e,t)}catch(s){let i=String((r=s==null?void 0:s.message)!=null?r:s).slice(0,300);e.trackEvent(Is,{stage:"init",reason:si(i)?"ENGINE_CHUNK_LOAD_FAILED":"RECORDER_INIT_FAILED",message:i})}}async load(e,t){var i;let r=o=>{o.catch(()=>{})};r(Promise.resolve().then(()=>(an(),Hr))),r(Promise.resolve().then(()=>(tt(),qr))),r(Promise.resolve().then(()=>(pn(),da))),r(Promise.resolve().then(()=>(fa(),pa))),r(Promise.resolve().then(()=>(Lr(),no))),r(Promise.resolve().then(()=>(va(),ya))),r(Promise.resolve().then(()=>(ca(),aa))),r(Promise.resolve().then(()=>(ms(),Zo)));let s;try{({createRecorder:s}=await mh())}catch(o){await new Promise(a=>setTimeout(a,fk)),{createRecorder:s}=await mh(),e.trackEvent("sdk_replay_recovered",{stage:"recorder-import",message:String((i=o==null?void 0:o.message)!=null?i:o).slice(0,300)})}this.controller=await s(e,t),this.watchdog=setTimeout(()=>{var a;let o=(a=this.controller)==null?void 0:a.stats();o!=null&&o.recording&&!o.captured&&e.trackEvent(Is,{stage:"first-frame",reason:"NO_FRAME_AFTER_ARM",streaming:o.streaming,bucket:o.sampleBucket})},mk)}flush(){var e;(e=this.controller)==null||e.flush()}stats(){var e,t;return(t=(e=this.controller)==null?void 0:e.stats())!=null?t:null}checkpoint(e="manual"){var t;(t=this.controller)==null||t.forceCheckpoint(e)}pause(){var e;(e=this.controller)==null||e.pause()}resume(){var e;(e=this.controller)==null||e.resume()}setPrivacy(e){var t;(t=this.controller)==null||t.setPrivacy(e)}teardown(){var e,t;clearTimeout(this.watchdog),this.watchdog=void 0,(e=this.controller)==null||e.teardown(),this.controller=void 0,(t=this.uninstallWebGL)==null||t.call(this),this.uninstallWebGL=void 0}}});var bh,we,ka=S(()=>{"use strict";bh={title:"Inbox",panelAria:"Notifications",open:"Open notifications",openUnread:n=>`Open notifications, ${n} unread`,close:"Close notifications",unread:n=>`${n} unread`,noUnread:"No unread messages",emptyTitle:"You\u2019re all caught up",emptyBody:"Your notifications will appear here.",emptyAnnounce:"No notifications",allTab:"All",viewAll:"View all",pin:"Pin",unpin:"Unpin",archive:"Archive",delete:"Delete"},we={received:"$message_received",seen:"$message_seen",read:"$message_read",cta:"$message_cta_clicked",archived:"$message_archived",unarchived:"$message_unarchived",pinned:"$message_pinned",unpinned:"$message_unpinned",deleted:"$message_deleted",expired:"$message_expired",unreadChanged:"$inbox_unread_changed"}});var Ea={};_(Ea,{mountInbox:()=>xk});function ee(n,e,t){let r=document.createElement(n);return e&&(r.className=e),t!=null&&(r.textContent=t),r}function vk(n){let e=Math.max(0,Math.floor((Date.now()-n)/1e3));if(e<60)return"now";let t=Math.floor(e/60);if(t<60)return`${t}m`;let r=Math.floor(t/60);if(r<24)return`${r}h`;let s=Math.floor(r/24);if(s<7)return`${s}d`;let i=Math.floor(s/7);return i<5?`${i}w`:`${Math.floor(s/30)}mo`}function wk(n,e,t,r,s,i){let o=e.includes("right")?"right":"left",a=t?o==="right"?"left":"right":o,c=e.includes("bottom")?"bottom":"top",l=(R,T)=>{var A;return`var(--scalebun-inbox-${R},${(A=i==null?void 0:i[R])!=null?A:T})`},u=l("bg",n?"#1b1922":"#ffffff"),d=l("fg",n?"#edeaf2":"#221e30"),p=l("sub",n?"#9a95a6":"#6b6580"),f=l("line",n?"rgba(255,255,255,.10)":"#eae7f2"),m=l("surf",n?"#262131":"#f7f6fb"),h=l("accent","#7c6cf0"),b=l("unread",n?"rgba(124,108,240,.10)":"rgba(124,108,240,.06)"),k=l("badge","#ff5b6b"),x=l("font","system-ui,-apple-system,Segoe UI,Roboto,sans-serif"),y=l("shadow","0 0 40px rgba(0,0,0,.22)"),g=l("width","380px"),w=l("gap","11px"),v=l("z","2147483600"),E=R=>l("radius",R),C=R=>l("radius-sm",R),I=s?`--scalebun-inbox-accent:${s};`:"";return`
588
+ :host{all:initial;direction:${t?"rtl":"ltr"};${I}}
589
+ *{box-sizing:border-box;font-family:${x}}
590
+ button:focus-visible,.row:focus-visible,.tab:focus-visible{outline:2px solid ${h};outline-offset:2px}
591
+ .live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
592
+ .bell{position:fixed;${c}:22px;${a}:22px;width:52px;height:52px;border-radius:50%;border:none;cursor:pointer;
593
+ background:${h};color:#fff;display:grid;place-items:center;box-shadow:0 6px 24px rgba(108,92,231,.4);z-index:${v}}
594
+ .bell:hover{filter:brightness(1.06)}
595
+ .bell svg{width:22px;height:22px}
596
+ .badge{position:absolute;top:-4px;${a}:-4px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;
597
+ background:${k};color:#fff;font-size:11px;font-weight:700;display:none;align-items:center;justify-content:center;line-height:1}
598
+ .badge.on{display:flex}
599
+ .scrim{position:fixed;inset:0;background:rgba(10,8,16,.42);z-index:calc(${v} + 1);opacity:0;pointer-events:none;transition:opacity .2s}
600
+ .scrim.on{opacity:1;pointer-events:auto}
601
+ .panel{position:fixed;${c==="bottom"?"bottom:0;top:0":"top:0;bottom:0"};${a}:0;width:${g};max-width:94vw;background:${u};color:${d};
602
+ z-index:calc(${v} + 2);display:flex;flex-direction:column;box-shadow:${y};
603
+ transform:translateX(${a==="right"?"100%":"-100%"});transition:transform .26s cubic-bezier(.4,0,.2,1)}
604
+ .panel.open{transform:translateX(0)}
605
+ .hd{display:flex;align-items:center;justify-content:space-between;padding:15px 16px;border-bottom:1px solid ${f}}
606
+ .hd .ti{font-size:15px;font-weight:700}
607
+ .hd .mt{font-size:12px;color:${p};margin-top:2px}
608
+ .x{width:30px;height:30px;border-radius:${C("8px")};border:1px solid ${f};background:${m};color:${p};cursor:pointer;font-size:17px;line-height:1;display:grid;place-items:center}
609
+ .x:hover{color:${d}}
610
+ .tabs{display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid ${f};overflow-x:auto}
611
+ .tab{flex-shrink:0;border:none;background:${m};color:${p};border-radius:999px;padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer}
612
+ .tab.on{background:${h};color:#fff}
613
+ .body{flex:1;overflow-y:auto;padding:6px}
614
+ .empty{padding:48px 20px;text-align:center;color:${p};font-size:13px}
615
+ .empty b{display:block;color:${d};font-size:14px;margin-bottom:5px}
616
+ .list{display:flex;flex-direction:column}
617
+ .row{position:relative;display:flex;gap:${w};padding:12px 12px 12px 15px;border-radius:${E("10px")};cursor:pointer}
618
+ .row:hover{background:${m}}
619
+ .row.unread{background:${b}}
620
+ .dot{position:absolute;left:5px;top:18px;width:7px;height:7px;border-radius:50%;background:${h};opacity:0}
621
+ .row.unread .dot{opacity:1}
622
+ .ic{flex-shrink:0;width:34px;height:34px;border-radius:${E("9px")};background:${m};display:grid;place-items:center;overflow:hidden;font-weight:700;color:${h};font-size:14px}
623
+ .ic img{width:100%;height:100%;object-fit:cover}
624
+ .rc{flex:1;min-width:0}
625
+ .rtop{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
626
+ .rt{font-size:13.5px;font-weight:600;color:${d};overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
627
+ .row.unread .rt{font-weight:700}
628
+ .rtime{flex-shrink:0;font-size:11px;color:${p}}
629
+ .rb{font-size:12.5px;color:${p};line-height:1.4;margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
630
+ .rcta{display:flex;gap:7px;margin-top:8px}
631
+ .rcta button{background:${h};color:#fff;border:none;border-radius:${C("7px")};padding:5px 11px;font-size:12px;font-weight:600;cursor:pointer}
632
+ .rcta button.sec{background:${m};color:${d}}
633
+ /* \u26A0\uFE0F Was \`position:absolute\` floating over the row, which meant NO space was reserved for it and the
634
+ title ran underneath \u2014 the buttons masked their own row's text (and in RTL they landed on top of
635
+ the title rather than the timestamp). A hover-only overlay only looks fine while the text is short.
636
+ Now a real flex child: it always occupies its column, so nothing can ever slide under it, and
637
+ \`visibility\` (not \`display\`) means revealing it on hover causes no reflow. */
638
+ .ract{flex-shrink:0;align-self:flex-start;display:flex;gap:2px;border-radius:${C("8px")};padding:2px;visibility:hidden}
639
+ .row:hover .ract,.row:focus-within .ract{visibility:visible}
640
+ .ract button{width:26px;height:26px;border:none;background:none;color:${p};cursor:pointer;border-radius:${C("6px")};display:grid;place-items:center}
641
+ .ract button:hover{background:${m};color:${d}}
642
+ .ract button.on{color:${h}}
643
+ .ract svg{width:15px;height:15px}
644
+ ${r!=="dropdown"?"":`
645
+ /* \u2500\u2500 dropdown \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
646
+ A compact popover anchored under the host's own trigger, for a bell that already lives in a navbar.
647
+ Everything below OVERRIDES the drawer rules above rather than forking the stylesheet \u2014 the rows,
648
+ tabs, a11y wiring and theming are identical, so only geometry changes.
649
+
650
+ \u26A0\uFE0F \`inset:auto\` first: the drawer pins all four edges, and leaving even one of them set makes the
651
+ panel stretch instead of sizing to its content. The anchor coordinates are written inline by
652
+ \`positionDropdown()\` at open time, because they depend on where the trigger is on screen. */
653
+ .panel{inset:auto;top:auto;bottom:auto;left:auto;right:auto;
654
+ height:auto;max-height:min(70vh,520px);width:min(${g},calc(100vw - 24px));
655
+ border:1px solid ${f};border-radius:${E("14px")};overflow:hidden;
656
+ transform:translateY(-6px) scale(.98);opacity:0;transform-origin:top ${a};
657
+ transition:opacity .14s ease-out,transform .14s ease-out}
658
+ .panel.open{transform:none;opacity:1}
659
+ /* No dimming: a dropdown is a light-touch surface, and a full-screen scrim over a navbar menu reads
660
+ as a modal. It still catches outside clicks \u2014 hence transparent rather than removed. */
661
+ .scrim{background:transparent}
662
+ .bell{display:none} /* the host's trigger IS the bell here */
663
+ .hd{padding:12px 14px}
664
+ .body{max-height:none}
665
+ .foot{display:flex;border-top:1px solid ${f};padding:8px}
666
+ .foot button{flex:1;border:none;background:none;color:${h};font-size:13px;font-weight:600;
667
+ cursor:pointer;padding:8px;border-radius:${C("8px")}}
668
+ .foot button:hover{background:${m}}
669
+ `}
670
+ @media(prefers-reduced-motion:reduce){.panel,.scrim{transition:none}}`}function xk(n,e,t){var G,ie,X,Y,te;let r=(G=e.position)!=null?G:"bottom-right",s=typeof document!="undefined"&&(document.documentElement.getAttribute("dir")==="rtl"||typeof getComputedStyle!="undefined"&&getComputedStyle(document.documentElement).direction==="rtl"),i=(ie=e.rtl)!=null?ie:s,o=e.layout==="dropdown"&&yh(e.trigger)?"dropdown":"drawer",a=e.accent,c={...bh,...(X=t==null?void 0:t.labels)!=null?X:{},...(Y=e.labels)!=null?Y:{}},l=(te=e.formatTime)!=null?te:vk,u=e.theme?e.theme==="dark":typeof matchMedia!="undefined"&&matchMedia("(prefers-color-scheme: dark)").matches,d=document.createElement("div");d.setAttribute("data-scalebun-inbox",""),d.setAttribute("data-scalebun","");let p=d.attachShadow({mode:"open"});Ne(p,wk(u,r,i,o,a,t==null?void 0:t.tokens)),document.body.appendChild(d);let f=ee("div","scrim"),m=ee("div","panel");m.setAttribute("role","dialog"),m.setAttribute("aria-modal","true"),m.setAttribute("aria-label",c.panelAria),m.setAttribute("aria-hidden","true"),i&&m.setAttribute("dir","rtl");let h=ee("div","hd"),b=ee("div"),k=ee("div","ti",c.title),x=ee("div","mt");b.append(k,x);let y=document.createElement("button");y.className="x",y.type="button",y.setAttribute("aria-label",c.close),y.textContent="\xD7",h.append(b,y);let g=ee("div","tabs");g.setAttribute("role","tablist"),g.style.display="none";let w=ee("div","body"),v=ee("div","live");if(v.setAttribute("role","status"),v.setAttribute("aria-live","polite"),m.append(h,g,w,v),e.onViewAll){let M=ee("div","foot"),O=document.createElement("button");O.type="button",O.textContent=c.viewAll,O.addEventListener("click",()=>{var N;J(),(N=e.onViewAll)==null||N.call(e)}),M.appendChild(O),m.appendChild(M)}p.append(f,m);let E,C,I=yh(e.trigger);I||(E=document.createElement("button"),E.className="bell",E.type="button",E.setAttribute("aria-label",c.open),E.setAttribute("aria-expanded","false"),E.setAttribute("aria-haspopup","dialog"),typeof e.icon=="string"?E.textContent=e.icon:e.icon?E.appendChild(e.icon):E.innerHTML=yk,C=document.createElement("span"),C.className="badge",C.setAttribute("aria-hidden","true"),E.appendChild(C),p.appendChild(E));let R=I!=null?I:E,T=!1,A=null,P=!1,$=()=>{if(o!=="dropdown"||!I)return;let M=I.getBoundingClientRect(),O=m.offsetWidth||360,N=m.offsetHeight||420,F=8,W=i?M.right-O:M.left;m.style.left=`${Math.max(F,Math.min(W,window.innerWidth-O-F))}px`;let re=window.innerHeight-M.bottom;m.style.top=re>=N+F||re>=M.top?`${M.bottom+6}px`:`${Math.max(F,M.top-N-6)}px`},D=M=>{var O,N;M!==T&&(T=M,M&&$(),m.classList.toggle("open",M),f.classList.toggle("on",M),m.setAttribute("aria-hidden",M?"false":"true"),E==null||E.setAttribute("aria-expanded",String(M)),M?(A=(N=(O=p.activeElement)!=null?O:R)!=null?N:null,P=!0,n.refresh(),Ve()):A==null||A.focus())},ne=()=>D(!0),J=()=>D(!1),Q=()=>D(!T),fe=()=>Q();E==null||E.addEventListener("click",fe),I==null||I.addEventListener("click",fe),y.addEventListener("click",J),f.addEventListener("click",J);let ce=M=>{if(M.key==="Escape"){M.stopPropagation(),J();return}if(M.key==="Tab"){let O=xe(),N=O[0],F=O[O.length-1];if(!N||!F)return;let W=p.activeElement;M.shiftKey&&W===N?(M.preventDefault(),F.focus()):!M.shiftKey&&W===F&&(M.preventDefault(),N.focus())}};m.addEventListener("keydown",ce);function xe(){return[...m.querySelectorAll('button, [tabindex="0"]')]}let Se=n.subscribe(M=>{let O=M.unreadCount;C&&(C.textContent=O>99?"99+":String(O),C.classList.toggle("on",O>0)),x.textContent=O>0?c.unread(O):c.noUnread,E&&E.setAttribute("aria-label",O>0?c.openUnread(O):c.open),T&&Ve()}),le=null;function H(){let M=ee("div","empty");return M.appendChild(ee("b",void 0,c.emptyTitle)),M.appendChild(document.createTextNode(c.emptyBody)),M}function V(M,O,N){let F=document.createElement("button");return F.type="button",F.innerHTML=M,F.setAttribute("aria-label",O),F.title=O,F.addEventListener("click",W=>{W.stopPropagation(),N()}),F}function j(M){var he,Ce,Ae;let O=ee("div","row"+(M.state==="unread"?" unread":""));O.setAttribute("role","listitem"),O.tabIndex=0,O.setAttribute("aria-label",`${M.title}${M.state==="unread"?", unread":""}`),O.dataset.id=M.id,O.appendChild(ee("span","dot"));let N=ee("div","ic");if(M.iconUrl){let Te=document.createElement("img");Te.src=M.iconUrl,Te.alt="",N.appendChild(Te)}else N.textContent=((Ce=(he=M.category)==null?void 0:he[0])!=null?Ce:"\u2022").toUpperCase();O.appendChild(N);let F=ee("div","rc"),W=ee("div","rtop");if(W.appendChild(ee("div","rt",M.title)),W.appendChild(ee("span","rtime",l(M.createdAt))),F.appendChild(W),M.body&&F.appendChild(ee("div","rb",M.body)),(Ae=M.cta)!=null&&Ae.length){let Te=ee("div","rcta");M.cta.slice(0,2).forEach((Je,it)=>{let ke=document.createElement("button");it>0&&(ke.className="sec"),ke.textContent=Je.label,ke.addEventListener("click",bn=>{bn.stopPropagation(),n.act(M.id,Je.key)}),Te.appendChild(ke)}),F.appendChild(Te)}O.appendChild(F);let re=ee("div","ract"),ge=V(hk,M.pinned?c.unpin:c.pin,()=>void n.pin(M.id,!M.pinned));return M.pinned&&ge.classList.add("on"),re.append(ge,V(gk,c.archive,()=>void n.archive(M.id)),V(bk,c.delete,()=>void n.remove(M.id))),O.appendChild(re),O.addEventListener("click",()=>{M.state==="unread"&&n.markRead(M.id)}),O}function de(M){var re,ge,he;let O=M.target.closest(".row");if(!O)return;let N=[...w.querySelectorAll(".row")],F=N.indexOf(O),W=O.dataset.id;M.key==="ArrowDown"?(M.preventDefault(),(re=N[Math.min(N.length-1,F+1)])==null||re.focus()):M.key==="ArrowUp"?(M.preventDefault(),(ge=N[Math.max(0,F-1)])==null||ge.focus()):M.key==="Enter"||M.key===" "?(M.preventDefault(),n.markRead(W)):M.key==="Delete"||M.key==="Backspace"?(M.preventDefault(),n.archive(W),(he=N[Math.min(N.length-1,F+1)])==null||he.focus()):M.key.toLowerCase()==="p"&&(M.preventDefault(),n.pin(W))}w.addEventListener("keydown",de);function me(M){if(M.length<2){g.style.display="none",g.textContent="";return}g.style.display="flex",g.textContent="";let O=(N,F)=>{let W=document.createElement("button");return W.className="tab"+(le===F?" on":""),W.type="button",W.textContent=N,W.setAttribute("role","tab"),W.setAttribute("aria-selected",String(le===F)),W.addEventListener("click",()=>{le=F,Ve()}),W};g.appendChild(O(c.allTab,null));for(let N of M)g.appendChild(O(N.charAt(0).toUpperCase()+N.slice(1),N))}async function se(){var he,Ce,Ae,Te,Je,it;if(!T)return;let M=await n.query({limit:200});if(!T)return;let O=(Ae=(Ce=(he=p.activeElement)==null?void 0:he.closest)==null?void 0:Ce.call(he,".row"))==null?void 0:Ae.dataset.id,N=[...new Set(M.messages.map(ke=>ke.category))].sort();me(N);let F=le?M.messages.filter(ke=>ke.category===le):M.messages,W=o==="dropdown"?Math.max(1,(Te=e.maxItems)!=null?Te:5):1/0,re=F.length>W?F.slice(0,W):F;if(w.textContent="",!re.length){w.appendChild(H()),v.textContent=c.emptyAnnounce,P&&(P=!1,y.focus());return}let ge=ee("div","list");ge.setAttribute("role","list");for(let ke of re)ge.appendChild(j(ke));w.appendChild(ge),v.textContent=`${F.length} notification${F.length===1?"":"s"}`,P?(P=!1,((Je=w.querySelector(".row"))!=null?Je:y).focus()):O&&((it=w.querySelector(`.row[data-id="${O}"]`))==null||it.focus())}let Ue=!1;function Ve(){Ue||(Ue=!0,queueMicrotask(()=>{Ue=!1,se()}))}return{open:ne,close:J,destroy(){Se(),m.removeEventListener("keydown",ce),w.removeEventListener("keydown",de),I==null||I.removeEventListener("click",fe),d.remove()}}}function yh(n){if(!n)return null;if(typeof n=="string")try{return document.querySelector(n)}catch{return null}return n}var hk,gk,bk,yk,Ia=S(()=>{"use strict";z();ka();hk='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 17v5M9 3h6l-1 6 3 3v2H7v-2l3-3z"/></svg>',gk='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M3 7h18v3H3zM5 10v10h14V10M9 14h6"/></svg>',bk='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13"/></svg>',yk='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg>'});var vh={};_(vh,{InboxStore:()=>fn,NOOP_STORE:()=>Ca});function kk(n){return new Promise(e=>{try{if(typeof indexedDB=="undefined")return e(null);let t=indexedDB.open(Sk+n,1);t.onupgradeneeded=()=>{let r=t.result;r.objectStoreNames.contains(ze)||r.createObjectStore(ze,{keyPath:"id"}),r.objectStoreNames.contains(rt)||r.createObjectStore(rt)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)}catch{e(null)}})}var Sk,ze,rt,fn,Ca,Aa=S(()=>{"use strict";Sk="scalebun_inbox_",ze="messages",rt="meta";fn=class{constructor(e){this.scope=e;this.dbp=null}db(){return this.dbp||(this.dbp=kk(this.scope)),this.dbp}async hydrate(){let e=await this.db();return e?new Promise(t=>{try{let r=e.transaction(ze,"readonly").objectStore(ze).getAll();r.onsuccess=()=>t(Array.isArray(r.result)?r.result:[]),r.onerror=()=>t([])}catch{t([])}}):[]}put(e){return this.putMany([e])}async putMany(e){if(!e.length)return;let t=await this.db();if(t)return new Promise(r=>{try{let s=t.transaction(ze,"readwrite"),i=s.objectStore(ze);for(let o of e)i.put(o);s.oncomplete=()=>r(),s.onerror=()=>r(),s.onabort=()=>r()}catch{r()}})}async remove(e){let t=await this.db();if(t)return new Promise(r=>{try{let s=t.transaction(ze,"readwrite");s.objectStore(ze).delete(e),s.oncomplete=()=>r(),s.onerror=()=>r()}catch{r()}})}async getMeta(e){let t=await this.db();if(t)return new Promise(r=>{try{let s=t.transaction(rt,"readonly").objectStore(rt).get(e);s.onsuccess=()=>r(s.result),s.onerror=()=>r(void 0)}catch{r(void 0)}})}async setMeta(e,t){let r=await this.db();if(r)return new Promise(s=>{try{let i=r.transaction(rt,"readwrite");i.objectStore(rt).put(t,e),i.oncomplete=()=>s(),i.onerror=()=>s()}catch{s()}})}async clear(){let e=await this.db();if(e)return new Promise(t=>{try{let r=e.transaction([ze,rt],"readwrite");r.objectStore(ze).clear(),r.objectStore(rt).clear(),r.oncomplete=()=>t(),r.onerror=()=>t()}catch{t()}})}},Ca={hydrate:()=>Promise.resolve([]),put:()=>Promise.resolve(),putMany:()=>Promise.resolve(),remove:()=>Promise.resolve(),getMeta:()=>Promise.resolve(void 0),setMeta:()=>Promise.resolve(),clear:()=>Promise.resolve()}});var wh={};_(wh,{InboxSync:()=>Ta,InboxTransport:()=>Ra,mergeMessage:()=>Ma,stateRank:()=>Ck});function Ma(n,e){var a,c,l,u,d;if(!n)return e;let t=n;if(e.revision>n.revision){let p={...n},f=e;for(let m of Ik)p[m]=f[m];t=p}let r=(a=n.stateAt)!=null?a:0,s=(c=e.stateAt)!=null?c:0;n.state==="deleted"||e.state==="deleted"?t={...t,state:"deleted",stateAt:Math.max(r,s),deletedAt:(l=n.deletedAt)!=null?l:e.deletedAt}:s>=r?t={...t,state:e.state,stateAt:s,readAt:e.readAt,archivedAt:e.archivedAt}:t={...t,state:n.state,stateAt:r};let i=(u=n.pinnedAt)!=null?u:0,o=(d=e.pinnedAt)!=null?d:0;return t={...t,pinned:o>=i?e.pinned:n.pinned,pinnedAt:Math.max(i,o)||void 0},t}function Ck(n){return Ek[n]}var Ek,Ik,Ta,Ra,Pa=S(()=>{"use strict";Mn();Ek={unread:0,read:1,archived:2,deleted:3},Ik=["revision","campaignId","category","priority","title","body","html","imageUrl","iconUrl","cta","createdAt","expiresAt","groupKey","data"];Ta=class{constructor(e){this.deps=e;this.cursor=null;this.cursorLoaded=!1;this.inflight=null}sync(){return this.inflight?this.inflight:(this.inflight=this.run().finally(()=>{this.inflight=null}),this.inflight)}async run(){var e,t,r,s,i;this.deps.onStatus("syncing");try{this.cursorLoaded||(this.cursor=(e=await this.deps.store.getMeta("cursor"))!=null?e:null,this.cursorLoaded=!0);let o=this.deps.runtime.collectDirtyOps(),a=new Map(o.map(u=>[u.id,{stateAt:u.stateAt,pinnedAt:u.pinnedAt}])),c={cursor:this.cursor,ops:o},l=await this.deps.transport.sync(c);if(!l){this.deps.onStatus(at()?"error":"offline");return}l.theme&&((r=(t=this.deps).onTheme)==null||r.call(t,l.theme)),this.deps.runtime.applyServerDelta((s=l.messages)!=null?s:[],(i=l.tombstones)!=null?i:[],l.unreadCount),this.deps.runtime.ackDirty(a),l.cursor!==void 0&&(this.cursor=l.cursor,await this.deps.store.setMeta("cursor",l.cursor)),this.deps.onStatus("idle")}catch{this.deps.onStatus(at()?"error":"offline")}}},Ra=class{constructor(e,t,r){this.apiBaseUrl=e;this.clientKey=t;this.deviceId=r}get usable(){return!!this.clientKey&&!!this.apiBaseUrl&&typeof fetch!="undefined"}async sync(e){if(!this.usable)return null;try{let t=await fetch(`${this.apiBaseUrl}/sdk/inbox/sync`,{method:"POST",headers:{"content-type":"application/json","x-scalebun-client-key":this.clientKey},body:JSON.stringify({schemaVersion:1,deviceId:this.deviceId,...e}),keepalive:!0});return t.ok?await t.json():null}catch{return null}}}});var kh={};_(kh,{InboxRuntime:()=>La});function Sh(n){return`${n.createdAt}_${n.id}`}var xh,Ak,La,Eh=S(()=>{"use strict";ka();Aa();Pa();xh={unread:0,read:1,archived:2,deleted:3},Ak=20;La=class{constructor(e){this.deps=e;this.mem=new Map;this.unread=0;this.ctaSubs=new Set;this.syncStatus="idle";var t;this.store=(t=e.store)!=null?t:e.scope?new fn(e.scope):Ca}async hydrate(){let e=await this.store.hydrate(),t=this.unread;for(let r of e)this.mem.has(r.id)||(this.mem.set(r.id,r),r.state==="unread"&&t++);this.unread=t,this.emitState()}getState(){let e=0;for(let t of this.mem.values())t.state!=="deleted"&&e++;return{unreadCount:this.unread,total:e,syncStatus:this.syncStatus}}emitState(){this.deps.onState(this.getState())}setSyncStatus(e){e!==this.syncStatus&&(this.syncStatus=e,this.emitState())}stamp(e){let t=this.deps.replayCoord();return t?{...e,replayCoord:t}:e}async ingest(e){var r;let t=[];for(let s of e){let i=this.mem.get(s.id);if(i){if(s.revision<=i.revision)continue;let a={...s,state:i.state,pinned:i.pinned,seenAt:i.seenAt,readAt:i.readAt,archivedAt:i.archivedAt,deletedAt:i.deletedAt};this.mem.set(s.id,a),t.push(a);continue}let o={...s,state:(r=s.state)!=null?r:"unread",pinned:!!s.pinned};this.mem.set(o.id,o),t.push(o),o.state==="unread"&&this.unread++,this.deps.trackEvent(we.received,this.stamp({messageId:o.id,campaignId:o.campaignId,category:o.category,priority:o.priority}))}t.length&&(this.emitUnreadAnd(),await this.store.putMany(t))}emitUnreadAnd(e){e!=null&&e!==this.unread&&this.deps.trackEvent(we.unreadChanged,this.stamp({unreadCount:this.unread,delta:this.unread-e})),this.emitState()}transition(e,t,r){let s=this.mem.get(e);if(!s)return;if(!(r!=null&&r.allowRegress)&&xh[t]<=xh[s.state])return s;let i=this.unread,o=s.state==="unread";s.state=t;let a=this.deps.now();s.stateAt=a,s._dirty=!0,t==="read"?s.readAt=a:t==="archived"?s.archivedAt=a:t==="deleted"?s.deletedAt=a:t==="unread"&&(s.readAt=void 0);let c=s.state==="unread";return o&&!c?this.unread--:!o&&c&&this.unread++,this.emitUnreadAnd(i),s}async markRead(e){let t=this.transition(e,"read");t&&(this.deps.trackEvent(we.read,this.stamp({messageId:e,category:t.category,priority:t.priority})),await this.store.put(t))}async markUnread(e){let t=this.mem.get(e);t&&t.state==="read"&&(this.transition(e,"unread",{allowRegress:!0}),await this.store.put(t))}async markReadByCampaign(e){for(let t of this.mem.values())if(t.campaignId===e&&t.state==="unread"){await this.markRead(t.id);return}}async markAllRead(e){let t=this.unread,r=[];for(let s of this.mem.values())s.state==="unread"&&(!e||s.category===e)&&(s.state="read",s.readAt=this.deps.now(),this.unread--,r.push(s));this.emitUnreadAnd(t),await this.store.putMany(r)}async archive(e){let t=this.transition(e,"archived");t&&(this.deps.trackEvent(we.archived,this.stamp({messageId:e,category:t.category})),await this.store.put(t))}async unarchive(e){let t=this.mem.get(e);t&&t.state==="archived"&&(this.transition(e,"read",{allowRegress:!0}),this.deps.trackEvent(we.unarchived,this.stamp({messageId:e,category:t.category})),await this.store.put(t))}async pin(e,t=!0){let r=this.mem.get(e);!r||r.pinned===t||(r.pinned=t,r.pinnedAt=this.deps.now(),r._dirty=!0,this.deps.trackEvent(t?we.pinned:we.unpinned,this.stamp({messageId:e,category:r.category})),this.emitState(),await this.store.put(r))}async remove(e){let t=this.mem.get(e);if(!t||t.state==="deleted")return;let r=t.state==="unread";this.transition(e,"deleted",{allowRegress:!0}),this.deps.trackEvent(we.deleted,this.stamp({messageId:e,category:t.category,wasUnread:r})),await this.store.put(t)}onCtaAction(e){return this.ctaSubs.add(e),()=>this.ctaSubs.delete(e)}act(e,t){var i;let r=this.mem.get(e),s=(i=r==null?void 0:r.cta)==null?void 0:i.find(o=>o.key===t);if(!(!r||!s)){if(this.deps.trackEvent(we.cta,this.stamp({messageId:e,ctaKey:t,action:s.action,url:s.url})),s.action==="link"&&s.url&&/^https?:\/\//i.test(s.url))try{window.open(s.url,"_blank","noopener")}catch{}else if(s.action==="deep"||s.action==="custom")for(let o of this.ctaSubs)try{o(e,s)}catch{}r.state==="unread"&&this.markRead(e)}}async get(e){let t=this.mem.get(e);return t&&t.state!=="deleted"?t:void 0}async query(e={}){var c;let t=e.state==null?null:new Set(Array.isArray(e.state)?e.state:[e.state]),r=[...this.mem.values()].filter(l=>!((t?!t.has(l.state):l.state==="deleted"||l.state==="archived")||e.category&&l.category!==e.category||e.pinned!=null&&l.pinned!==e.pinned));if(r.sort((l,u)=>l.pinned!==u.pinned?l.pinned?-1:1:e.sort==="priority"&&l.priority!==u.priority?u.priority-l.priority:u.createdAt-l.createdAt||(l.id<u.id?1:-1)),e.cursor){let l=r.findIndex(u=>Sh(u)===e.cursor);l>=0&&(r=r.slice(l+1))}let s=(c=e.limit)!=null?c:Ak,i=r.slice(0,s),o=r.length>s,a=i.length?i[i.length-1]:void 0;return{messages:i,cursor:a?Sh(a):null,hasMore:o}}async markSeen(e){let t=this.deps.now(),r=[];for(let s of e){let i=this.mem.get(s);i&&i.seenAt==null&&(i.seenAt=t,r.push(i),this.deps.trackEvent(we.seen,this.stamp({messageId:s,category:i.category})))}await this.store.putMany(r)}async sweepExpired(){let e=this.deps.now(),t=this.unread,r=[];for(let s of this.mem.values())if(s.expiresAt&&s.expiresAt<=e&&s.priority<3&&s.state!=="archived"&&s.state!=="deleted"){let i=s.state==="unread";s.state="archived",s.archivedAt=e,r.push(s),i&&this.unread--,this.deps.trackEvent(we.expired,this.stamp({messageId:s.id,category:s.category,wasUnread:i}))}this.emitUnreadAnd(t),await this.store.putMany(r)}recountUnread(){let e=0;for(let t of this.mem.values())t.state==="unread"&&e++;this.unread=e}collectDirtyOps(){var t;let e=[];for(let r of this.mem.values())r._dirty&&e.push({id:r.id,state:r.state,pinned:r.pinned,stateAt:(t=r.stateAt)!=null?t:0,pinnedAt:r.pinnedAt});return e}applyServerDelta(e,t,r){let s=[];for(let a of e){let c=this.mem.get(a.id),l=Ma(c,a);l._dirty=c==null?void 0:c._dirty,this.mem.set(a.id,l),s.push(l),c||this.deps.trackEvent(we.received,this.stamp({messageId:l.id,campaignId:l.campaignId,category:l.category,priority:l.priority}))}let i=this.deps.now();for(let a of t){let c=this.mem.get(a);c&&c.state!=="deleted"&&(c.state="deleted",c.deletedAt=i,c.stateAt=i,s.push(c))}let o=this.unread;this.recountUnread(),typeof r=="number"&&(this.unread=r),o!==this.unread&&this.deps.trackEvent(we.unreadChanged,this.stamp({unreadCount:this.unread,delta:this.unread-o})),this.emitState(),this.store.putMany(s)}ackDirty(e){var r,s;let t=[];for(let[i,o]of e){let a=this.mem.get(i);a&&a._dirty&&((r=a.stateAt)!=null?r:0)===o.stateAt&&((s=a.pinnedAt)!=null?s:void 0)===o.pinnedAt&&(a._dirty=!1,t.push(a))}this.store.putMany(t)}dispose(){this.mem.clear(),this.ctaSubs.clear(),this.unread=0}}});var Ch={};_(Ch,{InboxFeature:()=>_a});var Ih,_a,Ah=S(()=>{"use strict";z();Ih={unreadCount:0,total:0,syncStatus:"idle"},_a=class{constructor(){this.name="inbox";this.ctx=null;this.active=!1;this.stateSubs=new Set;this.unreadSubs=new Set;this.pendingCta=new Set;this.lastState=Ih;this.controllerRef=null;this.pushState=e=>{let t=this.lastState.unreadCount;this.lastState=e;for(let r of this.stateSubs)try{r(e)}catch{}if(e.unreadCount!==t)for(let r of this.unreadSubs)try{r(e.unreadCount)}catch{}}}get isActive(){return this.active}setup(e){this.ctx=e,typeof window!="undefined"&&(this.active=!0,this.onVisible=()=>{document.visibilityState==="visible"&&this.triggerSync()},this.onAttention=()=>this.triggerSync(),document.addEventListener("visibilitychange",this.onVisible),window.addEventListener("focus",this.onAttention),window.addEventListener("online",this.onAttention),"serviceWorker"in navigator&&(this.onSwMessage=t=>{var s;let r=t.data;if((r==null?void 0:r.type)==="scalebun-inbox-sync"){this.refreshNow();return}if((r==null?void 0:r.type)==="scalebun-push-click"&&((s=r.data)!=null&&s.scalebunCampaignId)){let i=r.data.scalebunCampaignId;this.ensureRuntime().then(o=>o==null?void 0:o.markReadByCampaign(i))}},navigator.serviceWorker.addEventListener("message",this.onSwMessage)))}triggerSync(){this.active&&this.syncEngine&&this.syncEngine.sync()}applyTheme(e){var r;JSON.stringify(e)!==JSON.stringify((r=this.remoteTheme)!=null?r:null)&&(this.remoteTheme=e,this.widget&&Promise.resolve().then(()=>(Ia(),Ea)).then(({mountInbox:s})=>{var i,o;(i=this.widget)==null||i.destroy(),this.widget=s(this.controller(),(o=this.mountOpts)!=null?o:{},this.remoteTheme)}))}refreshNow(){return this.active?this.ensureRuntime().then(()=>{var e;(e=this.syncEngine)==null||e.sync()}):Promise.resolve()}ensureRuntime(){return this.runtime?Promise.resolve(this.runtime):this.ctx?this.loading?this.loading:(this.loading=(async()=>{var c,l,u,d,p,f,m;let[{InboxRuntime:e},{InboxStore:t}]=await Promise.all([Promise.resolve().then(()=>(Eh(),kh)),Promise.resolve().then(()=>(Aa(),vh))]),r=new t(((c=this.ctx)==null?void 0:c.deviceId)||"anon"),s=new e({trackEvent:(h,b)=>{var k;return(k=this.ctx)==null?void 0:k.trackEvent(h,b)},replayCoord:Z,now:L,onState:this.pushState,store:r});this.runtime=s;for(let h of this.pendingCta)s.onCtaAction(h);this.pendingCta.clear(),await s.hydrate();let{InboxSync:i,InboxTransport:o}=await Promise.resolve().then(()=>(Pa(),wh)),a=new o((u=(l=this.ctx)==null?void 0:l.apiBaseUrl)!=null?u:"",(p=(d=this.ctx)==null?void 0:d.clientKey)!=null?p:"",(m=(f=this.ctx)==null?void 0:f.deviceId)!=null?m:"anon");return this.syncEngine=new i({transport:a,store:r,runtime:s,onStatus:h=>s.setSyncStatus(h),onTheme:h=>this.applyTheme(h)}),this.syncEngine.sync(),s})(),this.loading):Promise.resolve(void 0)}call(e,...t){return this.ensureRuntime().then(r=>{var s;(s=r==null?void 0:r[e])==null||s.call(r,...t)})}controller(){return this.controllerRef?this.controllerRef:(this.controllerRef={subscribe:e=>(this.stateSubs.add(e),e(this.lastState),this.ensureRuntime(),()=>this.stateSubs.delete(e)),onUnreadChange:e=>(this.unreadSubs.add(e),e(this.lastState.unreadCount),this.ensureRuntime(),()=>this.unreadSubs.delete(e)),getState:()=>this.lastState,query:e=>this.ensureRuntime().then(t=>t?t.query(e):{messages:[],cursor:null,hasMore:!1}),get:e=>this.ensureRuntime().then(t=>t==null?void 0:t.get(e)),markRead:e=>this.call("markRead",e),markUnread:e=>this.call("markUnread",e),markAllRead:e=>this.call("markAllRead",e),archive:e=>this.call("archive",e),unarchive:e=>this.call("unarchive",e),pin:(e,t)=>this.call("pin",e,t),remove:e=>this.call("remove",e),ingest:e=>this.call("ingest",e),act:(e,t)=>{this.call("act",e,t)},mount:e=>{typeof document!="undefined"&&this.ensureRuntime().then(async()=>{var r;let{mountInbox:t}=await Promise.resolve().then(()=>(Ia(),Ea));(r=this.widget)==null||r.destroy(),this.mountOpts=e!=null?e:{},this.widget=t(this.controller(),this.mountOpts,this.remoteTheme)})},open:()=>{var e;return(e=this.widget)==null?void 0:e.open()},close:()=>{var e;return(e=this.widget)==null?void 0:e.close()},unmount:()=>{var e;(e=this.widget)==null||e.destroy(),this.widget=void 0},onCtaAction:e=>this.runtime?this.runtime.onCtaAction(e):(this.pendingCta.add(e),this.ensureRuntime(),()=>{this.pendingCta.delete(e)}),refresh:()=>this.ensureRuntime().then(()=>{var e;return(e=this.syncEngine)==null?void 0:e.sync()})},this.controllerRef)}teardown(){var e,t;typeof window!="undefined"&&(this.onVisible&&document.removeEventListener("visibilitychange",this.onVisible),this.onAttention&&(window.removeEventListener("focus",this.onAttention),window.removeEventListener("online",this.onAttention)),this.onSwMessage&&"serviceWorker"in navigator&&navigator.serviceWorker.removeEventListener("message",this.onSwMessage)),this.onVisible=void 0,this.onAttention=void 0,this.onSwMessage=void 0,(e=this.widget)==null||e.destroy(),this.widget=void 0,(t=this.runtime)==null||t.dispose(),this.runtime=void 0,this.syncEngine=void 0,this.loading=void 0,this.stateSubs.clear(),this.unreadSubs.clear(),this.pendingCta.clear(),this.lastState=Ih,this.active=!1}}});var Th={};_(Th,{ProfilerFeature:()=>Oa});function Tk(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}var Oa,Rh=S(()=>{"use strict";z();Oa=class{constructor(){this.name="profiler";this.ctx=null;this.active=!1;this.startedAt=0}get isActive(){return this.active}setup(e){this.ctx=e,this.active=!0}available(){return typeof window!="undefined"&&typeof window.Profiler=="function"}start(e=10){if(!this.active||this.profiler||!this.available())return!1;try{let t=window.Profiler;return this.profiler=new t({sampleInterval:e,maxBufferSize:1e4}),this.startedAt=L(),!0}catch{return this.profiler=void 0,!1}}async stop(){var t;if(!this.profiler)return!1;let e=this.profiler;this.profiler=void 0;try{let r=await e.stop(),s=Math.round(L()-this.startedAt);return(t=this.ctx)==null||t.emit({kind:"performance",metric:"js_profile",value:Array.isArray(r.samples)?r.samples.length:0,duration:s,screenName:Tk(),metadata:{profile:r,format:"w3c-js-self-profiling"},clientId:`prof_${q()}`,timestamp:L()}),!0}catch{return!1}}teardown(){if(this.profiler){try{this.profiler.stop()}catch{}this.profiler=void 0}this.active=!1}}});function Na(){return typeof window!="undefined"&&typeof window.Profiler=="function"}async function Mh(n,e=10){if(!Na())return null;try{let t=window.Profiler,r=new t({sampleInterval:e,maxBufferSize:1e4});await new Promise(o=>setTimeout(o,n));let s=await r.stop(),i=Array.isArray(s==null?void 0:s.samples)?s.samples.length:0;return{profile:s,samples:i}}catch{return null}}var Ph=S(()=>{"use strict"});function Nh(n){return n?{...Lh,...n}:Lh}var Lh,_h,Oh,Ba=S(()=>{"use strict";Lh={pressureSustainMs:6e3,lagP95Ms:500,mainThreadStallMs:500,jankBurstCount:5,jankWindowMs:1e4,frozenFrameMs:700,memSurgeBytesPerSec:6291456,leakSamples:10,leakMinBytes:52428800,heapUsedRatio:.9,cooldownMs:6e4},_h=10*6e4,Oh=10});function Rk(n){if(!n.length)return 0;let e=Math.min(n.length-1,Math.floor(n.length*.95));return n[e]}var As,Cs,Bh=S(()=>{"use strict";Ba();As=class As{constructor(e){this.lag=[];this.pressure="nominal";this.pressureSince=0;this.jankAt=[];this.highSlopeStreak=0;this.memTrend=[];this.lastEmit=new Map;this.emitTimes=[];this.droppedCount=0;this.deps=e,this.th=e.thresholds}get dropped(){return this.droppedCount}onHeartbeat(e){this.lag.push(e),this.lag.length>As.LAG_RING&&this.lag.shift(),e>=this.th.mainThreadStallMs&&this.emit({type:"main_thread_stall",severity:e>=2e3?"critical":"warning",confidence:"high",tier:"lag-proxy",value:Math.round(e),likelyCause:"main thread blocked",description:`The main thread was blocked for ${Math.round(e)} ms.`}),this.evaluateCpu()}onPressure(e){e!==this.pressure&&(this.pressure=e,this.pressureSince=this.deps.now(),this.evaluateCpu())}onJank(e){var s,i;let t=this.deps.now();e.frameDurationMs>=this.th.frozenFrameMs&&this.emit({type:"frozen_frame",severity:e.frameDurationMs>=2e3?"critical":"warning",confidence:"high",tier:e.metric,value:Math.round(e.frameDurationMs),script:e.script,likelyCause:(s=e.script)!=null&&s.url?`long frame in ${e.script.url}`:"long animation frame",description:`A single frame took ${Math.round(e.frameDurationMs)} ms.`}),this.jankAt.push(t);let r=t-this.th.jankWindowMs;for(;this.jankAt.length&&this.jankAt[0]<r;)this.jankAt.shift();this.jankAt.length>=this.th.jankBurstCount&&this.emit({type:"jank_burst",severity:"warning",confidence:"medium",tier:e.metric,value:this.jankAt.length,script:e.script,likelyCause:(i=e.script)!=null&&i.url?`repeated jank in ${e.script.url}`:"repeated main-thread jank",description:`${this.jankAt.length} janky frames within ${Math.round(this.th.jankWindowMs/1e3)} s.`})}onMemory(e,t){let r=this.deps.now();if(t>0&&e/t>=this.th.heapUsedRatio&&this.emit({type:"low_memory_pressure",severity:"critical",confidence:"high",tier:"memory",value:Math.round(e/t*100),likelyCause:"JS heap near its limit",description:`Used heap is ${Math.round(e/t*100)}% of the limit.`}),this.prevMem){let s=(r-this.prevMem.at)/1e3,i=s>0?(e-this.prevMem.used)/s:0;i>this.th.memSurgeBytesPerSec?(this.highSlopeStreak++,this.highSlopeStreak>=2&&this.emit({type:"memory_surge",severity:i>2*this.th.memSurgeBytesPerSec?"critical":"warning",confidence:"medium",tier:"memory",value:Math.round(i),likelyCause:"rapid heap allocation",description:`Heap grew ~${Math.round(i/(1024*1024))} MiB/s.`})):this.highSlopeStreak=0}if(this.prevMem={used:e,at:r},this.memTrend.push(e),this.memTrend.length>this.th.leakSamples&&this.memTrend.shift(),this.memTrend.length===this.th.leakSamples){let s=!0;for(let o=1;o<this.memTrend.length;o++)if(this.memTrend[o]<this.memTrend[o-1]){s=!1;break}let i=this.memTrend[this.memTrend.length-1]-this.memTrend[0];s&&i>=this.th.leakMinBytes&&this.emit({type:"memory_leak_suspicion",severity:"warning",confidence:"low",tier:"memory",value:Math.round(i),likelyCause:"monotonic heap growth",description:`Heap grew ~${Math.round(i/(1024*1024))} MiB over ${this.memTrend.length} samples without release.`})}}evaluateCpu(){if(this.deps.pressureAvailable){this.pressure==="critical"&&this.deps.now()-this.pressureSince>=this.th.pressureSustainMs&&this.emit({type:"cpu_spike",severity:"critical",confidence:"high",tier:"pressure",likelyCause:"sustained CPU pressure",description:`CPU stayed under critical pressure for ${Math.round(this.th.pressureSustainMs/1e3)}s+.`});return}if(this.lag.length<6)return;let e=Rk([...this.lag].sort((t,r)=>t-r));e>this.th.lagP95Ms&&this.emit({type:"cpu_spike",severity:e>2*this.th.lagP95Ms?"critical":"warning",confidence:"medium",tier:"lag-proxy",value:Math.round(e),likelyCause:"sustained event-loop lag",description:`Event-loop lag p95 was ${Math.round(e)} ms.`})}emit(e){var r;let t=this.deps.now();if(!(t-((r=this.lastEmit.get(e.type))!=null?r:-1/0)<this.th.cooldownMs)){if(this.emitTimes=this.emitTimes.filter(s=>t-s<_h),this.emitTimes.length>=Oh){this.droppedCount++;return}this.lastEmit.set(e.type,t),this.emitTimes.push(t),this.deps.onIncident({...e,startTs:t})}}};As.LAG_RING=32;Cs=As});function Fh(n,e){return n.length?n[Math.min(n.length-1,Math.floor(n.length*e))]:0}var Ts,Dh=S(()=>{"use strict";z();Ts=class{constructor(){this.lags=[];this.pressureCounts={nominal:0,fair:0,serious:0,critical:0};this.sawPressure=!1;this.memFirstAt=0;this.memLastAt=0;this.incidents=0}onHeartbeat(e){this.lags.push(e)}onPressure(e){this.pressureCounts[e]++,this.sawPressure=!0}onMemory(e){let t=L();this.memFirst==null&&(this.memFirst=e,this.memFirstAt=t),this.memLast=e,this.memLastAt=t}noteIncident(){this.incidents++}drain(e,t){let r=[...this.lags].sort((i,o)=>i-o),s={lagP50:Math.round(Fh(r,.5)),lagP95:Math.round(Fh(r,.95)),lagMax:r.length?Math.round(r[r.length-1]):0,heartbeats:this.lags.length,incidents:this.incidents,droppedIncidents:t,tiers:e};if(this.sawPressure&&(s.pressure={...this.pressureCounts}),this.memLast!=null&&this.memFirst!=null){let i=(this.memLastAt-this.memFirstAt)/1e3;s.heap={firstBytes:this.memFirst,lastBytes:this.memLast,slopeBytesPerSec:i>0?Math.round((this.memLast-this.memFirst)/i):0}}return this.lags=[],this.pressureCounts={nominal:0,fair:0,serious:0,critical:0},this.sawPressure=!1,this.incidents=0,this.memLast!=null&&(this.memFirst=this.memLast,this.memFirstAt=L()),s}}});function qh(){try{return typeof document=="undefined"||document.visibilityState!=="hidden"}catch{return!0}}function Hh(n,e){var d;let t=[],r=L(),s,i=()=>{let p=L(),f=p-r-e.heartbeatMs;r=p,f>=0&&n.onHeartbeat(f),s=setTimeout(i,e.heartbeatMs)},o=()=>{r=L(),s=setTimeout(i,e.heartbeatMs)},a=()=>{s&&clearTimeout(s),s=void 0},c=()=>{qh()?s||o():a()};typeof document!="undefined"&&(document.addEventListener("visibilitychange",c),t.push(()=>document.removeEventListener("visibilitychange",c))),qh()&&o(),t.push(a);let l=!1;try{let p=globalThis.PressureObserver;if(typeof p=="function"){l=!0;let f=new p(m=>{let h=m[m.length-1];h!=null&&h.state&&n.onPressure(h.state)});f.observe("cpu",{sampleInterval:2e3}).catch(()=>{}),t.push(()=>{try{f.disconnect()}catch{}})}}catch{l=!1}let u=typeof performance!="undefined"&&typeof((d=performance.memory)==null?void 0:d.usedJSHeapSize)=="number";if(u){let p=()=>{var h;let m=performance.memory;m&&typeof m.usedJSHeapSize=="number"&&n.onMemory(m.usedJSHeapSize,(h=m.jsHeapSizeLimit)!=null?h:0)};p();let f=setInterval(p,e.memorySampleMs);t.push(()=>clearInterval(f))}return{stop:()=>{for(let p of t)try{p()}catch{}},pressureAvailable:l,memoryAvailable:u}}var $h=S(()=>{"use strict";z()});var zh={};_(zh,{startWatchdog:()=>Nk});function Pk(n,e){let t=e!=null?e:1;return t>=1?!0:t<=0?!1:Ee(`${n!=null?n:""}:wzb-watchdog-v1`)%100<t*100}function Lk(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}function Nk(n){var k,x,y,g;let e=(k=n.watchdogOptions)!=null?k:{};if(!Pk(n.sessionId,e.sampleRate))return Mk;let t=(w,v,E,C)=>{let I=Z();n.emit({kind:"performance",metric:w,value:v,screenName:Lk(),metadata:I?{...E,replay:I}:E,clientId:C!=null?C:`wd_${q()}`,timestamp:L()})},r=e.captureProfileOnIncident!==!1,s=!1,i=0,o=w=>{if(!r||s||!Na())return;let v=L();v-i<Ok||(i=v,s=!0,Mh(_k).then(E=>{E&&t("js_profile",E.samples,{profile:E.profile,format:"w3c-js-self-profiling",incidentClientId:w})}).finally(()=>{s=!1}))},a=Nh(e.thresholds),c=new Ts,l=0,u=0,d=typeof globalThis.PressureObserver=="function",p=new Cs({thresholds:a,now:L,pressureAvailable:d,onIncident:w=>{var E;l++,c.noteIncident();let v=`wd_${q()}`;t("resource_incident",(E=w.value)!=null?E:1,w,v),n.signal("resource_pressure"),o(v)}}),f=Wd(w=>p.onJank(w)),m=Hh({onHeartbeat:w=>{p.onHeartbeat(w),c.onHeartbeat(w)},onPressure:w=>{p.onPressure(w),c.onPressure(w)},onMemory:(w,v)=>{p.onMemory(w,v),c.onMemory(w)}},{heartbeatMs:Math.max(250,(x=e.heartbeatMs)!=null?x:1e3),memorySampleMs:(y=e.memorySampleMs)!=null?y:2e4}),h=()=>({pressure:d,memory:m.memoryAvailable}),b=setInterval(()=>{u++;let w=c.drain(h(),p.dropped);t("resource_health",w.lagP95,w)},(g=e.rollupMs)!=null?g:3e4);return{stop:()=>{clearInterval(b),f(),m.stop()},stats:()=>({incidents:l,droppedIncidents:p.dropped,rollups:u,tiers:h()})}}var Mk,_k,Ok,Uh=S(()=>{"use strict";z();Fe();Li();Ph();Bh();Dh();$h();Ba();Mk={stop:()=>{},stats:()=>({incidents:0,droppedIncidents:0,rollups:0,tiers:{pressure:!1,memory:!1}})};_k=1e4,Ok=6e4});var Vh={};_(Vh,{WatchdogFeature:()=>Fa});var Bk,Fa,Wh=S(()=>{"use strict";Bk={incidents:0,droppedIncidents:0,rollups:0,tiers:{pressure:!1,memory:!1}},Fa=class{constructor(){this.name="watchdog";this.active=!1}get isActive(){return this.active}async setup(e){if(typeof window=="undefined"||typeof performance=="undefined")return;this.active=!0;let{startWatchdog:t}=await Promise.resolve().then(()=>(Uh(),zh));this.active&&(this.handle=t(e))}stats(){var e,t;return(t=(e=this.handle)==null?void 0:e.stats())!=null?t:Bk}teardown(){var e;this.active=!1,(e=this.handle)==null||e.stop(),this.handle=void 0}}});function Fk(n){if(!n)return[];try{let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch{return[]}}function Dk(){try{return typeof localStorage!="undefined"?localStorage:null}catch{return null}}var Kh,Da,Rs,jh=S(()=>{"use strict";Kh="scalebun_inapp_outbox";Da=class{constructor(e,t=Dk()){this.post=e;this.storage=t;this.queue=[];this.flushing=!1;this.timer=null;var r,s;this.queue=Fk((s=(r=this.storage)==null?void 0:r.getItem(Kh))!=null?s:null)}enqueue(e){this.queue.some(t=>t.id===e.id)||(this.queue.push(e),this.queue.length>200&&this.queue.splice(0,this.queue.length-200),this.persist(),this.schedule())}get size(){return this.queue.length}schedule(){this.timer||this.flushing||(this.timer=setTimeout(()=>{this.timer=null,this.flush()},800))}async flush(){if(!(this.flushing||this.queue.length===0)){this.flushing=!0;try{for(;this.queue.length>0;){let e=this.queue.slice(0,50);if(!await this.post(e))break;let r=new Set(e.map(s=>s.id));this.queue=this.queue.filter(s=>!r.has(s.id)),this.persist()}}finally{this.flushing=!1,this.queue.length>0&&this.schedule()}}}persist(){var e;try{(e=this.storage)==null||e.setItem(Kh,JSON.stringify(this.queue))}catch{}}};Rs=class{constructor(e,t){this.apiBaseUrl=e;this.clientKey=t;this.outbox=new Da(r=>this.postEvents(r))}get usable(){return!!this.clientKey&&!!this.apiBaseUrl&&typeof fetch!="undefined"}headers(){return{"content-type":"application/json","x-scalebun-client-key":this.clientKey}}async fetchConfig(e){if(!this.usable)return null;let t=new URLSearchParams;for(let[r,s]of Object.entries(e))s&&t.set(r,String(s));try{let r=await fetch(`${this.apiBaseUrl}/sdk/engage/config?${t.toString()}`,{headers:this.headers(),cache:"no-store"});return r.ok?await r.json():null}catch{return null}}async postEvents(e){if(!this.usable||e.length===0)return!1;try{return(await fetch(`${this.apiBaseUrl}/sdk/engage/events`,{method:"POST",headers:this.headers(),body:JSON.stringify({schemaVersion:1,source:"inapp",events:e}),keepalive:!0})).ok}catch{return!1}}}});function qk(n){let e="";for(let t=0;t<n.length;t++){let r=n[t];r==="*"?n[t+1]==="*"?(e+=".*",t++):e+="[^/]*":"\\^$.|?+()[]{}".includes(r)?e+="\\"+r:e+=r}return new RegExp("^"+e+"$")}function qa(n,e){return!n||n.length===0?!0:n.some(t=>qk(t).test(e))}function Hk(n,e){var r;if(!n)return!0;let t=(r=e.queryElement)!=null?r:s=>typeof document!="undefined"?!!document.querySelector(s):!1;try{return t(n)}catch{return!1}}function zk(n){let e=n==null?void 0:n.segments;return e?e instanceof Set?e:new Set(e):new Set}function Uk(n,e){var r;let t=n.trim();if(!t)return!0;if(t.startsWith("segment:"))return zk(e).has(t.slice(8).trim());for(let s of $k){let i=t.indexOf(s);if(i>0){let o=t.slice(0,i).trim(),a=t.slice(i+s.length).trim(),c=(r=e==null?void 0:e.attrs)==null?void 0:r[o];if(c===void 0)return!1;let l=Number(c),u=Number(a),d=!Number.isNaN(l)&&!Number.isNaN(u)&&a!=="";switch(s){case"=":return String(c)===a;case"!=":return String(c)!==a;case">":return d&&l>u;case"<":return d&&l<u;case">=":return d&&l>=u;case"<=":return d&&l<=u}}}return!1}function Vk(n,e){return!n||!n.trim()?!0:n.split("&&").every(t=>Uk(t,e))}function Xh(n,e,t){var s,i;let r=(s=n.targeting)!=null?s:{};return qa(r.route,e.route)?Hk(r.element,e)?r.minViewport!=null&&((i=e.viewportWidth)!=null?i:1/0)<r.minViewport?{eligible:!1,reason:"viewport"}:r.selection&&!e.hasSelection?{eligible:!1,reason:"selection"}:Vk(r.audience,e.profile)?t.canShow(n,e.now)?{eligible:!0}:{eligible:!1,reason:"frequency"}:{eligible:!1,reason:"audience"}:{eligible:!1,reason:"element"}:{eligible:!1,reason:"route"}}function Kk(){try{return typeof localStorage!="undefined"?localStorage:null}catch{return null}}function jk(){try{return typeof sessionStorage!="undefined"?sessionStorage:null}catch{return null}}var $k,Gh,Yh,Wk,Ms,Ha=S(()=>{"use strict";as();$k=[">=","<=","!=","=",">","<"];Gh="scalebun_inapp_freq",Yh="scalebun_inapp_freq_session",Wk=1,Ms=class{constructor(e=Kk(),t="",r=jk()){this.storage=e;this.sessionId=t;this.sessionStore=r;this.map=this.load(),this.session=this.loadSession()}loadSession(){var e;try{let t=(e=this.sessionStore)==null?void 0:e.getItem(Yh),r=t?JSON.parse(t):null;if(r&&r.sid===this.sessionId&&r.recs)return{sid:this.sessionId,recs:r.recs}}catch{}return{sid:this.sessionId,recs:{}}}saveSession(){var e;try{(e=this.sessionStore)==null||e.setItem(Yh,JSON.stringify(this.session))}catch{}}load(){var e;try{let t=(e=this.storage)==null?void 0:e.getItem(Gh);return t?JSON.parse(t):{}}catch{return{}}}save(){var e;try{(e=this.storage)==null||e.setItem(Gh,JSON.stringify(this.map))}catch{}}canShow(e,t){var a,c,l;let r=e.frequency,s=this.map[e.id],i=this.session.recs[e.id];if(s!=null&&s.dismissed&&((a=e.dismiss)!=null&&a.persistDismiss||i!=null&&i.dismissed))return!1;let o=(c=r==null?void 0:r.maxImpressionsPerSession)!=null?c:r?0:Wk;return o>0&&((l=i==null?void 0:i.n)!=null?l:0)>=o?!1:s?!(r!=null&&r.showOnce&&s.count>0||(r==null?void 0:r.maxImpressions)!=null&&s.count>=r.maxImpressions||(r==null?void 0:r.cooldown)!=null&&t-s.lastShown<r.cooldown):!0}recordImpression(e,t){var i,o;let r=(i=this.map[e])!=null?i:{count:0,lastShown:0};r.count+=1,r.lastShown=t,this.map[e]=r,this.save();let s=(o=this.session.recs[e])!=null?o:{n:0};s.n+=1,this.session.recs[e]=s,this.saveSession()}recordDismiss(e,t){var i,o;let r=(i=this.map[e])!=null?i:{count:0,lastShown:0};r.dismissed=!0,r.lastShown=t,this.map[e]=r,this.save();let s=(o=this.session.recs[e])!=null?o:{n:0};s.dismissed=!0,this.session.recs[e]=s,this.saveSession()}clear(){this.map={},this.save(),this.session={sid:this.sessionId,recs:{}},this.saveSession()}}});var Jh=S(()=>{"use strict"});function Qh(n,e){var t,r,s;if(n.type!==e.type)return!1;switch(n.type){case"route":return qa(n.match?[n.match]:void 0,(t=e.value)!=null?t:"");case"event":return n.match==null||n.match===e.value;case"idle":return((r=e.arg)!=null?r:0)>=((s=n.arg)!=null?s:0);case"element":case"hover":case"selection":case"keyboard":case"right-click":return n.match==null||n.match===e.value;default:return!0}}function Zh(){let n=null,e=null,t=()=>typeof location!="undefined"?location.pathname+location.search:"";return{type:"route",start(r){if(typeof window=="undefined"||typeof history=="undefined")return;let s=()=>r.fire({type:"route",value:t()}),i=history.pushState,o=history.replaceState;history.pushState=function(...a){let c=i.apply(this,a);return s(),c},history.replaceState=function(...a){let c=o.apply(this,a);return s(),c},e=s,window.addEventListener("popstate",s),window.addEventListener("hashchange",s),n=()=>{history.pushState=i,history.replaceState=o},s()},stop(){n==null||n(),n=null,e&&typeof window!="undefined"&&(window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)),e=null}}}function eg(){let n=null;return{type:"event",start(e){n=e},stop(){n=null},fireEvent(e){n==null||n.fire({type:"event",value:e})}}}function tg(){let n=null,e=[],t=[],r=null,s=["mousemove","mousedown","keydown","scroll","touchstart","pointerdown"],i=()=>{for(let a of t)clearTimeout(a);t=[]},o=()=>{if(i(),!!n)for(let a of e)a>0&&t.push(setTimeout(()=>n==null?void 0:n.fire({type:"idle",arg:a}),a))};return{type:"idle",start(a){if(n=a,typeof window!="undefined"){r=o;for(let c of s)window.addEventListener(c,r,{passive:!0});o()}},stop(){if(i(),r&&typeof window!="undefined")for(let a of s)window.removeEventListener(a,r);r=null,n=null},setThresholds(a){e=Array.from(new Set(a.filter(c=>c>0))),o()}}}var Ps,ng=S(()=>{"use strict";Ha();Jh();Ps=class{constructor(e=()=>Date.now()){this.listeners=new Set;this.plugins=[];this.now=e}on(e){return this.listeners.add(e),()=>this.listeners.delete(e)}fire(e){var r;let t={...e,at:(r=e.at)!=null?r:this.now()};for(let s of this.listeners)try{s(t)}catch{}}use(e){this.plugins.push(e),e.start(this)}stop(){for(let e of this.plugins)e.stop();this.plugins=[],this.listeners.clear()}}});function Xk(n,e){var r,s;let t=Math.max(0,Math.min(120,120-(e-n.triggeredAt)/1e3));return Gk[n.tier]+((r=n.campaignPriority)!=null?r:0)+t+((s=Yk[n.category])!=null?s:0)}function sg(n,e,t,r){var y;let s=r.now,i=n.map(g=>({c:g,score:Xk(g,s)})).sort((g,w)=>w.score-g.score||g.c.id.localeCompare(w.c.id)),o=[],a=(g,w,v,E,C)=>o.push({id:g.id,action:w,reason:v,zone:g.zone,score:E,preempts:C}),c=new Map,l=new Map,u=e.filter(g=>g.zone==="toast").length,d=0,p=e.some(g=>Ls(g.zone)),f=!1,m=e.some(g=>g.tier==="critical")||!1,h=t.tokens,b=t.interruptionsThisSession,k=t.modalsToday,x=t.lastInterruptionAt;for(let{c:g,score:w}of i){if(g.campaignId){if(c.has(g.campaignId)){a(g,"DROP","dedupe:campaign",w);continue}c.set(g.campaignId,w)}let v=(y=r.guard)==null?void 0:y.call(r,g);if(v){a(g,v.action,v.reason,w);continue}if(g.interactionOnly){a(g,"DEFER","interaction-only",w);continue}if(g.guidance&&m){a(g,"DEFER","defer-until-clear",w);continue}if((g.zone==="toast"?3:1)===1&&l.has(g.zone)){a(g,g.cost>0?"QUEUE":"DROP",g.cost>0?"queue:zone-busy":"zone-lost",w);continue}if(Ls(g.zone)&&p){a(g,"QUEUE","queue:focus-busy",w);continue}if(g.zone==="toast"&&u+d>=3){a(g,"QUEUE","queue:toast-cap",w);continue}if(g.cost>0){if(b>=t.maxInterruptionsPerSession){a(g,"QUEUE","queue:budget:interruptions",w);continue}if(g.zone==="modal"&&k>=t.maxModalsPerDay){a(g,"QUEUE","queue:budget:modals",w);continue}if(f||s-x<t.minCooldownMs){a(g,"QUEUE","queue:cooldown",w);continue}if(h<g.cost){a(g,"QUEUE","queue:budget:tokens",w);continue}}let C;if(g.tier==="critical"){let I=e.find(R=>R.zone===g.zone&&!Ls(R.zone)&&rg[R.tier]<rg.critical);I&&(C=I.id)}a(g,C?"PREEMPT":"SHOW",C?"preempt:critical":"show",w,C),l.set(g.zone,g.id),g.zone==="toast"&&d++,Ls(g.zone)&&(p=!0),g.tier==="critical"&&(m=!0),g.cost>0&&(h-=g.cost,b++,g.zone==="modal"&&k++,f=!0,x=s)}return o}var Gk,Yk,rg,Ls,ig=S(()=>{"use strict";Gk={critical:1e3,high:400,normal:200,low:100,passive:50},Yk={security:300,system:250,billing:200},rg={critical:4,high:3,normal:2,low:1,passive:0};Ls=n=>n==="modal"||n==="takeover"});function Jk(n,e={}){switch(n){case"modal":return{surface:"modal",surfaceOptions:{placement:"center",size:"md",backdrop:!0}};case"fullscreen":return{surface:"takeover",surfaceOptions:{size:"full"}};case"bottom_sheet":return{surface:"slideover",surfaceOptions:{placement:"bottom"}};case"top_banner":return{surface:"banner",surfaceOptions:{placement:"top"}};case"bottom_banner":return{surface:"banner",surfaceOptions:{placement:"bottom"}};case"toast":return{surface:"toast",surfaceOptions:{placement:"bottom-right"}};case"tooltip":return e.anchorSelector?{surface:"popover",surfaceOptions:{placement:"bottom",maxWidth:320}}:{surface:"toast",surfaceOptions:{placement:"bottom-right"}};default:return{surface:"modal",surfaceOptions:{placement:"center",backdrop:!0}}}}function Qk(n){var s,i;let e=n.spec,t=[];e.imageUrl&&t.push({kind:"image",props:{src:e.imageUrl,alt:(s=e.title)!=null?s:""}}),e.title&&t.push({kind:"heading",props:{text:e.title}}),e.body&&t.push({kind:"text",props:{text:e.body}});let r=[];return e.cta&&r.push({label:e.cta.label,variant:"primary",action:e.cta.action,deepLink:e.cta.deepLink}),e.secondaryCta&&r.push({label:e.secondaryCta.label,variant:"secondary",action:e.secondaryCta.action}),r.length&&t.push({kind:"cta",props:{actions:r}}),t.length===0&&t.push({kind:"text",props:{text:(i=e.body)!=null?i:""}}),t}function Zk(n){var t,r,s,i;if(n.preview)return[{type:"manual"}];let e=(r=n.targetScreen)!=null?r:(t=n.triggerConfig)==null?void 0:t.screen;return e?[{type:"route",match:e}]:(s=n.triggerConfig)!=null&&s.event?[{type:"event",match:n.triggerConfig.event}]:(i=n.triggerConfig)!=null&&i.seconds?[{type:"idle",arg:n.triggerConfig.seconds*1e3}]:[{type:"manual"}]}function e0(n){let e=n.throttle;if(!e)return;let t={};return e.showOnce&&(t.showOnce=!0),e.maxImpressions!=null&&(t.maxImpressions=e.maxImpressions),e.cooldownHours!=null&&(t.cooldown=e.cooldownHours*36e5),Object.keys(t).length?t:void 0}function t0(n,e={}){var o,a,c;let{surface:t,surfaceOptions:r}=Jk(n.layout,e),s=t==="popover",i=(a=n.targetScreen)!=null?a:(o=n.triggerConfig)==null?void 0:o.screen;return{id:n.id,key:`legacy.${n.layout}.${n.id}`,name:(c=n.spec.title)!=null?c:`Legacy ${n.layout}`,category:"misc",platforms:["web"],surface:t,surfaceOptions:r,blocks:Qk(n),priority:n.layout==="fullscreen"?"high":"normal",triggers:Zk(n),targeting:{...i?{route:[i]}:{},...s&&e.anchorSelector?{element:e.anchorSelector}:{}},frequency:e0(n),dismiss:{xButton:!0,escClose:!0,backdropClose:n.layout==="modal"},motion:{reducedMotionFallback:"fade"},contract:{payloadVersion:1}}}function og(n,e={}){return(n!=null?n:[]).map(t=>t0(t,e))}var ag=S(()=>{"use strict"});function n0(n){var e;return(e=n==null?void 0:n.engine)!=null?e:"compat"}function cg(n){var r;let e=n0(n.config);if(e==="legacy")return[];let t=[];return(e==="native"||e==="compat")&&t.push(...(r=n.nativeVariants)!=null?r:[]),e==="compat"&&t.push(...og(n.legacyMessages)),t.filter(dp)}var lg=S(()=>{"use strict";ag();zr()});var dg={};_(dg,{InAppEngine:()=>$a});var r0,$a,ug=S(()=>{"use strict";jh();ng();Ha();ig();lg();ls();uo();Fo();zr();Vi();r0=120,$a=class{constructor(e){this.deps=e;this.host=new dn;this.slots=new Pt;this.variants=[];this.pending=new Map;this.live=new Map;this.tickTimer=null;this.started=!1;var t;this.now=(t=e.now)!=null?t:()=>Date.now(),this.freq=new Ms(void 0,e.sessionId),this.transport=new Rs(e.apiBaseUrl,e.clientKey),this.bus=new Ps(this.now),this.budget={tokens:5,interruptionsThisSession:0,maxInterruptionsPerSession:5,modalsToday:0,maxModalsPerDay:3,lastInterruptionAt:0,minCooldownMs:3e4}}async start(){this.started||(this.started=!0,await this.load())}async onIdentify(){this.started&&await this.load()}async load(){var s,i;let e;try{e=await this.transport.fetchConfig({platform:"web",appVersion:this.deps.appVersion,deviceId:this.deps.deviceId,endUserId:(i=(s=this.deps).userId)==null?void 0:i.call(s),route:this.deps.route()})}catch{return}if(!this.started)return;let t=Ui(e),r=e==null?void 0:e.variants;this.variants=cg({legacyMessages:t.inAppMessages,nativeVariants:r,config:this.deps.config}),this.variants.length!==0&&(this.unsub||(this.host.ensure(),this.bus.use(Zh()),this.bus.use(eg()),this.bus.use(tg()),this.unsub=this.bus.on(o=>this.onSignal(o))),this.bus.fire({type:"route",value:this.deps.route()}))}fireEvent(e){this.started&&this.bus.fire({type:"event",value:e})}onSignal(e){let t=this.targetingCtx();for(let r of this.variants)this.live.has(r.id)||this.pending.has(r.id)||r.triggers.some(s=>Qh(s,e))&&Xh(r,t,this.freq).eligible&&this.pending.set(r.id,this.toCandidate(r));this.pending.size&&this.scheduleTick()}toCandidate(e){let t=e.surface==="coachmark"||e.surface==="tour"||e.surface==="hotspot",r=e.surface==="launcher"||e.surface==="palette";return{id:e.id,zone:_t(e),focus:mo[e.surface],cost:ho[e.surface],tier:e.priority,category:e.category,triggeredAt:this.now(),guidance:t,interactionOnly:r}}targetingCtx(){var t,r,s,i;let e=typeof window!="undefined"?!!((r=(t=window.getSelection)==null?void 0:t.call(window))!=null&&r.toString()):!1;return{route:this.deps.route(),profile:(i=(s=this.deps).profile)==null?void 0:i.call(s),now:this.now(),viewportWidth:typeof window!="undefined"?window.innerWidth:void 0,hasSelection:e}}scheduleTick(){this.tickTimer||(this.tickTimer=setTimeout(()=>{this.tickTimer=null,this.tick()},r0))}async tick(){let e=[...this.pending.values()];if(e.length===0)return;let t=[...this.live.values()].map(s=>s.occ),r=sg(e,t,this.budget,{now:this.now()});for(let s of r){let i=this.variants.find(o=>o.id===s.id);i&&(s.action==="SHOW"||s.action==="PREEMPT"?(this.pending.delete(i.id),s.action==="PREEMPT"&&s.preempts&&this.close(s.preempts),await this.show(i)):s.action==="DROP"&&this.pending.delete(i.id))}this.pending.size&&this.scheduleTick()}async show(e){let t=this.now.bind(this),r=(i,o)=>{var c,l;let a={id:`${e.id}:${i}:${t()}`,type:i,variantId:e.id,ts:t(),props:o};this.transport.outbox.enqueue(a),(l=(c=this.deps).onEvent)==null||l.call(c,a)},s={onImpression:()=>{this.freq.recordImpression(e.id,t()),r("impression")},onView:()=>r("view"),onCtaClick:i=>r("cta_click",{action:i}),onInteraction:i=>r("interaction",{name:i}),onDismiss:i=>{this.freq.recordDismiss(e.id,t()),this.live.delete(e.id),r("dismiss",{method:i}),this.scheduleTick()}};try{let i=await Bo(e,s,{host:this.host,slots:this.slots});this.live.set(e.id,{occ:{id:e.id,zone:_t(e),focus:mo[e.surface],tier:e.priority},surface:i});let o=ho[e.surface];o>0&&(this.budget.interruptionsThisSession++,this.budget.lastInterruptionAt=t(),this.budget.tokens=Math.max(0,this.budget.tokens-o),_t(e)==="modal"&&this.budget.modalsToday++)}catch{this.pending.delete(e.id)}}close(e){let t=this.live.get(e);if(t){try{t.surface.close()}catch{}this.live.delete(e)}}stop(){var e;if(this.started){this.started=!1,this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=null),(e=this.unsub)==null||e.call(this),this.bus.stop();for(let t of[...this.live.keys()])this.close(t);this.pending.clear(),this.transport.outbox.flush();try{this.host.destroy()}catch{}}}}});var pg={};_(pg,{InApp2Feature:()=>za});var za,fg=S(()=>{"use strict";za=class{constructor(){this.name="inapp2";this.active=!1}get isActive(){return this.active}async setup(e){if(typeof window=="undefined"||typeof document=="undefined"||!e.clientKey||!e.apiBaseUrl)return;this.active=!0;let{InAppEngine:t}=await Promise.resolve().then(()=>(ug(),dg));this.active&&(this.engine=new t({apiBaseUrl:e.apiBaseUrl,clientKey:e.clientKey,deviceId:e.deviceId,sessionId:e.sessionId,appVersion:e.appVersion,userId:()=>{var r;return(r=e.getUserId)==null?void 0:r.call(e)},route:()=>typeof location!="undefined"?location.pathname+location.search:"",config:{engine:"native"}}),this.engine.start())}fireEvent(e){var t;(t=this.engine)==null||t.fireEvent(e)}onIdentify(){var e;(e=this.engine)==null||e.onIdentify()}teardown(){var e;this.active=!1,(e=this.engine)==null||e.stop(),this.engine=void 0}}});var yg={};_(yg,{armSoftAsk:()=>d0});function gg(){try{let n=Number(localStorage.getItem(bg)||0);return Number.isFinite(n)&&n>Date.now()}catch{return!1}}function c0(n){try{localStorage.setItem(bg,String(Date.now()+n*864e5))}catch{}}function l0(n){return new Promise(e=>{let t=document.createElement("div");t.setAttribute("data-scalebun-softask",""),t.setAttribute("data-scalebun",""),t.style.cssText="position:fixed;z-index:2147483000;inset:auto 16px 16px auto";let r=t.attachShadow({mode:"open"});r.innerHTML=`
671
+ <style>
672
+ :host{all:initial}
673
+ .c{width:min(340px,calc(100vw - 32px));box-sizing:border-box;padding:16px 18px;border-radius:14px;
674
+ background:#fff;color:#172033;box-shadow:0 18px 48px rgba(3,7,18,.28);
675
+ font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
676
+ animation:in .22s ease-out both}
677
+ @keyframes in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
678
+ .t{font-size:15px;font-weight:700;margin:0 0 4px}
679
+ .b{margin:0 0 14px;color:#5b6472}
680
+ .r{display:flex;gap:8px;justify-content:flex-end}
681
+ button{font:inherit;font-weight:600;border-radius:9px;padding:8px 14px;cursor:pointer;border:0}
682
+ .no{background:transparent;color:#5b6472}
683
+ .yes{background:var(--a);color:#fff}
684
+ @media (prefers-color-scheme:dark){
685
+ .c{background:#1a1e27;color:#f2f4f8}.b{color:#aab2c0}.no{color:#aab2c0}
686
+ }
687
+ @media (prefers-reduced-motion:reduce){.c{animation-duration:1ms}}
688
+ </style>
689
+ <div class="c" role="dialog" aria-modal="false" style="--a:${n.accent}">
690
+ <p class="t"></p>
691
+ <p class="b"></p>
692
+ <div class="r">
693
+ <button class="no" type="button"></button>
694
+ <button class="yes" type="button"></button>
695
+ </div>
696
+ </div>`,r.querySelector(".t").textContent=n.title,r.querySelector(".b").textContent=n.body;let s=r.querySelector(".no"),i=r.querySelector(".yes");s.textContent=n.denyText,i.textContent=n.allowText;let o=a=>{t.remove(),e(a)};s.addEventListener("click",()=>o(!1)),i.addEventListener("click",()=>o(!0)),document.body.appendChild(t)})}async function d0(n,e){var o;if(typeof document=="undefined"||typeof Notification=="undefined"||e.permission()!=="default"||gg())return;let r={...a0,...n},s=async()=>{var l,u,d;if(e.permission()!=="default"||gg())return;if(!await l0(r)){c0(r.remindAfterDays),(l=e.log)==null||l.call(e,"soft-ask declined \u2014 snoozed");return}let c=await e.enable();(u=e.log)==null||u.call(e,`soft-ask accepted \u2192 enable() = ${c}`),c==="denied"&&((d=e.log)==null||d.call(e,"browser permission denied \u2014 the SDK cannot re-ask"))},i=(o=n.trigger)!=null?o:"immediate";if(i==="immediate")return void s();if(typeof i=="object"&&"afterMs"in i){setTimeout(()=>void s(),Math.max(0,i.afterMs));return}if(typeof i=="object"&&"onSelector"in i){let a=c=>{let l=c.target;l&&l.closest&&l.closest(i.onSelector)&&(document.removeEventListener("click",a,!0),s())};document.addEventListener("click",a,!0)}}var bg,a0,vg=S(()=>{"use strict";bg="scalebun.push.softAsk.snoozedUntil",a0={title:"Stay in the loop",body:"Get notified about important updates. You can turn this off any time.",allowText:"Allow notifications",denyText:"Not now",remindAfterDays:7,accent:"#5B4FE0"}});var wg={};_(wg,{buildBugReportPayload:()=>p0});function u0(){try{return typeof location!="undefined"?location.href:void 0}catch{return}}function p0(n,e=[],t={}){var s;let r=t.replayCoord;return{clientReportId:`bug_${q()}`,...n.title?{title:K(n.title)}:{},message:K((s=n.message)!=null?s:""),...n.email?{email:n.email}:{},url:u0(),...e.length?{console:e.slice(-20)}:{},...typeof(r==null?void 0:r.seq)=="number"?{replaySeq:r.seq}:{},...r!=null&&r.segmentId?{replaySegmentId:r.segmentId}:{},timestamp:L()}}var xg=S(()=>{"use strict";z()});function f0(n){let e=n.getBoundingClientRect();return{x:e.left,y:e.top,width:e.width,height:e.height}}function m0(){return{x:0,y:0,width:window.innerWidth||1024,height:window.innerHeight||768}}var h0,_s,Sg=S(()=>{"use strict";Mo();z();h0=`
697
+ :host{all:initial}
698
+ *{box-sizing:border-box;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
699
+ .spot{position:fixed;border-radius:8px;box-shadow:0 0 0 9999px rgba(12,10,20,.55);z-index:2147483600;pointer-events:none;transition:all .2s ease}
700
+ .backdrop{position:fixed;inset:0;background:rgba(12,10,20,.55);z-index:2147483600}
701
+ .card{position:fixed;z-index:2147483602;width:min(320px,calc(100vw - 32px));background:#1b1922;color:#edeaf2;border-radius:12px;
702
+ padding:16px 18px;box-shadow:0 12px 40px rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.08)}
703
+ .card.modal{top:50%;left:50%;transform:translate(-50%,-50%)}
704
+ .arrow{position:absolute;width:12px;height:12px;background:inherit;border:inherit;transform:rotate(45deg)}
705
+ .t{font-size:15px;font-weight:700;margin:0 0 6px;padding-right:20px}
706
+ .b{font-size:13px;line-height:1.5;color:#c8c3d4;margin:0 0 14px}
707
+ .ft{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
708
+ .count{font-size:11px;color:#9a95a6;font-variant-numeric:tabular-nums;flex:none;white-space:nowrap}
709
+ .btns{display:flex;gap:8px;flex:none}
710
+ button{font:inherit;cursor:pointer;border-radius:8px;border:none}
711
+ .skip{background:none;color:#9a95a6;font-size:12px;padding:6px 8px}
712
+ .back{background:#262131;color:#edeaf2;font-size:12px;font-weight:600;padding:7px 12px}
713
+ .next{background:#7c6cf0;color:#fff;font-size:12px;font-weight:600;padding:7px 14px}
714
+ .x{position:absolute;top:10px;right:12px;background:none;color:#9a95a6;font-size:17px;line-height:1;padding:2px}
715
+ @media(prefers-reduced-motion:reduce){.spot{transition:none}}`,_s=class{constructor(){this.host=null;this.root=null;this.card=null;this.spot=null;this.ctx=null;this.onReflow=()=>this.position()}ensure(){return this.root?this.root:(this.host=document.createElement("div"),this.host.setAttribute("data-scalebun-coach",""),this.host.setAttribute("data-scalebun",""),this.root=this.host.attachShadow({mode:"open"}),Ne(this.root,h0),document.body.appendChild(this.host),window.addEventListener("scroll",this.onReflow,!0),window.addEventListener("resize",this.onReflow),this.root)}render(e){var d,p;let t=this.ensure();this.ctx=e,[...t.querySelectorAll(".spot,.backdrop,.card")].forEach(f=>f.remove()),this.card=null,this.spot=null;let r=!!e.el&&!e.degraded;if(r)this.spot=document.createElement("div"),this.spot.className="spot",t.appendChild(this.spot);else{let f=document.createElement("div");f.className="backdrop",f.addEventListener("click",()=>e.controls.close()),t.appendChild(f)}let s=document.createElement("div");s.className=r?"card":"card modal",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),e.step.title&&s.setAttribute("aria-label",e.step.title);let i=document.createElement("button");if(i.className="x",i.type="button",i.textContent="\xD7",i.setAttribute("aria-label","Close"),i.addEventListener("click",()=>e.controls.close()),s.appendChild(i),e.step.title){let f=document.createElement("div");f.className="t",f.textContent=e.step.title,s.appendChild(f)}if(e.step.body){let f=document.createElement("div");f.className="b",f.textContent=e.step.body,s.appendChild(f)}let o=document.createElement("div");o.className="ft";let a=document.createElement("span");a.className="count",a.textContent=`${e.index+1} of ${e.total}`;let c=document.createElement("div");c.className="btns";let l=document.createElement("button");if(l.className="skip",l.type="button",l.textContent="Skip",l.addEventListener("click",()=>e.controls.skip()),c.appendChild(l),e.index>0){let f=document.createElement("button");f.className="back",f.type="button",f.textContent="Back",f.addEventListener("click",()=>e.controls.back()),c.appendChild(f)}let u=document.createElement("button");if(u.className="next",u.type="button",u.textContent=e.index+1>=e.total?"Done":"Next",u.addEventListener("click",()=>e.controls.next()),c.appendChild(u),o.append(a,c),s.appendChild(o),r){let f=document.createElement("div");f.className="arrow",s.appendChild(f)}t.appendChild(s),this.card=s,(p=(d=(e.step.title,u)).focus)==null||p.call(d),this.position()}position(){var o;let e=this.ctx;if(!e||!this.card||!e.el||e.degraded)return;let t=f0(e.el);this.spot&&(this.spot.style.left=`${t.x-6}px`,this.spot.style.top=`${t.y-6}px`,this.spot.style.width=`${t.width+6*2}px`,this.spot.style.height=`${t.height+6*2}px`);let r={width:this.card.offsetWidth||320,height:this.card.offsetHeight||120},s=ss({anchor:t,tooltip:r,boundary:m0(),preferred:(o=e.step.placement)!=null?o:{side:"bottom",align:"center"}});this.card.style.left=`${s.x}px`,this.card.style.top=`${s.y}px`;let i=this.card.querySelector(".arrow");i&&(i.style.left=s.arrow.y===0||s.arrow.y===r.height?`${s.arrow.x-6}px`:s.placement.side==="left"?`${r.width-6}px`:"-6px",i.style.top=s.arrow.x===0||s.arrow.x===r.width?`${s.arrow.y-6}px`:s.placement.side==="top"?`${r.height-6}px`:"-6px")}hide(){var e;window.removeEventListener("scroll",this.onReflow,!0),window.removeEventListener("resize",this.onReflow),(e=this.host)==null||e.remove(),this.host=null,this.root=null,this.card=null,this.spot=null,this.ctx=null}}});var Eg={};_(Eg,{CoachmarkFeature:()=>Va});var kg,Va,Ig=S(()=>{"use strict";is();Sg();Po();ns();as();kg="scalebun_coach_progress",Va=class{constructor(e){this.deps=e;this.hub=new nt;this.renderer=new _s;this.listeners=new Map;this.toursCache=null;this.reportedAnchors=new Set;this.engine=new Ht({hub:this.hub,resolveAnchor:t=>ft(t),waitFor:(t,r,s)=>os(t,r,s),render:t=>this.renderer.render(t),hide:()=>this.renderer.hide(),emit:(t,r)=>this.emit(t,r),now:()=>Date.now(),persist:(t,r)=>this.persist(t,r),loadIndex:t=>this.loadIndex(t)})}start(e,t){this.reportAnchors(),this.engine.start(e,t)}reportAnchors(){for(let e of If())this.reportedAnchors.has(e)||(this.reportedAnchors.add(e),this.emit("$coachmark_anchor_seen",{anchorKey:e}))}async fetchTours(e){var s;if(!e&&this.toursCache)return this.toursCache;let{apiBaseUrl:t,clientKey:r}=this.deps;if(!t||!r||typeof fetch=="undefined")return e?[]:this.toursCache=[];try{let i=`${t}/sdk/coach/config${e?`?preview=${encodeURIComponent(e)}`:""}`,o=await fetch(i,{headers:{"x-scalebun-client-key":r},cache:"no-store"});if(!o.ok)return e?[]:this.toursCache=[];let c=(s=(await o.json()).tours)!=null?s:[];return e?c:this.toursCache=c}catch{return e?[]:this.toursCache=[]}}async startById(e,t){let r=(await this.fetchTours(t==null?void 0:t.preview)).find(s=>s.id===e);return r?(this.engine.start(r,t),!0):!1}next(){this.engine.next()}back(){this.engine.back()}skip(){this.engine.skip()}end(){this.engine.end("abandoned","api")}notify(e){this.engine.notify(e)}current(){return this.engine.state}on(e,t){let r=this.listeners.get(e);return r||(r=new Set,this.listeners.set(e,r)),r.add(t),()=>{var s;(s=this.listeners.get(e))==null||s.delete(t)}}emit(e,t){var o,a;let r=this.deps.replayCoord(),s={...t,...r?{replayCoord:r}:{}};this.deps.trackEvent(e,s);let i={event:e,...s};for(let c of(o=this.listeners.get(e))!=null?o:[])try{c(i)}catch{}for(let c of(a=this.listeners.get("*"))!=null?a:[])try{c(i)}catch{}}progress(){try{return JSON.parse(localStorage.getItem(kg)||"{}")}catch{return{}}}persist(e,t){try{let r=this.progress();t<0?delete r[e]:r[e]=t,localStorage.setItem(kg,JSON.stringify(r))}catch{}}loadIndex(e){return this.progress()[e]}dispose(){this.engine.dispose(),this.renderer.hide(),this.hub.dispose(),this.listeners.clear()}}});function Os(n){return n.supported?n.permission==="denied"?n.everSubscribed?"revoked":"blocked":n.permission==="default"?"never-granted":n.hasSubscription?"subscribed":n.everSubscribed?"expired":"never-granted":"unsupported"}var Cg,Wa=S(()=>{"use strict";Cg={subscribed:{title:"Notifications are on",detail:"This browser is registered and can receive push.",actionable:!1},"never-granted":{title:"Not asked yet",detail:"This browser has never been prompted. Ask from a click \u2014 browsers ignore the prompt otherwise.",actionable:!0},blocked:{title:"Blocked in this browser",detail:"Notifications were declined, and the browser will not show the prompt again. Only the person can re-enable it, from the site settings beside the address bar.",actionable:!1},revoked:{title:"Turned off after being enabled",detail:"This browser had notifications and they were switched off. Like blocking, only the person can restore it from the site settings \u2014 but unlike a first refusal, they opted in once, so a reminder in-product is fair.",actionable:!1},expired:{title:"Registration expired",detail:"Permission is still granted but the subscription is gone \u2014 browsers drop them after long inactivity or a data clear. Re-registering fixes it and does NOT prompt.",actionable:!0},unsupported:{title:"Not supported in this browser",detail:"Web push needs a service worker, the Push API and Notifications. This browser is missing at least one.",actionable:!1}}});var Ka={};_(Ka,{notInitializedReport:()=>x0,runPushDiagnostics:()=>w0});function g0(){return typeof navigator!="undefined"&&"serviceWorker"in navigator&&typeof window!="undefined"&&"PushManager"in window&&"Notification"in window}function b0(n){let e="=".repeat((4-n.length%4)%4),t=(n+e).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),s=new Uint8Array(r.length);for(let i=0;i<r.length;i++)s[i]=r.charCodeAt(i);return s}function y0(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function v0(n){return new Promise(e=>{let t=n.active;if(!t||typeof MessageChannel=="undefined"){e(null);return}let r=!1,s=i=>{r||(r=!0,e(i))};try{let i=new MessageChannel;i.port1.onmessage=o=>{let a=o.data;s(a&&a.type==="scalebun-sw-pong"?{version:a.version}:null)},t.postMessage({type:"scalebun-sw-ping"},[i.port2]),setTimeout(()=>s(null),1500)}catch{s(null)}})}async function w0(n){var m,h,b,k,x,y,g,w,v;let e=[],t=E=>(e.push(E),E),r=(E,C,I)=>{t({id:E,status:"unknown",label:C,detail:`Not evaluated \u2014 ${I}`})},s=typeof window!="undefined"&&window.isSecureContext===!0;t({id:"secure_context",status:s?"pass":"fail",label:"Secure context (HTTPS)",detail:s?void 0:"Page is not a secure context",fix:s?void 0:"Serve the site over HTTPS. Web Push is unavailable on plain HTTP (localhost is exempt)."});let i=[];(typeof navigator=="undefined"||!("serviceWorker"in navigator))&&i.push("ServiceWorker"),(typeof window=="undefined"||!("PushManager"in window))&&i.push("PushManager"),(typeof window=="undefined"||!("Notification"in window))&&i.push("Notification");let o=i.length===0&&g0(),a=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"");if(t({id:"api_support",status:o?"pass":"fail",label:"Browser supports Web Push",detail:o?void 0:`Missing: ${i.join(", ")||"push APIs"}`,fix:o?void 0:a?"On iOS, Web Push only works when the site is installed to the Home Screen as a PWA (iOS 16.4+). In a normal Safari tab these APIs are absent.":"This browser cannot receive Web Push. Hide your opt-in UI when ScaleBun.push.check() reports this."}),!o)return r("sw_reachable","Service worker file is reachable","push APIs are unavailable"),r("sw_registered","Service worker is registered","push APIs are unavailable"),r("sw_version","Service worker is up to date","push APIs are unavailable"),r("vapid_configured","Web Push configured for this app","push APIs are unavailable"),r("permission","Notification permission","push APIs are unavailable"),r("subscription_valid","Push subscription is valid","push APIs are unavailable"),r("device_registered","Device registered with ScaleBun","push APIs are unavailable"),r("identified","User is identified","push APIs are unavailable"),Ag(e);let c=null;try{let E=await fetch(n.serviceWorkerUrl,{method:"HEAD",cache:"no-store"});c=E.ok,t({id:"sw_reachable",status:E.ok?"pass":"fail",label:"Service worker file is reachable",detail:`GET ${n.serviceWorkerUrl} \u2192 ${E.status}`,fix:E.ok?void 0:`Copy scalebun-push-sw.js from @scalebun/web/dist/ to your web root so it is served at ${n.serviceWorkerUrl}.`})}catch{t({id:"sw_reachable",status:"unknown",label:"Service worker file is reachable",detail:`Could not fetch ${n.serviceWorkerUrl}`,fix:"Check that the file is served from the same origin and not blocked by CSP."})}let l=null;try{l=(m=await navigator.serviceWorker.getRegistration(n.serviceWorkerUrl))!=null?m:null}catch{l=null}let u=(g=(y=(k=(h=l==null?void 0:l.active)==null?void 0:h.scriptURL)!=null?k:(b=l==null?void 0:l.installing)==null?void 0:b.scriptURL)!=null?y:(x=l==null?void 0:l.waiting)==null?void 0:x.scriptURL)!=null?g:null,d=!!u&&u.indexOf("scalebun-push-sw")>=0;if(t({id:"sw_registered",status:l&&d?"pass":"fail",label:"Service worker is registered",detail:l?d?`Active: ${u}`:`A different worker owns this scope: ${u}`:"No registration found for this scope",fix:l?d?void 0:"Another service worker controls this scope. Serve the ScaleBun worker at a path it can own, and pass serviceWorkerScope to enablePush().":c===!1?"The worker file is missing (see the check above) \u2014 fix that first, then call ScaleBun.enablePush().":"Call ScaleBun.enablePush() from a user gesture to register the worker."}),l&&d){let E=await v0(l);!E||typeof E.version!="number"?t({id:"sw_version",status:"warn",label:"Service worker is up to date",detail:"The worker did not answer a version ping",fix:`Your copy of scalebun-push-sw.js is older than v${n.expectedSwVersion} (versions before v3 cannot report themselves). Re-copy it from @scalebun/web/dist/.`}):E.version<n.expectedSwVersion?t({id:"sw_version",status:"warn",label:"Service worker is up to date",detail:`Worker is v${E.version}, this SDK expects v${n.expectedSwVersion}`,fix:"Re-copy scalebun-push-sw.js from @scalebun/web/dist/ to your web root \u2014 the deployed copy is stale."}):t({id:"sw_version",status:"pass",label:"Service worker is up to date",detail:`v${E.version}`})}else r("sw_version","Service worker is up to date","no ScaleBun worker is registered");let p=null;try{let E=await fetch(`${n.apiBaseUrl}/sdk/engage/push-config`,{headers:{"content-type":"application/json","x-scalebun-client-key":n.clientKey},cache:"no-store"}),C=E.ok?await E.json():null;p=(C==null?void 0:C.enabled)===!1?null:(w=C==null?void 0:C.vapidPublicKey)!=null?w:null,t({id:"vapid_configured",status:p?"pass":"fail",label:"Web Push configured for this app",detail:p?void 0:"No VAPID key served for this client key",fix:p?void 0:"In the ScaleBun dashboard: Settings \u2192 Integrations \u2192 Web Push (VAPID) \u2192 Generate VAPID keys."})}catch{t({id:"vapid_configured",status:"unknown",label:"Web Push configured for this app",detail:"Could not reach the ScaleBun API",fix:"Check apiBaseUrl, network access, and CORS."})}let f=typeof Notification=="undefined"?"default":Notification.permission;t({id:"permission",status:f==="granted"?"pass":f==="denied"?"fail":"warn",label:"Notification permission",detail:f,fix:f==="granted"?void 0:f==="denied"?"The user blocked notifications. This cannot be re-prompted from code \u2014 they must re-allow it in browser site settings.":"Not asked yet. Call ScaleBun.enablePush() from a click handler."});try{let E=l?await l.pushManager.getSubscription():null;if(!E)t({id:"subscription_valid",status:"fail",label:"Push subscription is valid",detail:"No subscription on this browser",fix:f==="granted"?"Permission is granted but no subscription exists \u2014 call ScaleBun.enablePush() to create one.":"Call ScaleBun.enablePush() from a user gesture."});else{let C=E.toJSON(),I=typeof C.expirationTime=="number"&&C.expirationTime<=Date.now(),R=null;if(p){let A=(v=E.options)==null?void 0:v.applicationServerKey;R=A?y0(new Uint8Array(A),b0(p)):null}t({id:"subscription_valid",status:I||R===!1?"fail":R===null&&p?"warn":"pass",label:"Push subscription is valid",detail:I?"Subscription has expired":R===!1?"Subscription was created with a DIFFERENT VAPID key than this app now uses":R===null&&p?"Could not read the subscription key to compare against the tenant VAPID key":E.endpoint,fix:I?"Call ScaleBun.enablePush() again to mint a fresh subscription.":R===!1?"The VAPID keypair was rotated after this browser subscribed, so pushes to it will fail. Call ScaleBun.push.disable() then ScaleBun.enablePush() to re-subscribe.":void 0})}}catch{t({id:"subscription_valid",status:"unknown",label:"Push subscription is valid",detail:"Could not read the push subscription"})}try{let E=await fetch(`${n.apiBaseUrl}/sdk/engage/device-token/status?deviceId=${encodeURIComponent(n.deviceId)}`,{headers:{"content-type":"application/json","x-scalebun-client-key":n.clientKey},cache:"no-store"}),C=E.ok?await E.json():null;if(!C)t({id:"device_registered",status:"unknown",label:"Device registered with ScaleBun",detail:`Status lane returned ${E.status}`}),r("identified","User is identified","the server did not answer");else{let I=C.tokenStatus==="dead";t({id:"device_registered",status:C.registered&&!I?"pass":"fail",label:"Device registered with ScaleBun",detail:C.registered?I?"Token marked dead by the push service":"Registered and active":"No push token stored for this device",fix:C.registered?I?"The browser push service rejected this token (410 Gone). Call ScaleBun.enablePush() to re-subscribe.":void 0:"Call ScaleBun.enablePush() \u2014 the subscription never reached the backend."}),t({id:"identified",status:C.identified?"pass":"warn",label:"User is identified",detail:C.identified?"Bound to a person":"Anonymous device",fix:C.identified?void 0:"Call ScaleBun.identify() \u2014 journeys and lifecycle programs only target identified people, so this browser can receive broadcasts but never an automated lifecycle push."})}}catch{t({id:"device_registered",status:"unknown",label:"Device registered with ScaleBun",detail:"Could not reach the ScaleBun API"}),r("identified","User is identified","the server was unreachable")}return Ag(e)}function x0(){return{ok:!1,blocking:"api_support",checks:[{id:"api_support",status:"fail",label:"ScaleBun is initialized",detail:"push.check() was called before ScaleBun.init()",fix:"Call ScaleBun.init({ clientKey, apiBaseUrl }) first \u2014 diagnostics need the resolved config."}]}}function Ag(n){var t;let e=n.find(r=>r.status==="fail");return{ok:!e,blocking:(t=e==null?void 0:e.id)!=null?t:null,checks:n}}var ja=S(()=>{"use strict"});var Rg={};_(Rg,{DEFAULT_SW_URL:()=>Ga,EXPECTED_SW_VERSION:()=>Tg,PUSH_STATE_COPY:()=>Cg,PushFeature:()=>Ya,resolvePushState:()=>Os});function Ns(){return typeof navigator!="undefined"&&"serviceWorker"in navigator&&typeof window!="undefined"&&"PushManager"in window&&"Notification"in window}function S0(n){let e="=".repeat((4-n.length%4)%4),t=(n+e).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),s=new ArrayBuffer(r.length),i=new Uint8Array(s);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}var Tg,Ga,hn,Ya,Mg=S(()=>{"use strict";Wa();Wa();Tg=5,Ga="/scalebun-push-sw.js";hn=class hn{constructor(e){this.reg=null;this.lastEndpoint=null;this.swUrl=Ga;this.openedCbs=new Set;this.swMessageBound=!1;this.deps=e}log(...e){var t,r;(r=(t=this.deps).log)==null||r.call(t,"[scalebun:push]",...e)}permission(){return typeof Notification=="undefined"?"default":Notification.permission}async enable(e={}){try{if(!Ns())return this.log("unsupported browser \u2014 skipping"),"unsupported";if(!this.deps.clientKey||!this.deps.apiBaseUrl)return"error";if(this.permission()==="denied")return"denied";let t=await this.fetchPushConfig();if(!t||t.enabled===!1||!t.vapidPublicKey)return this.log("web push not configured for this app"),"not-configured";let r=await Notification.requestPermission();if(r!=="granted")return r==="denied"?"denied":"error";let s=e.serviceWorkerUrl||Ga;this.swUrl=s,this.reg=await navigator.serviceWorker.register(s,e.serviceWorkerScope?{scope:e.serviceWorkerScope}:void 0),await navigator.serviceWorker.ready,this.bindSwMessages();let o=await this.reg.pushManager.getSubscription()||await this.reg.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:S0(t.vapidPublicKey)}),a=await this.registerDeviceToken(o);return this.lastEndpoint=o.endpoint,a?"subscribed":"error"}catch(t){return this.log("enable failed",t),"error"}}async disable(e={}){var t,r;try{let s=this.reg||(Ns()?await navigator.serviceWorker.getRegistration():null),i=s?await s.pushManager.getSubscription():null,o=(r=(t=i==null?void 0:i.endpoint)!=null?t:this.lastEndpoint)!=null?r:null,a=i?await i.unsubscribe():!0;return this.lastEndpoint=null,e.revokeServerSide!==!1&&await this.revokeDeviceToken(o),a}catch{return!1}}async revokeDeviceToken(e){if(!this.deps.clientKey||!this.deps.apiBaseUrl)return!1;try{return(await fetch(`${this.deps.apiBaseUrl}/sdk/engage/device-token/revoke`,{method:"POST",headers:this.headers(),keepalive:!0,body:JSON.stringify({deviceId:this.deps.deviceId,...e?{endpoint:e}:{}})})).ok}catch{return!1}}onNotificationOpened(e){return this.openedCbs.add(e),this.bindSwMessages(),()=>this.openedCbs.delete(e)}async getSubscription(){try{let e=this.reg||(Ns()?await navigator.serviceWorker.getRegistration():null),t=e?await e.pushManager.getSubscription():null;return t?t.toJSON():null}catch{return null}}async check(e={}){let{runPushDiagnostics:t}=await Promise.resolve().then(()=>(ja(),Ka));return t({apiBaseUrl:this.deps.apiBaseUrl,clientKey:this.deps.clientKey,deviceId:this.deps.deviceId,serviceWorkerUrl:e.serviceWorkerUrl||this.swUrl,expectedSwVersion:Tg})}everSubscribed(){try{return localStorage.getItem(hn.EVER_KEY)==="1"}catch{return!1}}markEverSubscribed(){try{localStorage.setItem(hn.EVER_KEY,"1")}catch{}}async status(){var r,s;let e=Ns(),t=e?await this.getSubscription():null;return t&&this.markEverSubscribed(),{supported:e,permission:this.permission(),subscribed:!!t,endpoint:(s=(r=t==null?void 0:t.endpoint)!=null?r:this.lastEndpoint)!=null?s:null,state:Os({supported:e,permission:this.permission(),hasSubscription:!!t,everSubscribed:this.everSubscribed()})}}bindSwMessages(){this.swMessageBound||typeof navigator=="undefined"||!("serviceWorker"in navigator)||(this.swMessageBound=!0,navigator.serviceWorker.addEventListener("message",e=>{var r,s;let t=e.data;if(!(!t||typeof t.type!="string"))if(t.type==="scalebun-push-click"){let i=(r=t.data)!=null?r:{};for(let o of this.openedCbs)try{o({data:i,action:(s=t.action)!=null?s:null})}catch{}}else t.type==="scalebun-push-resubscribe"&&t.subscription&&this.registerDeviceTokenJson(t.subscription).then(i=>{var o;i&&((o=t.subscription)!=null&&o.endpoint)&&(this.lastEndpoint=t.subscription.endpoint)})}))}headers(){return{"content-type":"application/json","x-scalebun-client-key":this.deps.clientKey}}async fetchPushConfig(){try{let e=await fetch(`${this.deps.apiBaseUrl}/sdk/engage/push-config`,{headers:this.headers(),cache:"no-store"});return e.ok?await e.json():null}catch{return null}}registerDeviceToken(e){return this.registerDeviceTokenJson(e.toJSON())}async registerDeviceTokenJson(e){if(!e||!e.endpoint)return!1;try{return(await fetch(`${this.deps.apiBaseUrl}/sdk/engage/device-token`,{method:"POST",headers:this.headers(),keepalive:!0,body:JSON.stringify({schemaVersion:1,deviceId:this.deps.deviceId,platform:"web",pushProvider:"webpush",pushToken:JSON.stringify(e),tokenStatus:"active",...this.deps.sdkVersion?{sdkVersion:this.deps.sdkVersion}:{}})})).ok}catch{return!1}}};hn.EVER_KEY="scalebun.push.everSubscribed";Ya=hn});var yn=new Map,vn=n=>typeof n=="string"?n.replace(/[;:|]/g,"").trim().slice(0,32):"";function tc(n,e){let t=vn(n),r=vn(e);t&&r&&yn.set(t,r)}function nc(n){n===void 0?yn.clear():yn.delete(vn(n))}var Og=/^(nextjs-|__next|vercel-live)/,Ng=/^(headlessui-|radix-|mui-|:r[0-9a-z]*:|react-aria)/;function wn(){let n=new Map;document.querySelectorAll("[aria-expanded],dialog").forEach(r=>{let s=r.getAttribute("aria-expanded"),i=s==="true"||s===null&&r.hasAttribute("open")?"open":"closed",o="";for(let a of[r.getAttribute("data-scalebun-state"),r.getAttribute("data-testid"),r.getAttribute("aria-controls"),r.id])if(a&&!Ng.test(a)&&(o=vn(a)))break;o&&!Og.test(o)&&n.set(o,i)});for(let[r,s]of yn)n.set(r,s);if(!n.size)return;let e=[...n.keys()].sort().map(r=>`${r}:${n.get(r)}`),t="";for(let r of e){let s=t?`${t};${r}`:r;if(s.length>96)break;t=s}return t||void 0}var rc="https://api.scalebun.com/api/v1";var Bg=["authorization","cookie","set-cookie","x-api-key","x-csrf-token","password","token","secret"];function sc(n){var r,s,i,o,a,c,l,u,d,p,f,m,h,b,k,x,y,g,w,v,E,C,I,R,T,A,P,$,D,ne,J,Q,fe,ce,xe,Se,le,H,V,j,de,me,se,Ue,Ve,G,ie,X,Y,te,M,O,N,F,W,re,ge,he,Ce,Ae,Te,Je,it,ke,bn,Ja,Qa,Za,ec;if(!n||!n.clientKey)throw new Error("[scalebun] clientKey is required");let e=(r=n.apiBaseUrl)==null?void 0:r.replace(/\/$/,""),t=e&&/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?([/?#]|$)/.test(e)?e:rc;return{clientKey:n.clientKey,apiBaseUrl:t,environment:n.environment,release:n.release,appVersion:n.appVersion,flushIntervalMs:(s=n.flushIntervalMs)!=null?s:5e3,sessionTimeoutMs:n.sessionTimeoutMs,sessionMaxDurationMs:n.sessionMaxDurationMs,replay:n.replay,errors:n.errors,network:n.network,performance:n.performance,analytics:n.analytics,flags:n.flags,replayCanvas:(i=n.replayCanvas)!=null?i:!1,replayDirectUpload:(o=n.replayDirectUpload)!=null?o:!1,signSessionLane:(a=n.signSessionLane)!=null?a:!1,replayFrameOrigins:(c=n.replayFrameOrigins)!=null?c:[],autocapture:(l=n.autocapture)!=null?l:!0,tracePropagation:(u=n.tracePropagation)!=null?u:!0,tracePropagationOrigins:(d=n.tracePropagationOrigins)!=null?d:[],maxBatchSize:(p=n.maxBatchSize)!=null?p:50,maxQueueSize:(f=n.maxQueueSize)!=null?f:1e3,debug:(m=n.debug)!=null?m:!1,features:{errors:(b=(h=n.features)==null?void 0:h.errors)!=null?b:!0,network:(x=(k=n.features)==null?void 0:k.network)!=null?x:!0,console:(g=(y=n.features)==null?void 0:y.console)!=null?g:!0,webVitals:(v=(w=n.features)==null?void 0:w.webVitals)!=null?v:!0,performance:(C=(E=n.features)==null?void 0:E.performance)!=null?C:!0,journey:(R=(I=n.features)==null?void 0:I.journey)!=null?R:!0,replay:(A=(T=n.features)==null?void 0:T.replay)!=null?A:!1,bugReport:($=(P=n.features)==null?void 0:P.bugReport)!=null?$:!0,crash:(ne=(D=n.features)==null?void 0:D.crash)!=null?ne:!0,config:(Q=(J=n.features)==null?void 0:J.config)!=null?Q:!0,engage:(ce=(fe=n.features)==null?void 0:fe.engage)!=null?ce:!0,analytics:(Se=(xe=n.features)==null?void 0:xe.analytics)!=null?Se:!0,webPerf:(H=(le=n.features)==null?void 0:le.webPerf)!=null?H:!0,profiler:(j=(V=n.features)==null?void 0:V.profiler)!=null?j:!1,watchdog:(me=(de=n.features)==null?void 0:de.watchdog)!=null?me:!1,inbox:(Ue=(se=n.features)==null?void 0:se.inbox)!=null?Ue:!1,inapp2:(G=(Ve=n.features)==null?void 0:Ve.inapp2)!=null?G:!1},watchdog:n.watchdog,exitIntent:n.exitIntent,privacy:{captureNetworkBodies:(X=(ie=n.privacy)==null?void 0:ie.captureNetworkBodies)!=null?X:!1,denylist:[...Bg,...(te=(Y=n.privacy)==null?void 0:Y.denylist)!=null?te:[]].map(Lg=>Lg.toLowerCase()),maskSelectors:(O=(M=n.privacy)==null?void 0:M.maskSelectors)!=null?O:[],maskReplayText:(F=(N=n.privacy)==null?void 0:N.maskReplayText)!=null?F:!1,maskInputs:(re=(W=n.privacy)==null?void 0:W.maskInputs)!=null?re:!0,respectDnt:(he=(ge=n.privacy)==null?void 0:ge.respectDnt)!=null?he:!1,maskEventText:(Ae=(Ce=n.privacy)==null?void 0:Ce.maskEventText)!=null?Ae:!1},consent:{required:(Te=n.requireConsent)!=null?Te:!1,initial:(Je=n.initialConsent)!=null?Je:"unknown"},bugReport:{launcher:(ke=(it=n.bugReportOptions)==null?void 0:it.launcher)!=null?ke:!1,position:(Ja=(bn=n.bugReportOptions)==null?void 0:bn.position)!=null?Ja:"bottom-right",label:(Za=(Qa=n.bugReportOptions)==null?void 0:Qa.label)!=null?Za:"Report a bug"},...(ec=n.engageOptions)!=null&&ec.onInAppGameRequest?{onInAppGameRequest:n.engageOptions.onInAppGameRequest}:{}}}z();z();Cn();var An=class{constructor(e){this.config=e;this.id=Zs(this.timeoutMs,this.maxMs).id,this.deviceId=oc()}get sessionId(){return this.id}get timeoutMs(){var e;return(e=this.config.sessionTimeoutMs)!=null?e:xt}get maxMs(){var e;return(e=this.config.sessionMaxDurationMs)!=null?e:In}expired(){return Fc(this.timeoutMs,this.maxMs)}rotate(){if(!this.expired())return null;let e=this.id;return this.id=Zs(this.timeoutMs,this.maxMs).id,e}client(){return uc()}device(){return pc(this.deviceId)}app(){return fc(this.config)}context(){return Dc(),mc()}};Cn();var sb=typeof fetch=="function"?fetch.bind(globalThis):void 0,Rn=class Rn{constructor(e){this.config=e;this.suspendedUntil=0}isSuspended(){return Date.now()<this.suspendedUntil}headers(){return{"content-type":"application/json","x-scalebun-client-key":this.config.clientKey}}async signedHeaders(e){let t=this.headers();if(!this.config.signSessionLane)return t;let{signatureHeaders:r}=await Promise.resolve().then(()=>(ri(),ni));return{...t,...await r(this.config.clientKey,e)}}async startSession(e){var t,r,s,i,o,a,c,l;await this.post(`${this.config.apiBaseUrl}/ingestion/sessions`,{sessionId:e.sessionId,deviceId:e.device.id,platform:e.client.platform,appVersion:(s=(t=e.app)==null?void 0:t.version)!=null?s:(r=e.app)==null?void 0:r.release,osVersion:e.device.osVersion,deviceModel:(i=e.device.model)!=null?i:e.device.browser,locale:(o=e.context)==null?void 0:o.locale,timezone:(a=e.context)==null?void 0:a.timezone,idleThresholdMs:(c=this.config.sessionTimeoutMs)!=null?c:xt,sdkVersion:(l=e.client.sdk)==null?void 0:l.version,startedAt:Date.now()})}async sendBatch(e,t){var i,o;let r=`${this.config.apiBaseUrl}/ingestion/sessions/${encodeURIComponent(e.sessionId)}/batch`,s=await this.post(r,e,t==null?void 0:t.keepalive);if(!s)return null;try{return(o=(i=await s.json())==null?void 0:i.results)!=null?o:{}}catch{return{}}}async finalize(e){let t=`${this.config.apiBaseUrl}/ingestion/sessions/${encodeURIComponent(e)}/finalize`;await this.post(t,{endedAt:Date.now()},!0)}async submitBugReport(e,t){if(this.isSuspended())return null;let r=`${this.config.apiBaseUrl}/ingestion/sessions/${encodeURIComponent(e)}/bug-reports`;try{let s=JSON.stringify(t),i=await fetch(r,{method:"POST",headers:await this.signedHeaders(s),body:s});return i.ok?await i.json().catch(()=>({})):null}catch{return null}}async presignFrames(e,t,r){let s=`${this.config.apiBaseUrl}/ingestion/sessions/${encodeURIComponent(e)}/frames/presign`,i=await this.post(s,{frames:t,cssIds:r});if(!i)return null;try{return await i.json()}catch{return null}}async putSigned(e,t,r){try{return(await(sb||fetch)(e,{method:"PUT",body:t,headers:{"content-type":r}})).ok}catch{return!1}}async post(e,t,r=!1){if(this.isSuspended())return null;try{let s=JSON.stringify(t),i=await this.signedHeaders(s),o=s;if(!r&&s.length>Rn.GZIP_MIN_BYTES){let{gzipString:c}=await Promise.resolve().then(()=>(Uc(),zc)),l=await c(s);l&&(o=new Blob([l]),i["content-encoding"]="gzip")}let a=await fetch(e,{method:"POST",headers:i,body:o,keepalive:r});return a.status===403&&this.maybeEnterSuspended(a),a.ok?a:null}catch{return null}}maybeEnterSuspended(e){let t=Number(e.headers.get("retry-after"))||0;e.clone().json().then(r=>{if(!((r==null?void 0:r.code)==="workspace_suspended"||(r==null?void 0:r.enabled)===!1)&&!t)return;let i=Number(r==null?void 0:r.retryAfterSeconds)||t||3600;this.suspendedUntil=Date.now()+i*1e3}).catch(()=>{t&&(this.suspendedUntil=Date.now()+t*1e3)})}};Rn.GZIP_MIN_BYTES=1024;var Tn=Rn;Kt();z();Mn();Ln();var fb=1,Gc=n=>n.kind==="frame",_n=n=>n.frameType==="keyframe",mb=3,Yc=48e3,hb=20;function gb(n){try{return JSON.stringify(n).length}catch{return Yc}}var On=class{constructor(e,t,r){this.config=e;this.session=t;this.transport=r;this.queue=[];this.timer=null;this.droppedCount=0;this.queuedCount=0;this.attemptedCount=0;this.retriedCount=0;this.recoveredCount=0;this.expiredCount=0;this.ackedCount=0;this.started=!1;this.dead=!1;this.lifecycle=[];this.buffer=new Be;this.backoff=new kt;this.flushing=!1;this.sessionStarted=Promise.resolve();this.sessionOk=!1;this.sessionRetries=0;this.keyframePending=!1;this.inFlight=[];var s,i;this.consentGranted=!((s=e.consent)!=null&&s.required)||((i=e.consent)==null?void 0:i.initial)==="granted"}setConsentGranted(e){this.consentGranted=e}canEgress(){return this.consentGranted&&!this.dead}async start(){var e;if(!this.started){this.started=!0,this.dead=!1,this.armSession();try{let t=await this.buffer.load(),r=typeof t[0]=="string"?t[0]:"",s=(e=r?t[1]:t)!=null?e:[],i=Pn(s,o=>o.timestamp,L());this.expiredCount+=s.length-i.length,i.length&&(this.recoveredCount+=i.length,r&&r!==this.session.sessionId?this.drainOrphans(r,i):this.queue.unshift(...i))}catch{}this.timer=setInterval(()=>this.autoFlush(),this.config.flushIntervalMs),this.installLifecycleFlush(),this.queue.some(_n)&&this.flush()}}armSession(){this.sessionOk=!1,this.sessionStarted=this.transport.startSession({sessionId:this.session.sessionId,client:this.session.client(),device:this.session.device(),app:this.session.app(),context:this.session.context()}).then(()=>{this.sessionOk=!0}).catch(()=>{})}async restart(){this.sessionRetries=0,this.armSession(),await this.sessionStarted}evictChain(){let e=this.queue,t=0;for(let r=0;r<e.length;){let s=e[r];if(!Gc(s)){r++;continue}if(t&&_n(s))break;e.splice(r,1),t++}t||(e.shift(),t=1),this.droppedCount+=t}emit(e){if(!this.consentGranted){this.droppedCount++;return}this.queue.length>=this.config.maxQueueSize&&this.evictChain(),this.queuedCount++,this.queue.push(e),this.started&&_n(e)&&(this.flushing?this.keyframePending=!0:this.flush())}reportDrop(e,t){var r;e&&((r=this.reported)!=null||(this.reported=new Set),!this.reported.has(e)&&(this.reported.add(e),this.emit({kind:"event",name:"sdk_replay_capture_failed",timestamp:L(),props:{stage:"ingest-rejected",lane:e,reason:t!=null?t:"unknown"}})))}persistQueue(){let e=this.inFlight.length?[...this.inFlight,...this.queue]:this.queue;this.buffer.save([this.session.sessionId,Et(e,Gc,_n)])}autoFlush(){this.dead||!at()||!this.backoff.ready(L())||this.drain()}async drain(){for(let e=0;e<hb&&this.queue.length;e++){let t=this.queue.length;if(await this.flush(),this.queue.length>=t)return}}takeKeepalive(){let e=[],t=0;for(;this.queue.length&&e.length<this.config.maxBatchSize;){let r=gb(this.queue[0]);if(e.length&&t+r>Yc)break;t+=r,e.push(this.queue.shift())}return e}async flush(e){var r;if(this.dead||this.flushing||this.queue.length===0)return;this.flushing=!0;let t=e!=null&&e.keepalive?this.takeKeepalive():this.queue.splice(0,this.config.maxBatchSize);this.inFlight=t;try{if(await this.sessionStarted,this.started&&!this.sessionOk&&this.sessionRetries<mb&&(this.sessionRetries++,this.armSession(),await this.sessionStarted,!this.sessionOk)){this.queue.unshift(...t),this.inFlight=[],this.backoff.fail(L()),this.persistQueue();return}if(this.attemptedCount++,this.config.replayDirectUpload&&!(e!=null&&e.keepalive))try{let{offloadDomFrames:i}=await Promise.resolve().then(()=>(jc(),Kc));await i(t,{sessionId:this.session.sessionId,presign:(o,a)=>this.transport.presignFrames(o,a),put:(o,a,c)=>this.transport.putSigned(o,a,c)})}catch{}let s=await this.transport.sendBatch(this.buildEnvelope(t),e);if(s){this.inFlight=[],this.ackedCount+=t.length;let i=[],o=0;for(let a of t){let c=(r=a.kind)!=null?r:"",l=s[c];!l||l.ok||(this.ackedCount--,l.retry?(i.push(a),this.retriedCount++):(o++,this.droppedCount++,this.reportDrop(c,l.reason)))}i.length?(t.length-i.length-o===0?(this.backoff.fail(L()),this.queue.push(...i)):(this.backoff.reset(),this.queue.unshift(...i)),this.persistQueue()):this.backoff.reset()}else this.backoff.fail(L()),this.retriedCount+=t.length,this.queue.unshift(...t),this.inFlight=[],this.persistQueue()}catch{this.backoff.fail(L()),this.retriedCount+=t.length,this.queue.unshift(...t),this.inFlight=[],this.persistQueue()}finally{this.flushing=!1}this.keyframePending&&(this.keyframePending=!1,this.flush(e))}emitFor(e,t){if(!this.consentGranted||!e||e===this.session.sessionId){this.consentGranted&&e===this.session.sessionId&&this.emit(t);return}this.drainOrphans(e,[t])}async drainOrphans(e,t){var s;let r=[];for(let i=0;i<t.length;i+=this.config.maxBatchSize){let o=t.slice(i,i+this.config.maxBatchSize),a=null;try{a=await this.transport.sendBatch({...this.buildEnvelope(o),sessionId:e})}catch{}if(!a){r.push(...t.slice(i));break}for(let c of o){let l=a[(s=c.kind)!=null?s:""];l&&!l.ok&&l.retry&&r.push(c)}}r.length&&this.buffer.save([e,r])}buildEnvelope(e){return{schemaVersion:fb,sessionId:this.session.sessionId,sentAt:L(),client:this.session.client(),device:this.session.device(),app:this.session.app(),context:this.session.context(),items:e}}installLifecycleFlush(){if(typeof document=="undefined")return;let e=()=>{this.dead||(this.persistQueue(),this.flush({keepalive:!0}))},t=()=>{document.visibilityState==="hidden"&&e()};this.addLifecycle(document,"visibilitychange",t),typeof window!="undefined"&&(this.addLifecycle(window,"pagehide",e),this.addLifecycle(window,"online",()=>{this.backoff.reset(),this.autoFlush()}))}addLifecycle(e,t,r){e.addEventListener(t,r),this.lifecycle.push({target:e,type:t,fn:r})}removeLifecycle(){for(let e of this.lifecycle)try{e.target.removeEventListener(e.type,e.fn)}catch{}this.lifecycle=[]}async stop(){this.timer&&clearInterval(this.timer),this.timer=null,this.removeLifecycle(),await this.flush({keepalive:!0}),await this.transport.finalize(this.session.sessionId),await this.buffer.clear(),this.started=!1}async discard(){this.dead=!0,this.consentGranted=!1,this.timer&&clearInterval(this.timer),this.timer=null,this.removeLifecycle(),this.queue=[],this.started=!1;try{await this.buffer.clear()}catch{}}get pendingCount(){return this.queue.length}get dropped(){return this.droppedCount}get ledger(){return{queued:this.queuedCount,attempted:this.attemptedCount,retried:this.retriedCount,recovered:this.recoveredCount,dropped:this.droppedCount,expired:this.expiredCount,acked:this.ackedCount}}};ii();z();var Xc={drop:!1,warnings:[]};function Jc(n,e,t){var o,a;if(!n||e.startsWith("$"))return Xc;let r=n.strict===!0,s=(o=n.events)==null?void 0:o[e];if(!s)return n.allowUnknownEvents===!1?{drop:r,warnings:[`event "${e}" is not in the tracking plan`]}:Xc;let i=[];for(let c of(a=s.required)!=null?a:[])(t==null||!(c in t))&&i.push(`event "${e}" missing required prop "${c}"`);if(s.props){for(let c of Object.keys(s.props))if(t&&c in t){let l=typeof t[c];l!==s.props[c]&&i.push(`event "${e}" prop "${c}" expected ${s.props[c]}, got ${l}`)}}return{drop:r&&i.length>0,warnings:i}}Fe();var bb="wzb-analytics-v1",yb=new Set(["$identify","$group","$alias","purchase"]);function Qc(n,e,t){return t>=1||yb.has(n)?!0:t<=0?!1:Ee(`${e}:${bb}`)%1e4<t*1e4}Kt();Mn();Ln();var Kb=50,jb=5e3,Gb=2e3,Ze="scalebun_anonymous_id",pi="scalebun_user_id",$n="scalebun_super_props",di="scalebun_groups",Il="scalebun_installation_id",Cl="scalebun_first_open_done",fi="scalebun_attribution_click_id",Al="scalebun_attribution",Rl=/^[0-9a-f]{16,64}$/i,Yb=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"];function Xb(){try{if(typeof localStorage!="undefined"){let e=localStorage.getItem(Al);if(e){let t=JSON.parse(e);if(t&&typeof t=="object")return{props:t,isNew:!1}}}}catch{}let n={};try{if(typeof location!="undefined"){let e=new URL(location.href);for(let t of Yb){let r=e.searchParams.get(t);r&&(n[t]=r.slice(0,200))}for(let t of["fbclid","gclid"]){let r=e.searchParams.get(t);r&&(n[t]=r.slice(0,512))}}if(typeof document!="undefined"&&document.referrer)try{let e=new URL(document.referrer),t=typeof location!="undefined"?location.hostname:null;(!t||e.hostname!==t)&&(n.referrer=(e.origin+e.pathname).slice(0,512),n.referrer_domain=e.hostname)}catch{n.referrer=document.referrer.split("?")[0].slice(0,512)}}catch{}if(!n.referrer&&!n.utm_source&&!n.fbclid&&!n.gclid)return{props:{},isNew:!1};try{typeof location!="undefined"&&(n.landing_url=location.pathname.slice(0,512)),typeof localStorage!="undefined"&&localStorage.setItem(Al,JSON.stringify(n))}catch{}return{props:n,isNew:!0}}var Jb="pending-analytics";function Qb(){try{if(typeof localStorage!="undefined")return localStorage.getItem(pi)||void 0}catch{}}function ui(n){try{if(typeof localStorage=="undefined")return;n?localStorage.setItem(pi,n):localStorage.removeItem(pi)}catch{}}function mi(){return`anon_${q()}`}function Tl(n){try{if(typeof localStorage!="undefined"){let e=localStorage.getItem(n);if(e){let t=JSON.parse(e);if(t&&typeof t=="object")return t}}}catch{}return{}}function Gt(n,e){try{if(typeof localStorage=="undefined")return;Object.keys(e).length?localStorage.setItem(n,JSON.stringify(e)):localStorage.removeItem(n)}catch{}}function Zb(n){try{if(typeof document=="undefined")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)")),t=e==null?void 0:e[1];return t!=null?decodeURIComponent(t):null}catch{return null}}function hi(n,e,t){try{if(typeof document=="undefined")return;let r=[`${n}=${encodeURIComponent(e)}`,"path=/","max-age=31536000","SameSite=Lax"];t&&r.push(`domain=${t}`),document.cookie=r.join("; ")}catch{}}function ey(n){var r,s;let e="",t;try{typeof localStorage!="undefined"&&(e=(r=localStorage.getItem(Il))!=null?r:"",e||(e=n||`web_${q()}`,localStorage.setItem(Il,e)),t=(s=localStorage.getItem(fi))!=null?s:void 0)}catch{}e||(e=n||`web_${q()}`);try{if(typeof location!="undefined"&&location.search){let i=new URL(location.href),o=i.searchParams.get("scalebun_click_id");if(o&&Rl.test(o)){t=o;try{typeof localStorage!="undefined"&&localStorage.setItem(fi,o)}catch{}i.searchParams.delete("scalebun_click_id");try{history.replaceState(history.state,"",i.pathname+i.search+i.hash)}catch{}}}}catch{}return t?{installationId:e,clickId:t}:{installationId:e}}function ty(n){if(n){let t=Zb(Ze);if(t){try{typeof localStorage!="undefined"&&localStorage.setItem(Ze,t)}catch{}return t}}try{if(typeof localStorage!="undefined"){let t=localStorage.getItem(Ze),r=t!=null?t:mi();return t||localStorage.setItem(Ze,r),n&&hi(Ze,r,n),r}}catch{}let e=mi();return n&&hi(Ze,e,n),e}var zn=class{constructor(){this.name="analytics";this.ctx=null;this.active=!1;this.clientKey="";this.apiBaseUrl="";this.deviceId="";this.installationId="";this.attributionProps={};this.anonymousId="";this.userId=Qb();this.superProps={};this.groups={};this.queue=[];this.buffer=new Be(Jb);this.persisted=!1;this.backoff=new kt;this.sampleRate=1;this.droppedCount=0;this.sampledOutCount=0;this.flushCount=0}get pending(){return this.queue.length}get dropped(){return this.droppedCount}get stats(){return{pending:this.queue.length,dropped:this.droppedCount,sampledOut:this.sampledOutCount,flushes:this.flushCount,sampleRate:this.sampleRate}}get isActive(){return this.active}setup(e){var i,o,a,c,l,u,d;this.ctx=e,this.clientKey=(i=e.clientKey)!=null?i:"",this.apiBaseUrl=(o=e.apiBaseUrl)!=null?o:"",this.deviceId=(a=e.deviceId)!=null?a:"";let t=ey(this.deviceId);this.installationId=t.installationId,this.clickId=t.clickId;let r=Xb();this.attributionProps=r.props,this.cookieDomain=(c=e.analyticsOptions)==null?void 0:c.cookieDomain,this.anonymousId=ty(this.cookieDomain),this.superProps=Tl($n),this.groups=Tl(di),this.plan=(l=e.analyticsOptions)==null?void 0:l.plan;let s=(u=e.analyticsOptions)==null?void 0:u.sampleRate;typeof s=="number"&&s>=0&&s<=1&&(this.sampleRate=s),!(!this.clientKey||!this.apiBaseUrl)&&(r.isNew&&this.recordTouchpoint(),this.timer=setInterval(()=>this.autoFlush(),jb),typeof window!="undefined"&&(this.onHide=()=>{this.persist(),this.flush(!0)},window.addEventListener("pagehide",this.onHide)),this.offOnline=Vc(()=>{this.backoff.reset(),this.autoFlush()}),this.active=!0,this.maybeFirstOpen(),this.offSignal=(d=e.onSignal)==null?void 0:d.call(e,(p,f)=>{this.active&&(p==="rage"?this.track("$rageclick"):p==="dead"?this.track("$deadclick"):p==="shake"?this.track("$shake"):p==="error"?this.track("$exception",f):p==="web_vital"?this.track("$web_vital",f):p==="exit_intent"&&this.track("$exit_intent",f))}),this.buffer.load().then(p=>{let f=Array.isArray(p)?p:[],m=Pn(f,h=>h.event_time,L());this.droppedCount+=f.length-m.length,this.active&&m.length?(this.queue.unshift(...m),this.trim(),this.persisted=!0,this.autoFlush()):m.length<f.length&&this.buffer.clear()}),e.autocapture!==!1&&Promise.resolve().then(()=>(yl(),bl)).then(({installAutocapture:p})=>{this.active&&(this.stopAutocapture=p({onEvent:f=>this.track(f.name,{...f.props,capture_source:"automatic"}),maskText:e.maskEventText===!0}))}).catch(()=>{}))}get usable(){return this.active&&!!this.clientKey&&!!this.apiBaseUrl&&typeof fetch!="undefined"}get sessionId(){var e;return(e=this.ctx)==null?void 0:e.sessionId}async recordTouchpoint(){if(!this.clientKey||!this.apiBaseUrl||typeof fetch=="undefined")return;let e=this.attributionProps;try{await fetch(`${this.apiBaseUrl}/ingestion/attribution`,{method:"POST",headers:{"content-type":"application/json","x-scalebun-client-key":this.clientKey},keepalive:!0,body:JSON.stringify({sessionId:this.sessionId,anonymousId:this.anonymousId||void 0,source:e.utm_source,medium:e.utm_medium,campaign:e.utm_campaign,content:e.utm_content,term:e.utm_term,landingUrl:e.landing_url,referrer:e.referrer,referrerDomain:e.referrer_domain,clickToken:this.clickId})})}catch{}}maybeFirstOpen(){let e=!1;try{e=typeof localStorage!="undefined"&&localStorage.getItem(Cl)==="1"}catch{}if(!e){try{typeof localStorage!="undefined"&&localStorage.setItem(Cl,"1")}catch{}this.track("first_open")}}getInstallationId(){return this.installationId}setClickId(e){if(!(!e||!Rl.test(e))){this.clickId=e;try{typeof localStorage!="undefined"&&localStorage.setItem(fi,e)}catch{}}}build(e,t){let r=Z(),s=Object.keys(this.attributionProps).length?{...this.attributionProps,...this.superProps}:this.superProps,i=Object.keys(s).length?{...s,...t}:t,o=i&&Object.keys(i).length?ht(i):void 0,a=Object.keys(this.groups).length>0;return{event_id:q(),event_name:e.trim(),event_time:L(),platform:"web",installation_id:this.installationId,...this.deviceId?{device_id:this.deviceId}:{},anonymous_id:this.anonymousId,...this.sessionId?{session_id:this.sessionId}:{},...this.userId?{user_id:this.userId}:{},...this.clickId?{identifiers:{click_id:this.clickId}}:{},...o?{properties:o}:{},...a?{groups:{...this.groups}}:{},...r?{replay:r}:{},context:{sdk_version:Ds}}}get identity(){return{anonymousId:this.anonymousId,userId:this.userId,groups:this.groups,superProps:this.superProps}}evaluate(e,t){if(!this.plan)return{drop:!1};let r=Jc(this.plan,e,t);if(r.warnings.length)try{for(let s of r.warnings)console.warn(`[scalebun] tracking-plan: ${s}`)}catch{}return{drop:r.drop}}register(e){!e||typeof e!="object"||(this.superProps={...this.superProps,...e},Gt($n,this.superProps))}unregister(e){if(!(e in this.superProps))return;let{[e]:t,...r}=this.superProps;this.superProps=r,Gt($n,this.superProps)}group(e,t,r){!e||!t||(this.groups={...this.groups,[e]:t},Gt(di,this.groups),this.usable&&this.enqueue(this.build("$group",{group_type:e,group_key:t,...r!=null?r:{}})))}alias(e,t){var s;if(!e)return;let r=(s=t!=null?t:this.userId)!=null?s:this.anonymousId;this.userId=e,ui(e),this.usable&&this.enqueue(this.build("$alias",{previous_id:r}))}reset(){this.userId=void 0,ui(void 0),this.anonymousId=mi();try{typeof localStorage!="undefined"&&localStorage.setItem(Ze,this.anonymousId)}catch{}this.cookieDomain&&hi(Ze,this.anonymousId,this.cookieDomain),this.superProps={},this.groups={},Gt($n,this.superProps),Gt(di,this.groups)}track(e,t){if(!(!this.usable||!e)){if(!Qc(e,this.anonymousId,this.sampleRate)){this.sampledOutCount++;return}this.enqueue(this.build(e,t))}}trackPurchase(e){if(!this.usable)return;let t=this.build("purchase",e.props);t.revenue=e.revenue,t.currency=e.currency,this.enqueue(t)}trackSubscription(e){var t;this.usable&&(this.pendingSubscription=((t=this.pendingSubscription)!=null?t:Promise.resolve()).then(async()=>{try{let{normalizeSubscription:r}=await Promise.resolve().then(()=>(El(),kl)),s=r(e);if(!s){this.droppedCount++;return}if(!this.usable)return;let i=Z();this.enqueue(this.build("$subscription",i?{...s,replay:i}:s))}catch{}}))}identify(e,t){e&&(this.userId=e,ui(e),this.usable&&this.enqueue(this.build("$identify",t)))}enqueue(e){this.queue.push(e),this.trim(),this.queue.length>=Kb&&this.autoFlush()}trim(){let e=this.queue.length-Gb;e>0&&(this.queue.splice(0,e),this.droppedCount+=e)}autoFlush(){!at()||!this.backoff.ready(L())||this.flush()}async flush(e=!1){if(await this.pendingSubscription,!this.usable||!this.queue.length)return;let t=this.queue.splice(0,this.queue.length),r=JSON.stringify({events:t});try{let{signatureHeaders:s}=await Promise.resolve().then(()=>(ri(),ni)),i=await s(this.clientKey,r);(await fetch(`${this.apiBaseUrl}/batch`,{method:"POST",headers:{"content-type":"application/json","x-scalebun-client-key":this.clientKey,...i},body:r,keepalive:e})).ok?(this.backoff.reset(),this.flushCount++):(this.backoff.fail(L()),this.requeue(t))}catch{this.backoff.fail(L()),this.requeue(t)}this.persist()}requeue(e){this.queue.unshift(...e),this.trim()}async persist(){this.queue.length?(this.persisted=!0,await this.buffer.save(Et(this.queue))):this.persisted&&(this.persisted=!1,await this.buffer.clear())}teardown(){var e,t,r;(e=this.stopAutocapture)==null||e.call(this),this.stopAutocapture=void 0,this.timer&&clearInterval(this.timer),this.timer=void 0,this.onHide&&typeof window!="undefined"&&window.removeEventListener("pagehide",this.onHide),this.onHide=void 0,(t=this.offOnline)==null||t.call(this),(r=this.offSignal)==null||r.call(this),this.offSignal=void 0,this.offOnline=void 0,this.queue=[],this.persisted=!1,this.buffer.clear(),this.active=!1}};z();Fe();function ny(n,e){if(e in n)return n[e];if(e.indexOf(".")===-1)return;let t=n;for(let r of e.split(".")){if(t==null||typeof t!="object")return;t=t[r]}return t}function Ml(n,e){let t=ny(n,e.attr),r=e.value;switch(e.op){case"exists":return t!=null;case"eq":return t===r;case"neq":return t!==r;case"in":return Array.isArray(r)&&r.includes(t);case"nin":return Array.isArray(r)&&!r.includes(t);case"contains":return typeof t=="string"&&typeof r=="string"&&t.includes(r);case"gt":return typeof t=="number"&&typeof r=="number"&&t>r;case"lt":return typeof t=="number"&&typeof r=="number"&&t<r;default:return!1}}function ry(n,e){var o,a;let t=(o=e.all)!=null?o:[],r=(a=e.any)!=null?a:[];if(t.length===0&&r.length===0)return!0;let s=t.every(c=>Ml(n,c)),i=r.length===0||r.some(c=>Ml(n,c));return s&&i}function Yt(n,e){if(!n||n.length===0)return null;for(let t of n)if(ry(e,t))return t;return null}var Pl="scalebun_config",gi="scalebun_flag_overrides";function Un(){try{return typeof localStorage!="undefined"?localStorage:null}catch{return null}}function Ll(){let n=Un();if(!n)return null;try{let e=n.getItem(Pl);if(!e)return null;let t=JSON.parse(e);return t&&typeof t.version=="string"&&Array.isArray(t.flags)?t:null}catch{return null}}function _l(n){let e=Un();if(e)try{e.setItem(Pl,JSON.stringify(n))}catch{}}function Ol(){let n=Un();if(!n)return{};try{let e=n.getItem(gi),t=e?JSON.parse(e):null;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Vn(n){let e=Un();if(e)try{Object.keys(n).length?e.setItem(gi,JSON.stringify(n)):e.removeItem(gi)}catch{}}var bi={version:"",flags:[],remoteConfig:[],experiments:[],rollouts:[]};var sy=5*60*1e3,Nl=n=>{var e;return(e=n.salt)!=null?e:n.key},Wn=class{constructor(){this.name="config";this.ctx=null;this.active=!1;this.payload=bi;this.exposed=new Set;this.deviceId="";this.clientKey="";this.apiBaseUrl="";this.lastFetch=0;this.overrides={};this.changeListeners=new Set;this.settled=!1;this.readyPromise=new Promise(e=>this.resolveReady=e)}get isActive(){return this.active}setup(e){var t,r,s,i,o;this.ctx=e,this.deviceId=(t=e.deviceId)!=null?t:"",this.clientKey=(r=e.clientKey)!=null?r:"",this.apiBaseUrl=(s=e.apiBaseUrl)!=null?s:"",Oe({deviceId:this.deviceId}),this.overrides=Ol(),this.payload=(o=(i=this.seedFromBootstrap(e.flagsBootstrap))!=null?i:Ll())!=null?o:bi,this.exposed=new Set,this.refresh().finally(()=>this.markReady()),typeof document!="undefined"&&(this.onVisible=()=>{document.visibilityState==="visible"&&L()-this.lastFetch>sy&&this.refresh()},document.addEventListener("visibilitychange",this.onVisible)),e.flagsRealtime!==!1&&this.openStream(),this.active=!0}openStream(){if(!(typeof EventSource=="undefined"||!this.clientKey||!this.apiBaseUrl))try{this.es=new EventSource(`${this.apiBaseUrl}/config/stream?key=${encodeURIComponent(this.clientKey)}`),this.es.onmessage=e=>{try{if(e.data&&JSON.parse(e.data).type==="ping")return}catch{}this.refresh()}}catch{}}seedFromBootstrap(e){return!e||typeof e!="object"||!["flags","remoteConfig","experiments","rollouts"].some(r=>Array.isArray(e[r]))?null:{version:typeof e.version=="string"?e.version:"bootstrap",flags:Array.isArray(e.flags)?e.flags:[],remoteConfig:Array.isArray(e.remoteConfig)?e.remoteConfig:[],experiments:Array.isArray(e.experiments)?e.experiments:[],rollouts:Array.isArray(e.rollouts)?e.rollouts:[],entitlements:e.entitlements,holdout:e.holdout}}markReady(){var e;this.settled||(this.settled=!0,(e=this.resolveReady)==null||e.call(this))}emitChange(){for(let e of this.changeListeners)try{e()}catch{}}async refresh(){var e,t,r,s;if(!(!this.clientKey||!this.apiBaseUrl||typeof fetch=="undefined")){this.lastFetch=L();try{let i={"x-scalebun-client-key":this.clientKey};this.payload.version&&(i["if-none-match"]=`"${this.payload.version}"`);let o=await fetch(`${this.apiBaseUrl}/config`,{headers:i});if(o.status===304||!o.ok)return;let a=await o.json();if(a&&typeof a.version=="string"){let c=a.version!==this.payload.version;this.payload={version:a.version,flags:(e=a.flags)!=null?e:[],remoteConfig:(t=a.remoteConfig)!=null?t:[],experiments:(r=a.experiments)!=null?r:[],rollouts:(s=a.rollouts)!=null?s:[],entitlements:a.entitlements,holdout:a.holdout,sdkFlags:a.sdkFlags},_l(this.payload),c&&(this.exposed.clear(),this.emitChange())}}catch{}}}ready(){return this.readyPromise}onChange(e){return this.changeListeners.add(e),()=>{this.changeListeners.delete(e)}}override(e,t){this.overrides[e]=t,Vn(this.overrides),this.emitChange()}clearOverride(e){Object.prototype.hasOwnProperty.call(this.overrides,e)&&(delete this.overrides[e],Vn(this.overrides),this.emitChange())}clearOverrides(){this.overrides={},Vn(this.overrides),this.emitChange()}hasOverride(e){return Object.prototype.hasOwnProperty.call(this.overrides,e)}bucketingId(e){var s;let t=yt();if(e){let i=t[e];if(i!=null&&i!=="")return String(i)}if((s=this.payload.sdkFlags)!=null&&s.stableBucketingId)return this.deviceId;let r=t.userId;return r!=null&&r!==""?String(r):this.deviceId}knows(e){return!this.hasOverride(e)&&this.payload.flags.some(t=>t.key===e)}isEnabled(e){var r;if(this.hasOverride(e))return!!this.overrides[e];let t=this.payload.flags.find(s=>s.key===e);if(!t)return!1;if(t.variations&&t.variations.length)return!!this.variationDetail(e,!1).value;if(t.targeting&&t.targeting.length){let s=Yt(t.targeting,yt());if(s)return typeof s.rollout=="number"?Le(this.bucketingId(t.bucketBy),Nl(t))<s.rollout:(r=s.serve)!=null?r:!0}return t.enabled}variationDetail(e,t){var c,l,u;let r=this.payload.flags.find(d=>d.key===e);if(this.hasOverride(e)){let d=this.overrides[e];if(typeof d=="string"&&(r!=null&&r.variations)){let p=r.variations.find(f=>f.key===d);if(p)return{value:p.value,variant:p.key,reason:"DEFAULT"}}return{value:d!=null?d:t,variant:typeof d=="string"?d:null,reason:"DEFAULT"}}if(!r)return{value:t,variant:null,reason:"FLAG_NOT_FOUND"};let s=r.variations,i=()=>this.bucketingId(r.bucketBy),o=(d,p)=>{var m,h;let f=(m=d!=null?d:r.defaultVariant)!=null?m:null;if(f&&s){let b=s.find(k=>k.key===f);if(b)return{value:b.value,variant:f,reason:p}}return{value:(h=r.defaultValue)!=null?h:t,variant:f,reason:p}},a=()=>{if(s&&s.some(d=>typeof d.allocationPct=="number")){let d=oi(i(),e,s.map(p=>{var f;return{key:p.key,allocationPct:(f=p.allocationPct)!=null?f:0}}));return o(d,"ROLLOUT")}return s?o(null,"DEFAULT"):{value:r.enabled,variant:null,reason:"DEFAULT"}};if(r.targeting&&r.targeting.length){let d=Yt(r.targeting,yt());if(d)return typeof d.rollout=="number"?Le(i(),Nl(r))>=d.rollout?a():s?o((c=d.variation)!=null?c:null,"ROLLOUT"):{value:!0,variant:null,reason:"ROLLOUT"}:d.variation||s?o((l=d.variation)!=null?l:null,"TARGETING_MATCH"):{value:(u=d.serve)!=null?u:!0,variant:null,reason:"TARGETING_MATCH"}}return a()}variation(e,t){return this.variationDetail(e,t).value}get(e,t){let r=this.payload.remoteConfig.find(s=>s.key===e);if(!r)return t;try{switch(r.type){case"number":{let s=Number(r.value);return Number.isFinite(s)?s:t}case"boolean":return r.value==="true";case"json":return JSON.parse(r.value);default:return r.value}}catch{return t}}isOn(e){if(this.hasOverride(e))return!!this.overrides[e];let t=this.payload.rollouts.find(s=>s.key===e);if(!t)return!1;let r=t.percentage;if(t.targeting&&t.targeting.length){let s=Yt(t.targeting,yt());s&&typeof s.percentage=="number"&&(r=s.percentage)}return Le(this.bucketingId(t.bucketBy),t.salt)<r}inHoldout(){let e=this.payload.holdout;return!!e&&e.percentage>0&&Le(this.bucketingId(),e.salt)<e.percentage}inLayerSlot(e){if(!e.layer||!e.layerRange)return!0;let[t,r]=e.layerRange,s=Le(this.bucketingId(),`layer:${e.layer}`);return s>=t&&s<r}variant(e){var o;if(this.hasOverride(e)){let a=this.overrides[e];return a==null?null:String(a)}let t=this.payload.experiments.find(a=>a.key===e);if(!t||this.inHoldout()||!this.inLayerSlot(t))return null;let r=t.variants;if(t.targeting&&t.targeting.length){let a=Yt(t.targeting,yt());if(!a||a.include===!1)return null;a.variants&&a.variants.length&&(r=a.variants)}let s=oi(this.bucketingId(t.bucketBy),t.salt,r),i=`${e}=${s}`;if(s&&!this.exposed.has(i)){this.exposed.add(i);let a=Z();(o=this.ctx)==null||o.emit({kind:"event",name:"experiment_exposure",props:{experiment:e,variant:s,reason:"ENROLLED",...a?{$replay:a}:{}},timestamp:L()})}return s}entitlement(e){let t=this.payload.entitlements;return(t==null?void 0:t[e])!==!1}teardown(){var e;this.onVisible&&typeof document!="undefined"&&document.removeEventListener("visibilitychange",this.onVisible),this.onVisible=void 0,(e=this.es)==null||e.close(),this.es=void 0,this.active=!1}};z();z();function Bl(n){return n&&n.replace(/[\w.+-]+@[\w-]+\.[\w.-]+/g,"[email]").replace(/\?[^\s:)'"]*/g,"")}function Fl(n){if(!n)return n;let e=!1,t={};for(let r in n){let s=n[r];if(typeof s=="string"){let i=K(s);t[r]=i,i!==s&&(e=!0)}else t[r]=s}return e?t:n}var Dl=16*1024;function ql(n,e={}){var u,d,p,f;let{droppedSince:t=0,extra:r,frames:s,fingerprint:i,causes:o,scope:a}=e,c=n.stack;return!c&&n.source&&(c=`${n.message} at ${n.source}:${(u=n.lineno)!=null?u:0}:${(d=n.colno)!=null?d:0}`),c&&c.length>Dl&&(c=c.slice(0,Dl)),c=Bl(c),{kind:"error",type:n.type,message:K((p=n.message)!=null?p:""),stack:c,source:"js",...n.mechanism?{mechanism:n.mechanism}:{},...s&&s.length?{frames:s}:{},...i?{fingerprint:i}:{},...o&&o.length?{causes:o}:{},...a!=null&&a.level?{level:a.level}:{},...a!=null&&a.tags?{tags:a.tags}:{},...a!=null&&a.context?{context:a.context}:{},...iy(),...oy(),screenName:ay(),clientId:`err_${q()}`,timestamp:L(),...t>0?{droppedSince:t}:{},...(f=Fl(r))!=null?f:{}}}function iy(){let n=We.snapshot();return n.length?{breadcrumbs:n}:{}}function oy(){let n=Z();return n?{replay:n}:{}}function ay(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}var Kn=class{constructor(e){this.lastSeen=new Map;this.recent=[];this.dropped=0;var t,r,s;this.dedupWindowMs=(t=e==null?void 0:e.dedupWindowMs)!=null?t:5e3,this.capCount=(r=e==null?void 0:e.capCount)!=null?r:20,this.capWindowMs=(s=e==null?void 0:e.capWindowMs)!=null?s:1e4}accept(e){let t=Date.now();if(this.lastSeen.size>512)for(let[s,i]of this.lastSeen)t-i>=this.dedupWindowMs&&this.lastSeen.delete(s);let r=this.lastSeen.get(e);return r!=null&&t-r<this.dedupWindowMs?(this.dropped++,!1):(this.recent=this.recent.filter(s=>t-s<this.capWindowMs),this.recent.length>=this.capCount?(this.dropped++,!1):(this.lastSeen.set(e,t),this.recent.push(t),!0))}takeDropped(){let e=this.dropped;return this.dropped=0,e}};var Ct={tags:{},context:{}};function Hl(n,e){Ct.tags[n]=e}function $l(n,e){Ct.context[n]=e}function zl(n){Ct.level=n}function Ul(n){var i;let e={...Ct.tags,...n==null?void 0:n.tags},t={...Ct.context,...n==null?void 0:n.context},r=(i=n==null?void 0:n.level)!=null?i:Ct.level,s={};return r&&(s.level=r),Object.keys(e).length&&(s.tags=e),Object.keys(t).length&&(s.context=t),s}Fe();var cy="wzb-errors-v1";function Vl(n,e){return n==null||n>=1?!0:n<=0?!1:e?Le(e,cy)<n*100:!0}z();var hy=()=>[];function gy(n){if(!n)return"";let e=n.split(`
716
+ `).find(t=>/\bat\b|@/.test(t));return(e!=null?e:"").trim().slice(0,200)}var td=["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"];function nd(n,e){return typeof n=="string"?e.includes(n):n.test(e)}var jn=class{constructor(){this.name="errors";this.ctx=null;this.active=!1;this.throttle=new Kn;this.ignore=td;this.denyUrls=[];this.captureResourceErrors=!1;this.sampled=!0;this.counters={captured:0,droppedThrottle:0,droppedIgnore:0,droppedBeforeSend:0,byType:{},lastFingerprint:void 0}}stats(){return{captured:this.counters.captured,droppedThrottle:this.counters.droppedThrottle,droppedIgnore:this.counters.droppedIgnore,droppedBeforeSend:this.counters.droppedBeforeSend,byType:{...this.counters.byType},lastFingerprint:this.counters.lastFingerprint,breadcrumbs:We.snapshot().length,sampled:this.sampled}}get isActive(){return this.active}setup(e){var r,s,i;this.ctx=e;let t=e.errorsOptions;t&&(this.ignore=[...td,...(r=t.ignoreErrors)!=null?r:[]],this.denyUrls=(s=t.denyUrls)!=null?s:[],this.captureResourceErrors=(i=t.captureResourceErrors)!=null?i:!1,this.beforeSend=t.beforeSend),this.sampled=Vl(t==null?void 0:t.sampleRate,e.sessionId),Promise.resolve().then(()=>(ed(),Zl)).then(o=>{this.parseStack=o.parseStack,this.computeFingerprint=o.computeFingerprint,this.extractCauses=o.extractCauses}).catch(()=>{}),typeof window!="undefined"&&(this.onError=o=>{var l,u;let a=o.target;if(!!a&&a!==window&&typeof a.tagName=="string"&&!o.error&&!o.message){if(!this.captureResourceErrors)return;let d=a.src||a.href||"";this.handleAuto({type:"fatal",message:`Failed to load ${a.tagName.toLowerCase()}${d?` ${d}`:""}`,source:d,mechanism:"resource"});return}this.handleAuto({type:"fatal",message:o.message||((l=o.error)==null?void 0:l.message)||"Uncaught error",stack:(u=o.error)==null?void 0:u.stack,source:o.filename,lineno:o.lineno,colno:o.colno,mechanism:"onerror"},o.error)},this.onRejection=o=>{var c;let a=o.reason;this.handleAuto({type:"unhandledrejection",message:(c=a==null?void 0:a.message)!=null?c:String(o.reason),stack:a==null?void 0:a.stack,mechanism:"onunhandledrejection"},o.reason)},this.sampled&&(window.addEventListener("error",this.onError,!0),window.addEventListener("unhandledrejection",this.onRejection)),this.active=!0)}shouldIgnore(e){for(let t of this.ignore)if(nd(t,e.message))return!0;if(e.source){for(let t of this.denyUrls)if(nd(t,e.source))return!0}return!1}handleAuto(e,t){if(this.shouldIgnore(e)){this.counters.droppedIgnore++;return}let r=`${e.type}|${e.message}|${gy(e.stack)}`;if(!this.throttle.accept(r)){this.counters.droppedThrottle++;return}this.buildAndEmit(e,{droppedSince:this.throttle.takeDropped(),original:t})}captureHandled(e,t,r){var i;let s=e;this.buildAndEmit({type:"handled",message:(i=s==null?void 0:s.message)!=null?i:String(e),stack:s==null?void 0:s.stack,mechanism:"captureError"},{extra:t,scopeOver:r,original:e})}buildAndEmit(e,t){var a,c,l,u,d,p,f,m,h;let r=(a=this.parseStack)==null?void 0:a.call(this,e.stack),s=(u=(c=t.scopeOver)==null?void 0:c.fingerprint)!=null?u:(l=this.computeFingerprint)==null?void 0:l.call(this,e.type,r,e.message),i=t.original!=null&&this.extractCauses?this.extractCauses(t.original,(d=this.parseStack)!=null?d:hy):void 0,o=ql(e,{droppedSince:t.droppedSince,extra:t.extra,frames:r,fingerprint:s,causes:i,scope:Ul(t.scopeOver)});if(this.beforeSend)try{let b=this.beforeSend(o);if(!b){this.counters.droppedBeforeSend++;return}o=b}catch{}(p=this.ctx)==null||p.emit(o),this.counters.captured++,this.counters.byType[e.type]=((f=this.counters.byType[e.type])!=null?f:0)+1,s&&(this.counters.lastFingerprint=s),(h=this.ctx)==null||h.signal("error",{fingerprint:s,type:e.type,message:((m=e.message)!=null?m:"").slice(0,200),handled:e.type==="handled"})}teardown(){typeof window!="undefined"&&(this.onError&&window.removeEventListener("error",this.onError,!0),this.onRejection&&window.removeEventListener("unhandledrejection",this.onRejection),this.active=!1)}};var vi;function by(){return vi||(vi=typeof TextEncoder!="undefined"?new TextEncoder:void 0)}function Gn(n){try{let e=by();return e?e.encode(n).length:unescape(encodeURIComponent(n)).length}catch{return n.length}}function Yn(n){try{return n==null?void 0:typeof n=="string"?Gn(n):typeof URLSearchParams!="undefined"&&n instanceof URLSearchParams?Gn(n.toString()):typeof Blob!="undefined"&&n instanceof Blob?n.size:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:void 0}catch{return}}function Xt(n){if(!n)return;let e=parseInt(n,10);return Number.isFinite(e)&&e>=0?e:void 0}function dt(){return typeof performance!="undefined"&&typeof performance.now=="function"?performance.now():Date.now()}function rd(n,e,t,r){let s=n.fetch;return typeof s!="function"?()=>{}:(n.fetch=async function(o,a){var k,x,y,g,w,v,E,C,I,R,T;let c=vy(o),l=wy(o,a);if(t(c))return s.call(this,o,a);let u,d=a,p=r==null?void 0:r(c);if(p){u=p.traceId;let A=new Headers((k=a==null?void 0:a.headers)!=null?k:o instanceof Request?o.headers:void 0);A.set("traceparent",p.header),d={...a,headers:A}}let f=Date.now(),m=dt(),h=xy(d==null?void 0:d.body),b=Sy(o,d);try{let A=await s.call(this,o,d),P=null;try{P=typeof A.clone=="function"?A.clone():null}catch{P=null}return e({method:l,url:c,status:A.status,startedAt:f,duration:Math.round(dt()-m),requestSize:(y=Yn(d==null?void 0:d.body))!=null?y:Xt((x=b==null?void 0:b.get)==null?void 0:x.call(b,"content-length")),responseSize:Xt((w=(g=A.headers)==null?void 0:g.get)==null?void 0:w.call(g,"content-length")),reqBody:h,reqContentType:(E=(v=b==null?void 0:b.get)==null?void 0:v.call(b,"content-type"))!=null?E:void 0,resContentType:(R=(I=(C=A.headers)==null?void 0:C.get)==null?void 0:I.call(C,"content-type"))!=null?R:void 0,readResponseText:P?()=>yy(P):void 0,traceId:u}),A}catch(A){let P=A,$=(P==null?void 0:P.name)==="AbortError",D=(P==null?void 0:P.name)==="TimeoutError";throw e({method:l,url:c,status:0,startedAt:f,duration:Math.round(dt()-m),error:(T=P==null?void 0:P.message)!=null?T:"network error",aborted:$,timedOut:D}),A}},()=>{n.fetch=s})}var Xn=64*1024;async function yy(n){try{let e=n.body;if(!e||typeof e.getReader!="function"){let i=await n.text();return i.length>Xn?i.slice(0,Xn):i}let t=e.getReader(),r=typeof TextDecoder!="undefined"?new TextDecoder:void 0,s="";for(;;){let{done:i,value:o}=await t.read();if(i)break;if(o&&r&&(s+=r.decode(o,{stream:!0})),s.length>=Xn){try{await t.cancel()}catch{}return s.slice(0,Xn)}}return r&&(s+=r.decode()),s}catch{return null}}function vy(n){return typeof n=="string"?n:n instanceof URL?n.href:n.url}function wy(n,e){var r;let t=(r=e==null?void 0:e.method)!=null?r:typeof n!="string"&&!(n instanceof URL)?n.method:void 0;return(t!=null?t:"GET").toUpperCase()}function xy(n){if(typeof n=="string")return n;if(typeof URLSearchParams!="undefined"&&n instanceof URLSearchParams)return n.toString()}function Sy(n,e){try{if(e!=null&&e.headers)return new Headers(e.headers);if(typeof Request!="undefined"&&n instanceof Request)return n.headers}catch{}}function sd(n,e,t,r){let s=n.XMLHttpRequest;if(typeof s!="function")return()=>{};let i=s.prototype.open,o=s.prototype.send,a=s.prototype.setRequestHeader;return s.prototype.open=function(c,l,...u){return this.__scalebun={method:String(c).toUpperCase(),url:String(l)},i.call(this,c,l,...u)},s.prototype.setRequestHeader=function(c,l){return this.__scalebun&&typeof c=="string"&&c.toLowerCase()==="content-type"&&(this.__scalebun.reqContentType=String(l)),a.call(this,c,l)},s.prototype.send=function(c){let l=this.__scalebun;if(l&&!t(l.url)){let u=r==null?void 0:r(l.url);if(u){l.traceId=u.traceId;try{this.setRequestHeader("traceparent",u.header)}catch{}}let d=Date.now(),p=dt(),f=typeof c=="string"?c:void 0,m=Yn(c),h=!1,b=!1;this.addEventListener("abort",()=>{h=!0}),this.addEventListener("timeout",()=>{b=!0}),this.addEventListener("loadend",()=>{let k=this.status===0;e({method:l.method,url:l.url,status:this.status||0,startedAt:d,duration:Math.round(dt()-p),requestSize:m,responseSize:Ey(this),error:k?h?"aborted":b?"timeout":"network error":void 0,aborted:h,timedOut:b,reqBody:f,reqContentType:l.reqContentType,resContentType:ky(this,"content-type"),readResponseText:async()=>{try{return typeof this.responseText=="string"?this.responseText:null}catch{return null}},traceId:l.traceId})})}return o.call(this,c)},()=>{s.prototype.open=i,s.prototype.send=o,s.prototype.setRequestHeader=a}}function ky(n,e){var t,r;try{return(r=(t=n.getResponseHeader)==null?void 0:t.call(n,e))!=null?r:void 0}catch{return}}function Ey(n){var t;let e=Xt((t=n.getResponseHeader)==null?void 0:t.call(n,"content-length"));if(e!=null)return e;try{return typeof n.responseText=="string"?Gn(n.responseText):void 0}catch{return}}z();function id(n){let{status:e,error:t,aborted:r,timedOut:s}=n;if(r)return"abort";if(s)return"timeout";if((e===0||e===void 0)&&t)return Iy(t)?"abort":Cy(t)?"timeout":Ay(t)?"cors":"network_error";if(typeof e=="number"){if(e>=500)return"http_5xx";if(e>=400)return"http_4xx"}}function od(n,e=2e3){return typeof n=="number"&&n>=e}function Iy(n){return/\babort(ed)?\b/i.test(n)}function Cy(n){return/\btimed?\s*out\b|\btimeout\b/i.test(n)}function Ay(n){return/\bcors\b|cross-origin|access-control|opaque/i.test(n)}var Ty=/^(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,}|[0-9A-HJKMNP-TV-Z]{26})$/i;function Ry(n){return n?!!(Ty.test(n)||n.length>=12&&/\d/.test(n)&&/^[A-Za-z0-9_-]+$/.test(n)):!1}function ad(n){let e=n;try{let s=typeof location!="undefined"?location.href:"http://x";e=new URL(n,s).pathname}catch{let s=e.indexOf("?");s>=0&&(e=e.slice(0,s));let i=e.indexOf("#");i>=0&&(e=e.slice(0,i))}if(e==="/"||e==="")return e||"/";let t=e.split("/"),r=!1;for(let s=0;s<t.length;s++){let i=t[s];i!==void 0&&Ry(i)&&(t[s]=":id",r=!0)}return r?t.join("/"):e}function cd(n,e={}){var a,c;let t=(a=n.protocol)!=null?a:"http",r=t==="http"||t==="beacon"?id({status:n.status,error:n.error,aborted:n.aborted,timedOut:n.timedOut}):void 0,s=od(n.duration,(c=e.slowMs)!=null?c:2e3),i=ad(n.url);return{kind:"network",method:n.method,url:n.url,status:n.status,startedAt:n.startedAt,duration:n.duration,error:n.error,requestSize:n.requestSize,responseSize:n.responseSize,route:i,screenName:My(),...t!=="http"?{protocol:t}:{},...r?{failure:r}:{},...s?{slow:!0}:{},...n.transferSize!==void 0?{transferSize:n.transferSize}:{},...n.graphql?{graphql:n.graphql}:{},...n.timing?{timing:n.timing}:{},...n.ws?{ws:n.ws}:{},...n.request?{request:n.request}:{},...n.response?{response:n.response}:{},...n.traceId?{traceId:n.traceId}:{},clientId:`net_${q()}`,timestamp:L()}}function My(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}function ld(n){let e=new Uint8Array(n),t=globalThis.crypto;if(t&&typeof t.getRandomValues=="function")t.getRandomValues(e);else for(let s=0;s<n;s++)e[s]=Math.floor(Math.random()*256);let r="";for(let s of e)r+=s.toString(16).padStart(2,"0");return r}function Py(){let n=ld(16),e=ld(8);return{traceId:n,spanId:e,header:`00-${n}-${e}-01`}}function Ly(n){try{let e=typeof location!="undefined"?location.href:void 0;return new URL(n,e).origin}catch{return null}}function dd(n){if(!n.length)return null;let e=new Set(n);return t=>{let r=Ly(t);return r&&e.has(r)?Py():null}}var _y=new Set(["fetch","xmlhttprequest"]);function Oy(n){let e={},t=n.domainLookupEnd-n.domainLookupStart,r=n.connectEnd-n.connectStart,s=n.secureConnectionStart>0?n.connectEnd-n.secureConnectionStart:0,i=n.responseStart-n.requestStart,o=n.responseEnd-n.responseStart;t>0&&(e.dns=Jt(t)),r>0&&(e.tcp=Jt(r)),s>0&&(e.tls=Jt(s)),i>0&&(e.ttfb=Jt(i)),o>0&&(e.download=Jt(o));let a={};return Object.keys(e).length&&(a.timing=e),typeof n.transferSize=="number"&&n.transferSize>0&&(a.transferSize=n.transferSize),a}function Jt(n){return Math.round(n*100)/100}var At=class At{constructor(){this.byUrl=new Map;this.timeOriginMs=0}install(){var e;if(typeof PerformanceObserver=="undefined"||typeof performance=="undefined")return!1;this.timeOriginMs=(e=performance.timeOrigin)!=null?e:0;try{return this.observer=new PerformanceObserver(t=>{for(let r of t.getEntries()){let s=r;_y.has(s.initiatorType)&&this.add(s)}}),this.observer.observe({type:"resource",buffered:!0}),!0}catch{return!1}}add(e){let t=e.name,r=this.byUrl.get(t);r||(r=[],this.byUrl.set(t,r)),r.push(e),r.length>At.MAX_PER_URL&&r.shift(),this.prune()}match(e,t){let r=this.byUrl.get(e);if(!r||!r.length)return{};let s=t-this.timeOriginMs,i=0,o=1/0;for(let c=0;c<r.length;c++){let l=r[c];if(!l)continue;let u=Math.abs(l.startTime-s);u<o&&(o=u,i=c)}let[a]=r.splice(i,1);return r.length||this.byUrl.delete(e),a?Oy(a):{}}prune(){if(typeof performance=="undefined")return;let e=performance.now()-At.TTL_MS;for(let[t,r]of this.byUrl){let s=r.filter(i=>i.startTime>=e);s.length?this.byUrl.set(t,s):this.byUrl.delete(t)}}teardown(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0,this.byUrl.clear()}};At.TTL_MS=6e4,At.MAX_PER_URL=8;var Qn=At;Fe();function ud(n,e){if(n.failed||n.slow)return!0;let t=e>=1?1:e<=0?0:e;return t>=1?!0:t<=0?!1:Ee(n.key)%1e4<Math.round(t*1e4)}var Zn=class{constructor(e,t,r){this.windowMs=e;this.emit=t;this.onSuppress=r;this.map=new Map}push(e){var s,i,o,a;let t=`${e.method}|${(s=e.route)!=null?s:e.url}|${(o=(i=e.status)!=null?i:e.error)!=null?o:""}`,r=this.map.get(t);return r?(r.count++,r.item=e,clearTimeout(r.timer),r.timer=setTimeout(()=>this.flush(t),this.windowMs),(a=this.onSuppress)==null||a.call(this),!1):(this.map.size>=500&&this.evictOldest(),this.map.set(t,{count:0,item:e,timer:setTimeout(()=>this.flush(t),this.windowMs)}),this.emit(e),!0)}flush(e){let t=this.map.get(e);this.map.delete(e),t&&t.count>0&&this.emit({...t.item,repeat:t.count})}evictOldest(){let e=this.map.keys().next().value;if(e!==void 0){let t=this.map.get(e);t&&clearTimeout(t.timer),this.flush(e)}}get pending(){return this.map.size}dispose(){for(let e of this.map.values())clearTimeout(e.timer);this.map.clear()}};var Ny="google-analytics.com,googletagmanager.com,analytics.google.com,doubleclick.net,googlesyndication.com,googleadservices.com,app-measurement.com,facebook.net,analytics.tiktok.com,ads-twitter.com,analytics.twitter.com,ct.pinterest.com,bat.bing.com,px.ads.linkedin.com,tr.snapchat.com,tr6.snapchat.com,tr-shadow.snapchat.com,analytics.tiktokw.us,analytics-ipv6.tiktokw.us,criteo.com,criteo.net,taboola.com,outbrain.com,adroll.com,adsrvr.org,quantserve.com,scorecardresearch.com,hotjar.com,hotjar.io,clarity.ms,fullstory.com,mouseflow.com,crazyegg.com,luckyorange.com,inspectlet.com,segment.io,mixpanel.com,amplitude.com,heap.io,heapanalytics.com,rudderstack.com,posthog.com,matomo.cloud,plausible.io,simpleanalytics.com,statcounter.com,appsflyer.com,adjust.com,branch.io,ipify.org,ipinfo.io,ipapi.co,ip-api.com,geolocation-db.com,cloudflareinsights.com,nr-data.net,browser-intake-datadoghq.com,sentry.io,bugsnag.com,rollbar.com";function pd(n,e){let t=By(n)[1];if(!t)return!1;for(let r of(e!=null?e:Ny).split(","))if(t===r||t.endsWith("."+r))return!0;return!1}function By(n){let e=/^(?:([a-z][\w+.-]*):)?(?:\/\/(?:[^@/?#]*@)?([^:/?#]*)[^/?#]*)?([^?#]*)(\?[^#]*)?/i.exec(n||"")||[];return[(e[1]||"").toLowerCase(),(e[2]||"").toLowerCase(),e[3]||"",e[4]||""]}function zy(n,e){return typeof n=="string"?e.includes(n):n.test(e)}var tr=class{constructor(){this.name="network";this.active=!1;this.uninstalls=[];this.slowMs=2e3;this.sampleRate=1;this.dedupMs=0;this.denyUrls=[];this.keepThirdParty=!1;this.timingIndex=new Qn;this.timingOn=!1;this.counters={captured:0,byProtocol:{http:0,ws:0,sse:0,beacon:0},byFailure:{http_4xx:0,http_5xx:0,network_error:0,timeout:0,cors:0,abort:0},dropped:0,droppedThirdParty:0,sampledIn:0,bodiesCaptured:0}}stats(){return{captured:this.counters.captured,byProtocol:{...this.counters.byProtocol},byFailure:{...this.counters.byFailure},dropped:this.counters.dropped,droppedThirdParty:this.counters.droppedThirdParty,sampledIn:this.counters.sampledIn,bodiesCaptured:this.counters.bodiesCaptured}}get isActive(){return this.active}setup(e){var u,d,p,f,m,h;if(typeof window=="undefined")return;let t=(u=e.networkOptions)!=null?u:{};this.slowMs=(d=t.slowRequestMs)!=null?d:2e3,this.sampleRate=typeof t.sampleRate=="number"?t.sampleRate:1;let r=t.dedupWindowMs;this.dedupMs=typeof r=="number"&&r>0?r:0,this.dedupMs>0&&(this.deduper=new Zn(this.dedupMs,b=>{this.record(b),e.emit(b)},()=>{this.counters.dropped++})),this.denyUrls=(p=t.denyUrls)!=null?p:[],this.keepThirdParty=t.captureThirdParty===!0,this.thirdPartyHosts=t.thirdPartyHosts,this.beforeSend=t.beforeSend,t.captureBodies&&(this.bodyOpts={bodyMaxBytes:Math.min(Math.max(0,(f=t.bodyMaxBytes)!=null?f:8192),64*1024),contentTypeAllowlist:t.contentTypeAllowlist&&t.contentTypeAllowlist.length?t.contentTypeAllowlist:["application/json","text/plain"]}),this.timingOn=this.timingIndex.install();let s=e.apiBaseUrl,i=b=>!!s&&b.startsWith(s),o=b=>this.handle(e,b),a=(h=dd((m=e.traceOrigins)!=null?m:[]))!=null?h:void 0;this.uninstalls.push(rd(window,o,i,a)),this.uninstalls.push(sd(window,o,i,a));let c={ws:t.trackWebSocket!==!1,sse:t.trackSse!==!1,beacon:!0},l=typeof navigator!="undefined"?navigator:void 0;Promise.resolve().then(()=>(yd(),bd)).then(b=>{this.active&&this.uninstalls.push(...b.installStreams(window,l,o,i,c))}).catch(()=>{}),this.active=!0}handle(e,t){var s;if(!this.keepThirdParty&&(t.protocol==="beacon"||pd(t.url,this.thirdPartyHosts))){this.counters.dropped++,this.counters.droppedThirdParty++;return}if(this.denyUrls.some(i=>zy(i,t.url))){this.counters.dropped++;return}let r=(s=t.protocol)!=null?s:"http";if(this.timingOn&&r==="http"&&t.timing===void 0){setTimeout(()=>{if(!this.active)return;let i=this.timingIndex.match(t.url,t.startedAt);i.timing&&(t.timing=i.timing),i.transferSize!==void 0&&t.transferSize===void 0&&(t.transferSize=i.transferSize),this.finalize(e,t)},0);return}this.finalize(e,t)}finalize(e,t){var o;let r=(o=t.protocol)!=null?o:"http",s=r==="http"&&t.graphql===void 0&&this.maybeGraphql(t),i=!!this.bodyOpts&&r==="http";if(s||i){Promise.resolve().then(()=>(Ad(),Cd)).then(a=>a.enrichHttpCapture(t,{graphql:s,body:i?this.bodyOpts:void 0})).catch(()=>{}).finally(()=>{this.active&&this.emit(e,t)});return}this.emit(e,t)}maybeGraphql(e){return e.method!=="POST"?!1:/graphql/i.test(e.url)||!!e.reqBody&&e.reqBody.includes("query")}emit(e,t){let r=cd(t,{slowMs:this.slowMs});if(this.sampleRate<1){if(!ud({failed:!!r.failure,slow:!!r.slow,key:`${t.url}|${t.startedAt}`},this.sampleRate)){this.counters.dropped++;return}this.counters.sampledIn++}if(this.beforeSend)try{let s=this.beforeSend(r);if(s==null){this.counters.dropped++;return}r=s}catch{}r.failure&&r.failure!=="abort"&&e.signal("network_error"),this.emitItem(e,r)}emitItem(e,t){if(this.deduper){this.deduper.push(t);return}this.record(t),e.emit(t)}record(e){var s;this.counters.captured++;let t=(s=e.protocol)!=null?s:"http";this.counters.byProtocol[t]++;let r=e.failure;r&&this.counters.byFailure[r]++,(e.request||e.response)&&this.counters.bodiesCaptured++}teardown(){var e;for(let t of this.uninstalls)t();this.uninstalls=[],(e=this.deduper)==null||e.dispose(),this.deduper=void 0,this.timingIndex.teardown(),this.timingOn=!1,this.active=!1}};zs();function Td(n){let e=n[n.length-1];return e&&(e.renderTime||e.loadTime||e.startTime)||0}function Ai(){return{max:0,cur:0,first:0,last:0}}function Rd(n,e){for(let t of e){if(t.hadRecentInput||typeof t.value!="number")continue;let r=typeof t.startTime=="number"?t.startTime:n.last;n.cur>0&&r-n.last<1e3&&r-n.first<5e3?(n.cur+=t.value,n.last=r):(n.cur=t.value,n.first=r,n.last=r),n.cur>n.max&&(n.max=n.cur)}return n}function Md(n,e){let t=n;for(let r of e)typeof r.duration=="number"&&r.duration>t&&(t=r.duration);return t}function Ti(n){if(n)return n.replace(/[?#].*$/,"")}function Pd(){if(typeof performance=="undefined"||typeof performance.getEntriesByType!="function")return;let n=performance.getEntriesByType("navigation")[0];if(!n||!(n.responseStart>0))return;let e=(t,r)=>t>0&&r>=t?Math.round(r-t):0;return{redirect:e(n.redirectStart,n.redirectEnd),worker:e(n.workerStart,n.fetchStart),dns:e(n.domainLookupStart,n.domainLookupEnd),tcp:e(n.connectStart,n.connectEnd),tls:e(n.secureConnectionStart,n.connectEnd),request:e(n.requestStart,n.responseStart)}}function Ld(n){var a,c,l,u;if(typeof performance=="undefined"||typeof performance.getEntriesByType!="function")return;let e=performance.getEntriesByType("navigation")[0],t=Math.max(0,(a=e==null?void 0:e.responseStart)!=null?a:0),r=(l=(c=n.renderTime)!=null?c:n.loadTime)!=null?l:0;if(r<=0)return;let s=t,i=(u=n.loadTime)!=null?u:r;if(n.url){let d=performance.getEntriesByName(n.url)[0];d&&(s=Math.max(t,d.requestStart||d.startTime||t),i=n.loadTime||d.responseEnd||i)}let o=d=>Math.round(Math.max(0,d));return{ttfb:o(t),resourceLoadDelay:o(s-t),resourceLoadTime:n.url?o(i-s):0,elementRenderDelay:o(r-(n.url?i:t))}}function _d(n,e){let t;for(let r of n)if(!(r.end<e.start||r.start>e.end))for(let s of r.scripts)s.url&&(!t||s.dur>t.duration)&&(t={url:s.url,duration:Math.round(s.dur),fn:s.fn,invokerType:s.invokerType});return t}var Uy={lcp:[2500,4e3],inp:[200,500],cls:[.1,.25],fcp:[1800,3e3],ttfb:[800,1800]};function Od(n,e){let t=Uy[n];return t?e<=t[0]?"good":e<=t[1]?"needs-improvement":"poor":"unknown"}function Ri(n){if(!n||typeof n.tagName!="string")return;let e=[],t=n,r=0;for(;t&&t.nodeType===1&&r<5;){if(t.id){e.unshift(`#${Nd(t.id)}`);break}let s=t.getAttribute&&t.getAttribute("data-testid");if(s){e.unshift(`[data-testid="${Nd(s)}"]`);break}let i=t.tagName.toLowerCase(),o=t.parentElement;if(!o){e.unshift(i);break}let a=Vy(t,i);e.unshift(a>1?`${i}:nth-of-type(${a})`:i),t=o,r++}return e.length?e.join(" > "):void 0}function Vy(n,e){let t=1,r=n.previousElementSibling;for(;r;)r.tagName&&r.tagName.toLowerCase()===e&&t++,r=r.previousElementSibling;return t}function Nd(n){return n.replace(/([^\w-])/g,"\\$1")}function Bd(n){if(n)return{x:De(n.x),y:De(n.y),width:De(n.width),height:De(n.height)}}function De(n){return typeof n=="number"&&isFinite(n)?n:0}function Fd(n){if(!n)return;let e=n.element,t=typeof n.url=="string"&&n.url?n.url:void 0,r=Ri(e),s=e&&typeof e.tagName=="string"?e.tagName.toLowerCase():void 0,i=typeof n.loadTime=="number"?n.loadTime:void 0,o=typeof n.renderTime=="number"?n.renderTime:void 0;if(!r&&!t&&!s&&i===void 0&&o===void 0)return;let a={};return r&&(a.element=r),s&&(a.elementTag=s),t&&(a.url=t),i!==void 0&&(a.loadTime=Qt(i)),o!==void 0&&(a.renderTime=Qt(o)),a}function Mi(){return{largestValue:0,sources:[]}}function Dd(n,e,t=5){var r;for(let s of e){if(s.hadRecentInput)continue;let i=De(s.value);if(i<=0||i<=n.largestValue)continue;let o=s.sources||[],a=[];for(let c of o.slice(0,t)){let l=(r=c.node)!=null?r:void 0;a.push({selector:Ri(l),previousRect:Bd(c.previousRect),currentRect:Bd(c.currentRect)})}n.largestValue=i,n.sources=a}return n}function qd(n){if(!(n.largestValue<=0||n.sources.length===0))return{largestShiftValue:Math.round(n.largestValue*1e3)/1e3,sources:n.sources}}function Pi(){return{duration:0}}function Hd(n,e){for(let t of e){let r=De(t.duration);r<=n.duration||(n.duration=r,n.attribution=Wy(t))}return n}function Wy(n){var c;let e=(c=n.target)!=null?c:void 0,t=De(n.startTime),r=De(n.processingStart),s=De(n.processingEnd),i=De(n.duration),o={},a=Ri(e);return a&&(o.element=a),e&&typeof e.tagName=="string"&&(o.elementTag=e.tagName.toLowerCase()),typeof n.name=="string"&&(o.eventType=n.name),r>0&&(o.inputDelay=Qt(Math.max(0,r-t))),s>=r&&r>0&&(o.processingTime=Qt(Math.max(0,s-r))),s>0&&(o.presentationDelay=Qt(Math.max(0,t+i-s))),o}function $d(n){return n.duration>0?n.attribution:void 0}function Qt(n){return Math.round(n)}z();var rr=class rr{constructor(){this.name="webVitals";this.ctx=null;this.active=!1;this.disconnects=[];this.lcp=0;this.clsState=Ai();this.inp=0;this.clsAcc=Mi();this.inpAcc=Pi();this.route="/";this.loaf=[]}get isActive(){return this.active}setup(e){this.ctx=e,typeof PerformanceObserver!="undefined"&&(this.disconnects.push(Pe("largest-contentful-paint",t=>{var s,i;let r=Td(t);r&&(this.lcp=r,this.lcpAttr=(s=Fd(t[t.length-1]))!=null?s:this.lcpAttr,(i=this.lcpAttr)!=null&&i.url&&(this.lcpAttr.url=Ti(this.lcpAttr.url)))})),this.disconnects.push(Pe("layout-shift",t=>{Rd(this.clsState,t),Dd(this.clsAcc,t)})),this.disconnects.push(Pe("event",t=>{let r=this.inp;for(let s of t)typeof s.duration=="number"&&s.duration>r&&typeof s.startTime=="number"&&(r=s.duration,this.inpWindow={start:s.startTime,end:s.startTime+s.duration});this.inp=Md(this.inp,t),Hd(this.inpAcc,t)},{durationThreshold:40})),this.disconnects.push(Pe("long-animation-frame",t=>{var r,s,i;for(let o of t){if(this.loaf.length>=rr.LOAF_CAP)break;let a=(r=o.startTime)!=null?r:0,c=((s=o.scripts)!=null?s:[]).map(l=>{var u;return{url:(u=Ti(l.sourceURL||l.name||""))!=null?u:"",dur:typeof l.duration=="number"?l.duration:0,fn:l.sourceFunctionName,invokerType:l.invokerType}});this.loaf.push({start:a,end:a+((i=o.duration)!=null?i:0),scripts:c})}})),this.disconnects.push(Pe("paint",t=>{let r=t.find(s=>s.name==="first-contentful-paint");r&&this.emit("fcp",r.startTime,"ms")})),this.route=Ud(zd()),this.installRouteDetection(),this.emitTtfb(),typeof document!="undefined"&&(this.hideHandler=()=>{document.visibilityState==="hidden"&&this.finalizeRoute()},document.addEventListener("visibilitychange",this.hideHandler)),this.active=!0)}emitTtfb(){try{let e=typeof performance!="undefined"?performance.getEntriesByType("navigation")[0]:void 0;e&&e.responseStart>0&&this.emit("ttfb",e.responseStart,"ms",{ttfbPhases:Pd()})}catch{}}finalizeRoute(){let e=this.clsState.max;if(this.lcp>0){if(this.lcpAttr){let t=Ld(this.lcpAttr);t&&(this.lcpAttr.phases=t)}this.emit("lcp",this.lcp,"ms",this.lcpAttr)}if(this.inp>0){let t=$d(this.inpAcc);if(t&&this.inpWindow){let r=_d(this.loaf,this.inpWindow);r&&(t.loafScript=r)}this.emit("inp",this.inp,"ms",t)}e>0&&this.emit("cls",Math.round(e*1e3)/1e3,"score",qd(this.clsAcc)),this.lcp=this.inp=0,this.clsState=Ai(),this.lcpAttr=void 0,this.clsAcc=Mi(),this.inpAcc=Pi(),this.loaf=[],this.inpWindow=void 0}onRouteChange(){let e=Ud(zd());e!==this.route&&(this.finalizeRoute(),this.route=e)}installRouteDetection(){let e=typeof window!="undefined"?window:void 0;if(!e)return;let t=()=>this.onRouteChange(),r=e.navigation;if(r&&typeof r.addEventListener=="function"){r.addEventListener("currententrychange",t),this.routeStop=()=>r.removeEventListener("currententrychange",t);return}e.addEventListener("popstate",t);let s=e.history,i=s.pushState,o=s.replaceState,a=c=>function(...l){let u=c.apply(this,l);return t(),u};try{s.pushState=a(i),s.replaceState=a(o)}catch{}this.routeStop=()=>{e.removeEventListener("popstate",t);try{s.pushState=i,s.replaceState=o}catch{}}}emit(e,t,r,s){var o,a,c;let i={kind:"performance",metric:e,value:r==="score"?t:Math.round(t),unit:r,screenName:this.route,clientId:`vit_${q()}`,timestamp:L()};s&&(i.attribution=s),(o=this.ctx)==null||o.emit(i),(c=(a=this.ctx)==null?void 0:a.signal)==null||c.call(a,"web_vital",{metric:e,value:i.value,unit:r,rating:Od(e,i.value),path:this.route})}teardown(){var e;for(let t of this.disconnects)t();this.disconnects=[],this.hideHandler&&typeof document!="undefined"&&document.removeEventListener("visibilitychange",this.hideHandler),(e=this.routeStop)==null||e.call(this),this.routeStop=void 0,this.active=!1}};rr.LOAF_CAP=30;var nr=rr;function zd(){try{return typeof location!="undefined"?location.pathname:"/"}catch{return"/"}}function Ud(n){return n.replace(/\/[0-9a-f]{8,}(?=\/|$)/gi,"/:id").replace(/\/\d+(?=\/|$)/g,"/:id")||"/"}z();Li();z();var Ky=()=>{try{return typeof location!="undefined"?location.pathname:void 0}catch{return}};function Zt(n,e,t={}){var r;return{kind:"performance",metric:K(n),value:Math.round(e*1e3)/1e3,unit:(r=t.unit)!=null?r:"ms",screenName:Ky(),clientId:`perf_${q()}`,...t.duration!=null?{duration:Math.round(t.duration)}:{},...t.metadata?{metadata:t.metadata}:{},timestamp:L()}}var en=class{constructor(e){this.recent=[];this.dropped=0;var t,r;this.capCount=(t=e==null?void 0:e.capCount)!=null?t:60,this.windowMs=(r=e==null?void 0:e.windowMs)!=null?r:1e4}accept(){let e=Date.now();return this.recent=this.recent.filter(t=>e-t<this.windowMs),this.recent.length>=this.capCount?(this.dropped++,!1):(this.recent.push(e),!0)}takeDropped(){let e=this.dropped;return this.dropped=0,e}};var ir=class{constructor(e){this.open=new Map;this.dropped=0;var t,r,s;this.maxOpen=(t=e==null?void 0:e.maxOpen)!=null?t:100,this.ttlMs=(r=e==null?void 0:e.ttlMs)!=null?r:6e4,this.clock=(s=e==null?void 0:e.clock)!=null?s:Date.now}start(e){if(e){if(this.expire(),!this.open.has(e)&&this.open.size>=this.maxOpen){this.dropped++;return}this.open.set(e,this.clock())}}stop(e){this.expire();let t=this.open.get(e);return t==null?null:(this.open.delete(e),{name:e,durationMs:this.clock()-t})}expire(){let e=this.clock();for(let[t,r]of this.open)e-r>this.ttlMs&&(this.open.delete(t),this.dropped++)}takeDropped(){let e=this.dropped;return this.dropped=0,e}clear(){this.open.clear(),this.dropped=0}};z();function Kd(n){var t,r;let e=n;return{value:(t=e.duration)!=null?t:0,metadata:{startTime:Math.round((r=e.startTime)!=null?r:0)}}}function jd(n){var i,o,a,c,l,u,d,p,f,m;let e=n,t=Array.isArray(e.scripts)?e.scripts:[],r;for(let h of t)(!r||((i=h.duration)!=null?i:0)>((o=r.duration)!=null?o:0))&&(r=h);let s={frameDuration:Math.round((a=e.duration)!=null?a:0),startTime:Math.round((c=e.startTime)!=null?c:0)};if(r){let h={url:K(String((u=(l=r.sourceURL)!=null?l:r.name)!=null?u:"")),invoker:K(String((d=r.invoker)!=null?d:"")),duration:Math.round((p=r.duration)!=null?p:0)};r.sourceFunctionName&&(h.fn=String(r.sourceFunctionName)),r.sourceCharPosition!=null&&r.sourceCharPosition>=0&&(h.pos=r.sourceCharPosition),r.forcedStyleAndLayoutDuration&&(h.forcedLayout=Math.round(r.forcedStyleAndLayoutDuration)),r.invokerType&&(h.invokerType=String(r.invokerType)),s.script=h}return{value:(m=(f=e.blockingDuration)!=null?f:e.duration)!=null?m:0,metadata:s}}var jy=new Set(["fetch","xmlhttprequest","beacon"]);function Gy(n){return n.replace(/[?#].*$/,"")}function tn(n,e){return n>0&&e>=n?Math.round(e-n):void 0}var _i="";function Gd(n){_i=(n!=null?n:"").replace(/\/$/,"")}function Yy(n){return!!_i&&n.startsWith(_i)}function Yd(n){if(jy.has(n.initiatorType)||Yy(n.name))return null;let e=Math.round(n.duration);if(e<=0)return null;let t={kind:"resource",initiator:n.initiatorType,url:Gy(n.name)},r=(i,o)=>{o!==void 0&&o>0&&(t[i]=o)};r("dns",tn(n.domainLookupStart,n.domainLookupEnd)),r("tcp",tn(n.connectStart,n.connectEnd)),r("tls",n.secureConnectionStart>0?tn(n.secureConnectionStart,n.connectEnd):void 0),r("ttfb",tn(n.requestStart,n.responseStart)),r("download",tn(n.responseStart,n.responseEnd)),r("transferSize",n.transferSize||void 0),r("encodedSize",n.encodedBodySize||void 0),r("decodedSize",n.decodedBodySize||void 0);let s=n.renderBlockingStatus;return s&&(t.renderBlocking=s),{value:e,metadata:t}}function Xd(n){if(typeof window=="undefined"||typeof history=="undefined"||typeof location=="undefined")return()=>{};let e=()=>location.pathname+location.search,t=e(),r=()=>{let o=e();if(o!==t){t=o;try{n(o)}catch{}}},s=history.pushState,i=history.replaceState;return history.pushState=function(...a){let c=s.apply(this,a);return r(),c},history.replaceState=function(...a){let c=i.apply(this,a);return r(),c},window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{history.pushState=s,history.replaceState=i,window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}}Fe();var Xy="wzb-traces-v1";function Jd(n){return n.durationMs>=n.slowMs||n.hasError||n.sampleRate>=1?!0:n.sampleRate<=0?!1:Ee(`${n.traceId}:${Xy}`)%100<n.sampleRate*100}cr();var Qy=1e3,Zy=3e3,ev=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now();function tv(){try{let n=typeof PerformanceObserver!="undefined"&&PerformanceObserver.supportedEntryTypes;return Array.isArray(n)&&n.includes("long-animation-frame")}catch{return!1}}var ur=class{constructor(){this.name="performance";this.ctx=null;this.active=!1;this.disconnects=[];this.cap=new en;this.resCap=new en({capCount:100,windowMs:1e4});this.traces=new ir;this.pageloadEmitted=!1;this.tracesSampleRate=1;this.slowTxnMs=Zy;this.droppedTxns=0;this.txnCount=0;this.resourceCount=0;this.jankCount=0}get isActive(){return this.active}setup(e){if(this.active)return;this.ctx=e,Gd(e.apiBaseUrl);let t=e.performanceOptions;t&&(typeof t.tracesSampleRate=="number"&&(this.tracesSampleRate=t.tracesSampleRate),typeof t.slowTransactionMs=="number"&&(this.slowTxnMs=t.slowTransactionMs)),Promise.resolve().then(()=>(iu(),su)).then(s=>{this.engine=s,this.tryEmitPageload()}).catch(()=>{});let r=()=>{var i,o;let s=(o=(i=performance.getEntriesByType)==null?void 0:i.call(performance,"navigation"))==null?void 0:o[0];s&&(this.navEntry=s,this.tryEmitPageload())};if(typeof document!="undefined"&&document.readyState==="complete"?r():typeof window!="undefined"&&window.addEventListener("load",()=>setTimeout(r,0),{once:!0}),this.disconnects.push(Xd(s=>this.onRouteChange(s))),typeof window!="undefined"){let s=()=>this.finishRouteTxn();window.addEventListener("pagehide",s),this.disconnects.push(()=>window.removeEventListener("pagehide",s))}if(e.onSignal&&this.disconnects.push(e.onSignal(s=>{var i;s==="error"&&((i=this.activeTxn)==null||i.noteError())})),typeof PerformanceObserver=="undefined"){this.active=!0;return}tv()?this.disconnects.push(Pe("long-animation-frame",s=>{for(let i of s)this.emitCapped("loaf",i,jd(i))})):this.disconnects.push(Pe("longtask",s=>{for(let i of s)this.emitCapped("longtask",i,Kd(i))})),this.disconnects.push(Pe("resource",s=>{for(let i of s){let o=Yd(i);o&&this.emitResource(o)}})),this.active=!0}emitResource(e){var s;if(!this.resCap.accept())return;let t=this.resCap.takeDropped(),r=t>0?{...e.metadata,droppedSince:t}:e.metadata;this.resourceCount++,(s=this.ctx)==null||s.emit(Zt("resource",e.value,{unit:"ms",duration:e.value,metadata:r}))}perfStats(){return{transactions:this.txnCount,droppedTransactions:this.droppedTxns,resources:this.resourceCount,jank:this.jankCount,activeTransaction:!!this.activeTxn,sampleRate:this.tracesSampleRate}}emitCapped(e,t,r){var a,c,l;if(!this.cap.accept())return;let s=this.cap.takeDropped(),i=s>0?{...r.metadata,droppedSince:s}:r.metadata;this.jankCount++,(a=this.ctx)==null||a.emit(Zt(e,r.value,{unit:"ms",metadata:i}));let o=i.script;Vd({metric:e,blockingMs:r.value,frameDurationMs:e==="loaf"?Number((c=i.frameDuration)!=null?c:t.duration):t.duration,script:o?{url:o.url,invoker:o.invoker}:void 0}),(l=this.activeTxn)==null||l.addSpan(e,t.startTime,t.startTime+t.duration,r.metadata)}startTransaction(e){if(!this.engine)return ar;let t=new this.engine.Transaction(e,{clock:ev,onFinish:r=>this.emitTransaction(r)});return this.activeTxn=t,t}getActiveTraceContext(){var e;return(e=this.activeTxn)==null?void 0:e.context()}emitTransaction(e){this.activeTxn===e&&(this.activeTxn=void 0),this.emitTransactionData(e.data())}emitTransactionData(e){var r,s,i,o;if(e.durationMs>=this.slowTxnMs&&((s=(r=this.ctx)==null?void 0:r.signal)==null||s.call(r,"slow_screen")),!Jd({traceId:e.traceId,durationMs:e.durationMs,slowMs:this.slowTxnMs,sampleRate:this.tracesSampleRate,hasError:((i=e.errorCount)!=null?i:0)>0})){this.droppedTxns++;return}this.txnCount++;let t=Z();(o=this.ctx)==null||o.emit(Zt("transaction",e.durationMs,{unit:"ms",duration:e.durationMs,metadata:{kind:"transaction",name:e.name,trace:{traceId:e.traceId,spanId:e.spanId,sampled:e.sampled},spans:e.spans,...e.droppedSpans?{droppedSpans:e.droppedSpans}:{},...e.errorCount?{errorCount:e.errorCount}:{},...t?{replay:t}:{}}}))}tryEmitPageload(){if(this.pageloadEmitted||!this.engine||!this.navEntry||!this.navEntry.loadEventEnd)return;this.pageloadEmitted=!0;let e=typeof location!="undefined"?location.pathname:"/";this.emitTransactionData(this.engine.buildPageload(this.navEntry,e))}onRouteChange(e){this.finishRouteTxn(),this.routeTxn=this.startTransaction(`navigation ${e}`),typeof setTimeout!="undefined"&&(this.routeTimer=setTimeout(()=>this.finishRouteTxn(),Qy))}finishRouteTxn(){var e;this.routeTimer!==void 0&&(clearTimeout(this.routeTimer),this.routeTimer=void 0),(e=this.routeTxn)==null||e.finish(),this.routeTxn=void 0}startTrace(e){this.traces.start(e)}stopTrace(e){var r;let t=this.traces.stop(e);t&&((r=this.ctx)==null||r.emit(Zt(t.name,t.durationMs,{unit:"ms",duration:t.durationMs,metadata:{kind:"trace"}})))}teardown(){this.finishRouteTxn();for(let e of this.disconnects)e();this.disconnects=[],this.traces.clear(),this.active=!1}};z();var fr=class{constructor(e){this.onScreen=e;this.last="";this.cleanup=[]}start(){if(typeof window!="undefined"){if(typeof document!="undefined"&&document.prerendering){let e=()=>this.begin();document.addEventListener("prerenderingchange",e,{once:!0}),this.cleanup.push(()=>document.removeEventListener("prerenderingchange",e));return}this.begin()}}begin(){this.last=pr(),this.onScreen("",this.last);let e=window.navigation;if(e&&typeof e.addEventListener=="function"){let a=c=>{var u;let l=(u=c.destination)==null?void 0:u.url;this.check(l?nv(l):pr())};e.addEventListener("navigate",a),this.cleanup.push(()=>e.removeEventListener("navigate",a))}let t=history,r=t.pushState,s=t.replaceState,i=()=>this.check();t.pushState=function(...a){let c=r.apply(this,a);return i(),c},t.replaceState=function(...a){let c=s.apply(this,a);return i(),c},this.cleanup.push(()=>{t.pushState=r,t.replaceState=s});let o=()=>this.check();window.addEventListener("popstate",o),window.addEventListener("pageshow",o),this.cleanup.push(()=>{window.removeEventListener("popstate",o),window.removeEventListener("pageshow",o)})}check(e=pr()){if(e&&e!==this.last){let t=this.last;this.last=e,this.onScreen(t,e)}}stop(){for(let e of this.cleanup)e();this.cleanup=[]}};function pr(){try{return typeof location!="undefined"?location.pathname:""}catch{return""}}function nv(n){try{return new URL(n).pathname}catch{return pr()}}var mr=class{constructor(e=800,t=30,r=3){this.windowMs=e;this.radius=t;this.min=r;this.history=[]}push(e,t,r){this.history=this.history.filter(i=>r-i.t<this.windowMs);let s=this.history.filter(i=>Math.hypot(i.x-e,i.y-t)<=this.radius);return this.history.push({x:e,y:t,t:r}),s.length+1>=this.min}},hr=class{constructor(e=700){this.deadMs=e;this.changeVersion=0;this.observer=null;this.timers=new Set}observe(e){typeof MutationObserver!="undefined"&&(this.observer=new MutationObserver(()=>{this.changeVersion++}),this.observer.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}))}onClick(e){let t=this.changeVersion,r=ou(),s=setTimeout(()=>{this.timers.delete(s),e(this.changeVersion===t&&ou()===r)},this.deadMs);this.timers.add(s)}disconnect(){var e;(e=this.observer)==null||e.disconnect(),this.observer=null;for(let t of this.timers)clearTimeout(t);this.timers.clear()}};function ou(){try{return typeof location!="undefined"?location.href:""}catch{return""}}var Ni=n=>!!n&&n!=="none",rv=n=>Ni(n.transform)||Ni(n.filter)||Ni(n.perspective)||/transform|filter|perspective/.test(n.willChange||"")||/paint|layout|strict|content/.test(n.contain||"");function au(n){let e=0,t=!1,r=!1;for(let s=n;s;s=s.parentElement){let i=getComputedStyle(s);if(t){if(rv(i))return 0}else i.position==="fixed"?t=!0:i.position==="sticky"?(e=2,r=!0):r&&/auto|scroll|hidden|clip/.test(i.overflowY||"")&&(r=!1,s.scrollHeight<=s.clientHeight&&(e=0))}return t?1:e}z();var gr=class{constructor(e,t={},r){this.emit=e;this.signal=r;this.pending=new Map;var s,i,o,a,c;this.rage=new mr((s=t.rageWindowMs)!=null?s:800,(i=t.rageRadius)!=null?i:30,(o=t.rageMin)!=null?o:3),this.dead=new hr((a=t.deadMs)!=null?a:700),this.maskText=(c=t.maskText)!=null?c:!1}start(){typeof document!="undefined"&&(this.dead.observe(document),this.onPointerDownFn=e=>{let t=e;if(t.isPrimary===!1||typeof t.button=="number"&&t.button!==0)return;let r=cu(e);r&&(this.pointerDown=lu(r,t,Date.now(),this.maskText))},this.onClickFn=e=>{var a;let t=e,r=cu(e);if(!r)return;let s=this.pointerDown;this.pointerDown=void 0;let i=t.detail!==0&&s&&s.target===r&&Date.now()-s.timestamp<5e3?s:lu(r,t,Date.now(),this.maskText),o=this.rage.push(i.x,i.y,i.timestamp);o&&(i.data.rage=!0),o&&((a=this.signal)==null||a.call(this,"rage")),this.pending.set(i.interactionId,i),this.dead.onClick(c=>{var l;this.finish(i.interactionId,c),c&&((l=this.signal)==null||l.call(this,"dead"))})},this.onPageHideFn=()=>this.flushPending(),document.addEventListener("pointerdown",this.onPointerDownFn,!0),document.addEventListener("click",this.onClickFn,!0),typeof window!="undefined"&&window.addEventListener("pagehide",this.onPageHideFn,!0))}stop(){this.flushPending(),this.dead.disconnect(),typeof document!="undefined"&&(this.onPointerDownFn&&document.removeEventListener("pointerdown",this.onPointerDownFn,!0),this.onClickFn&&document.removeEventListener("click",this.onClickFn,!0)),this.onPageHideFn&&typeof window!="undefined"&&window.removeEventListener("pagehide",this.onPageHideFn,!0),this.pointerDown=void 0}finish(e,t){let r=this.pending.get(e);r&&(this.pending.delete(e),t===!0?r.data.dead=!0:t===void 0&&(r.data.deadUnknown=!0),this.emit("USER_ACTION",r.data,r.label,{interactionId:e,timestamp:r.timestamp,route:r.route}))}flushPending(){for(let e of[...this.pending.keys()])this.finish(e,void 0)}};function cu(n){var t;let e=n.target;if(!e||!e.tagName)return null;if(!e.hasAttribute("data-scalebun")){let r=(t=n.composedPath)==null?void 0:t.call(n)[0];r&&r.tagName&&(e=r)}return e}function lu(n,e,t,r){let s=wn(),i={action:"click",...sv(e),selector:dv(n),...ov(n,r),state_status:s?"captured_nonempty":"captured_empty"};s&&(i.ui=s);let o=Z();return o&&(i.replayCoord=o),{target:n,x:e.clientX,y:e.clientY,data:i,label:lv(n,r),interactionId:`ixw-${q()}`,timestamp:t,route:uv()}}function sv(n){var t,r,s;let e=typeof window!="undefined"?window:void 0;return{x:n.clientX,y:n.clientY,vw:(t=e==null?void 0:e.innerWidth)!=null?t:0,vh:(r=e==null?void 0:e.innerHeight)!=null?r:0,sx:e?Math.round(e.scrollX):0,sy:e?Math.round(e.scrollY):0,dh:document.documentElement.scrollHeight,dpr:(s=e==null?void 0:e.devicePixelRatio)!=null?s:1}}function iv(n,e){let t=(n.getAttribute("href")||"").replace(/[?#].*$/,"");if(t)return"h"+t;let r=(n.getAttribute("aria-label")||(e?"":n.textContent)||"").trim();if(r&&r.length<33&&!/@|\d{4,}/.test(r))return"a"+r;let s=n.getAttribute("type");return s?"y"+s:void 0}function ov(n,e){var a;let t=n.getBoundingClientRect(),r={ex:t.x|0,ey:t.y|0,ew:t.width|0,eh:t.height|0},s=au(n);s&&(r.fx=s),r.path=av(n);let i=iv(n,e);i&&(r.cx=i);let o=(a=n.closest("[data-scalebun-component]"))==null?void 0:a.getAttribute("data-scalebun-component");return o&&(r.component=o),r}function av(n){let e=[],t=n;for(let r=0;t&&r<6;r++){let s=t.tagName.toLowerCase();if(s==="html"||s==="body")break;if(t.id){e.unshift(`${s}#${t.id}`);break}let i=t.parentElement;if(i){let o=0,a=0,c=i.children,l=t;for(let u=0;u<c.length;u++){let d=c[u];!d||d.tagName!==l.tagName||(a++,d===l&&(o=a))}e.unshift(a>1?`${s}:nth-of-type(${o})`:s)}else e.unshift(s);t=i}return e.join(">")}var cv=n=>n.replace(/\S/g,"*");function lv(n,e=!1){let t=n.tagName.toLowerCase(),r=(n.textContent||"").trim().slice(0,40);return r?`${t}: ${e?cv(r):r}`:t}function dv(n){let e=n.tagName.toLowerCase();n.id&&(e+=`#${n.id}`);let t=(n.getAttribute("class")||"").trim().split(/\s+/).filter(Boolean).slice(0,2);return t.length&&(e+="."+t.join(".")),e}function uv(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}var br=class{constructor(){this.name="journey";this.ctx=null;this.active=!1}get isActive(){return this.active}setup(e){this.ctx=e,!(typeof window=="undefined"||typeof document=="undefined")&&(this.nav=new fr((t,r)=>this.emit("SCREEN_VIEW",{from:t,to:r},void 0,r)),Rc(wn),this.interactions=new gr((t,r,s,i)=>{var o;return this.emit(t,r,s,(o=i==null?void 0:i.route)!=null?o:du(),i)},{maskText:e.maskEventText===!0},t=>{var r;return(r=this.ctx)==null?void 0:r.signal(t)}),this.nav.start(),this.interactions.start(),this.active=!0)}emit(e,t,r,s,i){var c,l;let o=t.replayCoord?void 0:Z(),a={kind:"event",name:e,props:o?{...t,replayCoord:o}:t,label:r,screenName:s!=null?s:du(),eventId:`evt_${q()}`,timestamp:(c=i==null?void 0:i.timestamp)!=null?c:L(),interactionId:i==null?void 0:i.interactionId,interactionProtocol:i?1:void 0};(l=this.ctx)==null||l.emit(a)}teardown(){var e,t;(e=this.nav)==null||e.stop(),(t=this.interactions)==null||t.stop(),this.active=!1}};function du(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}Fs();z();var pv={maxDepth:4,maxBreadth:50,maxLength:8192};function Bi(n,e,t,r){if(n===null)return"null";if(n===void 0)return"undefined";let s=typeof n;if(s==="string")return n;if(s==="number"||s==="boolean"||s==="bigint")return String(n);if(s==="symbol")return n.toString();if(s==="function"){let o=n.name;return`[Function${o?`: ${o}`:""}]`}let i=n;if(t.has(i))return"[Circular]";if(n instanceof Error)return`${n.name}: ${n.message}`;if(e>=r.maxDepth)return Array.isArray(n)?"[Array]":"[Object]";t.add(i);try{if(Array.isArray(n)){let d=n.slice(0,r.maxBreadth).map(f=>Bi(f,e+1,t,r)),p=n.length>r.maxBreadth?`, \u2026(+${n.length-r.maxBreadth} more)`:"";return`[${d.join(", ")}${p}]`}if(n instanceof Map)return`Map(${n.size})`;if(n instanceof Set)return`Set(${n.size})`;let o=n.nodeName;if(typeof o=="string"){let d=n.id;return`<${o.toLowerCase()}${d?` #${String(d)}`:""}>`}let a=Object.keys(n),l=a.slice(0,r.maxBreadth).map(d=>{let p=Bi(n[d],e+1,t,r);return`${d}: ${p}`}),u=a.length>r.maxBreadth?`, \u2026(+${a.length-r.maxBreadth} more)`:"";return`{${l.join(", ")}${u}}`}finally{t.delete(i)}}function uu(n,e){let t={...pv,...e},r;try{r=n.map(s=>Bi(s,0,new WeakSet,t)).join(" ")}catch{r="[unserializable console arguments]"}return r.length>t.maxLength&&(r=r.slice(0,t.maxLength)+"\u2026(truncated)"),r}function pu(n){for(let e of n)if(e instanceof Error&&e.stack)return e.stack.slice(0,4*1024)}function Fi(n){switch(n){case"debug":return"debug";case"warn":return"warn";case"error":return"error";case"info":case"log":default:return"info"}}var fv=()=>{try{return typeof location!="undefined"?location.pathname:void 0}catch{return}};function fu(n,e,t=0){let r=Fi(n),s=K(uu(e)),i={method:n},o=fv();if(o&&(i.screen=o),r==="warn"||r==="error"){let a=pu(e);a&&(i.stack=K(a))}return t>0&&(i.droppedSince=t),{kind:"log",level:r,message:s,source:"console",platform:"js",logId:`log_${q()}`,metadata:i,timestamp:L()}}var yr=class{constructor(e){this.recent=[];this.dropped=0;var t,r;this.capCount=(t=e==null?void 0:e.capCount)!=null?t:100,this.capWindowMs=(r=e==null?void 0:e.capWindowMs)!=null?r:1e4}accept(e){if(e==="warn"||e==="error")return!0;let t=Date.now();return this.recent=this.recent.filter(r=>t-r<this.capWindowMs),this.recent.length>=this.capCount?(this.dropped++,!1):(this.recent.push(t),!0)}takeDropped(){let e=this.dropped;return this.dropped=0,e}};var mv=["debug","info","log","warn","error"],hv=50,vr=class{constructor(){this.name="console";this.ctx=null;this.active=!1;this.throttle=new yr;this.originals=new Map;this.capturing=!1;this.ring=[]}get isActive(){return this.active}setup(e){if(!this.active&&(this.ctx=e,typeof console!="undefined")){for(let t of mv){let r=console[t];if(typeof r!="function")continue;this.originals.set(t,r);let s=(...i)=>{try{r.apply(console,i)}catch{}this.capture(t,i)};console[t]=s}this.active=!0}}capture(e,t){var r;if(!this.capturing&&!(t.length>0&&t[0]===Bs)){this.capturing=!0;try{if(!this.throttle.accept(Fi(e)))return;let s=fu(e,t,this.throttle.takeDropped());this.pushRing(s),(r=this.ctx)==null||r.emit(s)}catch{}finally{this.capturing=!1}}}pushRing(e){this.ring.push(e),this.ring.length>hv&&this.ring.shift()}getRecent(){return this.ring.slice()}teardown(){if(typeof console!="undefined")for(let[e,t]of this.originals)console[e]=t;this.originals.clear(),this.ring.length=0,this.active=!1}};var wr=class{constructor(){this.name="bugReport";this.ctx=null;this.active=!1;this.submitFn=null;this.widget=null;this.mounting=!1}get isActive(){return this.active}setup(e){this.ctx=e,this.active=!0}signalReport(){var e;(e=this.ctx)==null||e.signal("report")}setSubmit(e){this.submitFn=e}async mountLauncher(e){if(!(this.widget||this.mounting||typeof document=="undefined")){this.mounting=!0;try{let{createBugReportWidget:t}=await Promise.resolve().then(()=>(gu(),hu));if(this.widget)return;this.widget=t({position:e.position,label:e.label,onSubmit:r=>this.submitFn?this.submitFn(r):Promise.resolve({e:"init"})})}catch{}finally{this.mounting=!1}}}teardown(){var e;(e=this.widget)==null||e.destroy(),this.widget=null,this.submitFn=null,this.active=!1}};z();var bu="scalebun:tab",yu="scalebun:live:";function qi(){try{return typeof localStorage!="undefined"?localStorage:null}catch{return null}}function wv(){try{return typeof sessionStorage!="undefined"?sessionStorage:null}catch{return null}}function Di(){try{let n=globalThis.crypto;if(n&&typeof n.randomUUID=="function")return n.randomUUID()}catch{}return`${Date.now().toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}function vu(){let n=wv();if(!n)return`mem-${Di()}`;try{let e=n.getItem(bu);if(e)return e;let t=Di();return n.setItem(bu,t),t}catch{return`mem-${Di()}`}}var Hi=n=>`${yu}${n}`;function xr(n){let e=qi();if(!e)return null;try{let t=e.getItem(Hi(n));if(!t)return null;let r=JSON.parse(t);return r&&r.v===1&&typeof r.sessionId=="string"?r:null}catch{return null}}function Sr(n,e){let t=qi();if(t)try{t.setItem(Hi(n),JSON.stringify(e))}catch{}}function kr(n,e){let t=xr(n);t&&(t.ended=e,t.lastActive=Date.now(),Sr(n,t))}function wu(n){let e=xr(n);e&&(e.lastActive=Date.now(),Sr(n,e))}function xu(n,e){let t=qi();if(t)try{let r=[];for(let s=0;s<t.length;s++){let i=t.key(s);if(!(!i||!i.startsWith(yu)||i===Hi(n)))try{let o=JSON.parse(t.getItem(i)||"{}");o&&(o.ended||e-(o.lastActive||0)>864e5)&&r.push(i)}catch{r.push(i)}}for(let s of r)t.removeItem(s)}catch{}}var xv=15e3,Er=class{constructor(){this.name="crash";this.ctx=null;this.active=!1;this.tabId=""}get isActive(){return this.active}setup(e){var t;this.ctx=e,typeof window!="undefined"&&(this.installReportingObserver(),this.installLiveness((t=e.sessionId)!=null?t:`sess_${q()}`),this.active=!0)}installReportingObserver(){let e=globalThis.ReportingObserver;if(e)try{this.observer=new e(t=>{for(let r of t)this.handleReport(r)},{buffered:!0}),this.observer.observe()}catch{}}handleReport(e){var o,a,c,l,u,d,p,f;if(e.type==="deprecation")return;let t=(o=e.body)!=null?o:{},r=e.type==="crash",s=r?`Browser crash report: ${(a=t.reason)!=null?a:"unknown"}`:(c=t.message)!=null?c:`${e.type} report`,i=t.sourceFile?`${t.sourceFile}:${(l=t.lineNumber)!=null?l:0}:${(u=t.columnNumber)!=null?u:0}`:void 0;this.emitError({type:r?"crash":"handled",message:s,stack:i,fingerprint:`report:${e.type}:${(p=(d=t.reason)!=null?d:t.id)!=null?p:s}`.slice(0,180),metadata:{reportType:e.type,reason:t.reason,anticipated:t.anticipated,url:e.url}}),r&&((f=this.ctx)==null||f.signal("error"))}installLiveness(e){var s;this.tabId=vu();let t=xr(this.tabId);t&&!t.ended&&t.sessionId!==e&&this.emitRecoveredCrash(t);let r=L();Sr(this.tabId,{v:1,sessionId:e,startedAt:r,lastActive:r,screen:(s=Su())!=null?s:"",ended:!1}),xu(this.tabId,r),this.onHide=()=>kr(this.tabId,!0),this.onShow=()=>kr(this.tabId,!1),window.addEventListener("pagehide",this.onHide),window.addEventListener("pageshow",this.onShow),this.heartbeat=setInterval(()=>wu(this.tabId),xv)}emitRecoveredCrash(e){var s,i,o;let t=Math.max(0,e.lastActive-e.startedAt),r=this.buildError({type:"crash",message:"Session ended abnormally (tab crash, OOM, or forced close \u2014 no graceful shutdown)",fingerprint:"session-abnormal-termination",screenName:e.screen||void 0,metadata:{reason:"unfinalized-session",priorSessionId:e.sessionId,durationMs:t,lastScreen:e.screen},timestamp:e.lastActive});if((s=this.ctx)!=null&&s.emitFor){this.ctx.emitFor(e.sessionId,r);return}(i=this.ctx)==null||i.emit({...r,type:"handled"}),(o=this.ctx)==null||o.signal("error")}buildError(e){var t,r;return{kind:"error",type:e.type,message:K(e.message),stack:e.stack,source:"js",fingerprint:e.fingerprint,screenName:(t=e.screenName)!=null?t:Su(),clientId:`crash_${q()}`,timestamp:(r=e.timestamp)!=null?r:L(),...e.metadata?{metadata:e.metadata}:{}}}emitError(e){var t;(t=this.ctx)==null||t.emit(this.buildError(e))}teardown(){if(this.observer){try{this.observer.disconnect()}catch{}this.observer=void 0}this.heartbeat&&clearInterval(this.heartbeat),this.heartbeat=void 0,typeof window!="undefined"&&(this.onHide&&window.removeEventListener("pagehide",this.onHide),this.onShow&&window.removeEventListener("pageshow",this.onShow)),this.tabId&&kr(this.tabId,!0),this.active=!1}};function Su(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}z();Kt();var Sv=50,Ir=class{constructor(e,t){this.apiBaseUrl=e;this.clientKey=t;this.buffer=new Be("engage-pending")}headers(){return{"content-type":"application/json","x-scalebun-client-key":this.clientKey}}get usable(){return!!this.clientKey&&!!this.apiBaseUrl&&typeof fetch!="undefined"}async fetchConfig(e){if(!this.usable)return null;let t=new URLSearchParams;e.platform&&t.set("platform",e.platform),e.appVersion&&t.set("appVersion",e.appVersion),e.deviceId&&t.set("deviceId",e.deviceId),e.endUserId&&t.set("endUserId",e.endUserId);try{let r=await fetch(`${this.apiBaseUrl}/sdk/engage/config?${t.toString()}`,{headers:this.headers(),cache:"no-store"});return r.ok?await r.json():null}catch{return null}}postImpressions(e){return this.post("/sdk/engage/surveys/impressions",{schemaVersion:1,impressions:e})}postResponses(e){return this.postWithRetry("/sdk/engage/responses",{schemaVersion:1,responses:e})}postEvents(e){return this.post("/sdk/engage/events",{schemaVersion:1,events:e})}postRatingEvents(e){return this.postWithRetry("/ingestion/rating-events",{schemaVersion:1,events:e})}async presignAttachments(e){if(!this.usable)return null;try{let t=await fetch(`${this.apiBaseUrl}/sdk/engage/attachments/presign`,{method:"POST",headers:this.headers(),body:JSON.stringify({schemaVersion:1,attachments:e})});return t.ok?await t.json():null}catch{return null}}async putBlob(e,t,r){if(typeof fetch=="undefined")return!1;try{return(await fetch(e,{method:"PUT",body:t,headers:{"content-type":r}})).ok}catch{return!1}}async post(e,t){if(!this.usable)return!1;try{return(await fetch(`${this.apiBaseUrl}${e}`,{method:"POST",headers:this.headers(),body:JSON.stringify(t),keepalive:!0})).ok}catch{return!1}}async postWithRetry(e,t,r=3,s=800){for(let i=0;i<r;i++){if(await this.post(e,t))return!0;i<r-1&&await new Promise(o=>setTimeout(o,s*2**i))}return await this.park(e,t),!1}async park(e,t){try{let s=[...await this.buffer.load(),{path:e,body:t}].slice(-Sv);await this.buffer.save(s)}catch{}}async flushParked(){if(!this.usable)return;let e;try{e=await this.buffer.load()}catch{return}if(!e.length)return;let t=[];for(let r of e)!r||typeof r.path!="string"||await this.post(r.path,r.body)||t.push(r);await this.buffer.save(t)}};var kS=32,ES=3e4,vm="scalebun_engage_sessions";function wm(){try{return typeof location!="undefined"?location.pathname:""}catch{return""}}function IS(n){let e=n,t=r=>Array.isArray(r)?r.length:0;return!!e&&(t(e.campaigns)>0||t(e.inAppMessages)>0)}var ds=class{constructor(){this.name="engage";this.ctx=null;this.active=!1;this.screen="";this.buffer=[];this.bufferOpen=!0}get isActive(){return this.active}async setup(e){var i;if(this.ctx=e,typeof window=="undefined"||typeof document=="undefined")return;let t=(i=e.clientKey)!=null?i:"";if(!t||!e.apiBaseUrl)return;this.transport=new Ir(e.apiBaseUrl,t),this.screen=wm(),this.active=!0,this.transport.flushParked(),this.unsub=e.onSignal(o=>this.onSignal(o)),this.onPop=()=>this.onScreenView(wm()),window.addEventListener("popstate",this.onPop);let{count:r,isNewSession:s}=this.bumpSessionCount();s&&(this.onLifecycle("session_start"),this.onLifecycle("app_open"),this.onLifecycle("n_sessions",r)),await this.refresh()}async refresh(){var i,o,a,c,l,u;if(!this.transport)return;let e=await this.transport.fetchConfig({platform:"web",appVersion:(i=this.ctx)==null?void 0:i.appVersion,deviceId:(o=this.ctx)==null?void 0:o.deviceId,endUserId:(c=(a=this.ctx)==null?void 0:a.getUserId)==null?void 0:c.call(a)});if(!IS(e)){(l=this.runtime)==null||l.setCampaigns([]),(u=this.runtime)==null||u.setMessages([]),this.closeBuffer();return}let{normalizeConfig:t}=await Promise.resolve().then(()=>(Vi(),Au)),r=t(e),s=await this.ensureRuntime();s&&(s.setCampaigns(r.campaigns),s.setMessages(r.inAppMessages),this.drain(s))}async ensureRuntime(){var t,r,s,i,o;if(this.runtime)return this.runtime;if(!this.transport)return;let{EngageRuntime:e}=await Promise.resolve().then(()=>(ym(),bm));return this.runtime=new e({transport:this.transport,deviceId:(r=(t=this.ctx)==null?void 0:t.deviceId)!=null?r:"",sessionId:(i=(s=this.ctx)==null?void 0:s.sessionId)!=null?i:"",uuid:q,now:L,currentScreen:()=>this.screen,replayCoord:Z,signal:a=>{var c;return(c=this.ctx)==null?void 0:c.signal(a)},...(o=this.ctx)!=null&&o.onInAppGameRequest?{gameHandler:this.ctx.onInAppGameRequest}:{}}),this.runtime}async submit(e,t){let r=await this.ensureRuntime();return r?r.submitFor(e,t):"error"}emitRatingEvent(e,t){this.ensureRuntime().then(r=>r==null?void 0:r.emitRatingEvent(e,t))}async resetInAppState(){let{clearEngageState:e}=await Promise.resolve().then(()=>(Xi(),Nu));e()}onScreenView(e){this.screen=e,this.feed("screen",e)}onIdentify(){this.active&&this.refresh()}onCustomEvent(e){this.feed("custom",e)}onSignal(e){this.feed("signal",e)}onLifecycle(e,t){this.feed("lifecycle",e,t)}feed(e,t,r){if(this.runtime){this.dispatch(this.runtime,e,t,r,0);return}this.bufferOpen&&(this.buffer.push({ch:e,value:t,arg:r,at:L()}),this.buffer.length>kS&&this.buffer.shift())}dispatch(e,t,r,s,i){switch(t){case"screen":e.onScreenView(r,i);break;case"custom":e.onCustomEvent(r,i);break;case"signal":e.onSignal(r,i);break;case"lifecycle":e.onLifecycle(r,s,i);break}}drain(e){let t=L()-ES;for(let r of this.buffer)r.at<t||this.dispatch(e,r.ch,r.value,r.arg,L()-r.at);this.closeBuffer()}closeBuffer(){this.bufferOpen=!1,this.buffer=[]}bumpSessionCount(){var e,t;try{let r=(t=(e=this.ctx)==null?void 0:e.sessionId)!=null?t:"",s=localStorage.getItem(vm),i=s?JSON.parse(s):{};if(r&&i.sessionId===r&&typeof i.count=="number")return{count:i.count,isNewSession:!1};let o=(typeof i.count=="number"?i.count:0)+1;return localStorage.setItem(vm,JSON.stringify({sessionId:r,count:o})),{count:o,isNewSession:!0}}catch{return{count:1,isNewSession:!0}}}teardown(){var e,t;(e=this.unsub)==null||e.call(this),this.unsub=void 0,this.onPop&&typeof window!="undefined"&&window.removeEventListener("popstate",this.onPop),this.onPop=void 0,(t=this.runtime)==null||t.stop(),this.runtime=void 0,this.closeBuffer(),this.active=!1}};z();Go();function RS(){try{return typeof location!="undefined"?location.pathname:void 0}catch{return}}var us=class{constructor(){this.name="webPerf";this.ctx=null;this.active=!1}get isActive(){return this.active}async setup(e){if(this.ctx=e,typeof window=="undefined"||typeof performance=="undefined")return;this.active=!0;let{startCollectors:t}=await Promise.resolve().then(()=>(km(),Sm));this.active&&(this.stop=t((r,s,i,o)=>this.emit(r,s,i,o),()=>this.active))}emit(e,t,r,s){var i;(i=this.ctx)==null||i.emit({kind:"performance",metric:e,value:t,screenName:RS(),...s!=null?{duration:s}:{},metadata:r,clientId:`pw_${q()}`,timestamp:L()})}teardown(){var e;this.active=!1,(e=this.stop)==null||e.call(this),this.stop=void 0}};var fs=class{constructor(){this.name="exitIntent";this.active=!1}get isActive(){return this.active}async setup(e){if(typeof window=="undefined"||typeof document=="undefined")return;this.active=!0;let{startExitIntent:t}=await Promise.resolve().then(()=>(Pm(),Mm));this.active&&(this.handle=t(e,e.exitIntent))}teardown(){var e;this.active=!1,(e=this.handle)==null||e.stop(),this.handle=void 0}};var mg=[new Wn,new zn,new jn,new tr,new nr,new us,new ur,new br,new vr,new wr,new Er,new ds,new fs],hg={replay:async()=>new(await Promise.resolve().then(()=>(gh(),hh))).ReplayFeature,inbox:async()=>new(await Promise.resolve().then(()=>(Ah(),Ch))).InboxFeature,profiler:async()=>new(await Promise.resolve().then(()=>(Rh(),Th))).ProfilerFeature,watchdog:async()=>new(await Promise.resolve().then(()=>(Wh(),Vh))).WatchdogFeature,inapp2:async()=>new(await Promise.resolve().then(()=>(fg(),pg))).InApp2Feature},s0={config:["network"],analytics:["network"],errors:["dom"],network:["dom"],webVitals:["performanceObserver"],webPerf:["performanceObserver"],performance:["performance"],journey:["dom"],console:["dom"],bugReport:["dom"],crash:["dom"],engage:["dom"],inbox:["dom"],profiler:["dom"],watchdog:["performanceObserver"],exitIntent:["dom"],inapp2:["dom"],replay:["dom"]};function Ua(n){var e;return(e=s0[n])!=null?e:["dom"]}z();var i0=6e4;function o0(n){return n==="frame"?"replay":n==="network"?"networkMonitoring":n==="error"?"crashReporting":n==="performance"||n==="resource"||n==="trace"||n==="transaction"?"performanceMonitoring":""}var mn=class{static async bootstrap(e,t){var w,v,E,C;let r=sc(e),s=cc(r.debug),i=new An(r),o=new Tn(r),a=new On(r,i,o);t!=null&&t.edge&&a.setConsentGranted(!1);let c=new Nn;Ws(),Ks(),typeof((w=r.errors)==null?void 0:w.maxBreadcrumbs)=="number"&&We.setMax(r.errors.maxBreadcrumbs),Sc((v=r.errors)==null?void 0:v.beforeBreadcrumb);let l=I=>{var T,A;let R=o0(I.kind);R&&((A=(T=c.get("config"))==null?void 0:T.entitlement)==null?void 0:A.call(T,R))===!1||(Ic(I),Ac(I),a.emit(I))},u=new Set,d={sessionId:i.sessionId,clientKey:r.clientKey,deviceId:i.deviceId,appVersion:r.appVersion,getUserId:()=>{var I,R;return(R=(I=c.get("analytics"))==null?void 0:I.identity)==null?void 0:R.userId},emit:l,emitFor:(I,R)=>a.emitFor(I,R),egressPending:()=>a.pendingCount,egressDropped:()=>a.dropped,trackEvent:(I,R)=>l({kind:"event",name:I,props:R,timestamp:Date.now()}),getAppState:()=>ot("visibility")&&document.visibilityState==="hidden"?"background":"active",log:s,apiBaseUrl:r.apiBaseUrl,signal:(I,R)=>{for(let T of u)try{T(I,R)}catch{}},onSignal:I=>(u.add(I),()=>u.delete(I)),replaySampling:r.replay,...r.onInAppGameRequest?{onInAppGameRequest:r.onInAppGameRequest}:{},errorsOptions:r.errors,networkOptions:r.network,performanceOptions:r.performance,watchdogOptions:r.watchdog,analyticsOptions:r.analytics,flagsBootstrap:(E=r.flags)==null?void 0:E.bootstrap,flagsRealtime:(C=r.flags)==null?void 0:C.realtime,replayCanvas:r.replayCanvas,replayDirectUpload:r.replayDirectUpload,replayFrameOrigins:r.replayFrameOrigins,autocapture:r.autocapture,traceOrigins:r.tracePropagation?[...typeof location!="undefined"?[location.origin]:[],...r.tracePropagationOrigins]:[],maskReplayText:r.privacy.maskReplayText,maskEventText:r.privacy.maskEventText,maskSelectors:r.privacy.maskSelectors,maskInputs:r.privacy.maskInputs,respectDnt:r.privacy.respectDnt,exitIntent:r.exitIntent},p=r.features,f=()=>{for(let I of mg)p[I.name]!==!1&&Ua(I.name).every(R=>ot(R))&&c.add(I)};f();let m=async()=>{await Promise.all(Object.entries(hg).map(async([I,R])=>{if(p[I]===!0&&Ua(I).every(T=>ot(T))&&!c.get(I))try{c.add(await R())}catch(T){s(`[scalebun] optional feature "${I}" failed to load:`,T)}}))},h=new xn(r.consent.initial),b=()=>{var T;let I=async()=>{var $,D;if(!i.expired())return;await a.drain();let A=i.rotate();if(!A)return;Ws(),Ks(),await a.restart();let P=c.get("replay");($=P==null?void 0:P.pause)==null||$.call(P),(D=P==null?void 0:P.resume)==null||D.call(P),s("[session] rotated",A,"->",i.sessionId)},R=setInterval(()=>void I(),i0);(T=R.unref)==null||T.call(R),ot("visibility")&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&I()})},k=!1,x=async()=>{var R;if(k)return;k=!0,f(),await m(),await c.setupAll(d),t!=null&&t.edge||(await a.start(),b());let I=(R=c.get("analytics"))==null?void 0:R.identity;if(I!=null&&I.userId&&!(t!=null&&t.edge)&&a.emit({kind:"identify",userId:I.userId,anonymousId:I.anonymousId,timestamp:Date.now()}),I){Oe(I.superProps);let T=I.groups;if(T)for(let A of Object.keys(T))Oe({[`group_${A}`]:T[A]});I.userId&&Oe({userId:I.userId})}s(t!=null&&t.edge?"activated (edge-lite)":"activated",{sessionId:i.sessionId})},g={config:r,session:i,pipeline:a,transport:o,registry:c,log:s,setConsent:I=>{h.set(I?"granted":"denied"),I?(a.setConsentGranted(!0),x()):(a.setConsentGranted(!1),k&&c.teardownAll(),k=!1,a.discard())},get consentStatus(){return h.value}};return!r.consent.required||h.granted?await x():s("consent required \u2014 capture deferred until setConsent(true)"),s("initialized",{sessionId:i.sessionId,consent:h.value}),g}};z();li();cr();var Xa=class{constructor(){this.rt=null;this.ready=!1;this.pendingConsent=null;this.pushFeature=null;this.coachFeature=null;this.coachController=null;this.pendingPushOpenCbs=[];this.settle=null;this.settled=new Promise(e=>{this.settle=e});this.replay={stats:()=>{var e,t;return(t=(e=this.replayFeature())==null?void 0:e.stats())!=null?t:null},checkpoint:e=>{var t;return(t=this.replayFeature())==null?void 0:t.checkpoint(e)},flush:()=>{var e;return(e=this.replayFeature())==null?void 0:e.flush()},stop:()=>{var e;return(e=this.replayFeature())==null?void 0:e.teardown()},start:()=>{var e;return(e=this.replayFeature())==null?void 0:e.resume()},pause:()=>{var e;return(e=this.replayFeature())==null?void 0:e.pause()},resume:()=>{var e;return(e=this.replayFeature())==null?void 0:e.resume()},setPrivacy:e=>{var t;return(t=this.replayFeature())==null?void 0:t.setPrivacy(e)}};this.performance={startTransaction:e=>{var r,s,i;let t=(r=this.rt)==null?void 0:r.registry.get("performance");return(i=(s=t==null?void 0:t.startTransaction)==null?void 0:s.call(t,e))!=null?i:ar},startTrace:e=>{var r,s;let t=(r=this.rt)==null?void 0:r.registry.get("performance");(s=t==null?void 0:t.startTrace)==null||s.call(t,e)},stopTrace:e=>{var r,s;let t=(r=this.rt)==null?void 0:r.registry.get("performance");(s=t==null?void 0:t.stopTrace)==null||s.call(t,e)},markScreenLoadStart:e=>{},sendMetric:(e,t)=>{var r;(r=this.rt)==null||r.pipeline.emit({kind:"performance",metric:e,value:t,timestamp:L()})}};this.session={start:()=>{},end:()=>{this.close()},emitEvent:(e,t)=>{this.track(e,t)}};this.engage={track:(e,t)=>this.track(e,t),refresh:()=>{var e,t;return(t=(e=this.engageFeature())==null?void 0:e.refresh())!=null?t:Promise.resolve()},submit:(e,t)=>{var r,s;return(s=(r=this.engageFeature())==null?void 0:r.submit(e,t))!=null?s:Promise.resolve("error")},emitRatingEvent:(e,t)=>{var r;return(r=this.engageFeature())==null?void 0:r.emitRatingEvent(e,t)},resetInAppState:()=>{var e,t;return(t=(e=this.engageFeature())==null?void 0:e.resetInAppState())!=null?t:Promise.resolve()}};this.push={enable:e=>this.enablePush(e),disable:e=>this.ensurePush().then(t=>{var r;return(r=t==null?void 0:t.disable(e))!=null?r:!1}),status:()=>this.ensurePush().then(e=>{var t;return(t=e==null?void 0:e.status())!=null?t:Promise.resolve({supported:!1,permission:"default",subscribed:!1,endpoint:null,state:"unsupported"})}),getSubscription:()=>this.ensurePush().then(e=>{var t;return(t=e==null?void 0:e.getSubscription())!=null?t:null}),check:async e=>{let t=await this.ensurePush();return t?t.check(e):(await Promise.resolve().then(()=>(ja(),Ka))).notInitializedReport()}};this.attribution={getInstallationId:()=>{var e,t;return(t=(e=this.analyticsFeature())==null?void 0:e.getInstallationId())!=null?t:""},setClickId:e=>{var t;return(t=this.analyticsFeature())==null?void 0:t.setClickId(e)}};this.flagExposed=new Set;this.flags={isEnabled:e=>{var s;let t=this.cfg(),r=(s=t==null?void 0:t.isEnabled(e))!=null?s:!1;return t!=null&&t.knows(e)&&this.recordExposure(e,r),r},variation:(e,t)=>this.flags.variationDetail(e,t).value,variationDetail:(e,t)=>{var i,o,a;let r=(o=(i=this.cfg())==null?void 0:i.variationDetail(e,t))!=null?o:{value:t,variant:null,reason:"FLAG_NOT_FOUND"},s=(a=r.variant)!=null?a:typeof r.value=="object"?null:r.value;return this.recordExposure(e,typeof s=="number"?String(s):s,r.reason),r},ready:()=>{var e,t;return(t=(e=this.cfg())==null?void 0:e.ready())!=null?t:Promise.resolve()},onChange:e=>{var t,r;return(r=(t=this.cfg())==null?void 0:t.onChange(e))!=null?r:()=>{}},override:(e,t)=>{var r;return(r=this.cfg())==null?void 0:r.override(e,t)},clearOverride:e=>{var t;return(t=this.cfg())==null?void 0:t.clearOverride(e)},clearOverrides:()=>{var e;return(e=this.cfg())==null?void 0:e.clearOverrides()}};this.config={get:(e,t)=>{var r,s;return(s=(r=this.cfg())==null?void 0:r.get(e,t))!=null?s:t},refresh:()=>{var e,t;return(t=(e=this.cfg())==null?void 0:e.refresh())!=null?t:Promise.resolve()}};this.rollouts={isOn:e=>{var r,s;let t=(s=(r=this.cfg())==null?void 0:r.isOn(e))!=null?s:!1;return this.recordExposure(e,t),t}};this.experiments={variant:e=>{var r,s;let t=(s=(r=this.cfg())==null?void 0:r.variant(e))!=null?s:null;return this.recordExposure(e,t),t}};this.profiler={available:()=>{var e,t;return(t=(e=this.prof())==null?void 0:e.available())!=null?t:!1},start:e=>{var t,r;return(r=(t=this.prof())==null?void 0:t.start(e))!=null?r:!1},stop:()=>{var e,t;return(t=(e=this.prof())==null?void 0:e.stop())!=null?t:Promise.resolve(!1)}};this.watchdog={stats:()=>{var t,r,s;let e=(t=this.rt)==null?void 0:t.registry.get("watchdog");return(s=(r=e==null?void 0:e.stats)==null?void 0:r.call(e))!=null?s:null}}}whenReady(){return this.settled}async init(e){var t,r,s,i,o;if(!this.ready){if(En((t=e==null?void 0:e.csp)==null?void 0:t.nonce),Oc()){let a=Ys();if(a==="edge"||a==="worker"){try{this.rt=await mn.bootstrap(e,{edge:!0}),this.ready=!0}catch(c){typeof console!="undefined"&&console.warn("[scalebun] edge init failed:",c)}return}e!=null&&e.debug&&typeof console!="undefined"&&console.warn("[scalebun] init() on SSR \u2014 deferring capture to the client.");return}try{if(this.rt=await mn.bootstrap(e),this.ready=!0,this.pendingConsent!==null&&(this.rt.setConsent(this.pendingConsent),this.pendingConsent=null),this.rt.config.features.bugReport!==!1){let c=this.rt.registry.get("bugReport");(r=c==null?void 0:c.setSubmit)==null||r.call(c,l=>this.reportBugDetailed(l)),this.rt.config.bugReport.launcher&&((s=c==null?void 0:c.mountLauncher)==null||s.call(c,{position:this.rt.config.bugReport.position,label:this.rt.config.bugReport.label}))}let a=(i=e==null?void 0:e.push)==null?void 0:i.softAsk;a&&Promise.resolve().then(()=>(vg(),yg)).then(({armSoftAsk:c})=>c(a,{enable:()=>this.enablePush(),permission:()=>Notification.permission})).catch(()=>{})}catch(a){typeof console!="undefined"&&console.warn("[scalebun] init failed:",a)}finally{(o=this.settle)==null||o.call(this)}}}setConsent(e){this.rt?this.rt.setConsent(e):this.pendingConsent=e}track(e,t){var r,s,i,o;(r=this.analyticsFeature())!=null&&r.evaluate(e,t).drop||((s=this.rt)==null||s.pipeline.emit(this.enrichEvent({kind:"event",name:e,props:t,timestamp:L()})),(i=this.analyticsFeature())==null||i.track(e,t),(o=this.engageFeature())==null||o.onCustomEvent(e))}enrichEvent(e){var c;let t=(c=this.analyticsFeature())==null?void 0:c.identity,r=Z(),s=t==null?void 0:t.superProps,i=e.props,o=s&&Object.keys(s).length?{...s,...i!=null?i:{}}:i,a=o&&ht(o);return{...e,...a!==void 0?{props:a}:{},...t!=null&&t.anonymousId?{anonymousId:t.anonymousId}:{},...t!=null&&t.userId?{userId:t.userId}:{},...t!=null&&t.groups&&Object.keys(t.groups).length?{groups:t.groups}:{},...r?{replay:r}:{}}}register(e){var t;(t=this.analyticsFeature())==null||t.register(e),Oe(e)}unregister(e){var t;(t=this.analyticsFeature())==null||t.unregister(e)}group(e,t,r){var s,i;!e||!t||((s=this.analyticsFeature())==null||s.group(e,t,r),Oe({[`group_${e}`]:t}),(i=this.rt)==null||i.pipeline.emit(this.enrichEvent({kind:"event",name:"$group",props:{group_type:e,group_key:t,...r!=null?r:{}},timestamp:L()})))}alias(e,t){var i,o,a,c;if(!e)return;let r=(i=this.analyticsFeature())==null?void 0:i.identity,s=(o=t!=null?t:r==null?void 0:r.userId)!=null?o:r==null?void 0:r.anonymousId;(a=this.analyticsFeature())==null||a.alias(e,t),(c=this.rt)==null||c.pipeline.emit({kind:"identify",userId:e,previousId:s,timestamp:L()})}reset(){var e,t,r,s,i;(e=this.engageFeature())==null||e.onLifecycle("before_logout"),(t=this.analyticsFeature())==null||t.reset(),Lc(),(i=this.rt)==null||i.pipeline.emit({kind:"identify",reset:!0,anonymousId:(s=(r=this.analyticsFeature())==null?void 0:r.identity)==null?void 0:s.anonymousId,timestamp:L()})}trackPurchase(e){var r,s,i;let t=vl(e);t&&((r=this.rt)==null||r.pipeline.emit(this.enrichEvent({kind:"event",name:"purchase",props:t.props,revenue:t.revenue,currency:t.currency,timestamp:L()})),(s=this.analyticsFeature())==null||s.trackPurchase(t),(i=this.engageFeature())==null||i.onCustomEvent("purchase"))}trackSubscription(e){var t;(t=this.analyticsFeature())==null||t.trackSubscription(e)}trackScreen(e,t){var r,s;e&&((r=this.rt)==null||r.pipeline.emit(this.enrichEvent({kind:"event",name:"SCREEN_VIEW",screenName:e,props:t,timestamp:L()})),(s=this.engageFeature())==null||s.onScreenView(e))}identify(e,t){var s,i,o,a,c,l,u,d;let r=(i=(s=this.analyticsFeature())==null?void 0:s.identity)==null?void 0:i.anonymousId;(o=this.rt)==null||o.pipeline.emit({kind:"identify",userId:e,anonymousId:r,traits:t,timestamp:L()}),(a=this.analyticsFeature())==null||a.identify(e,t),Oe({userId:e,...t!=null?t:{}}),(c=this.engageFeature())==null||c.onIdentify(),(d=(u=(l=this.rt)==null?void 0:l.registry.get("inapp2"))==null?void 0:u.onIdentify)==null||d.call(u)}setUser(e){e!=null&&e.id&&this.identify(e.id,e)}captureError(e,t){var a,c,l;let r=t!=null&&t.componentStack?{componentStack:t.componentStack}:void 0,s=t&&(t.level||t.tags||t.context||t.fingerprint)?{level:t.level,tags:t.tags,context:t.context,fingerprint:t.fingerprint}:void 0,i=(a=this.rt)==null?void 0:a.registry.get("errors");if(i!=null&&i.captureHandled){i.captureHandled(e,r,s);return}let o=e;(l=this.rt)==null||l.pipeline.emit({kind:"error",type:"handled",message:(c=o==null?void 0:o.message)!=null?c:String(e),stack:o==null?void 0:o.stack,source:"js",timestamp:L(),...r!=null?r:{}})}addBreadcrumb(e){var t;Ec({ts:L(),category:(t=e.category)!=null?t:"custom",type:e.type,level:e.level,message:e.message,data:e.data})}setTag(e,t){Hl(e,t)}setContext(e,t){$l(e,t)}setErrorLevel(e){zl(e)}submitRating(e,t,r){var o,a;let s=Math.round(e);if(!Number.isFinite(s)||s<1||s>5){(o=this.rt)==null||o.log("[scalebun] submitRating: score must be an integer 1\u20135, got",e);return}let i={kind:"rating",score:s,comment:t,surveyId:r,clientRatingId:`rat_${q()}`,timestamp:L()};(a=this.rt)==null||a.pipeline.emit(i)}async registerInAppSlot(e,t){let{registerInAppSlot:r}=await Promise.resolve().then(()=>(fo(),lp));return r(e,t)}async reportBug(e){let t=await this.reportBugDetailed(e);return typeof t=="string"?t:null}async reportBugDetailed(e){var t,r,s,i;if(!this.rt)return{e:"init"};if(this.rt.config.features.bugReport===!1)return this.rt.log("[scalebun] reportBug: bugReport feature is disabled"),{e:"off"};if(!e||!e.message)return this.rt.log("[scalebun] reportBug: a message is required"),{e:"empty"};if(!this.rt.pipeline.canEgress())return this.rt.log("[scalebun] reportBug: blocked \u2014 consent not granted"),{e:"consent"};try{let o=this.rt.registry.get("bugReport");(t=o==null?void 0:o.signalReport)==null||t.call(o);let a=this.rt.registry.get("console"),c=(s=(r=a==null?void 0:a.getRecent)==null?void 0:r.call(a))!=null?s:[],{buildBugReportPayload:l}=await Promise.resolve().then(()=>(xg(),wg)),u=Z(),d=l({message:e.message,title:e.title,email:e.email},c,{replayCoord:u}),p=await this.rt.transport.submitBugReport(this.rt.session.sessionId,d);return await this.rt.pipeline.flush(),(i=p==null?void 0:p.id)!=null?i:{e:"send"}}catch{return{e:"send"}}}async flush(){var e,t;await Promise.all([(e=this.rt)==null?void 0:e.pipeline.flush(),(t=this.analyticsFeature())==null?void 0:t.flush()])}errorStats(){var t,r,s;let e=(t=this.rt)==null?void 0:t.registry.get("errors");return(s=(r=e==null?void 0:e.stats)==null?void 0:r.call(e))!=null?s:null}perfStats(){var t,r,s;let e=(t=this.rt)==null?void 0:t.registry.get("performance");return(s=(r=e==null?void 0:e.perfStats)==null?void 0:r.call(e))!=null?s:null}networkStats(){var t,r,s;let e=(t=this.rt)==null?void 0:t.registry.get("network");return(s=(r=e==null?void 0:e.stats)==null?void 0:r.call(e))!=null?s:null}async close(){var e,t;(e=this.rt)==null||e.registry.teardownAll(),await((t=this.rt)==null?void 0:t.pipeline.stop()),this.rt=null,this.ready=!1}get sessionId(){var e;return(e=this.rt)==null?void 0:e.session.sessionId}egressStats(){var r,s,i,o,a,c,l,u,d,p,f,m,h;let e=this.analyticsFeature(),t=(r=this.rt)==null?void 0:r.pipeline.ledger;return{pending:((i=(s=this.rt)==null?void 0:s.pipeline.pendingCount)!=null?i:0)+((o=e==null?void 0:e.pending)!=null?o:0),dropped:((c=(a=this.rt)==null?void 0:a.pipeline.dropped)!=null?c:0)+((l=e==null?void 0:e.dropped)!=null?l:0),queued:(u=t==null?void 0:t.queued)!=null?u:0,attempted:(d=t==null?void 0:t.attempted)!=null?d:0,retried:(p=t==null?void 0:t.retried)!=null?p:0,recovered:(f=t==null?void 0:t.recovered)!=null?f:0,expired:(m=t==null?void 0:t.expired)!=null?m:0,acked:(h=t==null?void 0:t.acked)!=null?h:0}}analyticsStats(){var e,t;return(t=(e=this.analyticsFeature())==null?void 0:e.stats)!=null?t:null}setUiState(e,t){tc(e,t)}clearUiState(e){nc(e)}analyticsFeature(){var e;return(e=this.rt)==null?void 0:e.registry.get("analytics")}replayFeature(){var e;return(e=this.rt)==null?void 0:e.registry.get("replay")}engageFeature(){var e;return(e=this.rt)==null?void 0:e.registry.get("engage")}inboxFeature(){var e;return(e=this.rt)==null?void 0:e.registry.get("inbox")}inbox(){var e,t;return(t=(e=this.inboxFeature())==null?void 0:e.controller())!=null?t:k0}ensureCoach(){return this.coachFeature?Promise.resolve(this.coachFeature):this.rt?Promise.resolve().then(()=>(Ig(),Eg)).then(({CoachmarkFeature:e})=>{var s,i;if(this.coachFeature)return this.coachFeature;let t={trackEvent:(o,a)=>this.track(o,a),replayCoord:Z,apiBaseUrl:(s=this.rt)==null?void 0:s.config.apiBaseUrl,clientKey:(i=this.rt)==null?void 0:i.config.clientKey},r=new e(t);return this.coachFeature=r,r}):Promise.resolve(null)}coachmarks(){if(this.coachController)return this.coachController;let e=t=>{this.ensureCoach().then(r=>{r&&t(r)})};return this.coachController={start:(t,r)=>e(s=>s.start(t,r)),startInline:t=>e(r=>r.start(t)),startById:(t,r)=>e(s=>void s.startById(t,r)),reportAnchors:()=>e(t=>t.reportAnchors()),next:()=>e(t=>t.next()),back:()=>e(t=>t.back()),skip:()=>e(t=>t.skip()),end:()=>e(t=>t.end()),notify:t=>e(r=>r.notify(t)),current:()=>{var t,r;return(r=(t=this.coachFeature)==null?void 0:t.current())!=null?r:{tourId:null,index:0,status:"idle"}},on:(t,r)=>{if(this.coachFeature)return this.coachFeature.on(t,r);let s=null,i=!1;return this.ensureCoach().then(o=>{o&&!i&&(s=o.on(t,r))}),()=>{i=!0,s==null||s()}}},this.coachController}async ensurePush(){if(this.pushFeature)return this.pushFeature;if(!this.rt)return null;let{PushFeature:e}=await Promise.resolve().then(()=>(Mg(),Rg));this.pushFeature=new e({apiBaseUrl:this.rt.config.apiBaseUrl,clientKey:this.rt.config.clientKey,deviceId:this.rt.session.deviceId,log:this.rt.log}),this.pushFeature.onNotificationOpened(({data:t,action:r})=>{this.track("$push_opened",{...r?{action:r}:{},...t&&typeof t=="object"?t:{}})});for(let t of this.pendingPushOpenCbs)this.pushFeature.onNotificationOpened(t);return this.pendingPushOpenCbs=[],this.pushFeature}async enablePush(e){let t=await this.ensurePush();return t?t.enable(e):"error"}onNotificationOpened(e){return this.pushFeature?this.pushFeature.onNotificationOpened(e):(this.pendingPushOpenCbs.push(e),this.ensurePush(),()=>{var r;(r=this.pushFeature)==null||r.onNotificationOpened(e);let t=this.pendingPushOpenCbs.indexOf(e);t>=0&&this.pendingPushOpenCbs.splice(t,1)})}cfg(){var e;return(e=this.rt)==null?void 0:e.registry.get("config")}recordExposure(e,t,r){var i;if(!this.rt||t==null)return;let s=`${e}=${String(t)}`;this.flagExposed.has(s)||(this.flagExposed.add(s),(i=this.analyticsFeature())==null||i.register({[`$feature/${e}`]:t}),this.track("$feature_flag_called",{flag_key:e,flag_value:t,...r?{reason:r}:{}}))}prof(){var e;return(e=this.rt)==null?void 0:e.registry.get("profiler")}},st=()=>{},Xe=()=>Promise.resolve(),Pg={unreadCount:0,total:0,syncStatus:"idle"},k0={subscribe:n=>(n(Pg),st),onUnreadChange:n=>(n(0),st),getState:()=>Pg,query:()=>Promise.resolve({messages:[],cursor:null,hasMore:!1}),get:()=>Promise.resolve(void 0),markRead:Xe,markUnread:Xe,markAllRead:Xe,archive:Xe,unarchive:Xe,pin:Xe,remove:Xe,refresh:Xe,ingest:Xe,act:st,onCtaAction:()=>st,mount:st,open:st,close:st,unmount:st},gn=new Xa;z();function E0(n,e){let t=n.ScaleBun;n.ScaleBun=gn;let r=!1;if(t&&Array.isArray(t.q))for(let i of t.q){let[o,a]=i;o==="init"&&(r=!0);let c=gn[o];if(typeof c=="function"){let l=a?Array.prototype.slice.call(a):[];try{c.apply(gn,l)}catch{}}}let s=e==null?void 0:e.dataset;if(!r&&(s!=null&&s.clientKey)){let i={clientKey:s.clientKey};s.apiBaseUrl&&(i.apiBaseUrl=s.apiBaseUrl),s.environment&&(i.environment=s.environment),s.autocapture!=null&&(i.autocapture=s.autocapture!=="false"),gn.init(i)}}if(typeof window!="undefined"){let n=typeof document!="undefined"?document.currentScript:null;En(n==null?void 0:n.nonce),E0(window,n)}})();
717
+ //# sourceMappingURL=scalebun.min.js.map