@riverbankcms/sdk 0.60.9 → 0.60.12

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 (45) hide show
  1. package/dist/_dts/api/src/accessAdmin.d.ts +102 -0
  2. package/dist/_dts/api/src/common/envelope.d.ts +1 -1
  3. package/dist/_dts/api/src/domains.d.ts +14 -13
  4. package/dist/_dts/api/src/endpoints.d.ts +32 -0
  5. package/dist/_dts/api/src/index.d.ts +4 -3
  6. package/dist/_dts/api/src/navigation/linkValue.d.ts +15 -2
  7. package/dist/_dts/api/src/navigation.d.ts +2 -0
  8. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +15 -1
  9. package/dist/_dts/blocks/src/index.d.ts +1 -1
  10. package/dist/_dts/blocks/src/system/node/fragments/ctaButton.d.ts +2 -2
  11. package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +2 -1
  12. package/dist/_dts/blocks/src/system/types/link.d.ts +7 -1
  13. package/dist/_dts/core/src/participant-identity.d.ts +72 -0
  14. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +96 -60
  15. package/dist/_dts/db/src/schemas/forms.d.ts +135 -24
  16. package/dist/_dts/sdk/src/contracts/content.d.ts +7 -1
  17. package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -1
  18. package/dist/_dts/sdk/src/version.d.ts +1 -1
  19. package/dist/_dts/theme-core/src/buttons/classNames.d.ts +21 -0
  20. package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
  21. package/dist/_dts/theme-core/src/buttons/types.d.ts +1 -0
  22. package/dist/cli/index.mjs +188 -9
  23. package/dist/client/bookings.mjs +808 -149
  24. package/dist/client/client.mjs +553 -130
  25. package/dist/client/hooks.mjs +119 -0
  26. package/dist/client/rendering/client.mjs +412 -113
  27. package/dist/client/rendering/islands.mjs +4605 -4361
  28. package/dist/client/rendering.mjs +580 -157
  29. package/dist/preview-next/before-render.mjs +57 -0
  30. package/dist/preview-next/client/runtime.mjs +580 -151
  31. package/dist/preview-next/middleware.mjs +57 -0
  32. package/dist/server/components.mjs +293 -45
  33. package/dist/server/config-validation.mjs +119 -0
  34. package/dist/server/config.mjs +119 -0
  35. package/dist/server/data.mjs +119 -0
  36. package/dist/server/index.mjs +120 -1
  37. package/dist/server/next.mjs +300 -52
  38. package/dist/server/page-converter.mjs +62 -0
  39. package/dist/server/prebuild.mjs +1 -1
  40. package/dist/server/rendering/server.mjs +293 -45
  41. package/dist/server/rendering.mjs +293 -45
  42. package/dist/server/routing.mjs +159 -29
  43. package/dist/server/server.mjs +120 -1
  44. package/package.json +1 -1
  45. package/dist/_dts/blocks/src/system/runtime/shared/themedButtonClass.d.ts +0 -11
@@ -609,10 +609,71 @@ var init_participants = __esm({
609
609
  });
610
610
 
611
611
  // ../core/src/participant-identity.ts
612
+ var PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD, PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATIONS;
612
613
  var init_participant_identity = __esm({
613
614
  "../core/src/participant-identity.ts"() {
614
615
  "use strict";
615
616
  init_assertNever();
617
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD = {
618
+ participant_id: {
619
+ field: "participant_id",
620
+ role: "canonical_link",
621
+ canonicalSource: "booking_participants.id",
622
+ contractAction: "tighten_in_839",
623
+ notes: "Canonical person-subject link for a participation. #839 should enforce this once preflight is clean."
624
+ },
625
+ display_name: {
626
+ field: "display_name",
627
+ role: "contextual_snapshot",
628
+ canonicalSource: "booking_participants.display_name for live identity",
629
+ contractAction: "retain_as_snapshot",
630
+ notes: "Participation-time display context. Readers must not treat it as mutable live participant identity."
631
+ },
632
+ email: {
633
+ field: "email",
634
+ role: "contextual_snapshot",
635
+ canonicalSource: "booking_participants.email_normalized for live email identity",
636
+ contractAction: "retain_as_snapshot",
637
+ notes: "Participation-time contact snapshot used for notifications/context. Live identity belongs to the participant row."
638
+ },
639
+ email_normalized: {
640
+ field: "email_normalized",
641
+ role: "contextual_snapshot",
642
+ canonicalSource: "booking_participants.email_normalized for live email identity",
643
+ contractAction: "retain_as_snapshot",
644
+ notes: "Normalized snapshot/dedupe helper for the participation slot, not live person authority."
645
+ },
646
+ phone: {
647
+ field: "phone",
648
+ role: "contextual_snapshot",
649
+ canonicalSource: "booking_participants.phone for live phone identity",
650
+ contractAction: "retain_as_snapshot",
651
+ notes: "Participation-time phone context. Live identity belongs to the participant row."
652
+ },
653
+ identity_state: {
654
+ field: "identity_state",
655
+ role: "materialization_state",
656
+ canonicalSource: "booking_participants.identity_state for subject state",
657
+ contractAction: "review_for_later_contract_cleanup",
658
+ notes: "Slot materialization state: booker_supplied, contactable, portal_claimed, or staff_verified."
659
+ },
660
+ event_attendee_guest_id: {
661
+ field: "event_attendee_guest_id",
662
+ role: "compatibility_projection",
663
+ canonicalSource: "canonical participant slot plus #838 event guest compatibility projection",
664
+ contractAction: "retain_as_projection",
665
+ notes: "Compatibility FK for event guest read models. It is not person identity authority."
666
+ }
667
+ };
668
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATIONS = [
669
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.participant_id,
670
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.display_name,
671
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.email,
672
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.email_normalized,
673
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.phone,
674
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.identity_state,
675
+ PARTICIPANT_PARTICIPATION_IDENTITY_FIELD_CLASSIFICATION_BY_FIELD.event_attendee_guest_id
676
+ ];
616
677
  }
617
678
  });
618
679
 
