@syntrologie/runtime-sdk 2.0.1-canary.3 → 2.1.0-canary.1

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 (43) hide show
  1. package/CAPABILITIES.md +13 -21
  2. package/dist/actions/executors/index.d.ts +2 -3
  3. package/dist/actions/executors/index.js +4 -9
  4. package/dist/actions/executors/index.js.map +1 -1
  5. package/dist/apps/AppLoader.d.ts +1 -0
  6. package/dist/apps/AppLoader.js +19 -7
  7. package/dist/apps/AppLoader.js.map +1 -1
  8. package/dist/apps/index.d.ts +2 -3
  9. package/dist/apps/index.js +2 -3
  10. package/dist/apps/index.js.map +1 -1
  11. package/dist/apps/nav/index.js +6 -6
  12. package/dist/apps/nav/index.js.map +3 -3
  13. package/dist/bootstrap.d.ts +1 -1
  14. package/dist/bootstrap.js +1 -1
  15. package/dist/bootstrap.js.map +1 -1
  16. package/dist/config-validator.d.ts +49 -0
  17. package/dist/config-validator.js +173 -0
  18. package/dist/config-validator.js.map +1 -0
  19. package/dist/configFetcher.js +9 -1
  20. package/dist/configFetcher.js.map +1 -1
  21. package/dist/events/schema.d.ts +4 -4
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/smart-canvas.esm.js +23 -23
  26. package/dist/smart-canvas.esm.js.map +4 -4
  27. package/dist/smart-canvas.js +393 -926
  28. package/dist/smart-canvas.js.map +4 -4
  29. package/dist/smart-canvas.min.js +23 -23
  30. package/dist/smart-canvas.min.js.map +4 -4
  31. package/dist/telemetry/adapters/noop.d.ts +1 -18
  32. package/dist/telemetry/adapters/noop.js +5 -38
  33. package/dist/telemetry/adapters/noop.js.map +1 -1
  34. package/dist/telemetry/index.d.ts +0 -1
  35. package/dist/telemetry/registry.js +1 -1
  36. package/dist/telemetry/registry.js.map +1 -1
  37. package/dist/types.d.ts +21 -0
  38. package/dist/types.js +15 -2
  39. package/dist/types.js.map +1 -1
  40. package/dist/version.d.ts +13 -0
  41. package/dist/version.js +14 -0
  42. package/dist/version.js.map +1 -0
  43. package/package.json +8 -5
@@ -9351,17 +9351,17 @@ var SyntrologieSDK = (() => {
9351
9351
  node = node.parentNode;
9352
9352
  }
9353
9353
  }
