@riverbankcms/sdk 0.60.0 → 0.60.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 (86) hide show
  1. package/README.md +20 -3
  2. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +1 -3
  3. package/dist/_dts/api/src/bookingRecords.d.ts +1 -0
  4. package/dist/_dts/api/src/endpoints.d.ts +1 -1
  5. package/dist/_dts/billing/src/plans/types.d.ts +27 -0
  6. package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +1 -0
  7. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +173 -2
  8. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -2
  9. package/dist/_dts/blocks/src/system/runtime/header/shared.d.ts +1 -0
  10. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.client.d.ts +1 -0
  11. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/AgendaEventCard.d.ts +2 -0
  12. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
  13. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventDetailModal.d.ts +2 -1
  14. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +2 -1
  15. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +1 -0
  16. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +1 -0
  17. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCapacity.d.ts +16 -0
  18. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +2 -0
  19. package/dist/_dts/content-editor/src/index.d.ts +2 -2
  20. package/dist/_dts/content-editor/src/primitives/shared/activePreviewField.d.ts +9 -0
  21. package/dist/_dts/content-editor/src/primitives/shared/index.d.ts +1 -0
  22. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +10 -0
  23. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +3 -0
  24. package/dist/_dts/editor-blocks/src/BlockForm.d.ts +4 -0
  25. package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +8 -5
  26. package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +7 -5
  27. package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +2 -0
  28. package/dist/_dts/editor-blocks/src/block-editor/reorderControlMode.d.ts +3 -0
  29. package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +4 -0
  30. package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +14 -0
  31. package/dist/_dts/media-react/src/index.d.ts +1 -1
  32. package/dist/_dts/preview-next/src/client/index.d.ts +2 -0
  33. package/dist/_dts/preview-next/src/client/preview/PageDesignEditorStateContext.d.ts +11 -28
  34. package/dist/_dts/preview-next/src/client/preview/PreviewEditorUI.d.ts +1 -1
  35. package/dist/_dts/preview-next/src/client/preview/previewChromeSurface.d.ts +12 -0
  36. package/dist/_dts/preview-next/src/client/preview/previewCustomizeHistory.d.ts +41 -0
  37. package/dist/_dts/preview-next/src/client/preview/previewCustomizeRuntimePatch.d.ts +15 -0
  38. package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +106 -0
  39. package/dist/_dts/preview-next/src/client/preview/previewUndoDomains.d.ts +34 -0
  40. package/dist/_dts/preview-next/src/client/preview/sidebarTabPreference.d.ts +2 -1
  41. package/dist/_dts/preview-next/src/client/preview/useOnboardingConfirmationCheck.d.ts +4 -9
  42. package/dist/_dts/preview-next/src/constants.d.ts +0 -1
  43. package/dist/_dts/preview-next/src/index.d.ts +1 -0
  44. package/dist/_dts/preview-next/src/onboarding-preview-planner.d.ts +89 -0
  45. package/dist/_dts/preview-next/src/route-contract.d.ts +37 -0
  46. package/dist/_dts/sdk/src/rendering/components/Block.d.ts +7 -76
  47. package/dist/_dts/sdk/src/rendering/components/Block.server.d.ts +9 -0
  48. package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +78 -0
  49. package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +5 -5
  50. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  51. package/dist/_dts/sdk/src/version.d.ts +1 -1
  52. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  53. package/dist/_dts/theme-core/src/index.d.ts +17 -16
  54. package/dist/_dts/theme-core/src/responsiveDisplay.d.ts +23 -0
  55. package/dist/_dts/theme-core/src/responsiveMode.d.ts +21 -0
  56. package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
  57. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorErrors.d.ts +1 -0
  58. package/dist/_dts/ui/src/command-multi-select.d.ts +2 -2
  59. package/dist/cli/index.mjs +120 -40
  60. package/dist/client/bookings.mjs +27 -0
  61. package/dist/client/client.mjs +889 -497
  62. package/dist/client/hooks.mjs +61 -21
  63. package/dist/client/rendering/client.mjs +319 -128
  64. package/dist/client/rendering/islands.mjs +122 -44
  65. package/dist/client/rendering.mjs +959 -486
  66. package/dist/preview-next/before-render.mjs +5525 -0
  67. package/dist/preview-next/client/runtime.mjs +104162 -102561
  68. package/dist/preview-next/constants.mjs +0 -2
  69. package/dist/preview-next/index.mjs +0 -2
  70. package/dist/preview-next/middleware.mjs +5535 -1
  71. package/dist/server/components.mjs +7880 -7522
  72. package/dist/server/config-validation.mjs +61 -21
  73. package/dist/server/config.mjs +61 -21
  74. package/dist/server/data.mjs +61 -21
  75. package/dist/server/index.mjs +2 -2
  76. package/dist/server/next.mjs +783 -429
  77. package/dist/server/page-converter.mjs +60 -20
  78. package/dist/server/prebuild.mjs +1 -1
  79. package/dist/server/rendering/server.mjs +2461 -837
  80. package/dist/server/rendering.mjs +9276 -8840
  81. package/dist/server/routing.mjs +102 -39
  82. package/dist/server/server.mjs +62 -22
  83. package/dist/server/theme-bridge.mjs +639 -358
  84. package/dist/styles/index.css +343 -299
  85. package/package.json +1 -1
  86. package/dist/_dts/preview-next/src/client/blocks/runOptimisticCustomizeAction.d.ts +0 -21
@@ -13180,6 +13180,59 @@ function bindProp(from, opts) {
13180
13180
  };
13181
13181
  }
13182
13182
 
13183
+ // ../theme-core/src/responsiveDisplay.ts
13184
+ var BASE_DISPLAY_CLASSES = {
13185
+ block: "rb-block",
13186
+ flex: "rb-flex",
13187
+ "inline-block": "rb-inline-block",
13188
+ "inline-flex": "rb-inline-flex",
13189
+ grid: "rb-grid"
13190
+ };
13191
+ var LARGE_DISPLAY_CLASSES = {
13192
+ block: "rb-lg-block",
13193
+ flex: "rb-lg-flex",
13194
+ "inline-block": "rb-lg-inline-block",
13195
+ "inline-flex": "rb-lg-inline-flex",
13196
+ grid: "rb-lg-grid"
13197
+ };
13198
+ function mobileOnlyDisplay(display) {
13199
+ return `${BASE_DISPLAY_CLASSES[display]} rb-lg-hidden`;
13200
+ }
13201
+ function desktopOnlyDisplay(display) {
13202
+ return `rb-hidden ${LARGE_DISPLAY_CLASSES[display]}`;
13203
+ }
13204
+
13205
+ // ../blocks/src/system/runtime/header/shared.ts
13206
+ var POSITIONING_CLASSES = [
13207
+ "rb-sticky",
13208
+ "rb-fixed",
13209
+ "rb-absolute",
13210
+ "rb-relative",
13211
+ "rb-top-0",
13212
+ "rb-left-0",
13213
+ "rb-right-0",
13214
+ "rb-bottom-0",
13215
+ "rb-z-40",
13216
+ "rb-z-50"
13217
+ ];
13218
+ function splitPositioningClasses(className) {
13219
+ if (!className) return { wrapperClasses: "", sectionClasses: "" };
13220
+ const classes = className.split(/\s+/).filter(Boolean);
13221
+ const wrapperParts = [];
13222
+ const sectionParts = [];
13223
+ for (const cls of classes) {
13224
+ if (POSITIONING_CLASSES.includes(cls)) {
13225
+ wrapperParts.push(cls);
13226
+ } else {
13227
+ sectionParts.push(cls);
13228
+ }
13229
+ }
13230
+ return {
13231
+ wrapperClasses: wrapperParts.join(" "),
13232
+ sectionClasses: sectionParts.join(" ")
13233
+ };
13234
+ }
13235
+
13183
13236
  // ../blocks/src/system/blocks/site-header.ts
