@syntrologie/adapt-product 2.35.0 → 2.36.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/dist/cdn.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  onActivate,
3
3
  runtime
4
- } from "./chunk-HV6QS4PQ.js";
5
- import "./chunk-AAV4C3P4.js";
4
+ } from "./chunk-SLHBNATX.js";
5
+ import "./chunk-Y2QAYCSK.js";
6
6
 
7
7
  // src/cdn.ts
8
8
  var manifest = {
@@ -11,7 +11,7 @@ import {
11
11
  heroSchema,
12
12
  recoSchema,
13
13
  takeoverPlanSchema
14
- } from "./chunk-AAV4C3P4.js";
14
+ } from "./chunk-Y2QAYCSK.js";
15
15
 
16
16
  // ../../../node_modules/@lit/context/lib/create-context.js
17
17
  function n(n2) {
@@ -812,19 +812,30 @@ function detachSection(section) {
812
812
  }
813
813
 
814
814
  // src/takeover/engine.ts
815
+ var KIND_SUPERSEDES_ROLE = {
816
+ qa: "faq",
817
+ "peer-feed": "social-proof"
818
+ };
815
819
  var DEFAULT_COMMIT_TIMEOUT_MS = 500;
816
820
  var NOOP_DISPOSE = () => {
817
821
  };
818
822
  async function runTakeover(config, ports, opts = {}) {
819
823
  if (!ports.hasSignals()) {
824
+ const declaredRoles = new Set(config.hostSections.map((s4) => s4.role));
820
825
  void Promise.resolve().then(() => ports.fetchPlan()).then(
821
826
  (response2) => ports.renderModules(
822
827
  {
823
- // Host-derived entries (kind:sectionId) are ALSO dropped here:
824
- // their source sections stay attached on this path, and rendering
825
- // our re-presentation next to the attached original duplicates
826
- // host contentthe exact class the spec forbids (review F2).
827
- order: response2.plan.order.filter((entry) => !entry.includes(":")),
828
+ // Dropped on this path (nothing may detach, so the host's own
829
+ // sections all stay attached rendering an overlap duplicates
830
+ // content, the exact class the spec forbids):
831
+ // 1. host-derived entries (kind:sectionId) — review F2;
832
+ // 2. native kinds superseding a DECLARED host role (two-Q&As
833
+ // bug: our qa next to their attached FAQ).
834
+ order: response2.plan.order.filter((entry) => {
835
+ if (entry.includes(":")) return false;
836
+ const superseded = KIND_SUPERSEDES_ROLE[entry];
837
+ return !(superseded && declaredRoles.has(superseded));
838
+ }),
828
839
  suppress: []
829
840
  },
830
841
  () => {
@@ -951,7 +962,10 @@ function createTakeoverPlanFetcher(deps) {
951
962
  decision_archetypes: deps.decisionArchetypes,
952
963
  behavior_summary: deps.behaviorSummary,
953
964
  signals: deps.signals,
954
- ingest_snapshot: deps.config.ingestSnapshot
965
+ ingest_snapshot: deps.config.ingestSnapshot,
966
+ // The client's configurable wait (commitTimeoutMs, default 500):
967
+ // the server may classify inline within it (bounded inline classify).
968
+ budget_ms: deps.config.commitTimeoutMs ?? 500
955
969
  })
956
970
  });
957
971
  if (!resp.ok) {
@@ -1031,7 +1045,8 @@ function createDomPorts(config, deps) {
1031
1045
  } catch {
1032
1046
  }
1033
1047
  }
1034
- return applyCurtainToTargets(targets);
1048
+ const failsafe = Math.max(3e3, (config.commitTimeoutMs ?? 500) + 1e3);
1049
+ return applyCurtainToTargets(targets, { timeoutMs: failsafe });
1035
1050
  },
1036
1051
  deactivateRoot() {
1037
1052
  deps.root.replaceChildren();
@@ -2826,7 +2841,7 @@ var _SyntroPdpLit = class _SyntroPdpLit extends LitElement6 {
2826
2841
  this.replaceChildren();
2827
2842
  }
2828
2843
  this._takeoverRanBefore = true;
2829
- return runTakeover(config, ports);
2844
+ return runTakeover(config, ports, { commitTimeoutMs: config.commitTimeoutMs });
2830
2845
  }).then((result) => {
2831
2846
  if (!result) return null;
2832
2847
  telemetry2("takeover.outcome", { outcome: result.outcome });
@@ -11721,4 +11736,4 @@ export {
11721
11736
  * SPDX-License-Identifier: BSD-3-Clause
11722
11737
  *)
11723
11738
  */
11724
- //# sourceMappingURL=chunk-HV6QS4PQ.js.map
11739
+ //# sourceMappingURL=chunk-SLHBNATX.js.map