@wireai/activation 0.13.6-next.0 → 0.13.6

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/dist/index.mjs CHANGED
@@ -1155,7 +1155,10 @@ var readProgress = (response) => {
1155
1155
  key: typeof p.key === "string" ? p.key : void 0,
1156
1156
  // Whitelisted the same way as every other field: an old backend simply omits it.
1157
1157
  slot_id: typeof p.slot_id === "string" ? p.slot_id : void 0,
1158
- skippable: typeof p.skippable === "boolean" ? p.skippable : void 0
1158
+ skippable: typeof p.skippable === "boolean" ? p.skippable : void 0,
1159
+ // Whitelisted like the rest: a non-string (or absent) arm key reads as "no experiment", never
1160
+ // as an error. The kit does not interpret the value — see `OnboardingProgress.variant`.
1161
+ variant: typeof p.variant === "string" ? p.variant : void 0
1159
1162
  };
1160
1163
  };
1161
1164
 
@@ -1697,6 +1700,7 @@ var OnboardingFlow = ({
1697
1700
  const clientContextRef = useRef(clientContext);
1698
1701
  clientContextRef.current = clientContext;
1699
1702
  const lastScreenIndexRef = useRef(-1);
1703
+ const variantRef = useRef(void 0);
1700
1704
  const previewTimer = useRef(null);
1701
1705
  const [runId, setRunId] = useState(0);
1702
1706
  const startedRunRef = useRef(-1);
@@ -1746,14 +1750,17 @@ var OnboardingFlow = ({
1746
1750
  useEffect(() => {
1747
1751
  var _a2, _b2, _c2, _d2;
1748
1752
  setValidationError(void 0);
1753
+ if (variantRef.current === void 0 && progress.variant) variantRef.current = progress.variant;
1749
1754
  if (!(lastCard == null ? void 0 : lastCard.id)) return;
1750
1755
  const step2 = (_a2 = progress.step) != null ? _a2 : renderedCount;
1751
1756
  lastScreenIndexRef.current = Math.max(0, step2 - 1);
1752
- (_c2 = onEventRef.current) == null ? void 0 : _c2.call(onEventRef, {
1757
+ const turn = {
1753
1758
  type: "turn",
1754
1759
  step: step2,
1755
1760
  component: (_b2 = lastCard.response) == null ? void 0 : _b2.component
1756
- });
1761
+ };
1762
+ if (variantRef.current !== void 0) turn.variant = variantRef.current;
1763
+ (_c2 = onEventRef.current) == null ? void 0 : _c2.call(onEventRef, turn);
1757
1764
  if (((_d2 = lastCard.response) == null ? void 0 : _d2.component) === "InterstitialCard") {
1758
1765
  sendPreview(reportTargetRef.current, {
1759
1766
  sessionId: sessionIdRef.current,
@@ -1814,6 +1821,7 @@ var OnboardingFlow = ({
1814
1821
  const result = { answers: deriveAnswers(messages), raw: messages };
1815
1822
  const plan = readPlan(messages);
1816
1823
  if (plan !== void 0) result.plan = plan;
1824
+ if (variantRef.current !== void 0) result.variant = variantRef.current;
1817
1825
  onCompleteRef.current(result);
1818
1826
  }, [messages]);
1819
1827
  const handleRetry = useCallback(() => {