@@ -2091,6 +2152,15 @@ var init_augmentManifest = __esm({
2091
2152
 
2092
2153
  // ../theme-core/src/buttons/types.ts
2093
2154
  import { z as z11 } from "zod";
2155
+ function isVariantRole(value) {
2156
+ return VARIANT_ROLES.includes(value);
2157
+ }
2158
+ function asSpecialVariantId(value) {
2159
+ if (value.length === 0) {
2160
+ throw new Error("SpecialVariantId must be a non-empty string");
2161
+ }
2162
+ return value;
2163
+ }
2094
2164
  var VARIANT_ROLES, DEFAULT_VARIANT_ALIAS_ID, cornerStyleSchema, shadowSizeSchema, textTransformSchema, fontWeightSchema, buttonTypographySchema, letterSpacingSchema, hoverTransformSchema, hoverColorSchema, buttonPaddingPresetSchema, gradientStyleSchema, gradientSharpnessSchema, prioritySchema, variantRoleSchema, buttonSizeNameSchema, PADDING_TOKEN_PATTERN, paddingShorthandSchema, buttonSizeConfigSchema, buttonSizesSchema, buttonGlobalSettingsSchema, gradientDirectionSchema, buttonBackgroundSchema, effectApplicationSchema, buttonBorderSchema, variantShadowSchema, variantEffectsSchema, variantSizeOverridesSchema, buttonVariantSchema, buttonSystemSchema;
2095
2165
  var init_types2 = __esm({
2096
2166
  "../theme-core/src/buttons/types.ts"() {
@@ -2877,6 +2947,48 @@ var init_personalities = __esm({
2877
2947
  }
2878
2948
  });
2879
2949
 
2950
+ // ../theme-core/src/buttons/classNames.ts
2951
+ function parseThemeButtonVariantId(value) {
2952
+ const normalized = value?.trim() ?? "";
2953
+ if (normalized.length === 0) {
2954
+ return null;
2955
+ }
2956
+ if (normalized === DEFAULT_VARIANT_ALIAS_ID) {
2957
+ return DEFAULT_VARIANT_ALIAS_ID;
2958
+ }
2959
+ return isVariantRole(normalized) ? normalized : asSpecialVariantId(normalized);
2960
+ }
2961
+ function themeButtonVariantClassNames(variant) {
2962
+ if (variant === DEFAULT_VARIANT_ALIAS_ID) {
2963
+ return [variant];
2964
+ }
2965
+ return [variant, `button-${variant}`];
2966
+ }
2967
+ function themeButtonSizeClassName(size) {
2968
+ return `btn-${size}`;
2969
+ }
2970
+ function themeButtonSelector(variant, size) {
2971
+ const baseSelector = `.${variant}`;
2972
+ if (!size) {
2973
+ return baseSelector;
2974
+ }
2975
+ return `${baseSelector}.${themeButtonSizeClassName(size)}`;
2976
+ }
2977
+ function themeButtonClassName(spec) {
2978
+ const classes = [
2979
+ ...themeButtonVariantClassNames(spec.variant),
2980
+ themeButtonSizeClassName(spec.size),
2981
+ spec.extraClassName
2982
+ ];
2983
+ return classes.filter(Boolean).join(" ");
2984
+ }
2985
+ var init_classNames = __esm({
2986
+ "../theme-core/src/buttons/classNames.ts"() {
2987
+ "use strict";
2988
+ init_types2();
2989
+ }
2990
+ });
2991
+
2880
2992
  // ../theme-core/src/tokens/resolver.ts
2881
2993
  var TokenResolver;
2882
2994
  var init_resolver = __esm({
@@ -4550,17 +4662,25 @@ function resolveAliasSource(enabled) {
4550
4662
  }
4551
4663
  function variantChunks(variant, global, themeSizes, themeId, tokens, theme) {
4552
4664
  const out = [];
4553
- out.push(variantBaseRule(variant, global, themeId, tokens, theme));
4554
- const hoverBg = variantHoverBackgroundRule(variant, global, themeId, tokens);
4665
+ const variantId = parseButtonVariantIdForCss(variant.id);
4666
+ out.push(variantBaseRule(variant, variantId, global, themeId, tokens, theme));
4667
+ const hoverBg = variantHoverBackgroundRule(variant, variantId, global, themeId, tokens);
4555
4668
  if (hoverBg) out.push(hoverBg);
4556
4669
  const effects = variantEffectsCss(variant, themeId, tokens, theme);
4557
4670
  if (effects) out.push({ raw: effects });
4558
- out.push(...variantDisabledRules(variant, themeId));
4559
- out.push(...variantSizeRules(variant, themeSizes, themeId));
4671
+ out.push(...variantDisabledRules(variantId, themeId));
4672
+ out.push(...variantSizeRules(variant, variantId, themeSizes, themeId));
4560
4673
  return out;
4561
4674
  }
4562
- function variantBaseRule(variant, global, themeId, tokens, theme) {
4563
- const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}`;
4675
+ function parseButtonVariantIdForCss(value) {
4676
+ const variantId = parseThemeButtonVariantId(value);
4677
+ if (!variantId) {
4678
+ throw new Error("Button variant id must be a non-empty string");
4679
+ }
4680
+ return variantId;
4681
+ }
4682
+ function variantBaseRule(variant, variantId, global, themeId, tokens, theme) {
4683
+ const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}`;
4564
4684
  const decls = [];
4565
4685
  decls.push(["font-weight", String(global.fontWeight)]);
4566
4686
  decls.push(["font-family", resolveFontFamily(global)]);
@@ -4593,13 +4713,13 @@ function variantBaseRule(variant, global, themeId, tokens, theme) {
4593
4713
  }
4594
4714
  return rule(selector, decls);
4595
4715
  }
4596
- function variantHoverBackgroundRule(variant, global, themeId, tokens) {
4716
+ function variantHoverBackgroundRule(variant, variantId, global, themeId, tokens) {
4597
4717
  let hoverToken = variant.hoverBackgroundToken;
4598
4718
  if (!hoverToken && global.hoverColor === "token" && global.hoverColorToken) {
4599
4719
  hoverToken = global.hoverColorToken;
4600
4720
  }
4601
4721
  if (!hoverToken) return null;
4602
- return rule(`:where([data-theme-scope="${themeId}"]) .${variant.id}:hover`, [
4722
+ return rule(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:hover`, [
4603
4723
  ["background-color", tokens.getColor(hoverToken)]
4604
4724
  ]);
4605
4725
  }
@@ -4619,8 +4739,8 @@ function variantEffectsCss(variant, themeId, tokens, theme) {
4619
4739
  theme
4620
4740
  });
4621
4741
  }
4622
- function variantDisabledRules(variant, themeId) {
4623
- const base = `:where([data-theme-scope="${themeId}"]) .${variant.id}:disabled`;
4742
+ function variantDisabledRules(variantId, themeId) {
4743
+ const base = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:disabled`;
4624
4744
  const disabledSelectors = [base, `${base}:hover`, `${base}:active`, `${base}:focus`];
4625
4745
  const pseudoSelectors = [`${base}::before`, `${base}::after`];
4626
4746
  return [
@@ -4638,12 +4758,12 @@ function variantDisabledRules(variant, themeId) {
4638
4758
  ])
4639
4759
  ];
4640
4760
  }
4641
- function variantSizeRules(variant, themeSizes, themeId) {
4761
+ function variantSizeRules(variant, variantId, themeSizes, themeId) {
4642
4762
  const borderWidth = variant.border ? BORDER_WIDTH_MAP[variant.border.widthClass] || "1px" : "0px";
4643
4763
  const rules = [];
4644
4764
  for (const sizeName of BUTTON_SIZE_NAMES) {
4645
4765
  const config = resolveSizeConfig(variant, sizeName, themeSizes);
4646
- const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}.btn-${sizeName}`;
4766
+ const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId, sizeName)}`;
4647
4767
  const decls = [];
4648
4768
  for (const decl of paddingDeclarations(config.padding, borderWidth)) decls.push(decl);
4649
4769
  if (config.fontSize) {
@@ -4706,6 +4826,7 @@ var init_generateButtonCss = __esm({
4706
4826
  "../theme-core/src/buttons/generateButtonCss.ts"() {
4707
4827
  "use strict";
4708
4828
  init_types2();
4829
+ init_classNames();
4709
4830
  init_resolver();
4710
4831
  init_generateEffectsCSS();
4711
4832
  init_constants();
@@ -4752,6 +4873,7 @@ var init_buttons = __esm({
4752
4873
  "../theme-core/src/buttons/index.ts"() {
4753
4874
  "use strict";
4754
4875
  init_types2();
4876
+ init_classNames();
4755
4877
  init_generateButtonCss();
4756
4878
  init_generateDefaultButtonSystem();
4757
4879
  init_constants();
@@ -14838,19 +14960,6 @@ var init_EventCardIcons = __esm({
14838
14960
  }
14839
14961
  });
14840
14962
 
14841
- // ../blocks/src/system/runtime/shared/themedButtonClass.ts
14842
- function themedButtonClass(spec) {
14843
- const { variant, size, extraClassName } = spec;
14844
- const normalizedVariant = variant.trim();
14845
- const variantClasses = normalizedVariant ? [normalizedVariant, `button-${normalizedVariant}`] : [];
14846
- return [...variantClasses, `btn-${size}`, extraClassName].filter(Boolean).join(" ");
14847
- }
14848
- var init_themedButtonClass = __esm({
14849
- "../blocks/src/system/runtime/shared/themedButtonClass.ts"() {
14850
- "use strict";
14851
- }
14852
- });
14853
-
14854
14963
  // ../blocks/src/system/runtime/nodes/events/shared/EventCard.tsx
14855
14964
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
14856
14965
  function formatCapacityText(event, options) {
@@ -14898,7 +15007,7 @@ var init_EventCard = __esm({
14898
15007
  init_EventCardIcons();
14899
15008
  init_eventCapacity();
14900
15009
  init_utils();
14901
- init_themedButtonClass();
15010
+ init_buttons();
14902
15011
  EventCard = ({
14903
15012
  event,
14904
15013
  cardVariant = "default",
@@ -14924,7 +15033,7 @@ var init_EventCard = __esm({
14924
15033
  const isSoldOut = cta.hidden;
14925
15034
  const { available: spotsLeft } = getEventAvailability(event);
14926
15035
  const cardClass = `card-${cardVariant}`;
14927
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
15036
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
14928
15037
  const title = event.title;
14929
15038
  const summary = event.presentation?.summary ?? event.description;
14930
15039
  const image = event.presentation?.image ?? null;
@@ -15006,7 +15115,7 @@ var init_EventCompactRow = __esm({
15006
15115
  "use strict";
15007
15116
  init_utils();
15008
15117
  init_EventCardIcons();
15009
- init_themedButtonClass();
15118
+ init_buttons();
15010
15119
  EventCompactRow = ({
15011
15120
  event,
15012
15121
  buttonVariant = "primary",
@@ -15018,7 +15127,7 @@ var init_EventCompactRow = __esm({
15018
15127
  const price = formatEventPrice(event);
15019
15128
  const teacherLine = formatEventTeacherLine(event);
15020
15129
  const cta = resolveEventCta(event, buttonText);
15021
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "sm" });
15130
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "sm" });
15022
15131
  return /* @__PURE__ */ jsxs3("div", { className: "event-compact-row", children: [
15023
15132
  /* @__PURE__ */ jsxs3("div", { className: "event-compact-row-content", children: [
15024
15133
  /* @__PURE__ */ jsxs3("div", { className: "event-compact-row-top", children: [
@@ -19318,11 +19427,12 @@ var init_basic = __esm({
19318
19427
  }
19319
19428
  return null;
19320
19429
  }
19321
- const resolvedVariantId = typeof variantId === "string" ? variantId.trim() : "";
19322
- const normalizedVariantId = resolvedVariantId === DEFAULT_VARIANT_ALIAS_ID ? "" : resolvedVariantId;
19323
- const variantClasses = normalizedVariantId ? [normalizedVariantId, `button-${normalizedVariantId}`] : [];
19324
- const sizeClass = `btn-${size}`;
19325
- const combinedClassName = [...variantClasses, sizeClass, className].filter(Boolean).join(" ");
19430
+ const resolvedVariantId = parseThemeButtonVariantId(variantId);
19431
+ const combinedClassName = resolvedVariantId ? themeButtonClassName({
19432
+ variant: resolvedVariantId,
19433
+ size,
19434
+ extraClassName: className
19435
+ }) : className;
19326
19436
  if (resolvedHref) {
19327
19437
  return /* @__PURE__ */ jsx15(
19328
19438
  "a",
@@ -20275,7 +20385,7 @@ function FileDownloadNode({
20275
20385
  {
20276
20386
  href,
20277
20387
  download: filename,
20278
- className: themedButtonClass({
20388
+ className: themeButtonClassName({
20279
20389
  variant,
20280
20390
  size: "md",
20281
20391
  extraClassName: "rb-inline-flex rb-shrink-0 rb-items-center rb-justify-center rb-gap-2"
@@ -20295,7 +20405,7 @@ var init_file_download = __esm({
20295
20405
  init_lucide_react();
20296
20406
  init_colorStyles();
20297
20407
  init_media();
20298
- init_themedButtonClass();
20408
+ init_buttons();
20299
20409
  init_media2();
20300
20410
  FILE_DOWNLOAD_BUTTON_VARIANTS = ["primary", "secondary", "outline", "link"];
20301
20411
  }
@@ -22527,7 +22637,7 @@ var init_EventSpotlight = __esm({
22527
22637
  "../blocks/src/system/runtime/nodes/events/EventSpotlight.tsx"() {
22528
22638
  "use strict";
22529
22639
  init_shared5();
22530
- init_themedButtonClass();
22640
+ init_buttons();
22531
22641
  EventSpotlight = ({
22532
22642
  events,
22533
22643
  layout = "grid",
@@ -22549,7 +22659,7 @@ var init_EventSpotlight = __esm({
22549
22659
  }
22550
22660
  const containerClass = getContainerClass(layout, columns);
22551
22661
  const cardOrientation = getCardOrientation(layout);
22552
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
22662
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
22553
22663
  return /* @__PURE__ */ jsxs19("div", { className: `event-spotlight-section ${className || ""}`, "data-block": "event-spotlight", children: [
22554
22664
  /* @__PURE__ */ jsx32("div", { className: `event-spotlight ${containerClass}`, children: normalizedEvents.map((event) => /* @__PURE__ */ jsx32(
22555
22665
  EventCard,
@@ -23078,7 +23188,16 @@ var init_view3 = __esm({
23078
23188
  import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
23079
23189
  function renderServerPendingAction(label, soldOut) {
23080
23190
  return /* @__PURE__ */ jsxs22(Fragment5, { children: [
23081
- /* @__PURE__ */ jsx36("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: soldOut ? "Sold out" : label }),
23191
+ /* @__PURE__ */ jsx36(
23192
+ "button",
23193
+ {
23194
+ type: "button",
23195
+ className: themeButtonClassName({ variant: "default", size: "md" }),
23196
+ disabled: true,
23197
+ "aria-disabled": "true",
23198
+ children: soldOut ? "Sold out" : label
23199
+ }
23200
+ ),
23082
23201
  !soldOut ? /* @__PURE__ */ jsx36("p", { className: "rb-caption status-muted", children: "Cart actions become interactive after page load." }) : null
23083
23202
  ] });
23084
23203
  }
@@ -23098,7 +23217,14 @@ function ProductListServerContent(props2) {
23098
23217
  ),
23099
23218
  actions: /* @__PURE__ */ jsxs22(Fragment5, { children: [
23100
23219
  renderServerPendingAction(card.actionLabel, card.soldOut),
23101
- card.path ? /* @__PURE__ */ jsx36("a", { href: card.path, className: "secondary btn-sm", children: "View details" }) : null
23220
+ card.path ? /* @__PURE__ */ jsx36(
23221
+ "a",
23222
+ {
23223
+ href: card.path,
23224
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
23225
+ children: "View details"
23226
+ }
23227
+ ) : null
23102
23228
  ] })
23103
23229
  },
23104
23230
  card.productId
@@ -23141,6 +23267,7 @@ function CheckoutServerContent(props2) {
23141
23267
  var init_shop_commerce_server = __esm({
23142
23268
  "../blocks/src/system/runtime/nodes/shop-commerce.server.tsx"() {
23143
23269
  "use strict";
23270
+ init_buttons();
23144
23271
  init_RichText();
23145
23272
  init_carousel_server();
23146
23273
  init_richText_coerce();
@@ -23689,7 +23816,7 @@ function renderCalendarGrid(display) {
23689
23816
  "button",
23690
23817
  {
23691
23818
  type: "button",
23692
- className: themedButtonClass({
23819
+ className: themeButtonClassName({
23693
23820
  variant: display.buttonVariant,
23694
23821
  size: "sm"
23695
23822
  }),
@@ -23775,7 +23902,7 @@ function renderTimetableSsr(display) {
23775
23902
  "button",
23776
23903
  {
23777
23904
  type: "button",
23778
- className: themedButtonClass({
23905
+ className: themeButtonClassName({
23779
23906
  variant: display.buttonVariant,
23780
23907
  size: "sm"
23781
23908
  }),
@@ -23903,7 +24030,7 @@ var init_EventCalendar_server = __esm({
23903
24030
  init_renderEventListItem();
23904
24031
  init_utils();
23905
24032
  init_timetableModel();
23906
- init_themedButtonClass();
24033
+ init_buttons();
23907
24034
  EventCalendarSSR = (props2) => {
23908
24035
  const islandProps = buildEventCalendarInteractiveIslandProps(props2);
23909
24036
  const display = islandProps.render.display;
@@ -24034,7 +24161,7 @@ var init_form_server = __esm({
24034
24161
  "use strict";
24035
24162
  init_clsx();
24036
24163
  init_ssr();
24037
- init_themedButtonClass();
24164
+ init_buttons();
24038
24165
  init_form_interactive();
24039
24166
  FormNodeSSR = ({
24040
24167
  blockId,
@@ -24172,7 +24299,7 @@ var init_form_server = __esm({
24172
24299
  "button",
24173
24300
  {
24174
24301
  type: "submit",
24175
- className: themedButtonClass({
24302
+ className: themeButtonClassName({
24176
24303
  variant: "primary",
24177
24304
  size: "md",
24178
24305
  extraClassName: "rb-w-full rb-sm-w-auto"
@@ -24265,7 +24392,7 @@ function NewsletterFormSSR({
24265
24392
  "button",
24266
24393
  {
24267
24394
  type: "submit",
24268
- className: themedButtonClass({ variant: "primary", size: "md" }),
24395
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
24269
24396
  children: display.buttonLabel
24270
24397
  }
24271
24398
  ) })
@@ -24282,7 +24409,7 @@ var init_newsletter_form_server = __esm({
24282
24409
  "use strict";
24283
24410
  init_clsx();
24284
24411
  init_ssr();
24285
- init_themedButtonClass();
24412
+ init_buttons();
24286
24413
  init_newsletter_form_interactive();
24287
24414
  newsletter_form_server_default = NewsletterFormSSR;
24288
24415
  }
@@ -24413,7 +24540,16 @@ function ShopSSR({
24413
24540
  PassCardView,
24414
24541
  {
24415
24542
  display: pass,
24416
- action: /* @__PURE__ */ jsx49("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: pass.actionLabel })
24543
+ action: /* @__PURE__ */ jsx49(
24544
+ "button",
24545
+ {
24546
+ type: "button",
24547
+ className: themeButtonClassName({ variant: "default", size: "md" }),
24548
+ disabled: true,
24549
+ "aria-disabled": "true",
24550
+ children: pass.actionLabel
24551
+ }
24552
+ )
24417
24553
  },
24418
24554
  pass.id
24419
24555
  )),
@@ -24421,7 +24557,16 @@ function ShopSSR({
24421
24557
  MembershipCardView,
24422
24558
  {
24423
24559
  display: membership,
24424
- action: /* @__PURE__ */ jsx49("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: membership.actionLabel })
24560
+ action: /* @__PURE__ */ jsx49(
24561
+ "button",
24562
+ {
24563
+ type: "button",
24564
+ className: themeButtonClassName({ variant: "default", size: "md" }),
24565
+ disabled: true,
24566
+ "aria-disabled": "true",
24567
+ children: membership.actionLabel
24568
+ }
24569
+ )
24425
24570
  },
24426
24571
  membership.id
24427
24572
  ))
@@ -24436,6 +24581,7 @@ var shop_server_default;
24436
24581
  var init_shop_server = __esm({
24437
24582
  "../blocks/src/system/runtime/nodes/shop.server.tsx"() {
24438
24583
  "use strict";
24584
+ init_buttons();
24439
24585
  init_ssr();
24440
24586
  init_view3();
24441
24587
  init_shop_interactive();
@@ -38017,6 +38163,92 @@ function encodePublicProductCategorySelector2(selector) {
38017
38163
  };
38018
38164
  }
38019
38165
  }
38166
+ function isRecord4(value) {
38167
+ return typeof value === "object" && value !== null;
38168
+ }
38169
+ function isJsonResponseContentType(contentType) {
38170
+ if (!contentType) return false;
38171
+ const mimeType = contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
38172
+ return mimeType === "application/json" || mimeType.endsWith("+json");
38173
+ }
38174
+ function getResponseContentType(response) {
38175
+ return response.headers.get("content-type");
38176
+ }
38177
+ async function parseJsonBody(response) {
38178
+ const rawText = await response.text();
38179
+ if (rawText.trim().length === 0) {
38180
+ return { kind: "empty-body" };
38181
+ }
38182
+ try {
38183
+ return { kind: "success", value: JSON.parse(rawText) };
38184
+ } catch {
38185
+ return { kind: "invalid-json" };
38186
+ }
38187
+ }
38188
+ function getBlockApiErrorDetails(data) {
38189
+ if (!isRecord4(data)) {
38190
+ return {};
38191
+ }
38192
+ const nestedError = isRecord4(data.error) ? data.error : void 0;
38193
+ const message = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
38194
+ const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
38195
+ return { message, code };
38196
+ }
38197
+ function buildUnexpectedJsonResponseMessage(parseResult) {
38198
+ switch (parseResult.kind) {
38199
+ case "empty-body":
38200
+ return "Expected JSON response body but received an empty response";
38201
+ case "invalid-json":
38202
+ return "Expected JSON response but received invalid JSON";
38203
+ }
38204
+ }
38205
+ async function extractErrorDetails(response) {
38206
+ const contentType = getResponseContentType(response);
38207
+ const fallbackMessage = `Request failed: ${response.statusText}`;
38208
+ if (!isJsonResponseContentType(contentType)) {
38209
+ return {
38210
+ message: `${fallbackMessage} (received ${contentType ?? "unknown content type"})`
38211
+ };
38212
+ }
38213
+ const parseResult = await parseJsonBody(response);
38214
+ switch (parseResult.kind) {
38215
+ case "success": {
38216
+ const details = getBlockApiErrorDetails(parseResult.value);
38217
+ return {
38218
+ message: details.message ?? fallbackMessage,
38219
+ code: details.code
38220
+ };
38221
+ }
38222
+ case "invalid-json":
38223
+ return {
38224
+ message: `${fallbackMessage} (received invalid JSON)`
38225
+ };
38226
+ case "empty-body":
38227
+ return {
38228
+ message: `${fallbackMessage} (received an empty response)`
38229
+ };
38230
+ }
38231
+ }
38232
+ async function parseJsonApiResponse(response) {
38233
+ if (response.status === 204 || response.status === 205) {
38234
+ return void 0;
38235
+ }
38236
+ const contentType = getResponseContentType(response);
38237
+ if (!isJsonResponseContentType(contentType)) {
38238
+ throw new BlockApiError(
38239
+ `Expected JSON response but received ${contentType ?? "unknown content type"}`,
38240
+ response.status
38241
+ );
38242
+ }
38243
+ const parseResult = await parseJsonBody(response);
38244
+ if (parseResult.kind !== "success") {
38245
+ throw new BlockApiError(
38246
+ buildUnexpectedJsonResponseMessage(parseResult),
38247
+ response.status
38248
+ );
38249
+ }
38250
+ return parseResult.value;
38251
+ }
38020
38252
  function getAuthHeaders2(auth) {
38021
38253
  switch (auth.type) {
38022
38254
  case "api-key":
@@ -38073,21 +38305,10 @@ function createBlockApi(config) {
38073
38305
  const doFetch = async () => {
38074
38306
  const response = await fetch(url, fetchOptions);
38075
38307
  if (!response.ok) {
38076
- let errorMessage = `Request failed: ${response.statusText}`;
38077
- let errorCode;
38078
- try {
38079
- const errorData = await response.json();
38080
- if (typeof errorData.error?.message === "string") {
38081
- errorMessage = errorData.error.message;
38082
- } else if (typeof errorData.message === "string") {
38083
- errorMessage = errorData.message;
38084
- }
38085
- errorCode = errorData.error?.code || errorData.code;
38086
- } catch {
38087
- }
38088
- throw new BlockApiError(errorMessage, response.status, errorCode);
38308
+ const details = await extractErrorDetails(response);
38309
+ throw new BlockApiError(details.message, response.status, details.code);
38089
38310
  }
38090
- const json = await response.json();
38311
+ const json = await parseJsonApiResponse(response);
38091
38312
  if (isApiSuccessResponse(json)) {
38092
38313
  return json.data;
38093
38314
  }
@@ -41943,7 +42164,7 @@ function MultiStepForm({
41943
42164
  type: "button",
41944
42165
  onClick: goToPrevious,
41945
42166
  disabled: !canGoBack,
41946
- className: "outline btn-md",
42167
+ className: themeButtonClassName({ variant: "outline", size: "md" }),
41947
42168
  children: backButtonLabel
41948
42169
  }
41949
42170
  ),
@@ -41953,7 +42174,11 @@ function MultiStepForm({
41953
42174
  type: "button",
41954
42175
  onClick: goToNext,
41955
42176
  disabled: !canGoNext,
41956
- className: "primary btn-md rb-flex-1",
42177
+ className: themeButtonClassName({
42178
+ variant: "primary",
42179
+ size: "md",
42180
+ extraClassName: "rb-flex-1"
42181
+ }),
41957
42182
  children: [
41958
42183
  (isValidating || isSubmitting) && /* @__PURE__ */ jsx58(
41959
42184
  SpinnerNode,
@@ -42069,6 +42294,7 @@ var init_MultiStepForm = __esm({
42069
42294
  "../blocks/src/system/runtime/components/multi-step/MultiStepForm.tsx"() {
42070
42295
  "use strict";
42071
42296
  "use client";
42297
+ init_buttons();
42072
42298
  init_MultiStepContext();
42073
42299
  init_useMultiStep();
42074
42300
  init_spinner2();
@@ -43331,7 +43557,10 @@ function PaymentOptionSelectionStep({
43331
43557
  "button",
43332
43558
  {
43333
43559
  type: "button",
43334
- className: isSelected ? "primary btn-md" : "outline btn-md",
43560
+ className: themeButtonClassName({
43561
+ variant: isSelected ? "primary" : "outline",
43562
+ size: "md"
43563
+ }),
43335
43564
  style: paymentOptionLayoutStyle,
43336
43565
  onClick: () => updateData({
43337
43566
  selectedAppointmentPackageId: appointmentPackage.customerPassId,
@@ -43380,7 +43609,10 @@ function PaymentOptionSelectionStep({
43380
43609
  "button",
43381
43610
  {
43382
43611
  type: "button",
43383
- className: isSelected ? "primary btn-md" : "outline btn-md",
43612
+ className: themeButtonClassName({
43613
+ variant: isSelected ? "primary" : "outline",
43614
+ size: "md"
43615
+ }),
43384
43616
  style: paymentOptionLayoutStyle,
43385
43617
  onClick: () => updateData({
43386
43618
  selectedAppointmentPackageId: void 0,
@@ -43409,6 +43641,7 @@ var init_PaymentOptionSelectionStep = __esm({
43409
43641
  "../blocks/src/system/runtime/components/booking/PaymentOptionSelectionStep.tsx"() {
43410
43642
  "use strict";
43411
43643
  "use client";
43644
+ init_buttons();
43412
43645
  init_api();
43413
43646
  init_MultiStepContext();
43414
43647
  init_booking_form_state();
@@ -45041,6 +45274,7 @@ var init_booking_form_client = __esm({
45041
45274
  init_noop();
45042
45275
  init_client2();
45043
45276
  init_src3();
45277
+ init_buttons();
45044
45278
  init_api();
45045
45279
  init_MultiStepForm();
45046
45280
  init_SuccessMessage();
@@ -45277,7 +45511,7 @@ var init_booking_form_client = __esm({
45277
45511
  "button",
45278
45512
  {
45279
45513
  type: "button",
45280
- className: "secondary btn-sm",
45514
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
45281
45515
  onClick: clearFeedback,
45282
45516
  children: "Dismiss"
45283
45517
  }
@@ -46652,7 +46886,7 @@ var init_PaymentSelectionStep = __esm({
46652
46886
  init_lucide_react();
46653
46887
  init_utils3();
46654
46888
  init_spinner2();
46655
- init_themedButtonClass();
46889
+ init_buttons();
46656
46890
  init_CheckIcon2();
46657
46891
  init_SelectableOptionCard();
46658
46892
  PaymentSelectionStep = ({
@@ -46753,7 +46987,7 @@ var init_PaymentSelectionStep = __esm({
46753
46987
  "button",
46754
46988
  {
46755
46989
  type: "button",
46756
- className: themedButtonClass({ variant: "primary", size: "md" }),
46990
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
46757
46991
  disabled: !email.trim(),
46758
46992
  onClick: onRequestLogin,
46759
46993
  children: "Email me a login link"
@@ -48400,7 +48634,7 @@ function MagicLinkForm({
48400
48634
  "button",
48401
48635
  {
48402
48636
  type: "button",
48403
- className: classPrefix === "cp" ? "secondary" : `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
48637
+ className: classPrefix === "cp" ? themeButtonClassName({ variant: "secondary", size: "md" }) : `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
48404
48638
  onClick: handleReset,
48405
48639
  children: "Try a different email"
48406
48640
  }
@@ -48428,7 +48662,7 @@ function MagicLinkForm({
48428
48662
  "button",
48429
48663
  {
48430
48664
  type: "submit",
48431
- className: classPrefix === "cp" ? "primary" : `${classPrefix}-modal-btn`,
48665
+ className: classPrefix === "cp" ? themeButtonClassName({ variant: "primary", size: "md" }) : `${classPrefix}-modal-btn`,
48432
48666
  disabled: !email.trim() || loading,
48433
48667
  children: loading ? "Sending..." : buttonText
48434
48668
  }
@@ -48439,6 +48673,7 @@ var init_MagicLinkForm = __esm({
48439
48673
  "../blocks/src/system/runtime/nodes/shared/MagicLinkForm.tsx"() {
48440
48674
  "use strict";
48441
48675
  "use client";
48676
+ init_buttons();
48442
48677
  init_api();
48443
48678
  }
48444
48679
  });
@@ -48464,7 +48699,7 @@ function EventRegistrationWizard(props2) {
48464
48699
  } = props2;
48465
48700
  const maxTicketsNum = parseInt(maxTickets, 10) || 5;
48466
48701
  const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
48467
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
48702
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
48468
48703
  const wizard = useEventRegistrationWizard({
48469
48704
  anchorId: EVENT_REGISTRATION_ANCHOR_ID,
48470
48705
  occurrenceContext: occurrenceContext ?? null,
@@ -48601,7 +48836,7 @@ var init_EventRegistrationWizard = __esm({
48601
48836
  init_useEventRegistrationWizard();
48602
48837
  init_MagicLinkForm();
48603
48838
  init_spinner2();
48604
- init_themedButtonClass();
48839
+ init_buttons();
48605
48840
  init_event_registration3();
48606
48841
  EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
48607
48842
  EVENT_PORTAL_AUTH_COPY = {
@@ -49047,7 +49282,7 @@ function ErrorStep2({
49047
49282
  buttonVariant = "primary",
49048
49283
  onRetry
49049
49284
  }) {
49050
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
49285
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
49051
49286
  return /* @__PURE__ */ jsxs77("div", { className: "cr-error", role: "alert", children: [
49052
49287
  /* @__PURE__ */ jsx106(StateIcon, { variant: "error", children: /* @__PURE__ */ jsx106(CrossIcon, {}) }),
49053
49288
  /* @__PURE__ */ jsx106("h3", { className: "cr-error__title", children: "Enrollment Failed" }),
@@ -49059,7 +49294,7 @@ var init_ErrorStep2 = __esm({
49059
49294
  "../blocks/src/system/runtime/nodes/course-registration/ErrorStep.tsx"() {
49060
49295
  "use strict";
49061
49296
  init_shared7();
49062
- init_themedButtonClass();
49297
+ init_buttons();
49063
49298
  }
49064
49299
  });
49065
49300
 
@@ -49071,7 +49306,7 @@ function VerifyingTimeoutStep2({
49071
49306
  onCheckAgain,
49072
49307
  supportEmail
49073
49308
  }) {
49074
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
49309
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
49075
49310
  return /* @__PURE__ */ jsxs78("div", { className: "cr-error", role: "alert", children: [
49076
49311
  /* @__PURE__ */ jsx107(StateIcon, { variant: "warning", children: /* @__PURE__ */ jsx107(ClockIcon, {}) }),
49077
49312
  /* @__PURE__ */ jsx107("h3", { className: "cr-error__title", children: "Payment Verification Taking Longer" }),
@@ -49088,7 +49323,7 @@ var init_VerifyingTimeoutStep2 = __esm({
49088
49323
  "../blocks/src/system/runtime/nodes/course-registration/VerifyingTimeoutStep.tsx"() {
49089
49324
  "use strict";
49090
49325
  init_shared7();
49091
- init_themedButtonClass();
49326
+ init_buttons();
49092
49327
  }
49093
49328
  });
49094
49329
 
@@ -49100,7 +49335,7 @@ function PaymentFailedStep2({
49100
49335
  buttonVariant = "primary",
49101
49336
  onRetry
49102
49337
  }) {
49103
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
49338
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
49104
49339
  return /* @__PURE__ */ jsxs79("div", { className: "cr-payment-failed", role: "alert", children: [
49105
49340
  /* @__PURE__ */ jsx108(StateIcon, { variant: "error", children: /* @__PURE__ */ jsx108(CrossIcon, {}) }),
49106
49341
  /* @__PURE__ */ jsx108("h3", { className: "cr-payment-failed__title", children: "Payment Failed" }),
@@ -49112,7 +49347,7 @@ var init_PaymentFailedStep2 = __esm({
49112
49347
  "../blocks/src/system/runtime/nodes/course-registration/PaymentFailedStep.tsx"() {
49113
49348
  "use strict";
49114
49349
  init_shared7();
49115
- init_themedButtonClass();
49350
+ init_buttons();
49116
49351
  }
49117
49352
  });
49118
49353
 
@@ -50114,7 +50349,7 @@ function CourseRegistrationWizard(props2) {
50114
50349
  handleRetry,
50115
50350
  handleBookingModeChange
50116
50351
  } = useCourseRegistrationWizard(props2);
50117
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
50352
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
50118
50353
  if (scopedCourses.length === 0) {
50119
50354
  return /* @__PURE__ */ jsx112(
50120
50355
  "div",
@@ -50524,7 +50759,7 @@ var init_CourseRegistrationWizard = __esm({
50524
50759
  init_PaymentFailedStep2();
50525
50760
  init_VerifyingTimeoutStep2();
50526
50761
  init_spinner2();
50527
- init_themedButtonClass();
50762
+ init_buttons();
50528
50763
  }
50529
50764
  });
50530
50765
 
@@ -51258,7 +51493,11 @@ function PassesMembershipsController({ render }) {
51258
51493
  "button",
51259
51494
  {
51260
51495
  type: "button",
51261
- className: "secondary btn-sm shop__return-dismiss",
51496
+ className: themeButtonClassName({
51497
+ variant: "secondary",
51498
+ size: "sm",
51499
+ extraClassName: "shop__return-dismiss"
51500
+ }),
51262
51501
  onClick: () => dispatch({ type: "clearReturnNotice" }),
51263
51502
  children: "Dismiss"
51264
51503
  }
@@ -51275,7 +51514,11 @@ function PassesMembershipsController({ render }) {
51275
51514
  "button",
51276
51515
  {
51277
51516
  type: "button",
51278
- className: "default shop__cta",
51517
+ className: themeButtonClassName({
51518
+ variant: "default",
51519
+ size: "md",
51520
+ extraClassName: "shop__cta"
51521
+ }),
51279
51522
  onClick: () => handleBuyPass(pass),
51280
51523
  children: passDisplay.actionLabel
51281
51524
  }
@@ -51302,7 +51545,11 @@ function PassesMembershipsController({ render }) {
51302
51545
  "button",
51303
51546
  {
51304
51547
  type: "button",
51305
- className: "default shop__cta",
51548
+ className: themeButtonClassName({
51549
+ variant: "default",
51550
+ size: "md",
51551
+ extraClassName: "shop__cta"
51552
+ }),
51306
51553
  onClick: () => handleSubscribe(membership),
51307
51554
  children: membershipDisplay.actionLabel
51308
51555
  }
@@ -51346,12 +51593,20 @@ function PassesMembershipsController({ render }) {
51346
51593
  ] }) : null
51347
51594
  ] }),
51348
51595
  /* @__PURE__ */ jsxs87(ActionRow, { className: "shop__modal-warning-actions", children: [
51349
- /* @__PURE__ */ jsx118("button", { type: "button", className: "secondary", onClick: closeCheckout, children: "Cancel" }),
51350
51596
  /* @__PURE__ */ jsx118(
51351
51597
  "button",
51352
51598
  {
51353
51599
  type: "button",
51354
- className: "default",
51600
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
51601
+ onClick: closeCheckout,
51602
+ children: "Cancel"
51603
+ }
51604
+ ),
51605
+ /* @__PURE__ */ jsx118(
51606
+ "button",
51607
+ {
51608
+ type: "button",
51609
+ className: themeButtonClassName({ variant: "default", size: "md" }),
51355
51610
  onClick: handleConfirmDuplicate,
51356
51611
  disabled: checkout2.submitting,
51357
51612
  children: checkout2.submitting ? "Processing..." : "Subscribe Anyway"
@@ -51394,8 +51649,25 @@ function PassesMembershipsController({ render }) {
51394
51649
  ] }),
51395
51650
  checkout2.formError ? /* @__PURE__ */ jsx118("p", { className: "shop__modal-error", role: "alert", children: checkout2.formError }) : null,
51396
51651
  /* @__PURE__ */ jsxs87(ActionRow, { className: "shop__modal-actions", children: [
51397
- /* @__PURE__ */ jsx118("button", { type: "button", className: "secondary", onClick: closeCheckout, disabled: checkout2.submitting, children: "Cancel" }),
51398
- /* @__PURE__ */ jsx118("button", { type: "submit", className: "default", disabled: checkout2.submitting, children: checkout2.submitting ? "Processing..." : "Continue to Payment" })
51652
+ /* @__PURE__ */ jsx118(
51653
+ "button",
51654
+ {
51655
+ type: "button",
51656
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
51657
+ onClick: closeCheckout,
51658
+ disabled: checkout2.submitting,
51659
+ children: "Cancel"
51660
+ }
51661
+ ),
51662
+ /* @__PURE__ */ jsx118(
51663
+ "button",
51664
+ {
51665
+ type: "submit",
51666
+ className: themeButtonClassName({ variant: "default", size: "md" }),
51667
+ disabled: checkout2.submitting,
51668
+ children: checkout2.submitting ? "Processing..." : "Continue to Payment"
51669
+ }
51670
+ )
51399
51671
  ] })
51400
51672
  ] })
51401
51673
  ] })
@@ -51408,6 +51680,7 @@ var init_shop_client = __esm({
51408
51680
  "../blocks/src/system/runtime/nodes/shop.client.tsx"() {
51409
51681
  "use strict";
51410
51682
  "use client";
51683
+ init_buttons();
51411
51684
  init_api();
51412
51685
  init_ModalShell();
51413
51686
  init_shared7();
@@ -51622,7 +51895,7 @@ var init_embla_carousel_autoplay_esm = __esm({
51622
51895
  function isObject(subject) {
51623
51896
  return Object.prototype.toString.call(subject) === "[object Object]";
51624
51897
  }
51625
- function isRecord4(subject) {
51898
+ function isRecord5(subject) {
51626
51899
  return isObject(subject) || Array.isArray(subject);
51627
51900
  }
51628
51901
  function canUseDOM() {
@@ -51639,7 +51912,7 @@ function areOptionsEqual(optionsA, optionsB) {
51639
51912
  const valueA = optionsA[key];
51640
51913
  const valueB = optionsB[key];
51641
51914
  if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
51642
- if (!isRecord4(valueA) || !isRecord4(valueB)) return valueA === valueB;
51915
+ if (!isRecord5(valueA) || !isRecord5(valueB)) return valueA === valueB;
51643
51916
  return areOptionsEqual(valueA, valueB);
51644
51917
  });
51645
51918
  }
@@ -53733,7 +54006,7 @@ function ProductListController(props2) {
53733
54006
  "button",
53734
54007
  {
53735
54008
  type: "button",
53736
- className: "default",
54009
+ className: themeButtonClassName({ variant: "default", size: "md" }),
53737
54010
  onClick: () => {
53738
54011
  const product = props2.render.hydration.products.find((candidate) => candidate.id === card.productId);
53739
54012
  if (!product) return;
@@ -53749,7 +54022,14 @@ function ProductListController(props2) {
53749
54022
  children: card.soldOut ? "Sold out" : card.actionLabel
53750
54023
  }
53751
54024
  ),
53752
- card.path ? /* @__PURE__ */ jsx120("a", { href: card.path, className: "secondary btn-sm", children: "View details" }) : null
54025
+ card.path ? /* @__PURE__ */ jsx120(
54026
+ "a",
54027
+ {
54028
+ href: card.path,
54029
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54030
+ children: "View details"
54031
+ }
54032
+ ) : null
53753
54033
  ] }),
53754
54034
  feedback: /* @__PURE__ */ jsx120(
53755
54035
  ShopAddFeedback,
@@ -53815,7 +54095,7 @@ function ProductDetailController(props2) {
53815
54095
  "button",
53816
54096
  {
53817
54097
  type: "button",
53818
- className: "default",
54098
+ className: themeButtonClassName({ variant: "default", size: "md" }),
53819
54099
  disabled: display.soldOut,
53820
54100
  onClick: () => {
53821
54101
  if (!selectedProduct) return;
@@ -53865,15 +54145,31 @@ function CartController(props2) {
53865
54145
  onChange: item.quantityEditable ? (event) => cart2.updateQuantity(item.key, Number(event.target.value)) : void 0
53866
54146
  }
53867
54147
  ),
53868
- /* @__PURE__ */ jsx120("button", { type: "button", className: "secondary btn-sm", onClick: () => cart2.removeItem(item.key), children: "Remove" })
54148
+ /* @__PURE__ */ jsx120(
54149
+ "button",
54150
+ {
54151
+ type: "button",
54152
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54153
+ onClick: () => cart2.removeItem(item.key),
54154
+ children: "Remove"
54155
+ }
54156
+ )
53869
54157
  ] }),
53870
54158
  footerActions: /* @__PURE__ */ jsxs89(Fragment21, { children: [
53871
- /* @__PURE__ */ jsx120("button", { type: "button", className: "secondary btn-sm", onClick: () => cart2.clear(), children: display.clearButtonText }),
53872
54159
  /* @__PURE__ */ jsx120(
53873
54160
  "button",
53874
54161
  {
53875
54162
  type: "button",
53876
- className: "default",
54163
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54164
+ onClick: () => cart2.clear(),
54165
+ children: display.clearButtonText
54166
+ }
54167
+ ),
54168
+ /* @__PURE__ */ jsx120(
54169
+ "button",
54170
+ {
54171
+ type: "button",
54172
+ className: themeButtonClassName({ variant: "default", size: "md" }),
53877
54173
  onClick: () => {
53878
54174
  window.location.href = resolveDedicatedCheckoutPath(window.location.pathname);
53879
54175
  },
@@ -53979,7 +54275,15 @@ function CheckoutController(props2) {
53979
54275
  )
53980
54276
  ] }),
53981
54277
  state.feedback.tag === "error" ? /* @__PURE__ */ jsx120("p", { className: "rb-caption status-muted", children: state.feedback.message }) : null,
53982
- /* @__PURE__ */ jsx120("button", { type: "submit", className: "default", disabled: state.submission === "submitting", children: state.submission === "submitting" ? "Loading\u2026" : display.submitButtonText })
54278
+ /* @__PURE__ */ jsx120(
54279
+ "button",
54280
+ {
54281
+ type: "submit",
54282
+ className: themeButtonClassName({ variant: "default", size: "md" }),
54283
+ disabled: state.submission === "submitting",
54284
+ children: state.submission === "submitting" ? "Loading\u2026" : display.submitButtonText
54285
+ }
54286
+ )
53983
54287
  ] })
53984
54288
  }
53985
54289
  );
@@ -53989,6 +54293,7 @@ var init_shop_commerce = __esm({
53989
54293
  "../blocks/src/system/runtime/nodes/shop-commerce.tsx"() {
53990
54294
  "use strict";
53991
54295
  "use client";
54296
+ init_buttons();
53992
54297
  init_api();
53993
54298
  init_RichText();
53994
54299
  init_carousel_client();
@@ -54099,7 +54404,7 @@ function HeaderCartDrawerItems(props2) {
54099
54404
  "button",
54100
54405
  {
54101
54406
  type: "button",
54102
- className: "secondary btn-sm",
54407
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54103
54408
  onClick: () => props2.cart.removeItem(item.key),
54104
54409
  children: "Remove"
54105
54410
  }
@@ -54192,7 +54497,7 @@ function HeaderCartDrawer(props2) {
54192
54497
  "button",
54193
54498
  {
54194
54499
  type: "button",
54195
- className: "secondary",
54500
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
54196
54501
  onClick: () => props2.cart.clear(),
54197
54502
  disabled: display.state === "empty",
54198
54503
  children: display.clearButtonText
@@ -54201,12 +54506,20 @@ function HeaderCartDrawer(props2) {
54201
54506
  props2.checkoutHref && display.state === "ready" ? /* @__PURE__ */ jsx125(
54202
54507
  "a",
54203
54508
  {
54204
- className: "default",
54509
+ className: themeButtonClassName({ variant: "default", size: "md" }),
54205
54510
  href: props2.checkoutHref,
54206
54511
  onClick: props2.onClose,
54207
54512
  children: display.checkoutButtonText
54208
54513
  }
54209
- ) : /* @__PURE__ */ jsx125("button", { type: "button", className: "default", disabled: true, children: display.checkoutButtonText })
54514
+ ) : /* @__PURE__ */ jsx125(
54515
+ "button",
54516
+ {
54517
+ type: "button",
54518
+ className: themeButtonClassName({ variant: "default", size: "md" }),
54519
+ disabled: true,
54520
+ children: display.checkoutButtonText
54521
+ }
54522
+ )
54210
54523
  ] })
54211
54524
  ]
54212
54525
  }
@@ -54219,6 +54532,7 @@ var init_HeaderCartDrawer = __esm({
54219
54532
  "../blocks/src/system/runtime/header/HeaderCartDrawer.tsx"() {
54220
54533
  "use strict";
54221
54534
  "use client";
54535
+ init_buttons();
54222
54536
  init_display();
54223
54537
  init_ModalShell();
54224
54538
  }
@@ -54914,7 +55228,7 @@ var init_EventPaginatedListView_client = __esm({
54914
55228
  init_EventCompactRow();
54915
55229
  init_EmptyState();
54916
55230
  init_EventListing_view();
54917
- init_themedButtonClass();
55231
+ init_buttons();
54918
55232
  EventPaginatedListView = ({
54919
55233
  filters,
54920
55234
  display,
@@ -54957,7 +55271,7 @@ var init_EventPaginatedListView_client = __esm({
54957
55271
  {
54958
55272
  type: "button",
54959
55273
  onClick: loadMore,
54960
- className: themedButtonClass({
55274
+ className: themeButtonClassName({
54961
55275
  variant: display.buttonVariant,
54962
55276
  size: "md"
54963
55277
  }),
@@ -54971,7 +55285,7 @@ var init_EventPaginatedListView_client = __esm({
54971
55285
  type: "button",
54972
55286
  onClick: loadMore,
54973
55287
  disabled: loading,
54974
- className: themedButtonClass({
55288
+ className: themeButtonClassName({
54975
55289
  variant: display.buttonVariant,
54976
55290
  size: "md",
54977
55291
  extraClassName: loading ? "rb-opacity-50 rb-cursor-wait" : null
@@ -54983,7 +55297,7 @@ var init_EventPaginatedListView_client = __esm({
54983
55297
  "a",
54984
55298
  {
54985
55299
  href: seeAllUrl,
54986
- className: themedButtonClass({
55300
+ className: themeButtonClassName({
54987
55301
  variant: display.buttonVariant,
54988
55302
  size: "md"
54989
55303
  }),
@@ -56333,7 +56647,7 @@ var init_EventCombined_client = __esm({
56333
56647
  init_EventModalContext();
56334
56648
  init_EventModals();
56335
56649
  init_utils();
56336
- init_themedButtonClass();
56650
+ init_buttons();
56337
56651
  EventCombinedClient = ({
56338
56652
  events: initialEvents,
56339
56653
  siteId,
@@ -56659,7 +56973,7 @@ var init_EventCombined_client = __esm({
56659
56973
  {
56660
56974
  type: "button",
56661
56975
  onClick: goToToday,
56662
- className: themedButtonClass({ variant: buttonVariant, size: "sm" }),
56976
+ className: themeButtonClassName({ variant: buttonVariant, size: "sm" }),
56663
56977
  children: "Today"
56664
56978
  }
56665
56979
  )
@@ -56976,7 +57290,7 @@ var init_EventCalendar_client = __esm({
56976
57290
  init_EventModalContext();
56977
57291
  init_EventModals();
56978
57292
  init_WeekTimetableView();
56979
- init_themedButtonClass();
57293
+ init_buttons();
56980
57294
  EventCalendarClient = ({
56981
57295
  render
56982
57296
  }) => {
@@ -57265,7 +57579,7 @@ var init_EventCalendar_client = __esm({
57265
57579
  {
57266
57580
  type: "button",
57267
57581
  onClick: onToday,
57268
- className: themedButtonClass({
57582
+ className: themeButtonClassName({
57269
57583
  variant: display.buttonVariant,
57270
57584
  size: "sm"
57271
57585
  }),
@@ -57281,7 +57595,7 @@ var init_EventCalendar_client = __esm({
57281
57595
  {
57282
57596
  type: "button",
57283
57597
  onClick: onToday,
57284
- className: themedButtonClass({
57598
+ className: themeButtonClassName({
57285
57599
  variant: display.buttonVariant,
57286
57600
  size: "sm"
57287
57601
  }),
@@ -57379,7 +57693,7 @@ var init_form_client = __esm({
57379
57693
  init_client2();
57380
57694
  init_src3();
57381
57695
  init_useFormSubmission();
57382
- init_themedButtonClass();
57696
+ init_buttons();
57383
57697
  FormNodeClient = ({
57384
57698
  render
57385
57699
  }) => {
@@ -57521,7 +57835,7 @@ var init_form_client = __esm({
57521
57835
  "button",
57522
57836
  {
57523
57837
  type: "submit",
57524
- className: themedButtonClass({
57838
+ className: themeButtonClassName({
57525
57839
  variant: "primary",
57526
57840
  size: "md",
57527
57841
  extraClassName: "rb-w-full rb-sm-w-auto"
@@ -57648,7 +57962,7 @@ function NewsletterFormClient({
57648
57962
  "button",
57649
57963
  {
57650
57964
  type: "submit",
57651
- className: themedButtonClass({ variant: "primary", size: "md" }),
57965
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
57652
57966
  disabled: isSubmitting,
57653
57967
  children: isSubmitting ? "Subscribing..." : render.display.buttonLabel
57654
57968
  }
@@ -57666,7 +57980,7 @@ var init_newsletter_form_client = __esm({
57666
57980
  init_client2();
57667
57981
  init_src3();
57668
57982
  init_api();
57669
- init_themedButtonClass();
57983
+ init_buttons();
57670
57984
  }
57671
57985
  });
57672
57986
 
@@ -60515,6 +60829,63 @@ var ENDPOINT_DEFINITIONS = {
60515
60829
  auth: "user",
60516
60830
  responseKind: "json"
60517
60831
  },
60832
+ updateRegisteredDomainContact: {
60833
+ path: "/domains/{domainId}/registrar/contact",
60834
+ method: "POST",
60835
+ errors: [
60836
+ "validation:invalid_input",
60837
+ "resource:not_found",
60838
+ "auth:forbidden",
60839
+ "external:service_error",
60840
+ "external:registrar_orphaned_contact_profile",
60841
+ "server:internal_error"
60842
+ ],
60843
+ tags: ["domains", "domain-{domainId}", "domain-registrar"],
60844
+ auth: "user",
60845
+ responseKind: "json"
60846
+ },
60847
+ setRegisteredDomainPrivacy: {
60848
+ path: "/domains/{domainId}/registrar/privacy",
60849
+ method: "POST",
60850
+ errors: [
60851
+ "validation:invalid_input",
60852
+ "resource:not_found",
60853
+ "auth:forbidden",
60854
+ "external:service_error",
60855
+ "server:internal_error"
60856
+ ],
60857
+ tags: ["domains", "domain-{domainId}", "domain-registrar"],
60858
+ auth: "user",
60859
+ responseKind: "json"
60860
+ },
60861
+ setRegisteredDomainAutoRenew: {
60862
+ path: "/domains/{domainId}/registrar/auto-renew",
60863
+ method: "POST",
60864
+ errors: [
60865
+ "validation:invalid_input",
60866
+ "resource:not_found",
60867
+ "auth:forbidden",
60868
+ "external:service_error",
60869
+ "server:internal_error"
60870
+ ],
60871
+ tags: ["domains", "domain-{domainId}", "domain-registrar"],
60872
+ auth: "user",
60873
+ responseKind: "json"
60874
+ },
60875
+ getRegisteredDomainRenewalPosture: {
60876
+ path: "/domains/{domainId}/registrar/renewal",
60877
+ method: "GET",
60878
+ errors: [
60879
+ "validation:invalid_input",
60880
+ "resource:not_found",
60881
+ "auth:forbidden",
60882
+ "external:service_error",
60883
+ "server:internal_error"
60884
+ ],
60885
+ tags: ["domains", "domain-{domainId}", "domain-registrar"],
60886
+ auth: "user",
60887
+ responseKind: "json"
60888
+ },
60518
60889
  retryDomainVercel: {
60519
60890
  path: "/domains/{domainId}/vercel",
60520
60891
  method: "POST",
@@ -65542,6 +65913,9 @@ function validationContext(options = {}) {
65542
65913
  allowIncomplete: isDraft || (options.allowIncomplete ?? false)
65543
65914
  };
65544
65915
  }
65916
+ function formatFieldPath(path) {
65917
+ return path.map((segment) => String(segment)).join(".");
65918
+ }
65545
65919
  function fieldIssueToMessage(issue2) {
65546
65920
  switch (issue2.kind) {
65547
65921
  case "required":
@@ -65765,7 +66139,7 @@ function normalizeRepeaterItems(plan, value, ctx) {
65765
66139
  return normalizeObjectChildren(fields3, itemRecord, ctx);
65766
66140
  });
65767
66141
  }
65768
- function normalizeNumberInput(value, allowNull) {
66142
+ function normalizeNumberInput(value, _allowNull) {
65769
66143
  if (value === "") return void 0;
65770
66144
  if (typeof value === "string" && value.trim() !== "") return Number(value);
65771
66145
  return value;
@@ -65897,7 +66271,7 @@ function validateRepeaterItem(plan, item, index, ctx) {
65897
66271
  const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemType)?.fields : plan.repeatedItemPlan;
65898
66272
  if (!fields3) return [];
65899
66273
  return fields3.flatMap((childPlan) => {
65900
- const indexedPlan = withIndexedPath(childPlan, plan.path, index);
66274
+ const indexedPlan = materializeRepeaterItemPlan(childPlan, plan.path, index);
65901
66275
  return validateNormalizedFieldValue(indexedPlan, item[childPlan.fieldId], ctx);
65902
66276
  });
65903
66277
  }
@@ -65909,12 +66283,58 @@ function validateGroupPlan(plan, value, ctx) {
65909
66283
  function childValidationContext(plan, ctx) {
65910
66284
  return plan.allowNullChildren ? { ...ctx, allowNull: true } : ctx;
65911
66285
  }
65912
- function withIndexedPath(plan, parentPath, index) {
65913
- const suffix = plan.path.slice(parentPath.length + 1);
65914
- return {
65915
- ...plan,
65916
- path: [...parentPath, index, plan.fieldId, ...suffix]
65917
- };
66286
+ function materializeRepeaterItemPlan(plan, parentPath, index) {
66287
+ return rebaseFieldPlanPath(plan, [...parentPath, 0], [...parentPath, index]);
66288
+ }
66289
+ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
66290
+ const path = rebaseFieldPath(plan.path, fromPrefix, toPrefix);
66291
+ switch (plan.kind) {
66292
+ case "group":
66293
+ return {
66294
+ ...plan,
66295
+ path,
66296
+ children: plan.children.map((childPlan) => rebaseFieldPlanPath(childPlan, fromPrefix, toPrefix))
66297
+ };
66298
+ case "repeater":
66299
+ return {
66300
+ ...plan,
66301
+ path,
66302
+ ...plan.repeatedItemVariants ? {
66303
+ repeatedItemVariants: plan.repeatedItemVariants.map((variant) => ({
66304
+ ...variant,
66305
+ fields: variant.fields.map((fieldPlan) => rebaseFieldPlanPath(fieldPlan, fromPrefix, toPrefix))
66306
+ }))
66307
+ } : {},
66308
+ ...plan.repeatedItemPlan ? {
66309
+ repeatedItemPlan: plan.repeatedItemPlan.map(
66310
+ (fieldPlan) => rebaseFieldPlanPath(fieldPlan, fromPrefix, toPrefix)
66311
+ )
66312
+ } : {}
66313
+ };
66314
+ case "string":
66315
+ case "number":
66316
+ case "boolean":
66317
+ case "richText":
66318
+ case "media":
66319
+ case "link":
66320
+ case "select":
66321
+ case "passthrough":
66322
+ return {
66323
+ ...plan,
66324
+ path
66325
+ };
66326
+ default:
66327
+ return assertNever4(plan);
66328
+ }
66329
+ }
66330
+ function rebaseFieldPath(path, fromPrefix, toPrefix) {
66331
+ if (!startsWithFieldPath(path, fromPrefix)) {
66332
+ throw new Error(`Cannot rebase field path ${formatFieldPath(path)} from ${formatFieldPath(fromPrefix)}`);
66333
+ }
66334
+ return [...toPrefix, ...path.slice(fromPrefix.length)];
66335
+ }
66336
+ function startsWithFieldPath(path, prefix) {
66337
+ return prefix.every((segment, index) => path[index] === segment);
65918
66338
  }
65919
66339
  function issue(plan, kind, extra) {
65920
66340
  return {
@@ -76323,13 +76743,13 @@ function hydrateValue(value, context) {
76323
76743
  return isUnchanged ? value : resolvedItems;
76324
76744
  }
76325
76745
  if (isRecord3(value)) {
76326
- if (isInternalLink2(value)) {
76746
+ if (isInternalLink(value)) {
76327
76747
  return hydrateInternalLink(value, context.routes);
76328
76748
  }
76329
- if (isPageLink2(value)) {
76749
+ if (isPageLink(value)) {
76330
76750
  return hydratePageLink(value, context);
76331
76751
  }
76332
- if (isEntryLink2(value)) {
76752
+ if (isEntryLink(value)) {
76333
76753
  return hydrateEntryLink(value, context);
76334
76754
  }
76335
76755
  const resolvedEntries = Object.entries(value).map(([key, entry]) => [key, hydrateValue(entry, context)]);
@@ -76359,7 +76779,7 @@ function hydrateInternalLink(link2, routes) {
76359
76779
  }
76360
76780
  return Object.keys(updates).length > 0 ? { ...link2, ...updates } : link2;
76361
76781
  }
76362
- function isInternalLink2(value) {
76782
+ function isInternalLink(value) {
76363
76783
  if (value.kind !== "internal") {
76364
76784
  return false;
76365
76785
  }
@@ -76368,7 +76788,7 @@ function isInternalLink2(value) {
76368
76788
  }
76369
76789
  return true;
76370
76790
  }
76371
- function isPageLink2(value) {
76791
+ function isPageLink(value) {
76372
76792
  if (value.kind !== "page") {
76373
76793
  return false;
76374
76794
  }
@@ -76384,7 +76804,7 @@ function hydratePageLink(link2, context) {
76384
76804
  }
76385
76805
  return { ...link2, href: resolved.href, routeId: resolved.routeId };
76386
76806
  }
76387
- function isEntryLink2(value) {
76807
+ function isEntryLink(value) {
76388
76808
  if (value.kind !== "entry") {
76389
76809
  return false;
76390
76810
  }
@@ -78572,6 +78992,9 @@ function normalizeLoaderParams(endpoint, params, context) {
78572
78992
  init_media2();
78573
78993
  init_colorStyles();
78574
78994
 
78995
+ // ../api/src/navigation/linkValue.ts
78996
+ init_src();
78997
+
78575
78998
  // ../api/src/aiPlayground.ts
78576
78999
  import { z as z66 } from "zod";
78577
79000
  var Rfc6902PatchOp = z66.discriminatedUnion("op", [
@@ -79797,7 +80220,7 @@ var SimpleCache = class {
79797
80220
  };
79798
80221
 
79799
80222
  // src/version.ts
79800
- var SDK_VERSION = "0.60.9";
80223
+ var SDK_VERSION = "0.60.12";
79801
80224
 
79802
80225
  // src/client/error.ts
79803
80226
  var RiverbankApiError = class _RiverbankApiError extends Error {