13184
13237
  var logoRow = link(
13185
13238
  {
@@ -13260,7 +13313,7 @@ var headerCta = ctaButton({
13260
13313
  whenPath: "menu.ctaItem.label",
13261
13314
  variantPath: "menu.ctaItem.variant",
13262
13315
  linkPath: "menu.ctaItem.link",
13263
- className: "header-cta btn-sm rb-hidden rb-lg-inline-flex rb-ml-6"
13316
+ className: `header-cta btn-sm ${desktopOnlyDisplay("inline-flex")} rb-ml-6`
13264
13317
  });
13265
13318
  var mobileCta = ctaButton({
13266
13319
  basePath: "menu.ctaItem",
@@ -13288,7 +13341,7 @@ var mobileToggleButton = {
13288
13341
  props: {
13289
13342
  type: "button",
13290
13343
  variantId: "",
13291
- className: "nav-mobile-toggle rb-inline-flex rb-h-10 rb-w-10 rb-items-center rb-justify-center rb-rounded-md transition-theme-standard rb-lg-hidden",
13344
+ className: `nav-mobile-toggle ${mobileOnlyDisplay("inline-flex")} rb-h-10 rb-w-10 rb-items-center rb-justify-center rb-rounded-md transition-theme-standard`,
13292
13345
  "aria-label": "Open menu",
13293
13346
  "aria-expanded": "false",
13294
13347
  "aria-controls": "nav-mobile-overlay",
@@ -13343,7 +13396,7 @@ var mobileOverlay = {
13343
13396
  type: "div",
13344
13397
  props: {
13345
13398
  id: "nav-mobile-overlay",
13346
- className: "nav-mobile-overlay rb-fixed rb-inset-0 rb-z-50 rb-lg-hidden",
13399
+ className: `nav-mobile-overlay ${mobileOnlyDisplay("block")} rb-fixed rb-inset-0 rb-z-50`,
13347
13400
  role: "dialog",
13348
13401
  "aria-modal": "true",
13349
13402
  "aria-label": "Main menu",
@@ -13372,10 +13425,10 @@ var mobileHeaderBar = inline(
13372
13425
  className: bindProp("$root.theme.header.maxWidth", {
13373
13426
  transforms: pipe(
13374
13427
  tx("layout.maxWidthClass", {
13375
- base: "rb-header-layout rb-flex rb-w-full rb-items-center rb-justify-between rb-lg-hidden"
13428
+ base: `rb-header-layout ${mobileOnlyDisplay("flex")} rb-w-full rb-items-center rb-justify-between`
13376
13429
  })
13377
13430
  ),
13378
- fallback: "rb-container rb-header-layout rb-flex rb-w-full rb-items-center rb-justify-between rb-lg-hidden"
13431
+ fallback: `rb-container rb-header-layout ${mobileOnlyDisplay("flex")} rb-w-full rb-items-center rb-justify-between`
13379
13432
  }),
13380
13433
  align: "center",
13381
13434
  justify: "between"
@@ -13387,16 +13440,16 @@ var classicLayout2 = inline(
13387
13440
  className: bindProp("$root.theme.header.maxWidth", {
13388
13441
  transforms: pipe(
13389
13442
  tx("layout.maxWidthClass", {
13390
- base: "rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-items-center rb-gap-6"
13443
+ base: `rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-items-center rb-gap-6`
13391
13444
  })
13392
13445
  ),
13393
- fallback: "rb-container rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-items-center rb-gap-6"
13446
+ fallback: `rb-container rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-items-center rb-gap-6`
13394
13447
  }),
13395
13448
  align: "center"
13396
13449
  },
13397
13450
  [
13398
13451
  logoRow,
13399
- createNavRow("rb-ml-auto rb-hidden rb-lg-flex rb-gap-6"),
13452
+ createNavRow(`rb-ml-auto ${desktopOnlyDisplay("flex")} rb-gap-6`),
13400
13453
  headerCta
13401
13454
  ],
13402
13455
  when("$root.theme.header.variant", { equals: "classic" })
@@ -13408,16 +13461,16 @@ var centeredLayout = stack(
13408
13461
  className: bindProp("$root.theme.header.maxWidth", {
13409
13462
  transforms: pipe(
13410
13463
  tx("layout.maxWidthClass", {
13411
- base: "rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-flex-col rb-items-center rb-gap-5 rb-text-center"
13464
+ base: `rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-flex-col rb-items-center rb-gap-5 rb-text-center`
13412
13465
  })
13413
13466
  ),
13414
- fallback: "rb-container rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-flex-col rb-items-center rb-gap-5 rb-text-center"
13467
+ fallback: `rb-container rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-flex-col rb-items-center rb-gap-5 rb-text-center`
13415
13468
  })
13416
13469
  },
13417
13470
  [
13418
13471
  centeredLogoRow,
13419
13472
  createNavRow(
13420
- "rb-hidden rb-lg-flex rb-flex-wrap rb-justify-center rb-gap-x-6 rb-gap-y-3",
13473
+ `${desktopOnlyDisplay("flex")} rb-flex-wrap rb-justify-center rb-gap-x-6 rb-gap-y-3`,
13421
13474
  "center"
13422
13475
  )
13423
13476
  ],
@@ -13428,16 +13481,16 @@ var transparentLayout = inline(
13428
13481
  className: bindProp("$root.theme.header.maxWidth", {
13429
13482
  transforms: pipe(
13430
13483
  tx("layout.maxWidthClass", {
13431
- base: "rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-items-center rb-gap-6"
13484
+ base: `rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-items-center rb-gap-6`
13432
13485
  })
13433
13486
  ),
13434
- fallback: "rb-container rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-items-center rb-gap-6"
13487
+ fallback: `rb-container rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-items-center rb-gap-6`
13435
13488
  }),
13436
13489
  align: "center"
13437
13490
  },
13438
13491
  [
13439
13492
  logoRow,
13440
- createNavRow("rb-ml-auto rb-hidden rb-lg-flex rb-gap-6"),
13493
+ createNavRow(`rb-ml-auto ${desktopOnlyDisplay("flex")} rb-gap-6`),
13441
13494
  headerCta
13442
13495
  ],
13443
13496
  when("$root.theme.header.variant", { equals: "transparent" })
@@ -13447,18 +13500,18 @@ var floatingLayout = inline(
13447
13500
  className: bindProp("$root.theme.header.maxWidth", {
13448
13501
  transforms: pipe(
13449
13502
  tx("layout.maxWidthClass", {
13450
- base: "rb-header-layout header-floating-container rb-absolute rb-left-1/2 rb-top-4 rb-hidden rb-w-calc-100-minus-2rem rb-max-w-7xl rb-translate-x-neg-1/2 rb-items-center rb-gap-6 rb-px-6 rb-lg-flex",
13503
+ base: `rb-header-layout header-floating-container rb-absolute rb-left-1/2 rb-top-4 ${desktopOnlyDisplay("flex")} rb-w-calc-100-minus-2rem rb-max-w-7xl rb-translate-x-neg-1/2 rb-items-center rb-gap-6 rb-px-6`,
13451
13504
  container: "",
13452
13505
  full: ""
13453
13506
  })
13454
13507
  ),
13455
- fallback: "rb-header-layout header-floating-container rb-absolute rb-left-1/2 rb-top-4 rb-hidden rb-w-calc-100-minus-2rem rb-max-w-7xl rb-translate-x-neg-1/2 rb-items-center rb-gap-6 rb-px-6 rb-lg-flex"
13508
+ fallback: `rb-header-layout header-floating-container rb-absolute rb-left-1/2 rb-top-4 ${desktopOnlyDisplay("flex")} rb-w-calc-100-minus-2rem rb-max-w-7xl rb-translate-x-neg-1/2 rb-items-center rb-gap-6 rb-px-6`
13456
13509
  }),
13457
13510
  align: "center"
13458
13511
  },
13459
13512
  [
13460
13513
  logoRow,
13461
- createNavRow("rb-ml-auto rb-hidden rb-lg-flex rb-gap-6"),
13514
+ createNavRow(`rb-ml-auto ${desktopOnlyDisplay("flex")} rb-gap-6`),
13462
13515
  headerCta
13463
13516
  ],
13464
13517
  when("$root.theme.header.variant", { equals: "floating" })
@@ -13470,16 +13523,16 @@ var editorialLayout = stack(
13470
13523
  className: bindProp("$root.theme.header.maxWidth", {
13471
13524
  transforms: pipe(
13472
13525
  tx("layout.maxWidthClass", {
13473
- base: "rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-flex-col rb-items-center rb-gap-6 rb-text-center"
13526
+ base: `rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-flex-col rb-items-center rb-gap-6 rb-text-center`
13474
13527
  })
13475
13528
  ),
13476
- fallback: "rb-container rb-header-layout rb-hidden rb-lg-flex rb-w-full rb-flex-col rb-items-center rb-gap-6 rb-text-center"
13529
+ fallback: `rb-container rb-header-layout ${desktopOnlyDisplay("flex")} rb-w-full rb-flex-col rb-items-center rb-gap-6 rb-text-center`
13477
13530
  })
13478
13531
  },
13479
13532
  [
13480
13533
  centeredLogoRow,
13481
13534
  createNavRow(
13482
- "rb-hidden rb-lg-flex rb-flex-wrap rb-justify-center rb-gap-x-8 rb-gap-y-3",
13535
+ `${desktopOnlyDisplay("flex")} rb-flex-wrap rb-justify-center rb-gap-x-8 rb-gap-y-3`,
13483
13536
  "center"
13484
13537
  )
13485
13538
  ],
@@ -16750,6 +16803,18 @@ var eventSpotlightBlockDefinition = {
16750
16803
  // ../blocks/src/system/runtime/nodes/events/EventListing.interactive.ts
16751
16804
  import { z as z44 } from "zod";
16752
16805
 
16806
+ // ../blocks/src/system/runtime/nodes/events/shared/eventCapacity.ts
16807
+ function getEventAvailability(event) {
16808
+ if (event.capacity == null) {
16809
+ return { available: null, isFull: false };
16810
+ }
16811
+ const available = event.availableSpots ?? event.capacity - event.registeredCount;
16812
+ if (available <= 0) {
16813
+ return { available: 0, isFull: true };
16814
+ }
16815
+ return { available, isFull: false };
16816
+ }
16817
+
16753
16818
  // ../blocks/src/system/runtime/nodes/events/shared/utils.ts
16754
16819
  var COLUMN_CLASSES = {
16755
16820
  "2": "rb-sm-grid-cols-2",
@@ -16972,7 +17037,7 @@ function formatEventPrice(event) {
16972
17037
  }
16973
17038
  }
16974
17039
  function resolveEventCta(event, buttonText) {
16975
- const isSoldOut = event.capacity !== null && event.availableSpots === 0;
17040
+ const { isFull: isSoldOut } = getEventAvailability(event);
16976
17041
  const defaultButtonText = event.kind === "course_session" ? "View course" : "View event";
16977
17042
  const effectiveButtonText = buttonText ?? defaultButtonText;
16978
17043
  if (isSoldOut) {
@@ -18354,7 +18419,7 @@ var EventCard = ({
18354
18419
  )}`;
18355
18420
  const cta = resolveEventCta(event, buttonText);
18356
18421
  const isSoldOut = cta.hidden;
18357
- const spotsLeft = event.availableSpots;
18422
+ const { available: spotsLeft } = getEventAvailability(event);
18358
18423
  const cardClass = `card-${cardVariant}`;
18359
18424
  const buttonClass = `${buttonVariant} button-${buttonVariant}`;
18360
18425
  const title = event.title;
@@ -19379,6 +19444,21 @@ var eventCalendarManifest = createBlockManifest({
19379
19444
  visibleWhen: { field: "displayMode", oneOf: ["combined", "list", "timetable"] }
19380
19445
  }
19381
19446
  },
19447
+ {
19448
+ id: "showCapacity",
19449
+ type: "boolean",
19450
+ label: "Show available spots",
19451
+ description: "Display remaining capacity on event cards and timetable cells",
19452
+ required: false,
19453
+ defaultValue: true,
19454
+ ui: {
19455
+ intent: "display",
19456
+ visibleWhen: {
19457
+ field: "displayMode",
19458
+ oneOf: ["combined", "list", "week", "timetable"]
19459
+ }
19460
+ }
19461
+ },
19382
19462
  // Block-level pre-filtering
19383
19463
  {
19384
19464
  id: "eventSurface",
@@ -19570,6 +19650,9 @@ var eventCalendarManifest = createBlockManifest({
19570
19650
  showStaffFilter: {
19571
19651
  $bind: { from: "content.showStaffFilter", fallback: true }
19572
19652
  },
19653
+ showCapacity: {
19654
+ $bind: { from: "content.showCapacity", fallback: true }
19655
+ },
19573
19656
  kind: { $bind: { from: "content.kind", fallback: "all" } },
19574
19657
  eventSurface: {
19575
19658
  $bind: { from: "content.eventSurface", fallback: "all" }
@@ -26061,37 +26144,6 @@ function resolveNode(value) {
26061
26144
  return value;
26062
26145
  }
26063
26146
 
26064
- // ../blocks/src/system/runtime/header/shared.ts
26065
- var POSITIONING_CLASSES = [
26066
- "rb-sticky",
26067
- "rb-fixed",
26068
- "rb-absolute",
26069
- "rb-relative",
26070
- "rb-top-0",
26071
- "rb-left-0",
26072
- "rb-right-0",
26073
- "rb-bottom-0",
26074
- "rb-z-40",
26075
- "rb-z-50"
26076
- ];
26077
- function splitPositioningClasses(className) {
26078
- if (!className) return { wrapperClasses: "", sectionClasses: "" };
26079
- const classes = className.split(/\s+/).filter(Boolean);
26080
- const wrapperParts = [];
26081
- const sectionParts = [];
26082
- for (const cls of classes) {
26083
- if (POSITIONING_CLASSES.includes(cls)) {
26084
- wrapperParts.push(cls);
26085
- } else {
26086
- sectionParts.push(cls);
26087
- }
26088
- }
26089
- return {
26090
- wrapperClasses: wrapperParts.join(" "),
26091
- sectionClasses: sectionParts.join(" ")
26092
- };
26093
- }
26094
-
26095
26147
  // ../blocks/src/system/runtime/nodes/header-section.server.tsx
26096
26148
  import { jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
26097
26149
  function hasShrinkClasses(className) {
@@ -26865,7 +26917,7 @@ var event_details_server_default = EventDetailsSSR;
26865
26917
  import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
26866
26918
  function LocationMapView({
26867
26919
  addressText,
26868
- location,
26920
+ location: location2,
26869
26921
  zoom,
26870
26922
  heightPx,
26871
26923
  showAddressText,
@@ -26873,14 +26925,14 @@ function LocationMapView({
26873
26925
  directionsLabel,
26874
26926
  renderMap
26875
26927
  }) {
26876
- const directionsUrl = buildGoogleMapsDirectionsUrl({ addressText, location });
26877
- if (!location && !addressText && !directionsUrl) {
26928
+ const directionsUrl = buildGoogleMapsDirectionsUrl({ addressText, location: location2 });
26929
+ if (!location2 && !addressText && !directionsUrl) {
26878
26930
  return /* @__PURE__ */ jsx28("p", { className: "rb-caption", style: textColorStyle("mutedText"), children: "Location details coming soon." });
26879
26931
  }
26880
26932
  return /* @__PURE__ */ jsxs15("div", { className: "rb-flex rb-flex-col rb-gap-4 rb-text-left", children: [
26881
- location && renderMap ? renderMap({
26933
+ location2 && renderMap ? renderMap({
26882
26934
  addressText,
26883
- location,
26935
+ location: location2,
26884
26936
  className: "rb-location-map-canvas",
26885
26937
  height: heightPx,
26886
26938
  zoom
@@ -28066,21 +28118,26 @@ function buildTimetableModel(input) {
28066
28118
  for (const [dateKey, dayDrafts] of groupDraftsByDate(drafts)) {
28067
28119
  cellsByDate.set(
28068
28120
  dateKey,
28069
- assignTimetableLanes(dayDrafts).map((draft) => ({
28070
- event: draft.event,
28071
- startsAtMinutes: draft.startsAtMinutes,
28072
- endsAtMinutes: draft.endsAtMinutes,
28073
- topPercent: toRangePercent(draft.startsAtMinutes - rangeStartMinutes, rangeMinutes),
28074
- heightPercent: Math.max(
28075
- MIN_EVENT_HEIGHT_PERCENT,
28076
- toRangePercent(draft.endsAtMinutes - draft.startsAtMinutes, rangeMinutes)
28077
- ),
28078
- laneIndex: draft.laneIndex,
28079
- laneCount: draft.laneCount,
28080
- categoryColor: draft.event.eventCategory?.color || "rgb(var(--tb-accent))",
28081
- timeLabel: formatEventTimeRange(draft.event),
28082
- teacherLine: formatEventTeacherLine(draft.event)
28083
- }))
28121
+ assignTimetableLanes(dayDrafts).map((draft) => {
28122
+ const capacity = formatTimetableCapacity(draft.event);
28123
+ return {
28124
+ event: draft.event,
28125
+ startsAtMinutes: draft.startsAtMinutes,
28126
+ endsAtMinutes: draft.endsAtMinutes,
28127
+ topPercent: toRangePercent(draft.startsAtMinutes - rangeStartMinutes, rangeMinutes),
28128
+ heightPercent: Math.max(
28129
+ MIN_EVENT_HEIGHT_PERCENT,
28130
+ toRangePercent(draft.endsAtMinutes - draft.startsAtMinutes, rangeMinutes)
28131
+ ),
28132
+ laneIndex: draft.laneIndex,
28133
+ laneCount: draft.laneCount,
28134
+ categoryColor: draft.event.eventCategory?.color || "rgb(var(--tb-accent))",
28135
+ timeLabel: formatEventTimeRange(draft.event),
28136
+ teacherLine: formatEventTeacherLine(draft.event),
28137
+ capacityLabel: capacity.label,
28138
+ isFull: capacity.isFull
28139
+ };
28140
+ })
28084
28141
  );
28085
28142
  }
28086
28143
  return {
@@ -28213,6 +28270,12 @@ function formatShortDayLabel(date) {
28213
28270
  const dayName = FULL_DAY_NAMES[date.getDay()] ?? "";
28214
28271
  return `${dayName.slice(0, 3)} ${date.getDate()}`;
28215
28272
  }
28273
+ function formatTimetableCapacity(event) {
28274
+ const { available, isFull } = getEventAvailability(event);
28275
+ if (available == null) return { label: null, isFull: false };
28276
+ if (isFull) return { label: "Full", isFull: true };
28277
+ return { label: `${available} spots left`, isFull: false };
28278
+ }
28216
28279
  function formatEventTimeRange(event) {
28217
28280
  const timeZone = event.timeZone ?? null;
28218
28281
  return `${formatTime(event.startsAt, { timeZone })} - ${formatTime(event.endsAt, { timeZone })}`;
@@ -28469,7 +28532,17 @@ function renderTimetableSsr(display) {
28469
28532
  /* @__PURE__ */ jsx42("span", { className: "event-timetable-event-time", children: cell.timeLabel }),
28470
28533
  /* @__PURE__ */ jsx42("span", { className: "event-timetable-event-title", children: cell.event.title }),
28471
28534
  cell.teacherLine ? /* @__PURE__ */ jsx42("span", { className: "event-timetable-event-teacher", children: cell.teacherLine }) : null,
28472
- cell.event.venue ? /* @__PURE__ */ jsx42("span", { className: "event-timetable-event-meta", children: cell.event.venue.name }) : null
28535
+ cell.event.venue ? /* @__PURE__ */ jsx42("span", { className: "event-timetable-event-meta", children: cell.event.venue.name }) : null,
28536
+ display.showCapacity && cell.capacityLabel ? /* @__PURE__ */ jsx42(
28537
+ "span",
28538
+ {
28539
+ className: clsx_default(
28540
+ "event-timetable-event-capacity",
28541
+ cell.isFull && "event-timetable-event-capacity--full"
28542
+ ),
28543
+ children: cell.capacityLabel
28544
+ }
28545
+ ) : null
28473
28546
  ]
28474
28547
  },
28475
28548
  cell.event.occurrenceId || cell.event.id
@@ -32530,6 +32603,44 @@ ${declarationLines}
32530
32603
  // ../theme-core/src/responsiveMode.ts
32531
32604
  var DEFAULT_THEME_RESPONSIVE_MODE = "viewport";
32532
32605
  var THEME_RESPONSIVE_CONTAINER_NAME = "rb-site";
32606
+ var THEME_RESPONSIVE_MODE_ATTR = "data-rb-responsive-mode";
32607
+ function getResponsiveScopeSpec(mode = DEFAULT_THEME_RESPONSIVE_MODE) {
32608
+ if (mode === "container") {
32609
+ return {
32610
+ kind: "container",
32611
+ selector: `[${THEME_RESPONSIVE_MODE_ATTR}="container"]`,
32612
+ containerName: THEME_RESPONSIVE_CONTAINER_NAME
32613
+ };
32614
+ }
32615
+ return {
32616
+ kind: "viewport",
32617
+ selector: `[${THEME_RESPONSIVE_MODE_ATTR}="viewport"]`
32618
+ };
32619
+ }
32620
+ function escapeRegExp(value) {
32621
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
32622
+ }
32623
+ var RESPONSIVE_SCOPE_RULE_PATTERN = new RegExp(
32624
+ buildResponsiveScopeRulePatternSource(),
32625
+ "g"
32626
+ );
32627
+ var RESPONSIVE_SCOPE_RULE_AT_PATTERN = new RegExp(
32628
+ buildResponsiveScopeRulePatternSource(),
32629
+ "y"
32630
+ );
32631
+ function buildResponsiveScopeRulePatternSource() {
32632
+ return [
32633
+ "@scope",
32634
+ "\\(\\[",
32635
+ escapeRegExp(THEME_RESPONSIVE_MODE_ATTR),
32636
+ '="(?:viewport|container)"\\]\\)',
32637
+ "to",
32638
+ "\\((?::scope )?\\[",
32639
+ escapeRegExp(THEME_RESPONSIVE_MODE_ATTR),
32640
+ "\\]\\)",
32641
+ "\\{"
32642
+ ].join("\\s*");
32643
+ }
32533
32644
 
32534
32645
  // ../theme-core/src/responsive/mediaQuery.ts
32535
32646
  function convertMediaQueryToContainerQuery(query) {
@@ -34078,45 +34189,53 @@ var containerResponsiveThemeCss = `/*
34078
34189
  flex-basis: 16.666667%;
34079
34190
  }
34080
34191
  @container rb-site (min-width: 768px) {
34081
- .rb-md-basis-full {
34082
- flex-basis: 100%;
34083
- }
34084
- .rb-md-basis-1-2 {
34085
- flex-basis: 50%;
34086
- }
34087
- .rb-md-basis-1-3 {
34088
- flex-basis: 33.333333%;
34089
- }
34090
- .rb-md-basis-1-4 {
34091
- flex-basis: 25%;
34092
- }
34093
- .rb-md-basis-1-5 {
34094
- flex-basis: 20%;
34095
- }
34096
- .rb-md-basis-1-6 {
34097
- flex-basis: 16.666667%;
34192
+
34193
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34194
+ .rb-md-basis-full {
34195
+ flex-basis: 100%;
34196
+ }
34197
+ .rb-md-basis-1-2 {
34198
+ flex-basis: 50%;
34199
+ }
34200
+ .rb-md-basis-1-3 {
34201
+ flex-basis: 33.333333%;
34202
+ }
34203
+ .rb-md-basis-1-4 {
34204
+ flex-basis: 25%;
34205
+ }
34206
+ .rb-md-basis-1-5 {
34207
+ flex-basis: 20%;
34208
+ }
34209
+ .rb-md-basis-1-6 {
34210
+ flex-basis: 16.666667%;
34211
+ }
34098
34212
  }
34099
- }
34213
+
34214
+ }
34100
34215
  @container rb-site (min-width: 1024px) {
34101
- .rb-lg-basis-full {
34102
- flex-basis: 100%;
34103
- }
34104
- .rb-lg-basis-1-2 {
34105
- flex-basis: 50%;
34106
- }
34107
- .rb-lg-basis-1-3 {
34108
- flex-basis: 33.333333%;
34109
- }
34110
- .rb-lg-basis-1-4 {
34111
- flex-basis: 25%;
34112
- }
34113
- .rb-lg-basis-1-5 {
34114
- flex-basis: 20%;
34115
- }
34116
- .rb-lg-basis-1-6 {
34117
- flex-basis: 16.666667%;
34216
+
34217
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34218
+ .rb-lg-basis-full {
34219
+ flex-basis: 100%;
34220
+ }
34221
+ .rb-lg-basis-1-2 {
34222
+ flex-basis: 50%;
34223
+ }
34224
+ .rb-lg-basis-1-3 {
34225
+ flex-basis: 33.333333%;
34226
+ }
34227
+ .rb-lg-basis-1-4 {
34228
+ flex-basis: 25%;
34229
+ }
34230
+ .rb-lg-basis-1-5 {
34231
+ flex-basis: 20%;
34232
+ }
34233
+ .rb-lg-basis-1-6 {
34234
+ flex-basis: 16.666667%;
34235
+ }
34118
34236
  }
34119
- }
34237
+
34238
+ }
34120
34239
  .rb-shrink-0 {
34121
34240
  flex-shrink: 0;
34122
34241
  }
@@ -34138,64 +34257,80 @@ var containerResponsiveThemeCss = `/*
34138
34257
  grid-template-columns: repeat(4, minmax(0, 1fr));
34139
34258
  }
34140
34259
  @container rb-site (min-width: 640px) {
34141
- .rb-sm-grid-cols-2 {
34142
- grid-template-columns: repeat(2, minmax(0, 1fr));
34143
- }
34144
- .rb-sm-grid-cols-3 {
34145
- grid-template-columns: repeat(3, minmax(0, 1fr));
34146
- }
34147
- .rb-sm-grid-cols-4 {
34148
- grid-template-columns: repeat(4, minmax(0, 1fr));
34260
+
34261
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34262
+ .rb-sm-grid-cols-2 {
34263
+ grid-template-columns: repeat(2, minmax(0, 1fr));
34264
+ }
34265
+ .rb-sm-grid-cols-3 {
34266
+ grid-template-columns: repeat(3, minmax(0, 1fr));
34267
+ }
34268
+ .rb-sm-grid-cols-4 {
34269
+ grid-template-columns: repeat(4, minmax(0, 1fr));
34270
+ }
34149
34271
  }
34150
- }
34272
+
34273
+ }
34151
34274
  @container rb-site (min-width: 768px) {
34152
- .rb-md-grid-cols-2 {
34153
- grid-template-columns: repeat(2, minmax(0, 1fr));
34154
- }
34155
- .rb-md-grid-cols-3 {
34156
- grid-template-columns: repeat(3, minmax(0, 1fr));
34157
- }
34158
- .rb-md-grid-cols-4 {
34159
- grid-template-columns: repeat(4, minmax(0, 1fr));
34275
+
34276
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34277
+ .rb-md-grid-cols-2 {
34278
+ grid-template-columns: repeat(2, minmax(0, 1fr));
34279
+ }
34280
+ .rb-md-grid-cols-3 {
34281
+ grid-template-columns: repeat(3, minmax(0, 1fr));
34282
+ }
34283
+ .rb-md-grid-cols-4 {
34284
+ grid-template-columns: repeat(4, minmax(0, 1fr));
34285
+ }
34160
34286
  }
34161
- }
34287
+
34288
+ }
34162
34289
  @container rb-site (min-width: 1024px) {
34163
- .rb-lg-grid-cols-2 {
34164
- grid-template-columns: repeat(2, minmax(0, 1fr));
34165
- }
34166
- .rb-lg-grid-cols-3 {
34167
- grid-template-columns: repeat(3, minmax(0, 1fr));
34168
- }
34169
- .rb-lg-grid-cols-4 {
34170
- grid-template-columns: repeat(4, minmax(0, 1fr));
34171
- }
34172
- .rb-lg-w-3\\/4 {
34173
- width: 75%;
34174
- }
34175
- .rb-lg-col-span-1 {
34176
- grid-column: span 1 / span 1;
34177
- }
34178
- .rb-lg-col-span-2 {
34179
- grid-column: span 2 / span 2;
34180
- }
34181
- .rb-lg-col-span-3 {
34182
- grid-column: span 3 / span 3;
34183
- }
34184
- .rb-lg-col-span-4 {
34185
- grid-column: span 4 / span 4;
34290
+
34291
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34292
+ .rb-lg-grid-cols-2 {
34293
+ grid-template-columns: repeat(2, minmax(0, 1fr));
34294
+ }
34295
+ .rb-lg-grid-cols-3 {
34296
+ grid-template-columns: repeat(3, minmax(0, 1fr));
34297
+ }
34298
+ .rb-lg-grid-cols-4 {
34299
+ grid-template-columns: repeat(4, minmax(0, 1fr));
34300
+ }
34301
+ .rb-lg-w-3\\/4 {
34302
+ width: 75%;
34303
+ }
34304
+ .rb-lg-col-span-1 {
34305
+ grid-column: span 1 / span 1;
34306
+ }
34307
+ .rb-lg-col-span-2 {
34308
+ grid-column: span 2 / span 2;
34309
+ }
34310
+ .rb-lg-col-span-3 {
34311
+ grid-column: span 3 / span 3;
34312
+ }
34313
+ .rb-lg-col-span-4 {
34314
+ grid-column: span 4 / span 4;
34315
+ }
34186
34316
  }
34187
- }
34317
+
34318
+ }
34188
34319
  @container rb-site (min-width: 1280px) {
34189
- .rb-xl-grid-cols-2 {
34190
- grid-template-columns: repeat(2, minmax(0, 1fr));
34191
- }
34192
- .rb-xl-grid-cols-3 {
34193
- grid-template-columns: repeat(3, minmax(0, 1fr));
34194
- }
34195
- .rb-xl-grid-cols-4 {
34196
- grid-template-columns: repeat(4, minmax(0, 1fr));
34320
+
34321
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34322
+ .rb-xl-grid-cols-2 {
34323
+ grid-template-columns: repeat(2, minmax(0, 1fr));
34324
+ }
34325
+ .rb-xl-grid-cols-3 {
34326
+ grid-template-columns: repeat(3, minmax(0, 1fr));
34327
+ }
34328
+ .rb-xl-grid-cols-4 {
34329
+ grid-template-columns: repeat(4, minmax(0, 1fr));
34330
+ }
34197
34331
  }
34198
- }
34332
+
34333
+ }
34199
34334
 
34200
34335
  /* Alignment */
34201
34336
  .rb-items-start {
@@ -34264,13 +34399,17 @@ var containerResponsiveThemeCss = `/*
34264
34399
  row-gap: 0.75rem;
34265
34400
  }
34266
34401
  @container rb-site (min-width: 768px) {
34267
- .rb-md-gap-0 {
34268
- gap: 0;
34269
- }
34270
- .rb-md-gap-10 {
34271
- gap: 2.5rem;
34402
+
34403
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34404
+ .rb-md-gap-0 {
34405
+ gap: 0;
34406
+ }
34407
+ .rb-md-gap-10 {
34408
+ gap: 2.5rem;
34409
+ }
34272
34410
  }
34273
- }
34411
+
34412
+ }
34274
34413
 
34275
34414
  .rb-space-y-1 > :not([hidden]) ~ :not([hidden]) {
34276
34415
  margin-top: 0.25rem;
@@ -34372,137 +34511,149 @@ var containerResponsiveThemeCss = `/*
34372
34511
  }
34373
34512
 
34374
34513
  @container rb-site (min-width: 640px) {
34375
- .rb-sm-py-16 {
34376
- padding-top: 4rem;
34377
- padding-bottom: 4rem;
34378
- }
34379
- .rb-sm-py-20 {
34380
- padding-top: 5rem;
34381
- padding-bottom: 5rem;
34382
- }
34383
- .rb-sm-p-6 {
34384
- padding: 1.5rem;
34385
- }
34386
- .rb-sm-flex {
34387
- display: flex;
34388
- }
34389
- .rb-sm-block {
34390
- display: block;
34391
- }
34392
- .rb-sm-inline {
34393
- display: inline;
34394
- }
34395
- .rb-sm-inline-block {
34396
- display: inline-block;
34397
- }
34398
- .rb-sm-inline-flex {
34399
- display: inline-flex;
34400
- }
34401
- .rb-sm-grid {
34402
- display: grid;
34403
- }
34404
- .rb-sm-hidden {
34405
- display: none;
34406
- }
34407
- .rb-sm-flex-row {
34408
- flex-direction: row;
34409
- }
34410
- .rb-sm-items-start {
34411
- align-items: flex-start;
34412
- }
34413
- .rb-sm-items-center {
34414
- align-items: center;
34415
- }
34416
- .rb-sm-justify-between {
34417
- justify-content: space-between;
34418
- }
34419
- .rb-sm-p-8 {
34420
- padding: 2rem;
34421
- }
34422
- .rb-sm-text-lg {
34423
- font-size: 1.125rem;
34424
- line-height: 1.75rem;
34425
- }
34426
- .rb-sm-text-xl {
34427
- font-size: 1.25rem;
34428
- line-height: 1.75rem;
34429
- }
34430
- .rb-sm-text-4xl {
34431
- font-size: 2.25rem;
34432
- line-height: 2.5rem;
34433
- }
34434
34514
 
34435
- .rb-sm-w-auto {
34436
- width: auto;
34515
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34516
+ .rb-sm-py-16 {
34517
+ padding-top: 4rem;
34518
+ padding-bottom: 4rem;
34519
+ }
34520
+ .rb-sm-py-20 {
34521
+ padding-top: 5rem;
34522
+ padding-bottom: 5rem;
34523
+ }
34524
+ .rb-sm-p-6 {
34525
+ padding: 1.5rem;
34526
+ }
34527
+ .rb-sm-flex {
34528
+ display: flex;
34529
+ }
34530
+ .rb-sm-block {
34531
+ display: block;
34532
+ }
34533
+ .rb-sm-inline {
34534
+ display: inline;
34535
+ }
34536
+ .rb-sm-inline-block {
34537
+ display: inline-block;
34538
+ }
34539
+ .rb-sm-inline-flex {
34540
+ display: inline-flex;
34541
+ }
34542
+ .rb-sm-grid {
34543
+ display: grid;
34544
+ }
34545
+ .rb-sm-hidden {
34546
+ display: none;
34547
+ }
34548
+ .rb-sm-flex-row {
34549
+ flex-direction: row;
34550
+ }
34551
+ .rb-sm-items-start {
34552
+ align-items: flex-start;
34553
+ }
34554
+ .rb-sm-items-center {
34555
+ align-items: center;
34556
+ }
34557
+ .rb-sm-justify-between {
34558
+ justify-content: space-between;
34559
+ }
34560
+ .rb-sm-p-8 {
34561
+ padding: 2rem;
34562
+ }
34563
+ .rb-sm-text-lg {
34564
+ font-size: 1.125rem;
34565
+ line-height: 1.75rem;
34566
+ }
34567
+ .rb-sm-text-xl {
34568
+ font-size: 1.25rem;
34569
+ line-height: 1.75rem;
34570
+ }
34571
+ .rb-sm-text-4xl {
34572
+ font-size: 2.25rem;
34573
+ line-height: 2.5rem;
34574
+ }
34575
+
34576
+ .rb-sm-w-auto {
34577
+ width: auto;
34578
+ }
34437
34579
  }
34438
- }
34580
+
34581
+ }
34439
34582
  @container rb-site (min-width: 768px) {
34440
- .rb-md-py-20 {
34441
- padding-top: 5rem;
34442
- padding-bottom: 5rem;
34443
- }
34444
- .rb-md-py-24 {
34445
- padding-top: 6rem;
34446
- padding-bottom: 6rem;
34447
- }
34448
- .rb-md-w-1\\/3 {
34449
- width: 33.333333%;
34450
- }
34451
34583
 
34452
- .rb-md-flex {
34453
- display: flex;
34454
- }
34455
- .rb-md-block {
34456
- display: block;
34457
- }
34458
- .rb-md-inline {
34459
- display: inline;
34460
- }
34461
- .rb-md-inline-block {
34462
- display: inline-block;
34463
- }
34464
- .rb-md-inline-flex {
34465
- display: inline-flex;
34466
- }
34467
- .rb-md-grid {
34468
- display: grid;
34469
- }
34470
- .rb-md-hidden {
34471
- display: none;
34472
- }
34473
- .rb-md-flex-row {
34474
- flex-direction: row;
34475
- }
34476
- .rb-md-flex-row-reverse {
34477
- flex-direction: row-reverse;
34478
- }
34479
- .rb-md-items-start {
34480
- align-items: flex-start;
34584
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34585
+ .rb-md-py-20 {
34586
+ padding-top: 5rem;
34587
+ padding-bottom: 5rem;
34588
+ }
34589
+ .rb-md-py-24 {
34590
+ padding-top: 6rem;
34591
+ padding-bottom: 6rem;
34592
+ }
34593
+ .rb-md-w-1\\/3 {
34594
+ width: 33.333333%;
34595
+ }
34596
+
34597
+ .rb-md-flex {
34598
+ display: flex;
34599
+ }
34600
+ .rb-md-block {
34601
+ display: block;
34602
+ }
34603
+ .rb-md-inline {
34604
+ display: inline;
34605
+ }
34606
+ .rb-md-inline-block {
34607
+ display: inline-block;
34608
+ }
34609
+ .rb-md-inline-flex {
34610
+ display: inline-flex;
34611
+ }
34612
+ .rb-md-grid {
34613
+ display: grid;
34614
+ }
34615
+ .rb-md-hidden {
34616
+ display: none;
34617
+ }
34618
+ .rb-md-flex-row {
34619
+ flex-direction: row;
34620
+ }
34621
+ .rb-md-flex-row-reverse {
34622
+ flex-direction: row-reverse;
34623
+ }
34624
+ .rb-md-items-start {
34625
+ align-items: flex-start;
34626
+ }
34481
34627
  }
34482
- }
34628
+
34629
+ }
34483
34630
  @container rb-site (min-width: 1024px) {
34484
- .rb-lg-flex {
34485
- display: flex;
34486
- }
34487
- .rb-lg-block {
34488
- display: block;
34489
- }
34490
- .rb-lg-inline {
34491
- display: inline;
34492
- }
34493
- .rb-lg-inline-block {
34494
- display: inline-block;
34495
- }
34496
- .rb-lg-inline-flex {
34497
- display: inline-flex;
34498
- }
34499
- .rb-lg-grid {
34500
- display: grid;
34501
- }
34502
- .rb-lg-hidden {
34503
- display: none;
34631
+
34632
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
34633
+ .rb-lg-flex {
34634
+ display: flex;
34635
+ }
34636
+ .rb-lg-block {
34637
+ display: block;
34638
+ }
34639
+ .rb-lg-inline {
34640
+ display: inline;
34641
+ }
34642
+ .rb-lg-inline-block {
34643
+ display: inline-block;
34644
+ }
34645
+ .rb-lg-inline-flex {
34646
+ display: inline-flex;
34647
+ }
34648
+ .rb-lg-grid {
34649
+ display: grid;
34650
+ }
34651
+ .rb-lg-hidden {
34652
+ display: none;
34653
+ }
34504
34654
  }
34505
- }
34655
+
34656
+ }
34506
34657
 
34507
34658
  /* Margin */
34508
34659
  .rb-m-0 {
@@ -34759,8 +34910,9 @@ var containerResponsiveThemeCss = `/*
34759
34910
  font-weight: 700;
34760
34911
  }
34761
34912
  .rb-font-mono {
34762
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
34763
- "Liberation Mono", "Courier New", monospace;
34913
+ font-family:
34914
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
34915
+ "Courier New", monospace;
34764
34916
  }
34765
34917
  .rb-leading-relaxed {
34766
34918
  line-height: 1.625;
@@ -34978,39 +35130,44 @@ var containerResponsiveThemeCss = `/*
34978
35130
  }
34979
35131
 
34980
35132
  @container rb-site (max-width: 639px) {
34981
- .rb-image-gallery-marquee {
34982
- overflow-x: auto;
34983
- overflow-y: hidden;
34984
- -webkit-overflow-scrolling: touch;
34985
- touch-action: pan-x;
34986
- scrollbar-width: none;
34987
- }
34988
35133
 
34989
- .rb-image-gallery-marquee::-webkit-scrollbar {
34990
- display: none;
34991
- }
35134
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35135
+ .rb-image-gallery-marquee {
35136
+ overflow-x: auto;
35137
+ overflow-y: hidden;
35138
+ -webkit-overflow-scrolling: touch;
35139
+ touch-action: pan-x;
35140
+ scrollbar-width: none;
35141
+ }
34992
35142
 
34993
- /* Let users swipe smoothly without fighting autoplay while interacting. */
34994
- .rb-image-gallery-marquee:active .rb-animate-marquee,
34995
- .rb-image-gallery-marquee:focus-within .rb-animate-marquee {
34996
- animation-play-state: paused;
34997
- }
35143
+ .rb-image-gallery-marquee::-webkit-scrollbar {
35144
+ display: none;
35145
+ }
34998
35146
 
34999
- .rb-container-full.rb-image-gallery-marquee-container {
35000
- padding-left: 0;
35001
- padding-right: 0;
35002
- }
35147
+ /* Let users swipe smoothly without fighting autoplay while interacting. */
35148
+ .rb-image-gallery-marquee:active .rb-animate-marquee,
35149
+ .rb-image-gallery-marquee:focus-within .rb-animate-marquee {
35150
+ animation-play-state: paused;
35151
+ }
35003
35152
 
35004
- /* Marquee variant: keep images in color on mobile for legibility. */
35005
- .rb-image-gallery-marquee-container .rb-filter-grayscale,
35006
- .rb-image-gallery-marquee-container .rb-filter-grayscale-hover-reveal {
35007
- filter: none;
35008
- }
35153
+ .rb-container-full.rb-image-gallery-marquee-container {
35154
+ padding-left: 0;
35155
+ padding-right: 0;
35156
+ }
35009
35157
 
35010
- .rb-image-gallery-marquee-container .rb-filter-grayscale-hover-reveal:hover {
35011
- filter: none;
35158
+ /* Marquee variant: keep images in color on mobile for legibility. */
35159
+ .rb-image-gallery-marquee-container .rb-filter-grayscale,
35160
+ .rb-image-gallery-marquee-container .rb-filter-grayscale-hover-reveal {
35161
+ filter: none;
35162
+ }
35163
+
35164
+ .rb-image-gallery-marquee-container
35165
+ .rb-filter-grayscale-hover-reveal:hover {
35166
+ filter: none;
35167
+ }
35012
35168
  }
35013
- }
35169
+
35170
+ }
35014
35171
 
35015
35172
  @media (prefers-reduced-motion: reduce) {
35016
35173
  .rb-animate-marquee {
@@ -35115,12 +35272,16 @@ var containerResponsiveThemeCss = `/*
35115
35272
  }
35116
35273
 
35117
35274
  @container rb-site (min-width: 640px) {
35118
- .rb-container,
35119
- .rb-container-full {
35120
- padding-left: 1.5rem;
35121
- padding-right: 1.5rem;
35275
+
35276
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35277
+ .rb-container,
35278
+ .rb-container-full {
35279
+ padding-left: 1.5rem;
35280
+ padding-right: 1.5rem;
35281
+ }
35122
35282
  }
35123
- }
35283
+
35284
+ }
35124
35285
 
35125
35286
  /* Flex alignment */
35126
35287
  .rb-self-start {
@@ -35154,27 +35315,31 @@ var containerResponsiveThemeCss = `/*
35154
35315
  }
35155
35316
 
35156
35317
  @container rb-site (min-width: 640px) {
35157
- .rb-section-pad-compact {
35158
- padding-top: 2rem;
35159
- padding-bottom: 2rem;
35160
- }
35161
- .rb-section-pad-cozy {
35162
- padding-top: 3.5rem;
35163
- padding-bottom: 3.5rem;
35164
- }
35165
- .rb-section-pad-medium {
35166
- padding-top: 4rem;
35167
- padding-bottom: 4rem;
35168
- }
35169
- .rb-section-pad-comfortable {
35170
- padding-top: 5rem;
35171
- padding-bottom: 5rem;
35172
- }
35173
- .rb-section-pad-spacious {
35174
- padding-top: 7rem;
35175
- padding-bottom: 7rem;
35318
+
35319
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35320
+ .rb-section-pad-compact {
35321
+ padding-top: 2rem;
35322
+ padding-bottom: 2rem;
35323
+ }
35324
+ .rb-section-pad-cozy {
35325
+ padding-top: 3.5rem;
35326
+ padding-bottom: 3.5rem;
35327
+ }
35328
+ .rb-section-pad-medium {
35329
+ padding-top: 4rem;
35330
+ padding-bottom: 4rem;
35331
+ }
35332
+ .rb-section-pad-comfortable {
35333
+ padding-top: 5rem;
35334
+ padding-bottom: 5rem;
35335
+ }
35336
+ .rb-section-pad-spacious {
35337
+ padding-top: 7rem;
35338
+ padding-bottom: 7rem;
35339
+ }
35176
35340
  }
35177
- }
35341
+
35342
+ }
35178
35343
 
35179
35344
  .rb-container-pad-none {
35180
35345
  padding: 0;
@@ -35196,22 +35361,26 @@ var containerResponsiveThemeCss = `/*
35196
35361
  }
35197
35362
 
35198
35363
  @container rb-site (min-width: 640px) {
35199
- .rb-container-pad-compact {
35200
- padding: 1.5rem;
35201
- }
35202
- .rb-container-pad-cozy {
35203
- padding: 2rem;
35204
- }
35205
- .rb-container-pad-medium {
35206
- padding: 2rem;
35207
- }
35208
- .rb-container-pad-comfortable {
35209
- padding: 2.5rem;
35210
- }
35211
- .rb-container-pad-spacious {
35212
- padding: 3.5rem;
35364
+
35365
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35366
+ .rb-container-pad-compact {
35367
+ padding: 1.5rem;
35368
+ }
35369
+ .rb-container-pad-cozy {
35370
+ padding: 2rem;
35371
+ }
35372
+ .rb-container-pad-medium {
35373
+ padding: 2rem;
35374
+ }
35375
+ .rb-container-pad-comfortable {
35376
+ padding: 2.5rem;
35377
+ }
35378
+ .rb-container-pad-spacious {
35379
+ padding: 3.5rem;
35380
+ }
35213
35381
  }
35214
- }
35382
+
35383
+ }
35215
35384
 
35216
35385
  /* Semantic gap tokens (theme-aware via --space-mult) */
35217
35386
  .rb-gap-semantic-none {
@@ -35240,27 +35409,31 @@ var containerResponsiveThemeCss = `/*
35240
35409
  }
35241
35410
 
35242
35411
  @container rb-site (min-width: 768px) {
35243
- .rb-gap-semantic-compact {
35244
- --rb-semantic-gap: calc(1.25rem * var(--space-mult, 1));
35245
- gap: calc(1.25rem * var(--space-mult, 1));
35246
- }
35247
- .rb-gap-semantic-cozy {
35248
- --rb-semantic-gap: calc(2.25rem * var(--space-mult, 1));
35249
- gap: calc(2.25rem * var(--space-mult, 1));
35250
- }
35251
- .rb-gap-semantic-medium {
35252
- --rb-semantic-gap: calc(3.5rem * var(--space-mult, 1));
35253
- gap: calc(3.5rem * var(--space-mult, 1));
35254
- }
35255
- .rb-gap-semantic-comfortable {
35256
- --rb-semantic-gap: calc(5.75rem * var(--space-mult, 1));
35257
- gap: calc(5.75rem * var(--space-mult, 1));
35258
- }
35259
- .rb-gap-semantic-spacious {
35260
- --rb-semantic-gap: calc(8.75rem * var(--space-mult, 1));
35261
- gap: calc(8.75rem * var(--space-mult, 1));
35412
+
35413
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35414
+ .rb-gap-semantic-compact {
35415
+ --rb-semantic-gap: calc(1.25rem * var(--space-mult, 1));
35416
+ gap: calc(1.25rem * var(--space-mult, 1));
35417
+ }
35418
+ .rb-gap-semantic-cozy {
35419
+ --rb-semantic-gap: calc(2.25rem * var(--space-mult, 1));
35420
+ gap: calc(2.25rem * var(--space-mult, 1));
35421
+ }
35422
+ .rb-gap-semantic-medium {
35423
+ --rb-semantic-gap: calc(3.5rem * var(--space-mult, 1));
35424
+ gap: calc(3.5rem * var(--space-mult, 1));
35425
+ }
35426
+ .rb-gap-semantic-comfortable {
35427
+ --rb-semantic-gap: calc(5.75rem * var(--space-mult, 1));
35428
+ gap: calc(5.75rem * var(--space-mult, 1));
35429
+ }
35430
+ .rb-gap-semantic-spacious {
35431
+ --rb-semantic-gap: calc(8.75rem * var(--space-mult, 1));
35432
+ gap: calc(8.75rem * var(--space-mult, 1));
35433
+ }
35262
35434
  }
35263
- }
35435
+
35436
+ }
35264
35437
 
35265
35438
  /* Backdrop blur helpers */
35266
35439
  .rb-backdrop-blur {
@@ -35614,11 +35787,13 @@ var containerResponsiveThemeCss = `/*
35614
35787
  line-height: var(--rb-prose-lg-line-height);
35615
35788
  }
35616
35789
  @container rb-site (min-width: 640px) {
35617
- :where(.theme-scope) .rb-prose-xl-sm {
35790
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35791
+ :where(.theme-scope) .rb-prose-xl-sm {
35618
35792
  font-size: var(--rb-prose-xl-sm-font-size);
35619
35793
  line-height: var(--rb-prose-xl-sm-line-height);
35620
35794
  }
35621
35795
  }
35796
+ }
35622
35797
 
35623
35798
  /* Neutral prose uses theme text color by default */
35624
35799
  :where(.theme-scope) .rb-prose-neutral {
@@ -35702,22 +35877,28 @@ var containerResponsiveThemeCss = `/*
35702
35877
  }
35703
35878
 
35704
35879
  @container rb-site (min-width: 768px) {
35705
- :where(.theme-scope) .rb-columns-equal-height {
35880
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35881
+ :where(.theme-scope) .rb-columns-equal-height {
35706
35882
  --rb-columns-cols: var(--rb-columns-cols-md, var(--rb-columns-cols));
35707
35883
  }
35708
35884
  }
35885
+ }
35709
35886
 
35710
35887
  @container rb-site (min-width: 1024px) {
35711
- :where(.theme-scope) .rb-columns-equal-height {
35888
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35889
+ :where(.theme-scope) .rb-columns-equal-height {
35712
35890
  --rb-columns-cols: var(--rb-columns-cols-lg, var(--rb-columns-cols));
35713
35891
  }
35714
35892
  }
35893
+ }
35715
35894
 
35716
35895
  @container rb-site (min-width: 1280px) {
35717
- :where(.theme-scope) .rb-columns-equal-height {
35896
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
35897
+ :where(.theme-scope) .rb-columns-equal-height {
35718
35898
  --rb-columns-cols: var(--rb-columns-cols-xl, var(--rb-columns-cols));
35719
35899
  }
35720
35900
  }
35901
+ }
35721
35902
 
35722
35903
  :where(.theme-scope) .rb-columns-equal-height > * {
35723
35904
  height: var(--rb-columns-tile-h);
@@ -36339,7 +36520,8 @@ var containerResponsiveThemeCss = `/*
36339
36520
 
36340
36521
  /* Mobile: reduce site title size (~30%) to keep header compact */
36341
36522
  @container rb-site (max-width: 767px) {
36342
- :where(.theme-scope) .header-logo-text {
36523
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
36524
+ :where(.theme-scope) .header-logo-text {
36343
36525
  font-size: 0.8rem;
36344
36526
  line-height: 1.25rem;
36345
36527
  }
@@ -36350,6 +36532,7 @@ var containerResponsiveThemeCss = `/*
36350
36532
  line-height: 1.25rem;
36351
36533
  }
36352
36534
  }
36535
+ }
36353
36536
 
36354
36537
  /* Centered/editorial variants use larger title */
36355
36538
  :where(.theme-scope) .header-variant-centered .header-logo-text,
@@ -36373,10 +36556,12 @@ var containerResponsiveThemeCss = `/*
36373
36556
  }
36374
36557
 
36375
36558
  @container rb-site (max-width: 767px) {
36376
- :where(.theme-scope) .rb-header-shrink.header-scrolled .header-logo-text {
36559
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
36560
+ :where(.theme-scope) .rb-header-shrink.header-scrolled .header-logo-text {
36377
36561
  font-size: 0.75rem;
36378
36562
  }
36379
36563
  }
36564
+ }
36380
36565
 
36381
36566
  /* =================================================================
36382
36567
  Accessibility: Reduced Motion
@@ -36820,10 +37005,12 @@ var containerResponsiveThemeCss = `/*
36820
37005
  }
36821
37006
 
36822
37007
  @container rb-site (min-width: 768px) {
36823
- :where(.theme-scope) :where([data-block="event-registration"]) .er-event-grid {
37008
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37009
+ :where(.theme-scope) :where([data-block="event-registration"]) .er-event-grid {
36824
37010
  grid-template-columns: repeat(2, minmax(0, 1fr));
36825
37011
  }
36826
37012
  }
37013
+ }
36827
37014
 
36828
37015
  :where(.theme-scope) :where([data-block="event-registration"]) .er-row {
36829
37016
  display: flex;
@@ -37056,12 +37243,14 @@ var containerResponsiveThemeCss = `/*
37056
37243
  }
37057
37244
 
37058
37245
  @container rb-site (min-width: 768px) {
37059
- :where(.theme-scope) :where([data-block="event-registration"]) .er-layout {
37246
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37247
+ :where(.theme-scope) :where([data-block="event-registration"]) .er-layout {
37060
37248
  /* Desktop: main + sidebar */
37061
37249
  grid-template-columns: 1fr 300px;
37062
37250
  grid-template-areas: "main summary";
37063
37251
  }
37064
37252
  }
37253
+ }
37065
37254
 
37066
37255
  :where(.theme-scope) :where([data-block="event-registration"]) .er-layout-main {
37067
37256
  grid-area: main;
@@ -37143,10 +37332,12 @@ var containerResponsiveThemeCss = `/*
37143
37332
  }
37144
37333
 
37145
37334
  @container rb-site (min-width: 640px) {
37146
- :where(.theme-scope) :where([data-block="event-registration"]) .er-step-label {
37335
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37336
+ :where(.theme-scope) :where([data-block="event-registration"]) .er-step-label {
37147
37337
  display: inline;
37148
37338
  }
37149
37339
  }
37340
+ }
37150
37341
 
37151
37342
  /* Sticky order summary */
37152
37343
  :where(.theme-scope) :where([data-block="event-registration"]) .er-summary {
@@ -37163,11 +37354,13 @@ var containerResponsiveThemeCss = `/*
37163
37354
  }
37164
37355
 
37165
37356
  @container rb-site (min-width: 768px) {
37166
- :where(.theme-scope) :where([data-block="event-registration"]) .er-summary {
37357
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37358
+ :where(.theme-scope) :where([data-block="event-registration"]) .er-summary {
37167
37359
  position: sticky;
37168
37360
  top: 1rem;
37169
37361
  }
37170
37362
  }
37363
+ }
37171
37364
 
37172
37365
  :where(.theme-scope) :where([data-block="event-registration"]) .er-summary-event {
37173
37366
  font-weight: 600;
@@ -37237,12 +37430,14 @@ var containerResponsiveThemeCss = `/*
37237
37430
  }
37238
37431
 
37239
37432
  @container rb-site (min-width: 768px) {
37240
- :where(.theme-scope) :where([data-block="event-registration"]) .er-guest-card {
37433
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37434
+ :where(.theme-scope) :where([data-block="event-registration"]) .er-guest-card {
37241
37435
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
37242
37436
  column-gap: 1rem;
37243
37437
  align-items: start;
37244
37438
  }
37245
37439
  }
37440
+ }
37246
37441
 
37247
37442
  /* Shake animation for validation errors */
37248
37443
  @keyframes er-shake {
@@ -37387,7 +37582,8 @@ var containerResponsiveThemeCss = `/*
37387
37582
  * ============================================================================= */
37388
37583
 
37389
37584
  @container rb-site (min-width: 768px) {
37390
- :where(.theme-scope)
37585
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37586
+ :where(.theme-scope)
37391
37587
  :where([data-block="event-listing"], [data-block="event-spotlight"], [data-block="event-calendar"], [data-block="event-combined"])
37392
37588
  .event-card[data-orientation="horizontal"] {
37393
37589
  display: flex;
@@ -37438,6 +37634,7 @@ var containerResponsiveThemeCss = `/*
37438
37634
  text-align: right;
37439
37635
  }
37440
37636
  }
37637
+ }
37441
37638
 
37442
37639
  /* Keep token list in sync with \`EVENT_CATEGORY_BADGE_TOKENS\` in \`packages/blocks/src/system/constants/events.ts\`. */
37443
37640
  :where(.theme-scope)
@@ -37517,7 +37714,8 @@ var containerResponsiveThemeCss = `/*
37517
37714
  }
37518
37715
 
37519
37716
  @container rb-site (min-width: 768px) {
37520
- :where(.theme-scope) :where([data-block="event-registration"]) .er-payment-layout {
37717
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
37718
+ :where(.theme-scope) :where([data-block="event-registration"]) .er-payment-layout {
37521
37719
  grid-template-columns: 1fr 260px;
37522
37720
  grid-template-areas:
37523
37721
  "main sidebar"
@@ -37532,6 +37730,7 @@ var containerResponsiveThemeCss = `/*
37532
37730
  "footer";
37533
37731
  }
37534
37732
  }
37733
+ }
37535
37734
 
37536
37735
  :where(.theme-scope) :where([data-block="event-registration"]) .er-payment-layout-main {
37537
37736
  grid-area: main;
@@ -38811,7 +39010,8 @@ var containerResponsiveThemeCss = `/*
38811
39010
  :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-time,
38812
39011
  :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-title,
38813
39012
  :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-teacher,
38814
- :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-meta {
39013
+ :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-meta,
39014
+ :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-capacity {
38815
39015
  display: block;
38816
39016
  min-width: 0;
38817
39017
  overflow: hidden;
@@ -38837,6 +39037,17 @@ var containerResponsiveThemeCss = `/*
38837
39037
  opacity: 0.72;
38838
39038
  }
38839
39039
 
39040
+ :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-capacity {
39041
+ font-size: 0.6875rem;
39042
+ font-weight: 600;
39043
+ opacity: 0.85;
39044
+ }
39045
+
39046
+ :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-event-capacity--full {
39047
+ color: rgb(var(--tb-danger, 220 38 38));
39048
+ opacity: 1;
39049
+ }
39050
+
38840
39051
  :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-day-empty {
38841
39052
  margin: 0;
38842
39053
  padding: 1rem 0.5rem;
@@ -38853,7 +39064,8 @@ var containerResponsiveThemeCss = `/*
38853
39064
  }
38854
39065
 
38855
39066
  @container rb-site (max-width: 767px) {
38856
- :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-day-selector {
39067
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
39068
+ :where(.theme-scope) :where([data-block="event-calendar"]) .event-timetable-day-selector {
38857
39069
  display: flex;
38858
39070
  }
38859
39071
 
@@ -38883,6 +39095,7 @@ var containerResponsiveThemeCss = `/*
38883
39095
  padding-inline: 0.75rem;
38884
39096
  }
38885
39097
  }
39098
+ }
38886
39099
 
38887
39100
  /* -----------------------------------------------------------------------------
38888
39101
  * Event Calendar Modals
@@ -39021,7 +39234,8 @@ var containerResponsiveThemeCss = `/*
39021
39234
 
39022
39235
  /* Responsive adjustments */
39023
39236
  @container rb-site (max-width: 640px) {
39024
- :where(.theme-scope) :where([data-block="event-calendar"]) .event-calendar-container {
39237
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
39238
+ :where(.theme-scope) :where([data-block="event-calendar"]) .event-calendar-container {
39025
39239
  margin-left: -1.5rem;
39026
39240
  margin-right: -1.5rem;
39027
39241
  border-left: none;
@@ -39082,6 +39296,7 @@ var containerResponsiveThemeCss = `/*
39082
39296
  margin: 0 0.5rem;
39083
39297
  }
39084
39298
  }
39299
+ }
39085
39300
 
39086
39301
  /*
39087
39302
  * Shared: Tab bar (underline style)
@@ -39444,10 +39659,12 @@ var containerResponsiveThemeCss = `/*
39444
39659
  }
39445
39660
 
39446
39661
  @container rb-site (min-width: 768px) {
39447
- :where(.theme-scope) :where([data-block="form"]) .fb-row-2 {
39662
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
39663
+ :where(.theme-scope) :where([data-block="form"]) .fb-row-2 {
39448
39664
  grid-template-columns: 1fr 1fr;
39449
39665
  }
39450
39666
  }
39667
+ }
39451
39668
 
39452
39669
  /* Field wrapper */
39453
39670
  :where(.theme-scope) :where([data-block="form"]) .fb-field {
@@ -39528,10 +39745,12 @@ var containerResponsiveThemeCss = `/*
39528
39745
  }
39529
39746
 
39530
39747
  @container rb-site (min-width: 640px) {
39531
- :where(.theme-scope) :where([data-block="hero"]) .hero-subheadline {
39748
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
39749
+ :where(.theme-scope) :where([data-block="hero"]) .hero-subheadline {
39532
39750
  font-size: 1.25rem;
39533
39751
  }
39534
39752
  }
39753
+ }
39535
39754
 
39536
39755
  /* =============================================================================
39537
39756
  * Shared: Heading Group (used by CTA, single-button, etc.)
@@ -39745,16 +39964,19 @@ var containerResponsiveThemeCss = `/*
39745
39964
  }
39746
39965
 
39747
39966
  @container rb-site (min-width: 768px) {
39748
- :where(.theme-scope) .carousel-root {
39967
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
39968
+ :where(.theme-scope) .carousel-root {
39749
39969
  --rb-carousel-slides-to-show: var(
39750
39970
  --rb-carousel-slides-to-show-tablet,
39751
39971
  var(--rb-carousel-slides-to-show-mobile, 1)
39752
39972
  );
39753
39973
  }
39754
39974
  }
39975
+ }
39755
39976
 
39756
39977
  @container rb-site (min-width: 1024px) {
39757
- :where(.theme-scope) .carousel-root {
39978
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
39979
+ :where(.theme-scope) .carousel-root {
39758
39980
  --rb-carousel-slides-to-show: var(
39759
39981
  --rb-carousel-slides-to-show-desktop,
39760
39982
  var(
@@ -39764,6 +39986,7 @@ var containerResponsiveThemeCss = `/*
39764
39986
  );
39765
39987
  }
39766
39988
  }
39989
+ }
39767
39990
 
39768
39991
  /* Slides take exact percentage width with internal padding for gaps.
39769
39992
  * Padding is more reliable than margin (no collapsing, consistent on all slides). */
@@ -40037,10 +40260,12 @@ var containerResponsiveThemeCss = `/*
40037
40260
 
40038
40261
  /* Responsive grid */
40039
40262
  @container rb-site (max-width: 768px) {
40040
- :where(.theme-scope) .shop__products--grid {
40263
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
40264
+ :where(.theme-scope) .shop__products--grid {
40041
40265
  grid-template-columns: 1fr;
40042
40266
  }
40043
40267
  }
40268
+ }
40044
40269
 
40045
40270
  :where(.theme-scope) .shop__modal-product {
40046
40271
  font-size: 0.9375rem;
@@ -40142,11 +40367,13 @@ var containerResponsiveThemeCss = `/*
40142
40367
 
40143
40368
  /* Mobile: full-width CTA buttons inside cards */
40144
40369
  @container rb-site (max-width: 640px) {
40145
- :where(.theme-scope) .shop__cta {
40370
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
40371
+ :where(.theme-scope) .shop__cta {
40146
40372
  align-self: stretch;
40147
40373
  width: 100%;
40148
40374
  }
40149
40375
  }
40376
+ }
40150
40377
 
40151
40378
  /* =============================================================================
40152
40379
  * Block: Customer Portal
@@ -40852,7 +41079,8 @@ var containerResponsiveThemeCss = `/*
40852
41079
 
40853
41080
  /* Responsive: show everything without horizontal scrolling */
40854
41081
  @container rb-site (max-width: 640px) {
40855
- :where(.theme-scope) :where([data-block="customer-portal"]) .cp-only-mobile {
41082
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41083
+ :where(.theme-scope) :where([data-block="customer-portal"]) .cp-only-mobile {
40856
41084
  display: flex;
40857
41085
  }
40858
41086
 
@@ -40892,6 +41120,7 @@ var containerResponsiveThemeCss = `/*
40892
41120
  align-self: stretch;
40893
41121
  }
40894
41122
  }
41123
+ }
40895
41124
 
40896
41125
  /* Placeholder (SSR) */
40897
41126
  :where(.theme-scope) :where([data-block="customer-portal"]) .cp-placeholder {
@@ -40981,7 +41210,8 @@ var containerResponsiveThemeCss = `/*
40981
41210
 
40982
41211
  /* Position arrows outside the carousel content area */
40983
41212
  @container rb-site (max-width: 639px) {
40984
- :where(.theme-scope) :where([data-block="testimonials"]) .rb-testimonials-carousel.carousel-root .carousel-nav-btn--prev {
41213
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41214
+ :where(.theme-scope) :where([data-block="testimonials"]) .rb-testimonials-carousel.carousel-root .carousel-nav-btn--prev {
40985
41215
  /* Move arrows closer to viewport edge than container edge on mobile. */
40986
41216
  left: calc(0.5rem - 1.5rem);
40987
41217
  }
@@ -40991,10 +41221,12 @@ var containerResponsiveThemeCss = `/*
40991
41221
  right: calc(0.5rem - 1.5rem);
40992
41222
  }
40993
41223
  }
41224
+ }
40994
41225
 
40995
41226
  /* Position arrows further out on larger breakpoints */
40996
41227
  @container rb-site (min-width: 640px) {
40997
- :where(.theme-scope) :where([data-block="testimonials"]) .rb-testimonials-carousel.carousel-root .carousel-nav-btn--prev {
41228
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41229
+ :where(.theme-scope) :where([data-block="testimonials"]) .rb-testimonials-carousel.carousel-root .carousel-nav-btn--prev {
40998
41230
  left: calc(-1 * (var(--rb-testimonial-carousel-arrow-size) / 2 + var(--rb-testimonial-carousel-arrow-gap)));
40999
41231
  }
41000
41232
 
@@ -41002,6 +41234,7 @@ var containerResponsiveThemeCss = `/*
41002
41234
  right: calc(-1 * (var(--rb-testimonial-carousel-arrow-size) / 2 + var(--rb-testimonial-carousel-arrow-gap)));
41003
41235
  }
41004
41236
  }
41237
+ }
41005
41238
 
41006
41239
  /*
41007
41240
  * Event Details (runtime node)
@@ -41053,10 +41286,12 @@ var containerResponsiveThemeCss = `/*
41053
41286
  }
41054
41287
 
41055
41288
  @container rb-site (min-width: 768px) {
41056
- :where(.theme-scope) .rb-tiles-grid {
41289
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41290
+ :where(.theme-scope) .rb-tiles-grid {
41057
41291
  grid-template-columns: repeat(var(--rb-tiles-grid-cols-md, var(--rb-tiles-grid-cols-sm, 2)), minmax(0, 1fr));
41058
41292
  }
41059
41293
  }
41294
+ }
41060
41295
 
41061
41296
  :where(.theme-scope) :where(.rb-tile--interactive, .er-event-card) {
41062
41297
  cursor: pointer;
@@ -41161,10 +41396,12 @@ var containerResponsiveThemeCss = `/*
41161
41396
  }
41162
41397
 
41163
41398
  @container rb-site (min-width: 768px) {
41164
- :where(.theme-scope) :where([data-block="course-registration"]) .cr-layout--with-sidebar {
41399
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41400
+ :where(.theme-scope) :where([data-block="course-registration"]) .cr-layout--with-sidebar {
41165
41401
  grid-template-columns: 1fr 280px;
41166
41402
  }
41167
41403
  }
41404
+ }
41168
41405
 
41169
41406
  :where(.theme-scope) :where([data-block="course-registration"]) .cr-layout__main {
41170
41407
  min-width: 0;
@@ -41175,10 +41412,12 @@ var containerResponsiveThemeCss = `/*
41175
41412
  }
41176
41413
 
41177
41414
  @container rb-site (min-width: 768px) {
41178
- :where(.theme-scope) :where([data-block="course-registration"]) .cr-layout__sidebar {
41415
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41416
+ :where(.theme-scope) :where([data-block="course-registration"]) .cr-layout__sidebar {
41179
41417
  display: block;
41180
41418
  }
41181
41419
  }
41420
+ }
41182
41421
 
41183
41422
  /* =============================================================================
41184
41423
  * Step Indicator
@@ -41229,10 +41468,12 @@ var containerResponsiveThemeCss = `/*
41229
41468
  }
41230
41469
 
41231
41470
  @container rb-site (min-width: 640px) {
41232
- :where(.theme-scope) :where([data-block="course-registration"]) .cr-step-label {
41471
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
41472
+ :where(.theme-scope) :where([data-block="course-registration"]) .cr-step-label {
41233
41473
  display: block;
41234
41474
  }
41235
41475
  }
41476
+ }
41236
41477
 
41237
41478
  :where(.theme-scope) :where([data-block="course-registration"]) .cr-step-label--active {
41238
41479
  color: var(--cr-on-surface);
@@ -42115,7 +42356,8 @@ var containerResponsiveThemeCss = `/*
42115
42356
 
42116
42357
  /* Mobile fallback for inline variant */
42117
42358
  @container rb-site (max-width: 640px) {
42118
- :where(.theme-scope) .newsletter-inline .newsletter-form-fields {
42359
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
42360
+ :where(.theme-scope) .newsletter-inline .newsletter-form-fields {
42119
42361
  flex-direction: column;
42120
42362
  }
42121
42363
 
@@ -42123,6 +42365,7 @@ var containerResponsiveThemeCss = `/*
42123
42365
  min-width: 100%;
42124
42366
  }
42125
42367
  }
42368
+ }
42126
42369
 
42127
42370
  /* =============================================================================
42128
42371
  * Success State
@@ -42160,12 +42403,14 @@ var containerResponsiveThemeCss = `/*
42160
42403
  }
42161
42404
 
42162
42405
  @container rb-site (min-width: 1024px) {
42163
- :where(.theme-scope) :where([data-block="team-members"]) :where(.rb-team-members[data-layout-width="lg-3-4-left"]) {
42406
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
42407
+ :where(.theme-scope) :where([data-block="team-members"]) :where(.rb-team-members[data-layout-width="lg-3-4-left"]) {
42164
42408
  width: 75%;
42165
42409
  margin-left: 0;
42166
42410
  margin-right: auto;
42167
42411
  }
42168
42412
  }
42413
+ }
42169
42414
 
42170
42415
  :where(.theme-scope) :where([data-block="team-members"]) .rb-team-member-photo {
42171
42416
  display: block;
@@ -42240,7 +42485,8 @@ var containerResponsiveThemeCss = `/*
42240
42485
  }
42241
42486
 
42242
42487
  @container rb-site (min-width: 768px) {
42243
- /* Stack variant: enforce real column ratio at md+ (fixes transform/fallback pitfalls). */
42488
+ @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
42489
+ /* Stack variant: enforce real column ratio at md+ (fixes transform/fallback pitfalls). */
42244
42490
  :where(.theme-scope) :where([data-block="team-members"][data-block-variant="stack"]) :where(.rb-team-member-photo-col) {
42245
42491
  flex: 0 0 var(--rb-team-image-basis);
42246
42492
  }
@@ -42264,6 +42510,7 @@ var containerResponsiveThemeCss = `/*
42264
42510
  flex-direction: row-reverse;
42265
42511
  }
42266
42512
  }
42513
+ }
42267
42514
 
42268
42515
  /* Thumbnail padding (space around image inside the item) */
42269
42516
  :where(.theme-scope) :where([data-block="team-members"]) .rb-team-members[data-thumb-pad="sm"] .rb-team-member-photo-wrap {
@@ -42466,18 +42713,19 @@ function ThemeScopeCore({
42466
42713
  children,
42467
42714
  className
42468
42715
  }) {
42469
- const isContainerResponsive = responsiveMode === "container";
42716
+ const responsiveScope = getResponsiveScopeSpec(responsiveMode);
42717
+ const isContainerResponsive = responsiveScope.kind === "container";
42470
42718
  const wrapperStyle = isContainerResponsive ? {
42471
42719
  ...cssVars,
42472
42720
  containerType: "inline-size",
42473
- containerName: THEME_RESPONSIVE_CONTAINER_NAME
42721
+ containerName: responsiveScope.containerName
42474
42722
  } : cssVars;
42475
42723
  return /* @__PURE__ */ jsxs36(
42476
42724
  "div",
42477
42725
  {
42478
42726
  className: className ? `theme-scope ${className}` : "theme-scope",
42479
42727
  style: wrapperStyle,
42480
- "data-rb-responsive-mode": responsiveMode,
42728
+ "data-rb-responsive-mode": responsiveScope.kind,
42481
42729
  ...dataAttrs,
42482
42730
  suppressHydrationWarning,
42483
42731
  children: [
@@ -42485,25 +42733,131 @@ function ThemeScopeCore({
42485
42733
  "style",
42486
42734
  {
42487
42735
  "data-container-responsive-overrides": true,
42488
- dangerouslySetInnerHTML: { __html: escapeStyleContent(containerResponsiveThemeCss) }
42736
+ dangerouslySetInnerHTML: {
42737
+ __html: escapeStyleContent(containerResponsiveThemeCss)
42738
+ }
42739
+ }
42740
+ ),
42741
+ layoutCss && /* @__PURE__ */ jsx51(
42742
+ "style",
42743
+ {
42744
+ "data-layout-styles": true,
42745
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(layoutCss) }
42746
+ }
42747
+ ),
42748
+ buttonCss && /* @__PURE__ */ jsx51(
42749
+ "style",
42750
+ {
42751
+ "data-button-effects": true,
42752
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(buttonCss) }
42753
+ }
42754
+ ),
42755
+ headerCss && /* @__PURE__ */ jsx51(
42756
+ "style",
42757
+ {
42758
+ "data-header-styles": true,
42759
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(headerCss) }
42760
+ }
42761
+ ),
42762
+ footerCss && /* @__PURE__ */ jsx51(
42763
+ "style",
42764
+ {
42765
+ "data-footer-styles": true,
42766
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(footerCss) }
42767
+ }
42768
+ ),
42769
+ cardCss && /* @__PURE__ */ jsx51(
42770
+ "style",
42771
+ {
42772
+ "data-card-styles": true,
42773
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(cardCss) }
42774
+ }
42775
+ ),
42776
+ accordionCss && /* @__PURE__ */ jsx51(
42777
+ "style",
42778
+ {
42779
+ "data-accordion-styles": true,
42780
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(accordionCss) }
42781
+ }
42782
+ ),
42783
+ inputCss && /* @__PURE__ */ jsx51(
42784
+ "style",
42785
+ {
42786
+ "data-input-styles": true,
42787
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(inputCss) }
42788
+ }
42789
+ ),
42790
+ statusCss && /* @__PURE__ */ jsx51(
42791
+ "style",
42792
+ {
42793
+ "data-status-styles": true,
42794
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(statusCss) }
42795
+ }
42796
+ ),
42797
+ progressCss && /* @__PURE__ */ jsx51(
42798
+ "style",
42799
+ {
42800
+ "data-progress-styles": true,
42801
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(progressCss) }
42802
+ }
42803
+ ),
42804
+ typographyCss && /* @__PURE__ */ jsx51(
42805
+ "style",
42806
+ {
42807
+ "data-typography-styles": true,
42808
+ dangerouslySetInnerHTML: {
42809
+ __html: escapeStyleContent(typographyCss)
42810
+ }
42811
+ }
42812
+ ),
42813
+ eventCalendarCss && /* @__PURE__ */ jsx51(
42814
+ "style",
42815
+ {
42816
+ "data-event-calendar-styles": true,
42817
+ dangerouslySetInnerHTML: {
42818
+ __html: escapeStyleContent(eventCalendarCss)
42819
+ }
42820
+ }
42821
+ ),
42822
+ blockVarsCss && /* @__PURE__ */ jsx51(
42823
+ "style",
42824
+ {
42825
+ "data-block-vars-styles": true,
42826
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(blockVarsCss) }
42827
+ }
42828
+ ),
42829
+ blockCustomVarsCss && /* @__PURE__ */ jsx51(
42830
+ "style",
42831
+ {
42832
+ "data-block-custom-vars-styles": true,
42833
+ dangerouslySetInnerHTML: {
42834
+ __html: escapeStyleContent(blockCustomVarsCss)
42835
+ }
42836
+ }
42837
+ ),
42838
+ blockCustomCss && /* @__PURE__ */ jsx51(
42839
+ "style",
42840
+ {
42841
+ "data-block-custom-styles": true,
42842
+ dangerouslySetInnerHTML: {
42843
+ __html: escapeStyleContent(blockCustomCss)
42844
+ }
42845
+ }
42846
+ ),
42847
+ atRulesCss && /* @__PURE__ */ jsx51(
42848
+ "style",
42849
+ {
42850
+ "data-at-rules-styles": true,
42851
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(atRulesCss) }
42852
+ }
42853
+ ),
42854
+ customCss && /* @__PURE__ */ jsx51(
42855
+ "style",
42856
+ {
42857
+ "data-custom-theme-styles": true,
42858
+ dangerouslySetInnerHTML: { __html: escapeStyleContent(customCss) }
42489
42859
  }
42490
42860
  ),
42491
- layoutCss && /* @__PURE__ */ jsx51("style", { "data-layout-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(layoutCss) } }),
42492
- buttonCss && /* @__PURE__ */ jsx51("style", { "data-button-effects": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(buttonCss) } }),
42493
- headerCss && /* @__PURE__ */ jsx51("style", { "data-header-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(headerCss) } }),
42494
- footerCss && /* @__PURE__ */ jsx51("style", { "data-footer-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(footerCss) } }),
42495
- cardCss && /* @__PURE__ */ jsx51("style", { "data-card-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(cardCss) } }),
42496
- accordionCss && /* @__PURE__ */ jsx51("style", { "data-accordion-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(accordionCss) } }),
42497
- inputCss && /* @__PURE__ */ jsx51("style", { "data-input-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(inputCss) } }),
42498
- statusCss && /* @__PURE__ */ jsx51("style", { "data-status-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(statusCss) } }),
42499
- progressCss && /* @__PURE__ */ jsx51("style", { "data-progress-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(progressCss) } }),
42500
- typographyCss && /* @__PURE__ */ jsx51("style", { "data-typography-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(typographyCss) } }),
42501
- eventCalendarCss && /* @__PURE__ */ jsx51("style", { "data-event-calendar-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(eventCalendarCss) } }),
42502
- blockVarsCss && /* @__PURE__ */ jsx51("style", { "data-block-vars-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(blockVarsCss) } }),
42503
- blockCustomVarsCss && /* @__PURE__ */ jsx51("style", { "data-block-custom-vars-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(blockCustomVarsCss) } }),
42504
- blockCustomCss && /* @__PURE__ */ jsx51("style", { "data-block-custom-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(blockCustomCss) } }),
42505
- atRulesCss && /* @__PURE__ */ jsx51("style", { "data-at-rules-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(atRulesCss) } }),
42506
- customCss && /* @__PURE__ */ jsx51("style", { "data-custom-theme-styles": true, dangerouslySetInnerHTML: { __html: escapeStyleContent(customCss) } }),
42507
42861
  children
42508
42862
  ]
42509
42863
  }
@@ -43344,6 +43698,1550 @@ async function Layout({
43344
43698
  return useThemeScope ? /* @__PURE__ */ jsx58(ThemeScope2, { theme, children: content }) : content;
43345
43699
  }
43346
43700
 
43701
+ // ../../node_modules/.pnpm/@vibrant+image@4.0.4/node_modules/@vibrant/image/dist/esm/histogram.js
43702
+ var Histogram = class {
43703
+ constructor(pixels, opts) {
43704
+ this.pixels = pixels;
43705
+ this.opts = opts;
43706
+ const { sigBits } = opts;
43707
+ const getColorIndex = (r22, g2, b2) => (r22 << 2 * sigBits) + (g2 << sigBits) + b2;
43708
+ this.getColorIndex = getColorIndex;
43709
+ const rshift = 8 - sigBits;
43710
+ const hn = 1 << 3 * sigBits;
43711
+ const hist = new Uint32Array(hn);
43712
+ let rmax;
43713
+ let rmin;
43714
+ let gmax;
43715
+ let gmin;
43716
+ let bmax;
43717
+ let bmin;
43718
+ let r2;
43719
+ let g;
43720
+ let b;
43721
+ let a;
43722
+ rmax = gmax = bmax = 0;
43723
+ rmin = gmin = bmin = Number.MAX_VALUE;
43724
+ const n = pixels.length / 4;
43725
+ let i = 0;
43726
+ while (i < n) {
43727
+ const offset = i * 4;
43728
+ i++;
43729
+ r2 = pixels[offset + 0];
43730
+ g = pixels[offset + 1];
43731
+ b = pixels[offset + 2];
43732
+ a = pixels[offset + 3];
43733
+ if (a === 0) continue;
43734
+ r2 = r2 >> rshift;
43735
+ g = g >> rshift;
43736
+ b = b >> rshift;
43737
+ const index = getColorIndex(r2, g, b);
43738
+ if (hist[index] === void 0) hist[index] = 0;
43739
+ hist[index] += 1;
43740
+ if (r2 > rmax) rmax = r2;
43741
+ if (r2 < rmin) rmin = r2;
43742
+ if (g > gmax) gmax = g;
43743
+ if (g < gmin) gmin = g;
43744
+ if (b > bmax) bmax = b;
43745
+ if (b < bmin) bmin = b;
43746
+ }
43747
+ this._colorCount = hist.reduce(
43748
+ (total, c) => c > 0 ? total + 1 : total,
43749
+ 0
43750
+ );
43751
+ this.hist = hist;
43752
+ this.rmax = rmax;
43753
+ this.rmin = rmin;
43754
+ this.gmax = gmax;
43755
+ this.gmin = gmin;
43756
+ this.bmax = bmax;
43757
+ this.bmin = bmin;
43758
+ }
43759
+ get colorCount() {
43760
+ return this._colorCount;
43761
+ }
43762
+ };
43763
+
43764
+ // ../../node_modules/.pnpm/@vibrant+image@4.0.4/node_modules/@vibrant/image/dist/esm/index.js
43765
+ var ImageBase = class {
43766
+ scaleDown(opts) {
43767
+ const width = this.getWidth();
43768
+ const height = this.getHeight();
43769
+ let ratio = 1;
43770
+ if (opts.maxDimension > 0) {
43771
+ const maxSide = Math.max(width, height);
43772
+ if (maxSide > opts.maxDimension) ratio = opts.maxDimension / maxSide;
43773
+ } else {
43774
+ ratio = 1 / opts.quality;
43775
+ }
43776
+ if (ratio < 1) this.resize(width * ratio, height * ratio, ratio);
43777
+ }
43778
+ };
43779
+ function applyFilters(imageData, filters) {
43780
+ if (filters.length > 0) {
43781
+ const pixels = imageData.data;
43782
+ const n = pixels.length / 4;
43783
+ let offset;
43784
+ let r2;
43785
+ let g;
43786
+ let b;
43787
+ let a;
43788
+ for (let i = 0; i < n; i++) {
43789
+ offset = i * 4;
43790
+ r2 = pixels[offset + 0];
43791
+ g = pixels[offset + 1];
43792
+ b = pixels[offset + 2];
43793
+ a = pixels[offset + 3];
43794
+ for (let j = 0; j < filters.length; j++) {
43795
+ if (!filters[j]?.(r2, g, b, a)) {
43796
+ pixels[offset + 3] = 0;
43797
+ break;
43798
+ }
43799
+ }
43800
+ }
43801
+ }
43802
+ return imageData;
43803
+ }
43804
+
43805
+ // ../../node_modules/.pnpm/@vibrant+image-browser@4.0.4/node_modules/@vibrant/image-browser/dist/esm/index.js
43806
+ function isRelativeUrl(url) {
43807
+ const u = new URL(url, location.href);
43808
+ return u.protocol === location.protocol && u.host === location.host && u.port === location.port;
43809
+ }
43810
+ function isSameOrigin(a, b) {
43811
+ const ua = new URL(a);
43812
+ const ub = new URL(b);
43813
+ return ua.protocol === ub.protocol && ua.hostname === ub.hostname && ua.port === ub.port;
43814
+ }
43815
+ var BrowserImage = class extends ImageBase {
43816
+ _getCanvas() {
43817
+ if (!this._canvas) {
43818
+ throw new Error("Canvas is not initialized");
43819
+ }
43820
+ return this._canvas;
43821
+ }
43822
+ _getContext() {
43823
+ if (!this._context) {
43824
+ throw new Error("Context is not initialized");
43825
+ }
43826
+ return this._context;
43827
+ }
43828
+ _getWidth() {
43829
+ if (!this._width) {
43830
+ throw new Error("Width is not initialized");
43831
+ }
43832
+ return this._width;
43833
+ }
43834
+ _getHeight() {
43835
+ if (!this._height) {
43836
+ throw new Error("Height is not initialized");
43837
+ }
43838
+ return this._height;
43839
+ }
43840
+ _initCanvas() {
43841
+ const img = this.image;
43842
+ if (!img) {
43843
+ throw new Error("Image is not initialized");
43844
+ }
43845
+ const canvas = this._canvas = document.createElement("canvas");
43846
+ const context = canvas.getContext("2d");
43847
+ if (!context) throw new ReferenceError("Failed to create canvas context");
43848
+ this._context = context;
43849
+ canvas.className = "@vibrant/canvas";
43850
+ canvas.style.display = "none";
43851
+ this._width = canvas.width = img.width;
43852
+ this._height = canvas.height = img.height;
43853
+ context.drawImage(img, 0, 0);
43854
+ document.body.appendChild(canvas);
43855
+ }
43856
+ load(image) {
43857
+ let img;
43858
+ let src;
43859
+ if (typeof image === "string") {
43860
+ img = document.createElement("img");
43861
+ src = image;
43862
+ if (!isRelativeUrl(src) && !isSameOrigin(window.location.href, src)) {
43863
+ img.crossOrigin = "anonymous";
43864
+ }
43865
+ img.src = src;
43866
+ } else if (image instanceof HTMLImageElement) {
43867
+ img = image;
43868
+ src = image.src;
43869
+ } else {
43870
+ return Promise.reject(
43871
+ new Error(`Cannot load buffer as an image in browser`)
43872
+ );
43873
+ }
43874
+ this.image = img;
43875
+ return new Promise((resolve, reject) => {
43876
+ const onImageLoad = () => {
43877
+ this._initCanvas();
43878
+ resolve(this);
43879
+ };
43880
+ if (img.complete) {
43881
+ onImageLoad();
43882
+ } else {
43883
+ img.onload = onImageLoad;
43884
+ img.onerror = (_e) => reject(new Error(`Fail to load image: ${src}`));
43885
+ }
43886
+ });
43887
+ }
43888
+ clear() {
43889
+ this._getContext().clearRect(0, 0, this._getWidth(), this._getHeight());
43890
+ }
43891
+ update(imageData) {
43892
+ this._getContext().putImageData(imageData, 0, 0);
43893
+ }
43894
+ getWidth() {
43895
+ return this._getWidth();
43896
+ }
43897
+ getHeight() {
43898
+ return this._getHeight();
43899
+ }
43900
+ resize(targetWidth, targetHeight, ratio) {
43901
+ if (!this.image) {
43902
+ throw new Error("Image is not initialized");
43903
+ }
43904
+ this._width = this._getCanvas().width = targetWidth;
43905
+ this._height = this._getCanvas().height = targetHeight;
43906
+ this._getContext().scale(ratio, ratio);
43907
+ this._getContext().drawImage(this.image, 0, 0);
43908
+ }
43909
+ getPixelCount() {
43910
+ return this._getWidth() * this._getHeight();
43911
+ }
43912
+ getImageData() {
43913
+ return this._getContext().getImageData(
43914
+ 0,
43915
+ 0,
43916
+ this._getWidth(),
43917
+ this._getHeight()
43918
+ );
43919
+ }
43920
+ remove() {
43921
+ if (this._canvas && this._canvas.parentNode) {
43922
+ this._canvas.parentNode.removeChild(this._canvas);
43923
+ }
43924
+ }
43925
+ };
43926
+
43927
+ // ../../node_modules/.pnpm/@vibrant+core@4.0.4/node_modules/@vibrant/core/dist/esm/utils.js
43928
+ function assignDeep(target, ...sources) {
43929
+ sources.forEach((s) => {
43930
+ if (!s) return;
43931
+ for (const key in s) {
43932
+ if (s.hasOwnProperty(key)) {
43933
+ const v = s[key];
43934
+ if (Array.isArray(v)) {
43935
+ target[key] = v.slice(0);
43936
+ } else if (typeof v === "object") {
43937
+ if (!target[key]) target[key] = {};
43938
+ assignDeep(target[key], v);
43939
+ } else {
43940
+ target[key] = v;
43941
+ }
43942
+ }
43943
+ }
43944
+ });
43945
+ return target;
43946
+ }
43947
+
43948
+ // ../../node_modules/.pnpm/@vibrant+core@4.0.4/node_modules/@vibrant/core/dist/esm/options.js
43949
+ function buildProcessOptions(opts, override) {
43950
+ const { colorCount, quantizer, generators, filters } = opts;
43951
+ const commonQuantizerOpts = { colorCount };
43952
+ const q = typeof quantizer === "string" ? { name: quantizer, options: {} } : quantizer;
43953
+ q.options = assignDeep({}, commonQuantizerOpts, q.options);
43954
+ return assignDeep(
43955
+ {},
43956
+ {
43957
+ quantizer: q,
43958
+ generators,
43959
+ filters
43960
+ },
43961
+ override
43962
+ );
43963
+ }
43964
+
43965
+ // ../../node_modules/.pnpm/@vibrant+core@4.0.4/node_modules/@vibrant/core/dist/esm/builder.js
43966
+ var Builder = class {
43967
+ /**
43968
+ * Arguments are the same as `Vibrant.constructor`.
43969
+ */
43970
+ constructor(src, opts = {}) {
43971
+ this._src = src;
43972
+ this._opts = assignDeep({}, Vibrant.DefaultOpts, opts);
43973
+ }
43974
+ /**
43975
+ * Sets `opts.colorCount` to `n`.
43976
+ * @returns this `Builder` instance.
43977
+ */
43978
+ maxColorCount(n) {
43979
+ this._opts.colorCount = n;
43980
+ return this;
43981
+ }
43982
+ /**
43983
+ * Sets `opts.maxDimension` to `d`.
43984
+ * @returns this `Builder` instance.
43985
+ */
43986
+ maxDimension(d) {
43987
+ this._opts.maxDimension = d;
43988
+ return this;
43989
+ }
43990
+ /**
43991
+ * Adds a filter function
43992
+ * @returns this `Builder` instance.
43993
+ */
43994
+ addFilter(name) {
43995
+ if (!this._opts.filters) {
43996
+ this._opts.filters = [name];
43997
+ } else {
43998
+ this._opts.filters.push(name);
43999
+ }
44000
+ return this;
44001
+ }
44002
+ /**
44003
+ * Removes a filter function.
44004
+ * @returns this `Builder` instance.
44005
+ */
44006
+ removeFilter(name) {
44007
+ if (this._opts.filters) {
44008
+ const i = this._opts.filters.indexOf(name);
44009
+ if (i > 0) this._opts.filters.splice(i);
44010
+ }
44011
+ return this;
44012
+ }
44013
+ /**
44014
+ * Clear all filters.
44015
+ * @returns this `Builder` instance.
44016
+ */
44017
+ clearFilters() {
44018
+ this._opts.filters = [];
44019
+ return this;
44020
+ }
44021
+ /**
44022
+ * Sets `opts.quality` to `q`.
44023
+ * @returns this `Builder` instance.
44024
+ */
44025
+ quality(q) {
44026
+ this._opts.quality = q;
44027
+ return this;
44028
+ }
44029
+ /**
44030
+ * Specifies which `Image` implementation class to use.
44031
+ * @returns this `Builder` instance.
44032
+ */
44033
+ useImageClass(imageClass) {
44034
+ this._opts.ImageClass = imageClass;
44035
+ return this;
44036
+ }
44037
+ /**
44038
+ * Sets `opts.generator` to `generator`
44039
+ * @returns this `Builder` instance.
44040
+ */
44041
+ useGenerator(generator, options) {
44042
+ if (!this._opts.generators) this._opts.generators = [];
44043
+ this._opts.generators.push(
44044
+ options ? { name: generator, options } : generator
44045
+ );
44046
+ return this;
44047
+ }
44048
+ /**
44049
+ * Specifies which `Quantizer` implementation class to use
44050
+ * @returns this `Builder` instance.
44051
+ */
44052
+ useQuantizer(quantizer, options) {
44053
+ this._opts.quantizer = options ? { name: quantizer, options } : quantizer;
44054
+ return this;
44055
+ }
44056
+ /**
44057
+ * Builds and returns a `Vibrant` instance as configured.
44058
+ */
44059
+ build() {
44060
+ return new Vibrant(this._src, this._opts);
44061
+ }
44062
+ /**
44063
+ * Builds a `Vibrant` instance as configured and calls its `getPalette` method.
44064
+ */
44065
+ getPalette() {
44066
+ return this.build().getPalette();
44067
+ }
44068
+ };
44069
+
44070
+ // ../../node_modules/.pnpm/@vibrant+core@4.0.4/node_modules/@vibrant/core/dist/esm/pipeline/index.js
44071
+ var Stage = class {
44072
+ constructor(pipeline2) {
44073
+ this.pipeline = pipeline2;
44074
+ this._map = {};
44075
+ }
44076
+ names() {
44077
+ return Object.keys(this._map);
44078
+ }
44079
+ has(name) {
44080
+ return !!this._map[name];
44081
+ }
44082
+ get(name) {
44083
+ return this._map[name];
44084
+ }
44085
+ register(name, stageFn) {
44086
+ this._map[name] = stageFn;
44087
+ return this.pipeline;
44088
+ }
44089
+ };
44090
+ var BasicPipeline = class {
44091
+ constructor() {
44092
+ this.filter = new Stage(this);
44093
+ this.quantizer = new Stage(this);
44094
+ this.generator = new Stage(this);
44095
+ }
44096
+ _buildProcessTasks({
44097
+ filters,
44098
+ quantizer,
44099
+ generators
44100
+ }) {
44101
+ if (generators.length === 1 && generators[0] === "*") {
44102
+ generators = this.generator.names();
44103
+ }
44104
+ return {
44105
+ filters: filters.map((f) => createTask(this.filter, f)),
44106
+ quantizer: createTask(this.quantizer, quantizer),
44107
+ generators: generators.map((g) => createTask(this.generator, g))
44108
+ };
44109
+ function createTask(stage, o) {
44110
+ let name;
44111
+ let options;
44112
+ if (typeof o === "string") {
44113
+ name = o;
44114
+ } else {
44115
+ name = o.name;
44116
+ options = o.options;
44117
+ }
44118
+ return {
44119
+ name,
44120
+ fn: stage.get(name),
44121
+ options
44122
+ };
44123
+ }
44124
+ }
44125
+ async process(imageData, opts) {
44126
+ const { filters, quantizer, generators } = this._buildProcessTasks(opts);
44127
+ const imageFilterData = await this._filterColors(filters, imageData);
44128
+ const colors = await this._generateColors(quantizer, imageFilterData);
44129
+ const palettes = await this._generatePalettes(generators, colors);
44130
+ return {
44131
+ colors,
44132
+ palettes
44133
+ };
44134
+ }
44135
+ _filterColors(filters, imageData) {
44136
+ return Promise.resolve(
44137
+ applyFilters(
44138
+ imageData,
44139
+ filters.map(({ fn }) => fn)
44140
+ )
44141
+ );
44142
+ }
44143
+ _generateColors(quantizer, imageData) {
44144
+ return Promise.resolve(quantizer.fn(imageData.data, quantizer.options));
44145
+ }
44146
+ async _generatePalettes(generators, colors) {
44147
+ const promiseArr = await Promise.all(
44148
+ generators.map(({ fn, options }) => Promise.resolve(fn(colors, options)))
44149
+ );
44150
+ return Promise.resolve(
44151
+ promiseArr.reduce(
44152
+ (promises, promiseVal, i) => {
44153
+ promises[generators[i].name] = promiseVal;
44154
+ return promises;
44155
+ },
44156
+ {}
44157
+ )
44158
+ );
44159
+ }
44160
+ };
44161
+
44162
+ // ../../node_modules/.pnpm/@vibrant+color@4.0.4/node_modules/@vibrant/color/dist/esm/converter.js
44163
+ function rgbToHex2(r2, g, b) {
44164
+ return "#" + ((1 << 24) + (r2 << 16) + (g << 8) + b).toString(16).slice(1, 7);
44165
+ }
44166
+ function rgbToHsl2(r2, g, b) {
44167
+ r2 /= 255;
44168
+ g /= 255;
44169
+ b /= 255;
44170
+ const max = Math.max(r2, g, b);
44171
+ const min = Math.min(r2, g, b);
44172
+ let h = 0;
44173
+ let s = 0;
44174
+ const l = (max + min) / 2;
44175
+ if (max !== min) {
44176
+ const d = max - min;
44177
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
44178
+ switch (max) {
44179
+ case r2:
44180
+ h = (g - b) / d + (g < b ? 6 : 0);
44181
+ break;
44182
+ case g:
44183
+ h = (b - r2) / d + 2;
44184
+ break;
44185
+ case b:
44186
+ h = (r2 - g) / d + 4;
44187
+ break;
44188
+ }
44189
+ h /= 6;
44190
+ }
44191
+ return [h, s, l];
44192
+ }
44193
+ function hslToRgb(h, s, l) {
44194
+ let r2;
44195
+ let g;
44196
+ let b;
44197
+ function hue2rgb(p, q, t) {
44198
+ if (t < 0) t += 1;
44199
+ if (t > 1) t -= 1;
44200
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
44201
+ if (t < 1 / 2) return q;
44202
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
44203
+ return p;
44204
+ }
44205
+ if (s === 0) {
44206
+ r2 = g = b = l;
44207
+ } else {
44208
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
44209
+ const p = 2 * l - q;
44210
+ r2 = hue2rgb(p, q, h + 1 / 3);
44211
+ g = hue2rgb(p, q, h);
44212
+ b = hue2rgb(p, q, h - 1 / 3);
44213
+ }
44214
+ return [r2 * 255, g * 255, b * 255];
44215
+ }
44216
+
44217
+ // ../../node_modules/.pnpm/@vibrant+color@4.0.4/node_modules/@vibrant/color/dist/esm/index.js
44218
+ var Swatch2 = class _Swatch {
44219
+ static applyFilters(colors, filters) {
44220
+ return filters.length > 0 ? colors.filter(({ r: r2, g, b }) => {
44221
+ for (let j = 0; j < filters.length; j++) {
44222
+ if (!filters[j]?.(r2, g, b, 255)) return false;
44223
+ }
44224
+ return true;
44225
+ }) : colors;
44226
+ }
44227
+ /**
44228
+ * Make a value copy of a swatch based on a previous one. Returns a new Swatch instance
44229
+ * @param {Swatch} swatch
44230
+ */
44231
+ static clone(swatch) {
44232
+ return new _Swatch(swatch._rgb, swatch._population);
44233
+ }
44234
+ /**
44235
+ * The red value in the RGB value
44236
+ */
44237
+ get r() {
44238
+ return this._rgb[0];
44239
+ }
44240
+ /**
44241
+ * The green value in the RGB value
44242
+ */
44243
+ get g() {
44244
+ return this._rgb[1];
44245
+ }
44246
+ /**
44247
+ * The blue value in the RGB value
44248
+ */
44249
+ get b() {
44250
+ return this._rgb[2];
44251
+ }
44252
+ /**
44253
+ * The color value as a rgb value
44254
+ */
44255
+ get rgb() {
44256
+ return this._rgb;
44257
+ }
44258
+ /**
44259
+ * The color value as a hsl value
44260
+ */
44261
+ get hsl() {
44262
+ if (!this._hsl) {
44263
+ const [r2, g, b] = this._rgb;
44264
+ this._hsl = rgbToHsl2(r2, g, b);
44265
+ }
44266
+ return this._hsl;
44267
+ }
44268
+ /**
44269
+ * The color value as a hex string
44270
+ */
44271
+ get hex() {
44272
+ if (!this._hex) {
44273
+ const [r2, g, b] = this._rgb;
44274
+ this._hex = rgbToHex2(r2, g, b);
44275
+ }
44276
+ return this._hex;
44277
+ }
44278
+ get population() {
44279
+ return this._population;
44280
+ }
44281
+ /**
44282
+ * Get the JSON object for the swatch
44283
+ */
44284
+ toJSON() {
44285
+ return {
44286
+ rgb: this.rgb,
44287
+ population: this.population
44288
+ };
44289
+ }
44290
+ getYiq() {
44291
+ if (!this._yiq) {
44292
+ const rgb = this._rgb;
44293
+ this._yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3;
44294
+ }
44295
+ return this._yiq;
44296
+ }
44297
+ /**
44298
+ * Returns an appropriate color to use for any 'title' text which is displayed over this Swatch's color.
44299
+ */
44300
+ get titleTextColor() {
44301
+ if (!this._titleTextColor) {
44302
+ this._titleTextColor = this.getYiq() < 200 ? "#fff" : "#000";
44303
+ }
44304
+ return this._titleTextColor;
44305
+ }
44306
+ /**
44307
+ * Returns an appropriate color to use for any 'body' text which is displayed over this Swatch's color.
44308
+ */
44309
+ get bodyTextColor() {
44310
+ if (!this._bodyTextColor) {
44311
+ this._bodyTextColor = this.getYiq() < 150 ? "#fff" : "#000";
44312
+ }
44313
+ return this._bodyTextColor;
44314
+ }
44315
+ /**
44316
+ * Internal use.
44317
+ * @param rgb `[r, g, b]`
44318
+ * @param population Population of the color in an image
44319
+ */
44320
+ constructor(rgb, population) {
44321
+ this._rgb = rgb;
44322
+ this._population = population;
44323
+ }
44324
+ };
44325
+
44326
+ // ../../node_modules/.pnpm/@vibrant+core@4.0.4/node_modules/@vibrant/core/dist/esm/index.js
44327
+ var _Vibrant = class _Vibrant2 {
44328
+ /**
44329
+ *
44330
+ * @param _src Path to image file (supports HTTP/HTTPs)
44331
+ * @param opts Options (optional)
44332
+ */
44333
+ constructor(_src, opts) {
44334
+ this._src = _src;
44335
+ this.opts = assignDeep({}, _Vibrant2.DefaultOpts, opts);
44336
+ }
44337
+ static use(pipeline2) {
44338
+ this._pipeline = pipeline2;
44339
+ }
44340
+ static from(src) {
44341
+ return new Builder(src);
44342
+ }
44343
+ get result() {
44344
+ return this._result;
44345
+ }
44346
+ _process(image, opts) {
44347
+ image.scaleDown(this.opts);
44348
+ const processOpts = buildProcessOptions(this.opts, opts);
44349
+ return _Vibrant2._pipeline.process(image.getImageData(), processOpts);
44350
+ }
44351
+ async getPalette() {
44352
+ const image = new this.opts.ImageClass();
44353
+ try {
44354
+ const image1 = await image.load(this._src);
44355
+ const result1 = await this._process(image1, {
44356
+ generators: ["default"]
44357
+ });
44358
+ this._result = result1;
44359
+ const res = result1.palettes["default"];
44360
+ if (!res) {
44361
+ throw new Error(
44362
+ `Something went wrong and a palette was not found, please file a bug against our GitHub repo: https://github.com/vibrant-Colors/node-vibrant/`
44363
+ );
44364
+ }
44365
+ image.remove();
44366
+ return res;
44367
+ } catch (err2) {
44368
+ image.remove();
44369
+ return Promise.reject(err2);
44370
+ }
44371
+ }
44372
+ async getPalettes() {
44373
+ const image = new this.opts.ImageClass();
44374
+ try {
44375
+ const image1 = await image.load(this._src);
44376
+ const result1 = await this._process(image1, {
44377
+ generators: ["*"]
44378
+ });
44379
+ this._result = result1;
44380
+ const res = result1.palettes;
44381
+ image.remove();
44382
+ return res;
44383
+ } catch (err2) {
44384
+ image.remove();
44385
+ return Promise.reject(err2);
44386
+ }
44387
+ }
44388
+ };
44389
+ _Vibrant.DefaultOpts = {
44390
+ colorCount: 64,
44391
+ quality: 5,
44392
+ filters: []
44393
+ };
44394
+ var Vibrant = _Vibrant;
44395
+
44396
+ // ../../node_modules/.pnpm/node-vibrant@4.0.4/node_modules/node-vibrant/dist/esm/configs/config.js
44397
+ Vibrant.DefaultOpts.quantizer = "mmcq";
44398
+ Vibrant.DefaultOpts.generators = ["default"];
44399
+ Vibrant.DefaultOpts.filters = ["default"];
44400
+
44401
+ // ../../node_modules/.pnpm/node-vibrant@4.0.4/node_modules/node-vibrant/dist/esm/configs/browser.js
44402
+ Vibrant.DefaultOpts.ImageClass = BrowserImage;
44403
+
44404
+ // ../../node_modules/.pnpm/@vibrant+quantizer-mmcq@4.0.4/node_modules/@vibrant/quantizer-mmcq/dist/esm/vbox.js
44405
+ var SIGBITS = 5;
44406
+ var RSHIFT = 8 - SIGBITS;
44407
+ var VBox = class _VBox {
44408
+ constructor(r1, r2, g1, g2, b1, b2, histogram) {
44409
+ this.histogram = histogram;
44410
+ this._volume = -1;
44411
+ this._avg = null;
44412
+ this._count = -1;
44413
+ this.dimension = { r1, r2, g1, g2, b1, b2 };
44414
+ }
44415
+ static build(pixels) {
44416
+ const h = new Histogram(pixels, { sigBits: SIGBITS });
44417
+ const { rmin, rmax, gmin, gmax, bmin, bmax } = h;
44418
+ return new _VBox(rmin, rmax, gmin, gmax, bmin, bmax, h);
44419
+ }
44420
+ invalidate() {
44421
+ this._volume = this._count = -1;
44422
+ this._avg = null;
44423
+ }
44424
+ volume() {
44425
+ if (this._volume < 0) {
44426
+ const { r1, r2, g1, g2, b1, b2 } = this.dimension;
44427
+ this._volume = (r2 - r1 + 1) * (g2 - g1 + 1) * (b2 - b1 + 1);
44428
+ }
44429
+ return this._volume;
44430
+ }
44431
+ count() {
44432
+ if (this._count < 0) {
44433
+ const { hist, getColorIndex } = this.histogram;
44434
+ const { r1, r2, g1, g2, b1, b2 } = this.dimension;
44435
+ let c = 0;
44436
+ for (let r3 = r1; r3 <= r2; r3++) {
44437
+ for (let g = g1; g <= g2; g++) {
44438
+ for (let b = b1; b <= b2; b++) {
44439
+ const index = getColorIndex(r3, g, b);
44440
+ if (!hist[index]) {
44441
+ continue;
44442
+ }
44443
+ c += hist[index];
44444
+ }
44445
+ }
44446
+ }
44447
+ this._count = c;
44448
+ }
44449
+ return this._count;
44450
+ }
44451
+ clone() {
44452
+ const { histogram } = this;
44453
+ const { r1, r2, g1, g2, b1, b2 } = this.dimension;
44454
+ return new _VBox(r1, r2, g1, g2, b1, b2, histogram);
44455
+ }
44456
+ avg() {
44457
+ if (!this._avg) {
44458
+ const { hist, getColorIndex } = this.histogram;
44459
+ const { r1, r2, g1, g2, b1, b2 } = this.dimension;
44460
+ let ntot = 0;
44461
+ const mult = 1 << 8 - SIGBITS;
44462
+ let rsum;
44463
+ let gsum;
44464
+ let bsum;
44465
+ rsum = gsum = bsum = 0;
44466
+ for (let r3 = r1; r3 <= r2; r3++) {
44467
+ for (let g = g1; g <= g2; g++) {
44468
+ for (let b = b1; b <= b2; b++) {
44469
+ const index = getColorIndex(r3, g, b);
44470
+ const h = hist[index];
44471
+ if (!h) continue;
44472
+ ntot += h;
44473
+ rsum += h * (r3 + 0.5) * mult;
44474
+ gsum += h * (g + 0.5) * mult;
44475
+ bsum += h * (b + 0.5) * mult;
44476
+ }
44477
+ }
44478
+ }
44479
+ if (ntot) {
44480
+ this._avg = [~~(rsum / ntot), ~~(gsum / ntot), ~~(bsum / ntot)];
44481
+ } else {
44482
+ this._avg = [
44483
+ ~~(mult * (r1 + r2 + 1) / 2),
44484
+ ~~(mult * (g1 + g2 + 1) / 2),
44485
+ ~~(mult * (b1 + b2 + 1) / 2)
44486
+ ];
44487
+ }
44488
+ }
44489
+ return this._avg;
44490
+ }
44491
+ contains(rgb) {
44492
+ let [r2, g, b] = rgb;
44493
+ const { r1, r2: r22, g1, g2, b1, b2 } = this.dimension;
44494
+ r2 >>= RSHIFT;
44495
+ g >>= RSHIFT;
44496
+ b >>= RSHIFT;
44497
+ return r2 >= r1 && r2 <= r22 && g >= g1 && g <= g2 && b >= b1 && b <= b2;
44498
+ }
44499
+ split() {
44500
+ const { hist, getColorIndex } = this.histogram;
44501
+ const { r1, r2, g1, g2, b1, b2 } = this.dimension;
44502
+ const count = this.count();
44503
+ if (!count) return [];
44504
+ if (count === 1) return [this.clone()];
44505
+ const rw = r2 - r1 + 1;
44506
+ const gw = g2 - g1 + 1;
44507
+ const bw = b2 - b1 + 1;
44508
+ const maxw = Math.max(rw, gw, bw);
44509
+ let accSum = null;
44510
+ let sum;
44511
+ let total;
44512
+ sum = total = 0;
44513
+ let maxd = null;
44514
+ if (maxw === rw) {
44515
+ maxd = "r";
44516
+ accSum = new Uint32Array(r2 + 1);
44517
+ for (let r3 = r1; r3 <= r2; r3++) {
44518
+ sum = 0;
44519
+ for (let g = g1; g <= g2; g++) {
44520
+ for (let b = b1; b <= b2; b++) {
44521
+ const index = getColorIndex(r3, g, b);
44522
+ if (!hist[index]) continue;
44523
+ sum += hist[index];
44524
+ }
44525
+ }
44526
+ total += sum;
44527
+ accSum[r3] = total;
44528
+ }
44529
+ } else if (maxw === gw) {
44530
+ maxd = "g";
44531
+ accSum = new Uint32Array(g2 + 1);
44532
+ for (let g = g1; g <= g2; g++) {
44533
+ sum = 0;
44534
+ for (let r3 = r1; r3 <= r2; r3++) {
44535
+ for (let b = b1; b <= b2; b++) {
44536
+ const index = getColorIndex(r3, g, b);
44537
+ if (!hist[index]) continue;
44538
+ sum += hist[index];
44539
+ }
44540
+ }
44541
+ total += sum;
44542
+ accSum[g] = total;
44543
+ }
44544
+ } else {
44545
+ maxd = "b";
44546
+ accSum = new Uint32Array(b2 + 1);
44547
+ for (let b = b1; b <= b2; b++) {
44548
+ sum = 0;
44549
+ for (let r3 = r1; r3 <= r2; r3++) {
44550
+ for (let g = g1; g <= g2; g++) {
44551
+ const index = getColorIndex(r3, g, b);
44552
+ if (!hist[index]) continue;
44553
+ sum += hist[index];
44554
+ }
44555
+ }
44556
+ total += sum;
44557
+ accSum[b] = total;
44558
+ }
44559
+ }
44560
+ let splitPoint = -1;
44561
+ const reverseSum = new Uint32Array(accSum.length);
44562
+ for (let i = 0; i < accSum.length; i++) {
44563
+ const d = accSum[i];
44564
+ if (!d) continue;
44565
+ if (splitPoint < 0 && d > total / 2) splitPoint = i;
44566
+ reverseSum[i] = total - d;
44567
+ }
44568
+ const vbox = this;
44569
+ function doCut(d) {
44570
+ const dim1 = d + "1";
44571
+ const dim2 = d + "2";
44572
+ const d1 = vbox.dimension[dim1];
44573
+ let d2 = vbox.dimension[dim2];
44574
+ const vbox1 = vbox.clone();
44575
+ const vbox2 = vbox.clone();
44576
+ const left = splitPoint - d1;
44577
+ const right = d2 - splitPoint;
44578
+ if (left <= right) {
44579
+ d2 = Math.min(d2 - 1, ~~(splitPoint + right / 2));
44580
+ d2 = Math.max(0, d2);
44581
+ } else {
44582
+ d2 = Math.max(d1, ~~(splitPoint - 1 - left / 2));
44583
+ d2 = Math.min(vbox.dimension[dim2], d2);
44584
+ }
44585
+ while (!accSum[d2]) d2++;
44586
+ let c2 = reverseSum[d2];
44587
+ while (!c2 && accSum[d2 - 1]) c2 = reverseSum[--d2];
44588
+ vbox1.dimension[dim2] = d2;
44589
+ vbox2.dimension[dim1] = d2 + 1;
44590
+ return [vbox1, vbox2];
44591
+ }
44592
+ return doCut(maxd);
44593
+ }
44594
+ };
44595
+
44596
+ // ../../node_modules/.pnpm/@vibrant+quantizer-mmcq@4.0.4/node_modules/@vibrant/quantizer-mmcq/dist/esm/pqueue.js
44597
+ var PQueue = class {
44598
+ _sort() {
44599
+ if (!this._sorted) {
44600
+ this.contents.sort(this._comparator);
44601
+ this._sorted = true;
44602
+ }
44603
+ }
44604
+ constructor(comparator) {
44605
+ this._comparator = comparator;
44606
+ this.contents = [];
44607
+ this._sorted = false;
44608
+ }
44609
+ push(item) {
44610
+ this.contents.push(item);
44611
+ this._sorted = false;
44612
+ }
44613
+ peek(index) {
44614
+ this._sort();
44615
+ index = typeof index === "number" ? index : this.contents.length - 1;
44616
+ return this.contents[index];
44617
+ }
44618
+ pop() {
44619
+ this._sort();
44620
+ return this.contents.pop();
44621
+ }
44622
+ size() {
44623
+ return this.contents.length;
44624
+ }
44625
+ map(mapper) {
44626
+ this._sort();
44627
+ return this.contents.map(mapper);
44628
+ }
44629
+ };
44630
+
44631
+ // ../../node_modules/.pnpm/@vibrant+quantizer-mmcq@4.0.4/node_modules/@vibrant/quantizer-mmcq/dist/esm/index.js
44632
+ var fractByPopulations = 0.75;
44633
+ function _splitBoxes(pq, target) {
44634
+ let lastSize = pq.size();
44635
+ while (pq.size() < target) {
44636
+ const vbox = pq.pop();
44637
+ if (vbox && vbox.count() > 0) {
44638
+ const [vbox1, vbox2] = vbox.split();
44639
+ if (!vbox1) break;
44640
+ pq.push(vbox1);
44641
+ if (vbox2 && vbox2.count() > 0) pq.push(vbox2);
44642
+ if (pq.size() === lastSize) {
44643
+ break;
44644
+ } else {
44645
+ lastSize = pq.size();
44646
+ }
44647
+ } else {
44648
+ break;
44649
+ }
44650
+ }
44651
+ }
44652
+ var MMCQ = (pixels, opts) => {
44653
+ if (pixels.length === 0 || opts.colorCount < 2 || opts.colorCount > 256) {
44654
+ throw new Error("Wrong MMCQ parameters");
44655
+ }
44656
+ const vbox = VBox.build(pixels);
44657
+ vbox.histogram.colorCount;
44658
+ const pq = new PQueue((a, b) => a.count() - b.count());
44659
+ pq.push(vbox);
44660
+ _splitBoxes(pq, fractByPopulations * opts.colorCount);
44661
+ const pq2 = new PQueue(
44662
+ (a, b) => a.count() * a.volume() - b.count() * b.volume()
44663
+ );
44664
+ pq2.contents = pq.contents;
44665
+ _splitBoxes(pq2, opts.colorCount - pq2.size());
44666
+ return generateSwatches(pq2);
44667
+ };
44668
+ function generateSwatches(pq) {
44669
+ const swatches = [];
44670
+ while (pq.size()) {
44671
+ const v = pq.pop();
44672
+ const color = v.avg();
44673
+ const [r2, g, b] = color;
44674
+ swatches.push(new Swatch2(color, v.count()));
44675
+ }
44676
+ return swatches;
44677
+ }
44678
+
44679
+ // ../../node_modules/.pnpm/@vibrant+generator-default@4.0.4/node_modules/@vibrant/generator-default/dist/esm/index.js
44680
+ var DefaultOpts = {
44681
+ targetDarkLuma: 0.26,
44682
+ maxDarkLuma: 0.45,
44683
+ minLightLuma: 0.55,
44684
+ targetLightLuma: 0.74,
44685
+ minNormalLuma: 0.3,
44686
+ targetNormalLuma: 0.5,
44687
+ maxNormalLuma: 0.7,
44688
+ targetMutesSaturation: 0.3,
44689
+ maxMutesSaturation: 0.4,
44690
+ targetVibrantSaturation: 1,
44691
+ minVibrantSaturation: 0.35,
44692
+ weightSaturation: 3,
44693
+ weightLuma: 6.5,
44694
+ weightPopulation: 0.5
44695
+ };
44696
+ function _findMaxPopulation(swatches) {
44697
+ let p = 0;
44698
+ swatches.forEach((s) => {
44699
+ p = Math.max(p, s.population);
44700
+ });
44701
+ return p;
44702
+ }
44703
+ function _isAlreadySelected(palette, s) {
44704
+ return palette.Vibrant === s || palette.DarkVibrant === s || palette.LightVibrant === s || palette.Muted === s || palette.DarkMuted === s || palette.LightMuted === s;
44705
+ }
44706
+ function _createComparisonValue(saturation, targetSaturation, luma, targetLuma, population, maxPopulation, opts) {
44707
+ function weightedMean(...values) {
44708
+ let sum = 0;
44709
+ let weightSum = 0;
44710
+ for (let i = 0; i < values.length; i += 2) {
44711
+ const value = values[i];
44712
+ const weight = values[i + 1];
44713
+ if (!value || !weight) continue;
44714
+ sum += value * weight;
44715
+ weightSum += weight;
44716
+ }
44717
+ return sum / weightSum;
44718
+ }
44719
+ function invertDiff(value, targetValue) {
44720
+ return 1 - Math.abs(value - targetValue);
44721
+ }
44722
+ return weightedMean(
44723
+ invertDiff(saturation, targetSaturation),
44724
+ opts.weightSaturation,
44725
+ invertDiff(luma, targetLuma),
44726
+ opts.weightLuma,
44727
+ population / maxPopulation,
44728
+ opts.weightPopulation
44729
+ );
44730
+ }
44731
+ function _findColorVariation(palette, swatches, maxPopulation, targetLuma, minLuma, maxLuma, targetSaturation, minSaturation, maxSaturation, opts) {
44732
+ let max = null;
44733
+ let maxValue = 0;
44734
+ swatches.forEach((swatch) => {
44735
+ const [, s, l] = swatch.hsl;
44736
+ if (s >= minSaturation && s <= maxSaturation && l >= minLuma && l <= maxLuma && !_isAlreadySelected(palette, swatch)) {
44737
+ const value = _createComparisonValue(
44738
+ s,
44739
+ targetSaturation,
44740
+ l,
44741
+ targetLuma,
44742
+ swatch.population,
44743
+ maxPopulation,
44744
+ opts
44745
+ );
44746
+ if (max === null || value > maxValue) {
44747
+ max = swatch;
44748
+ maxValue = value;
44749
+ }
44750
+ }
44751
+ });
44752
+ return max;
44753
+ }
44754
+ function _generateVariationColors(swatches, maxPopulation, opts) {
44755
+ const palette = {
44756
+ Vibrant: null,
44757
+ DarkVibrant: null,
44758
+ LightVibrant: null,
44759
+ Muted: null,
44760
+ DarkMuted: null,
44761
+ LightMuted: null
44762
+ };
44763
+ palette.Vibrant = _findColorVariation(
44764
+ palette,
44765
+ swatches,
44766
+ maxPopulation,
44767
+ opts.targetNormalLuma,
44768
+ opts.minNormalLuma,
44769
+ opts.maxNormalLuma,
44770
+ opts.targetVibrantSaturation,
44771
+ opts.minVibrantSaturation,
44772
+ 1,
44773
+ opts
44774
+ );
44775
+ palette.LightVibrant = _findColorVariation(
44776
+ palette,
44777
+ swatches,
44778
+ maxPopulation,
44779
+ opts.targetLightLuma,
44780
+ opts.minLightLuma,
44781
+ 1,
44782
+ opts.targetVibrantSaturation,
44783
+ opts.minVibrantSaturation,
44784
+ 1,
44785
+ opts
44786
+ );
44787
+ palette.DarkVibrant = _findColorVariation(
44788
+ palette,
44789
+ swatches,
44790
+ maxPopulation,
44791
+ opts.targetDarkLuma,
44792
+ 0,
44793
+ opts.maxDarkLuma,
44794
+ opts.targetVibrantSaturation,
44795
+ opts.minVibrantSaturation,
44796
+ 1,
44797
+ opts
44798
+ );
44799
+ palette.Muted = _findColorVariation(
44800
+ palette,
44801
+ swatches,
44802
+ maxPopulation,
44803
+ opts.targetNormalLuma,
44804
+ opts.minNormalLuma,
44805
+ opts.maxNormalLuma,
44806
+ opts.targetMutesSaturation,
44807
+ 0,
44808
+ opts.maxMutesSaturation,
44809
+ opts
44810
+ );
44811
+ palette.LightMuted = _findColorVariation(
44812
+ palette,
44813
+ swatches,
44814
+ maxPopulation,
44815
+ opts.targetLightLuma,
44816
+ opts.minLightLuma,
44817
+ 1,
44818
+ opts.targetMutesSaturation,
44819
+ 0,
44820
+ opts.maxMutesSaturation,
44821
+ opts
44822
+ );
44823
+ palette.DarkMuted = _findColorVariation(
44824
+ palette,
44825
+ swatches,
44826
+ maxPopulation,
44827
+ opts.targetDarkLuma,
44828
+ 0,
44829
+ opts.maxDarkLuma,
44830
+ opts.targetMutesSaturation,
44831
+ 0,
44832
+ opts.maxMutesSaturation,
44833
+ opts
44834
+ );
44835
+ return palette;
44836
+ }
44837
+ function _generateEmptySwatches(palette, _maxPopulation, opts) {
44838
+ if (!palette.Vibrant && !palette.DarkVibrant && !palette.LightVibrant) {
44839
+ if (!palette.DarkVibrant && palette.DarkMuted) {
44840
+ let [h, s, l] = palette.DarkMuted.hsl;
44841
+ l = opts.targetDarkLuma;
44842
+ palette.DarkVibrant = new Swatch2(hslToRgb(h, s, l), 0);
44843
+ }
44844
+ if (!palette.LightVibrant && palette.LightMuted) {
44845
+ let [h, s, l] = palette.LightMuted.hsl;
44846
+ l = opts.targetDarkLuma;
44847
+ palette.DarkVibrant = new Swatch2(hslToRgb(h, s, l), 0);
44848
+ }
44849
+ }
44850
+ if (!palette.Vibrant && palette.DarkVibrant) {
44851
+ let [h, s, l] = palette.DarkVibrant.hsl;
44852
+ l = opts.targetNormalLuma;
44853
+ palette.Vibrant = new Swatch2(hslToRgb(h, s, l), 0);
44854
+ } else if (!palette.Vibrant && palette.LightVibrant) {
44855
+ let [h, s, l] = palette.LightVibrant.hsl;
44856
+ l = opts.targetNormalLuma;
44857
+ palette.Vibrant = new Swatch2(hslToRgb(h, s, l), 0);
44858
+ }
44859
+ if (!palette.DarkVibrant && palette.Vibrant) {
44860
+ let [h, s, l] = palette.Vibrant.hsl;
44861
+ l = opts.targetDarkLuma;
44862
+ palette.DarkVibrant = new Swatch2(hslToRgb(h, s, l), 0);
44863
+ }
44864
+ if (!palette.LightVibrant && palette.Vibrant) {
44865
+ let [h, s, l] = palette.Vibrant.hsl;
44866
+ l = opts.targetLightLuma;
44867
+ palette.LightVibrant = new Swatch2(hslToRgb(h, s, l), 0);
44868
+ }
44869
+ if (!palette.Muted && palette.Vibrant) {
44870
+ let [h, s, l] = palette.Vibrant.hsl;
44871
+ l = opts.targetMutesSaturation;
44872
+ palette.Muted = new Swatch2(hslToRgb(h, s, l), 0);
44873
+ }
44874
+ if (!palette.DarkMuted && palette.DarkVibrant) {
44875
+ let [h, s, l] = palette.DarkVibrant.hsl;
44876
+ l = opts.targetMutesSaturation;
44877
+ palette.DarkMuted = new Swatch2(hslToRgb(h, s, l), 0);
44878
+ }
44879
+ if (!palette.LightMuted && palette.LightVibrant) {
44880
+ let [h, s, l] = palette.LightVibrant.hsl;
44881
+ l = opts.targetMutesSaturation;
44882
+ palette.LightMuted = new Swatch2(hslToRgb(h, s, l), 0);
44883
+ }
44884
+ }
44885
+ var DefaultGenerator = ((swatches, opts) => {
44886
+ opts = Object.assign({}, DefaultOpts, opts);
44887
+ const maxPopulation = _findMaxPopulation(swatches);
44888
+ const palette = _generateVariationColors(swatches, maxPopulation, opts);
44889
+ _generateEmptySwatches(palette, maxPopulation, opts);
44890
+ return palette;
44891
+ });
44892
+
44893
+ // ../../node_modules/.pnpm/node-vibrant@4.0.4/node_modules/node-vibrant/dist/esm/pipeline/index.js
44894
+ var pipeline = new BasicPipeline().filter.register(
44895
+ "default",
44896
+ (r2, g, b, a) => a >= 125 && !(r2 > 250 && g > 250 && b > 250)
44897
+ ).quantizer.register("mmcq", MMCQ).generator.register("default", DefaultGenerator);
44898
+
44899
+ // ../../node_modules/.pnpm/node-vibrant@4.0.4/node_modules/node-vibrant/dist/esm/browser.js
44900
+ Vibrant.use(pipeline);
44901
+
44902
+ // ../blocks/src/system/runtime/bindings.ts
44903
+ var shouldLogWarnings = isNonProductionEnv();
44904
+ function isPlainObject4(value) {
44905
+ return typeof value === "object" && value !== null && !Array.isArray(value);
44906
+ }
44907
+ function isRouteMapEntry(value) {
44908
+ if (typeof value === "string") return true;
44909
+ return isPlainObject4(value);
44910
+ }
44911
+ function isRouteMap(value) {
44912
+ if (!isPlainObject4(value)) return false;
44913
+ return Object.values(value).every(isRouteMapEntry);
44914
+ }
44915
+ function isPageIdentifierMap(value) {
44916
+ if (!isPlainObject4(value)) return false;
44917
+ return Object.values(value).every((v) => typeof v === "string");
44918
+ }
44919
+ function isEntryIdentifierMap(value) {
44920
+ if (!isPlainObject4(value)) return false;
44921
+ for (const v of Object.values(value)) {
44922
+ if (!isPlainObject4(v)) return false;
44923
+ if (!Object.values(v).every((inner) => typeof inner === "string")) return false;
44924
+ }
44925
+ return true;
44926
+ }
44927
+ function buildTransformContext(vm) {
44928
+ const root = vm.$root;
44929
+ const stage = root && isPlainObject4(root) && root.previewStage === "preview" ? "preview" : "published";
44930
+ const routes = root && isPlainObject4(root) && isRouteMap(root.routes) ? root.routes : void 0;
44931
+ const pagesByIdentifier = root && isPlainObject4(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
44932
+ const entriesByIdentifier = root && isPlainObject4(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
44933
+ return {
44934
+ theme: defaultThemeTokens,
44935
+ stage,
44936
+ data: vm.content,
44937
+ routes,
44938
+ pagesByIdentifier,
44939
+ entriesByIdentifier
44940
+ };
44941
+ }
44942
+ function resolveParamsBindings(input, vm, meta) {
44943
+ if (input === null || typeof input !== "object") return input;
44944
+ if (Array.isArray(input)) return input.map((v) => resolveParamsBindings(v, vm, meta));
44945
+ const inputRecord = input;
44946
+ const maybeBind = inputRecord.$bind;
44947
+ if (maybeBind && typeof maybeBind === "object") {
44948
+ try {
44949
+ const binding = bindingSchema.parse(maybeBind);
44950
+ const value = resolveBinding(binding.from, vm);
44951
+ const resolved = value === void 0 || value === null ? binding.fallback : runTransforms(value, binding.transforms, buildTransformContext(vm), defaultTransforms);
44952
+ if (resolved === void 0 || resolved === null || resolved === "") {
44953
+ return binding.fallback;
44954
+ }
44955
+ return resolved;
44956
+ } catch (err2) {
44957
+ if (shouldLogWarnings) {
44958
+ console.warn(
44959
+ `bindings: failed to parse loader param binding for block "${meta?.blockKind ?? "unknown"}"`,
44960
+ err2
44961
+ );
44962
+ }
44963
+ return void 0;
44964
+ }
44965
+ }
44966
+ const out = {};
44967
+ for (const [k, v] of Object.entries(input)) {
44968
+ out[k] = resolveParamsBindings(v, vm, meta);
44969
+ }
44970
+ return out;
44971
+ }
44972
+ function resolveBinding(path, vm) {
44973
+ const segments = splitPath2(path);
44974
+ if (!segments.length) return void 0;
44975
+ const [first, ...rest] = segments;
44976
+ let source = vm;
44977
+ if (first === "$root") {
44978
+ source = vm;
44979
+ return readFromSource2(source, [first, ...rest]);
44980
+ }
44981
+ if (first === "content") {
44982
+ source = vm.content;
44983
+ return readFromSource2(source, rest);
44984
+ }
44985
+ const contentResult = readFromSource2(vm.content, segments);
44986
+ if (contentResult !== void 0) {
44987
+ return contentResult;
44988
+ }
44989
+ return readFromSource2(vm, segments);
44990
+ }
44991
+ function splitPath2(path) {
44992
+ const PATH_SEPARATOR_REGEX2 = /\./g;
44993
+ const BRACKET_ACCESS_REGEX2 = /\[(?<token>[^\]]+)\]/g;
44994
+ const segments = [];
44995
+ const parts = path.split(PATH_SEPARATOR_REGEX2);
44996
+ for (const raw of parts) {
44997
+ if (!raw) continue;
44998
+ const baseMatch = raw.match(/^([^\[]+)/);
44999
+ if (baseMatch && baseMatch[1]) {
45000
+ segments.push(baseMatch[1]);
45001
+ }
45002
+ const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX2);
45003
+ for (const match of bracketMatches) {
45004
+ const token = match.groups?.token ?? "";
45005
+ if (token.startsWith('"') || token.startsWith("'")) {
45006
+ segments.push(token.slice(1, -1));
45007
+ } else if (/^\d+$/.test(token)) {
45008
+ segments.push(Number(token));
45009
+ } else {
45010
+ segments.push(token);
45011
+ }
45012
+ }
45013
+ if (!baseMatch && !raw.includes("[")) {
45014
+ segments.push(raw);
45015
+ }
45016
+ }
45017
+ return segments;
45018
+ }
45019
+ function readFromSource2(source, segments) {
45020
+ return segments.reduce((current, segment) => {
45021
+ if (current === void 0 || current === null) return void 0;
45022
+ if (typeof segment === "number") {
45023
+ if (Array.isArray(current)) return current[segment];
45024
+ return void 0;
45025
+ }
45026
+ if (typeof current === "object" && current !== null && segment in current) {
45027
+ return current[segment];
45028
+ }
45029
+ return void 0;
45030
+ }, source);
45031
+ }
45032
+ function isNonProductionEnv() {
45033
+ if (typeof globalThis === "undefined") {
45034
+ return true;
45035
+ }
45036
+ const maybeProcess = globalThis.process;
45037
+ const nodeEnv = maybeProcess?.env?.NODE_ENV;
45038
+ return nodeEnv !== "production";
45039
+ }
45040
+
45041
+ // ../blocks/src/system/data/utils.ts
45042
+ function normalizeDataLoaders(def) {
45043
+ if (!def?.dataLoaders) {
45044
+ return [];
45045
+ }
45046
+ return Object.entries(def.dataLoaders).map(([key, loader]) => ({ key, loader }));
45047
+ }
45048
+ function normalizeContent(block) {
45049
+ const source = block.draftContent ?? block.content ?? block.publishedContent ?? {};
45050
+ if (!isObjectRecord(source)) return {};
45051
+ if ("data" in source) {
45052
+ const data = source.data;
45053
+ if (isObjectRecord(data)) {
45054
+ return data;
45055
+ }
45056
+ if (data === null || data === void 0) {
45057
+ return {};
45058
+ }
45059
+ }
45060
+ return source;
45061
+ }
45062
+ function normalizeParams(input) {
45063
+ if (!input || typeof input !== "object") return {};
45064
+ const entries = Object.entries(input).map(([key, value]) => [
45065
+ key,
45066
+ coerceToString(value)
45067
+ ]);
45068
+ return Object.fromEntries(entries);
45069
+ }
45070
+ function isNonArrayObject(value) {
45071
+ return typeof value === "object" && value !== null && !Array.isArray(value);
45072
+ }
45073
+ function safeJsonStringify(value) {
45074
+ try {
45075
+ return JSON.stringify(value);
45076
+ } catch {
45077
+ return void 0;
45078
+ }
45079
+ }
45080
+ function coerceToString(value) {
45081
+ if (value === null || value === void 0) return "";
45082
+ if (Array.isArray(value)) {
45083
+ if (value.some(isNonArrayObject)) {
45084
+ const json = safeJsonStringify(value);
45085
+ if (typeof json === "string") return json;
45086
+ }
45087
+ return value.map(coerceToString).join(",");
45088
+ }
45089
+ if (isNonArrayObject(value)) {
45090
+ const json = safeJsonStringify(value);
45091
+ if (typeof json === "string") return json;
45092
+ }
45093
+ return String(value);
45094
+ }
45095
+ function coercePayload(payload) {
45096
+ if (payload && typeof payload === "object" && !Array.isArray(payload)) {
45097
+ const record = payload;
45098
+ if ("data" in record && typeof record.data !== "function") return record.data;
45099
+ if ("form" in record && typeof record.form !== "function") return record.form;
45100
+ if ("entries" in record && typeof record.entries !== "function") return record.entries;
45101
+ if ("services" in record && typeof record.services !== "function") return record.services;
45102
+ }
45103
+ return payload;
45104
+ }
45105
+
45106
+ // ../blocks/src/system/data/prefetchBlockData.ts
45107
+ async function prefetchBlockData(page, context, options) {
45108
+ const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders } = options;
45109
+ const results = {};
45110
+ const tasks = [];
45111
+ for (const block of page.blocks) {
45112
+ const blockId = block.id;
45113
+ if (!blockId) continue;
45114
+ let loaders;
45115
+ const def = getBlockDefinition(block.kind);
45116
+ if (def) {
45117
+ loaders = normalizeDataLoaders(def);
45118
+ } else if (getCustomBlockLoaders) {
45119
+ const customLoaders = getCustomBlockLoaders(block.kind);
45120
+ loaders = customLoaders ? Object.entries(customLoaders).map(([key, loader]) => ({ key, loader })) : [];
45121
+ } else {
45122
+ loaders = [];
45123
+ }
45124
+ if (loaders.length === 0) continue;
45125
+ const root = {
45126
+ ...context.root ?? {},
45127
+ siteId: context.siteId,
45128
+ pageId: context.pageId,
45129
+ previewStage: context.previewStage
45130
+ };
45131
+ const normalizedContent = normalizeContent(block);
45132
+ const vm = { content: normalizedContent, $root: root };
45133
+ for (const { key, loader } of loaders) {
45134
+ if (loader.mode === "client") {
45135
+ continue;
45136
+ }
45137
+ if (typeof loader.when !== "undefined") {
45138
+ const resolvedWhen = resolveParamsBindings(loader.when, vm, {
45139
+ blockKind: block.kind
45140
+ });
45141
+ if (resolvedWhen !== true) {
45142
+ continue;
45143
+ }
45144
+ }
45145
+ const rawParams = resolveParamsBindings(loader.params, vm, {
45146
+ blockKind: block.kind
45147
+ });
45148
+ const params = normalizeParams(rawParams);
45149
+ const endpoint = loader.endpoint;
45150
+ if (isValidEndpoint && !isValidEndpoint(endpoint)) {
45151
+ continue;
45152
+ }
45153
+ tasks.push(
45154
+ (async () => {
45155
+ try {
45156
+ const payload = await apiClient({ endpoint, params });
45157
+ const data = coercePayload(payload);
45158
+ const blockResults = results[blockId] ?? (results[blockId] = {});
45159
+ blockResults[key] = data;
45160
+ } catch (error) {
45161
+ if (onError) {
45162
+ onError(error, { block: block.kind, loader: key });
45163
+ }
45164
+ }
45165
+ })()
45166
+ );
45167
+ }
45168
+ }
45169
+ if (tasks.length > 0) {
45170
+ await Promise.all(tasks);
45171
+ }
45172
+ return results;
45173
+ }
45174
+
45175
+ // ../blocks/src/system/data/loaderEndpoints.ts
45176
+ var SUPPORTED_LOADER_ENDPOINTS = [
45177
+ "listPublishedEntries",
45178
+ "getPublishedEntryPreview",
45179
+ "listPublicEvents",
45180
+ "getPublicEventDetails",
45181
+ "listPublicCourses",
45182
+ "listPublicProducts",
45183
+ "listPublicPasses",
45184
+ "listPublicMemberships",
45185
+ "getPublicFormById",
45186
+ "getPublicBookingServices"
45187
+ ];
45188
+
45189
+ // ../blocks/src/system/data/normalizeLoaderParams.ts
45190
+ function toStringParams(value) {
45191
+ if (!isObjectRecord(value)) return {};
45192
+ const out = {};
45193
+ for (const [k, v] of Object.entries(value)) {
45194
+ if (typeof v === "string") out[k] = v;
45195
+ }
45196
+ return out;
45197
+ }
45198
+ function stripEmptyStringValues(params) {
45199
+ for (const [key, value] of Object.entries(params)) {
45200
+ if (value === "") {
45201
+ delete params[key];
45202
+ }
45203
+ }
45204
+ }
45205
+ function ensureSiteId(params, context) {
45206
+ if (!params.siteId && typeof context.siteId === "string" && context.siteId) {
45207
+ params.siteId = context.siteId;
45208
+ }
45209
+ }
45210
+ function normalizeLoaderParams(endpoint, params, context) {
45211
+ const out = toStringParams(params);
45212
+ stripEmptyStringValues(out);
45213
+ if (endpoint === "getPublicFormById") {
45214
+ ensureSiteId(out, context);
45215
+ if (!out.formId && out.formSlug) {
45216
+ out.formId = out.formSlug;
45217
+ delete out.formSlug;
45218
+ }
45219
+ return out;
45220
+ }
45221
+ if (endpoint === "getPublicBookingServices") {
45222
+ ensureSiteId(out, context);
45223
+ return out;
45224
+ }
45225
+ if (endpoint === "listPublicEvents") {
45226
+ ensureSiteId(out, context);
45227
+ return out;
45228
+ }
45229
+ if (endpoint === "getPublicEventDetails") {
45230
+ ensureSiteId(out, context);
45231
+ return out;
45232
+ }
45233
+ if (endpoint === "listPublicProducts") {
45234
+ ensureSiteId(out, context);
45235
+ return out;
45236
+ }
45237
+ if (endpoint === "getPublishedEntryPreview") {
45238
+ ensureSiteId(out, context);
45239
+ return out;
45240
+ }
45241
+ ensureSiteId(out, context);
45242
+ return out;
45243
+ }
45244
+
43347
45245
  // ../api/src/cache-tags.ts
43348
45246
  var TAG_TEMPLATES = {
43349
45247
  siteCollection: "riverbank:site",
@@ -44369,7 +46267,7 @@ var ENDPOINT_DEFINITIONS = {
44369
46267
  responseKind: "void"
44370
46268
  },
44371
46269
  googleCalendarCallback: {
44372
- path: "/sites/{siteId}/bookings/calendar/google/callback",
46270
+ path: "/bookings/calendar/google/callback",
44373
46271
  method: "GET",
44374
46272
  auth: "user",
44375
46273
  responseKind: "void"
@@ -48927,22 +50825,6 @@ var navigationLinkInputSchema = z56.discriminatedUnion(
48927
50825
 
48928
50826
  // ../api/src/sdkConfig/contracts.ts
48929
50827
  import { z as z57 } from "zod";
48930
-
48931
- // ../blocks/src/system/data/loaderEndpoints.ts
48932
- var SUPPORTED_LOADER_ENDPOINTS = [
48933
- "listPublishedEntries",
48934
- "getPublishedEntryPreview",
48935
- "listPublicEvents",
48936
- "getPublicEventDetails",
48937
- "listPublicCourses",
48938
- "listPublicProducts",
48939
- "listPublicPasses",
48940
- "listPublicMemberships",
48941
- "getPublicFormById",
48942
- "getPublicBookingServices"
48943
- ];
48944
-
48945
- // ../api/src/sdkConfig/contracts.ts
48946
50828
  function unsafeRetypeZodSchema(schema) {
48947
50829
  return schema;
48948
50830
  }
@@ -49815,335 +51697,6 @@ var MultiPageUpdateResponse = z61.object({
49815
51697
  toolCallsUsed: z61.number()
49816
51698
  });
49817
51699
 
49818
- // ../blocks/src/system/runtime/bindings.ts
49819
- var shouldLogWarnings = isNonProductionEnv();
49820
- function isPlainObject4(value) {
49821
- return typeof value === "object" && value !== null && !Array.isArray(value);
49822
- }
49823
- function isRouteMapEntry(value) {
49824
- if (typeof value === "string") return true;
49825
- return isPlainObject4(value);
49826
- }
49827
- function isRouteMap(value) {
49828
- if (!isPlainObject4(value)) return false;
49829
- return Object.values(value).every(isRouteMapEntry);
49830
- }
49831
- function isPageIdentifierMap(value) {
49832
- if (!isPlainObject4(value)) return false;
49833
- return Object.values(value).every((v) => typeof v === "string");
49834
- }
49835
- function isEntryIdentifierMap(value) {
49836
- if (!isPlainObject4(value)) return false;
49837
- for (const v of Object.values(value)) {
49838
- if (!isPlainObject4(v)) return false;
49839
- if (!Object.values(v).every((inner) => typeof inner === "string")) return false;
49840
- }
49841
- return true;
49842
- }
49843
- function buildTransformContext(vm) {
49844
- const root = vm.$root;
49845
- const stage = root && isPlainObject4(root) && root.previewStage === "preview" ? "preview" : "published";
49846
- const routes = root && isPlainObject4(root) && isRouteMap(root.routes) ? root.routes : void 0;
49847
- const pagesByIdentifier = root && isPlainObject4(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
49848
- const entriesByIdentifier = root && isPlainObject4(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
49849
- return {
49850
- theme: defaultThemeTokens,
49851
- stage,
49852
- data: vm.content,
49853
- routes,
49854
- pagesByIdentifier,
49855
- entriesByIdentifier
49856
- };
49857
- }
49858
- function resolveParamsBindings(input, vm, meta) {
49859
- if (input === null || typeof input !== "object") return input;
49860
- if (Array.isArray(input)) return input.map((v) => resolveParamsBindings(v, vm, meta));
49861
- const inputRecord = input;
49862
- const maybeBind = inputRecord.$bind;
49863
- if (maybeBind && typeof maybeBind === "object") {
49864
- try {
49865
- const binding = bindingSchema.parse(maybeBind);
49866
- const value = resolveBinding(binding.from, vm);
49867
- const resolved = value === void 0 || value === null ? binding.fallback : runTransforms(value, binding.transforms, buildTransformContext(vm), defaultTransforms);
49868
- if (resolved === void 0 || resolved === null || resolved === "") {
49869
- return binding.fallback;
49870
- }
49871
- return resolved;
49872
- } catch (err2) {
49873
- if (shouldLogWarnings) {
49874
- console.warn(
49875
- `bindings: failed to parse loader param binding for block "${meta?.blockKind ?? "unknown"}"`,
49876
- err2
49877
- );
49878
- }
49879
- return void 0;
49880
- }
49881
- }
49882
- const out = {};
49883
- for (const [k, v] of Object.entries(input)) {
49884
- out[k] = resolveParamsBindings(v, vm, meta);
49885
- }
49886
- return out;
49887
- }
49888
- function resolveBinding(path, vm) {
49889
- const segments = splitPath2(path);
49890
- if (!segments.length) return void 0;
49891
- const [first, ...rest] = segments;
49892
- let source = vm;
49893
- if (first === "$root") {
49894
- source = vm;
49895
- return readFromSource2(source, [first, ...rest]);
49896
- }
49897
- if (first === "content") {
49898
- source = vm.content;
49899
- return readFromSource2(source, rest);
49900
- }
49901
- const contentResult = readFromSource2(vm.content, segments);
49902
- if (contentResult !== void 0) {
49903
- return contentResult;
49904
- }
49905
- return readFromSource2(vm, segments);
49906
- }
49907
- function splitPath2(path) {
49908
- const PATH_SEPARATOR_REGEX2 = /\./g;
49909
- const BRACKET_ACCESS_REGEX2 = /\[(?<token>[^\]]+)\]/g;
49910
- const segments = [];
49911
- const parts = path.split(PATH_SEPARATOR_REGEX2);
49912
- for (const raw of parts) {
49913
- if (!raw) continue;
49914
- const baseMatch = raw.match(/^([^\[]+)/);
49915
- if (baseMatch && baseMatch[1]) {
49916
- segments.push(baseMatch[1]);
49917
- }
49918
- const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX2);
49919
- for (const match of bracketMatches) {
49920
- const token = match.groups?.token ?? "";
49921
- if (token.startsWith('"') || token.startsWith("'")) {
49922
- segments.push(token.slice(1, -1));
49923
- } else if (/^\d+$/.test(token)) {
49924
- segments.push(Number(token));
49925
- } else {
49926
- segments.push(token);
49927
- }
49928
- }
49929
- if (!baseMatch && !raw.includes("[")) {
49930
- segments.push(raw);
49931
- }
49932
- }
49933
- return segments;
49934
- }
49935
- function readFromSource2(source, segments) {
49936
- return segments.reduce((current, segment) => {
49937
- if (current === void 0 || current === null) return void 0;
49938
- if (typeof segment === "number") {
49939
- if (Array.isArray(current)) return current[segment];
49940
- return void 0;
49941
- }
49942
- if (typeof current === "object" && current !== null && segment in current) {
49943
- return current[segment];
49944
- }
49945
- return void 0;
49946
- }, source);
49947
- }
49948
- function isNonProductionEnv() {
49949
- if (typeof globalThis === "undefined") {
49950
- return true;
49951
- }
49952
- const maybeProcess = globalThis.process;
49953
- const nodeEnv = maybeProcess?.env?.NODE_ENV;
49954
- return nodeEnv !== "production";
49955
- }
49956
-
49957
- // ../blocks/src/system/data/utils.ts
49958
- function normalizeDataLoaders(def) {
49959
- if (!def?.dataLoaders) {
49960
- return [];
49961
- }
49962
- return Object.entries(def.dataLoaders).map(([key, loader]) => ({ key, loader }));
49963
- }
49964
- function normalizeContent(block) {
49965
- const source = block.draftContent ?? block.content ?? block.publishedContent ?? {};
49966
- if (!isObjectRecord(source)) return {};
49967
- if ("data" in source) {
49968
- const data = source.data;
49969
- if (isObjectRecord(data)) {
49970
- return data;
49971
- }
49972
- if (data === null || data === void 0) {
49973
- return {};
49974
- }
49975
- }
49976
- return source;
49977
- }
49978
- function normalizeParams(input) {
49979
- if (!input || typeof input !== "object") return {};
49980
- const entries = Object.entries(input).map(([key, value]) => [
49981
- key,
49982
- coerceToString(value)
49983
- ]);
49984
- return Object.fromEntries(entries);
49985
- }
49986
- function isNonArrayObject(value) {
49987
- return typeof value === "object" && value !== null && !Array.isArray(value);
49988
- }
49989
- function safeJsonStringify(value) {
49990
- try {
49991
- return JSON.stringify(value);
49992
- } catch {
49993
- return void 0;
49994
- }
49995
- }
49996
- function coerceToString(value) {
49997
- if (value === null || value === void 0) return "";
49998
- if (Array.isArray(value)) {
49999
- if (value.some(isNonArrayObject)) {
50000
- const json = safeJsonStringify(value);
50001
- if (typeof json === "string") return json;
50002
- }
50003
- return value.map(coerceToString).join(",");
50004
- }
50005
- if (isNonArrayObject(value)) {
50006
- const json = safeJsonStringify(value);
50007
- if (typeof json === "string") return json;
50008
- }
50009
- return String(value);
50010
- }
50011
- function coercePayload(payload) {
50012
- if (payload && typeof payload === "object" && !Array.isArray(payload)) {
50013
- const record = payload;
50014
- if ("data" in record && typeof record.data !== "function") return record.data;
50015
- if ("form" in record && typeof record.form !== "function") return record.form;
50016
- if ("entries" in record && typeof record.entries !== "function") return record.entries;
50017
- if ("services" in record && typeof record.services !== "function") return record.services;
50018
- }
50019
- return payload;
50020
- }
50021
-
50022
- // ../blocks/src/system/data/prefetchBlockData.ts
50023
- async function prefetchBlockData(page, context, options) {
50024
- const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders } = options;
50025
- const results = {};
50026
- const tasks = [];
50027
- for (const block of page.blocks) {
50028
- const blockId = block.id;
50029
- if (!blockId) continue;
50030
- let loaders;
50031
- const def = getBlockDefinition(block.kind);
50032
- if (def) {
50033
- loaders = normalizeDataLoaders(def);
50034
- } else if (getCustomBlockLoaders) {
50035
- const customLoaders = getCustomBlockLoaders(block.kind);
50036
- loaders = customLoaders ? Object.entries(customLoaders).map(([key, loader]) => ({ key, loader })) : [];
50037
- } else {
50038
- loaders = [];
50039
- }
50040
- if (loaders.length === 0) continue;
50041
- const root = {
50042
- ...context.root ?? {},
50043
- siteId: context.siteId,
50044
- pageId: context.pageId,
50045
- previewStage: context.previewStage
50046
- };
50047
- const normalizedContent = normalizeContent(block);
50048
- const vm = { content: normalizedContent, $root: root };
50049
- for (const { key, loader } of loaders) {
50050
- if (loader.mode === "client") {
50051
- continue;
50052
- }
50053
- if (typeof loader.when !== "undefined") {
50054
- const resolvedWhen = resolveParamsBindings(loader.when, vm, {
50055
- blockKind: block.kind
50056
- });
50057
- if (resolvedWhen !== true) {
50058
- continue;
50059
- }
50060
- }
50061
- const rawParams = resolveParamsBindings(loader.params, vm, {
50062
- blockKind: block.kind
50063
- });
50064
- const params = normalizeParams(rawParams);
50065
- const endpoint = loader.endpoint;
50066
- if (isValidEndpoint && !isValidEndpoint(endpoint)) {
50067
- continue;
50068
- }
50069
- tasks.push(
50070
- (async () => {
50071
- try {
50072
- const payload = await apiClient({ endpoint, params });
50073
- const data = coercePayload(payload);
50074
- const blockResults = results[blockId] ?? (results[blockId] = {});
50075
- blockResults[key] = data;
50076
- } catch (error) {
50077
- if (onError) {
50078
- onError(error, { block: block.kind, loader: key });
50079
- }
50080
- }
50081
- })()
50082
- );
50083
- }
50084
- }
50085
- if (tasks.length > 0) {
50086
- await Promise.all(tasks);
50087
- }
50088
- return results;
50089
- }
50090
-
50091
- // ../blocks/src/system/data/normalizeLoaderParams.ts
50092
- function toStringParams(value) {
50093
- if (!isObjectRecord(value)) return {};
50094
- const out = {};
50095
- for (const [k, v] of Object.entries(value)) {
50096
- if (typeof v === "string") out[k] = v;
50097
- }
50098
- return out;
50099
- }
50100
- function stripEmptyStringValues(params) {
50101
- for (const [key, value] of Object.entries(params)) {
50102
- if (value === "") {
50103
- delete params[key];
50104
- }
50105
- }
50106
- }
50107
- function ensureSiteId(params, context) {
50108
- if (!params.siteId && typeof context.siteId === "string" && context.siteId) {
50109
- params.siteId = context.siteId;
50110
- }
50111
- }
50112
- function normalizeLoaderParams(endpoint, params, context) {
50113
- const out = toStringParams(params);
50114
- stripEmptyStringValues(out);
50115
- if (endpoint === "getPublicFormById") {
50116
- ensureSiteId(out, context);
50117
- if (!out.formId && out.formSlug) {
50118
- out.formId = out.formSlug;
50119
- delete out.formSlug;
50120
- }
50121
- return out;
50122
- }
50123
- if (endpoint === "getPublicBookingServices") {
50124
- ensureSiteId(out, context);
50125
- return out;
50126
- }
50127
- if (endpoint === "listPublicEvents") {
50128
- ensureSiteId(out, context);
50129
- return out;
50130
- }
50131
- if (endpoint === "getPublicEventDetails") {
50132
- ensureSiteId(out, context);
50133
- return out;
50134
- }
50135
- if (endpoint === "listPublicProducts") {
50136
- ensureSiteId(out, context);
50137
- return out;
50138
- }
50139
- if (endpoint === "getPublishedEntryPreview") {
50140
- ensureSiteId(out, context);
50141
- return out;
50142
- }
50143
- ensureSiteId(out, context);
50144
- return out;
50145
- }
50146
-
50147
51700
  // src/data/prefetchBlockData.ts
50148
51701
  var SUPPORTED_LOADER_ENDPOINTS2 = [
50149
51702
  "listPublishedEntries",
@@ -50388,83 +51941,154 @@ async function prefetchBlockData2(page, context, client, options) {
50388
51941
  });
50389
51942
  }
50390
51943
 
50391
- // src/rendering/components/Block.tsx
51944
+ // src/rendering/components/Block.shared.tsx
50392
51945
  import { jsx as jsx59, jsxs as jsxs41 } from "react/jsx-runtime";
50393
- async function Block({
51946
+ function renderUnknownBlock(blockKind) {
51947
+ return /* @__PURE__ */ jsx59("div", { className: "p-4 border border-red-300 bg-red-50 rounded", children: /* @__PURE__ */ jsxs41("p", { className: "text-red-800 font-semibold", children: [
51948
+ "Unknown block type: ",
51949
+ blockKind
51950
+ ] }) });
51951
+ }
51952
+ function buildBlockContentRuntime({
51953
+ theme,
51954
+ siteId,
51955
+ supabaseUrl,
51956
+ mediaAssets
51957
+ }) {
51958
+ const themeRuntime = buildThemeRuntime2(theme);
51959
+ const blocksTheme = parseBlocksTheme(theme);
51960
+ const imageResolveContext = siteId || supabaseUrl || mediaAssets?.length ? { siteId, supabaseUrl, mediaAssets } : void 0;
51961
+ if (imageResolveContext) {
51962
+ setContextResolveImageUrlContext(buildResolveImageUrlContext(imageResolveContext));
51963
+ }
51964
+ return { themeRuntime, blocksTheme, imageResolveContext };
51965
+ }
51966
+ function buildSingleBlockPageOutline({
51967
+ blockId,
51968
+ blockKind
51969
+ }) {
51970
+ return {
51971
+ name: "Single Block",
51972
+ path: "/block",
51973
+ purpose: "Block preview",
51974
+ blocks: [{
51975
+ id: blockId,
51976
+ kind: blockKind,
51977
+ purpose: "preview"
51978
+ }]
51979
+ };
51980
+ }
51981
+ async function loadStandaloneBlockData({
50394
51982
  blockKind,
50395
51983
  blockId,
50396
- content,
50397
- theme,
50398
51984
  siteId,
50399
51985
  pageId,
50400
51986
  previewStage,
50401
51987
  client,
50402
- usePlaceholders: _usePlaceholders = false,
50403
- override: OverrideComponent
51988
+ hasDefinition
51989
+ }) {
51990
+ if (!client || !blockId || !siteId || !hasDefinition) return void 0;
51991
+ const allResolvedData = await prefetchBlockData2(
51992
+ buildSingleBlockPageOutline({ blockId, blockKind }),
51993
+ { siteId, pageId, previewStage },
51994
+ client
51995
+ );
51996
+ return allResolvedData[blockId];
51997
+ }
51998
+ function buildStandaloneBlockViewModel({
51999
+ siteId,
52000
+ pageId,
52001
+ previewStage,
52002
+ apiBaseUrl,
52003
+ portalToken,
52004
+ routeMap,
52005
+ pagesByIdentifier,
52006
+ entriesByIdentifier
52007
+ }) {
52008
+ return {
52009
+ $root: {
52010
+ siteId: siteId ?? null,
52011
+ pageId: pageId ?? null,
52012
+ previewStage: previewStage ?? "published",
52013
+ apiBaseUrl: apiBaseUrl ?? null,
52014
+ portalToken: portalToken ?? null,
52015
+ ...routeMap ? { routes: routeMap } : {},
52016
+ ...pagesByIdentifier ? { pagesByIdentifier } : {},
52017
+ ...entriesByIdentifier ? { entriesByIdentifier } : {}
52018
+ }
52019
+ };
52020
+ }
52021
+ function renderBlockOverride({
52022
+ OverrideComponent,
52023
+ props: props2,
52024
+ runtime,
52025
+ resolvedData
52026
+ }) {
52027
+ return /* @__PURE__ */ jsx59(
52028
+ OverrideComponent,
52029
+ {
52030
+ content: props2.content,
52031
+ theme: runtime.themeRuntime.tokens,
52032
+ themeConfig: props2.theme,
52033
+ data: resolvedData,
52034
+ siteId: props2.siteId,
52035
+ supabaseUrl: props2.supabaseUrl,
52036
+ imageResolveContext: runtime.imageResolveContext,
52037
+ blockId: props2.blockId ?? null,
52038
+ blockKind: props2.blockKind
52039
+ }
52040
+ );
52041
+ }
52042
+ function renderManifestBlock({
52043
+ definition,
52044
+ props: props2,
52045
+ runtime,
52046
+ resolvedData
50404
52047
  }) {
50405
- const definition = getBlockDefinition(blockKind);
50406
- if (!definition && !OverrideComponent) {
50407
- return /* @__PURE__ */ jsx59("div", { className: "p-4 border border-red-300 bg-red-50 rounded", children: /* @__PURE__ */ jsxs41("p", { className: "text-red-800 font-semibold", children: [
50408
- "Unknown block type: ",
50409
- blockKind
50410
- ] }) });
50411
- }
50412
- const themeRuntime = buildThemeRuntime2(theme);
50413
- const blocksTheme = parseBlocksTheme(theme);
50414
- let resolvedData;
50415
- if (client && blockId && definition) {
50416
- const pageOutline = {
50417
- name: "Single Block",
50418
- path: "/block",
50419
- purpose: "Block preview",
50420
- blocks: [{
50421
- id: blockId,
50422
- kind: blockKind,
50423
- purpose: "preview"
50424
- }]
50425
- };
50426
- const allResolvedData = await prefetchBlockData2(
50427
- pageOutline,
50428
- { siteId, pageId, previewStage },
50429
- client
50430
- );
50431
- resolvedData = allResolvedData[blockId];
50432
- }
50433
- if (OverrideComponent) {
50434
- return /* @__PURE__ */ jsx59(
50435
- OverrideComponent,
50436
- {
50437
- content,
50438
- theme: themeRuntime.tokens,
50439
- themeConfig: theme,
50440
- data: resolvedData,
50441
- blockId: blockId ?? null,
50442
- blockKind
50443
- }
50444
- );
50445
- }
50446
- if (!definition) {
50447
- return /* @__PURE__ */ jsx59("div", { className: "p-4 border border-red-300 bg-red-50 rounded", children: /* @__PURE__ */ jsxs41("p", { className: "text-red-800 font-semibold", children: [
50448
- "Unknown block type: ",
50449
- blockKind
50450
- ] }) });
50451
- }
50452
52048
  const BlockComponent = makeDefaultBlockComponent({ manifest: definition.manifest });
50453
52049
  const registry = getDefaultComponentRegistry();
50454
- const blocksThemeConfig = blocksTheme;
52050
+ const blocksThemeConfig = runtime.blocksTheme;
50455
52051
  return /* @__PURE__ */ jsx59(
50456
52052
  BlockComponent,
50457
52053
  {
50458
- blockId: blockId ?? void 0,
50459
- blockKind,
50460
- theme: themeRuntime.tokens,
52054
+ blockId: props2.blockId ?? void 0,
52055
+ blockKind: props2.blockKind,
52056
+ theme: runtime.themeRuntime.tokens,
50461
52057
  themeConfig: blocksThemeConfig,
50462
- content,
52058
+ content: props2.content,
50463
52059
  data: resolvedData,
50464
- registry
52060
+ registry,
52061
+ viewModelOverrides: buildStandaloneBlockViewModel(props2)
50465
52062
  }
50466
52063
  );
50467
52064
  }
52065
+ async function BlockContent(props2) {
52066
+ const definition = getBlockDefinition(props2.blockKind);
52067
+ const OverrideComponent = props2.override;
52068
+ if (!definition && !OverrideComponent) {
52069
+ return renderUnknownBlock(props2.blockKind);
52070
+ }
52071
+ const runtime = buildBlockContentRuntime(props2);
52072
+ const resolvedData = await loadStandaloneBlockData({
52073
+ ...props2,
52074
+ hasDefinition: Boolean(definition)
52075
+ });
52076
+ if (OverrideComponent) {
52077
+ return renderBlockOverride({ OverrideComponent, props: props2, runtime, resolvedData });
52078
+ }
52079
+ return renderManifestBlock({
52080
+ definition,
52081
+ props: props2,
52082
+ runtime,
52083
+ resolvedData
52084
+ });
52085
+ }
52086
+
52087
+ // src/rendering/components/Block.server.tsx
52088
+ import { jsx as jsx60 } from "react/jsx-runtime";
52089
+ function Block(props2) {
52090
+ return /* @__PURE__ */ jsx60(BlockContent, { ...props2 });
52091
+ }
50468
52092
  export {
50469
52093
  Block,
50470
52094
  Layout,