@scalebun/web 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/bootstrap/FeatureRegistry.d.ts +44 -0
- package/dist/bootstrap/FeatureRegistry.d.ts.map +1 -0
- package/dist/bootstrap/FeatureRegistry.js +85 -0
- package/dist/bootstrap/FeatureRegistry.js.map +1 -0
- package/dist/bootstrap/SDKBootstrapper.d.ts +37 -0
- package/dist/bootstrap/SDKBootstrapper.d.ts.map +1 -0
- package/dist/bootstrap/SDKBootstrapper.js +248 -0
- package/dist/bootstrap/SDKBootstrapper.js.map +1 -0
- package/dist/browser.d.ts +51 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +81 -0
- package/dist/browser.js.map +1 -0
- package/dist/config/schema.d.ts +108 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +95 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/breadcrumbs.d.ts +56 -0
- package/dist/core/breadcrumbs.d.ts.map +1 -0
- package/dist/core/breadcrumbs.js +141 -0
- package/dist/core/breadcrumbs.js.map +1 -0
- package/dist/core/capabilities.d.ts +38 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/capabilities.js +78 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/consent.d.ts +17 -0
- package/dist/core/consent.d.ts.map +1 -0
- package/dist/core/consent.js +38 -0
- package/dist/core/consent.js.map +1 -0
- package/dist/core/csp.d.ts +31 -0
- package/dist/core/csp.d.ts.map +1 -0
- package/dist/core/csp.js +74 -0
- package/dist/core/csp.js.map +1 -0
- package/dist/core/evalContext.d.ts +7 -0
- package/dist/core/evalContext.d.ts.map +1 -0
- package/dist/core/evalContext.js +22 -0
- package/dist/core/evalContext.js.map +1 -0
- package/dist/core/ids.d.ts +6 -0
- package/dist/core/ids.d.ts.map +1 -0
- package/dist/core/ids.js +35 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lifecycle.d.ts +4 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +24 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/logger.d.ts +12 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +14 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/observe.d.ts +3 -0
- package/dist/core/observe.d.ts.map +1 -0
- package/dist/core/observe.js +22 -0
- package/dist/core/observe.js.map +1 -0
- package/dist/core/pageContext.d.ts +13 -0
- package/dist/core/pageContext.d.ts.map +1 -0
- package/dist/core/pageContext.js +73 -0
- package/dist/core/pageContext.js.map +1 -0
- package/dist/core/prune.d.ts +7 -0
- package/dist/core/prune.d.ts.map +1 -0
- package/dist/core/prune.js +31 -0
- package/dist/core/prune.js.map +1 -0
- package/dist/core/redact.d.ts +15 -0
- package/dist/core/redact.d.ts.map +1 -0
- package/dist/core/redact.js +50 -0
- package/dist/core/redact.js.map +1 -0
- package/dist/core/replayCoord.d.ts +22 -0
- package/dist/core/replayCoord.d.ts.map +1 -0
- package/dist/core/replayCoord.js +20 -0
- package/dist/core/replayCoord.js.map +1 -0
- package/dist/core/retry.d.ts +25 -0
- package/dist/core/retry.d.ts.map +1 -0
- package/dist/core/retry.js +44 -0
- package/dist/core/retry.js.map +1 -0
- package/dist/core/runtime.d.ts +28 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +67 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/scrollDepth.d.ts +48 -0
- package/dist/core/scrollDepth.d.ts.map +1 -0
- package/dist/core/scrollDepth.js +63 -0
- package/dist/core/scrollDepth.js.map +1 -0
- package/dist/debug/index.d.ts +6 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +2 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/features/analytics/AnalyticsFeature.d.ts +122 -0
- package/dist/features/analytics/AnalyticsFeature.d.ts.map +1 -0
- package/dist/features/analytics/AnalyticsFeature.js +757 -0
- package/dist/features/analytics/AnalyticsFeature.js.map +1 -0
- package/dist/features/analytics/autocapture.d.ts +13 -0
- package/dist/features/analytics/autocapture.d.ts.map +1 -0
- package/dist/features/analytics/autocapture.js +398 -0
- package/dist/features/analytics/autocapture.js.map +1 -0
- package/dist/features/analytics/governance.d.ts +15 -0
- package/dist/features/analytics/governance.d.ts.map +1 -0
- package/dist/features/analytics/governance.js +30 -0
- package/dist/features/analytics/governance.js.map +1 -0
- package/dist/features/analytics/revenue.d.ts +38 -0
- package/dist/features/analytics/revenue.d.ts.map +1 -0
- package/dist/features/analytics/revenue.js +26 -0
- package/dist/features/analytics/revenue.js.map +1 -0
- package/dist/features/analytics/sampler.d.ts +2 -0
- package/dist/features/analytics/sampler.d.ts.map +1 -0
- package/dist/features/analytics/sampler.js +24 -0
- package/dist/features/analytics/sampler.js.map +1 -0
- package/dist/features/analytics/subscription.d.ts +25 -0
- package/dist/features/analytics/subscription.d.ts.map +1 -0
- package/dist/features/analytics/subscription.js +51 -0
- package/dist/features/analytics/subscription.js.map +1 -0
- package/dist/features/attention/index.d.ts +29 -0
- package/dist/features/attention/index.d.ts.map +1 -0
- package/dist/features/attention/index.js +128 -0
- package/dist/features/attention/index.js.map +1 -0
- package/dist/features/bugreport/BugReportFeature.d.ts +36 -0
- package/dist/features/bugreport/BugReportFeature.d.ts.map +1 -0
- package/dist/features/bugreport/BugReportFeature.js +55 -0
- package/dist/features/bugreport/BugReportFeature.js.map +1 -0
- package/dist/features/bugreport/collect.d.ts +21 -0
- package/dist/features/bugreport/collect.d.ts.map +1 -0
- package/dist/features/bugreport/collect.js +27 -0
- package/dist/features/bugreport/collect.js.map +1 -0
- package/dist/features/bugreport/widget.d.ts +21 -0
- package/dist/features/bugreport/widget.d.ts.map +1 -0
- package/dist/features/bugreport/widget.js +111 -0
- package/dist/features/bugreport/widget.js.map +1 -0
- package/dist/features/coach/CoachmarkFeature.d.ts +78 -0
- package/dist/features/coach/CoachmarkFeature.d.ts.map +1 -0
- package/dist/features/coach/CoachmarkFeature.js +161 -0
- package/dist/features/coach/CoachmarkFeature.js.map +1 -0
- package/dist/features/coach/anchor.d.ts +32 -0
- package/dist/features/coach/anchor.d.ts.map +1 -0
- package/dist/features/coach/anchor.js +128 -0
- package/dist/features/coach/anchor.js.map +1 -0
- package/dist/features/coach/observers.d.ts +17 -0
- package/dist/features/coach/observers.d.ts.map +1 -0
- package/dist/features/coach/observers.js +49 -0
- package/dist/features/coach/observers.js.map +1 -0
- package/dist/features/coach/overlay.d.ts +15 -0
- package/dist/features/coach/overlay.d.ts.map +1 -0
- package/dist/features/coach/overlay.js +183 -0
- package/dist/features/coach/overlay.js.map +1 -0
- package/dist/features/coach/position.d.ts +9 -0
- package/dist/features/coach/position.d.ts.map +1 -0
- package/dist/features/coach/position.js +83 -0
- package/dist/features/coach/position.js.map +1 -0
- package/dist/features/coach/predicate.d.ts +10 -0
- package/dist/features/coach/predicate.d.ts.map +1 -0
- package/dist/features/coach/predicate.js +36 -0
- package/dist/features/coach/predicate.js.map +1 -0
- package/dist/features/coach/tour.d.ts +55 -0
- package/dist/features/coach/tour.d.ts.map +1 -0
- package/dist/features/coach/tour.js +181 -0
- package/dist/features/coach/tour.js.map +1 -0
- package/dist/features/coach/types.d.ts +161 -0
- package/dist/features/coach/types.d.ts.map +1 -0
- package/dist/features/coach/types.js +2 -0
- package/dist/features/coach/types.js.map +1 -0
- package/dist/features/coach/wait.d.ts +34 -0
- package/dist/features/coach/wait.d.ts.map +1 -0
- package/dist/features/coach/wait.js +107 -0
- package/dist/features/coach/wait.js.map +1 -0
- package/dist/features/config/ConfigFeature.d.ts +117 -0
- package/dist/features/config/ConfigFeature.d.ts.map +1 -0
- package/dist/features/config/ConfigFeature.js +437 -0
- package/dist/features/config/ConfigFeature.js.map +1 -0
- package/dist/features/config/bucketing.d.ts +20 -0
- package/dist/features/config/bucketing.d.ts.map +1 -0
- package/dist/features/config/bucketing.js +37 -0
- package/dist/features/config/bucketing.js.map +1 -0
- package/dist/features/config/configStore.d.ts +11 -0
- package/dist/features/config/configStore.d.ts.map +1 -0
- package/dist/features/config/configStore.js +66 -0
- package/dist/features/config/configStore.js.map +1 -0
- package/dist/features/config/targeting.d.ts +11 -0
- package/dist/features/config/targeting.d.ts.map +1 -0
- package/dist/features/config/targeting.js +57 -0
- package/dist/features/config/targeting.js.map +1 -0
- package/dist/features/config/types.d.ts +100 -0
- package/dist/features/config/types.d.ts.map +1 -0
- package/dist/features/config/types.js +9 -0
- package/dist/features/config/types.js.map +1 -0
- package/dist/features/console/ConsoleFeature.d.ts +31 -0
- package/dist/features/console/ConsoleFeature.d.ts.map +1 -0
- package/dist/features/console/ConsoleFeature.js +98 -0
- package/dist/features/console/ConsoleFeature.js.map +1 -0
- package/dist/features/console/normalize.d.ts +18 -0
- package/dist/features/console/normalize.d.ts.map +1 -0
- package/dist/features/console/normalize.js +64 -0
- package/dist/features/console/normalize.js.map +1 -0
- package/dist/features/console/serialize.d.ts +24 -0
- package/dist/features/console/serialize.d.ts.map +1 -0
- package/dist/features/console/serialize.js +99 -0
- package/dist/features/console/serialize.js.map +1 -0
- package/dist/features/console/throttle.d.ts +27 -0
- package/dist/features/console/throttle.d.ts.map +1 -0
- package/dist/features/console/throttle.js +37 -0
- package/dist/features/console/throttle.js.map +1 -0
- package/dist/features/crash/CrashFeature.d.ts +46 -0
- package/dist/features/crash/CrashFeature.d.ts.map +1 -0
- package/dist/features/crash/CrashFeature.js +173 -0
- package/dist/features/crash/CrashFeature.js.map +1 -0
- package/dist/features/crash/liveness.d.ts +30 -0
- package/dist/features/crash/liveness.d.ts.map +1 -0
- package/dist/features/crash/liveness.js +131 -0
- package/dist/features/crash/liveness.js.map +1 -0
- package/dist/features/engage/EngageFeature.d.ts +61 -0
- package/dist/features/engage/EngageFeature.d.ts.map +1 -0
- package/dist/features/engage/EngageFeature.js +221 -0
- package/dist/features/engage/EngageFeature.js.map +1 -0
- package/dist/features/engage/attachments.d.ts +24 -0
- package/dist/features/engage/attachments.d.ts.map +1 -0
- package/dist/features/engage/attachments.js +209 -0
- package/dist/features/engage/attachments.js.map +1 -0
- package/dist/features/engage/gameLogic.d.ts +60 -0
- package/dist/features/engage/gameLogic.d.ts.map +1 -0
- package/dist/features/engage/gameLogic.js +213 -0
- package/dist/features/engage/gameLogic.js.map +1 -0
- package/dist/features/engage/gameResolver.d.ts +35 -0
- package/dist/features/engage/gameResolver.d.ts.map +1 -0
- package/dist/features/engage/gameResolver.js +81 -0
- package/dist/features/engage/gameResolver.js.map +1 -0
- package/dist/features/engage/gameTypes.d.ts +76 -0
- package/dist/features/engage/gameTypes.d.ts.map +1 -0
- package/dist/features/engage/gameTypes.js +17 -0
- package/dist/features/engage/gameTypes.js.map +1 -0
- package/dist/features/engage/inappSlots.d.ts +39 -0
- package/dist/features/engage/inappSlots.d.ts.map +1 -0
- package/dist/features/engage/inappSlots.js +50 -0
- package/dist/features/engage/inappSlots.js.map +1 -0
- package/dist/features/engage/normalize.d.ts +11 -0
- package/dist/features/engage/normalize.d.ts.map +1 -0
- package/dist/features/engage/normalize.js +203 -0
- package/dist/features/engage/normalize.js.map +1 -0
- package/dist/features/engage/richInApp.d.ts +64 -0
- package/dist/features/engage/richInApp.d.ts.map +1 -0
- package/dist/features/engage/richInApp.js +1082 -0
- package/dist/features/engage/richInApp.js.map +1 -0
- package/dist/features/engage/runtime.d.ts +78 -0
- package/dist/features/engage/runtime.d.ts.map +1 -0
- package/dist/features/engage/runtime.js +349 -0
- package/dist/features/engage/runtime.js.map +1 -0
- package/dist/features/engage/shakeDetector.d.ts +6 -0
- package/dist/features/engage/shakeDetector.d.ts.map +1 -0
- package/dist/features/engage/shakeDetector.js +105 -0
- package/dist/features/engage/shakeDetector.js.map +1 -0
- package/dist/features/engage/theme.d.ts +129 -0
- package/dist/features/engage/theme.d.ts.map +1 -0
- package/dist/features/engage/theme.js +270 -0
- package/dist/features/engage/theme.js.map +1 -0
- package/dist/features/engage/throttle.d.ts +31 -0
- package/dist/features/engage/throttle.d.ts.map +1 -0
- package/dist/features/engage/throttle.js +130 -0
- package/dist/features/engage/throttle.js.map +1 -0
- package/dist/features/engage/transport.d.ts +62 -0
- package/dist/features/engage/transport.d.ts.map +1 -0
- package/dist/features/engage/transport.js +185 -0
- package/dist/features/engage/transport.js.map +1 -0
- package/dist/features/engage/triggerEngine.d.ts +39 -0
- package/dist/features/engage/triggerEngine.d.ts.map +1 -0
- package/dist/features/engage/triggerEngine.js +105 -0
- package/dist/features/engage/triggerEngine.js.map +1 -0
- package/dist/features/engage/types.d.ts +265 -0
- package/dist/features/engage/types.d.ts.map +1 -0
- package/dist/features/engage/types.js +3 -0
- package/dist/features/engage/types.js.map +1 -0
- package/dist/features/engage/widget/InAppWidget.d.ts +10 -0
- package/dist/features/engage/widget/InAppWidget.d.ts.map +1 -0
- package/dist/features/engage/widget/InAppWidget.js +136 -0
- package/dist/features/engage/widget/InAppWidget.js.map +1 -0
- package/dist/features/engage/widget/SurveyWidget.d.ts +11 -0
- package/dist/features/engage/widget/SurveyWidget.d.ts.map +1 -0
- package/dist/features/engage/widget/SurveyWidget.js +546 -0
- package/dist/features/engage/widget/SurveyWidget.js.map +1 -0
- package/dist/features/errors/ErrorsFeature.d.ts +62 -0
- package/dist/features/errors/ErrorsFeature.d.ts.map +1 -0
- package/dist/features/errors/ErrorsFeature.js +209 -0
- package/dist/features/errors/ErrorsFeature.js.map +1 -0
- package/dist/features/errors/causes.d.ts +15 -0
- package/dist/features/errors/causes.d.ts.map +1 -0
- package/dist/features/errors/causes.js +29 -0
- package/dist/features/errors/causes.js.map +1 -0
- package/dist/features/errors/dedup.d.ts +28 -0
- package/dist/features/errors/dedup.d.ts.map +1 -0
- package/dist/features/errors/dedup.js +42 -0
- package/dist/features/errors/dedup.js.map +1 -0
- package/dist/features/errors/group/fingerprint.d.ts +13 -0
- package/dist/features/errors/group/fingerprint.d.ts.map +1 -0
- package/dist/features/errors/group/fingerprint.js +45 -0
- package/dist/features/errors/group/fingerprint.js.map +1 -0
- package/dist/features/errors/lazy.d.ts +8 -0
- package/dist/features/errors/lazy.d.ts.map +1 -0
- package/dist/features/errors/lazy.js +8 -0
- package/dist/features/errors/lazy.js.map +1 -0
- package/dist/features/errors/normalize.d.ts +26 -0
- package/dist/features/errors/normalize.d.ts.map +1 -0
- package/dist/features/errors/normalize.js +58 -0
- package/dist/features/errors/normalize.js.map +1 -0
- package/dist/features/errors/parse/stacktrace.d.ts +13 -0
- package/dist/features/errors/parse/stacktrace.d.ts.map +1 -0
- package/dist/features/errors/parse/stacktrace.js +85 -0
- package/dist/features/errors/parse/stacktrace.js.map +1 -0
- package/dist/features/errors/redact.d.ts +7 -0
- package/dist/features/errors/redact.d.ts.map +1 -0
- package/dist/features/errors/redact.js +39 -0
- package/dist/features/errors/redact.js.map +1 -0
- package/dist/features/errors/sampling.d.ts +2 -0
- package/dist/features/errors/sampling.d.ts.map +1 -0
- package/dist/features/errors/sampling.js +24 -0
- package/dist/features/errors/sampling.js.map +1 -0
- package/dist/features/errors/scope.d.ts +26 -0
- package/dist/features/errors/scope.d.ts.map +1 -0
- package/dist/features/errors/scope.js +30 -0
- package/dist/features/errors/scope.js.map +1 -0
- package/dist/features/exit-intent/ExitIntentFeature.d.ts +16 -0
- package/dist/features/exit-intent/ExitIntentFeature.d.ts.map +1 -0
- package/dist/features/exit-intent/ExitIntentFeature.js +25 -0
- package/dist/features/exit-intent/ExitIntentFeature.js.map +1 -0
- package/dist/features/exit-intent/engine.d.ts +127 -0
- package/dist/features/exit-intent/engine.d.ts.map +1 -0
- package/dist/features/exit-intent/engine.js +227 -0
- package/dist/features/exit-intent/engine.js.map +1 -0
- package/dist/features/forms/index.d.ts +83 -0
- package/dist/features/forms/index.d.ts.map +1 -0
- package/dist/features/forms/index.js +405 -0
- package/dist/features/forms/index.js.map +1 -0
- package/dist/features/inapp/InApp2Feature.d.ts +24 -0
- package/dist/features/inapp/InApp2Feature.d.ts.map +1 -0
- package/dist/features/inapp/InApp2Feature.js +43 -0
- package/dist/features/inapp/InApp2Feature.js.map +1 -0
- package/dist/features/inapp/a11y/focus.d.ts +24 -0
- package/dist/features/inapp/a11y/focus.d.ts.map +1 -0
- package/dist/features/inapp/a11y/focus.js +112 -0
- package/dist/features/inapp/a11y/focus.js.map +1 -0
- package/dist/features/inapp/anchor/controller.d.ts +64 -0
- package/dist/features/inapp/anchor/controller.d.ts.map +1 -0
- package/dist/features/inapp/anchor/controller.js +155 -0
- package/dist/features/inapp/anchor/controller.js.map +1 -0
- package/dist/features/inapp/api.d.ts +28 -0
- package/dist/features/inapp/api.d.ts.map +1 -0
- package/dist/features/inapp/api.js +41 -0
- package/dist/features/inapp/api.js.map +1 -0
- package/dist/features/inapp/blocks/blocks.d.ts +65 -0
- package/dist/features/inapp/blocks/blocks.d.ts.map +1 -0
- package/dist/features/inapp/blocks/blocks.js +196 -0
- package/dist/features/inapp/blocks/blocks.js.map +1 -0
- package/dist/features/inapp/blocks/feedback.d.ts +13 -0
- package/dist/features/inapp/blocks/feedback.d.ts.map +1 -0
- package/dist/features/inapp/blocks/feedback.js +154 -0
- package/dist/features/inapp/blocks/feedback.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/carousel.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/carousel.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/carousel.js +67 -0
- package/dist/features/inapp/blocks/heavy/carousel.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/chart.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/chart.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/chart.js +83 -0
- package/dist/features/inapp/blocks/heavy/chart.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/code.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/code.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/code.js +47 -0
- package/dist/features/inapp/blocks/heavy/code.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/confetti.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/confetti.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/confetti.js +76 -0
- package/dist/features/inapp/blocks/heavy/confetti.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/countdown.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/countdown.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/countdown.js +59 -0
- package/dist/features/inapp/blocks/heavy/countdown.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/index.d.ts +11 -0
- package/dist/features/inapp/blocks/heavy/index.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/index.js +45 -0
- package/dist/features/inapp/blocks/heavy/index.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/markdown.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/markdown.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/markdown.js +76 -0
- package/dist/features/inapp/blocks/heavy/markdown.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/productgrid.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/productgrid.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/productgrid.js +46 -0
- package/dist/features/inapp/blocks/heavy/productgrid.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/qr.d.ts +10 -0
- package/dist/features/inapp/blocks/heavy/qr.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/qr.js +69 -0
- package/dist/features/inapp/blocks/heavy/qr.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/scratch.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/scratch.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/scratch.js +141 -0
- package/dist/features/inapp/blocks/heavy/scratch.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/slot.d.ts +8 -0
- package/dist/features/inapp/blocks/heavy/slot.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/slot.js +96 -0
- package/dist/features/inapp/blocks/heavy/slot.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.d.ts +9 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.js +127 -0
- package/dist/features/inapp/blocks/heavy/spinwheel.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/steps.d.ts +27 -0
- package/dist/features/inapp/blocks/heavy/steps.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/steps.js +127 -0
- package/dist/features/inapp/blocks/heavy/steps.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/streak.d.ts +18 -0
- package/dist/features/inapp/blocks/heavy/streak.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/streak.js +52 -0
- package/dist/features/inapp/blocks/heavy/streak.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/table.d.ts +7 -0
- package/dist/features/inapp/blocks/heavy/table.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/table.js +30 -0
- package/dist/features/inapp/blocks/heavy/table.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/unavailable.d.ts +28 -0
- package/dist/features/inapp/blocks/heavy/unavailable.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/unavailable.js +33 -0
- package/dist/features/inapp/blocks/heavy/unavailable.js.map +1 -0
- package/dist/features/inapp/blocks/heavy/video.d.ts +7 -0
- package/dist/features/inapp/blocks/heavy/video.d.ts.map +1 -0
- package/dist/features/inapp/blocks/heavy/video.js +38 -0
- package/dist/features/inapp/blocks/heavy/video.js.map +1 -0
- package/dist/features/inapp/blocks/styles.d.ts +7 -0
- package/dist/features/inapp/blocks/styles.d.ts.map +1 -0
- package/dist/features/inapp/blocks/styles.js +198 -0
- package/dist/features/inapp/blocks/styles.js.map +1 -0
- package/dist/features/inapp/center/bridge.d.ts +12 -0
- package/dist/features/inapp/center/bridge.d.ts.map +1 -0
- package/dist/features/inapp/center/bridge.js +59 -0
- package/dist/features/inapp/center/bridge.js.map +1 -0
- package/dist/features/inapp/center/panel.d.ts +20 -0
- package/dist/features/inapp/center/panel.d.ts.map +1 -0
- package/dist/features/inapp/center/panel.js +194 -0
- package/dist/features/inapp/center/panel.js.map +1 -0
- package/dist/features/inapp/center/store.d.ts +50 -0
- package/dist/features/inapp/center/store.d.ts.map +1 -0
- package/dist/features/inapp/center/store.js +188 -0
- package/dist/features/inapp/center/store.js.map +1 -0
- package/dist/features/inapp/center/sync.d.ts +32 -0
- package/dist/features/inapp/center/sync.d.ts.map +1 -0
- package/dist/features/inapp/center/sync.js +60 -0
- package/dist/features/inapp/center/sync.js.map +1 -0
- package/dist/features/inapp/center/types.d.ts +46 -0
- package/dist/features/inapp/center/types.d.ts.map +1 -0
- package/dist/features/inapp/center/types.js +5 -0
- package/dist/features/inapp/center/types.js.map +1 -0
- package/dist/features/inapp/core/analytics.d.ts +35 -0
- package/dist/features/inapp/core/analytics.d.ts.map +1 -0
- package/dist/features/inapp/core/analytics.js +70 -0
- package/dist/features/inapp/core/analytics.js.map +1 -0
- package/dist/features/inapp/core/compat.d.ts +28 -0
- package/dist/features/inapp/core/compat.d.ts.map +1 -0
- package/dist/features/inapp/core/compat.js +104 -0
- package/dist/features/inapp/core/compat.js.map +1 -0
- package/dist/features/inapp/core/debugOverlay.d.ts +5 -0
- package/dist/features/inapp/core/debugOverlay.d.ts.map +1 -0
- package/dist/features/inapp/core/debugOverlay.js +79 -0
- package/dist/features/inapp/core/debugOverlay.js.map +1 -0
- package/dist/features/inapp/core/engine.d.ts +70 -0
- package/dist/features/inapp/core/engine.d.ts.map +1 -0
- package/dist/features/inapp/core/engine.js +248 -0
- package/dist/features/inapp/core/engine.js.map +1 -0
- package/dist/features/inapp/core/environment.d.ts +21 -0
- package/dist/features/inapp/core/environment.d.ts.map +1 -0
- package/dist/features/inapp/core/environment.js +57 -0
- package/dist/features/inapp/core/environment.js.map +1 -0
- package/dist/features/inapp/core/host.d.ts +53 -0
- package/dist/features/inapp/core/host.d.ts.map +1 -0
- package/dist/features/inapp/core/host.js +239 -0
- package/dist/features/inapp/core/host.js.map +1 -0
- package/dist/features/inapp/core/keyboard.d.ts +27 -0
- package/dist/features/inapp/core/keyboard.d.ts.map +1 -0
- package/dist/features/inapp/core/keyboard.js +69 -0
- package/dist/features/inapp/core/keyboard.js.map +1 -0
- package/dist/features/inapp/core/metrics.d.ts +73 -0
- package/dist/features/inapp/core/metrics.d.ts.map +1 -0
- package/dist/features/inapp/core/metrics.js +125 -0
- package/dist/features/inapp/core/metrics.js.map +1 -0
- package/dist/features/inapp/core/migration.d.ts +32 -0
- package/dist/features/inapp/core/migration.d.ts.map +1 -0
- package/dist/features/inapp/core/migration.js +28 -0
- package/dist/features/inapp/core/migration.js.map +1 -0
- package/dist/features/inapp/core/orchestrator.d.ts +77 -0
- package/dist/features/inapp/core/orchestrator.d.ts.map +1 -0
- package/dist/features/inapp/core/orchestrator.js +144 -0
- package/dist/features/inapp/core/orchestrator.js.map +1 -0
- package/dist/features/inapp/core/respect.d.ts +51 -0
- package/dist/features/inapp/core/respect.d.ts.map +1 -0
- package/dist/features/inapp/core/respect.js +78 -0
- package/dist/features/inapp/core/respect.js.map +1 -0
- package/dist/features/inapp/core/slots.d.ts +19 -0
- package/dist/features/inapp/core/slots.d.ts.map +1 -0
- package/dist/features/inapp/core/slots.js +53 -0
- package/dist/features/inapp/core/slots.js.map +1 -0
- package/dist/features/inapp/core/targeting.d.ts +58 -0
- package/dist/features/inapp/core/targeting.d.ts.map +1 -0
- package/dist/features/inapp/core/targeting.js +181 -0
- package/dist/features/inapp/core/targeting.js.map +1 -0
- package/dist/features/inapp/core/transport.d.ts +66 -0
- package/dist/features/inapp/core/transport.d.ts.map +1 -0
- package/dist/features/inapp/core/transport.js +154 -0
- package/dist/features/inapp/core/transport.js.map +1 -0
- package/dist/features/inapp/core/triggers.d.ts +94 -0
- package/dist/features/inapp/core/triggers.d.ts.map +1 -0
- package/dist/features/inapp/core/triggers.js +368 -0
- package/dist/features/inapp/core/triggers.js.map +1 -0
- package/dist/features/inapp/inappContract.web.d.ts +47 -0
- package/dist/features/inapp/inappContract.web.d.ts.map +1 -0
- package/dist/features/inapp/inappContract.web.js +219 -0
- package/dist/features/inapp/inappContract.web.js.map +1 -0
- package/dist/features/inapp/index.d.ts +23 -0
- package/dist/features/inapp/index.d.ts.map +1 -0
- package/dist/features/inapp/index.js +23 -0
- package/dist/features/inapp/index.js.map +1 -0
- package/dist/features/inapp/registry.canonical.hash.d.ts +7 -0
- package/dist/features/inapp/registry.canonical.hash.d.ts.map +1 -0
- package/dist/features/inapp/registry.canonical.hash.js +7 -0
- package/dist/features/inapp/registry.canonical.hash.js.map +1 -0
- package/dist/features/inapp/registry.web.canonical.d.ts +21 -0
- package/dist/features/inapp/registry.web.canonical.d.ts.map +1 -0
- package/dist/features/inapp/registry.web.canonical.js +136 -0
- package/dist/features/inapp/registry.web.canonical.js.map +1 -0
- package/dist/features/inapp/registry.web.catalog.d.ts +12 -0
- package/dist/features/inapp/registry.web.catalog.d.ts.map +1 -0
- package/dist/features/inapp/registry.web.catalog.js +208 -0
- package/dist/features/inapp/registry.web.catalog.js.map +1 -0
- package/dist/features/inapp/surfaces/banner.d.ts +7 -0
- package/dist/features/inapp/surfaces/banner.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/banner.js +30 -0
- package/dist/features/inapp/surfaces/banner.js.map +1 -0
- package/dist/features/inapp/surfaces/checklist.d.ts +13 -0
- package/dist/features/inapp/surfaces/checklist.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/checklist.js +127 -0
- package/dist/features/inapp/surfaces/checklist.js.map +1 -0
- package/dist/features/inapp/surfaces/coachmark.d.ts +10 -0
- package/dist/features/inapp/surfaces/coachmark.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/coachmark.js +92 -0
- package/dist/features/inapp/surfaces/coachmark.js.map +1 -0
- package/dist/features/inapp/surfaces/hotspot.d.ts +8 -0
- package/dist/features/inapp/surfaces/hotspot.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/hotspot.js +88 -0
- package/dist/features/inapp/surfaces/hotspot.js.map +1 -0
- package/dist/features/inapp/surfaces/inline.d.ts +13 -0
- package/dist/features/inapp/surfaces/inline.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/inline.js +72 -0
- package/dist/features/inapp/surfaces/inline.js.map +1 -0
- package/dist/features/inapp/surfaces/launcher.d.ts +9 -0
- package/dist/features/inapp/surfaces/launcher.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/launcher.js +54 -0
- package/dist/features/inapp/surfaces/launcher.js.map +1 -0
- package/dist/features/inapp/surfaces/modal.d.ts +8 -0
- package/dist/features/inapp/surfaces/modal.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/modal.js +70 -0
- package/dist/features/inapp/surfaces/modal.js.map +1 -0
- package/dist/features/inapp/surfaces/mount.d.ts +19 -0
- package/dist/features/inapp/surfaces/mount.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/mount.js +29 -0
- package/dist/features/inapp/surfaces/mount.js.map +1 -0
- package/dist/features/inapp/surfaces/palette.d.ts +9 -0
- package/dist/features/inapp/surfaces/palette.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/palette.js +127 -0
- package/dist/features/inapp/surfaces/palette.js.map +1 -0
- package/dist/features/inapp/surfaces/panel.d.ts +14 -0
- package/dist/features/inapp/surfaces/panel.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/panel.js +91 -0
- package/dist/features/inapp/surfaces/panel.js.map +1 -0
- package/dist/features/inapp/surfaces/popover.d.ts +10 -0
- package/dist/features/inapp/surfaces/popover.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/popover.js +66 -0
- package/dist/features/inapp/surfaces/popover.js.map +1 -0
- package/dist/features/inapp/surfaces/render.d.ts +34 -0
- package/dist/features/inapp/surfaces/render.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/render.js +52 -0
- package/dist/features/inapp/surfaces/render.js.map +1 -0
- package/dist/features/inapp/surfaces/slideover.d.ts +9 -0
- package/dist/features/inapp/surfaces/slideover.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/slideover.js +144 -0
- package/dist/features/inapp/surfaces/slideover.js.map +1 -0
- package/dist/features/inapp/surfaces/styles.d.ts +7 -0
- package/dist/features/inapp/surfaces/styles.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/styles.js +186 -0
- package/dist/features/inapp/surfaces/styles.js.map +1 -0
- package/dist/features/inapp/surfaces/surface.d.ts +69 -0
- package/dist/features/inapp/surfaces/surface.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/surface.js +80 -0
- package/dist/features/inapp/surfaces/surface.js.map +1 -0
- package/dist/features/inapp/surfaces/takeover.d.ts +9 -0
- package/dist/features/inapp/surfaces/takeover.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/takeover.js +60 -0
- package/dist/features/inapp/surfaces/takeover.js.map +1 -0
- package/dist/features/inapp/surfaces/toast.d.ts +7 -0
- package/dist/features/inapp/surfaces/toast.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/toast.js +48 -0
- package/dist/features/inapp/surfaces/toast.js.map +1 -0
- package/dist/features/inapp/surfaces/toolbar.d.ts +8 -0
- package/dist/features/inapp/surfaces/toolbar.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/toolbar.js +62 -0
- package/dist/features/inapp/surfaces/toolbar.js.map +1 -0
- package/dist/features/inapp/surfaces/tour.d.ts +14 -0
- package/dist/features/inapp/surfaces/tour.d.ts.map +1 -0
- package/dist/features/inapp/surfaces/tour.js +199 -0
- package/dist/features/inapp/surfaces/tour.js.map +1 -0
- package/dist/features/inapp/types.d.ts +163 -0
- package/dist/features/inapp/types.d.ts.map +1 -0
- package/dist/features/inapp/types.js +12 -0
- package/dist/features/inapp/types.js.map +1 -0
- package/dist/features/inbox/InboxFeature.d.ts +57 -0
- package/dist/features/inbox/InboxFeature.d.ts.map +1 -0
- package/dist/features/inbox/InboxFeature.js +225 -0
- package/dist/features/inbox/InboxFeature.js.map +1 -0
- package/dist/features/inbox/runtime.d.ts +67 -0
- package/dist/features/inbox/runtime.d.ts.map +1 -0
- package/dist/features/inbox/runtime.js +376 -0
- package/dist/features/inbox/runtime.js.map +1 -0
- package/dist/features/inbox/store.d.ts +37 -0
- package/dist/features/inbox/store.d.ts.map +1 -0
- package/dist/features/inbox/store.js +149 -0
- package/dist/features/inbox/store.js.map +1 -0
- package/dist/features/inbox/sync.d.ts +49 -0
- package/dist/features/inbox/sync.d.ts.map +1 -0
- package/dist/features/inbox/sync.js +131 -0
- package/dist/features/inbox/sync.js.map +1 -0
- package/dist/features/inbox/types.d.ts +275 -0
- package/dist/features/inbox/types.d.ts.map +1 -0
- package/dist/features/inbox/types.js +42 -0
- package/dist/features/inbox/types.js.map +1 -0
- package/dist/features/inbox/widget/InboxWidget.d.ts +16 -0
- package/dist/features/inbox/widget/InboxWidget.d.ts.map +1 -0
- package/dist/features/inbox/widget/InboxWidget.js +608 -0
- package/dist/features/inbox/widget/InboxWidget.js.map +1 -0
- package/dist/features/index.d.ts +21 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +2 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/journey/InteractionTracker.d.ts +34 -0
- package/dist/features/journey/InteractionTracker.d.ts.map +1 -0
- package/dist/features/journey/InteractionTracker.js +125 -0
- package/dist/features/journey/InteractionTracker.js.map +1 -0
- package/dist/features/journey/JourneyFeature.d.ts +18 -0
- package/dist/features/journey/JourneyFeature.d.ts.map +1 -0
- package/dist/features/journey/JourneyFeature.js +57 -0
- package/dist/features/journey/JourneyFeature.js.map +1 -0
- package/dist/features/journey/NavigationTracker.d.ts +16 -0
- package/dist/features/journey/NavigationTracker.d.ts.map +1 -0
- package/dist/features/journey/NavigationTracker.js +92 -0
- package/dist/features/journey/NavigationTracker.js.map +1 -0
- package/dist/features/journey/friction.d.ts +29 -0
- package/dist/features/journey/friction.d.ts.map +1 -0
- package/dist/features/journey/friction.js +65 -0
- package/dist/features/journey/friction.js.map +1 -0
- package/dist/features/manifest.d.ts +20 -0
- package/dist/features/manifest.d.ts.map +1 -0
- package/dist/features/manifest.js +76 -0
- package/dist/features/manifest.js.map +1 -0
- package/dist/features/network/NetworkFeature.d.ts +56 -0
- package/dist/features/network/NetworkFeature.d.ts.map +1 -0
- package/dist/features/network/NetworkFeature.js +235 -0
- package/dist/features/network/NetworkFeature.js.map +1 -0
- package/dist/features/network/capture/body.d.ts +31 -0
- package/dist/features/network/capture/body.d.ts.map +1 -0
- package/dist/features/network/capture/body.js +81 -0
- package/dist/features/network/capture/body.js.map +1 -0
- package/dist/features/network/classify.d.ts +21 -0
- package/dist/features/network/classify.d.ts.map +1 -0
- package/dist/features/network/classify.js +50 -0
- package/dist/features/network/classify.js.map +1 -0
- package/dist/features/network/dedup.d.ts +36 -0
- package/dist/features/network/dedup.d.ts.map +1 -0
- package/dist/features/network/dedup.js +68 -0
- package/dist/features/network/dedup.js.map +1 -0
- package/dist/features/network/fetchInterceptor.d.ts +20 -0
- package/dist/features/network/fetchInterceptor.d.ts.map +1 -0
- package/dist/features/network/fetchInterceptor.js +158 -0
- package/dist/features/network/fetchInterceptor.js.map +1 -0
- package/dist/features/network/intercept/beacon.d.ts +14 -0
- package/dist/features/network/intercept/beacon.d.ts.map +1 -0
- package/dist/features/network/intercept/beacon.js +56 -0
- package/dist/features/network/intercept/beacon.js.map +1 -0
- package/dist/features/network/intercept/sse.d.ts +16 -0
- package/dist/features/network/intercept/sse.d.ts.map +1 -0
- package/dist/features/network/intercept/sse.js +74 -0
- package/dist/features/network/intercept/sse.js.map +1 -0
- package/dist/features/network/intercept/streams.d.ts +23 -0
- package/dist/features/network/intercept/streams.d.ts.map +1 -0
- package/dist/features/network/intercept/streams.js +25 -0
- package/dist/features/network/intercept/streams.js.map +1 -0
- package/dist/features/network/intercept/websocket.d.ts +14 -0
- package/dist/features/network/intercept/websocket.d.ts.map +1 -0
- package/dist/features/network/intercept/websocket.js +97 -0
- package/dist/features/network/intercept/websocket.js.map +1 -0
- package/dist/features/network/lazy.d.ts +23 -0
- package/dist/features/network/lazy.d.ts.map +1 -0
- package/dist/features/network/lazy.js +65 -0
- package/dist/features/network/lazy.js.map +1 -0
- package/dist/features/network/normalize.d.ts +9 -0
- package/dist/features/network/normalize.d.ts.map +1 -0
- package/dist/features/network/normalize.js +49 -0
- package/dist/features/network/normalize.js.map +1 -0
- package/dist/features/network/parse/graphql.d.ts +17 -0
- package/dist/features/network/parse/graphql.d.ts.map +1 -0
- package/dist/features/network/parse/graphql.js +106 -0
- package/dist/features/network/parse/graphql.js.map +1 -0
- package/dist/features/network/parse/url.d.ts +12 -0
- package/dist/features/network/parse/url.d.ts.map +1 -0
- package/dist/features/network/parse/url.js +52 -0
- package/dist/features/network/parse/url.js.map +1 -0
- package/dist/features/network/sampler.d.ts +21 -0
- package/dist/features/network/sampler.d.ts.map +1 -0
- package/dist/features/network/sampler.js +25 -0
- package/dist/features/network/sampler.js.map +1 -0
- package/dist/features/network/size.d.ts +21 -0
- package/dist/features/network/size.d.ts.map +1 -0
- package/dist/features/network/size.js +63 -0
- package/dist/features/network/size.js.map +1 -0
- package/dist/features/network/timing.d.ts +41 -0
- package/dist/features/network/timing.d.ts.map +1 -0
- package/dist/features/network/timing.js +134 -0
- package/dist/features/network/timing.js.map +1 -0
- package/dist/features/network/tracing.d.ts +18 -0
- package/dist/features/network/tracing.d.ts.map +1 -0
- package/dist/features/network/tracing.js +46 -0
- package/dist/features/network/tracing.js.map +1 -0
- package/dist/features/network/types.d.ts +75 -0
- package/dist/features/network/types.d.ts.map +1 -0
- package/dist/features/network/types.js +2 -0
- package/dist/features/network/types.js.map +1 -0
- package/dist/features/network/xhrInterceptor.d.ts +12 -0
- package/dist/features/network/xhrInterceptor.d.ts.map +1 -0
- package/dist/features/network/xhrInterceptor.js +108 -0
- package/dist/features/network/xhrInterceptor.js.map +1 -0
- package/dist/features/performance/PerformanceFeature.d.ts +76 -0
- package/dist/features/performance/PerformanceFeature.d.ts.map +1 -0
- package/dist/features/performance/PerformanceFeature.js +265 -0
- package/dist/features/performance/PerformanceFeature.js.map +1 -0
- package/dist/features/performance/jankTap.d.ts +23 -0
- package/dist/features/performance/jankTap.d.ts.map +1 -0
- package/dist/features/performance/jankTap.js +20 -0
- package/dist/features/performance/jankTap.js.map +1 -0
- package/dist/features/performance/longTasks.d.ts +14 -0
- package/dist/features/performance/longTasks.d.ts.map +1 -0
- package/dist/features/performance/longTasks.js +55 -0
- package/dist/features/performance/longTasks.js.map +1 -0
- package/dist/features/performance/normalize.d.ts +15 -0
- package/dist/features/performance/normalize.d.ts.map +1 -0
- package/dist/features/performance/normalize.js +30 -0
- package/dist/features/performance/normalize.js.map +1 -0
- package/dist/features/performance/resources.d.ts +19 -0
- package/dist/features/performance/resources.d.ts.map +1 -0
- package/dist/features/performance/resources.js +78 -0
- package/dist/features/performance/resources.js.map +1 -0
- package/dist/features/performance/sampler.d.ts +10 -0
- package/dist/features/performance/sampler.d.ts.map +1 -0
- package/dist/features/performance/sampler.js +23 -0
- package/dist/features/performance/sampler.js.map +1 -0
- package/dist/features/performance/spa.d.ts +2 -0
- package/dist/features/performance/spa.d.ts.map +1 -0
- package/dist/features/performance/spa.js +40 -0
- package/dist/features/performance/spa.js.map +1 -0
- package/dist/features/performance/throttle.d.ts +21 -0
- package/dist/features/performance/throttle.d.ts.map +1 -0
- package/dist/features/performance/throttle.js +26 -0
- package/dist/features/performance/throttle.js.map +1 -0
- package/dist/features/performance/trace/context.d.ts +17 -0
- package/dist/features/performance/trace/context.d.ts.map +1 -0
- package/dist/features/performance/trace/context.js +33 -0
- package/dist/features/performance/trace/context.js.map +1 -0
- package/dist/features/performance/trace/index.d.ts +7 -0
- package/dist/features/performance/trace/index.d.ts.map +1 -0
- package/dist/features/performance/trace/index.js +6 -0
- package/dist/features/performance/trace/index.js.map +1 -0
- package/dist/features/performance/trace/pageload.d.ts +3 -0
- package/dist/features/performance/trace/pageload.d.ts.map +1 -0
- package/dist/features/performance/trace/pageload.js +34 -0
- package/dist/features/performance/trace/pageload.js.map +1 -0
- package/dist/features/performance/trace/transaction.d.ts +61 -0
- package/dist/features/performance/trace/transaction.d.ts.map +1 -0
- package/dist/features/performance/trace/transaction.js +90 -0
- package/dist/features/performance/trace/transaction.js.map +1 -0
- package/dist/features/performance/trace/types.d.ts +23 -0
- package/dist/features/performance/trace/types.d.ts.map +1 -0
- package/dist/features/performance/trace/types.js +10 -0
- package/dist/features/performance/trace/types.js.map +1 -0
- package/dist/features/performance/traces.d.ts +36 -0
- package/dist/features/performance/traces.d.ts.map +1 -0
- package/dist/features/performance/traces.js +50 -0
- package/dist/features/performance/traces.js.map +1 -0
- package/dist/features/profiler/ProfilerFeature.d.ts +28 -0
- package/dist/features/profiler/ProfilerFeature.d.ts.map +1 -0
- package/dist/features/profiler/ProfilerFeature.js +82 -0
- package/dist/features/profiler/ProfilerFeature.js.map +1 -0
- package/dist/features/profiler/capture.d.ts +8 -0
- package/dist/features/profiler/capture.d.ts.map +1 -0
- package/dist/features/profiler/capture.js +21 -0
- package/dist/features/profiler/capture.js.map +1 -0
- package/dist/features/push/PushFeature.d.ts +120 -0
- package/dist/features/push/PushFeature.d.ts.map +1 -0
- package/dist/features/push/PushFeature.js +319 -0
- package/dist/features/push/PushFeature.js.map +1 -0
- package/dist/features/push/diagnostics.d.ts +55 -0
- package/dist/features/push/diagnostics.d.ts.map +1 -0
- package/dist/features/push/diagnostics.js +383 -0
- package/dist/features/push/diagnostics.js.map +1 -0
- package/dist/features/push/pushState.d.ts +58 -0
- package/dist/features/push/pushState.d.ts.map +1 -0
- package/dist/features/push/pushState.js +75 -0
- package/dist/features/push/pushState.js.map +1 -0
- package/dist/features/push/softAsk.d.ts +68 -0
- package/dist/features/push/softAsk.d.ts.map +1 -0
- package/dist/features/push/softAsk.js +141 -0
- package/dist/features/push/softAsk.js.map +1 -0
- package/dist/features/replay/ReplayFeature.d.ts +32 -0
- package/dist/features/replay/ReplayFeature.d.ts.map +1 -0
- package/dist/features/replay/ReplayFeature.js +132 -0
- package/dist/features/replay/ReplayFeature.js.map +1 -0
- package/dist/features/replay/engine/canvas.d.ts +45 -0
- package/dist/features/replay/engine/canvas.d.ts.map +1 -0
- package/dist/features/replay/engine/canvas.js +122 -0
- package/dist/features/replay/engine/canvas.js.map +1 -0
- package/dist/features/replay/engine/crossOrigin.d.ts +23 -0
- package/dist/features/replay/engine/crossOrigin.d.ts.map +1 -0
- package/dist/features/replay/engine/crossOrigin.js +108 -0
- package/dist/features/replay/engine/crossOrigin.js.map +1 -0
- package/dist/features/replay/engine/cssom.d.ts +31 -0
- package/dist/features/replay/engine/cssom.d.ts.map +1 -0
- package/dist/features/replay/engine/cssom.js +128 -0
- package/dist/features/replay/engine/cssom.js.map +1 -0
- package/dist/features/replay/engine/iframe.d.ts +65 -0
- package/dist/features/replay/engine/iframe.d.ts.map +1 -0
- package/dist/features/replay/engine/iframe.js +186 -0
- package/dist/features/replay/engine/iframe.js.map +1 -0
- package/dist/features/replay/engine/interactions.d.ts +142 -0
- package/dist/features/replay/engine/interactions.d.ts.map +1 -0
- package/dist/features/replay/engine/interactions.js +371 -0
- package/dist/features/replay/engine/interactions.js.map +1 -0
- package/dist/features/replay/engine/mutations.d.ts +49 -0
- package/dist/features/replay/engine/mutations.d.ts.map +1 -0
- package/dist/features/replay/engine/mutations.js +261 -0
- package/dist/features/replay/engine/mutations.js.map +1 -0
- package/dist/features/replay/engine/nodeRegistry.d.ts +23 -0
- package/dist/features/replay/engine/nodeRegistry.d.ts.map +1 -0
- package/dist/features/replay/engine/nodeRegistry.js +51 -0
- package/dist/features/replay/engine/nodeRegistry.js.map +1 -0
- package/dist/features/replay/engine/player.d.ts +11 -0
- package/dist/features/replay/engine/player.d.ts.map +1 -0
- package/dist/features/replay/engine/player.js +284 -0
- package/dist/features/replay/engine/player.js.map +1 -0
- package/dist/features/replay/engine/rebuild.d.ts +8 -0
- package/dist/features/replay/engine/rebuild.d.ts.map +1 -0
- package/dist/features/replay/engine/rebuild.js +46 -0
- package/dist/features/replay/engine/rebuild.js.map +1 -0
- package/dist/features/replay/engine/replayWorker.d.ts +33 -0
- package/dist/features/replay/engine/replayWorker.d.ts.map +1 -0
- package/dist/features/replay/engine/replayWorker.js +175 -0
- package/dist/features/replay/engine/replayWorker.js.map +1 -0
- package/dist/features/replay/engine/resources.d.ts +52 -0
- package/dist/features/replay/engine/resources.d.ts.map +1 -0
- package/dist/features/replay/engine/resources.js +132 -0
- package/dist/features/replay/engine/resources.js.map +1 -0
- package/dist/features/replay/engine/snapshot.d.ts +103 -0
- package/dist/features/replay/engine/snapshot.d.ts.map +1 -0
- package/dist/features/replay/engine/snapshot.js +409 -0
- package/dist/features/replay/engine/snapshot.js.map +1 -0
- package/dist/features/replay/engine/traverse.d.ts +19 -0
- package/dist/features/replay/engine/traverse.d.ts.map +1 -0
- package/dist/features/replay/engine/traverse.js +39 -0
- package/dist/features/replay/engine/traverse.js.map +1 -0
- package/dist/features/replay/engine/types.d.ts +137 -0
- package/dist/features/replay/engine/types.d.ts.map +1 -0
- package/dist/features/replay/engine/types.js +6 -0
- package/dist/features/replay/engine/types.js.map +1 -0
- package/dist/features/replay/engine/webglPatch.d.ts +26 -0
- package/dist/features/replay/engine/webglPatch.d.ts.map +1 -0
- package/dist/features/replay/engine/webglPatch.js +83 -0
- package/dist/features/replay/engine/webglPatch.js.map +1 -0
- package/dist/features/replay/lifecycle/adaptive.d.ts +38 -0
- package/dist/features/replay/lifecycle/adaptive.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/adaptive.js +90 -0
- package/dist/features/replay/lifecycle/adaptive.js.map +1 -0
- package/dist/features/replay/lifecycle/cadence.d.ts +20 -0
- package/dist/features/replay/lifecycle/cadence.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/cadence.js +62 -0
- package/dist/features/replay/lifecycle/cadence.js.map +1 -0
- package/dist/features/replay/lifecycle/deviceSignals.d.ts +35 -0
- package/dist/features/replay/lifecycle/deviceSignals.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/deviceSignals.js +61 -0
- package/dist/features/replay/lifecycle/deviceSignals.js.map +1 -0
- package/dist/features/replay/lifecycle/pii.d.ts +14 -0
- package/dist/features/replay/lifecycle/pii.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/pii.js +52 -0
- package/dist/features/replay/lifecycle/pii.js.map +1 -0
- package/dist/features/replay/lifecycle/recorder.d.ts +129 -0
- package/dist/features/replay/lifecycle/recorder.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/recorder.js +509 -0
- package/dist/features/replay/lifecycle/recorder.js.map +1 -0
- package/dist/features/replay/lifecycle/sampling.d.ts +28 -0
- package/dist/features/replay/lifecycle/sampling.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/sampling.js +31 -0
- package/dist/features/replay/lifecycle/sampling.js.map +1 -0
- package/dist/features/replay/lifecycle/segmentBuffer.d.ts +75 -0
- package/dist/features/replay/lifecycle/segmentBuffer.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/segmentBuffer.js +130 -0
- package/dist/features/replay/lifecycle/segmentBuffer.js.map +1 -0
- package/dist/features/replay/lifecycle/viewContext.d.ts +7 -0
- package/dist/features/replay/lifecycle/viewContext.d.ts.map +1 -0
- package/dist/features/replay/lifecycle/viewContext.js +51 -0
- package/dist/features/replay/lifecycle/viewContext.js.map +1 -0
- package/dist/features/scroll/index.d.ts +31 -0
- package/dist/features/scroll/index.d.ts.map +1 -0
- package/dist/features/scroll/index.js +102 -0
- package/dist/features/scroll/index.js.map +1 -0
- package/dist/features/session/sessionManager.d.ts +25 -0
- package/dist/features/session/sessionManager.d.ts.map +1 -0
- package/dist/features/session/sessionManager.js +36 -0
- package/dist/features/session/sessionManager.js.map +1 -0
- package/dist/features/session/sessionStore.d.ts +106 -0
- package/dist/features/session/sessionStore.d.ts.map +1 -0
- package/dist/features/session/sessionStore.js +265 -0
- package/dist/features/session/sessionStore.js.map +1 -0
- package/dist/features/watchdog/WatchdogFeature.d.ts +23 -0
- package/dist/features/watchdog/WatchdogFeature.d.ts.map +1 -0
- package/dist/features/watchdog/WatchdogFeature.js +29 -0
- package/dist/features/watchdog/WatchdogFeature.js.map +1 -0
- package/dist/features/watchdog/collectors.d.ts +18 -0
- package/dist/features/watchdog/collectors.d.ts.map +1 -0
- package/dist/features/watchdog/collectors.js +107 -0
- package/dist/features/watchdog/collectors.js.map +1 -0
- package/dist/features/watchdog/config.d.ts +51 -0
- package/dist/features/watchdog/config.d.ts.map +1 -0
- package/dist/features/watchdog/config.js +28 -0
- package/dist/features/watchdog/config.js.map +1 -0
- package/dist/features/watchdog/engine.d.ts +22 -0
- package/dist/features/watchdog/engine.d.ts.map +1 -0
- package/dist/features/watchdog/engine.js +123 -0
- package/dist/features/watchdog/engine.js.map +1 -0
- package/dist/features/watchdog/incidents.d.ts +79 -0
- package/dist/features/watchdog/incidents.d.ts.map +1 -0
- package/dist/features/watchdog/incidents.js +204 -0
- package/dist/features/watchdog/incidents.js.map +1 -0
- package/dist/features/watchdog/rollup.d.ts +41 -0
- package/dist/features/watchdog/rollup.d.ts.map +1 -0
- package/dist/features/watchdog/rollup.js +76 -0
- package/dist/features/watchdog/rollup.js.map +1 -0
- package/dist/features/webVitals/WebVitalsFeature.d.ts +46 -0
- package/dist/features/webVitals/WebVitalsFeature.d.ts.map +1 -0
- package/dist/features/webVitals/WebVitalsFeature.js +252 -0
- package/dist/features/webVitals/WebVitalsFeature.js.map +1 -0
- package/dist/features/webVitals/attribution.d.ts +50 -0
- package/dist/features/webVitals/attribution.d.ts.map +1 -0
- package/dist/features/webVitals/attribution.js +186 -0
- package/dist/features/webVitals/attribution.js.map +1 -0
- package/dist/features/webVitals/observe.d.ts +6 -0
- package/dist/features/webVitals/observe.d.ts.map +1 -0
- package/dist/features/webVitals/observe.js +6 -0
- package/dist/features/webVitals/observe.js.map +1 -0
- package/dist/features/webVitals/vitals.d.ts +99 -0
- package/dist/features/webVitals/vitals.d.ts.map +1 -0
- package/dist/features/webVitals/vitals.js +166 -0
- package/dist/features/webVitals/vitals.js.map +1 -0
- package/dist/features/webperf/WebPerfFeature.d.ts +19 -0
- package/dist/features/webperf/WebPerfFeature.d.ts.map +1 -0
- package/dist/features/webperf/WebPerfFeature.js +48 -0
- package/dist/features/webperf/WebPerfFeature.js.map +1 -0
- package/dist/features/webperf/collectors.d.ts +3 -0
- package/dist/features/webperf/collectors.d.ts.map +1 -0
- package/dist/features/webperf/collectors.js +118 -0
- package/dist/features/webperf/collectors.js.map +1 -0
- package/dist/features/webperf/math.d.ts +12 -0
- package/dist/features/webperf/math.d.ts.map +1 -0
- package/dist/features/webperf/math.js +26 -0
- package/dist/features/webperf/math.js.map +1 -0
- package/dist/inapp.d.ts +6 -0
- package/dist/inapp.d.ts.map +1 -0
- package/dist/inapp.js +6 -0
- package/dist/inapp.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/index.d.ts +7 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +2 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/pipeline/index.d.ts +3 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +3 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/pipeline.d.ts +84 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +284 -0
- package/dist/pipeline/pipeline.js.map +1 -0
- package/dist/public/ScaleBunFacade.d.ts +382 -0
- package/dist/public/ScaleBunFacade.d.ts.map +1 -0
- package/dist/public/ScaleBunFacade.js +787 -0
- package/dist/public/ScaleBunFacade.js.map +1 -0
- package/dist/public/index.d.ts +5 -0
- package/dist/public/index.d.ts.map +1 -0
- package/dist/public/index.js +4 -0
- package/dist/public/index.js.map +1 -0
- package/dist/public/typedTracker.d.ts +91 -0
- package/dist/public/typedTracker.d.ts.map +1 -0
- package/dist/public/typedTracker.js +60 -0
- package/dist/public/typedTracker.js.map +1 -0
- package/dist/scalebun-push-sw.js +236 -0
- package/dist/scalebun.min.js +635 -0
- package/dist/scalebun.min.js.map +7 -0
- package/dist/storage/idb.d.ts +16 -0
- package/dist/storage/idb.d.ts.map +1 -0
- package/dist/storage/idb.js +76 -0
- package/dist/storage/idb.js.map +1 -0
- package/dist/storage/index.d.ts +3 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +3 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/transport/gzip.d.ts +2 -0
- package/dist/transport/gzip.d.ts.map +1 -0
- package/dist/transport/gzip.js +20 -0
- package/dist/transport/gzip.js.map +1 -0
- package/dist/transport/httpClient.d.ts +60 -0
- package/dist/transport/httpClient.d.ts.map +1 -0
- package/dist/transport/httpClient.js +154 -0
- package/dist/transport/httpClient.js.map +1 -0
- package/dist/transport/index.d.ts +3 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +3 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/transport/sign.d.ts +25 -0
- package/dist/transport/sign.d.ts.map +1 -0
- package/dist/transport/sign.js +58 -0
- package/dist/transport/sign.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IAM 2.0 Engagement Orchestrator (spec §8, P0.5) — attention as a scheduled resource.
|
|
3
|
+
*
|
|
4
|
+
* `decide()` is a **pure function**: same (candidates, occupants, budget, ctx) → same decisions. It is
|
|
5
|
+
* the window manager for attention. Nothing renders by "appearing"; every eligible+triggered candidate
|
|
6
|
+
* passes the deterministic pipeline (§8.5) and gets exactly one verdict:
|
|
7
|
+
* SHOW | QUEUE(until safe) | DEFER(context) | DROP(reason) | PREEMPT(loser)
|
|
8
|
+
* Every decision carries a reason so §10 can observe/replay-correlate the full arbitration.
|
|
9
|
+
*
|
|
10
|
+
* The reference fixture (§8.8) — critical banner + tour + toast + AI panel + checklist, all live —
|
|
11
|
+
* is enforced by orchestrator.test.ts as a deterministic snapshot.
|
|
12
|
+
*/
|
|
13
|
+
import type { Category, FocusClass, PriorityTier, Zone } from '../types';
|
|
14
|
+
export type Action = 'SHOW' | 'QUEUE' | 'DEFER' | 'DROP' | 'PREEMPT';
|
|
15
|
+
/** A fully-resolved candidate — the engine fills zone/focus/cost/tier from the contract maps so
|
|
16
|
+
* `decide` stays a pure function of its arguments (no table lookups, no DOM). */
|
|
17
|
+
export interface Candidate {
|
|
18
|
+
id: string;
|
|
19
|
+
campaignId?: string;
|
|
20
|
+
zone: Zone;
|
|
21
|
+
focus: FocusClass;
|
|
22
|
+
/** attention cost (§8.3). 0 ⇒ ambient/passive (spends no budget). */
|
|
23
|
+
cost: number;
|
|
24
|
+
tier: PriorityTier;
|
|
25
|
+
category: Category;
|
|
26
|
+
/** author campaign priority 0..100 (§8.2). */
|
|
27
|
+
campaignPriority?: number;
|
|
28
|
+
/** never auto-interrupt — opens only on user action (AI panel, palette, launcher). */
|
|
29
|
+
interactionOnly?: boolean;
|
|
30
|
+
/** guidance surface (tour/coachmark/hotspot) — deferred while an alert is live (§8.5). */
|
|
31
|
+
guidance?: boolean;
|
|
32
|
+
triggeredAt: number;
|
|
33
|
+
}
|
|
34
|
+
export interface Occupant {
|
|
35
|
+
id: string;
|
|
36
|
+
zone: Zone;
|
|
37
|
+
focus: FocusClass;
|
|
38
|
+
tier: PriorityTier;
|
|
39
|
+
}
|
|
40
|
+
export interface Budget {
|
|
41
|
+
/** remaining attention tokens in the current rolling window. */
|
|
42
|
+
tokens: number;
|
|
43
|
+
interruptionsThisSession: number;
|
|
44
|
+
maxInterruptionsPerSession: number;
|
|
45
|
+
modalsToday: number;
|
|
46
|
+
maxModalsPerDay: number;
|
|
47
|
+
lastInterruptionAt: number;
|
|
48
|
+
minCooldownMs: number;
|
|
49
|
+
}
|
|
50
|
+
export type GuardVerdict = {
|
|
51
|
+
action: 'DEFER' | 'DROP';
|
|
52
|
+
reason: string;
|
|
53
|
+
} | null;
|
|
54
|
+
export interface DecideCtx {
|
|
55
|
+
now: number;
|
|
56
|
+
/** §11 RespectGuard verdict per candidate (typing/fullscreen/DND/first-load). null ⇒ allowed. */
|
|
57
|
+
guard?: (c: Candidate) => GuardVerdict;
|
|
58
|
+
}
|
|
59
|
+
export interface Decision {
|
|
60
|
+
id: string;
|
|
61
|
+
action: Action;
|
|
62
|
+
reason: string;
|
|
63
|
+
zone: Zone;
|
|
64
|
+
score: number;
|
|
65
|
+
/** for PREEMPT: the live occupant being displaced. */
|
|
66
|
+
preempts?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function scoreOf(c: Candidate, now: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* The deterministic arbitration pipeline. Processes candidates in descending score so higher-priority
|
|
71
|
+
* decisions constrain lower ones within the same tick (a shown interruption puts later ones on
|
|
72
|
+
* cooldown; a shown alert defers guidance).
|
|
73
|
+
*/
|
|
74
|
+
export declare function decide(candidates: Candidate[], occupants: Occupant[], budget: Budget, ctx: DecideCtx): Decision[];
|
|
75
|
+
/** Default conservative attention budget (§8.3). */
|
|
76
|
+
export declare function defaultBudget(): Budget;
|
|
77
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../../src/features/inapp/core/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEzE,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAErE;kFACkF;AAClF,MAAM,WAAW,SAAS;IACxB,EAAE,EA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,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGzD;AAID;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,UAAU,EAAE,SAAS,EAAE,EACvB,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,SAAS,GACb,QAAQ,EAAE,CAsHZ;AAED,oDAAoD;AACpD,wBAAgB,aAAa,IAAI,MAAM,CAUtC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// ── Scoring (§8.2) ────────────────────────────────────────────────────────────
|
|
2
|
+
const TIER_WEIGHT = {
|
|
3
|
+
critical: 1000,
|
|
4
|
+
high: 400,
|
|
5
|
+
normal: 200,
|
|
6
|
+
low: 100,
|
|
7
|
+
passive: 50,
|
|
8
|
+
};
|
|
9
|
+
const CATEGORY_BOOST = {
|
|
10
|
+
security: 300,
|
|
11
|
+
system: 250,
|
|
12
|
+
billing: 200,
|
|
13
|
+
};
|
|
14
|
+
const TIER_RANK = { critical: 4, high: 3, normal: 2, low: 1, passive: 0 };
|
|
15
|
+
export function scoreOf(c, now) {
|
|
16
|
+
const recency = Math.max(0, Math.min(120, 120 - (now - c.triggeredAt) / 1000));
|
|
17
|
+
return TIER_WEIGHT[c.tier] + (c.campaignPriority ?? 0) + recency + (CATEGORY_BOOST[c.category] ?? 0);
|
|
18
|
+
}
|
|
19
|
+
const isFocusStealing = (z) => z === 'modal' || z === 'takeover';
|
|
20
|
+
/**
|
|
21
|
+
* The deterministic arbitration pipeline. Processes candidates in descending score so higher-priority
|
|
22
|
+
* decisions constrain lower ones within the same tick (a shown interruption puts later ones on
|
|
23
|
+
* cooldown; a shown alert defers guidance).
|
|
24
|
+
*/
|
|
25
|
+
export function decide(candidates, occupants, budget, ctx) {
|
|
26
|
+
const now = ctx.now;
|
|
27
|
+
const scored = candidates
|
|
28
|
+
.map((c) => ({ c, score: scoreOf(c, now) }))
|
|
29
|
+
.sort((a, b) => b.score - a.score || a.c.id.localeCompare(b.c.id)); // stable, deterministic
|
|
30
|
+
const decisions = [];
|
|
31
|
+
const emit = (c, action, reason, score, preempts) => decisions.push({ id: c.id, action, reason, zone: c.zone, score, preempts });
|
|
32
|
+
// Running tick state — mutated as we accept SHOW/PREEMPT decisions.
|
|
33
|
+
const bestCampaign = new Map(); // campaignId → best score seen (dedupe)
|
|
34
|
+
const zoneWinner = new Map(); // zone → id that took it this tick
|
|
35
|
+
const toastLive = occupants.filter((o) => o.zone === 'toast').length;
|
|
36
|
+
let toastShown = 0;
|
|
37
|
+
let focusStealerLive = occupants.some((o) => isFocusStealing(o.zone));
|
|
38
|
+
let interruptionFiredThisTick = false;
|
|
39
|
+
let alertLive = occupants.some((o) => o.tier === 'critical') || false; // a live critical surface = "alert on screen"
|
|
40
|
+
let tokens = budget.tokens;
|
|
41
|
+
let interruptions = budget.interruptionsThisSession;
|
|
42
|
+
let modals = budget.modalsToday;
|
|
43
|
+
let lastInterruptionAt = budget.lastInterruptionAt;
|
|
44
|
+
for (const { c, score } of scored) {
|
|
45
|
+
// 1. dedupe per campaign — the top-scoring variant of a campaign wins; the rest DROP.
|
|
46
|
+
if (c.campaignId) {
|
|
47
|
+
if (bestCampaign.has(c.campaignId)) {
|
|
48
|
+
emit(c, 'DROP', 'dedupe:campaign', score);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
bestCampaign.set(c.campaignId, score);
|
|
52
|
+
}
|
|
53
|
+
// 2. RespectGuard (§11) — hard context vetoes.
|
|
54
|
+
const g = ctx.guard?.(c);
|
|
55
|
+
if (g) {
|
|
56
|
+
emit(c, g.action, g.reason, score);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
// 3. interaction-only surfaces never auto-interrupt.
|
|
60
|
+
if (c.interactionOnly) {
|
|
61
|
+
emit(c, 'DEFER', 'interaction-only', score);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
// 4. guidance must not overlay a live alert.
|
|
65
|
+
if (c.guidance && alertLive) {
|
|
66
|
+
emit(c, 'DEFER', 'defer-until-clear', score);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
// 5. per-zone arbitration — one active winner per zone (toast is the multi-slot exception).
|
|
70
|
+
const cap = c.zone === 'toast' ? 3 : 1;
|
|
71
|
+
if (cap === 1 && zoneWinner.has(c.zone)) {
|
|
72
|
+
// a higher-scoring candidate already claimed this zone this tick.
|
|
73
|
+
emit(c, c.cost > 0 ? 'QUEUE' : 'DROP', c.cost > 0 ? 'queue:zone-busy' : 'zone-lost', score);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
// 6. global focus-stealing mutual exclusion (one blocking surface, ever — §8.7).
|
|
77
|
+
if (isFocusStealing(c.zone) && focusStealerLive) {
|
|
78
|
+
emit(c, 'QUEUE', 'queue:focus-busy', score);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
// 7. toast stack cap (≤3 incl. live).
|
|
82
|
+
if (c.zone === 'toast' && toastLive + toastShown >= 3) {
|
|
83
|
+
emit(c, 'QUEUE', 'queue:toast-cap', score);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
// 8. attention budget + cooldown (interruptive only; ambient/passive are free).
|
|
87
|
+
if (c.cost > 0) {
|
|
88
|
+
if (interruptions >= budget.maxInterruptionsPerSession) {
|
|
89
|
+
emit(c, 'QUEUE', 'queue:budget:interruptions', score);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (c.zone === 'modal' && modals >= budget.maxModalsPerDay) {
|
|
93
|
+
emit(c, 'QUEUE', 'queue:budget:modals', score);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (interruptionFiredThisTick || now - lastInterruptionAt < budget.minCooldownMs) {
|
|
97
|
+
emit(c, 'QUEUE', 'queue:cooldown', score);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (tokens < c.cost) {
|
|
101
|
+
emit(c, 'QUEUE', 'queue:budget:tokens', score);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// 9. preemption — a critical winner may displace a live *ambient* lower-tier occupant of its zone.
|
|
106
|
+
let preempts;
|
|
107
|
+
if (c.tier === 'critical') {
|
|
108
|
+
const victim = occupants.find((o) => o.zone === c.zone && !isFocusStealing(o.zone) && TIER_RANK[o.tier] < TIER_RANK.critical);
|
|
109
|
+
if (victim)
|
|
110
|
+
preempts = victim.id;
|
|
111
|
+
}
|
|
112
|
+
// ── ACCEPT ──
|
|
113
|
+
emit(c, preempts ? 'PREEMPT' : 'SHOW', preempts ? 'preempt:critical' : 'show', score, preempts);
|
|
114
|
+
zoneWinner.set(c.zone, c.id);
|
|
115
|
+
if (c.zone === 'toast')
|
|
116
|
+
toastShown++;
|
|
117
|
+
if (isFocusStealing(c.zone))
|
|
118
|
+
focusStealerLive = true;
|
|
119
|
+
if (c.tier === 'critical')
|
|
120
|
+
alertLive = true;
|
|
121
|
+
if (c.cost > 0) {
|
|
122
|
+
tokens -= c.cost;
|
|
123
|
+
interruptions++;
|
|
124
|
+
if (c.zone === 'modal')
|
|
125
|
+
modals++;
|
|
126
|
+
interruptionFiredThisTick = true;
|
|
127
|
+
lastInterruptionAt = now;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return decisions;
|
|
131
|
+
}
|
|
132
|
+
/** Default conservative attention budget (§8.3). */
|
|
133
|
+
export function defaultBudget() {
|
|
134
|
+
return {
|
|
135
|
+
tokens: 5,
|
|
136
|
+
interruptionsThisSession: 0,
|
|
137
|
+
maxInterruptionsPerSession: 3,
|
|
138
|
+
modalsToday: 0,
|
|
139
|
+
maxModalsPerDay: 2,
|
|
140
|
+
lastInterruptionAt: 0,
|
|
141
|
+
minCooldownMs: 90000,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../../src/features/inapp/core/orchestrator.ts"],"names":[],"mappings":"AAwEA,iFAAiF;AACjF,MAAM,WAAW,GAAiC;IAChD,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,EAAE;CACZ,CAAC;AACF,MAAM,cAAc,GAAsC;IACxD,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;CACb,CAAC;AACF,MAAM,SAAS,GAAiC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAExG,MAAM,UAAU,OAAO,CAAC,CAAY,EAAE,GAAW;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/E,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACvG,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,UAAU,CAAC;AAEvE;;;;GAIG;AACH,MAAM,UAAU,MAAM,CACpB,UAAuB,EACvB,SAAqB,EACrB,MAAc,EACd,GAAc;IAEd,MAAM,GAA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AI,CAAC;YAAE,gBAAgB,GAAG,IAAI,CAAC;QACrD,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU;YAAE,SAAS,GAAG,IAAI,CAAC;QAC5C,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC;YACjB,aAAa,EAAE,CAAC;YAChB,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;gBAAE,MAAM,EAAE,CAAC;YACjC,yBAAyB,GAAG,IAAI,CAAC;YACjC,kBAAkB,GAAG,GAAG,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,MAAM,EAAE,CAAC;QACT,wBAAwB,EAAE,CAAC;QAC3B,0BAA0B,EAAE,CAAC;QAC7B,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,CAAC;QAClB,kBAAkB,EAAE,CAAC;QACrB,aAAa,EAAE,KAAM;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IAM 2.0 RespectGuard (spec §11, P0.6) — "never annoy the user" as an enforced policy.
|
|
3
|
+
*
|
|
4
|
+
* Produces the per-candidate veto the Orchestrator consumes (`ctx.guard`). It encodes the hard
|
|
5
|
+
* invariants: never interrupt while the user is typing, in fullscreen/presentation, during the
|
|
6
|
+
* first-load grace window, under Do-Not-Disturb, or when the user is fatigued (consecutive
|
|
7
|
+
* dismissals → global back-off). Vetoes are almost always **DEFER** (transient — retry at a safe
|
|
8
|
+
* moment), never a silent DROP, so a message waits its turn instead of being lost.
|
|
9
|
+
*
|
|
10
|
+
* Crucially, guards apply only to surfaces that *can* annoy — interruptive (cost > 0), focus-stealing,
|
|
11
|
+
* or guidance. Ambient/passive surfaces (hints, inbox, hotspots) are never vetoed: they don't
|
|
12
|
+
* interrupt, so respecting the user never means hiding them.
|
|
13
|
+
*/
|
|
14
|
+
import type { Candidate, GuardVerdict } from './orchestrator';
|
|
15
|
+
export interface RespectProbes {
|
|
16
|
+
isTyping?: () => boolean;
|
|
17
|
+
isFullscreen?: () => boolean;
|
|
18
|
+
isDnd?: () => boolean;
|
|
19
|
+
/** Tab-awareness (P3.8) — a backgrounded tab should never interrupt. */
|
|
20
|
+
isHidden?: () => boolean;
|
|
21
|
+
now?: () => number;
|
|
22
|
+
}
|
|
23
|
+
export interface RespectConfig {
|
|
24
|
+
/** Grace window after page load during which nothing interrupts (ms). */
|
|
25
|
+
firstLoadGraceMs?: number;
|
|
26
|
+
/** Consecutive dismissals before the fatigue back-off kicks in. */
|
|
27
|
+
fatigueThreshold?: number;
|
|
28
|
+
loadedAt?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare class RespectGuard {
|
|
31
|
+
private isTyping;
|
|
32
|
+
private isFullscreen;
|
|
33
|
+
private isDnd;
|
|
34
|
+
private isHidden;
|
|
35
|
+
private now;
|
|
36
|
+
private graceMs;
|
|
37
|
+
private fatigueThreshold;
|
|
38
|
+
private loadedAt;
|
|
39
|
+
private consecutiveDismissals;
|
|
40
|
+
constructor(probes?: RespectProbes, config?: RespectConfig);
|
|
41
|
+
/** True for surfaces capable of interrupting/annoying — the only ones guards apply to. */
|
|
42
|
+
private canAnnoy;
|
|
43
|
+
/** The verdict fn to hand the Orchestrator. null ⇒ allowed. */
|
|
44
|
+
readonly guard: (c: Candidate) => GuardVerdict;
|
|
45
|
+
/** Fatigue tracking — a dismissal shrinks tolerance; an engagement resets it (§8.3 fatigue decay). */
|
|
46
|
+
recordDismiss(): void;
|
|
47
|
+
recordEngagement(): void;
|
|
48
|
+
/** Toggle Do-Not-Disturb (persisted). */
|
|
49
|
+
static setDnd(on: boolean): void;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=respect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respect.d.ts","sourceRo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@
|
|
|
1
|
+
const DND_KEY = 'scalebun_inapp_dnd';
|
|
2
|
+
function defaultIsTyping() {
|
|
3
|
+
if (typeof document === 'undefined')
|
|
4
|
+
return false;
|
|
5
|
+
const el = document.activeElement;
|
|
6
|
+
if (!el)
|
|
7
|
+
return false;
|
|
8
|
+
const tag = el.tagName;
|
|
9
|
+
return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || el.isContentEditable === true;
|
|
10
|
+
}
|
|
11
|
+
function defaultIsFullscreen() {
|
|
12
|
+
if (typeof document === 'undefined')
|
|
13
|
+
return false;
|
|
14
|
+
return !!document.fullscreenElement;
|
|
15
|
+
}
|
|
16
|
+
function defaultIsDnd() {
|
|
17
|
+
try {
|
|
18
|
+
return typeof localStorage !== 'undefined' && localStorage.getItem(DND_KEY) === '1';
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class RespectGuard {
|
|
25
|
+
constructor(probes = {}, config = {}) {
|
|
26
|
+
this.consecutiveDismissals = 0;
|
|
27
|
+
/** The verdict fn to hand the Orchestrator. null ⇒ allowed. */
|
|
28
|
+
this.guard = (c) => {
|
|
29
|
+
if (!this.canAnnoy(c))
|
|
30
|
+
return null; // ambient/passive: respecting the user ≠ hiding it
|
|
31
|
+
if (this.isHidden())
|
|
32
|
+
return { action: 'DEFER', reason: 'respect:hidden' };
|
|
33
|
+
if (this.isTyping())
|
|
34
|
+
return { action: 'DEFER', reason: 'respect:typing' };
|
|
35
|
+
if (this.isFullscreen())
|
|
36
|
+
return { action: 'DEFER', reason: 'respect:fullscreen' };
|
|
37
|
+
if (this.now() - this.loadedAt < this.graceMs)
|
|
38
|
+
return { action: 'DEFER', reason: 'respect:first-load' };
|
|
39
|
+
if (this.isDnd())
|
|
40
|
+
return { action: 'DEFER', reason: 'respect:dnd' };
|
|
41
|
+
if (this.consecutiveDismissals >= this.fatigueThreshold)
|
|
42
|
+
return { action: 'DEFER', reason: 'respect:fatigue' };
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
45
|
+
this.isTyping = probes.isTyping ?? defaultIsTyping;
|
|
46
|
+
this.isFullscreen = probes.isFullscreen ?? defaultIsFullscreen;
|
|
47
|
+
this.isDnd = probes.isDnd ?? defaultIsDnd;
|
|
48
|
+
this.isHidden = probes.isHidden ?? (() => typeof document !== 'undefined' && document.visibilityState === 'hidden');
|
|
49
|
+
this.now = probes.now ?? (() => Date.now());
|
|
50
|
+
this.graceMs = config.firstLoadGraceMs ?? 3000;
|
|
51
|
+
this.fatigueThreshold = config.fatigueThreshold ?? 2;
|
|
52
|
+
this.loadedAt = config.loadedAt ?? this.now();
|
|
53
|
+
}
|
|
54
|
+
/** True for surfaces capable of interrupting/annoying — the only ones guards apply to. */
|
|
55
|
+
canAnnoy(c) {
|
|
56
|
+
return c.cost > 0 || c.focus === 'focus-stealing' || !!c.guidance;
|
|
57
|
+
}
|
|
58
|
+
/** Fatigue tracking — a dismissal shrinks tolerance; an engagement resets it (§8.3 fatigue decay). */
|
|
59
|
+
recordDismiss() {
|
|
60
|
+
this.consecutiveDismissals++;
|
|
61
|
+
}
|
|
62
|
+
recordEngagement() {
|
|
63
|
+
this.consecutiveDismissals = 0;
|
|
64
|
+
}
|
|
65
|
+
/** Toggle Do-Not-Disturb (persisted). */
|
|
66
|
+
static setDnd(on) {
|
|
67
|
+
try {
|
|
68
|
+
if (on)
|
|
69
|
+
localStorage.setItem(DND_KEY, '1');
|
|
70
|
+
else
|
|
71
|
+
localStorage.removeItem(DND_KEY);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
/* storage disabled */
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=respect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respect.js","sourceRoot":"","sources":["../../../../src/features/inapp/core/respect.ts"],"names":[],"mappings":"AAgCA,MAAM,OAA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CAAC,GAAG,EAAE,CAAC;IAChD,CAAC;IAED,0FAA0F;IAClF,QAAQ,CAAC,CAAY;QAC3B,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,gBAAgB,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACpE,CAAC;IAcD,sGAAsG;IACtG,aAAa;QACX,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IACD,gBAAgB;QACd,IAAI,CAAC,qBAAqB,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,yCAAyC;IACzC,MAAM,CAAC,MAAM,CAAC,EAAW;QACvB,IAAI,CAAC;YACH,IAAI,EAAE;gBAAE,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;;gBACtC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,sBAAsB;QACxB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IAM 2.0 host slot registry (spec §7.5 inline exception, P1.5).
|
|
3
|
+
*
|
|
4
|
+
* Inline surfaces (S8) render *in document flow* — inside a named element the host app registers
|
|
5
|
+
* (`scalebun.inapp.registerSlot('empty-state', el)`). Because an inline variant may become eligible before
|
|
6
|
+
* its slot exists (or the slot may mount/unmount with the SPA), the registry supports late binding:
|
|
7
|
+
* `whenAvailable` fires now if the slot is present, else the moment it registers.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SlotRegistry {
|
|
10
|
+
private slots;
|
|
11
|
+
private waiters;
|
|
12
|
+
register(name: string, el: HTMLElement): void;
|
|
13
|
+
unregister(name: string): void;
|
|
14
|
+
get(name: string): HTMLElement | undefined;
|
|
15
|
+
/** Run `cb` with the slot element now (if present) or when it next registers. Returns a canceller. */
|
|
16
|
+
whenAvailable(name: string, cb: (el: HTMLElement) => void): () => void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../../src/features/inapp/core/slots.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAkC;IAC/C,OAAO,CAAC,OAAO,CAAqD;IAEpE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI;IAe7C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI9B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI1C,sGAAsG;IACtG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,IAAI;IAYtE,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IAM 2.0 host slot registry (spec §7.5 inline exception, P1.5).
|
|
3
|
+
*
|
|
4
|
+
* Inline surfaces (S8) render *in document flow* — inside a named element the host app registers
|
|
5
|
+
* (`scalebun.inapp.registerSlot('empty-state', el)`). Because an inline variant may become eligible before
|
|
6
|
+
* its slot exists (or the slot may mount/unmount with the SPA), the registry supports late binding:
|
|
7
|
+
* `whenAvailable` fires now if the slot is present, else the moment it registers.
|
|
8
|
+
*/
|
|
9
|
+
export class SlotRegistry {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.slots = new Map();
|
|
12
|
+
this.waiters = new Map();
|
|
13
|
+
}
|
|
14
|
+
register(name, el) {
|
|
15
|
+
this.slots.set(name, el);
|
|
16
|
+
const ws = this.waiters.get(name);
|
|
17
|
+
if (ws) {
|
|
18
|
+
this.waiters.delete(name);
|
|
19
|
+
for (const w of ws) {
|
|
20
|
+
try {
|
|
21
|
+
w(el);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
/* a waiter must not break registration */
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
unregister(name) {
|
|
30
|
+
this.slots.delete(name);
|
|
31
|
+
}
|
|
32
|
+
get(name) {
|
|
33
|
+
return this.slots.get(name);
|
|
34
|
+
}
|
|
35
|
+
/** Run `cb` with the slot element now (if present) or when it next registers. Returns a canceller. */
|
|
36
|
+
whenAvailable(name, cb) {
|
|
37
|
+
const existing = this.slots.get(name);
|
|
38
|
+
if (existing) {
|
|
39
|
+
cb(existing);
|
|
40
|
+
return () => { };
|
|
41
|
+
}
|
|
42
|
+
let set = this.waiters.get(name);
|
|
43
|
+
if (!set)
|
|
44
|
+
this.waiters.set(name, (set = new Set()));
|
|
45
|
+
set.add(cb);
|
|
46
|
+
return () => this.waiters.get(name)?.delete(cb);
|
|
47
|
+
}
|
|
48
|
+
clear() {
|
|
49
|
+
this.slots.clear();
|
|
50
|
+
this.waiters.clear();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../../src/features/inapp/core/slots.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,YAAY;IAAzB;QACU,UAAK,GAAG,IAAI,GAAG,EAAuB,CAAC;QACvC,YAAO,GAAG,IAAI,GAAG,EAA0C,CAAC;IA0CtE,CAAC;IAxCC,QAAQ,CAAC,IAAY,EAAE,EAAe;QACpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,EAAE,EAAE,CAAC;YACP,IAAI,CAAC,OAAO,CAAC,MAAM,CA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AM 2.0 targeting engine (spec §7.2, P0.3).
|
|
3
|
+
*
|
|
4
|
+
* Pure, client-side eligibility: given a variant + a snapshot of context (route, user profile, DOM,
|
|
5
|
+
* viewport), decide whether the variant *could* show — before the Orchestrator arbitrates *which*
|
|
6
|
+
* eligible variant actually wins its zone. Four matchers:
|
|
7
|
+
* • route — glob allow-list against the current path
|
|
8
|
+
* • element — a required CSS selector resolves (anchored surfaces / element gating)
|
|
9
|
+
* • audience — a lightweight predicate over the local user profile (segments + attributes)
|
|
10
|
+
* • frequency — showOnce / maxImpressions / cooldown / persistDismiss, durable across reloads
|
|
11
|
+
*
|
|
12
|
+
* The server remains authoritative (it decides the served set); this is the last-mile client guard
|
|
13
|
+
* that also enforces the rules the server can't track per-device (frequency, DOM presence, viewport).
|
|
14
|
+
*/
|
|
15
|
+
import type { Variant } from '../types';
|
|
16
|
+
/** Is `el` at least `minRatio` visible in the viewport? Reuses coach's pure visibleRatio. */
|
|
17
|
+
export declare function elementVisible(el: Element, minRatio?: number, vp?: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}): boolean;
|
|
21
|
+
export interface UserProfile {
|
|
22
|
+
segments?: Set<string> | string[];
|
|
23
|
+
attrs?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface TargetingContext {
|
|
26
|
+
route: string;
|
|
27
|
+
profile?: UserProfile;
|
|
28
|
+
now: number;
|
|
29
|
+
viewportWidth?: number;
|
|
30
|
+
hasSelection?: boolean;
|
|
31
|
+
/** Injectable DOM probe (defaults to document.querySelector) — keeps the matcher testable. */
|
|
32
|
+
queryElement?: (selector: string) => boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function matchRoute(patterns: string[] | undefined, path: string): boolean;
|
|
35
|
+
export declare function elementPresent(selector: string | undefined, ctx: TargetingContext): boolean;
|
|
36
|
+
export declare function audienceMatch(expr: string | undefined, profile: UserProfile | undefined): boolean;
|
|
37
|
+
/** Persists per-variant impression/dismiss state so showOnce/cooldown survive reloads. */
|
|
38
|
+
export declare class FrequencyStore {
|
|
39
|
+
private readonly storage;
|
|
40
|
+
private map;
|
|
41
|
+
constructor(storage?: Storage | null);
|
|
42
|
+
private load;
|
|
43
|
+
private save;
|
|
44
|
+
/** Does this variant's frequency rule permit a show right now? */
|
|
45
|
+
canShow(v: Variant, now: number): boolean;
|
|
46
|
+
recordImpression(id: string, now: number): void;
|
|
47
|
+
recordDismiss(id: string, now: number): void;
|
|
48
|
+
/** Dev/QA reset. */
|
|
49
|
+
clear(): void;
|
|
50
|
+
}
|
|
51
|
+
export interface EligibilityResult {
|
|
52
|
+
eligible: boolean;
|
|
53
|
+
/** When ineligible, why (targeting|frequency|viewport|selection) — feeds §10 observability. */
|
|
54
|
+
reason?: string;
|
|
55
|
+
}
|
|
56
|
+
/** Does the variant pass targeting + frequency for this context? (Triggers gate *when*, not *if*.) */
|
|
57
|
+
export declare function evaluateEligibility(v: Variant, ctx: TargetingContext, freq: FrequencyStore): EligibilityResult;
|
|
58
|
+
//# sourceMappingURL=targeting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targeting.d.ts","sourceRoot":"","sources":["../../../../src/features/inapp/core/targeting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,UAAU,CAAC;AAIvD,6FAA6F;AAC7F,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,SAAM,EAAE,EAAE,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAK3G;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,gBA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