9354
- function getNodeForCharacterOffset(root2, offset4) {
9354
+ function getNodeForCharacterOffset(root2, offset3) {
9355
9355
  var node = getLeafNode(root2);
9356
9356
  var nodeStart = 0;
9357
9357
  var nodeEnd = 0;
9358
9358
  while (node) {
9359
9359
  if (node.nodeType === TEXT_NODE) {
9360
9360
  nodeEnd = nodeStart + node.textContent.length;
9361
- if (nodeStart <= offset4 && nodeEnd >= offset4) {
9361
+ if (nodeStart <= offset3 && nodeEnd >= offset3) {
9362
9362
  return {
9363
9363
  node,
9364
- offset: offset4 - nodeStart
9364
+ offset: offset3 - nodeStart
9365
9365
  };
9366
9366
  }
9367
9367
  nodeStart = nodeEnd;
@@ -24539,6 +24539,8 @@ var SyntrologieSDK = (() => {
24539
24539
  RuleZ: () => RuleZ,
24540
24540
  RuntimeContextZ: () => RuntimeContextZ,
24541
24541
  RuntimeProvider: () => RuntimeProvider,
24542
+ SDK_SCHEMA_VERSION: () => SDK_SCHEMA_VERSION,
24543
+ SDK_VERSION: () => SDK_VERSION,
24542
24544
  STATIC_SLOT_STYLES: () => STATIC_SLOT_STYLES,
24543
24545
  ScoreStrategyZ: () => ScoreStrategyZ,
24544
24546
  SelectorZ: () => SelectorZ,
@@ -24602,9 +24604,10 @@ var SyntrologieSDK = (() => {
24602
24604
  getSlotZIndex: () => getSlotZIndex,
24603
24605
  hasExecutor: () => hasExecutor,
24604
24606
  isCoreActionKind: () => isCoreActionKind,
24605
- navigationRuntime: () => runtime3,
24607
+ needsMigration: () => needsMigration,
24606
24608
  normalizePostHogEvent: () => normalizePostHogEvent,
24607
24609
  overlaysRuntime: () => runtime2,
24610
+ parseVersion: () => parseVersion,
24608
24611
  playEnterAnimation: () => playEnterAnimation,
24609
24612
  playExitAnimation: () => playExitAnimation,
24610
24613
  registerSmartCanvasElement: () => registerSmartCanvasElement,
@@ -24625,6 +24628,7 @@ var SyntrologieSDK = (() => {
24625
24628
  validateActions: () => validateActions,
24626
24629
  validateActivationConfig: () => validateActivationConfig,
24627
24630
  validateCondition: () => validateCondition,
24631
+ validateConfig: () => validateConfig,
24628
24632
  validateEventFilter: () => validateEventFilter,
24629
24633
  validateFrequencyEntry: () => validateFrequencyEntry,
24630
24634
  validateNormalizedEvent: () => validateNormalizedEvent,
@@ -24635,6 +24639,122 @@ var SyntrologieSDK = (() => {
24635
24639
  widgetRegistry: () => widgetRegistry
24636
24640
  });
24637
24641
 
24642
+ // src/version.ts
24643
+ var SDK_VERSION = "2.1.0-canary.1";
24644
+
24645
+ // src/types.ts
24646
+ var SDK_SCHEMA_VERSION = "2.0";
24647
+
24648
+ // src/config-validator.ts
24649
+ function parseVersion(version) {
24650
+ const parts = version.split(".");
24651
+ return {
24652
+ major: parseInt(parts[0] || "0", 10),
24653
+ minor: parseInt(parts[1] || "0", 10)
24654
+ };
24655
+ }
24656
+ function validateConfig(config) {
24657
+ const warnings = [];
24658
+ const errors = [];
24659
+ if (!config || typeof config !== "object") {
24660
+ return {
24661
+ valid: false,
24662
+ errors: ["Config must be an object"],
24663
+ warnings
24664
+ };
24665
+ }
24666
+ const typedConfig = config;
24667
+ if (!typedConfig.tiles) {
24668
+ errors.push("Config missing required field: tiles");
24669
+ }
24670
+ if (!typedConfig.actions) {
24671
+ errors.push("Config missing required field: actions");
24672
+ }
24673
+ if (!typedConfig.fetchedAt) {
24674
+ errors.push("Config missing required field: fetchedAt");
24675
+ }
24676
+ if (errors.length > 0) {
24677
+ return { valid: false, errors, warnings };
24678
+ }
24679
+ const configVersion = typedConfig.schemaVersion || "1.0";
24680
+ const configVer = parseVersion(configVersion);
24681
+ const sdkVer = parseVersion(SDK_SCHEMA_VERSION);
24682
+ if (configVer.major > sdkVer.major) {
24683
+ warnings.push(
24684
+ `Config schema v${configVersion} is newer than SDK v${SDK_SCHEMA_VERSION}. Some features may not work. Update SDK to latest version.`
24685
+ );
24686
+ }
24687
+ if (configVer.major < sdkVer.major || !typedConfig.schemaVersion) {
24688
+ warnings.push(
24689
+ `Config schema v${configVersion} is older than SDK v${SDK_SCHEMA_VERSION}. Migrating config to current version.`
24690
+ );
24691
+ return {
24692
+ valid: true,
24693
+ warnings,
24694
+ errors,
24695
+ migratedConfig: migrateConfig(typedConfig, configVersion)
24696
+ };
24697
+ }
24698
+ return {
24699
+ valid: true,
24700
+ warnings,
24701
+ errors
24702
+ };
24703
+ }
24704
+ function migrateConfig(config, fromVersion) {
24705
+ let migrated = { ...config };
24706
+ const fromVer = parseVersion(fromVersion);
24707
+ if (fromVer.major === 1) {
24708
+ migrated = migrateV1ToV2(migrated);
24709
+ }
24710
+ migrated.schemaVersion = SDK_SCHEMA_VERSION;
24711
+ return migrated;
24712
+ }
24713
+ function migrateV1ToV2(config) {
24714
+ const migrated = {
24715
+ schemaVersion: "2.0",
24716
+ tiles: [],
24717
+ actions: config.actions || [],
24718
+ fetchedAt: config.fetchedAt || (/* @__PURE__ */ new Date()).toISOString()
24719
+ };
24720
+ if (config.tiles && Array.isArray(config.tiles)) {
24721
+ migrated.tiles = config.tiles.map((tile) => {
24722
+ const migratedTile = { ...tile };
24723
+ if (tile.experiment && !tile.activation) {
24724
+ const exp = tile.experiment;
24725
+ if (exp.featureKey) {
24726
+ migratedTile.activation = {
24727
+ strategy: {
24728
+ type: "external",
24729
+ provider: "growthbook",
24730
+ featureKey: exp.featureKey,
24731
+ fallback: false
24732
+ }
24733
+ };
24734
+ }
24735
+ delete migratedTile.experiment;
24736
+ }
24737
+ return migratedTile;
24738
+ });
24739
+ }
24740
+ if (config.configVersion) migrated.configVersion = config.configVersion;
24741
+ if (config.canvasTitle) migrated.canvasTitle = config.canvasTitle;
24742
+ if (config.theme) migrated.theme = config.theme;
24743
+ if (config.launcher) migrated.launcher = config.launcher;
24744
+ if (config.routes) migrated.routes = config.routes;
24745
+ return migrated;
24746
+ }
24747
+ function needsMigration(config) {
24748
+ if (!config || typeof config !== "object") {
24749
+ return false;
24750
+ }
24751
+ const typedConfig = config;
24752
+ const configVersion = typedConfig.schemaVersion || "1.0";
24753
+ const configVer = parseVersion(configVersion);
24754
+ const sdkVer = parseVersion(SDK_SCHEMA_VERSION);
24755
+ return configVer.major < sdkVer.major || !typedConfig.schemaVersion;
24756
+ }
24757
+
24638
24758
  // ../../node_modules/posthog-js/dist/module.js
24639
24759
  var t = "undefined" != typeof window ? window : void 0;
24640
24760
  var i = "undefined" != typeof globalThis ? globalThis : t;
@@ -29307,7 +29427,6 @@ var SyntrologieSDK = (() => {
29307
29427
  }
29308
29428
 
29309
29429
  // src/telemetry/adapters/noop.ts
29310
- var SEGMENT_CACHE_KEY = "syntro_segment_attributes";
29311
29430
  function randomId() {
29312
29431
  const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
29313
29432
  let id = "";
@@ -29316,36 +29435,13 @@ var SyntrologieSDK = (() => {
29316
29435
  }
29317
29436
  return id;
29318
29437
  }
29319
- function getMockSegmentFlags() {
29320
- if (typeof window === "undefined") return {};
29321
- try {
29322
- const cached = localStorage.getItem(SEGMENT_CACHE_KEY);
29323
- if (cached) {
29324
- const attrs = JSON.parse(cached);
29325
- const flags = {};
29326
- for (const key of Object.keys(attrs)) {
29327
- flags[key] = true;
29328
- }
29329
- return flags;
29330
- }
29331
- } catch {
29332
- }
29333
- return {};
29334
- }
29335
29438
  var NoopAdapter = class {
29336
- constructor(options = {}) {
29439
+ constructor() {
29337
29440
  __publicField(this, "sessionId");
29338
- __publicField(this, "mockFlags");
29339
29441
  this.sessionId = randomId();
29340
- this.mockFlags = getMockSegmentFlags();
29341
29442
  console.log(
29342
29443
  `[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`
29343
29444
  );
29344
- if (options.onFeatureFlagsLoaded) {
29345
- const cb = options.onFeatureFlagsLoaded;
29346
- const flags = this.mockFlags;
29347
- Promise.resolve().then(() => cb(flags));
29348
- }
29349
29445
  }
29350
29446
  trackCanvasOpened(_surface) {
29351
29447
  }
@@ -29372,14 +29468,14 @@ var SyntrologieSDK = (() => {
29372
29468
  return "demo-user";
29373
29469
  }
29374
29470
  getAllFeatureFlags() {
29375
- return { ...this.mockFlags };
29471
+ return {};
29376
29472
  }
29377
29473
  getSegmentFlags() {
29378
- return { ...this.mockFlags };
29474
+ return {};
29379
29475
  }
29380
29476
  };
29381
- function createNoopClient(options) {
29382
- return new NoopAdapter(options);
29477
+ function createNoopClient() {
29478
+ return new NoopAdapter();
29383
29479
  }
29384
29480
 
29385
29481
  // ../../node_modules/@growthbook/growthbook/dist/esm/util.mjs
@@ -29592,7 +29688,7 @@ var SyntrologieSDK = (() => {
29592
29688
  function loadSDKVersion() {
29593
29689
  let version;
29594
29690
  try {
29595
- version = "1.6.3";
29691
+ version = "1.6.4";
29596
29692
  } catch (e2) {
29597
29693
  version = "";
29598
29694
  }
@@ -30524,8 +30620,11 @@ var SyntrologieSDK = (() => {
30524
30620
  }
30525
30621
  return _regexCache[cacheKey];
30526
30622
  }
30527
- function evalConditionValue(condition, value, savedGroups) {
30623
+ function evalConditionValue(condition, value, savedGroups, insensitive = false) {
30528
30624
  if (typeof condition === "string") {
30625
+ if (insensitive) {
30626
+ return String(value).toLowerCase() === condition.toLowerCase();
30627
+ }
30529
30628
  return value + "" === condition;
30530
30629
  }
30531
30630
  if (typeof condition === "number") {
@@ -30570,12 +30669,33 @@ var SyntrologieSDK = (() => {
30570
30669
  }
30571
30670
  return false;
30572
30671
  }
30573
- function isIn(actual, expected) {
30672
+ function isIn(actual, expected, insensitive = false) {
30673
+ if (insensitive) {
30674
+ const caseFold = (val) => typeof val === "string" ? val.toLowerCase() : val;
30675
+ if (Array.isArray(actual)) {
30676
+ return actual.some((el) => expected.some((exp) => caseFold(el) === caseFold(exp)));
30677
+ }
30678
+ return expected.some((exp) => caseFold(actual) === caseFold(exp));
30679
+ }
30574
30680
  if (Array.isArray(actual)) {
30575
30681
  return actual.some((el) => expected.includes(el));
30576
30682
  }
30577
30683
  return expected.includes(actual);
30578
30684
  }
30685
+ function isInAll(actual, expected, savedGroups, insensitive = false) {
30686
+ if (!Array.isArray(actual)) return false;
30687
+ for (let i2 = 0; i2 < expected.length; i2++) {
30688
+ let passed = false;
30689
+ for (let j2 = 0; j2 < actual.length; j2++) {
30690
+ if (evalConditionValue(expected[i2], actual[j2], savedGroups, insensitive)) {
30691
+ passed = true;
30692
+ break;
30693
+ }
30694
+ }
30695
+ if (!passed) return false;
30696
+ }
30697
+ return true;
30698
+ }
30579
30699
  function evalOperatorCondition(operator, actual, expected, savedGroups) {
30580
30700
  switch (operator) {
30581
30701
  case "$veq":
@@ -30607,6 +30727,9 @@ var SyntrologieSDK = (() => {
30607
30727
  case "$in":
30608
30728
  if (!Array.isArray(expected)) return false;
30609
30729
  return isIn(actual, expected);
30730
+ case "$ini":
30731
+ if (!Array.isArray(expected)) return false;
30732
+ return isIn(actual, expected, true);
30610
30733
  case "$inGroup":
30611
30734
  return isIn(actual, savedGroups[expected] || []);
30612
30735
  case "$notInGroup":
@@ -30614,6 +30737,9 @@ var SyntrologieSDK = (() => {
30614
30737
  case "$nin":
30615
30738
  if (!Array.isArray(expected)) return false;
30616
30739
  return !isIn(actual, expected);
30740
+ case "$nini":
30741
+ if (!Array.isArray(expected)) return false;
30742
+ return !isIn(actual, expected, true);
30617
30743
  case "$not":
30618
30744
  return !evalConditionValue(expected, actual, savedGroups);
30619
30745
  case "$size":
@@ -30622,18 +30748,11 @@ var SyntrologieSDK = (() => {
30622
30748
  case "$elemMatch":
30623
30749
  return elemMatch(actual, expected, savedGroups);
30624
30750
  case "$all":
30625
- if (!Array.isArray(actual)) return false;
30626
- for (let i2 = 0; i2 < expected.length; i2++) {
30627
- let passed = false;
30628
- for (let j2 = 0; j2 < actual.length; j2++) {
30629
- if (evalConditionValue(expected[i2], actual[j2], savedGroups)) {
30630
- passed = true;
30631
- break;
30632
- }
30633
- }
30634
- if (!passed) return false;
30635
- }
30636
- return true;
30751
+ if (!Array.isArray(expected)) return false;
30752
+ return isInAll(actual, expected, savedGroups);
30753
+ case "$alli":
30754
+ if (!Array.isArray(expected)) return false;
30755
+ return isInAll(actual, expected, savedGroups, true);
30637
30756
  case "$regex":
30638
30757
  try {
30639
30758
  return getRegex(expected).test(actual);
@@ -31455,13 +31574,13 @@ var SyntrologieSDK = (() => {
31455
31574
 
31456
31575
  // ../../node_modules/@growthbook/growthbook/dist/esm/GrowthBook.mjs
31457
31576
  var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
31458
- var SDK_VERSION = loadSDKVersion();
31577
+ var SDK_VERSION2 = loadSDKVersion();
31459
31578
  var GrowthBook = class {
31460
31579
  // context is technically private, but some tools depend on it so we can't mangle the name
31461
31580
  // Properties and methods that start with "_" are mangled by Terser (saves ~150 bytes)
31462
31581
  constructor(options) {
31463
31582
  options = options || {};
31464
- this.version = SDK_VERSION;
31583
+ this.version = SDK_VERSION2;
31465
31584
  this._options = this.context = options;
31466
31585
  this._renderer = options.renderer || null;
31467
31586
  this._trackedExperiments = /* @__PURE__ */ new Set();
@@ -32349,7 +32468,7 @@ var SyntrologieSDK = (() => {
32349
32468
  fetcher,
32350
32469
  pollIntervalMs = 3e4,
32351
32470
  experiments,
32352
- runtime: runtime4
32471
+ runtime: runtime3
32353
32472
  }) {
32354
32473
  const [state, setState] = (0, import_react.useState)({
32355
32474
  tiles: [],
@@ -32362,11 +32481,11 @@ var SyntrologieSDK = (() => {
32362
32481
  const response = await fetcher();
32363
32482
  debug("SmartCanvas Config", "Raw config response", response);
32364
32483
  let tiles = response.tiles || [];
32365
- if (runtime4 && response.routes) {
32366
- runtime4.setRoutes(response.routes);
32484
+ if (runtime3 && response.routes) {
32485
+ runtime3.setRoutes(response.routes);
32367
32486
  }
32368
- if (runtime4) {
32369
- tiles = await runtime4.filterTiles(tiles);
32487
+ if (runtime3) {
32488
+ tiles = await runtime3.filterTiles(tiles);
32370
32489
  if (experiments) {
32371
32490
  tiles = tiles.filter((tile) => experiments.shouldRenderRectangle(tile));
32372
32491
  }
@@ -32392,7 +32511,7 @@ var SyntrologieSDK = (() => {
32392
32511
  error: err instanceof Error ? err.message : "Unknown error"
32393
32512
  }));
32394
32513
  }
32395
- }, [experiments, fetcher, runtime4]);
32514
+ }, [experiments, fetcher, runtime3]);
32396
32515
  (0, import_react.useEffect)(() => {
32397
32516
  load();
32398
32517
  if (!pollIntervalMs) return;
@@ -33395,24 +33514,24 @@ var SyntrologieSDK = (() => {
33395
33514
  runtime: null,
33396
33515
  context: null
33397
33516
  });
33398
- function RuntimeProvider({ runtime: runtime4, children }) {
33517
+ function RuntimeProvider({ runtime: runtime3, children }) {
33399
33518
  const [context, setContext] = (0, import_react5.useState)(
33400
- runtime4 ? runtime4.context.get() : null
33519
+ runtime3 ? runtime3.context.get() : null
33401
33520
  );
33402
33521
  (0, import_react5.useEffect)(() => {
33403
- if (!runtime4) return;
33404
- setContext(runtime4.context.get());
33405
- const unsubscribe2 = runtime4.context.subscribe((ctx) => {
33522
+ if (!runtime3) return;
33523
+ setContext(runtime3.context.get());
33524
+ const unsubscribe2 = runtime3.context.subscribe((ctx) => {
33406
33525
  setContext(ctx);
33407
33526
  });
33408
33527
  return unsubscribe2;
33409
- }, [runtime4]);
33410
- const value = (0, import_react5.useMemo)(() => ({ runtime: runtime4, context }), [runtime4, context]);
33528
+ }, [runtime3]);
33529
+ const value = (0, import_react5.useMemo)(() => ({ runtime: runtime3, context }), [runtime3, context]);
33411
33530
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RuntimeReactContext.Provider, { value, children });
33412
33531
  }
33413
33532
  function useRuntime() {
33414
- const { runtime: runtime4 } = (0, import_react5.useContext)(RuntimeReactContext);
33415
- return runtime4;
33533
+ const { runtime: runtime3 } = (0, import_react5.useContext)(RuntimeReactContext);
33534
+ return runtime3;
33416
33535
  }
33417
33536
  function useRuntimeContext() {
33418
33537
  const { context } = (0, import_react5.useContext)(RuntimeReactContext);
@@ -33431,31 +33550,31 @@ var SyntrologieSDK = (() => {
33431
33550
  return context?.viewport ?? null;
33432
33551
  }
33433
33552
  function useRuntimeEvents(filter, callback, deps = []) {
33434
- const runtime4 = useRuntime();
33553
+ const runtime3 = useRuntime();
33435
33554
  (0, import_react5.useEffect)(() => {
33436
- if (!runtime4) return;
33437
- const unsubscribe2 = filter ? runtime4.events.subscribe(filter, callback) : runtime4.events.subscribe(callback);
33555
+ if (!runtime3) return;
33556
+ const unsubscribe2 = filter ? runtime3.events.subscribe(filter, callback) : runtime3.events.subscribe(callback);
33438
33557
  return unsubscribe2;
33439
- }, [runtime4, ...deps]);
33558
+ }, [runtime3, ...deps]);
33440
33559
  }
33441
33560
  function useRuntimeState() {
33442
- const runtime4 = useRuntime();
33443
- return runtime4?.state ?? null;
33561
+ const runtime3 = useRuntime();
33562
+ return runtime3?.state ?? null;
33444
33563
  }
33445
33564
  function useDecision(strategy, defaultValue) {
33446
- const runtime4 = useRuntime();
33565
+ const runtime3 = useRuntime();
33447
33566
  const [result, setResult] = (0, import_react5.useState)({
33448
33567
  value: defaultValue,
33449
33568
  isFallback: true,
33450
33569
  isLoading: true
33451
33570
  });
33452
33571
  (0, import_react5.useEffect)(() => {
33453
- if (!runtime4 || !strategy) {
33572
+ if (!runtime3 || !strategy) {
33454
33573
  setResult({ value: defaultValue, isFallback: true, isLoading: false });
33455
33574
  return;
33456
33575
  }
33457
33576
  let cancelled = false;
33458
- runtime4.evaluate(strategy).then((res) => {
33577
+ runtime3.evaluate(strategy).then((res) => {
33459
33578
  if (!cancelled) {
33460
33579
  setResult({ value: res.value, isFallback: res.isFallback, isLoading: false });
33461
33580
  }
@@ -33463,7 +33582,7 @@ var SyntrologieSDK = (() => {
33463
33582
  return () => {
33464
33583
  cancelled = true;
33465
33584
  };
33466
- }, [runtime4, strategy, defaultValue]);
33585
+ }, [runtime3, strategy, defaultValue]);
33467
33586
  return result;
33468
33587
  }
33469
33588
 
@@ -33588,7 +33707,7 @@ var SyntrologieSDK = (() => {
33588
33707
  { author: "Lumi", text: "Hi! Need clarity on a deduction?" }
33589
33708
  ]);
33590
33709
  const [input, setInput] = (0, import_react6.useState)("");
33591
- const runtime4 = useRuntime();
33710
+ const runtime3 = useRuntime();
33592
33711
  const handleSubmit = (event) => {
33593
33712
  event.preventDefault();
33594
33713
  if (!input.trim()) return;
@@ -33603,9 +33722,9 @@ var SyntrologieSDK = (() => {
33603
33722
  ]);
33604
33723
  }, 600);
33605
33724
  telemetry?.trackAction("chatbot_message", config.id, surface);
33606
- if (runtime4) {
33725
+ if (runtime3) {
33607
33726
  const event2 = CanvasEvents.tileAction(config.id, "chatbot_message", surface);
33608
- runtime4.events.publish(event2.name, event2.props, event2.source);
33727
+ runtime3.events.publish(event2.name, event2.props, event2.source);
33609
33728
  }
33610
33729
  setInput("");
33611
33730
  };
@@ -33676,7 +33795,7 @@ var SyntrologieSDK = (() => {
33676
33795
  surface,
33677
33796
  telemetry,
33678
33797
  isExpanded,
33679
- runtime: runtime4
33798
+ runtime: runtime3
33680
33799
  }) {
33681
33800
  const containerRef = (0, import_react6.useRef)(null);
33682
33801
  (0, import_react6.useEffect)(() => {
@@ -33686,12 +33805,12 @@ var SyntrologieSDK = (() => {
33686
33805
  surface,
33687
33806
  telemetry,
33688
33807
  isExpanded,
33689
- runtime: runtime4
33808
+ runtime: runtime3
33690
33809
  });
33691
33810
  return () => {
33692
33811
  if (cleanup) cleanup();
33693
33812
  };
33694
- }, [renderer, config, surface, telemetry, isExpanded, runtime4]);
33813
+ }, [renderer, config, surface, telemetry, isExpanded, runtime3]);
33695
33814
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: containerRef, style: { width: "100%", height: "100%" } });
33696
33815
  }
33697
33816
  function TileCard({
@@ -33704,16 +33823,16 @@ var SyntrologieSDK = (() => {
33704
33823
  onToggleExpand
33705
33824
  }) {
33706
33825
  const { title, subtitle, content, style: configStyle } = config;
33707
- const runtime4 = useRuntime();
33826
+ const runtime3 = useRuntime();
33708
33827
  const trackAction = (0, import_react6.useCallback)(
33709
33828
  (actionId) => {
33710
33829
  telemetry?.trackAction(actionId, config.id, surface);
33711
- if (runtime4) {
33830
+ if (runtime3) {
33712
33831
  const event = CanvasEvents.tileAction(config.id, actionId, surface);
33713
- runtime4.events.publish(event.name, event.props, event.source);
33832
+ runtime3.events.publish(event.name, event.props, event.source);
33714
33833
  }
33715
33834
  },
33716
- [telemetry, runtime4, config.id, surface]
33835
+ [telemetry, runtime3, config.id, surface]
33717
33836
  );
33718
33837
  const accentColor = configStyle?.accentColor ?? "#6366f1";
33719
33838
  const collapsedHeight = "72px";
@@ -33869,7 +33988,7 @@ var SyntrologieSDK = (() => {
33869
33988
  surface,
33870
33989
  telemetry,
33871
33990
  isExpanded,
33872
- runtime: runtime4
33991
+ runtime: runtime3
33873
33992
  }
33874
33993
  );
33875
33994
  }
@@ -34113,29 +34232,29 @@ var SyntrologieSDK = (() => {
34113
34232
  }) {
34114
34233
  const [mounted, setMounted] = (0, import_react7.useState)(false);
34115
34234
  const [expandedId, setExpandedId] = (0, import_react7.useState)(null);
34116
- const runtime4 = useRuntime();
34235
+ const runtime3 = useRuntime();
34117
34236
  const theme = { ...DEFAULT_THEME, ...themeOverride };
34118
34237
  const handleTileClick = (0, import_react7.useCallback)(
34119
34238
  (id) => {
34120
34239
  const wasExpanded = expandedId === id;
34121
34240
  setExpandedId(wasExpanded ? null : id);
34122
- if (runtime4) {
34241
+ if (runtime3) {
34123
34242
  const event = wasExpanded ? CanvasEvents.tileCollapsed(id, "overlay") : CanvasEvents.tileExpanded(id, "overlay");
34124
- runtime4.events.publish(event.name, event.props, event.source);
34243
+ runtime3.events.publish(event.name, event.props, event.source);
34125
34244
  }
34126
34245
  },
34127
- [expandedId, runtime4]
34246
+ [expandedId, runtime3]
34128
34247
  );
34129
34248
  (0, import_react7.useEffect)(() => {
34130
34249
  if (!isOpen) return;
34131
34250
  tiles.forEach((tile) => {
34132
34251
  telemetry?.trackRectangleViewed(tile.id, "overlay");
34133
- if (runtime4) {
34252
+ if (runtime3) {
34134
34253
  const event = CanvasEvents.tileViewed(tile.id, "overlay");
34135
- runtime4.events.publish(event.name, event.props, event.source);
34254
+ runtime3.events.publish(event.name, event.props, event.source);
34136
34255
  }
34137
34256
  });
34138
- }, [telemetry, runtime4, isOpen, tiles]);
34257
+ }, [telemetry, runtime3, isOpen, tiles]);
34139
34258
  (0, import_react7.useEffect)(() => {
34140
34259
  setMounted(true);
34141
34260
  ensureLauncherStyles();
@@ -34147,12 +34266,12 @@ var SyntrologieSDK = (() => {
34147
34266
  } else {
34148
34267
  telemetry?.trackCanvasClosed("overlay");
34149
34268
  }
34150
- if (runtime4) {
34269
+ if (runtime3) {
34151
34270
  const event = next ? CanvasEvents.canvasOpened("overlay") : CanvasEvents.canvasClosed("overlay");
34152
- runtime4.events.publish(event.name, event.props, event.source);
34271
+ runtime3.events.publish(event.name, event.props, event.source);
34153
34272
  }
34154
34273
  onToggle();
34155
- }, [isOpen, telemetry, runtime4, onToggle]);
34274
+ }, [isOpen, telemetry, runtime3, onToggle]);
34156
34275
  const isFocused = displayMode === "focused";
34157
34276
  const isRight = theme.position === "right";
34158
34277
  const bgColor = theme.colorBackground || "#1c1c1e";
@@ -34559,7 +34678,13 @@ var SyntrologieSDK = (() => {
34559
34678
  throw new Error(`SmartCanvas: config URI not allowed: ${uri}`);
34560
34679
  }
34561
34680
  const effectiveCredentials = credentials ?? (isSameOrigin(uri) ? "include" : "omit");
34562
- const response = await fetch(uri, { credentials: effectiveCredentials });
34681
+ const response = await fetch(uri, {
34682
+ credentials: effectiveCredentials,
34683
+ headers: {
34684
+ "X-SDK-Version": SDK_VERSION,
34685
+ "X-SDK-Schema-Version": SDK_SCHEMA_VERSION
34686
+ }
34687
+ });
34563
34688
  if (!response.ok) {
34564
34689
  throw new Error(`SmartCanvas: failed to fetch config (${response.status})`);
34565
34690
  }
@@ -34598,7 +34723,7 @@ var SyntrologieSDK = (() => {
34598
34723
  pollIntervalMs,
34599
34724
  experiments,
34600
34725
  telemetry,
34601
- runtime: runtime4,
34726
+ runtime: runtime3,
34602
34727
  overlayFetcher,
34603
34728
  overlayConfigUri,
34604
34729
  overlayConfigFeatureKey = "smart-canvas-overlay-uri",
@@ -34609,8 +34734,8 @@ var SyntrologieSDK = (() => {
34609
34734
  customRenderers,
34610
34735
  theme
34611
34736
  }) {
34612
- if (runtime4) {
34613
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RuntimeProvider, { runtime: runtime4, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
34737
+ if (runtime3) {
34738
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RuntimeProvider, { runtime: runtime3, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
34614
34739
  SmartCanvasAppInner,
34615
34740
  {
34616
34741
  controller,
@@ -34622,7 +34747,7 @@ var SyntrologieSDK = (() => {
34622
34747
  pollIntervalMs,
34623
34748
  experiments,
34624
34749
  telemetry,
34625
- runtime: runtime4,
34750
+ runtime: runtime3,
34626
34751
  overlayFetcher,
34627
34752
  overlayConfigUri,
34628
34753
  overlayConfigFeatureKey,
@@ -34669,7 +34794,7 @@ var SyntrologieSDK = (() => {
34669
34794
  pollIntervalMs,
34670
34795
  experiments,
34671
34796
  telemetry,
34672
- runtime: runtime4,
34797
+ runtime: runtime3,
34673
34798
  overlayFetcher: _overlayFetcher,
34674
34799
  overlayConfigUri: _overlayConfigUri,
34675
34800
  overlayConfigFeatureKey: _overlayConfigFeatureKey = "smart-canvas-overlay-uri",
@@ -34687,7 +34812,7 @@ var SyntrologieSDK = (() => {
34687
34812
  );
34688
34813
  const pathname = pageContext?.url ? new URL(pageContext.url).pathname : localPathname;
34689
34814
  (0, import_react9.useEffect)(() => {
34690
- if (runtime4) return;
34815
+ if (runtime3) return;
34691
34816
  if (typeof window === "undefined") return;
34692
34817
  const updatePathname = () => setLocalPathname(window.location.pathname);
34693
34818
  window.addEventListener("popstate", updatePathname);
@@ -34706,7 +34831,7 @@ var SyntrologieSDK = (() => {
34706
34831
  history.pushState = originalPushState;
34707
34832
  history.replaceState = originalReplaceState;
34708
34833
  };
34709
- }, [runtime4]);
34834
+ }, [runtime3]);
34710
34835
  const derivedFetcher = (0, import_react9.useMemo)(() => {
34711
34836
  if (fetcher) return fetcher;
34712
34837
  return createCanvasConfigFetcher({
@@ -34721,7 +34846,7 @@ var SyntrologieSDK = (() => {
34721
34846
  fetcher: derivedFetcher,
34722
34847
  pollIntervalMs,
34723
34848
  experiments,
34724
- runtime: runtime4
34849
+ runtime: runtime3
34725
34850
  });
34726
34851
  const hasContent = configState.tiles.length > 0 && !configState.error;
34727
34852
  (0, import_react9.useEffect)(() => controller.subscribe((state) => setOpen(state.open)), [controller]);
@@ -34731,12 +34856,12 @@ var SyntrologieSDK = (() => {
34731
34856
  }
34732
34857
  }, [controller, hasContent]);
34733
34858
  (0, import_react9.useEffect)(() => {
34734
- if (runtime4?.actions && configState.actions.length > 0) {
34735
- runtime4.actions.applyBatch(configState.actions).catch((err) => {
34859
+ if (runtime3?.actions && configState.actions.length > 0) {
34860
+ runtime3.actions.applyBatch(configState.actions).catch((err) => {
34736
34861
  console.error("[SmartCanvas] Failed to apply actions:", err);
34737
34862
  });
34738
34863
  }
34739
- }, [runtime4, configState.actions]);
34864
+ }, [runtime3, configState.actions]);
34740
34865
  const mergedTheme = (0, import_react9.useMemo)(() => {
34741
34866
  const configTheme = configState.theme;
34742
34867
  if (!configTheme) return theme;
@@ -35165,15 +35290,15 @@ var SyntrologieSDK = (() => {
35165
35290
  let currentFetcher = null;
35166
35291
  let currentBatchHandle = null;
35167
35292
  let isEnabled = true;
35168
- const runtime4 = config.runtime;
35293
+ const runtime3 = config.runtime;
35169
35294
  async function applyActions(actions) {
35170
- if (!runtime4?.actions || actions.length === 0) {
35295
+ if (!runtime3?.actions || actions.length === 0) {
35171
35296
  return;
35172
35297
  }
35173
35298
  if (currentBatchHandle?.isApplied()) {
35174
35299
  await currentBatchHandle.revertAll();
35175
35300
  }
35176
- currentBatchHandle = await runtime4.actions.applyBatch(actions);
35301
+ currentBatchHandle = await runtime3.actions.applyBatch(actions);
35177
35302
  }
35178
35303
  async function revertActions() {
35179
35304
  if (currentBatchHandle?.isApplied()) {
@@ -35186,7 +35311,7 @@ var SyntrologieSDK = (() => {
35186
35311
  currentFetcher = config.fetcher;
35187
35312
  const canvasConfig = await config.fetcher();
35188
35313
  currentConfig = canvasConfig;
35189
- if (canvasConfig.actions && canvasConfig.actions.length > 0 && runtime4?.actions) {
35314
+ if (canvasConfig.actions && canvasConfig.actions.length > 0 && runtime3?.actions) {
35190
35315
  await applyActions(canvasConfig.actions);
35191
35316
  }
35192
35317
  } catch (error2) {
@@ -35235,7 +35360,7 @@ var SyntrologieSDK = (() => {
35235
35360
  pollIntervalMs: config.pollIntervalMs,
35236
35361
  experiments,
35237
35362
  telemetry,
35238
- runtime: runtime4,
35363
+ runtime: runtime3,
35239
35364
  overlayFetcher: config.overlayFetcher,
35240
35365
  overlayConfigUri: config.overlayConfigUri,
35241
35366
  overlayConfigFeatureKey: config.overlayConfigFeatureKey,
@@ -35304,7 +35429,7 @@ var SyntrologieSDK = (() => {
35304
35429
  startSessionRecording: () => {
35305
35430
  telemetry?.startSessionRecording?.();
35306
35431
  },
35307
- runtime: runtime4
35432
+ runtime: runtime3
35308
35433
  };
35309
35434
  if (typeof window !== "undefined") {
35310
35435
  const isDev = true;
@@ -41333,16 +41458,72 @@ var SyntrologieSDK = (() => {
41333
41458
  }
41334
41459
  return coords;
41335
41460
  }
41461
+ async function detectOverflow(state, options) {
41462
+ var _await$platform$isEle;
41463
+ if (options === void 0) {
41464
+ options = {};
41465
+ }
41466
+ const {
41467
+ x: x2,
41468
+ y: y2,
41469
+ platform: platform2,
41470
+ rects,
41471
+ elements: elements2,
41472
+ strategy
41473
+ } = state;
41474
+ const {
41475
+ boundary = "clippingAncestors",
41476
+ rootBoundary = "viewport",
41477
+ elementContext = "floating",
41478
+ altBoundary = false,
41479
+ padding = 0
41480
+ } = evaluate2(options, state);
41481
+ const paddingObject = getPaddingObject(padding);
41482
+ const altContext = elementContext === "floating" ? "reference" : "floating";
41483
+ const element = elements2[altBoundary ? altContext : elementContext];
41484
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
41485
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements2.floating)),
41486
+ boundary,
41487
+ rootBoundary,
41488
+ strategy
41489
+ }));
41490
+ const rect = elementContext === "floating" ? {
41491
+ x: x2,
41492
+ y: y2,
41493
+ width: rects.floating.width,
41494
+ height: rects.floating.height
41495
+ } : rects.reference;
41496
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements2.floating));
41497
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
41498
+ x: 1,
41499
+ y: 1
41500
+ } : {
41501
+ x: 1,
41502
+ y: 1
41503
+ };
41504
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
41505
+ elements: elements2,
41506
+ rect,
41507
+ offsetParent,
41508
+ strategy
41509
+ }) : rect);
41510
+ return {
41511
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
41512
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
41513
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
41514
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
41515
+ };
41516
+ }
41336
41517
  var computePosition = async (reference, floating, config) => {
41337
41518
  const {
41338
41519
  placement = "bottom",
41339
41520
  strategy = "absolute",
41340
41521
  middleware = [],
41341
- platform: platform3
41522
+ platform: platform2
41342
41523
  } = config;
41343
41524
  const validMiddleware = middleware.filter(Boolean);
41344
- const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating));
41345
- let rects = await platform3.getElementRects({
41525
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
41526
+ let rects = await platform2.getElementRects({
41346
41527
  reference,
41347
41528
  floating,
41348
41529
  strategy
@@ -41355,6 +41536,7 @@ var SyntrologieSDK = (() => {
41355
41536
  let middlewareData = {};
41356
41537
  let resetCount = 0;
41357
41538
  for (let i2 = 0; i2 < validMiddleware.length; i2++) {
41539
+ var _platform$detectOverf;
41358
41540
  const {
41359
41541
  name,
41360
41542
  fn: fn2
@@ -41372,7 +41554,10 @@ var SyntrologieSDK = (() => {
41372
41554
  strategy,
41373
41555
  middlewareData,
41374
41556
  rects,
41375
- platform: platform3,
41557
+ platform: {
41558
+ ...platform2,
41559
+ detectOverflow: (_platform$detectOverf = platform2.detectOverflow) != null ? _platform$detectOverf : detectOverflow
41560
+ },
41376
41561
  elements: {
41377
41562
  reference,
41378
41563
  floating
@@ -41394,7 +41579,7 @@ var SyntrologieSDK = (() => {
41394
41579
  statefulPlacement = reset.placement;
41395
41580
  }
41396
41581
  if (reset.rects) {
41397
- rects = reset.rects === true ? await platform3.getElementRects({
41582
+ rects = reset.rects === true ? await platform2.getElementRects({
41398
41583
  reference,
41399
41584
  floating,
41400
41585
  strategy
@@ -41416,62 +41601,6 @@ var SyntrologieSDK = (() => {
41416
41601
  middlewareData
41417
41602
  };
41418
41603
  };
41419
- async function detectOverflow(state, options) {
41420
- var _await$platform$isEle;
41421
- if (options === void 0) {
41422
- options = {};
41423
- }
41424
- const {
41425
- x: x2,
41426
- y: y2,
41427
- platform: platform3,
41428
- rects,
41429
- elements: elements2,
41430
- strategy
41431
- } = state;
41432
- const {
41433
- boundary = "clippingAncestors",
41434
- rootBoundary = "viewport",
41435
- elementContext = "floating",
41436
- altBoundary = false,
41437
- padding = 0
41438
- } = evaluate2(options, state);
41439
- const paddingObject = getPaddingObject(padding);
41440
- const altContext = elementContext === "floating" ? "reference" : "floating";
41441
- const element = elements2[altBoundary ? altContext : elementContext];
41442
- const clippingClientRect = rectToClientRect(await platform3.getClippingRect({
41443
- element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements2.floating)),
41444
- boundary,
41445
- rootBoundary,
41446
- strategy
41447
- }));
41448
- const rect = elementContext === "floating" ? {
41449
- x: x2,
41450
- y: y2,
41451
- width: rects.floating.width,
41452
- height: rects.floating.height
41453
- } : rects.reference;
41454
- const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements2.floating));
41455
- const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) ? await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || {
41456
- x: 1,
41457
- y: 1
41458
- } : {
41459
- x: 1,
41460
- y: 1
41461
- };
41462
- const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({
41463
- elements: elements2,
41464
- rect,
41465
- offsetParent,
41466
- strategy
41467
- }) : rect);
41468
- return {
41469
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
41470
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
41471
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
41472
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
41473
- };
41474
- }
41475
41604
  var arrow = (options) => ({
41476
41605
  name: "arrow",
41477
41606
  options,
@@ -41481,7 +41610,7 @@ var SyntrologieSDK = (() => {
41481
41610
  y: y2,
41482
41611
  placement,
41483
41612
  rects,
41484
- platform: platform3,
41613
+ platform: platform2,
41485
41614
  elements: elements2,
41486
41615
  middlewareData
41487
41616
  } = state;
@@ -41499,16 +41628,16 @@ var SyntrologieSDK = (() => {
41499
41628
  };
41500
41629
  const axis = getAlignmentAxis(placement);
41501
41630
  const length = getAxisLength(axis);
41502
- const arrowDimensions = await platform3.getDimensions(element);
41631
+ const arrowDimensions = await platform2.getDimensions(element);
41503
41632
  const isYAxis = axis === "y";
41504
41633
  const minProp = isYAxis ? "top" : "left";
41505
41634
  const maxProp = isYAxis ? "bottom" : "right";
41506
41635
  const clientProp = isYAxis ? "clientHeight" : "clientWidth";
41507
41636
  const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
41508
41637
  const startDiff = coords[axis] - rects.reference[axis];
41509
- const arrowOffsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(element));
41638
+ const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
41510
41639
  let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
41511
- if (!clientSize || !await (platform3.isElement == null ? void 0 : platform3.isElement(arrowOffsetParent))) {
41640
+ if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
41512
41641
  clientSize = elements2.floating[clientProp] || rects.floating[length];
41513
41642
  }
41514
41643
  const centerToReference = endDiff / 2 - startDiff / 2;
@@ -41518,14 +41647,14 @@ var SyntrologieSDK = (() => {
41518
41647
  const min$1 = minPadding;
41519
41648
  const max2 = clientSize - arrowDimensions[length] - maxPadding;
41520
41649
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
41521
- const offset4 = clamp(min$1, center, max2);
41522
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
41650
+ const offset3 = clamp(min$1, center, max2);
41651
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
41523
41652
  const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
41524
41653
  return {
41525
41654
  [axis]: coords[axis] + alignmentOffset,
41526
41655
  data: {
41527
- [axis]: offset4,
41528
- centerOffset: center - offset4 - alignmentOffset,
41656
+ [axis]: offset3,
41657
+ centerOffset: center - offset3 - alignmentOffset,
41529
41658
  ...shouldAddOffset && {
41530
41659
  alignmentOffset
41531
41660
  }
@@ -41548,7 +41677,7 @@ var SyntrologieSDK = (() => {
41548
41677
  middlewareData,
41549
41678
  rects,
41550
41679
  initialPlacement,
41551
- platform: platform3,
41680
+ platform: platform2,
41552
41681
  elements: elements2
41553
41682
  } = state;
41554
41683
  const {
@@ -41566,14 +41695,14 @@ var SyntrologieSDK = (() => {
41566
41695
  const side = getSide(placement);
41567
41696
  const initialSideAxis = getSideAxis(initialPlacement);
41568
41697
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
41569
- const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating));
41698
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements2.floating));
41570
41699
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
41571
41700
  const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
41572
41701
  if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
41573
41702
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
41574
41703
  }
41575
41704
  const placements2 = [initialPlacement, ...fallbackPlacements];
41576
- const overflow = await detectOverflow(state, detectOverflowOptions);
41705
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
41577
41706
  const overflows = [];
41578
41707
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
41579
41708
  if (checkMainAxis) {
@@ -41663,7 +41792,8 @@ var SyntrologieSDK = (() => {
41663
41792
  options,
41664
41793
  async fn(state) {
41665
41794
  const {
41666
- rects
41795
+ rects,
41796
+ platform: platform2
41667
41797
  } = state;
41668
41798
  const {
41669
41799
  strategy = "referenceHidden",
@@ -41671,7 +41801,7 @@ var SyntrologieSDK = (() => {
41671
41801
  } = evaluate2(options, state);
41672
41802
  switch (strategy) {
41673
41803
  case "referenceHidden": {
41674
- const overflow = await detectOverflow(state, {
41804
+ const overflow = await platform2.detectOverflow(state, {
41675
41805
  ...detectOverflowOptions,
41676
41806
  elementContext: "reference"
41677
41807
  });
@@ -41684,7 +41814,7 @@ var SyntrologieSDK = (() => {
41684
41814
  };
41685
41815
  }
41686
41816
  case "escaped": {
41687
- const overflow = await detectOverflow(state, {
41817
+ const overflow = await platform2.detectOverflow(state, {
41688
41818
  ...detectOverflowOptions,
41689
41819
  altBoundary: true
41690
41820
  });
@@ -41707,10 +41837,10 @@ var SyntrologieSDK = (() => {
41707
41837
  async function convertValueToCoords(state, options) {
41708
41838
  const {
41709
41839
  placement,
41710
- platform: platform3,
41840
+ platform: platform2,
41711
41841
  elements: elements2
41712
41842
  } = state;
41713
- const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating));
41843
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements2.floating));
41714
41844
  const side = getSide(placement);
41715
41845
  const alignment = getAlignment(placement);
41716
41846
  const isVertical = getSideAxis(placement) === "y";
@@ -41782,7 +41912,8 @@ var SyntrologieSDK = (() => {
41782
41912
  const {
41783
41913
  x: x2,
41784
41914
  y: y2,
41785
- placement
41915
+ placement,
41916
+ platform: platform2
41786
41917
  } = state;
41787
41918
  const {
41788
41919
  mainAxis: checkMainAxis = true,
@@ -41805,7 +41936,7 @@ var SyntrologieSDK = (() => {
41805
41936
  x: x2,
41806
41937
  y: y2
41807
41938
  };
41808
- const overflow = await detectOverflow(state, detectOverflowOptions);
41939
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
41809
41940
  const crossAxis = getSideAxis(getSide(placement));
41810
41941
  const mainAxis = getOppositeAxis(crossAxis);
41811
41942
  let mainAxisCoord = coords[mainAxis];
@@ -42122,9 +42253,15 @@ var SyntrologieSDK = (() => {
42122
42253
  }
42123
42254
  return rect.left + leftScroll;
42124
42255
  }
42125
- function getHTMLOffset(documentElement, scroll) {
42256
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
42257
+ if (ignoreScrollbarX === void 0) {
42258
+ ignoreScrollbarX = false;
42259
+ }
42126
42260
  const htmlRect = documentElement.getBoundingClientRect();
42127
- const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
42261
+ const x2 = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
42262
+ // RTL <body> scrollbar.
42263
+ getWindowScrollBarX(documentElement, htmlRect)
42264
+ ));
42128
42265
  const y2 = htmlRect.top + scroll.scrollTop;
42129
42266
  return {
42130
42267
  x: x2,
@@ -42162,7 +42299,7 @@ var SyntrologieSDK = (() => {
42162
42299
  offsets.y = offsetRect.y + offsetParent.clientTop;
42163
42300
  }
42164
42301
  }
42165
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
42302
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
42166
42303
  return {
42167
42304
  width: rect.width * scale.x,
42168
42305
  height: rect.height * scale.y,
@@ -42191,7 +42328,6 @@ var SyntrologieSDK = (() => {
42191
42328
  y: y2
42192
42329
  };
42193
42330
  }
42194
- var SCROLLBAR_MAX = 25;
42195
42331
  function getViewportRect(element, strategy) {
42196
42332
  const win = getWindow(element);
42197
42333
  const html2 = getDocumentElement(element);
@@ -42209,19 +42345,6 @@ var SyntrologieSDK = (() => {
42209
42345
  y2 = visualViewport.offsetTop;
42210
42346
  }
42211
42347
  }
42212
- const windowScrollbarX = getWindowScrollBarX(html2);
42213
- if (windowScrollbarX <= 0) {
42214
- const doc = html2.ownerDocument;
42215
- const body = doc.body;
42216
- const bodyStyles = getComputedStyle(body);
42217
- const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
42218
- const clippingStableScrollbarWidth = Math.abs(html2.clientWidth - body.clientWidth - bodyMarginInline);
42219
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
42220
- width -= clippingStableScrollbarWidth;
42221
- }
42222
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
42223
- width += windowScrollbarX;
42224
- }
42225
42348
  return {
42226
42349
  width,
42227
42350
  height,
@@ -42229,7 +42352,6 @@ var SyntrologieSDK = (() => {
42229
42352
  y: y2
42230
42353
  };
42231
42354
  }
42232
- var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
42233
42355
  function getInnerBoundingClientRect(element, strategy) {
42234
42356
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
42235
42357
  const top = clientRect.top + element.clientTop;
@@ -42287,7 +42409,7 @@ var SyntrologieSDK = (() => {
42287
42409
  if (!currentNodeIsContaining && computedStyle.position === "fixed") {
42288
42410
  currentContainingBlockComputedStyle = null;
42289
42411
  }
42290
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
42412
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
42291
42413
  if (shouldDropCurrentNode) {
42292
42414
  result = result.filter((ancestor) => ancestor !== currentNode);
42293
42415
  } else {
@@ -42343,9 +42465,6 @@ var SyntrologieSDK = (() => {
42343
42465
  scrollTop: 0
42344
42466
  };
42345
42467
  const offsets = createCoords(0);
42346
- function setLeftRTLScrollbarOffset() {
42347
- offsets.x = getWindowScrollBarX(documentElement);
42348
- }
42349
42468
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
42350
42469
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
42351
42470
  scroll = getNodeScroll(offsetParent);
@@ -42355,12 +42474,9 @@ var SyntrologieSDK = (() => {
42355
42474
  offsets.x = offsetRect.x + offsetParent.clientLeft;
42356
42475
  offsets.y = offsetRect.y + offsetParent.clientTop;
42357
42476
  } else if (documentElement) {
42358
- setLeftRTLScrollbarOffset();
42477
+ offsets.x = getWindowScrollBarX(documentElement);
42359
42478
  }
42360
42479
  }
42361
- if (isFixed && !isOffsetParentAnElement && documentElement) {
42362
- setLeftRTLScrollbarOffset();
42363
- }
42364
42480
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
42365
42481
  const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
42366
42482
  const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
@@ -42509,7 +42625,7 @@ var SyntrologieSDK = (() => {
42509
42625
  // Handle <iframe>s
42510
42626
  root: root.ownerDocument
42511
42627
  });
42512
- } catch (_e2) {
42628
+ } catch (e2) {
42513
42629
  io2 = new IntersectionObserver(handleObserve, options);
42514
42630
  }
42515
42631
  io2.observe(element);
@@ -43263,64 +43379,6 @@ var SyntrologieSDK = (() => {
43263
43379
  executors: executors2
43264
43380
  };
43265
43381
 
43266
- // ../adaptives/adaptive-navigation/dist/runtime.js
43267
- var executeScrollTo = async (action, context) => {
43268
- const anchorEl = context.resolveAnchor(action.anchorId);
43269
- if (!anchorEl) {
43270
- throw new Error(`Anchor not found: ${action.anchorId}`);
43271
- }
43272
- const _scrollXBefore = window.scrollX;
43273
- const _scrollYBefore = window.scrollY;
43274
- anchorEl.scrollIntoView({
43275
- behavior: action.behavior ?? "smooth",
43276
- block: action.block ?? "center",
43277
- inline: action.inline ?? "nearest"
43278
- });
43279
- context.publishEvent("action.applied", {
43280
- id: context.generateId(),
43281
- kind: "navigation:scrollTo",
43282
- anchorId: action.anchorId,
43283
- behavior: action.behavior ?? "smooth"
43284
- });
43285
- return {
43286
- cleanup: () => {
43287
- }
43288
- };
43289
- };
43290
- var executeNavigate = async (action, context) => {
43291
- const url = action.url.trim();
43292
- if (url.toLowerCase().startsWith("javascript:")) {
43293
- throw new Error("javascript: URLs are not allowed");
43294
- }
43295
- const target = action.target ?? "_self";
43296
- context.publishEvent("action.applied", {
43297
- id: context.generateId(),
43298
- kind: "navigation:navigate",
43299
- url: action.url,
43300
- target
43301
- });
43302
- if (target === "_blank") {
43303
- window.open(url, "_blank", "noopener,noreferrer");
43304
- } else {
43305
- window.location.href = url;
43306
- }
43307
- return {
43308
- cleanup: () => {
43309
- }
43310
- };
43311
- };
43312
- var executors3 = [
43313
- { kind: "navigation:scrollTo", executor: executeScrollTo },
43314
- { kind: "navigation:navigate", executor: executeNavigate }
43315
- ];
43316
- var runtime3 = {
43317
- id: "adaptive-navigation",
43318
- version: "1.0.0",
43319
- name: "Navigation",
43320
- description: "Scroll and page navigation actions",
43321
- executors: executors3
43322
- };
43323
-
43324
43382
  // src/actions/executors/tour.ts
43325
43383
  var ACTIVE_TOUR_KEY = "syntro_active_tour";
43326
43384
  var activeTours = /* @__PURE__ */ new Map();
@@ -43581,9 +43639,6 @@ var SyntrologieSDK = (() => {
43581
43639
  for (const { kind, executor } of executors2) {
43582
43640
  this.registerCore(kind, executor);
43583
43641
  }
43584
- for (const { kind, executor } of executors3) {
43585
- this.registerCore(kind, executor);
43586
- }
43587
43642
  this.registerCore("core:mountWidget", async () => {
43588
43643
  throw new Error("core:mountWidget must be handled by ActionEngine");
43589
43644
  });
@@ -44618,598 +44673,6 @@ var SyntrologieSDK = (() => {
44618
44673
  return tpl.innerHTML = root.firstChild ? tpl.innerHTML : tpl.innerHTML;
44619
44674
  }
44620
44675
 
44621
- // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
44622
- function getCssDimensions2(element) {
44623
- const css = getComputedStyle2(element);
44624
- let width = parseFloat(css.width) || 0;
44625
- let height = parseFloat(css.height) || 0;
44626
- const hasOffset = isHTMLElement(element);
44627
- const offsetWidth = hasOffset ? element.offsetWidth : width;
44628
- const offsetHeight = hasOffset ? element.offsetHeight : height;
44629
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
44630
- if (shouldFallback) {
44631
- width = offsetWidth;
44632
- height = offsetHeight;
44633
- }
44634
- return {
44635
- width,
44636
- height,
44637
- $: shouldFallback
44638
- };
44639
- }
44640
- function unwrapElement2(element) {
44641
- return !isElement(element) ? element.contextElement : element;
44642
- }
44643
- function getScale2(element) {
44644
- const domElement = unwrapElement2(element);
44645
- if (!isHTMLElement(domElement)) {
44646
- return createCoords(1);
44647
- }
44648
- const rect = domElement.getBoundingClientRect();
44649
- const {
44650
- width,
44651
- height,
44652
- $
44653
- } = getCssDimensions2(domElement);
44654
- let x2 = ($ ? round(rect.width) : rect.width) / width;
44655
- let y2 = ($ ? round(rect.height) : rect.height) / height;
44656
- if (!x2 || !Number.isFinite(x2)) {
44657
- x2 = 1;
44658
- }
44659
- if (!y2 || !Number.isFinite(y2)) {
44660
- y2 = 1;
44661
- }
44662
- return {
44663
- x: x2,
44664
- y: y2
44665
- };
44666
- }
44667
- var noOffsets2 = /* @__PURE__ */ createCoords(0);
44668
- function getVisualOffsets2(element) {
44669
- const win = getWindow(element);
44670
- if (!isWebKit() || !win.visualViewport) {
44671
- return noOffsets2;
44672
- }
44673
- return {
44674
- x: win.visualViewport.offsetLeft,
44675
- y: win.visualViewport.offsetTop
44676
- };
44677
- }
44678
- function shouldAddVisualOffsets2(element, isFixed, floatingOffsetParent) {
44679
- if (isFixed === void 0) {
44680
- isFixed = false;
44681
- }
44682
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
44683
- return false;
44684
- }
44685
- return isFixed;
44686
- }
44687
- function getBoundingClientRect2(element, includeScale, isFixedStrategy, offsetParent) {
44688
- if (includeScale === void 0) {
44689
- includeScale = false;
44690
- }
44691
- if (isFixedStrategy === void 0) {
44692
- isFixedStrategy = false;
44693
- }
44694
- const clientRect = element.getBoundingClientRect();
44695
- const domElement = unwrapElement2(element);
44696
- let scale = createCoords(1);
44697
- if (includeScale) {
44698
- if (offsetParent) {
44699
- if (isElement(offsetParent)) {
44700
- scale = getScale2(offsetParent);
44701
- }
44702
- } else {
44703
- scale = getScale2(element);
44704
- }
44705
- }
44706
- const visualOffsets = shouldAddVisualOffsets2(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets2(domElement) : createCoords(0);
44707
- let x2 = (clientRect.left + visualOffsets.x) / scale.x;
44708
- let y2 = (clientRect.top + visualOffsets.y) / scale.y;
44709
- let width = clientRect.width / scale.x;
44710
- let height = clientRect.height / scale.y;
44711
- if (domElement) {
44712
- const win = getWindow(domElement);
44713
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
44714
- let currentWin = win;
44715
- let currentIFrame = getFrameElement(currentWin);
44716
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
44717
- const iframeScale = getScale2(currentIFrame);
44718
- const iframeRect = currentIFrame.getBoundingClientRect();
44719
- const css = getComputedStyle2(currentIFrame);
44720
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
44721
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
44722
- x2 *= iframeScale.x;
44723
- y2 *= iframeScale.y;
44724
- width *= iframeScale.x;
44725
- height *= iframeScale.y;
44726
- x2 += left;
44727
- y2 += top;
44728
- currentWin = getWindow(currentIFrame);
44729
- currentIFrame = getFrameElement(currentWin);
44730
- }
44731
- }
44732
- return rectToClientRect({
44733
- width,
44734
- height,
44735
- x: x2,
44736
- y: y2
44737
- });
44738
- }
44739
- function getWindowScrollBarX2(element, rect) {
44740
- const leftScroll = getNodeScroll(element).scrollLeft;
44741
- if (!rect) {
44742
- return getBoundingClientRect2(getDocumentElement(element)).left + leftScroll;
44743
- }
44744
- return rect.left + leftScroll;
44745
- }
44746
- function getHTMLOffset2(documentElement, scroll, ignoreScrollbarX) {
44747
- if (ignoreScrollbarX === void 0) {
44748
- ignoreScrollbarX = false;
44749
- }
44750
- const htmlRect = documentElement.getBoundingClientRect();
44751
- const x2 = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
44752
- // RTL <body> scrollbar.
44753
- getWindowScrollBarX2(documentElement, htmlRect)
44754
- ));
44755
- const y2 = htmlRect.top + scroll.scrollTop;
44756
- return {
44757
- x: x2,
44758
- y: y2
44759
- };
44760
- }
44761
- function convertOffsetParentRelativeRectToViewportRelativeRect2(_ref) {
44762
- let {
44763
- elements: elements2,
44764
- rect,
44765
- offsetParent,
44766
- strategy
44767
- } = _ref;
44768
- const isFixed = strategy === "fixed";
44769
- const documentElement = getDocumentElement(offsetParent);
44770
- const topLayer = elements2 ? isTopLayer(elements2.floating) : false;
44771
- if (offsetParent === documentElement || topLayer && isFixed) {
44772
- return rect;
44773
- }
44774
- let scroll = {
44775
- scrollLeft: 0,
44776
- scrollTop: 0
44777
- };
44778
- let scale = createCoords(1);
44779
- const offsets = createCoords(0);
44780
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
44781
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
44782
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
44783
- scroll = getNodeScroll(offsetParent);
44784
- }
44785
- if (isHTMLElement(offsetParent)) {
44786
- const offsetRect = getBoundingClientRect2(offsetParent);
44787
- scale = getScale2(offsetParent);
44788
- offsets.x = offsetRect.x + offsetParent.clientLeft;
44789
- offsets.y = offsetRect.y + offsetParent.clientTop;
44790
- }
44791
- }
44792
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset2(documentElement, scroll, true) : createCoords(0);
44793
- return {
44794
- width: rect.width * scale.x,
44795
- height: rect.height * scale.y,
44796
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
44797
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
44798
- };
44799
- }
44800
- function getClientRects2(element) {
44801
- return Array.from(element.getClientRects());
44802
- }
44803
- function getDocumentRect2(element) {
44804
- const html2 = getDocumentElement(element);
44805
- const scroll = getNodeScroll(element);
44806
- const body = element.ownerDocument.body;
44807
- const width = max(html2.scrollWidth, html2.clientWidth, body.scrollWidth, body.clientWidth);
44808
- const height = max(html2.scrollHeight, html2.clientHeight, body.scrollHeight, body.clientHeight);
44809
- let x2 = -scroll.scrollLeft + getWindowScrollBarX2(element);
44810
- const y2 = -scroll.scrollTop;
44811
- if (getComputedStyle2(body).direction === "rtl") {
44812
- x2 += max(html2.clientWidth, body.clientWidth) - width;
44813
- }
44814
- return {
44815
- width,
44816
- height,
44817
- x: x2,
44818
- y: y2
44819
- };
44820
- }
44821
- function getViewportRect2(element, strategy) {
44822
- const win = getWindow(element);
44823
- const html2 = getDocumentElement(element);
44824
- const visualViewport = win.visualViewport;
44825
- let width = html2.clientWidth;
44826
- let height = html2.clientHeight;
44827
- let x2 = 0;
44828
- let y2 = 0;
44829
- if (visualViewport) {
44830
- width = visualViewport.width;
44831
- height = visualViewport.height;
44832
- const visualViewportBased = isWebKit();
44833
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
44834
- x2 = visualViewport.offsetLeft;
44835
- y2 = visualViewport.offsetTop;
44836
- }
44837
- }
44838
- return {
44839
- width,
44840
- height,
44841
- x: x2,
44842
- y: y2
44843
- };
44844
- }
44845
- function getInnerBoundingClientRect2(element, strategy) {
44846
- const clientRect = getBoundingClientRect2(element, true, strategy === "fixed");
44847
- const top = clientRect.top + element.clientTop;
44848
- const left = clientRect.left + element.clientLeft;
44849
- const scale = isHTMLElement(element) ? getScale2(element) : createCoords(1);
44850
- const width = element.clientWidth * scale.x;
44851
- const height = element.clientHeight * scale.y;
44852
- const x2 = left * scale.x;
44853
- const y2 = top * scale.y;
44854
- return {
44855
- width,
44856
- height,
44857
- x: x2,
44858
- y: y2
44859
- };
44860
- }
44861
- function getClientRectFromClippingAncestor2(element, clippingAncestor, strategy) {
44862
- let rect;
44863
- if (clippingAncestor === "viewport") {
44864
- rect = getViewportRect2(element, strategy);
44865
- } else if (clippingAncestor === "document") {
44866
- rect = getDocumentRect2(getDocumentElement(element));
44867
- } else if (isElement(clippingAncestor)) {
44868
- rect = getInnerBoundingClientRect2(clippingAncestor, strategy);
44869
- } else {
44870
- const visualOffsets = getVisualOffsets2(element);
44871
- rect = {
44872
- x: clippingAncestor.x - visualOffsets.x,
44873
- y: clippingAncestor.y - visualOffsets.y,
44874
- width: clippingAncestor.width,
44875
- height: clippingAncestor.height
44876
- };
44877
- }
44878
- return rectToClientRect(rect);
44879
- }
44880
- function hasFixedPositionAncestor2(element, stopNode) {
44881
- const parentNode = getParentNode(element);
44882
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
44883
- return false;
44884
- }
44885
- return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor2(parentNode, stopNode);
44886
- }
44887
- function getClippingElementAncestors2(element, cache2) {
44888
- const cachedResult = cache2.get(element);
44889
- if (cachedResult) {
44890
- return cachedResult;
44891
- }
44892
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
44893
- let currentContainingBlockComputedStyle = null;
44894
- const elementIsFixed = getComputedStyle2(element).position === "fixed";
44895
- let currentNode = elementIsFixed ? getParentNode(element) : element;
44896
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
44897
- const computedStyle = getComputedStyle2(currentNode);
44898
- const currentNodeIsContaining = isContainingBlock(currentNode);
44899
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
44900
- currentContainingBlockComputedStyle = null;
44901
- }
44902
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor2(element, currentNode);
44903
- if (shouldDropCurrentNode) {
44904
- result = result.filter((ancestor) => ancestor !== currentNode);
44905
- } else {
44906
- currentContainingBlockComputedStyle = computedStyle;
44907
- }
44908
- currentNode = getParentNode(currentNode);
44909
- }
44910
- cache2.set(element, result);
44911
- return result;
44912
- }
44913
- function getClippingRect2(_ref) {
44914
- let {
44915
- element,
44916
- boundary,
44917
- rootBoundary,
44918
- strategy
44919
- } = _ref;
44920
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors2(element, this._c) : [].concat(boundary);
44921
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
44922
- const firstClippingAncestor = clippingAncestors[0];
44923
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
44924
- const rect = getClientRectFromClippingAncestor2(element, clippingAncestor, strategy);
44925
- accRect.top = max(rect.top, accRect.top);
44926
- accRect.right = min(rect.right, accRect.right);
44927
- accRect.bottom = min(rect.bottom, accRect.bottom);
44928
- accRect.left = max(rect.left, accRect.left);
44929
- return accRect;
44930
- }, getClientRectFromClippingAncestor2(element, firstClippingAncestor, strategy));
44931
- return {
44932
- width: clippingRect.right - clippingRect.left,
44933
- height: clippingRect.bottom - clippingRect.top,
44934
- x: clippingRect.left,
44935
- y: clippingRect.top
44936
- };
44937
- }
44938
- function getDimensions2(element) {
44939
- const {
44940
- width,
44941
- height
44942
- } = getCssDimensions2(element);
44943
- return {
44944
- width,
44945
- height
44946
- };
44947
- }
44948
- function getRectRelativeToOffsetParent2(element, offsetParent, strategy) {
44949
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
44950
- const documentElement = getDocumentElement(offsetParent);
44951
- const isFixed = strategy === "fixed";
44952
- const rect = getBoundingClientRect2(element, true, isFixed, offsetParent);
44953
- let scroll = {
44954
- scrollLeft: 0,
44955
- scrollTop: 0
44956
- };
44957
- const offsets = createCoords(0);
44958
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
44959
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
44960
- scroll = getNodeScroll(offsetParent);
44961
- }
44962
- if (isOffsetParentAnElement) {
44963
- const offsetRect = getBoundingClientRect2(offsetParent, true, isFixed, offsetParent);
44964
- offsets.x = offsetRect.x + offsetParent.clientLeft;
44965
- offsets.y = offsetRect.y + offsetParent.clientTop;
44966
- } else if (documentElement) {
44967
- offsets.x = getWindowScrollBarX2(documentElement);
44968
- }
44969
- }
44970
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset2(documentElement, scroll) : createCoords(0);
44971
- const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
44972
- const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
44973
- return {
44974
- x: x2,
44975
- y: y2,
44976
- width: rect.width,
44977
- height: rect.height
44978
- };
44979
- }
44980
- function isStaticPositioned2(element) {
44981
- return getComputedStyle2(element).position === "static";
44982
- }
44983
- function getTrueOffsetParent2(element, polyfill) {
44984
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
44985
- return null;
44986
- }
44987
- if (polyfill) {
44988
- return polyfill(element);
44989
- }
44990
- let rawOffsetParent = element.offsetParent;
44991
- if (getDocumentElement(element) === rawOffsetParent) {
44992
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
44993
- }
44994
- return rawOffsetParent;
44995
- }
44996
- function getOffsetParent2(element, polyfill) {
44997
- const win = getWindow(element);
44998
- if (isTopLayer(element)) {
44999
- return win;
45000
- }
45001
- if (!isHTMLElement(element)) {
45002
- let svgOffsetParent = getParentNode(element);
45003
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
45004
- if (isElement(svgOffsetParent) && !isStaticPositioned2(svgOffsetParent)) {
45005
- return svgOffsetParent;
45006
- }
45007
- svgOffsetParent = getParentNode(svgOffsetParent);
45008
- }
45009
- return win;
45010
- }
45011
- let offsetParent = getTrueOffsetParent2(element, polyfill);
45012
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned2(offsetParent)) {
45013
- offsetParent = getTrueOffsetParent2(offsetParent, polyfill);
45014
- }
45015
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned2(offsetParent) && !isContainingBlock(offsetParent)) {
45016
- return win;
45017
- }
45018
- return offsetParent || getContainingBlock(element) || win;
45019
- }
45020
- var getElementRects2 = async function(data) {
45021
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent2;
45022
- const getDimensionsFn = this.getDimensions;
45023
- const floatingDimensions = await getDimensionsFn(data.floating);
45024
- return {
45025
- reference: getRectRelativeToOffsetParent2(data.reference, await getOffsetParentFn(data.floating), data.strategy),
45026
- floating: {
45027
- x: 0,
45028
- y: 0,
45029
- width: floatingDimensions.width,
45030
- height: floatingDimensions.height
45031
- }
45032
- };
45033
- };
45034
- function isRTL2(element) {
45035
- return getComputedStyle2(element).direction === "rtl";
45036
- }
45037
- var platform2 = {
45038
- convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect2,
45039
- getDocumentElement,
45040
- getClippingRect: getClippingRect2,
45041
- getOffsetParent: getOffsetParent2,
45042
- getElementRects: getElementRects2,
45043
- getClientRects: getClientRects2,
45044
- getDimensions: getDimensions2,
45045
- getScale: getScale2,
45046
- isElement,
45047
- isRTL: isRTL2
45048
- };
45049
- function rectsAreEqual2(a2, b2) {
45050
- return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height;
45051
- }
45052
- function observeMove2(element, onMove) {
45053
- let io2 = null;
45054
- let timeoutId;
45055
- const root = getDocumentElement(element);
45056
- function cleanup() {
45057
- var _io;
45058
- clearTimeout(timeoutId);
45059
- (_io = io2) == null || _io.disconnect();
45060
- io2 = null;
45061
- }
45062
- function refresh(skip, threshold) {
45063
- if (skip === void 0) {
45064
- skip = false;
45065
- }
45066
- if (threshold === void 0) {
45067
- threshold = 1;
45068
- }
45069
- cleanup();
45070
- const elementRectForRootMargin = element.getBoundingClientRect();
45071
- const {
45072
- left,
45073
- top,
45074
- width,
45075
- height
45076
- } = elementRectForRootMargin;
45077
- if (!skip) {
45078
- onMove();
45079
- }
45080
- if (!width || !height) {
45081
- return;
45082
- }
45083
- const insetTop = floor(top);
45084
- const insetRight = floor(root.clientWidth - (left + width));
45085
- const insetBottom = floor(root.clientHeight - (top + height));
45086
- const insetLeft = floor(left);
45087
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
45088
- const options = {
45089
- rootMargin,
45090
- threshold: max(0, min(1, threshold)) || 1
45091
- };
45092
- let isFirstUpdate = true;
45093
- function handleObserve(entries) {
45094
- const ratio = entries[0].intersectionRatio;
45095
- if (ratio !== threshold) {
45096
- if (!isFirstUpdate) {
45097
- return refresh();
45098
- }
45099
- if (!ratio) {
45100
- timeoutId = setTimeout(() => {
45101
- refresh(false, 1e-7);
45102
- }, 1e3);
45103
- } else {
45104
- refresh(false, ratio);
45105
- }
45106
- }
45107
- if (ratio === 1 && !rectsAreEqual2(elementRectForRootMargin, element.getBoundingClientRect())) {
45108
- refresh();
45109
- }
45110
- isFirstUpdate = false;
45111
- }
45112
- try {
45113
- io2 = new IntersectionObserver(handleObserve, {
45114
- ...options,
45115
- // Handle <iframe>s
45116
- root: root.ownerDocument
45117
- });
45118
- } catch (e2) {
45119
- io2 = new IntersectionObserver(handleObserve, options);
45120
- }
45121
- io2.observe(element);
45122
- }
45123
- refresh(true);
45124
- return cleanup;
45125
- }
45126
- function autoUpdate2(reference, floating, update, options) {
45127
- if (options === void 0) {
45128
- options = {};
45129
- }
45130
- const {
45131
- ancestorScroll = true,
45132
- ancestorResize = true,
45133
- elementResize = typeof ResizeObserver === "function",
45134
- layoutShift = typeof IntersectionObserver === "function",
45135
- animationFrame = false
45136
- } = options;
45137
- const referenceEl = unwrapElement2(reference);
45138
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
45139
- ancestors.forEach((ancestor) => {
45140
- ancestorScroll && ancestor.addEventListener("scroll", update, {
45141
- passive: true
45142
- });
45143
- ancestorResize && ancestor.addEventListener("resize", update);
45144
- });
45145
- const cleanupIo = referenceEl && layoutShift ? observeMove2(referenceEl, update) : null;
45146
- let reobserveFrame = -1;
45147
- let resizeObserver = null;
45148
- if (elementResize) {
45149
- resizeObserver = new ResizeObserver((_ref) => {
45150
- let [firstEntry] = _ref;
45151
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
45152
- resizeObserver.unobserve(floating);
45153
- cancelAnimationFrame(reobserveFrame);
45154
- reobserveFrame = requestAnimationFrame(() => {
45155
- var _resizeObserver;
45156
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
45157
- });
45158
- }
45159
- update();
45160
- });
45161
- if (referenceEl && !animationFrame) {
45162
- resizeObserver.observe(referenceEl);
45163
- }
45164
- resizeObserver.observe(floating);
45165
- }
45166
- let frameId;
45167
- let prevRefRect = animationFrame ? getBoundingClientRect2(reference) : null;
45168
- if (animationFrame) {
45169
- frameLoop();
45170
- }
45171
- function frameLoop() {
45172
- const nextRefRect = getBoundingClientRect2(reference);
45173
- if (prevRefRect && !rectsAreEqual2(prevRefRect, nextRefRect)) {
45174
- update();
45175
- }
45176
- prevRefRect = nextRefRect;
45177
- frameId = requestAnimationFrame(frameLoop);
45178
- }
45179
- update();
45180
- return () => {
45181
- var _resizeObserver2;
45182
- ancestors.forEach((ancestor) => {
45183
- ancestorScroll && ancestor.removeEventListener("scroll", update);
45184
- ancestorResize && ancestor.removeEventListener("resize", update);
45185
- });
45186
- cleanupIo == null || cleanupIo();
45187
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
45188
- resizeObserver = null;
45189
- if (animationFrame) {
45190
- cancelAnimationFrame(frameId);
45191
- }
45192
- };
45193
- }
45194
- var offset3 = offset;
45195
- var shift3 = shift;
45196
- var flip3 = flip;
45197
- var computePosition3 = (reference, floating, options) => {
45198
- const cache2 = /* @__PURE__ */ new Map();
45199
- const mergedOptions = {
45200
- platform: platform2,
45201
- ...options
45202
- };
45203
- const platformWithCache = {
45204
- ...mergedOptions.platform,
45205
- _c: cache2
45206
- };
45207
- return computePosition(reference, floating, {
45208
- ...mergedOptions,
45209
- platform: platformWithCache
45210
- });
45211
- };
45212
-
45213
44676
  // src/surfaces/positioning.ts
45214
44677
  var STATIC_SLOT_STYLES = {
45215
44678
  drawer_right: {
@@ -45302,18 +44765,18 @@ var SyntrologieSDK = (() => {
45302
44765
  function setupAdjacentPositioning(container, anchorEl, config) {
45303
44766
  const placement = config.placement === "auto" ? "bottom" : config.placement;
45304
44767
  const middleware = [
45305
- offset3(config.offset ? { mainAxis: config.offset.y, crossAxis: config.offset.x } : 8)
44768
+ offset2(config.offset ? { mainAxis: config.offset.y, crossAxis: config.offset.x } : 8)
45306
44769
  ];
45307
44770
  if (config.flip !== false) {
45308
- middleware.push(flip3());
44771
+ middleware.push(flip2());
45309
44772
  }
45310
44773
  if (config.shift !== false) {
45311
- middleware.push(shift3({ padding: 8 }));
44774
+ middleware.push(shift2({ padding: 8 }));
45312
44775
  }
45313
44776
  container.style.position = "absolute";
45314
44777
  container.style.zIndex = "2147483646";
45315
- const cleanup = autoUpdate2(anchorEl, container, async () => {
45316
- const { x: x2, y: y2, strategy } = await computePosition3(anchorEl, container, {
44778
+ const cleanup = autoUpdate(anchorEl, container, async () => {
44779
+ const { x: x2, y: y2, strategy } = await computePosition2(anchorEl, container, {
45317
44780
  placement,
45318
44781
  middleware
45319
44782
  });
@@ -45830,11 +45293,11 @@ var SyntrologieSDK = (() => {
45830
45293
 
45831
45294
  // src/apps/AppContext.ts
45832
45295
  function createAppContext(options) {
45833
- const { appId, runtime: runtime4, isBuiltIn = false } = options;
45296
+ const { appId, runtime: runtime3, isBuiltIn = false } = options;
45834
45297
  const _statePrefix = `app:${appId}:`;
45835
45298
  const registeredActions = [];
45836
45299
  const registeredWidgets = [];
45837
- const appStorage = runtime4.state.ns(`app:${appId}`);
45300
+ const appStorage = runtime3.state.ns(`app:${appId}`);
45838
45301
  const context = {
45839
45302
  appId,
45840
45303
  // Namespaced state access (using session storage scoped to this app)
@@ -45844,19 +45307,19 @@ var SyntrologieSDK = (() => {
45844
45307
  remove: (key) => appStorage.remove(key)
45845
45308
  },
45846
45309
  // Telemetry access (if available) - using EventBus for custom events
45847
- telemetry: runtime4.telemetry ? {
45310
+ telemetry: runtime3.telemetry ? {
45848
45311
  emit: (eventName, props) => {
45849
- runtime4.events.publish(eventName, {
45312
+ runtime3.events.publish(eventName, {
45850
45313
  ...props,
45851
45314
  _appId: appId
45852
45315
  });
45853
45316
  },
45854
- getSessionId: () => runtime4.telemetry?.getSessionId?.()
45317
+ getSessionId: () => runtime3.telemetry?.getSessionId?.()
45855
45318
  } : void 0,
45856
45319
  // Surfaces access
45857
45320
  surfaces: {
45858
45321
  mount: (slot, content, opts) => {
45859
- const handle = runtime4.surfaces.mount(slot, content, {
45322
+ const handle = runtime3.surfaces.mount(slot, content, {
45860
45323
  ...opts,
45861
45324
  adaptiveId: appId
45862
45325
  });
@@ -45865,17 +45328,17 @@ var SyntrologieSDK = (() => {
45865
45328
  update: (newContent) => handle.update(newContent)
45866
45329
  };
45867
45330
  },
45868
- canMount: (slot, priority) => runtime4.surfaces.canMount(slot, priority)
45331
+ canMount: (slot, priority) => runtime3.surfaces.canMount(slot, priority)
45869
45332
  },
45870
45333
  // Events access
45871
45334
  events: {
45872
45335
  subscribe: (callback) => {
45873
- return runtime4.events.subscribe((event) => {
45336
+ return runtime3.events.subscribe((event) => {
45874
45337
  callback(event);
45875
45338
  });
45876
45339
  },
45877
45340
  publish: (name, props) => {
45878
- runtime4.events.publish(name, {
45341
+ runtime3.events.publish(name, {
45879
45342
  ...props,
45880
45343
  _appId: appId
45881
45344
  });
@@ -45883,7 +45346,7 @@ var SyntrologieSDK = (() => {
45883
45346
  },
45884
45347
  // Action registration
45885
45348
  registerAction: (definition) => {
45886
- runtime4.executors.register(
45349
+ runtime3.executors.register(
45887
45350
  definition.kind,
45888
45351
  definition.executor,
45889
45352
  definition.schema,
@@ -45894,15 +45357,15 @@ var SyntrologieSDK = (() => {
45894
45357
  },
45895
45358
  // Widget registration
45896
45359
  registerWidget: (definition) => {
45897
- runtime4.widgets.register(definition.id, definition.component, appId, definition.metadata);
45360
+ runtime3.widgets.register(definition.id, definition.component, appId, definition.metadata);
45898
45361
  registeredWidgets.push(definition.id);
45899
45362
  }
45900
45363
  };
45901
45364
  return context;
45902
45365
  }
45903
- function cleanupAppContext(appId, runtime4) {
45904
- runtime4.executors.unregisterBySource(appId);
45905
- runtime4.widgets.unregisterBySource(appId);
45366
+ function cleanupAppContext(appId, runtime3) {
45367
+ runtime3.executors.unregisterBySource(appId);
45368
+ runtime3.widgets.unregisterBySource(appId);
45906
45369
  }
45907
45370
 
45908
45371
  // src/apps/AppRegistry.ts
@@ -45916,8 +45379,8 @@ var SyntrologieSDK = (() => {
45916
45379
  * Bind the registry to a runtime instance.
45917
45380
  * Must be called before apps can be activated.
45918
45381
  */
45919
- bind(runtime4) {
45920
- this.runtime = runtime4;
45382
+ bind(runtime3) {
45383
+ this.runtime = runtime3;
45921
45384
  }
45922
45385
  /**
45923
45386
  * Unbind from the current runtime.
@@ -46182,22 +45645,19 @@ var SyntrologieSDK = (() => {
46182
45645
 
46183
45646
  // src/apps/AppLoader.ts
46184
45647
  var CORE_ACTION_KINDS = /* @__PURE__ */ new Set([
46185
- // Overlay actions (bundled via @syntrologie/app-overlays)
45648
+ // Overlay actions (bundled via @syntrologie/adapt-overlays)
46186
45649
  "overlays:highlight",
46187
45650
  "overlays:pulse",
46188
45651
  "overlays:badge",
46189
45652
  "overlays:tooltip",
46190
45653
  "overlays:modal",
46191
- // Content actions (bundled via @syntrologie/app-content)
45654
+ // Content actions (bundled via @syntrologie/adapt-content)
46192
45655
  "content:insertHtml",
46193
45656
  "content:setText",
46194
45657
  "content:setAttr",
46195
45658
  "content:addClass",
46196
45659
  "content:removeClass",
46197
45660
  "content:setStyle",
46198
- // Navigation actions (bundled via @syntrologie/app-navigation)
46199
- "navigation:scrollTo",
46200
- "navigation:navigate",
46201
45661
  // Core actions (bundled with runtime)
46202
45662
  "core:mountWidget",
46203
45663
  "core:wait",
@@ -46205,6 +45665,13 @@ var SyntrologieSDK = (() => {
46205
45665
  "core:parallel",
46206
45666
  "core:tour"
46207
45667
  ]);
45668
+ var NAMESPACE_TO_APP_ID = {
45669
+ navigation: "nav"
45670
+ // navigation:scrollTo, navigation:navigate → apps/nav/
45671
+ };
45672
+ function resolveAppId(namespace) {
45673
+ return NAMESPACE_TO_APP_ID[namespace] ?? namespace;
45674
+ }
46208
45675
  function isCoreActionKind(kind) {
46209
45676
  return CORE_ACTION_KINDS.has(kind);
46210
45677
  }
@@ -46212,12 +45679,12 @@ var SyntrologieSDK = (() => {
46212
45679
  if (isCoreActionKind(kind)) return null;
46213
45680
  const colonIndex = kind.indexOf(":");
46214
45681
  if (colonIndex === -1) return null;
46215
- return kind.slice(0, colonIndex);
45682
+ return resolveAppId(kind.slice(0, colonIndex));
46216
45683
  }
46217
45684
  function getAppIdFromWidgetId(widgetId) {
46218
45685
  const colonIndex = widgetId.indexOf(":");
46219
45686
  if (colonIndex === -1) return null;
46220
- return widgetId.slice(0, colonIndex);
45687
+ return resolveAppId(widgetId.slice(0, colonIndex));
46221
45688
  }
46222
45689
  function createAppLoader(options) {
46223
45690
  const { cdnBase, registry, timeout = 1e4, onLoadStart, onLoadEnd } = options;
@@ -46695,7 +46162,7 @@ var SyntrologieSDK = (() => {
46695
46162
  function createSmartCanvasRuntime(options = {}) {
46696
46163
  const { telemetry, sessionMetrics, routes, mode = "production", namespace } = options;
46697
46164
  const widgets = options.widgets ?? widgetRegistry;
46698
- const executors4 = options.executors ?? executorRegistry;
46165
+ const executors3 = options.executors ?? executorRegistry;
46699
46166
  const apps = options.apps ?? appRegistry;
46700
46167
  const context = createContextManager({
46701
46168
  telemetry,
@@ -46723,9 +46190,9 @@ var SyntrologieSDK = (() => {
46723
46190
  eventBus: events,
46724
46191
  surfaces,
46725
46192
  anchorResolver,
46726
- executorRegistry: executors4
46193
+ executorRegistry: executors3
46727
46194
  });
46728
- const runtime4 = {
46195
+ const runtime3 = {
46729
46196
  telemetry,
46730
46197
  context,
46731
46198
  events,
@@ -46734,7 +46201,7 @@ var SyntrologieSDK = (() => {
46734
46201
  actions,
46735
46202
  surfaces,
46736
46203
  widgets,
46737
- executors: executors4,
46204
+ executors: executors3,
46738
46205
  apps,
46739
46206
  version: RUNTIME_VERSION,
46740
46207
  mode,
@@ -46779,8 +46246,8 @@ var SyntrologieSDK = (() => {
46779
46246
  surfaces.destroy();
46780
46247
  }
46781
46248
  };
46782
- apps.bind(runtime4);
46783
- return runtime4;
46249
+ apps.bind(runtime3);
46250
+ return runtime3;
46784
46251
  }
46785
46252
 
46786
46253
  // src/token.ts
@@ -46824,7 +46291,7 @@ var SyntrologieSDK = (() => {
46824
46291
  // src/telemetry/registry.ts
46825
46292
  var adapters2 = {
46826
46293
  posthog: (config) => createPostHogClient(config),
46827
- noop: (config) => createNoopClient(config)
46294
+ noop: () => createNoopClient()
46828
46295
  };
46829
46296
  function createTelemetryClient(provider, config) {
46830
46297
  const factory = adapters2[provider];
@@ -47043,11 +46510,11 @@ var SyntrologieSDK = (() => {
47043
46510
  });
47044
46511
  return hasAuditFlag;
47045
46512
  }
47046
- var SEGMENT_CACHE_KEY2 = "syntro_segment_attributes";
46513
+ var SEGMENT_CACHE_KEY = "syntro_segment_attributes";
47047
46514
  function loadCachedSegmentAttributes() {
47048
46515
  if (typeof window === "undefined") return {};
47049
46516
  try {
47050
- const cached = localStorage.getItem(SEGMENT_CACHE_KEY2);
46517
+ const cached = localStorage.getItem(SEGMENT_CACHE_KEY);
47051
46518
  if (cached) {
47052
46519
  const attrs = JSON.parse(cached);
47053
46520
  debug("Syntro Bootstrap", "Loaded cached segment attributes:", attrs);
@@ -47061,7 +46528,7 @@ var SyntrologieSDK = (() => {
47061
46528
  function cacheSegmentAttributes(attrs) {
47062
46529
  if (typeof window === "undefined") return;
47063
46530
  try {
47064
- localStorage.setItem(SEGMENT_CACHE_KEY2, JSON.stringify(attrs));
46531
+ localStorage.setItem(SEGMENT_CACHE_KEY, JSON.stringify(attrs));
47065
46532
  debug("Syntro Bootstrap", "Cached segment attributes:", attrs);
47066
46533
  } catch (err) {
47067
46534
  warn("Syntro Bootstrap", "Failed to cache segment attributes:", err);
@@ -47177,7 +46644,7 @@ var SyntrologieSDK = (() => {
47177
46644
  if (editorMode) runtimeMode = "editor";
47178
46645
  else if (auditMode) runtimeMode = "audit";
47179
46646
  else if (getEnvVar("NODE_ENV") === "development") runtimeMode = "development";
47180
- const runtime4 = createSmartCanvasRuntime({
46647
+ const runtime3 = createSmartCanvasRuntime({
47181
46648
  telemetry,
47182
46649
  sessionMetrics,
47183
46650
  mode: runtimeMode,
@@ -47185,17 +46652,17 @@ var SyntrologieSDK = (() => {
47185
46652
  // Use the EventBus we created earlier (already wired to PostHog)
47186
46653
  });
47187
46654
  debug("Syntro Bootstrap", "Runtime created:", {
47188
- version: runtime4.version,
47189
- mode: runtime4.mode,
47190
- hasContext: !!runtime4.context,
47191
- hasEvents: !!runtime4.events,
47192
- hasState: !!runtime4.state
46655
+ version: runtime3.version,
46656
+ mode: runtime3.mode,
46657
+ hasContext: !!runtime3.context,
46658
+ hasEvents: !!runtime3.events,
46659
+ hasState: !!runtime3.state
47193
46660
  });
47194
46661
  debug("Syntro Bootstrap", "Core app executors already registered");
47195
- const cdnBase = options.cdnBase || getEnvVar("NEXT_PUBLIC_SYNTRO_CDN_BASE") || getEnvVar("VITE_SYNTRO_CDN_BASE") || "https://cdn.syntro.io";
46662
+ const cdnBase = options.cdnBase || getEnvVar("NEXT_PUBLIC_SYNTRO_CDN_BASE") || getEnvVar("VITE_SYNTRO_CDN_BASE") || "https://cdn.syntrologie.com";
47196
46663
  const appLoader = createAppLoader({
47197
46664
  cdnBase,
47198
- registry: runtime4.apps,
46665
+ registry: runtime3.apps,
47199
46666
  onLoadStart: (appId) => {
47200
46667
  debug("Syntro Bootstrap", `Loading app from CDN: ${appId}`);
47201
46668
  },
@@ -47209,9 +46676,9 @@ var SyntrologieSDK = (() => {
47209
46676
  });
47210
46677
  if (typeof window !== "undefined") {
47211
46678
  window.SynOS = {
47212
- appRegistry: runtime4.apps,
47213
- runtime: runtime4,
47214
- version: runtime4.version
46679
+ appRegistry: runtime3.apps,
46680
+ runtime: runtime3,
46681
+ version: runtime3.version
47215
46682
  };
47216
46683
  debug("Syntro Bootstrap", "Global SynOS object exposed");
47217
46684
  }
@@ -47250,9 +46717,9 @@ var SyntrologieSDK = (() => {
47250
46717
  warn("Syntro Bootstrap", "Some apps failed to load:", failedApps);
47251
46718
  }
47252
46719
  for (const appId of requiredApps) {
47253
- if (runtime4.apps.has(appId)) {
46720
+ if (runtime3.apps.has(appId)) {
47254
46721
  try {
47255
- await runtime4.apps.activate(appId);
46722
+ await runtime3.apps.activate(appId);
47256
46723
  } catch (err) {
47257
46724
  warn("Syntro Bootstrap", `Failed to activate app: ${appId}`, err);
47258
46725
  }
@@ -47268,10 +46735,10 @@ var SyntrologieSDK = (() => {
47268
46735
  fetcher: appLoadingFetcher,
47269
46736
  integrations: { experiments, telemetry },
47270
46737
  editorUrl,
47271
- runtime: runtime4
46738
+ runtime: runtime3
47272
46739
  // Pass runtime so actions can be applied
47273
46740
  });
47274
- return { canvas, runtime: runtime4, experiments, telemetry, sessionMetrics, appLoader };
46741
+ return { canvas, runtime: runtime3, experiments, telemetry, sessionMetrics, appLoader };
47275
46742
  }
47276
46743
  var Syntro = {
47277
46744
  init,