@riverbankcms/sdk 0.60.6 → 0.60.9

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 (103) hide show
  1. package/dist/_dts/api/src/appointmentSetup.d.ts +2 -2
  2. package/dist/_dts/api/src/bookingConfig.d.ts +6 -0
  3. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +45 -3
  4. package/dist/_dts/api/src/bookingOperations.d.ts +40 -3
  5. package/dist/_dts/api/src/courses.d.ts +1 -5
  6. package/dist/_dts/api/src/endpoints.d.ts +80 -1
  7. package/dist/_dts/api/src/index.d.ts +3 -2
  8. package/dist/_dts/api/src/navigation/contracts.d.ts +9 -9
  9. package/dist/_dts/api/src/navigation/linkValue.d.ts +1 -1
  10. package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
  11. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +15 -1
  12. package/dist/_dts/api/src/resources.d.ts +1 -1
  13. package/dist/_dts/api/src/siteBanner.d.ts +8 -8
  14. package/dist/_dts/api/src/siteOnboarding.d.ts +1 -0
  15. package/dist/_dts/api/src/teamMembers.d.ts +27 -0
  16. package/dist/_dts/blocks/src/index.d.ts +2 -1
  17. package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +35 -29
  18. package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +1 -5
  19. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +40 -34
  20. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -5
  21. package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +1 -1
  22. package/dist/_dts/blocks/src/system/blocks/products/shared.d.ts +2 -2
  23. package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +9 -9
  24. package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +24 -0
  25. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +18 -8
  26. package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
  27. package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
  28. package/dist/_dts/blocks/src/system/data/utils.d.ts +1 -1
  29. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +185 -0
  30. package/dist/_dts/blocks/src/system/manifest/index.d.ts +1 -0
  31. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +201 -201
  32. package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -84
  33. package/dist/_dts/blocks/src/system/node/schema.d.ts +5 -5
  34. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
  35. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +4 -4
  36. package/dist/_dts/blocks/src/system/transforms/registry/ui.d.ts +1 -1
  37. package/dist/_dts/blocks/src/system/transforms/typed.d.ts +3 -3
  38. package/dist/_dts/blocks/src/system/types/link.d.ts +93 -1
  39. package/dist/_dts/content-model/src/content-types/schema.d.ts +8 -8
  40. package/dist/_dts/content-model/src/metadataConfig.d.ts +1 -0
  41. package/dist/_dts/core/src/branded.d.ts +2 -0
  42. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +124 -8
  43. package/dist/_dts/db/src/schemas/forms.d.ts +85 -64
  44. package/dist/_dts/editor-blocks/src/widgets/link/LinkSummary.d.ts +1 -1
  45. package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +1 -1
  46. package/dist/_dts/editor-blocks/src/widgets/link/utils.d.ts +1 -1
  47. package/dist/_dts/sdk/src/client/types.d.ts +9 -2
  48. package/dist/_dts/sdk/src/config/typed-entries.d.ts +36 -1
  49. package/dist/_dts/sdk/src/config/types.d.ts +1 -1
  50. package/dist/_dts/sdk/src/config/validation.d.ts +40 -37
  51. package/dist/_dts/sdk/src/contracts/content.d.ts +6 -1
  52. package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
  53. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +18 -8
  54. package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +1 -1
  55. package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +19 -19
  56. package/dist/_dts/sdk/src/public-api/contracts.d.ts +87 -69
  57. package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
  58. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -5
  59. package/dist/_dts/sdk/src/version.d.ts +1 -1
  60. package/dist/_dts/theme-core/src/accordions/types.d.ts +11 -11
  61. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +10 -10
  62. package/dist/_dts/theme-core/src/buttons/types.d.ts +27 -27
  63. package/dist/_dts/theme-core/src/cards/types.d.ts +17 -17
  64. package/dist/_dts/theme-core/src/inputs/types.d.ts +14 -14
  65. package/dist/_dts/theme-core/src/interactive/baseSchema.d.ts +2 -2
  66. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +438 -438
  67. package/dist/_dts/theme-core/src/navigation/types.d.ts +16 -16
  68. package/dist/_dts/theme-core/src/palette/variants/types.d.ts +15 -15
  69. package/dist/_dts/theme-core/src/schema.d.ts +662 -662
  70. package/dist/_dts/theme-core/src/shared/componentStyles.d.ts +4 -4
  71. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +15 -15
  72. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +7 -7
  73. package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
  74. package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +5 -5
  75. package/dist/_dts/ui/src/badge.d.ts +1 -1
  76. package/dist/_dts/ui/src/button-group.d.ts +1 -1
  77. package/dist/_dts/ui/src/button.d.ts +2 -2
  78. package/dist/_dts/ui/src/callout.d.ts +1 -1
  79. package/dist/_dts/ui/src/card.d.ts +1 -1
  80. package/dist/_dts/ui/src/surface.d.ts +2 -2
  81. package/dist/_dts/ui/src/toggle.d.ts +4 -4
  82. package/dist/cli/index.mjs +951 -451
  83. package/dist/client/client.mjs +39490 -38952
  84. package/dist/client/hooks.mjs +1992 -1741
  85. package/dist/client/rendering/client.mjs +179 -130
  86. package/dist/client/rendering/islands.mjs +68 -43
  87. package/dist/client/rendering.mjs +1812 -1292
  88. package/dist/preview-next/before-render.mjs +147 -1
  89. package/dist/preview-next/client/runtime.mjs +1377 -829
  90. package/dist/preview-next/middleware.mjs +147 -1
  91. package/dist/server/components.mjs +3246 -2751
  92. package/dist/server/config-validation.mjs +2198 -1962
  93. package/dist/server/config.mjs +2198 -1962
  94. package/dist/server/data.mjs +1992 -1741
  95. package/dist/server/index.mjs +168 -2
  96. package/dist/server/next.mjs +3230 -2701
  97. package/dist/server/page-converter.mjs +345 -259
  98. package/dist/server/prebuild.mjs +1 -1
  99. package/dist/server/rendering/server.mjs +3274 -2763
  100. package/dist/server/rendering.mjs +3274 -2763
  101. package/dist/server/routing.mjs +530 -309
  102. package/dist/server/server.mjs +2011 -1742
  103. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
  import * as ReactDOM5 from 'react-dom';
6
6
  import ReactDOM5__default, { createPortal, unstable_batchedUpdates } from 'react-dom';
7
7
  import deepEqual6 from 'fast-deep-equal';
8
- import z37, { z } from 'zod';
8
+ import z38, { z } from 'zod';
9
9
  import { QueryClient, MutationCache, QueryCache, QueryClientProvider, useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
10
10
  import { createRoot } from 'react-dom/client';
11
11
  import { useRouter } from 'next/navigation';
@@ -1049,13 +1049,150 @@ var init_endpoints = __esm({
1049
1049
  "server:internal_error"
1050
1050
  ]
1051
1051
  },
1052
- deleteAppointmentResource: {
1052
+ removeAppointmentResource: {
1053
1053
  path: "/sites/{siteId}/bookings/resources/{resourceId}",
1054
1054
  method: "DELETE",
1055
1055
  auth: "user",
1056
1056
  responseKind: "json",
1057
1057
  errors: ["resource:not_found", "server:internal_error"]
1058
1058
  },
1059
+ createTeamMemberProfile: {
1060
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile",
1061
+ method: "POST",
1062
+ auth: "user",
1063
+ responseKind: "json",
1064
+ errors: [
1065
+ "validation:invalid_input",
1066
+ "resource:not_found",
1067
+ "resource:conflict",
1068
+ "server:internal_error"
1069
+ ]
1070
+ },
1071
+ updateTeamMemberProfilePolicy: {
1072
+ path: "/sites/{siteId}/bookings/resources/profile-policy",
1073
+ method: "PUT",
1074
+ auth: "user",
1075
+ responseKind: "json",
1076
+ errors: ["validation:invalid_input", "server:internal_error"]
1077
+ },
1078
+ updateTeamMemberProfileContent: {
1079
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/content",
1080
+ method: "PUT",
1081
+ tags: [
1082
+ "site-{siteId}",
1083
+ "content-{siteId}-team-member",
1084
+ "content-entry-{entryId}"
1085
+ ],
1086
+ auth: "user",
1087
+ responseKind: "json",
1088
+ errors: [
1089
+ "validation:invalid_input",
1090
+ "resource:not_found",
1091
+ "resource:conflict",
1092
+ "server:internal_error"
1093
+ ]
1094
+ },
1095
+ publishTeamMemberProfile: {
1096
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/publish",
1097
+ method: "POST",
1098
+ tags: [
1099
+ "site-{siteId}",
1100
+ "content-{siteId}-team-member",
1101
+ "content-entry-{entryId}"
1102
+ ],
1103
+ auth: "user",
1104
+ responseKind: "json",
1105
+ errors: [
1106
+ "validation:invalid_input",
1107
+ "resource:not_found",
1108
+ "server:internal_error"
1109
+ ]
1110
+ },
1111
+ discardTeamMemberProfileDraft: {
1112
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/discard",
1113
+ method: "POST",
1114
+ tags: [
1115
+ "site-{siteId}",
1116
+ "content-{siteId}-team-member",
1117
+ "content-entry-{entryId}"
1118
+ ],
1119
+ auth: "user",
1120
+ responseKind: "json",
1121
+ errors: [
1122
+ "validation:invalid_input",
1123
+ "resource:not_found",
1124
+ "resource:conflict",
1125
+ "server:internal_error"
1126
+ ]
1127
+ },
1128
+ unpublishTeamMemberProfile: {
1129
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/unpublish",
1130
+ method: "POST",
1131
+ tags: [
1132
+ "site-{siteId}",
1133
+ "content-{siteId}-team-member",
1134
+ "content-entry-{entryId}"
1135
+ ],
1136
+ auth: "user",
1137
+ responseKind: "json",
1138
+ errors: [
1139
+ "validation:invalid_input",
1140
+ "resource:not_found",
1141
+ "resource:conflict",
1142
+ "server:internal_error"
1143
+ ]
1144
+ },
1145
+ scheduleTeamMemberProfile: {
1146
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/schedule",
1147
+ method: "POST",
1148
+ tags: [
1149
+ "site-{siteId}",
1150
+ "content-{siteId}-team-member",
1151
+ "content-entry-{entryId}"
1152
+ ],
1153
+ auth: "user",
1154
+ responseKind: "json",
1155
+ errors: [
1156
+ "validation:invalid_input",
1157
+ "resource:not_found",
1158
+ "resource:conflict",
1159
+ "server:internal_error"
1160
+ ]
1161
+ },
1162
+ cancelScheduledTeamMemberProfile: {
1163
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/schedule",
1164
+ method: "DELETE",
1165
+ tags: [
1166
+ "site-{siteId}",
1167
+ "content-{siteId}-team-member",
1168
+ "content-entry-{entryId}"
1169
+ ],
1170
+ auth: "user",
1171
+ responseKind: "json",
1172
+ errors: [
1173
+ "validation:invalid_input",
1174
+ "resource:not_found",
1175
+ "resource:conflict",
1176
+ "server:internal_error"
1177
+ ]
1178
+ },
1179
+ updateTeamMemberProfileRouteMetadata: {
1180
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/routes/{routeId}/metadata",
1181
+ method: "PATCH",
1182
+ tags: [
1183
+ TAG_TEMPLATES.siteCollection,
1184
+ TAG_TEMPLATES.siteRoutableContent,
1185
+ TAG_TEMPLATES.routeById
1186
+ ],
1187
+ auth: "user",
1188
+ responseKind: "json",
1189
+ errors: [
1190
+ "validation:invalid_input",
1191
+ "resource:not_found",
1192
+ "resource:conflict",
1193
+ "server:internal_error"
1194
+ ]
1195
+ },
1059
1196
  listAppointmentServices: {
1060
1197
  path: "/sites/{siteId}/bookings/services",
1061
1198
  method: "GET",
@@ -3429,6 +3566,15 @@ var init_endpoints = __esm({
3429
3566
  auth: "public",
3430
3567
  responseKind: "json"
3431
3568
  },
3569
+ listPublicTeamMembers: {
3570
+ path: "/public/sites/{siteId}/team-members",
3571
+ method: "GET",
3572
+ revalidate: 60,
3573
+ tags: ["public-team-members-{siteId}"],
3574
+ errors: [],
3575
+ auth: "public",
3576
+ responseKind: "json"
3577
+ },
3432
3578
  getPublicCourse: {
3433
3579
  path: "/public/sites/{siteId}/courses/{courseId}",
3434
3580
  method: "GET",
@@ -57636,7 +57782,7 @@ var init_index_esm = __esm({
57636
57782
  const isRadio = isRadioInput(ref);
57637
57783
  const isCheckBox = isCheckBoxInput(ref);
57638
57784
  const isRadioOrCheckbox = isRadio || isCheckBox;
57639
- const isEmpty2 = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement2(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
57785
+ const isEmpty = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement2(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
57640
57786
  const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
57641
57787
  const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
57642
57788
  const message2 = exceedMax ? maxLengthMessage : minLengthMessage;
@@ -57647,7 +57793,7 @@ var init_index_esm = __esm({
57647
57793
  ...appendErrorsCurry(exceedMax ? maxType : minType, message2)
57648
57794
  };
57649
57795
  };
57650
- if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox && (isEmpty2 || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
57796
+ if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
57651
57797
  const { value, message: message2 } = isString(required) ? { value: !!required, message: required } : getValueAndMessage(required);
57652
57798
  if (value) {
57653
57799
  error[name] = {
@@ -57662,7 +57808,7 @@ var init_index_esm = __esm({
57662
57808
  }
57663
57809
  }
57664
57810
  }
57665
- if (!isEmpty2 && (!isNullOrUndefined(min3) || !isNullOrUndefined(max3))) {
57811
+ if (!isEmpty && (!isNullOrUndefined(min3) || !isNullOrUndefined(max3))) {
57666
57812
  let exceedMax;
57667
57813
  let exceedMin;
57668
57814
  const maxOutput = getValueAndMessage(max3);
@@ -57695,7 +57841,7 @@ var init_index_esm = __esm({
57695
57841
  }
57696
57842
  }
57697
57843
  }
57698
- if ((maxLength || minLength) && !isEmpty2 && (isString(inputValue) || isFieldArray && Array.isArray(inputValue))) {
57844
+ if ((maxLength || minLength) && !isEmpty && (isString(inputValue) || isFieldArray && Array.isArray(inputValue))) {
57699
57845
  const maxLengthOutput = getValueAndMessage(maxLength);
57700
57846
  const minLengthOutput = getValueAndMessage(minLength);
57701
57847
  const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
@@ -57708,7 +57854,7 @@ var init_index_esm = __esm({
57708
57854
  }
57709
57855
  }
57710
57856
  }
57711
- if (pattern && !isEmpty2 && isString(inputValue)) {
57857
+ if (pattern && !isEmpty && isString(inputValue)) {
57712
57858
  const { value: patternValue, message: message2 } = getValueAndMessage(pattern);
57713
57859
  if (isRegex(patternValue) && !inputValue.match(patternValue)) {
57714
57860
  error[name] = {
@@ -88021,8 +88167,8 @@ var init_dist57 = __esm({
88021
88167
  if (empty2 || !allWasSelected) {
88022
88168
  return;
88023
88169
  }
88024
- const isEmpty2 = isNodeEmpty(newState.doc);
88025
- if (!isEmpty2) {
88170
+ const isEmpty = isNodeEmpty(newState.doc);
88171
+ if (!isEmpty) {
88026
88172
  return;
88027
88173
  }
88028
88174
  const tr3 = newState.tr;
@@ -91006,8 +91152,8 @@ var init_dist84 = __esm({
91006
91152
  const isEmptyDoc = this.editor.isEmpty;
91007
91153
  doc3.descendants((node, pos) => {
91008
91154
  const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
91009
- const isEmpty2 = !node.isLeaf && isNodeEmpty(node);
91010
- if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty2) {
91155
+ const isEmpty = !node.isLeaf && isNodeEmpty(node);
91156
+ if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
91011
91157
  const classes = [this.options.emptyNodeClass];
91012
91158
  if (isEmptyDoc) {
91013
91159
  classes.push(this.options.emptyEditorClass);
@@ -94234,7 +94380,7 @@ var init_dist86 = __esm({
94234
94380
  function RichTextEditorSurface({
94235
94381
  editor,
94236
94382
  config,
94237
- isEmpty: isEmpty2,
94383
+ isEmpty,
94238
94384
  className,
94239
94385
  contentClassName,
94240
94386
  placeholderClassName,
@@ -94268,7 +94414,7 @@ function RichTextEditorSurface({
94268
94414
  onClick,
94269
94415
  ...interactiveContentProps,
94270
94416
  children: [
94271
- isEmpty2 ? /* @__PURE__ */ jsx(
94417
+ isEmpty ? /* @__PURE__ */ jsx(
94272
94418
  "span",
94273
94419
  {
94274
94420
  className: cn2(
@@ -94514,7 +94660,7 @@ function useRichTextEditor({ content, editable, variant }) {
94514
94660
  const baseConfig = richTextConfigs[variant];
94515
94661
  const config = baseConfig;
94516
94662
  const [warnings, setWarnings] = useState({ unsupportedNodes: [], unsupportedMarks: [] });
94517
- const [isEmpty2, setIsEmpty] = useState(() => isDocEmpty(content));
94663
+ const [isEmpty, setIsEmpty] = useState(() => isDocEmpty(content));
94518
94664
  const editor = useEditor2(
94519
94665
  {
94520
94666
  extensions: config.extensions,
@@ -94558,7 +94704,7 @@ function useRichTextEditor({ content, editable, variant }) {
94558
94704
  };
94559
94705
  }, [editor]);
94560
94706
  const warningSummary = hasUnsupportedRichTextContent(warnings) ? formatUnsupportedRichTextSummary(warnings) : null;
94561
- return { editor, isEmpty: isEmpty2, config, warnings, warningSummary };
94707
+ return { editor, isEmpty, config, warnings, warningSummary };
94562
94708
  }
94563
94709
  function deepEqual4(a2, b3) {
94564
94710
  try {
@@ -96894,6 +97040,12 @@ var init_metadataConfig = __esm({
96894
97040
  "draftSlug",
96895
97041
  "draftStatus",
96896
97042
  "scheduledPublishAt"
97043
+ ],
97044
+ "team-member": [
97045
+ "draftTitle",
97046
+ "draftSlug",
97047
+ "draftStatus",
97048
+ "scheduledPublishAt"
96897
97049
  ]
96898
97050
  };
96899
97051
  EMPTY_METADATA_FIELDS = [];
@@ -97911,7 +98063,7 @@ function createRichTextDoc(paragraphs) {
97911
98063
  }))
97912
98064
  };
97913
98065
  }
97914
- var EXCERPT_FALLBACK, SUMMARY_FALLBACK, BODY_TEXT_BINDINGS, DEFAULT_TEMPLATE_DEFINITIONS;
98066
+ var EXCERPT_FALLBACK, SUMMARY_FALLBACK, BODY_TEXT_BINDINGS, TEAM_MEMBER_BODY_TEXT_BINDINGS, DEFAULT_TEMPLATE_DEFINITIONS;
97915
98067
  var init_defaults2 = __esm({
97916
98068
  "../content-model/src/templates/defaults.ts"() {
97917
98069
  init_types3();
@@ -97933,6 +98085,10 @@ var init_defaults2 = __esm({
97933
98085
  body: fieldBinding("body"),
97934
98086
  alignment: literalBinding("left")
97935
98087
  };
98088
+ TEAM_MEMBER_BODY_TEXT_BINDINGS = {
98089
+ body: fieldBinding("bio"),
98090
+ alignment: literalBinding("left")
98091
+ };
97936
98092
  DEFAULT_TEMPLATE_DEFINITIONS = {
97937
98093
  post: {
97938
98094
  templateKey: "default",
@@ -98082,6 +98238,28 @@ var init_defaults2 = __esm({
98082
98238
  }
98083
98239
  ]
98084
98240
  },
98241
+ "team-member": {
98242
+ templateKey: "default",
98243
+ name: "Team member profile",
98244
+ description: "Default layout for team member profile pages.",
98245
+ metadata: {},
98246
+ blocks: [
98247
+ {
98248
+ blockKind: "block.hero",
98249
+ scope: "entry",
98250
+ bindings: {
98251
+ eyebrow: literalBinding("About"),
98252
+ headline: metaBinding("title"),
98253
+ subheadline: fieldBinding("intro")
98254
+ }
98255
+ },
98256
+ {
98257
+ blockKind: "block.body-text",
98258
+ scope: "entry",
98259
+ bindings: TEAM_MEMBER_BODY_TEXT_BINDINGS
98260
+ }
98261
+ ]
98262
+ },
98085
98263
  product: {
98086
98264
  templateKey: "default",
98087
98265
  name: "Product detail",
@@ -98339,19 +98517,65 @@ var init_fieldPath = __esm({
98339
98517
  "../blocks/src/system/manifest/fieldPath.ts"() {
98340
98518
  }
98341
98519
  });
98342
-
98343
- // ../blocks/src/system/manifest/registry.ts
98344
- function registerManifest(manifest) {
98345
- manifestStore.set(manifest.name, manifest);
98346
- return manifest;
98520
+ function isInternalResolvedLinkValue(value) {
98521
+ return value?.kind === "internal" && "entityId" in value && "entityType" in value && "href" in value && "title" in value && "typeLabel" in value && typeof value.entityId === "string" && typeof value.entityType === "string" && typeof value.href === "string" && typeof value.title === "string" && typeof value.typeLabel === "string";
98347
98522
  }
98348
- var REGISTRY_SYMBOL, isVitest, globalScope, manifestStore;
98349
- var init_registry2 = __esm({
98350
- "../blocks/src/system/manifest/registry.ts"() {
98351
- REGISTRY_SYMBOL = /* @__PURE__ */ Symbol.for("@riverbankcms/blocks/manifest-registry");
98352
- isVitest = typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.VITEST === "true";
98353
- globalScope = globalThis;
98354
- manifestStore = isVitest ? /* @__PURE__ */ new Map() : globalScope[REGISTRY_SYMBOL] ?? (globalScope[REGISTRY_SYMBOL] = /* @__PURE__ */ new Map());
98523
+ var nullableString, resolvedInternalLinkKeys, internalRouteOnlyLinkSchema, internalResolvedLinkSchema, internalLinkSchema, externalLinkSchema, customLinkSchema, pageLinkSchema, entryLinkSchema, linkSchema;
98524
+ var init_link2 = __esm({
98525
+ "../blocks/src/system/types/link.ts"() {
98526
+ nullableString = z.union([z.string().min(1), z.null()]);
98527
+ resolvedInternalLinkKeys = ["entityId", "entityType", "href", "title", "typeLabel"];
98528
+ internalRouteOnlyLinkSchema = z.object({
98529
+ kind: z.literal("internal"),
98530
+ routeId: z.string().min(1)
98531
+ }).passthrough().superRefine((value, ctx) => {
98532
+ const hasResolvedMetadata = resolvedInternalLinkKeys.some((key) => value[key] != null);
98533
+ if (!hasResolvedMetadata) return;
98534
+ ctx.addIssue({
98535
+ code: "custom",
98536
+ message: "Internal links with resolved metadata must include entityId, entityType, href, title, and typeLabel"
98537
+ });
98538
+ });
98539
+ internalResolvedLinkSchema = z.object({
98540
+ kind: z.literal("internal"),
98541
+ routeId: z.string().min(1),
98542
+ entityId: z.string().min(1),
98543
+ entityType: z.enum(["page", "content"]),
98544
+ href: z.string().min(1),
98545
+ title: z.string().min(1),
98546
+ typeLabel: z.string().min(1),
98547
+ contentTypeKey: nullableString.optional(),
98548
+ contentTypeName: nullableString.optional(),
98549
+ updatedAt: nullableString.optional()
98550
+ }).passthrough();
98551
+ internalLinkSchema = z.union([
98552
+ internalResolvedLinkSchema,
98553
+ internalRouteOnlyLinkSchema
98554
+ ]);
98555
+ externalLinkSchema = z.object({
98556
+ kind: z.literal("external"),
98557
+ href: z.string().min(1)
98558
+ }).passthrough();
98559
+ customLinkSchema = z.object({
98560
+ kind: z.literal("url"),
98561
+ href: z.string().min(1)
98562
+ }).passthrough();
98563
+ pageLinkSchema = z.object({
98564
+ kind: z.literal("page"),
98565
+ identifier: z.string().min(1)
98566
+ }).passthrough();
98567
+ entryLinkSchema = z.object({
98568
+ kind: z.literal("entry"),
98569
+ contentType: z.string().min(1),
98570
+ identifier: z.string().min(1)
98571
+ }).passthrough();
98572
+ linkSchema = z.union([
98573
+ internalLinkSchema,
98574
+ externalLinkSchema,
98575
+ customLinkSchema,
98576
+ pageLinkSchema,
98577
+ entryLinkSchema
98578
+ ]);
98355
98579
  }
98356
98580
  });
98357
98581
 
@@ -100413,385 +100637,569 @@ var init_schema3 = __esm({
100413
100637
  });
100414
100638
  }
100415
100639
  });
100416
-
100417
- // ../blocks/src/lib/typeGuards.ts
100418
- function isRecord5(value) {
100419
- return typeof value === "object" && value !== null && !Array.isArray(value);
100420
- }
100421
- function isObjectRecord(value) {
100422
- return typeof value === "object" && value !== null;
100640
+ function assertNever5(value) {
100641
+ throw new Error(`Unhandled field validation variant: ${JSON.stringify(value)}`);
100423
100642
  }
100424
- var init_typeGuards2 = __esm({
100425
- "../blocks/src/lib/typeGuards.ts"() {
100426
- }
100427
- });
100428
- function buildRichTextSchema(options) {
100429
- let schema = RichTextValueSchema;
100430
- if (options?.required) {
100431
- const label = options.label ?? "This field";
100432
- schema = schema.refine(
100433
- (val) => {
100434
- const doc3 = isRecord5(val) && "doc" in val ? val.doc : val;
100435
- const content = isRecord5(doc3) ? doc3.content : void 0;
100436
- if (!Array.isArray(content) || content.length === 0) return false;
100437
- const first2 = content[0];
100438
- if (content.length === 1 && isRecord5(first2) && first2.type === "paragraph" && (!("content" in first2) || first2.content == null)) {
100439
- return false;
100440
- }
100441
- return true;
100442
- },
100443
- {
100444
- message: `${label} is required`
100445
- }
100446
- );
100643
+ function validationContext(options = {}) {
100644
+ const isDraft = options.mode === "draft";
100645
+ return {
100646
+ allowNull: options.allowNull ?? true,
100647
+ allowIncomplete: isDraft || (options.allowIncomplete ?? false)
100648
+ };
100649
+ }
100650
+ function fieldIssueToMessage(issue2) {
100651
+ switch (issue2.kind) {
100652
+ case "required":
100653
+ return "This field is required";
100654
+ case "wrongType":
100655
+ return `${issue2.label} needs ${issue2.expected}`;
100656
+ case "tooLong":
100657
+ return `Use ${issue2.maximum} characters or fewer`;
100658
+ case "invalidEmail":
100659
+ return "Enter a valid email address";
100660
+ case "invalidPhone":
100661
+ return "Enter a valid phone number";
100662
+ case "invalidPattern":
100663
+ return "Check the format and try again";
100664
+ case "invalidUrl":
100665
+ return "Enter a valid web address";
100666
+ case "invalidNumber":
100667
+ return `${issue2.label} needs a number`;
100668
+ case "tooSmall":
100669
+ return `${issue2.label} must be ${issue2.minimum} or more`;
100670
+ case "tooLarge":
100671
+ return `${issue2.label} must be ${issue2.maximum} or less`;
100672
+ case "invalidSlug":
100673
+ return `${issue2.label} can only use lowercase letters, numbers, and dashes`;
100674
+ case "invalidOption":
100675
+ return `Choose one of the available options for ${issue2.label}`;
100676
+ case "tooFewItems":
100677
+ return `${issue2.label} must have at least ${issue2.minimum} ${pluralize(issue2.itemLabel, issue2.minimum)}`;
100678
+ case "tooManyItems":
100679
+ return `${issue2.label} must have at most ${issue2.maximum} ${pluralize(issue2.itemLabel, issue2.maximum)}`;
100680
+ case "invalidRichText":
100681
+ return `${issue2.label} must be valid rich text`;
100682
+ case "invalidMedia":
100683
+ return `${issue2.label} must be a valid media item`;
100684
+ case "invalidLink":
100685
+ return `${issue2.label} must be a valid link`;
100686
+ case "invalidReference":
100687
+ return `${issue2.label} must reference a valid item`;
100688
+ default:
100689
+ return assertNever5(issue2);
100447
100690
  }
100448
- return schema;
100449
100691
  }
100450
- var TipTapMarkSchema, TipTapNodeSchema, RichTextValueSchema;
100451
- var init_richTextSchema = __esm({
100452
- "../blocks/src/system/manifest/richTextSchema.ts"() {
100453
- init_typeGuards2();
100454
- TipTapMarkSchema = z.object({
100455
- type: z.string(),
100456
- attrs: z.record(z.string(), z.unknown()).optional()
100457
- });
100458
- TipTapNodeSchema = z.lazy(
100459
- () => z.object({
100460
- type: z.string(),
100461
- content: z.array(TipTapNodeSchema).optional(),
100462
- text: z.string().optional(),
100463
- attrs: z.record(z.string(), z.unknown()).optional(),
100464
- marks: z.array(TipTapMarkSchema).optional()
100465
- })
100466
- );
100467
- RichTextValueSchema = z.union([
100468
- // New format: TipTap document directly
100469
- TipTapNodeSchema,
100470
- // Legacy format: wrapped in { doc: {...} }
100471
- z.object({
100472
- doc: TipTapNodeSchema
100473
- })
100474
- ]);
100475
- }
100476
- });
100477
- function isEmpty(value) {
100478
- if (typeof value === "string" && value.trim() === "") return true;
100479
- if (value === null || value === void 0) return true;
100480
- if (Array.isArray(value) && value.length === 0) return true;
100481
- if (isEmptyRichTextDoc(value)) return true;
100482
- return false;
100692
+ function pluralize(label, count3) {
100693
+ if (count3 === 1) return label;
100694
+ return label.endsWith("s") ? label : `${label}s`;
100483
100695
  }
100484
- function isEmptyRichTextDoc(value) {
100485
- if (!value || typeof value !== "object") return false;
100486
- const obj = value;
100487
- const doc3 = "doc" in obj ? obj.doc : obj;
100488
- if (!doc3 || typeof doc3 !== "object") return false;
100489
- const docObj = doc3;
100490
- if (docObj.type !== "doc") return false;
100491
- const content = docObj.content;
100492
- if (!Array.isArray(content) || content.length === 0) return true;
100493
- if (content.length === 1) {
100494
- const first2 = content[0];
100495
- if (first2.type === "paragraph" && (!first2.content || first2.content.length === 0)) {
100496
- return true;
100696
+ function deriveFieldValidationPlan(field, path = [field.id]) {
100697
+ const required = Boolean(field.required);
100698
+ switch (field.type) {
100699
+ case "text": {
100700
+ const inputType = field.ui?.inputType;
100701
+ if (inputType === "number") {
100702
+ const constraints2 = commonConstraints(required, { kind: "numberType" });
100703
+ if (typeof field.ui?.min === "number") constraints2.push({ kind: "numberMin", minimum: field.ui.min });
100704
+ if (typeof field.ui?.max === "number") constraints2.push({ kind: "numberMax", maximum: field.ui.max });
100705
+ return makePlan("number", "number", field, path, required, constraints2);
100706
+ }
100707
+ const constraints = commonConstraints(required, { kind: "textType" });
100708
+ if (inputType === "email") constraints.push({ kind: "emailFormat" });
100709
+ if (inputType === "tel") constraints.push({ kind: "phoneFormat" });
100710
+ if (field.ui?.pattern) constraints.push({ kind: "patternFormat", pattern: field.ui.pattern });
100711
+ if (typeof field.maxLength === "number") constraints.push({ kind: "maxLength", maximum: field.maxLength });
100712
+ return makePlan("string", "string", field, path, required, constraints);
100713
+ }
100714
+ case "number": {
100715
+ const constraints = commonConstraints(required, { kind: "numberType" });
100716
+ if (typeof field.min === "number") constraints.push({ kind: "numberMin", minimum: field.min });
100717
+ if (typeof field.max === "number") constraints.push({ kind: "numberMax", maximum: field.max });
100718
+ return makePlan("number", "number", field, path, required, constraints);
100719
+ }
100720
+ case "slug": {
100721
+ const constraints = commonConstraints(required, { kind: "textType" }, { kind: "slugFormat" });
100722
+ if (typeof field.maxLength === "number") constraints.push({ kind: "maxLength", maximum: field.maxLength });
100723
+ return makePlan("string", "string", field, path, required, constraints);
100497
100724
  }
100725
+ case "url":
100726
+ return makePlan("string", "string", field, path, required, commonConstraints(
100727
+ required,
100728
+ { kind: "textType" },
100729
+ { kind: "urlFormat", allowRelative: Boolean(field.allowRelative) }
100730
+ ));
100731
+ case "reference":
100732
+ return makePlan("string", "string", field, path, required, commonConstraints(required, { kind: "referenceText" }));
100733
+ case "date":
100734
+ case "time":
100735
+ case "datetime":
100736
+ return makePlan("string", "string", field, path, required, commonConstraints(required, { kind: "textType" }));
100737
+ case "select":
100738
+ return makePlan("select", "select", field, path, required, commonConstraints(required, {
100739
+ kind: "selectOption",
100740
+ source: resolveSelectConstraintSource(field),
100741
+ multiple: Boolean(field.multiple)
100742
+ }));
100743
+ case "richText":
100744
+ return makePlan("richText", "object", field, path, required, commonConstraints(required, { kind: "richTextDoc" }));
100745
+ case "media":
100746
+ return makePlan("media", "object", field, path, required, commonConstraints(required, { kind: "mediaObject" }));
100747
+ case "link":
100748
+ return makePlan("link", "object", field, path, required, commonConstraints(required, { kind: "linkObject" }));
100749
+ case "boolean":
100750
+ return makePlan("boolean", "boolean", field, path, required, requiredConstraints(required));
100751
+ case "repeater":
100752
+ return {
100753
+ ...makePlan("repeater", "array", field, path, required, commonConstraints(required, { kind: "arrayType" })),
100754
+ ...field.polymorphic && field.itemTypes ? { repeatedItemVariants: deriveRepeatedItemVariants(field, [...path, 0]) } : { repeatedItemPlan: deriveNestedFieldPlans(getRepeaterFields(field), [...path, 0]) },
100755
+ constraints: withRepeaterItemConstraints(field, commonConstraints(required, { kind: "arrayType" }))
100756
+ };
100757
+ case "group":
100758
+ case "modal":
100759
+ return {
100760
+ ...makePlan("group", "object", field, path, required, requiredConstraints(required)),
100761
+ children: deriveNestedFieldPlans(field.schema?.fields ?? [], path),
100762
+ allowNullChildren: field.type === "group" && field.ui?.widget === "locationPicker"
100763
+ };
100764
+ case "tabGroup":
100765
+ return {
100766
+ ...makePlan("group", "object", field, path, required, requiredConstraints(required)),
100767
+ children: field.tabs.flatMap((tab) => deriveNestedFieldPlans(tab.fields, path))
100768
+ };
100769
+ case "presetOrCustom":
100770
+ case "contentTypeSelect":
100771
+ case "entryPicker":
100772
+ return makePlan("passthrough", "unknown", field, path, false, []);
100773
+ default:
100774
+ return assertNever5(field);
100498
100775
  }
100499
- return false;
100500
100776
  }
100501
- function preprocessEmptyValues(content) {
100502
- if (!content || typeof content !== "object" || Array.isArray(content)) {
100503
- return {};
100504
- }
100505
- const result = {};
100506
- for (const [key, value] of Object.entries(content)) {
100507
- result[key] = isEmpty(value) ? void 0 : value;
100777
+ function commonConstraints(required, ...specific) {
100778
+ return required ? [{ kind: "required" }, ...specific] : [...specific];
100779
+ }
100780
+ function requiredConstraints(required) {
100781
+ return required ? [{ kind: "required" }] : [];
100782
+ }
100783
+ function makePlan(kind, valueKind, field, path, required, constraints) {
100784
+ return {
100785
+ kind,
100786
+ valueKind,
100787
+ fieldId: field.id,
100788
+ label: field.label,
100789
+ fieldType: field.type,
100790
+ path,
100791
+ required,
100792
+ constraints
100793
+ };
100794
+ }
100795
+ function withRepeaterItemConstraints(field, constraints) {
100796
+ const next = [...constraints];
100797
+ if (typeof field.minItems === "number") next.push({ kind: "minItems", minimum: field.minItems });
100798
+ if (typeof field.maxItems === "number") next.push({ kind: "maxItems", maximum: field.maxItems });
100799
+ return next;
100800
+ }
100801
+ function deriveRepeatedItemVariants(field, parentPath) {
100802
+ return Object.entries(field.itemTypes ?? {}).map(([typeId, itemType]) => ({
100803
+ typeId,
100804
+ fields: deriveNestedFieldPlans(getFlattenedRepeaterFields(itemType.fields), parentPath)
100805
+ }));
100806
+ }
100807
+ function deriveNestedFieldPlans(fields3, parentPath) {
100808
+ return fields3.map((field) => deriveFieldValidationPlan(field, [...parentPath, field.id]));
100809
+ }
100810
+ function getRepeaterFields(field) {
100811
+ const fields3 = field.polymorphic && field.itemTypes ? Object.values(field.itemTypes).flatMap((itemType) => itemType.fields) : field.schema?.fields ?? [];
100812
+ return getFlattenedRepeaterFields(fields3);
100813
+ }
100814
+ function getFlattenedRepeaterFields(fields3) {
100815
+ return fields3.flatMap((child) => {
100816
+ if (child.type === "group" && child.ui?.flattenInRepeater) {
100817
+ return child.schema?.fields ?? [];
100818
+ }
100819
+ return child;
100820
+ });
100821
+ }
100822
+ function resolveSelectConstraintSource(field) {
100823
+ const source = normalizeSelectSource(field);
100824
+ switch (source.kind) {
100825
+ case "static":
100826
+ return { kind: "static", values: field.options.map((option) => option.value) };
100827
+ case "site":
100828
+ case "sdk":
100829
+ return { kind: "runtime", source: source.kind };
100830
+ default:
100831
+ return assertNever5(source);
100508
100832
  }
100509
- return result;
100510
100833
  }
100511
- function createManifestValidator(manifestOrFields, options = {}) {
100512
- const allowNull = options.allowNull ?? true;
100513
- const isDraft = options.mode === "draft";
100514
- const allowIncomplete = isDraft || (options.allowIncomplete ?? false);
100515
- const shape = {};
100516
- const fields3 = Array.isArray(manifestOrFields) ? manifestOrFields : manifestOrFields.fields ?? [];
100517
- for (const field of fields3) {
100518
- shape[field.id] = buildFieldSchema(field, allowNull, allowIncomplete);
100834
+ function normalizeFieldValue(plan, value, ctx) {
100835
+ switch (plan.kind) {
100836
+ case "number":
100837
+ return normalizeNumberInput(value, ctx.allowNull);
100838
+ case "string":
100839
+ return acceptsOptionalBlankAsMissing(plan, value) ? void 0 : value;
100840
+ case "group":
100841
+ return normalizeObjectChildren(plan.children, value, childValidationContext(plan, ctx));
100842
+ case "repeater":
100843
+ return normalizeRepeaterItems(plan, value, ctx);
100844
+ case "boolean":
100845
+ case "richText":
100846
+ case "media":
100847
+ case "link":
100848
+ case "select":
100849
+ case "passthrough":
100850
+ return value;
100851
+ default:
100852
+ return assertNever5(plan);
100519
100853
  }
100520
- const baseSchema = z.object(shape).catchall(z.unknown()).passthrough();
100521
- if (isDraft) {
100522
- return z.preprocess(preprocessEmptyValues, baseSchema);
100854
+ }
100855
+ function normalizeObjectChildren(children, value, ctx) {
100856
+ if (!value || typeof value !== "object" || Array.isArray(value)) return value;
100857
+ const normalized = { ...value };
100858
+ for (const child of children) {
100859
+ normalized[child.fieldId] = normalizeFieldValue(child, normalized[child.fieldId], ctx);
100523
100860
  }
100524
- return baseSchema;
100861
+ return normalized;
100525
100862
  }
100526
- function buildFieldSchema(field, allowNull, allowIncomplete = false) {
100527
- const required = Boolean(field.required);
100528
- let schema;
100529
- switch (field.type) {
100530
- case "text":
100531
- schema = buildTextSchema(field);
100532
- break;
100533
- case "richText":
100534
- schema = buildRichTextSchema2();
100535
- break;
100536
- case "media": {
100537
- const baseMediaSchema = z.record(z.string(), z.unknown());
100538
- const isRequired = Boolean(field.required);
100539
- schema = isRequired ? baseMediaSchema : baseMediaSchema.nullable();
100540
- break;
100541
- }
100863
+ function normalizeRepeaterItems(plan, value, ctx) {
100864
+ if (!Array.isArray(value)) return value;
100865
+ return value.map((item) => {
100866
+ if (!item || typeof item !== "object" || Array.isArray(item)) return item;
100867
+ const itemRecord = item;
100868
+ const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemRecord._type)?.fields : plan.repeatedItemPlan;
100869
+ if (!fields3) return item;
100870
+ return normalizeObjectChildren(fields3, itemRecord, ctx);
100871
+ });
100872
+ }
100873
+ function normalizeNumberInput(value, allowNull) {
100874
+ if (value === "") return void 0;
100875
+ if (typeof value === "string" && value.trim() !== "") return Number(value);
100876
+ return value;
100877
+ }
100878
+ function acceptsOptionalBlankAsMissing(plan, value) {
100879
+ if (plan.required || typeof value !== "string" || value.trim() !== "") return false;
100880
+ return plan.constraints.some(
100881
+ (constraint) => constraint.kind === "urlFormat" || constraint.kind === "slugFormat" || constraint.kind === "emailFormat" || constraint.kind === "phoneFormat" || constraint.kind === "patternFormat"
100882
+ );
100883
+ }
100884
+ function validateNormalizedFieldValue(plan, value, ctx) {
100885
+ if (value === null && (ctx.allowNull || acceptsOptionalNullValue(plan))) return [];
100886
+ if (isMissingForPlan(plan, value)) {
100887
+ return shouldRequireValue(plan, value, ctx) ? [requiredIssue(plan, value)] : [];
100888
+ }
100889
+ switch (plan.kind) {
100890
+ case "string":
100891
+ return validateStringPlan(plan, value);
100892
+ case "number":
100893
+ return validateNumberPlan(plan, value);
100542
100894
  case "boolean":
100543
- schema = z.boolean();
100544
- break;
100545
- case "slug":
100546
- schema = buildSlugSchema(field);
100547
- break;
100548
- case "url":
100549
- schema = buildUrlSchema(field);
100550
- break;
100551
- case "link":
100552
- schema = buildLinkSchema();
100553
- break;
100895
+ return typeof value === "boolean" ? [] : [issue(plan, "wrongType", { expected: "a true/false value" })];
100554
100896
  case "select":
100555
- schema = buildSelectSchema(field);
100556
- break;
100557
- case "reference":
100558
- schema = buildReferenceSchema(field);
100559
- break;
100897
+ return validateSelectPlan(plan, value);
100898
+ case "richText":
100899
+ return isValidRichTextDoc(value) ? [] : [issue(plan, "invalidRichText")];
100900
+ case "media":
100901
+ return isPlainObject3(value) ? [] : [issue(plan, "invalidMedia")];
100902
+ case "link":
100903
+ return linkSchema.safeParse(value).success ? [] : [issue(plan, "invalidLink")];
100560
100904
  case "repeater":
100561
- schema = buildRepeaterSchema(field, allowNull, allowIncomplete);
100562
- break;
100905
+ return validateRepeaterPlan(plan, value, ctx);
100563
100906
  case "group":
100564
- schema = buildGroupSchema(field, allowNull, allowIncomplete);
100565
- break;
100907
+ return validateGroupPlan(plan, value, ctx);
100908
+ case "passthrough":
100909
+ return [];
100566
100910
  default:
100567
- schema = z.unknown();
100568
- break;
100911
+ return assertNever5(plan);
100569
100912
  }
100570
- return finalizeSchema(schema, required, allowNull, allowIncomplete);
100571
100913
  }
100572
- function buildFriendlyStringSchema(field) {
100573
- return z.string({
100574
- error: (issue) => issue.input === void 0 || issue.input === null ? "This field is required" : `${field.label} needs text`
100575
- });
100914
+ function shouldRequireValue(plan, value, ctx) {
100915
+ if (!plan.required || ctx.allowIncomplete) return false;
100916
+ if (value === null && ctx.allowNull) return false;
100917
+ return true;
100576
100918
  }
100577
- function buildTextSchema(field) {
100578
- const ui = field.ui ?? {};
100579
- const inputType = ui?.inputType;
100580
- let schema;
100581
- if (inputType === "number") {
100582
- schema = z.coerce.number({
100583
- error: (issue) => issue.input === void 0 ? `${field.label} is required` : `${field.label} needs a number`
100584
- });
100585
- if (typeof ui?.min === "number") {
100586
- schema = schema.min(
100587
- ui.min,
100588
- `${field.label} must be ${ui.min} or more`
100589
- );
100590
- }
100591
- if (typeof ui?.max === "number") {
100592
- schema = schema.max(
100593
- ui.max,
100594
- `${field.label} must be ${ui.max} or less`
100595
- );
100596
- }
100597
- } else {
100598
- schema = buildFriendlyStringSchema(field);
100599
- if (inputType === "email") {
100600
- schema = schema.email("Enter a valid email address");
100601
- }
100602
- if (inputType === "tel") {
100603
- const TEL_RE = /^[+()0-9\s\-]{3,}$/;
100604
- schema = schema.regex(
100605
- TEL_RE,
100606
- "Enter a valid phone number"
100607
- );
100608
- }
100609
- if (ui?.pattern) {
100610
- try {
100611
- const re2 = new RegExp(ui.pattern);
100612
- schema = schema.regex(
100613
- re2,
100614
- `${field.label} is not in the right format`
100615
- );
100616
- } catch {
100617
- }
100618
- }
100619
- if (field.maxLength) {
100620
- schema = schema.max(
100621
- field.maxLength,
100622
- `${field.label} must be ${field.maxLength} characters or less`
100623
- );
100624
- }
100625
- if (field.required) {
100626
- schema = schema.min(1, { message: `${field.label} is required` }).refine((v2) => v2.trim().length > 0, { message: `${field.label} is required` });
100627
- }
100628
- }
100629
- return schema;
100919
+ function acceptsOptionalNullValue(plan) {
100920
+ return !plan.required && (plan.kind === "media" || plan.kind === "number");
100921
+ }
100922
+ function isMissingForPlan(plan, value) {
100923
+ if (value === void 0) return true;
100924
+ if (value === null) return plan.required;
100925
+ if (typeof value === "string" && value.trim() === "") return true;
100926
+ if (Array.isArray(value) && value.length === 0) return true;
100927
+ return false;
100630
100928
  }
100631
- function buildRichTextSchema2() {
100632
- return buildRichTextSchema();
100929
+ function validateStringPlan(plan, value) {
100930
+ if (typeof value !== "string") return [issue(plan, "wrongType", { expected: "text" })];
100931
+ return plan.constraints.flatMap((constraint) => validateStringConstraint(plan, constraint, value));
100633
100932
  }
100634
- function buildSlugSchema(field) {
100635
- const message2 = `${field.label} can only use lowercase letters, numbers, and dashes`;
100636
- let schema = buildFriendlyStringSchema(field).regex(SLUG_PATTERN, message2);
100637
- if (field.maxLength) {
100638
- schema = schema.max(
100639
- field.maxLength,
100640
- `${field.label} must be ${field.maxLength} characters or less`
100641
- );
100933
+ function validateStringConstraint(plan, constraint, value) {
100934
+ switch (constraint.kind) {
100935
+ case "required":
100936
+ case "textType":
100937
+ case "referenceText":
100938
+ return [];
100939
+ case "maxLength":
100940
+ return value.length > constraint.maximum ? [issue(plan, "tooLong", { maximum: constraint.maximum })] : [];
100941
+ case "emailFormat":
100942
+ return z.email().safeParse(value).success ? [] : [issue(plan, "invalidEmail")];
100943
+ case "phoneFormat":
100944
+ return TEL_RE.test(value) ? [] : [issue(plan, "invalidPhone")];
100945
+ case "patternFormat": {
100946
+ const re2 = compilePattern(constraint.pattern);
100947
+ return re2 && !re2.test(value) ? [issue(plan, "invalidPattern")] : [];
100948
+ }
100949
+ case "urlFormat":
100950
+ return isValidUrl(value, constraint.allowRelative) ? [] : [issue(plan, "invalidUrl")];
100951
+ case "slugFormat":
100952
+ return SLUG_PATTERN.test(value) ? [] : [issue(plan, "invalidSlug")];
100953
+ default:
100954
+ return assertNever5(constraint);
100642
100955
  }
100643
- if (field.required) {
100644
- schema = schema.min(1, { message: `${field.label} is required` });
100956
+ }
100957
+ function validateNumberPlan(plan, value) {
100958
+ if (!isValidNumber(value)) return [issue(plan, "invalidNumber")];
100959
+ return plan.constraints.flatMap((constraint) => validateNumberConstraint(plan, constraint, Number(value)));
100960
+ }
100961
+ function validateNumberConstraint(plan, constraint, value) {
100962
+ switch (constraint.kind) {
100963
+ case "required":
100964
+ case "numberType":
100965
+ return [];
100966
+ case "numberMin":
100967
+ return value < constraint.minimum ? [issue(plan, "tooSmall", { minimum: constraint.minimum })] : [];
100968
+ case "numberMax":
100969
+ return value > constraint.maximum ? [issue(plan, "tooLarge", { maximum: constraint.maximum })] : [];
100970
+ default:
100971
+ return assertNever5(constraint);
100645
100972
  }
100646
- return schema;
100647
100973
  }
100648
- function buildUrlSchema(field) {
100649
- const message2 = "Enter a valid web address";
100650
- const validate = (value) => {
100651
- if (!value) {
100652
- return !field.required;
100653
- }
100654
- if (field.allowRelative && value.startsWith("/")) {
100655
- return true;
100656
- }
100657
- try {
100658
- const parsed = new URL(value);
100659
- return ALLOWED_URL_PROTOCOLS.includes(
100660
- parsed.protocol
100661
- );
100662
- } catch {
100663
- return false;
100974
+ function validateSelectPlan(plan, value) {
100975
+ const constraint = plan.constraints.find((candidate) => candidate.kind === "selectOption");
100976
+ if (!constraint || constraint.source.kind === "runtime") return [];
100977
+ return isValidSelectValue(value, constraint.source.values, constraint.multiple) ? [] : [issue(plan, "invalidOption")];
100978
+ }
100979
+ function validateRepeaterPlan(plan, value, ctx) {
100980
+ if (!Array.isArray(value)) return [issue(plan, "wrongType", { expected: "a list" })];
100981
+ const constraintIssues = plan.constraints.flatMap((constraint) => {
100982
+ switch (constraint.kind) {
100983
+ case "required":
100984
+ case "arrayType":
100985
+ return [];
100986
+ case "minItems":
100987
+ return value.length < constraint.minimum ? [issue(plan, "tooFewItems", { minimum: constraint.minimum, itemLabel: "item" })] : [];
100988
+ case "maxItems":
100989
+ return value.length > constraint.maximum ? [issue(plan, "tooManyItems", { maximum: constraint.maximum, itemLabel: "item" })] : [];
100990
+ default:
100991
+ return assertNever5(constraint);
100664
100992
  }
100993
+ });
100994
+ return [
100995
+ ...constraintIssues,
100996
+ ...value.flatMap((item, index2) => validateRepeaterItem(plan, item, index2, ctx))
100997
+ ];
100998
+ }
100999
+ function validateRepeaterItem(plan, item, index2, ctx) {
101000
+ if (!isPlainObject3(item)) return [];
101001
+ const itemType = item._type;
101002
+ const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemType)?.fields : plan.repeatedItemPlan;
101003
+ if (!fields3) return [];
101004
+ return fields3.flatMap((childPlan) => {
101005
+ const indexedPlan = withIndexedPath(childPlan, plan.path, index2);
101006
+ return validateNormalizedFieldValue(indexedPlan, item[childPlan.fieldId], ctx);
101007
+ });
101008
+ }
101009
+ function validateGroupPlan(plan, value, ctx) {
101010
+ if (!isPlainObject3(value)) return [issue(plan, "wrongType", { expected: "an object" })];
101011
+ const childCtx = childValidationContext(plan, ctx);
101012
+ return plan.children.flatMap((childPlan) => validateNormalizedFieldValue(childPlan, value[childPlan.fieldId], childCtx));
101013
+ }
101014
+ function childValidationContext(plan, ctx) {
101015
+ return plan.allowNullChildren ? { ...ctx, allowNull: true } : ctx;
101016
+ }
101017
+ function withIndexedPath(plan, parentPath, index2) {
101018
+ const suffix = plan.path.slice(parentPath.length + 1);
101019
+ return {
101020
+ ...plan,
101021
+ path: [...parentPath, index2, plan.fieldId, ...suffix]
100665
101022
  };
100666
- let schema = buildFriendlyStringSchema(field).trim().refine(validate, message2);
100667
- if (field.required) {
100668
- schema = schema.min(1, { message: `${field.label} is required` });
100669
- }
100670
- return schema;
100671
101023
  }
100672
- function buildLinkSchema() {
100673
- return linkSchema;
101024
+ function issue(plan, kind, extra) {
101025
+ return {
101026
+ kind,
101027
+ path: plan.path,
101028
+ fieldId: plan.fieldId,
101029
+ label: plan.label,
101030
+ ...extra ?? {}
101031
+ };
100674
101032
  }
100675
- function assertNeverSelectSource2(value) {
100676
- throw new Error(`Unhandled select source: ${JSON.stringify(value)}`);
101033
+ function requiredIssue(plan, value) {
101034
+ if (typeof value === "string") return issue(plan, "required", { emptyOrigin: "string" });
101035
+ if (Array.isArray(value)) return issue(plan, "required", { emptyOrigin: "array" });
101036
+ return issue(plan, "required");
100677
101037
  }
100678
- function buildSelectSchema(field) {
100679
- const source = normalizeSelectSource(field);
100680
- const singleValueSchema = (() => {
100681
- switch (source.kind) {
100682
- case "sdk":
100683
- case "site":
100684
- return buildFriendlyStringSchema(field);
100685
- case "static": {
100686
- const values = field.options.map((option) => option.value);
100687
- return buildFriendlyStringSchema(field).refine(
100688
- (value) => values.includes(value),
100689
- `Choose one of the available options for ${field.label}`
100690
- );
100691
- }
100692
- default:
100693
- return assertNeverSelectSource2(source);
101038
+ function fieldPlanToZod(plan, options = {}) {
101039
+ const ctx = validationContext(options);
101040
+ return z.any().transform((value) => normalizeFieldValue(plan, value, ctx)).superRefine((value, zodCtx) => {
101041
+ for (const validationIssue of validateNormalizedFieldValue(plan, value, ctx)) {
101042
+ addFieldIssueToZodContext(zodCtx, validationIssue);
100694
101043
  }
100695
- })();
100696
- if (field.multiple) {
100697
- const arraySchema = z.array(singleValueSchema);
100698
- return field.required ? arraySchema.min(1, { message: "This field is required" }) : arraySchema.nullable();
101044
+ });
101045
+ }
101046
+ function addFieldIssueToZodContext(zodCtx, validationIssue) {
101047
+ const message2 = fieldIssueToMessage(validationIssue);
101048
+ switch (validationIssue.kind) {
101049
+ case "required":
101050
+ if (validationIssue.emptyOrigin) {
101051
+ zodCtx.addIssue({
101052
+ code: "too_small",
101053
+ origin: validationIssue.emptyOrigin,
101054
+ minimum: 1,
101055
+ inclusive: true,
101056
+ message: message2
101057
+ });
101058
+ return;
101059
+ }
101060
+ zodCtx.addIssue({ code: "invalid_type", expected: "nonoptional", message: message2 });
101061
+ return;
101062
+ case "tooLong":
101063
+ zodCtx.addIssue({
101064
+ code: "too_big",
101065
+ origin: "string",
101066
+ maximum: validationIssue.maximum,
101067
+ inclusive: true,
101068
+ message: message2
101069
+ });
101070
+ return;
101071
+ case "invalidOption":
101072
+ zodCtx.addIssue({ code: "invalid_value", values: [], message: message2 });
101073
+ return;
101074
+ case "wrongType":
101075
+ case "invalidEmail":
101076
+ case "invalidPhone":
101077
+ case "invalidPattern":
101078
+ case "invalidUrl":
101079
+ case "invalidNumber":
101080
+ case "tooSmall":
101081
+ case "tooLarge":
101082
+ case "invalidSlug":
101083
+ case "tooFewItems":
101084
+ case "tooManyItems":
101085
+ case "invalidRichText":
101086
+ case "invalidMedia":
101087
+ case "invalidLink":
101088
+ case "invalidReference":
101089
+ zodCtx.addIssue({ code: "custom", message: message2 });
101090
+ return;
101091
+ default:
101092
+ assertNever5(validationIssue);
100699
101093
  }
100700
- return field.required ? singleValueSchema : singleValueSchema.nullable();
100701
101094
  }
100702
- function buildReferenceSchema(field) {
100703
- let schema = z.string({
100704
- error: (issue) => issue.input === void 0 || issue.input === null ? "This field is required" : `${field.label} needs text`
100705
- });
100706
- if (field.required) {
100707
- schema = schema.min(1, { message: `${field.label} is required` });
101095
+ function compilePattern(pattern) {
101096
+ try {
101097
+ return new RegExp(pattern);
101098
+ } catch {
101099
+ return null;
100708
101100
  }
100709
- return schema;
100710
101101
  }
100711
- function buildRepeaterSchema(field, allowNull, allowIncomplete) {
100712
- const parsed = fieldSchema.array().parse(field.schema?.fields ?? []);
100713
- const childShape = {};
100714
- for (const child of parsed) {
100715
- if (child.type === "group" && child.ui?.flattenInRepeater) {
100716
- const groupParsed = fieldSchema.array().parse(child.schema?.fields ?? []);
100717
- for (const gc of groupParsed) {
100718
- childShape[gc.id] = buildFieldSchema(gc, allowNull, allowIncomplete);
100719
- }
100720
- } else {
100721
- childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
100722
- }
101102
+ function isValidNumber(value) {
101103
+ return typeof value === "number" && Number.isFinite(value);
101104
+ }
101105
+ function isValidUrl(value, allowRelative) {
101106
+ if (!value) return false;
101107
+ if (allowRelative && value.startsWith("/")) return true;
101108
+ try {
101109
+ const parsed = new URL(value);
101110
+ return ALLOWED_URL_PROTOCOLS.includes(parsed.protocol);
101111
+ } catch {
101112
+ return false;
100723
101113
  }
100724
- let schema = z.object(childShape).catchall(z.unknown()).passthrough();
100725
- let arraySchema = z.array(schema);
100726
- if (typeof field.minItems === "number") {
100727
- arraySchema = arraySchema.min(field.minItems);
101114
+ }
101115
+ function isValidSelectValue(value, values, multiple) {
101116
+ if (multiple) {
101117
+ return Array.isArray(value) && value.every((item) => typeof item === "string" && values.includes(item));
100728
101118
  }
100729
- if (typeof field.maxItems === "number") {
100730
- arraySchema = arraySchema.max(field.maxItems);
101119
+ return typeof value === "string" && values.includes(value);
101120
+ }
101121
+ function isEmptyValue(value) {
101122
+ if (value === null || value === void 0) return true;
101123
+ if (typeof value === "string" && value.trim() === "") return true;
101124
+ if (Array.isArray(value) && value.length === 0) return true;
101125
+ if (isEmptyRichTextDoc(value)) return true;
101126
+ return false;
101127
+ }
101128
+ function isPlainObject3(value) {
101129
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
101130
+ }
101131
+ function isValidRichTextDoc(value) {
101132
+ const doc3 = richTextDoc(value);
101133
+ return Boolean(isPlainObject3(doc3) && doc3.type === "doc");
101134
+ }
101135
+ function isEmptyRichTextDoc(value) {
101136
+ const doc3 = richTextDoc(value);
101137
+ if (!isPlainObject3(doc3)) return false;
101138
+ if (doc3.type !== "doc") return false;
101139
+ const content = doc3.content;
101140
+ if (!Array.isArray(content) || content.length === 0) return true;
101141
+ if (content.length !== 1) return false;
101142
+ const first2 = content[0];
101143
+ return first2?.type === "paragraph" && (!Array.isArray(first2.content) || first2.content.length === 0);
101144
+ }
101145
+ function richTextDoc(value) {
101146
+ if (!isPlainObject3(value)) return value;
101147
+ return isPlainObject3(value.doc) ? value.doc : value;
101148
+ }
101149
+ var TEL_RE, SLUG_PATTERN, ALLOWED_URL_PROTOCOLS;
101150
+ var init_fieldValidation = __esm({
101151
+ "../blocks/src/system/manifest/fieldValidation/index.ts"() {
101152
+ init_link2();
101153
+ init_schema3();
101154
+ TEL_RE = /^[+()0-9\s-]{3,}$/;
101155
+ SLUG_PATTERN = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(?:[a-z0-9]+(?:-[a-z0-9]+)*))*$/;
101156
+ ALLOWED_URL_PROTOCOLS = ["http:", "https:"];
100731
101157
  }
100732
- return arraySchema;
101158
+ });
101159
+
101160
+ // ../blocks/src/system/manifest/registry.ts
101161
+ function registerManifest(manifest) {
101162
+ manifestStore.set(manifest.name, manifest);
101163
+ return manifest;
100733
101164
  }
100734
- function buildGroupSchema(field, allowNull, allowIncomplete) {
100735
- const parsed = fieldSchema.array().parse(field.schema?.fields ?? []);
100736
- const childShape = {};
100737
- for (const child of parsed) {
100738
- childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
101165
+ var REGISTRY_SYMBOL, isVitest, globalScope, manifestStore;
101166
+ var init_registry2 = __esm({
101167
+ "../blocks/src/system/manifest/registry.ts"() {
101168
+ REGISTRY_SYMBOL = /* @__PURE__ */ Symbol.for("@riverbankcms/blocks/manifest-registry");
101169
+ isVitest = typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.VITEST === "true";
101170
+ globalScope = globalThis;
101171
+ manifestStore = isVitest ? /* @__PURE__ */ new Map() : globalScope[REGISTRY_SYMBOL] ?? (globalScope[REGISTRY_SYMBOL] = /* @__PURE__ */ new Map());
100739
101172
  }
100740
- return z.object(childShape).catchall(z.unknown()).passthrough();
101173
+ });
101174
+ function preprocessEmptyValues(content) {
101175
+ if (!content || typeof content !== "object" || Array.isArray(content)) {
101176
+ return {};
101177
+ }
101178
+ const result = {};
101179
+ for (const [key, value] of Object.entries(content)) {
101180
+ result[key] = isEmptyValue(value) ? void 0 : value;
101181
+ }
101182
+ return result;
100741
101183
  }
100742
- function finalizeSchema(schema, required, allowNull, allowIncomplete = false) {
100743
- if (required) {
100744
- if (allowIncomplete) {
100745
- return allowNull ? schema.or(z.null()).optional() : schema.optional();
100746
- }
100747
- return allowNull ? schema.or(z.null()) : schema;
101184
+ function createManifestValidator(manifestOrFields, options = {}) {
101185
+ const isDraft = options.mode === "draft";
101186
+ const shape = {};
101187
+ const fields3 = Array.isArray(manifestOrFields) ? manifestOrFields : manifestOrFields.fields ?? [];
101188
+ for (const field of fields3) {
101189
+ shape[field.id] = buildFieldSchema(field, options);
101190
+ }
101191
+ const baseSchema = z.object(shape).catchall(z.unknown()).passthrough();
101192
+ if (isDraft) {
101193
+ return z.preprocess(preprocessEmptyValues, baseSchema);
100748
101194
  }
100749
- return allowNull ? schema.optional().nullable() : schema.optional();
101195
+ return baseSchema;
101196
+ }
101197
+ function buildFieldSchema(field, options) {
101198
+ return fieldPlanToZod(deriveFieldValidationPlan(field), options);
100750
101199
  }
100751
- var SLUG_PATTERN, ALLOWED_URL_PROTOCOLS, nullableString, internalLinkSchema, externalLinkSchema, customLinkSchema, pageLinkSchema, entryLinkSchema, linkSchema;
100752
101200
  var init_validation = __esm({
100753
101201
  "../blocks/src/system/manifest/validation.ts"() {
100754
- init_schema3();
100755
- init_richTextSchema();
100756
- SLUG_PATTERN = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(?:[a-z0-9]+(?:-[a-z0-9]+)*))*$/;
100757
- ALLOWED_URL_PROTOCOLS = ["http:", "https:"];
100758
- nullableString = z.union([z.string().min(1), z.null()]);
100759
- internalLinkSchema = z.object({
100760
- kind: z.literal("internal"),
100761
- routeId: z.string().min(1),
100762
- entityId: z.string().min(1).optional(),
100763
- entityType: z.enum(["page", "content"]).optional(),
100764
- href: nullableString.optional(),
100765
- title: nullableString.optional(),
100766
- typeLabel: nullableString.optional(),
100767
- contentTypeKey: nullableString.optional(),
100768
- contentTypeName: nullableString.optional(),
100769
- updatedAt: nullableString.optional()
100770
- }).passthrough();
100771
- externalLinkSchema = z.object({
100772
- kind: z.literal("external"),
100773
- href: z.string().min(1)
100774
- }).passthrough();
100775
- customLinkSchema = z.object({
100776
- kind: z.literal("url"),
100777
- href: z.string().min(1)
100778
- }).passthrough();
100779
- pageLinkSchema = z.object({
100780
- kind: z.literal("page"),
100781
- identifier: z.string().min(1)
100782
- }).passthrough();
100783
- entryLinkSchema = z.object({
100784
- kind: z.literal("entry"),
100785
- contentType: z.string().min(1),
100786
- identifier: z.string().min(1)
100787
- }).passthrough();
100788
- linkSchema = z.union([
100789
- internalLinkSchema,
100790
- externalLinkSchema,
100791
- customLinkSchema,
100792
- pageLinkSchema,
100793
- entryLinkSchema
100794
- ]);
101202
+ init_fieldValidation();
100795
101203
  }
100796
101204
  });
100797
101205
 
@@ -100828,6 +101236,7 @@ var init_manifest = __esm({
100828
101236
  "../blocks/src/system/manifest/index.ts"() {
100829
101237
  init_augmentManifest();
100830
101238
  init_fieldPath();
101239
+ init_fieldValidation();
100831
101240
  init_registry2();
100832
101241
  init_schema3();
100833
101242
  init_validation();
@@ -100894,7 +101303,7 @@ function makeBoundaryId(previousBlockId, nextBlockId) {
100894
101303
  const next = encodeURIComponent(nextBlockId);
100895
101304
  return asDesignBoundaryId(`boundary:${previous}:${next}`);
100896
101305
  }
100897
- function assertNever5(value, message2 = "Unhandled Theme V2 variant") {
101306
+ function assertNever6(value, message2 = "Unhandled Theme V2 variant") {
100898
101307
  throw new Error(`${message2}: ${String(value)}`);
100899
101308
  }
100900
101309
  function brandNonEmptyString(value, label) {
@@ -101999,44 +102408,44 @@ var init_personalities = __esm({
101999
102408
  var hotspotSchema, rotationSchema, rectSchema, aspectCropSchema, transformSchema, mediaSchema;
102000
102409
  var init_media = __esm({
102001
102410
  "../theme-core/src/lib/media.ts"() {
102002
- hotspotSchema = z37.object({
102003
- x: z37.number().min(0).max(1),
102004
- y: z37.number().min(0).max(1),
102005
- radius: z37.number().optional()
102006
- });
102007
- rotationSchema = z37.union([z37.literal(0), z37.literal(90), z37.literal(180), z37.literal(270)]);
102008
- rectSchema = z37.tuple([z37.number(), z37.number(), z37.number(), z37.number()]);
102009
- aspectCropSchema = z37.object({
102010
- aspect: z37.preprocess((value) => value == null ? void 0 : value, z37.string().optional()),
102011
- rect: z37.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
102012
- hotspot: z37.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
102013
- rotation: z37.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
102014
- });
102015
- transformSchema = z37.object({
102016
- aspectCrops: z37.preprocess((value) => {
102411
+ hotspotSchema = z38.object({
102412
+ x: z38.number().min(0).max(1),
102413
+ y: z38.number().min(0).max(1),
102414
+ radius: z38.number().optional()
102415
+ });
102416
+ rotationSchema = z38.union([z38.literal(0), z38.literal(90), z38.literal(180), z38.literal(270)]);
102417
+ rectSchema = z38.tuple([z38.number(), z38.number(), z38.number(), z38.number()]);
102418
+ aspectCropSchema = z38.object({
102419
+ aspect: z38.preprocess((value) => value == null ? void 0 : value, z38.string().optional()),
102420
+ rect: z38.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
102421
+ hotspot: z38.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
102422
+ rotation: z38.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
102423
+ });
102424
+ transformSchema = z38.object({
102425
+ aspectCrops: z38.preprocess((value) => {
102017
102426
  if (!value || typeof value !== "object" || Array.isArray(value)) {
102018
102427
  return void 0;
102019
102428
  }
102020
102429
  return value;
102021
- }, z37.record(z37.string(), aspectCropSchema.catch({}))).optional(),
102430
+ }, z38.record(z38.string(), aspectCropSchema.catch({}))).optional(),
102022
102431
  rect: rectSchema.optional(),
102023
102432
  hotspot: hotspotSchema.optional(),
102024
102433
  rotation: rotationSchema.optional()
102025
102434
  });
102026
- mediaSchema = z37.object({
102027
- type: z37.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
102028
- purpose: z37.string().optional(),
102029
- placeholder: z37.boolean().default(true).optional(),
102030
- assetId: z37.string().optional(),
102031
- identifier: z37.string().optional(),
102032
- src: z37.string().optional(),
102033
- alt: z37.string().optional(),
102034
- filename: z37.string().optional(),
102035
- mimeType: z37.string().optional(),
102036
- width: z37.number().optional(),
102037
- height: z37.number().optional(),
102038
- storageBucket: z37.string().optional(),
102039
- storagePath: z37.string().optional(),
102435
+ mediaSchema = z38.object({
102436
+ type: z38.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
102437
+ purpose: z38.string().optional(),
102438
+ placeholder: z38.boolean().default(true).optional(),
102439
+ assetId: z38.string().optional(),
102440
+ identifier: z38.string().optional(),
102441
+ src: z38.string().optional(),
102442
+ alt: z38.string().optional(),
102443
+ filename: z38.string().optional(),
102444
+ mimeType: z38.string().optional(),
102445
+ width: z38.number().optional(),
102446
+ height: z38.number().optional(),
102447
+ storageBucket: z38.string().optional(),
102448
+ storagePath: z38.string().optional(),
102040
102449
  transform: transformSchema.optional()
102041
102450
  });
102042
102451
  }
@@ -106622,7 +107031,7 @@ function compileContainerStyles(contentFrame, rules) {
106622
107031
  })
106623
107032
  };
106624
107033
  default:
106625
- return assertNever5(contentFrame);
107034
+ return assertNever6(contentFrame);
106626
107035
  }
106627
107036
  }
106628
107037
  function compileBlockRuntimeFields(input) {
@@ -107006,8 +107415,8 @@ var init_generatedDesignPipeline = __esm({
107006
107415
  }
107007
107416
  });
107008
107417
  function validateBlockSequence(snapshots, ctx) {
107009
- for (const issue of collectBlockSequenceIssues(snapshots)) {
107010
- ctx.addIssue(issue);
107418
+ for (const issue2 of collectBlockSequenceIssues(snapshots)) {
107419
+ ctx.addIssue(issue2);
107011
107420
  }
107012
107421
  }
107013
107422
  function collectBlockSequenceIssues(snapshots) {
@@ -112674,7 +113083,19 @@ var init_teamMember = __esm({
112674
113083
  bind2("photo")
112675
113084
  )
112676
113085
  ]),
112677
- text({ as: "h3" }, bind2("name")),
113086
+ link(
113087
+ {
113088
+ href: { $bind: { from: "profilePath" } },
113089
+ className: "rb-team-member-name-link"
113090
+ },
113091
+ [text({ as: "h3" }, bind2("name"))],
113092
+ when("profilePath")
113093
+ ),
113094
+ text(
113095
+ { as: "h3" },
113096
+ when("profilePath", { not: true }),
113097
+ bind2("name")
113098
+ ),
112678
113099
  text({ as: "p", className: "rb-team-member-role" }, when("role"), bind2("role")),
112679
113100
  richText(
112680
113101
  { className: "rb-prose rb-max-w-none" },
@@ -113551,9 +113972,9 @@ function createZodCodec(schema) {
113551
113972
  return decodeSuccess(parsed.data);
113552
113973
  }
113553
113974
  return decodeFailure(
113554
- parsed.error.issues.map((issue) => ({
113555
- path: zodIssuePath(issue.path),
113556
- message: issue.message
113975
+ parsed.error.issues.map((issue2) => ({
113976
+ path: zodIssuePath(issue2.path),
113977
+ message: issue2.message
113557
113978
  }))
113558
113979
  );
113559
113980
  }
@@ -113961,7 +114382,7 @@ function getNavStyleClasses(navStyle) {
113961
114382
  return baseClasses;
113962
114383
  }
113963
114384
  }
113964
- function isPlainObject3(value) {
114385
+ function isPlainObject4(value) {
113965
114386
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
113966
114387
  }
113967
114388
  function readString(obj, key) {
@@ -114089,7 +114510,7 @@ var init_ui = __esm({
114089
114510
  summary: "Resolve hero content wrapper className from alignment + max width controls",
114090
114511
  schema: heroContentWrapperClassSchema,
114091
114512
  run: (value, options, context) => {
114092
- const content = isPlainObject3(value) ? value : isPlainObject3(context.data) ? context.data : {};
114513
+ const content = isPlainObject4(value) ? value : isPlainObject4(context.data) ? context.data : {};
114093
114514
  const alignment = resolveHeroContentAlignment(content);
114094
114515
  const maxWidth = resolveHeroContentMaxWidth(content);
114095
114516
  const textAlignClass = alignment === "center" ? "rb-text-center" : alignment === "right" ? "rb-text-right" : "rb-text-left";
@@ -114108,7 +114529,7 @@ var init_ui = __esm({
114108
114529
  kind: "string",
114109
114530
  summary: "Map hero contentAlignment to CTA row justify value",
114110
114531
  run: (value, _options, context) => {
114111
- const content = isPlainObject3(value) ? value : isPlainObject3(context.data) ? context.data : {};
114532
+ const content = isPlainObject4(value) ? value : isPlainObject4(context.data) ? context.data : {};
114112
114533
  const alignment = resolveHeroContentAlignment(content);
114113
114534
  return alignment === "left" ? "start" : alignment === "right" ? "end" : "center";
114114
114535
  }
@@ -114118,7 +114539,7 @@ var init_ui = __esm({
114118
114539
  kind: "string",
114119
114540
  summary: "Map hero verticalAlignment to stack justify value",
114120
114541
  run: (value, _options, context) => {
114121
- const content = isPlainObject3(value) ? value : isPlainObject3(context.data) ? context.data : {};
114542
+ const content = isPlainObject4(value) ? value : isPlainObject4(context.data) ? context.data : {};
114122
114543
  const vertical = resolveHeroVerticalAlignment(content);
114123
114544
  return vertical === "top" ? "start" : vertical === "bottom" ? "end" : "center";
114124
114545
  }
@@ -114132,7 +114553,7 @@ var init_ui = __esm({
114132
114553
  summary: "Append align-items class for hero split layouts based on verticalAlignment",
114133
114554
  schema: heroGridClassFromVerticalAlignmentSchema,
114134
114555
  run: (value, options, context) => {
114135
- const content = isPlainObject3(value) ? value : isPlainObject3(context.data) ? context.data : {};
114556
+ const content = isPlainObject4(value) ? value : isPlainObject4(context.data) ? context.data : {};
114136
114557
  const vertical = resolveHeroVerticalAlignment(content);
114137
114558
  const itemsClass = vertical === "top" ? "rb-items-start" : vertical === "bottom" ? "rb-items-end" : "rb-items-center";
114138
114559
  return joinClasses3([options.base, itemsClass]);
@@ -115012,6 +115433,18 @@ var init_media2 = __esm({
115012
115433
  mediaTransforms = [mediaFromUrl];
115013
115434
  }
115014
115435
  });
115436
+
115437
+ // ../blocks/src/lib/typeGuards.ts
115438
+ function isRecord5(value) {
115439
+ return typeof value === "object" && value !== null && !Array.isArray(value);
115440
+ }
115441
+ function isObjectRecord2(value) {
115442
+ return typeof value === "object" && value !== null;
115443
+ }
115444
+ var init_typeGuards2 = __esm({
115445
+ "../blocks/src/lib/typeGuards.ts"() {
115446
+ }
115447
+ });
115015
115448
  function getSiteName(context) {
115016
115449
  const viewModel = context.viewModel;
115017
115450
  if (!isRecord5(viewModel)) return null;
@@ -117096,52 +117529,52 @@ var init_media3 = __esm({
117096
117529
  "audio",
117097
117530
  "video"
117098
117531
  ];
117099
- hotspotSchema2 = z37.object({
117100
- x: z37.number().min(0).max(1),
117101
- y: z37.number().min(0).max(1),
117102
- radius: z37.number().optional()
117103
- });
117104
- rotationSchema2 = z37.union([z37.literal(0), z37.literal(90), z37.literal(180), z37.literal(270)]);
117105
- rectSchema2 = z37.tuple([z37.number(), z37.number(), z37.number(), z37.number()]);
117106
- aspectCropSchema2 = z37.object({
117107
- aspect: z37.preprocess((value) => value == null ? void 0 : value, z37.string().optional()),
117108
- rect: z37.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
117109
- hotspot: z37.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
117110
- rotation: z37.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
117111
- });
117112
- transformSchema2 = z37.object({
117113
- aspectCrops: z37.preprocess((value) => {
117532
+ hotspotSchema2 = z38.object({
117533
+ x: z38.number().min(0).max(1),
117534
+ y: z38.number().min(0).max(1),
117535
+ radius: z38.number().optional()
117536
+ });
117537
+ rotationSchema2 = z38.union([z38.literal(0), z38.literal(90), z38.literal(180), z38.literal(270)]);
117538
+ rectSchema2 = z38.tuple([z38.number(), z38.number(), z38.number(), z38.number()]);
117539
+ aspectCropSchema2 = z38.object({
117540
+ aspect: z38.preprocess((value) => value == null ? void 0 : value, z38.string().optional()),
117541
+ rect: z38.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
117542
+ hotspot: z38.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
117543
+ rotation: z38.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
117544
+ });
117545
+ transformSchema2 = z38.object({
117546
+ aspectCrops: z38.preprocess((value) => {
117114
117547
  if (!value || typeof value !== "object" || Array.isArray(value)) {
117115
117548
  return void 0;
117116
117549
  }
117117
117550
  return value;
117118
- }, z37.record(z37.string(), aspectCropSchema2.catch({}))).optional(),
117551
+ }, z38.record(z38.string(), aspectCropSchema2.catch({}))).optional(),
117119
117552
  rect: rectSchema2.optional(),
117120
117553
  hotspot: hotspotSchema2.optional(),
117121
117554
  rotation: rotationSchema2.optional()
117122
117555
  });
117123
- mediaBaseSchema = z37.object({
117124
- purpose: z37.string().optional(),
117125
- placeholder: z37.boolean().default(true).optional(),
117126
- assetId: z37.string().optional(),
117127
- identifier: z37.string().optional(),
117128
- src: z37.string().optional(),
117129
- alt: z37.string().optional(),
117130
- filename: z37.string().optional(),
117131
- mimeType: z37.string().optional(),
117132
- width: z37.number().optional(),
117133
- height: z37.number().optional(),
117134
- storageBucket: z37.string().optional(),
117135
- storagePath: z37.string().optional(),
117556
+ mediaBaseSchema = z38.object({
117557
+ purpose: z38.string().optional(),
117558
+ placeholder: z38.boolean().default(true).optional(),
117559
+ assetId: z38.string().optional(),
117560
+ identifier: z38.string().optional(),
117561
+ src: z38.string().optional(),
117562
+ alt: z38.string().optional(),
117563
+ filename: z38.string().optional(),
117564
+ mimeType: z38.string().optional(),
117565
+ width: z38.number().optional(),
117566
+ height: z38.number().optional(),
117567
+ storageBucket: z38.string().optional(),
117568
+ storagePath: z38.string().optional(),
117136
117569
  transform: transformSchema2.optional()
117137
117570
  });
117138
- imageMediaSchema = mediaBaseSchema.extend({ type: z37.literal("image") });
117139
- videoMediaSchema = mediaBaseSchema.extend({ type: z37.literal("video") });
117140
- audioMediaSchema = mediaBaseSchema.extend({ type: z37.literal("audio") });
117141
- documentMediaSchema = mediaBaseSchema.extend({ type: z37.literal("document") });
117142
- spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z37.literal("spreadsheet") });
117143
- archiveMediaSchema = mediaBaseSchema.extend({ type: z37.literal("archive") });
117144
- mediaSchema2 = z37.discriminatedUnion("type", [
117571
+ imageMediaSchema = mediaBaseSchema.extend({ type: z38.literal("image") });
117572
+ videoMediaSchema = mediaBaseSchema.extend({ type: z38.literal("video") });
117573
+ audioMediaSchema = mediaBaseSchema.extend({ type: z38.literal("audio") });
117574
+ documentMediaSchema = mediaBaseSchema.extend({ type: z38.literal("document") });
117575
+ spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z38.literal("spreadsheet") });
117576
+ archiveMediaSchema = mediaBaseSchema.extend({ type: z38.literal("archive") });
117577
+ mediaSchema2 = z38.discriminatedUnion("type", [
117145
117578
  imageMediaSchema,
117146
117579
  videoMediaSchema,
117147
117580
  audioMediaSchema,
@@ -117237,7 +117670,9 @@ var init_schemas = __esm({
117237
117670
  courseTeamMemberSummarySchema = z.object({
117238
117671
  id: z.string(),
117239
117672
  name: z.string(),
117240
- summary: z.string().nullable()
117673
+ roleLabel: z.string().nullable(),
117674
+ summary: z.string().nullable(),
117675
+ profilePath: z.string().nullable()
117241
117676
  });
117242
117677
  coursePricingOptionSchema = z.object({
117243
117678
  id: z.string(),
@@ -117348,7 +117783,9 @@ var init_schemas2 = __esm({
117348
117783
  publicTeamMemberSummarySchema = z.object({
117349
117784
  id: z.string(),
117350
117785
  name: z.string(),
117351
- summary: z.string().nullable()
117786
+ roleLabel: z.string().nullable(),
117787
+ summary: z.string().nullable(),
117788
+ profilePath: z.string().nullable()
117352
117789
  });
117353
117790
  publicEventSchema = z.object({
117354
117791
  kind: z.enum(["event", "course_session"]).optional(),
@@ -123555,7 +123992,7 @@ var init_shared8 = __esm({
123555
123992
  });
123556
123993
 
123557
123994
  // ../blocks/src/system/runtime/api/creditProducts.ts
123558
- function assertNever6(value) {
123995
+ function assertNever7(value) {
123559
123996
  throw new Error(`Unhandled credit product case: ${String(value)}`);
123560
123997
  }
123561
123998
  function useCasesFromModules(modules) {
@@ -123588,7 +124025,7 @@ function getCreditProductCreditUnit(useCase) {
123588
124025
  perCreditSuffix: "credit"
123589
124026
  };
123590
124027
  default:
123591
- return assertNever6(useCase);
124028
+ return assertNever7(useCase);
123592
124029
  }
123593
124030
  }
123594
124031
  function deriveCreditProductLabels(products, options = {}) {
@@ -125631,9 +126068,7 @@ var init_newsletter_signup = __esm({
125631
126068
  };
125632
126069
  }
125633
126070
  });
125634
-
125635
- // ../blocks/src/system/blocks/team-members.ts
125636
- var ITEM_NAME7, headingNode, wrapVariant3, teamMemberStackLayout, gridMembersNode, gridVariant, stackMembersNode, stackVariant, teamMembersManifest, teamMembersBlockDefinition;
126071
+ var ITEM_NAME7, teamMemberPhotoSchema, teamMemberDataSchema, teamMembersDataSchema, dynamicSourceWhen, manualSourceWhen, headingNode, wrapVariant3, teamMemberStackLayout, manualGridMembersNode, dynamicGridMembersNode, gridVariant, manualStackMembersNode, dynamicStackMembersNode, stackVariant, teamMembersManifest, teamMembersBlockDefinition;
125637
126072
  var init_team_members = __esm({
125638
126073
  "../blocks/src/system/blocks/team-members.ts"() {
125639
126074
  init_fragments2();
@@ -125643,7 +126078,25 @@ var init_team_members = __esm({
125643
126078
  init_fragments();
125644
126079
  init_fragmentCollection();
125645
126080
  init_imageLayout();
126081
+ init_media3();
125646
126082
  ITEM_NAME7 = "member";
126083
+ teamMemberPhotoSchema = mediaSchema2.refine((media2) => media2.type === "image", {
126084
+ message: "Team member photos must be image media"
126085
+ }).nullable();
126086
+ teamMemberDataSchema = z.object({
126087
+ _type: z.literal("teamMember"),
126088
+ id: z.string(),
126089
+ name: z.string(),
126090
+ role: z.string().nullable(),
126091
+ roleLabel: z.string().nullable(),
126092
+ bio: z.string().nullable(),
126093
+ summary: z.string().nullable(),
126094
+ photo: teamMemberPhotoSchema,
126095
+ profilePath: z.string().nullable()
126096
+ });
126097
+ teamMembersDataSchema = z.array(teamMemberDataSchema);
126098
+ dynamicSourceWhen = { equals: "site_staff" };
126099
+ manualSourceWhen = { equals: "site_staff", not: true };
125647
126100
  headingNode = text(
125648
126101
  { as: "h2" },
125649
126102
  bind2("content.heading"),
@@ -125733,7 +126186,15 @@ var init_team_members = __esm({
125733
126186
  ]
125734
126187
  ),
125735
126188
  stack({ gap: "sm", className: "rb-team-member-body rb-flex-1 rb-min-w-0" }, [
125736
- text({ as: "h3" }, bind2("name")),
126189
+ link(
126190
+ {
126191
+ href: { $bind: { from: "profilePath" } },
126192
+ className: "rb-team-member-name-link"
126193
+ },
126194
+ [text({ as: "h3" }, bind2("name"))],
126195
+ when("profilePath")
126196
+ ),
126197
+ text({ as: "h3" }, when("profilePath", { not: true }), bind2("name")),
125737
126198
  text(
125738
126199
  { as: "p", className: "rb-team-member-role" },
125739
126200
  when("role"),
@@ -125747,12 +126208,18 @@ var init_team_members = __esm({
125747
126208
  ])
125748
126209
  ]
125749
126210
  );
125750
- gridMembersNode = repeaterFragmentLayout({
126211
+ manualGridMembersNode = when("content.source", manualSourceWhen)(repeaterFragmentLayout({
125751
126212
  collectionPath: "content.members",
125752
126213
  itemName: ITEM_NAME7,
125753
126214
  fragments: { teamMember: teamMemberFragment },
125754
126215
  itemGap: "sm"
125755
- });
126216
+ }));
126217
+ dynamicGridMembersNode = when("content.source", dynamicSourceWhen)(repeaterFragmentLayout({
126218
+ collectionPath: "data.members",
126219
+ itemName: ITEM_NAME7,
126220
+ fragments: { teamMember: teamMemberFragment },
126221
+ itemGap: "sm"
126222
+ }));
125756
126223
  gridVariant = wrapVariant3(
125757
126224
  el(
125758
126225
  "grid",
@@ -125766,22 +126233,29 @@ var init_team_members = __esm({
125766
126233
  },
125767
126234
  gap: { $bind: { from: "content.gap", fallback: "medium" } }
125768
126235
  },
125769
- [gridMembersNode]
126236
+ [manualGridMembersNode, dynamicGridMembersNode]
125770
126237
  )
125771
126238
  );
125772
- stackMembersNode = repeaterFragmentLayout({
126239
+ manualStackMembersNode = when("content.source", manualSourceWhen)(repeaterFragmentLayout({
125773
126240
  collectionPath: "content.members",
125774
126241
  itemName: ITEM_NAME7,
125775
126242
  fragments: { teamMember: teamMemberFragment },
125776
126243
  layoutOverrides: { teamMember: teamMemberStackLayout },
125777
126244
  itemGap: "sm"
125778
- });
126245
+ }));
126246
+ dynamicStackMembersNode = when("content.source", dynamicSourceWhen)(repeaterFragmentLayout({
126247
+ collectionPath: "data.members",
126248
+ itemName: ITEM_NAME7,
126249
+ fragments: { teamMember: teamMemberFragment },
126250
+ layoutOverrides: { teamMember: teamMemberStackLayout },
126251
+ itemGap: "sm"
126252
+ }));
125779
126253
  stackVariant = wrapVariant3({
125780
126254
  type: "stack",
125781
126255
  props: {
125782
126256
  gap: { $bind: { from: "content.gap", fallback: "medium" } }
125783
126257
  },
125784
- children: [stackMembersNode]
126258
+ children: [manualStackMembersNode, dynamicStackMembersNode]
125785
126259
  });
125786
126260
  teamMembersManifest = createBlockManifest({
125787
126261
  id: "block.team-members",
@@ -125796,6 +126270,18 @@ var init_team_members = __esm({
125796
126270
  required: false,
125797
126271
  maxLength: 120
125798
126272
  }),
126273
+ parseFieldDefinition({
126274
+ id: "source",
126275
+ type: "select",
126276
+ label: "Team members",
126277
+ description: "Choose whether to use the site-wide team or a hand-picked list.",
126278
+ defaultValue: "manual",
126279
+ options: [
126280
+ { value: "manual", label: "Choose manually" },
126281
+ { value: "site_staff", label: "Use all site team members" }
126282
+ ],
126283
+ ui: { intent: "behavior" }
126284
+ }),
125799
126285
  parseFieldDefinition({
125800
126286
  id: "layoutAlign",
125801
126287
  type: "select",
@@ -125898,18 +126384,24 @@ var init_team_members = __esm({
125898
126384
  ],
125899
126385
  ui: { intent: "display" }
125900
126386
  }),
125901
- fragmentsToRepeaterField(
125902
- "members",
125903
- "Team members",
125904
- { teamMember: teamMemberFragment },
125905
- {
125906
- minItems: 0,
125907
- maxItems: 50,
125908
- itemLabel: "Team member",
125909
- itemLabelSource: "name",
125910
- description: "Add people to this section."
126387
+ {
126388
+ ...fragmentsToRepeaterField(
126389
+ "members",
126390
+ "Team members",
126391
+ { teamMember: teamMemberFragment },
126392
+ {
126393
+ minItems: 0,
126394
+ maxItems: 50,
126395
+ itemLabel: "Team member",
126396
+ itemLabelSource: "name",
126397
+ description: "Add people to this section."
126398
+ }
126399
+ ),
126400
+ ui: {
126401
+ intent: "content",
126402
+ visibleWhen: { field: "source", equals: "manual" }
125911
126403
  }
125912
- )
126404
+ }
125913
126405
  ],
125914
126406
  layout: gridVariant,
125915
126407
  variants: {
@@ -125935,7 +126427,20 @@ var init_team_members = __esm({
125935
126427
  styleTokens: { spacing: "lg" }
125936
126428
  });
125937
126429
  teamMembersBlockDefinition = {
125938
- manifest: teamMembersManifest
126430
+ manifest: teamMembersManifest,
126431
+ dataSchemas: {
126432
+ members: teamMembersDataSchema
126433
+ },
126434
+ dataLoaders: {
126435
+ members: {
126436
+ endpoint: "listPublicTeamMembers",
126437
+ params: {
126438
+ siteId: { $bind: { from: "$root.siteId" } },
126439
+ stage: { $bind: { from: "$root.previewStage", fallback: "published" } }
126440
+ },
126441
+ mode: "server"
126442
+ }
126443
+ }
125939
126444
  };
125940
126445
  }
125941
126446
  });
@@ -128813,7 +129318,7 @@ function okWith(data) {
128813
129318
  function err2(error) {
128814
129319
  return { ok: false, error };
128815
129320
  }
128816
- function assertNever7(value, message2) {
129321
+ function assertNever8(value, message2) {
128817
129322
  throw new Error(`Unexpected value: ${String(value)}`);
128818
129323
  }
128819
129324
  var init_dist88 = __esm({
@@ -128958,7 +129463,7 @@ function deriveBookingFormViewState(input) {
128958
129463
  resourceName: input.verificationState.resourceName
128959
129464
  };
128960
129465
  default:
128961
- return assertNever7(input.verificationState);
129466
+ return assertNever8(input.verificationState);
128962
129467
  }
128963
129468
  }
128964
129469
  function resolveBookingSiteId(siteId, form2) {
@@ -129041,7 +129546,7 @@ function getBookingServicePaymentSelectionMode(service) {
129041
129546
  case "flexible_balance":
129042
129547
  return "implicit_flexible_balance";
129043
129548
  default:
129044
- return assertNever7(onlyKind);
129549
+ return assertNever8(onlyKind);
129045
129550
  }
129046
129551
  }
129047
129552
  if (allowedKinds.length === 2 && allowedKinds.includes("upfront") && (allowedKinds.includes("deferred_manual") || allowedKinds.includes("instalment_plan") || allowedKinds.includes("flexible_balance"))) {
@@ -129243,7 +129748,7 @@ function formatBookingSubmissionPreparationError(error) {
129243
129748
  case "service-missing-duration":
129244
129749
  return `Service "${error.serviceTitle}" is missing duration. Please update the service in the dashboard to include a duration (e.g., 30 minutes).`;
129245
129750
  default:
129246
- return assertNever7(error);
129751
+ return assertNever8(error);
129247
129752
  }
129248
129753
  }
129249
129754
  function getBookingSuccessMessage(successMessage) {
@@ -129658,6 +130163,12 @@ var init_CoursePricingDisplay = __esm({
129658
130163
  init_shared6();
129659
130164
  }
129660
130165
  });
130166
+ function TeamMemberName({
130167
+ name,
130168
+ profilePath
130169
+ }) {
130170
+ return profilePath ? /* @__PURE__ */ jsx("a", { href: profilePath, className: "rb-hover-opacity-80", children: /* @__PURE__ */ jsx("strong", { children: name }) }) : /* @__PURE__ */ jsx("strong", { children: name });
130171
+ }
129661
130172
  function EventDetailsView({
129662
130173
  selection,
129663
130174
  showVenue,
@@ -129721,7 +130232,13 @@ function EventDetailsView({
129721
130232
  teamMembers.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "rb-mt-6", children: [
129722
130233
  /* @__PURE__ */ jsx("div", { className: "rb-label rb-mb-2", children: "Team members" }),
129723
130234
  /* @__PURE__ */ jsx("div", { className: "rb-flex rb-flex-col rb-gap-3", children: teamMembers.map((teamMember) => /* @__PURE__ */ jsxs("div", { children: [
129724
- /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: teamMember.name }) }),
130235
+ /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(
130236
+ TeamMemberName,
130237
+ {
130238
+ name: teamMember.name,
130239
+ profilePath: teamMember.profilePath
130240
+ }
130241
+ ) }),
129725
130242
  teamMember.summary ? /* @__PURE__ */ jsx("p", { className: "rb-caption status-muted", children: teamMember.summary }) : null
129726
130243
  ] }, teamMember.id)) })
129727
130244
  ] }) : null,
@@ -130094,6 +130611,12 @@ var init_runs = __esm({
130094
130611
  init_src3();
130095
130612
  }
130096
130613
  });
130614
+ function TeamMemberName2({
130615
+ name,
130616
+ profilePath
130617
+ }) {
130618
+ return profilePath ? /* @__PURE__ */ jsx("a", { href: profilePath, className: "rb-hover-opacity-80", children: /* @__PURE__ */ jsx("strong", { children: name }) }) : /* @__PURE__ */ jsx("strong", { children: name });
130619
+ }
130097
130620
  function parseLimit2(value, fallback2) {
130098
130621
  if (value === "all") return "all";
130099
130622
  const n3 = typeof value === "string" ? Number.parseInt(value, 10) : typeof value === "number" ? value : NaN;
@@ -130151,7 +130674,13 @@ function CourseDetailsView(props2) {
130151
130674
  teamMembers.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
130152
130675
  /* @__PURE__ */ jsx("div", { className: "rb-label rb-mb-2", children: "Team members" }),
130153
130676
  /* @__PURE__ */ jsx("div", { className: "rb-flex rb-flex-col rb-gap-3", children: teamMembers.map((teamMember) => /* @__PURE__ */ jsxs("div", { children: [
130154
- /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: teamMember.name }) }),
130677
+ /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(
130678
+ TeamMemberName2,
130679
+ {
130680
+ name: teamMember.name,
130681
+ profilePath: teamMember.profilePath
130682
+ }
130683
+ ) }),
130155
130684
  teamMember.summary && /* @__PURE__ */ jsx("p", { className: "rb-caption status-muted", children: teamMember.summary })
130156
130685
  ] }, teamMember.id)) })
130157
130686
  ] })
@@ -132351,7 +132880,7 @@ function readFromSource(source, segments) {
132351
132880
  return void 0;
132352
132881
  }, source);
132353
132882
  }
132354
- function isPlainObject4(value) {
132883
+ function isPlainObject5(value) {
132355
132884
  return typeof value === "object" && value !== null && !Array.isArray(value);
132356
132885
  }
132357
132886
  function parseRouteEntry(routeId, value) {
@@ -132361,35 +132890,35 @@ function parseRouteEntry(routeId, value) {
132361
132890
  if (typeof value === "string") {
132362
132891
  return [routeId, value];
132363
132892
  }
132364
- if (isPlainObject4(value)) {
132893
+ if (isPlainObject5(value)) {
132365
132894
  return [routeId, value];
132366
132895
  }
132367
132896
  return null;
132368
132897
  }
132369
132898
  function extractRouteMapFromViewModel(viewModel) {
132370
- if (!isPlainObject4(viewModel)) return void 0;
132899
+ if (!isPlainObject5(viewModel)) return void 0;
132371
132900
  const root = viewModel.$root;
132372
- if (!isPlainObject4(root)) return void 0;
132901
+ if (!isPlainObject5(root)) return void 0;
132373
132902
  const routes = root.routes;
132374
- if (!isPlainObject4(routes)) return void 0;
132903
+ if (!isPlainObject5(routes)) return void 0;
132375
132904
  const entries = Object.entries(routes).map(([routeId, value]) => parseRouteEntry(routeId, value)).filter((entry) => entry !== null);
132376
132905
  if (entries.length === 0) return void 0;
132377
132906
  return Object.fromEntries(entries);
132378
132907
  }
132379
132908
  function extractPagesByIdentifierFromViewModel(viewModel) {
132380
- if (!isPlainObject4(viewModel)) return void 0;
132909
+ if (!isPlainObject5(viewModel)) return void 0;
132381
132910
  const root = viewModel.$root;
132382
- if (!isPlainObject4(root)) return void 0;
132911
+ if (!isPlainObject5(root)) return void 0;
132383
132912
  const pagesByIdentifier = root.pagesByIdentifier;
132384
- if (!isPlainObject4(pagesByIdentifier)) return void 0;
132913
+ if (!isPlainObject5(pagesByIdentifier)) return void 0;
132385
132914
  return pagesByIdentifier;
132386
132915
  }
132387
132916
  function extractEntriesByIdentifierFromViewModel(viewModel) {
132388
- if (!isPlainObject4(viewModel)) return void 0;
132917
+ if (!isPlainObject5(viewModel)) return void 0;
132389
132918
  const root = viewModel.$root;
132390
- if (!isPlainObject4(root)) return void 0;
132919
+ if (!isPlainObject5(root)) return void 0;
132391
132920
  const entriesByIdentifier = root.entriesByIdentifier;
132392
- if (!isPlainObject4(entriesByIdentifier)) return void 0;
132921
+ if (!isPlainObject5(entriesByIdentifier)) return void 0;
132393
132922
  return entriesByIdentifier;
132394
132923
  }
132395
132924
  function parseBinding(raw, origin) {
@@ -132405,7 +132934,7 @@ function applyTransformsAndFallback(value, binding, context) {
132405
132934
  const routeMap = context.routes ?? extractRouteMapFromViewModel(context.viewModel);
132406
132935
  const pagesByIdentifier = context.pagesByIdentifier ?? extractPagesByIdentifierFromViewModel(context.viewModel);
132407
132936
  const entriesByIdentifier = context.entriesByIdentifier ?? extractEntriesByIdentifierFromViewModel(context.viewModel);
132408
- const root = isPlainObject4(context.viewModel.$root) ? context.viewModel.$root : null;
132937
+ const root = isPlainObject5(context.viewModel.$root) ? context.viewModel.$root : null;
132409
132938
  const stage = root?.previewStage === "preview" ? "preview" : "published";
132410
132939
  const transformed = runTransforms(
132411
132940
  value,
@@ -132442,21 +132971,21 @@ function resolveTransformData(context, bindingPath) {
132442
132971
  const [first2] = segments;
132443
132972
  if (typeof first2 === "string" && first2 !== "$root") {
132444
132973
  const namedScope = context.scopes.find((entry) => entry.name === first2);
132445
- if (namedScope && isPlainObject4(namedScope.value)) {
132974
+ if (namedScope && isPlainObject5(namedScope.value)) {
132446
132975
  return namedScope.value;
132447
132976
  }
132448
132977
  }
132449
132978
  for (let i2 = context.scopes.length - 1; i2 >= 0; i2 -= 1) {
132450
132979
  const scope = context.scopes[i2];
132451
- if (scope && isPlainObject4(scope.value)) {
132980
+ if (scope && isPlainObject5(scope.value)) {
132452
132981
  return scope.value;
132453
132982
  }
132454
132983
  }
132455
132984
  const content = context.viewModel.content;
132456
- if (isPlainObject4(content)) {
132985
+ if (isPlainObject5(content)) {
132457
132986
  return content;
132458
132987
  }
132459
- if (isPlainObject4(context.viewModel)) {
132988
+ if (isPlainObject5(context.viewModel)) {
132460
132989
  return context.viewModel;
132461
132990
  }
132462
132991
  return void 0;
@@ -132591,7 +133120,7 @@ function getNestedBinding(bindings, path) {
132591
133120
  const segments = path.split(".");
132592
133121
  let current = bindings;
132593
133122
  for (const segment of segments) {
132594
- if (!isPlainObject4(current)) return void 0;
133123
+ if (!isPlainObject5(current)) return void 0;
132595
133124
  current = current[segment];
132596
133125
  }
132597
133126
  return current;
@@ -132605,7 +133134,7 @@ function resolveBindingToEditorPath(fieldName, bindings, editableRouteMetadataFi
132605
133134
  };
132606
133135
  const binding = bindings[fieldName] ?? getNestedBinding(bindings, fieldName);
132607
133136
  if (!binding) return null;
132608
- if (isPlainObject4(binding) && "source" in binding) {
133137
+ if (isPlainObject5(binding) && "source" in binding) {
132609
133138
  const source = binding.source;
132610
133139
  if (source === "field" && "path" in binding) {
132611
133140
  const path = binding.path;
@@ -132624,7 +133153,7 @@ function resolveBindingToEditorPath(fieldName, bindings, editableRouteMetadataFi
132624
133153
  if (typeof option === "string") {
132625
133154
  return `content.${option}`;
132626
133155
  }
132627
- if (isPlainObject4(option) && "source" in option) {
133156
+ if (isPlainObject5(option) && "source" in option) {
132628
133157
  const optSource = option.source;
132629
133158
  if (optSource === "field" && "path" in option) {
132630
133159
  const path = option.path;
@@ -132669,7 +133198,7 @@ function injectEditorPath(props2, node, parsedBinding, context) {
132669
133198
  }
132670
133199
  }
132671
133200
  const root = context.viewModel?.$root;
132672
- const isEntryTemplatePage = isPlainObject4(root) && root.contentEntry != null;
133201
+ const isEntryTemplatePage = isPlainObject5(root) && root.contentEntry != null;
132673
133202
  if (isEntryTemplatePage && context.pathBase) return props2;
132674
133203
  const prefix = context.pathBase ?? "";
132675
133204
  const injectedPath = `${prefix}${fieldPath}`;
@@ -132698,7 +133227,7 @@ function injectMediaSlotPath(props2, node, parsedBinding, context) {
132698
133227
  if (entryPath) return props2;
132699
133228
  }
132700
133229
  const root = context.viewModel?.$root;
132701
- const isEntryTemplatePage = isPlainObject4(root) && root.contentEntry != null;
133230
+ const isEntryTemplatePage = isPlainObject5(root) && root.contentEntry != null;
132702
133231
  if (isEntryTemplatePage && context.pathBase) return props2;
132703
133232
  return {
132704
133233
  ...props2,
@@ -132802,7 +133331,7 @@ function getNodeProps(node) {
132802
133331
  if (key.startsWith("$")) continue;
132803
133332
  legacy[key] = value;
132804
133333
  }
132805
- const props2 = isPlainObject4(node.props) ? node.props : {};
133334
+ const props2 = isPlainObject5(node.props) ? node.props : {};
132806
133335
  return { ...legacy, ...props2 };
132807
133336
  }
132808
133337
  function resolveTree(node, options) {
@@ -132869,14 +133398,14 @@ var init_runtime2 = __esm({
132869
133398
  });
132870
133399
 
132871
133400
  // ../theme-core/src/blockOverrides.ts
132872
- function isPlainObject5(value) {
133401
+ function isPlainObject6(value) {
132873
133402
  return typeof value === "object" && value !== null && !Array.isArray(value);
132874
133403
  }
132875
133404
  function cloneValue(value) {
132876
133405
  if (Array.isArray(value)) {
132877
133406
  return value.map((item) => cloneValue(item));
132878
133407
  }
132879
- if (isPlainObject5(value)) {
133408
+ if (isPlainObject6(value)) {
132880
133409
  const cloned = {};
132881
133410
  for (const [key, child] of Object.entries(value)) {
132882
133411
  cloned[key] = cloneValue(child);
@@ -132892,7 +133421,7 @@ function mergeDeep2(defaultValue2, overrideValue) {
132892
133421
  if (overrideValue === null) {
132893
133422
  return null;
132894
133423
  }
132895
- if (isPlainObject5(defaultValue2) && isPlainObject5(overrideValue)) {
133424
+ if (isPlainObject6(defaultValue2) && isPlainObject6(overrideValue)) {
132896
133425
  const merged = {};
132897
133426
  const keys2 = /* @__PURE__ */ new Set([...Object.keys(defaultValue2), ...Object.keys(overrideValue)]);
132898
133427
  for (const key of keys2) {
@@ -133084,12 +133613,6 @@ var init_ai = __esm({
133084
133613
  }
133085
133614
  });
133086
133615
 
133087
- // ../blocks/src/system/types/link.ts
133088
- var init_link2 = __esm({
133089
- "../blocks/src/system/types/link.ts"() {
133090
- }
133091
- });
133092
-
133093
133616
  // ../blocks/src/system/index.ts
133094
133617
  var init_system = __esm({
133095
133618
  "../blocks/src/system/index.ts"() {
@@ -137187,7 +137710,7 @@ function resolveBlockData({
137187
137710
  }
137188
137711
  function getRenderableContent(block) {
137189
137712
  const source = block.draftContent ?? block.content ?? {};
137190
- if (!isObjectRecord(source)) {
137713
+ if (!isObjectRecord2(source)) {
137191
137714
  return {};
137192
137715
  }
137193
137716
  return source;
@@ -137206,8 +137729,8 @@ function summarizeValue(value) {
137206
137729
  for (const k of keys2.slice(0, 8)) {
137207
137730
  const v2 = rec[k];
137208
137731
  if (k === "body" || k === "content") {
137209
- const isDocWrapper = !!(v2 && typeof v2 === "object" && isObjectRecord(v2) && "doc" in v2);
137210
- const isDoc = !!(v2 && typeof v2 === "object" && isObjectRecord(v2) && v2.type === "doc");
137732
+ const isDocWrapper = !!(v2 && typeof v2 === "object" && isObjectRecord2(v2) && "doc" in v2);
137733
+ const isDoc = !!(v2 && typeof v2 === "object" && isObjectRecord2(v2) && v2.type === "doc");
137211
137734
  preview[k] = isDocWrapper ? "{doc}" : isDoc ? "{type:doc}" : summarizeValue(v2);
137212
137735
  } else {
137213
137736
  preview[k] = summarizeValue(v2);
@@ -139086,25 +139609,25 @@ var init_Button2 = __esm({
139086
139609
  var BlockKind, blockSchema, pagePath;
139087
139610
  var init_schema5 = __esm({
139088
139611
  "../blocks/src/structure/schema.ts"() {
139089
- BlockKind = z37.string();
139090
- blockSchema = z37.object({
139091
- id: z37.string().nullable(),
139612
+ BlockKind = z38.string();
139613
+ blockSchema = z38.object({
139614
+ id: z38.string().nullable(),
139092
139615
  // optional ID for reference in toggle ops
139093
139616
  kind: BlockKind,
139094
- purpose: z37.string().min(1),
139617
+ purpose: z38.string().min(1),
139095
139618
  // Optional content fields used by PageRenderer / block runtime.
139096
- content: z37.record(z37.string(), z37.unknown()).optional(),
139619
+ content: z38.record(z38.string(), z38.unknown()).optional(),
139097
139620
  // Nullable because some persisted sources store "no draft" as null.
139098
- draftContent: z37.record(z37.string(), z37.unknown()).nullable().optional(),
139621
+ draftContent: z38.record(z38.string(), z38.unknown()).nullable().optional(),
139099
139622
  // Optional template bindings for reverse field mapping (entry editing)
139100
- bindings: z37.record(z37.string(), z37.unknown()).optional()
139623
+ bindings: z38.record(z38.string(), z38.unknown()).optional()
139101
139624
  }).passthrough();
139102
- pagePath = z37.string().regex(/^\/[\S]*$/, 'path must start with "/" and contain no spaces');
139103
- z37.object({
139104
- name: z37.string().min(1),
139625
+ pagePath = z38.string().regex(/^\/[\S]*$/, 'path must start with "/" and contain no spaces');
139626
+ z38.object({
139627
+ name: z38.string().min(1),
139105
139628
  path: pagePath,
139106
- purpose: z37.string().min(1),
139107
- blocks: z37.array(blockSchema).min(1)
139629
+ purpose: z38.string().min(1),
139630
+ blocks: z38.array(blockSchema).min(1)
139108
139631
  });
139109
139632
  }
139110
139633
  });
@@ -148433,6 +148956,7 @@ var init_loaderEndpoints = __esm({
148433
148956
  "listPublicEvents",
148434
148957
  "getPublicEventDetails",
148435
148958
  "listPublicCourses",
148959
+ "listPublicTeamMembers",
148436
148960
  "listPublicProducts",
148437
148961
  "listPublicPasses",
148438
148962
  "listPublicMemberships",
@@ -148495,6 +149019,7 @@ var init_src6 = __esm({
148495
149019
  init_buildThemeRuntimeFromBridge();
148496
149020
  init_blocks4();
148497
149021
  init_system();
149022
+ init_link2();
148498
149023
  init_validation();
148499
149024
  init_primitives();
148500
149025
  init_media4();
@@ -148545,10 +149070,10 @@ function deriveBlockDraftSaveability(input) {
148545
149070
  issues
148546
149071
  };
148547
149072
  }
148548
- function withNormalizedManifestMessage(issue) {
149073
+ function withNormalizedManifestMessage(issue2) {
148549
149074
  return {
148550
- ...issue,
148551
- message: normalizeManifestIssueMessage(issue)
149075
+ ...issue2,
149076
+ message: normalizeManifestIssueMessage(issue2)
148552
149077
  };
148553
149078
  }
148554
149079
  function validateBlockManifestIssues(manifest, values, mode) {
@@ -148560,31 +149085,31 @@ function validateBlockManifestIssues(manifest, values, mode) {
148560
149085
  return result.error.issues.map(withNormalizedManifestMessage);
148561
149086
  }
148562
149087
  function validateBlockManifest(manifest, values, mode) {
148563
- return validateBlockManifestIssues(manifest, values, mode).map((issue) => {
148564
- const path = normalizeIssuePath(issue.path);
149088
+ return validateBlockManifestIssues(manifest, values, mode).map((issue2) => {
149089
+ const path = normalizeIssuePath(issue2.path);
148565
149090
  return {
148566
- code: issue.code,
149091
+ code: issue2.code,
148567
149092
  path,
148568
149093
  fieldPath: normalizePathString(path),
148569
- message: issue.message
149094
+ message: issue2.message
148570
149095
  };
148571
149096
  });
148572
149097
  }
148573
- function normalizeManifestIssueMessage(issue) {
148574
- switch (issue.code) {
149098
+ function normalizeManifestIssueMessage(issue2) {
149099
+ switch (issue2.code) {
148575
149100
  case "invalid_type":
148576
- return issue.message;
149101
+ return issue2.message;
148577
149102
  case "too_big":
148578
- return issue.origin === "string" ? `Use ${issue.maximum} characters or fewer` : issue.message;
149103
+ return issue2.origin === "string" ? `Use ${issue2.maximum} characters or fewer` : issue2.message;
148579
149104
  case "too_small":
148580
- if (issue.origin !== "string") return issue.message;
148581
- return issue.minimum === 1 ? "This field is required" : `Use at least ${issue.minimum} characters`;
149105
+ if (issue2.origin !== "string") return issue2.message;
149106
+ return issue2.minimum === 1 ? "This field is required" : `Use at least ${issue2.minimum} characters`;
148582
149107
  case "invalid_format":
148583
- if (issue.format === "email") return "Enter a valid email address";
148584
- if (issue.format === "url") return "Enter a valid web address";
149108
+ if (issue2.format === "email") return "Enter a valid email address";
149109
+ if (issue2.format === "url") return "Enter a valid web address";
148585
149110
  return "Check the format and try again";
148586
149111
  default:
148587
- return issue.message;
149112
+ return issue2.message;
148588
149113
  }
148589
149114
  }
148590
149115
  function getManifestValidation(manifest, mode) {
@@ -148739,16 +149264,16 @@ function validateAllBlocks(uiStore) {
148739
149264
  }
148740
149265
  const issues = validateBlockManifest(definition.manifest, content, "strict");
148741
149266
  if (issues.length > 0) {
148742
- for (const issue of issues) {
149267
+ for (const issue2 of issues) {
148743
149268
  errors.push({
148744
149269
  blockId: snapshot2.id,
148745
149270
  blockKind: snapshot2.meta.kind,
148746
- fieldPath: issue.fieldPath,
149271
+ fieldPath: issue2.fieldPath,
148747
149272
  fieldLabel: getFieldLabelFromManifest(
148748
149273
  definition.manifest,
148749
- issue.path
149274
+ issue2.path
148750
149275
  ),
148751
- message: issue.message
149276
+ message: issue2.message
148752
149277
  });
148753
149278
  }
148754
149279
  }
@@ -149512,7 +150037,7 @@ var init_extractBlockData = __esm({
149512
150037
  });
149513
150038
 
149514
150039
  // ../content-editor/src/utils/assertNever.ts
149515
- function assertNever8(value, message2) {
150040
+ function assertNever9(value, message2) {
149516
150041
  throw new Error(`Unexpected value: ${String(value)}`);
149517
150042
  }
149518
150043
  var init_assertNever2 = __esm({
@@ -150110,7 +150635,7 @@ function applyEditorCommand(snapshot2, command2) {
150110
150635
  return nextSnapshot;
150111
150636
  }
150112
150637
  default:
150113
- return assertNever8(command2);
150638
+ return assertNever9(command2);
150114
150639
  }
150115
150640
  }
150116
150641
  function applyUserOperation(snapshot2, operation) {
@@ -150182,7 +150707,7 @@ function applySystemOperation(snapshot2, operation) {
150182
150707
  case "replace-block-list":
150183
150708
  return replaceEditorBlockList(snapshot2, operation.next);
150184
150709
  default:
150185
- return assertNever8(operation);
150710
+ return assertNever9(operation);
150186
150711
  }
150187
150712
  }
150188
150713
  function hydrateMetadataSnapshot(snapshot2, baseline, current, published) {
@@ -151952,7 +152477,7 @@ function toDrainFailure(effect, error) {
151952
152477
  case "persist-remove":
151953
152478
  return { kind: effect.type, message: message2 };
151954
152479
  default:
151955
- return assertNever8(effect);
152480
+ return assertNever9(effect);
151956
152481
  }
151957
152482
  }
151958
152483
  async function drainEditorEffect(effect, context) {
@@ -151964,7 +152489,7 @@ async function drainEditorEffect(effect, context) {
151964
152489
  case "persist-remove":
151965
152490
  return drainPersistRemoveEffect(effect, context);
151966
152491
  default:
151967
- return assertNever8(effect);
152492
+ return assertNever9(effect);
151968
152493
  }
151969
152494
  }
151970
152495
  async function drainEditorEffects(effects, context) {
@@ -153024,40 +153549,151 @@ var init_TextField = __esm({
153024
153549
  init_FieldFrame();
153025
153550
  }
153026
153551
  });
153027
- function withTextFieldSharedRules(schema, field) {
153028
- const maxLengthMessage = typeof field.maxLength === "number" ? `${field.label} must be ${field.maxLength} characters or less` : void 0;
153029
- let withRules = schema;
153030
- if (typeof field.maxLength === "number") {
153031
- withRules = withRules.max(field.maxLength, { message: maxLengthMessage });
153552
+
153553
+ // ../block-form/src/widgets/utils/readNumericUiConfig.ts
153554
+ function readNumericInputUiConfig(ui) {
153555
+ if (!ui || typeof ui !== "object") return {};
153556
+ const rec = ui;
153557
+ return {
153558
+ min: typeof rec.min === "number" ? rec.min : void 0,
153559
+ max: typeof rec.max === "number" ? rec.max : void 0,
153560
+ step: typeof rec.step === "number" ? rec.step : void 0
153561
+ };
153562
+ }
153563
+ function readNumberFieldUiConfig(ui) {
153564
+ return readNumericInputUiConfig(ui);
153565
+ }
153566
+ function readSliderFieldUiConfig(ui) {
153567
+ const base2 = readNumericInputUiConfig(ui);
153568
+ if (!ui || typeof ui !== "object") return base2;
153569
+ const rec = ui;
153570
+ return {
153571
+ ...base2,
153572
+ showValue: typeof rec.showValue === "boolean" ? rec.showValue : void 0
153573
+ };
153574
+ }
153575
+ var init_readNumericUiConfig = __esm({
153576
+ "../block-form/src/widgets/utils/readNumericUiConfig.ts"() {
153032
153577
  }
153033
- if (field.required) {
153034
- return withRules.min(1, "This field is required");
153578
+ });
153579
+
153580
+ // ../block-form/src/manifest/canonicalValidation.ts
153581
+ function buildCanonicalFieldSchema(field) {
153582
+ const manifestField = normalizeFieldForCanonicalValidation(field);
153583
+ return fieldPlanToZod(deriveFieldValidationPlan(manifestField), {
153584
+ allowNull: !Boolean(field.required)
153585
+ });
153586
+ }
153587
+ function normalizeFieldForCanonicalValidation(field) {
153588
+ return parseFieldDefinition(toManifestFieldInput(field));
153589
+ }
153590
+ function toManifestFieldInput(field) {
153591
+ switch (field.type) {
153592
+ case "number":
153593
+ return numberFieldToManifestInput(field);
153594
+ case "group":
153595
+ return groupFieldToManifestInput(field);
153596
+ case "modal":
153597
+ return modalFieldToManifestInput(field);
153598
+ case "repeater":
153599
+ return repeaterFieldToManifestInput(field);
153600
+ case "tabGroup":
153601
+ return {
153602
+ ...field,
153603
+ tabs: field.tabs.map((tab) => ({
153604
+ ...tab,
153605
+ fields: tab.fields.map(toManifestFieldInput)
153606
+ }))
153607
+ };
153608
+ case "button":
153609
+ throw new Error("Button fields do not have canonical content validation");
153610
+ case "text":
153611
+ case "richText":
153612
+ case "media":
153613
+ case "boolean":
153614
+ case "date":
153615
+ case "time":
153616
+ case "datetime":
153617
+ case "slug":
153618
+ case "url":
153619
+ case "link":
153620
+ case "select":
153621
+ case "reference":
153622
+ case "presetOrCustom":
153623
+ case "contentTypeSelect":
153624
+ case "entryPicker":
153625
+ return field;
153035
153626
  }
153036
- return withRules.optional().nullable().or(z.literal(""));
153627
+ return assertNever10(field);
153037
153628
  }
153038
- function buildTextFieldSchema(field) {
153039
- const inputType = field.ui?.inputType;
153040
- if (inputType === "email") {
153041
- return withTextFieldSharedRules(z.string().email("Enter a valid email"), field);
153042
- }
153043
- if (inputType === "tel") {
153044
- return withTextFieldSharedRules(
153045
- z.string().regex(/^[+()0-9\s\-]{3,}$/, "Enter a valid phone number"),
153046
- field
153047
- );
153629
+ function numberFieldToManifestInput(field) {
153630
+ const ui = readNumberFieldUiConfig(field.ui);
153631
+ return {
153632
+ ...field,
153633
+ min: field.min ?? ui.min,
153634
+ max: field.max ?? ui.max,
153635
+ step: field.step ?? ui.step
153636
+ };
153637
+ }
153638
+ function groupFieldToManifestInput(field) {
153639
+ return {
153640
+ ...field,
153641
+ schema: {
153642
+ ...field.schema,
153643
+ fields: (field.schema?.fields ?? field.fields).map(toManifestFieldInput)
153644
+ }
153645
+ };
153646
+ }
153647
+ function modalFieldToManifestInput(field) {
153648
+ return {
153649
+ ...field,
153650
+ schema: {
153651
+ ...field.schema,
153652
+ fields: field.schema.fields.map(toManifestFieldInput)
153653
+ }
153654
+ };
153655
+ }
153656
+ function repeaterFieldToManifestInput(field) {
153657
+ if (field.polymorphic) {
153658
+ return {
153659
+ ...field,
153660
+ itemTypes: Object.fromEntries(
153661
+ Object.entries(field.itemTypes).map(([typeId, itemType]) => [
153662
+ typeId,
153663
+ {
153664
+ ...itemType,
153665
+ fields: itemType.fields.map(toManifestFieldInput)
153666
+ }
153667
+ ])
153668
+ )
153669
+ };
153048
153670
  }
153049
- let s2 = z.string();
153050
- if (field.ui?.pattern) {
153051
- try {
153052
- const re2 = new RegExp(field.ui.pattern);
153053
- s2 = s2.regex(re2, { message: `${field.label} is not in the right format` });
153054
- } catch {
153671
+ return {
153672
+ ...field,
153673
+ schema: {
153674
+ ...field.schema,
153675
+ fields: (field.schema?.fields ?? field.fields).map(toManifestFieldInput)
153055
153676
  }
153677
+ };
153678
+ }
153679
+ function assertNever10(value) {
153680
+ throw new Error(`Unhandled field config variant: ${JSON.stringify(value)}`);
153681
+ }
153682
+ var init_canonicalValidation = __esm({
153683
+ "../block-form/src/manifest/canonicalValidation.ts"() {
153684
+ init_fieldValidation();
153685
+ init_schema3();
153686
+ init_readNumericUiConfig();
153056
153687
  }
153057
- return withTextFieldSharedRules(s2, field);
153688
+ });
153689
+
153690
+ // ../block-form/src/widgets/TextField/textFieldSchema.ts
153691
+ function buildTextFieldSchema(field) {
153692
+ return buildCanonicalFieldSchema(field);
153058
153693
  }
153059
153694
  var init_textFieldSchema = __esm({
153060
153695
  "../block-form/src/widgets/TextField/textFieldSchema.ts"() {
153696
+ init_canonicalValidation();
153061
153697
  }
153062
153698
  });
153063
153699
 
@@ -153082,33 +153718,6 @@ var init_TextField2 = __esm({
153082
153718
  init_TextField();
153083
153719
  }
153084
153720
  });
153085
-
153086
- // ../block-form/src/widgets/utils/readNumericUiConfig.ts
153087
- function readNumericInputUiConfig(ui) {
153088
- if (!ui || typeof ui !== "object") return {};
153089
- const rec = ui;
153090
- return {
153091
- min: typeof rec.min === "number" ? rec.min : void 0,
153092
- max: typeof rec.max === "number" ? rec.max : void 0,
153093
- step: typeof rec.step === "number" ? rec.step : void 0
153094
- };
153095
- }
153096
- function readNumberFieldUiConfig(ui) {
153097
- return readNumericInputUiConfig(ui);
153098
- }
153099
- function readSliderFieldUiConfig(ui) {
153100
- const base2 = readNumericInputUiConfig(ui);
153101
- if (!ui || typeof ui !== "object") return base2;
153102
- const rec = ui;
153103
- return {
153104
- ...base2,
153105
- showValue: typeof rec.showValue === "boolean" ? rec.showValue : void 0
153106
- };
153107
- }
153108
- var init_readNumericUiConfig = __esm({
153109
- "../block-form/src/widgets/utils/readNumericUiConfig.ts"() {
153110
- }
153111
- });
153112
153721
  function NumberField({ path, backend, config }) {
153113
153722
  const { value, error, setValue } = useField(path, backend);
153114
153723
  const ui = readNumberFieldUiConfig(config.ui);
@@ -153148,44 +153757,14 @@ var init_NumberField = __esm({
153148
153757
  init_readNumericUiConfig();
153149
153758
  }
153150
153759
  });
153760
+
153761
+ // ../block-form/src/widgets/NumberField/numberFieldSchema.ts
153151
153762
  function buildNumberFieldSchema(field) {
153152
- const requiredMessage = "This field is required";
153153
- const numberMessage = `${field.label} needs a number`;
153154
- let numberSchema = z.coerce.number({
153155
- error: (issue) => issue.input === void 0 ? requiredMessage : numberMessage
153156
- });
153157
- if (typeof field.ui?.min === "number") {
153158
- numberSchema = numberSchema.min(field.ui.min, {
153159
- message: `${field.label} must be ${field.ui.min} or more`
153160
- });
153161
- }
153162
- if (typeof field.ui?.max === "number") {
153163
- numberSchema = numberSchema.max(field.ui.max, {
153164
- message: `${field.label} must be ${field.ui.max} or less`
153165
- });
153166
- }
153167
- const emptyToUndefined = (value) => value === "" || value === null ? void 0 : value;
153168
- if (!field.required) {
153169
- return z.preprocess(emptyToUndefined, numberSchema.optional().nullable());
153170
- }
153171
- return z.preprocess(
153172
- emptyToUndefined,
153173
- z.unknown().superRefine((value, ctx) => {
153174
- if (value === void 0) {
153175
- ctx.addIssue({ code: "custom", message: requiredMessage });
153176
- return;
153177
- }
153178
- const parsed = numberSchema.safeParse(value);
153179
- if (!parsed.success) {
153180
- for (const issue of parsed.error.issues) {
153181
- ctx.addIssue({ code: "custom", message: issue.message });
153182
- }
153183
- }
153184
- }).transform((value) => Number(value))
153185
- );
153763
+ return buildCanonicalFieldSchema(field);
153186
153764
  }
153187
153765
  var init_numberFieldSchema = __esm({
153188
153766
  "../block-form/src/widgets/NumberField/numberFieldSchema.ts"() {
153767
+ init_canonicalValidation();
153189
153768
  }
153190
153769
  });
153191
153770
 
@@ -153322,29 +153901,14 @@ var init_SelectField = __esm({
153322
153901
  init_selectValueMapping();
153323
153902
  }
153324
153903
  });
153904
+
153905
+ // ../block-form/src/widgets/SelectField/selectFieldSchema.ts
153325
153906
  function buildSelectFieldSchema(field) {
153326
- const validValues = field.options?.map((opt) => opt.value) ?? [];
153327
- const requiredMessage = "This field is required";
153328
- const invalidOptionMessage = `Choose one of the available options for ${field.label}`;
153329
- if (validValues.length === 0) {
153330
- if (field.multiple) {
153331
- const arr = z.array(z.string());
153332
- return field.required ? arr.min(1, { message: requiredMessage }) : arr.nullable();
153333
- }
153334
- const single = z.string();
153335
- return field.required ? single.min(1, { message: requiredMessage }) : single.nullable();
153336
- }
153337
- const base2 = z.enum(validValues, {
153338
- error: invalidOptionMessage
153339
- });
153340
- if (field.multiple) {
153341
- const arr = z.array(base2);
153342
- return field.required ? arr.min(1, { message: requiredMessage }) : arr.nullable();
153343
- }
153344
- return field.required ? base2 : base2.nullable();
153907
+ return buildCanonicalFieldSchema(field);
153345
153908
  }
153346
153909
  var init_selectFieldSchema = __esm({
153347
153910
  "../block-form/src/widgets/SelectField/selectFieldSchema.ts"() {
153911
+ init_canonicalValidation();
153348
153912
  }
153349
153913
  });
153350
153914
 
@@ -154446,7 +155010,7 @@ function createStoreBackend(options) {
154446
155010
  return issues;
154447
155011
  }
154448
155012
  return issues.filter(
154449
- (issue) => blockValidation.isPathEdited(currentBlockId, issue.path.join("."))
155013
+ (issue2) => blockValidation.isPathEdited(currentBlockId, issue2.path.join("."))
154450
155014
  );
154451
155015
  };
154452
155016
  return {
@@ -154488,7 +155052,7 @@ function createStoreBackend(options) {
154488
155052
  let fieldError;
154489
155053
  if (validateFn) {
154490
155054
  const issues = getVisibleValidationIssues();
154491
- const fieldIssue = issues.find((issue) => issue.path.join(".") === path);
155055
+ const fieldIssue = issues.find((issue2) => issue2.path.join(".") === path);
154492
155056
  if (fieldIssue) {
154493
155057
  fieldError = { message: fieldIssue.message };
154494
155058
  }
@@ -154513,9 +155077,9 @@ function createStoreBackend(options) {
154513
155077
  getErrors: () => {
154514
155078
  const issues = getVisibleValidationIssues();
154515
155079
  const errors = {};
154516
- issues.forEach((issue) => {
154517
- const path = issue.path.join(".");
154518
- errors[path] = { message: issue.message };
155080
+ issues.forEach((issue2) => {
155081
+ const path = issue2.path.join(".");
155082
+ errors[path] = { message: issue2.message };
154519
155083
  });
154520
155084
  return errors;
154521
155085
  },
@@ -154599,9 +155163,9 @@ function createStoreBackend(options) {
154599
155163
  const issues = getValidationIssues();
154600
155164
  const visibleIssues = getVisibleValidationIssues();
154601
155165
  const errors = {};
154602
- visibleIssues.forEach((issue) => {
154603
- const path = issue.path.join(".");
154604
- errors[path] = { message: issue.message };
155166
+ visibleIssues.forEach((issue2) => {
155167
+ const path = issue2.path.join(".");
155168
+ errors[path] = { message: issue2.message };
154605
155169
  });
154606
155170
  return {
154607
155171
  isDirty: isSnapshotDirty(snapshot2),
@@ -154641,12 +155205,6 @@ var init_types22 = __esm({
154641
155205
  }
154642
155206
  });
154643
155207
 
154644
- // ../block-form/src/backend/validation.ts
154645
- var init_validation3 = __esm({
154646
- "../block-form/src/backend/validation.ts"() {
154647
- }
154648
- });
154649
-
154650
155208
  // ../block-form/src/backend/adapter.ts
154651
155209
  var init_adapter = __esm({
154652
155210
  "../block-form/src/backend/adapter.ts"() {
@@ -154731,7 +155289,6 @@ var init_backend = __esm({
154731
155289
  "../block-form/src/backend/index.ts"() {
154732
155290
  init_types22();
154733
155291
  init_hooks();
154734
- init_validation3();
154735
155292
  init_adapter();
154736
155293
  init_useRepeaterBackend();
154737
155294
  }
@@ -156108,7 +156665,7 @@ function ze() {
156108
156665
  /* @__PURE__ */ Te(P)
156109
156666
  );
156110
156667
  }
156111
- function z70(e3) {
156668
+ function z69(e3) {
156112
156669
  if (L2) {
156113
156670
  if (/* @__PURE__ */ Te(P) !== null)
156114
156671
  throw Tt(), Je;
@@ -158137,12 +158694,12 @@ function ha(e3, t3) {
158137
158694
  var mt = we(Dr, 2);
158138
158695
  let Pr;
158139
158696
  var We = X3(mt);
158140
- en(We), We.__change = ui, z70(mt);
158697
+ en(We), We.__change = ui, z69(mt);
158141
158698
  var Ut = we(mt, 2), wi = X3(Ut);
158142
158699
  {
158143
158700
  var pi = (n3) => {
158144
158701
  var u3 = na(), _2 = Gr(u3), y2 = X3(_2);
158145
- Ge(y2, () => c3(re2).verified), z70(_2);
158702
+ Ge(y2, () => c3(re2).verified), z69(_2);
158146
158703
  var T2 = we(_2, 2);
158147
158704
  en(T2), Pe(() => {
158148
158705
  se(T2, "name", V2()), jo(T2, c3(Le));
@@ -158151,10 +158708,10 @@ function ha(e3, t3) {
158151
158708
  {
158152
158709
  var _2 = (T2) => {
158153
158710
  var E = ia(), p2 = X3(E);
158154
- Ge(p2, () => c3(re2).verifying), z70(E), ne(T2, E);
158711
+ Ge(p2, () => c3(re2).verifying), z69(E), ne(T2, E);
158155
158712
  }, y2 = (T2) => {
158156
158713
  var E = oa(), p2 = X3(E);
158157
- Ge(p2, () => c3(re2).label), z70(E), Pe(() => se(E, "for", c3(cr))), ne(T2, E);
158714
+ Ge(p2, () => c3(re2).label), z69(E), Pe(() => se(E, "for", c3(cr))), ne(T2, E);
158158
158715
  };
158159
158716
  $e(
158160
158717
  n3,
@@ -158169,18 +158726,18 @@ function ha(e3, t3) {
158169
158726
  c3(C2) === b2.VERIFIED ? n3(pi) : n3(bi, false);
158170
158727
  });
158171
158728
  }
158172
- z70(Ut);
158729
+ z69(Ut);
158173
158730
  var yi = we(Ut, 2);
158174
158731
  {
158175
158732
  var Ei = (n3) => {
158176
158733
  var u3 = aa(), _2 = X3(u3);
158177
- se(_2, "href", sr), z70(u3), Pe(() => se(_2, "aria-label", c3(re2).ariaLinkLabel)), ne(n3, u3);
158734
+ se(_2, "href", sr), z69(u3), Pe(() => se(_2, "aria-label", c3(re2).ariaLinkLabel)), ne(n3, u3);
158178
158735
  };
158179
158736
  $e(yi, (n3) => {
158180
158737
  (N() !== true || c3(Dt)) && n3(Ei);
158181
158738
  });
158182
158739
  }
158183
- z70(Mt);
158740
+ z69(Mt);
158184
158741
  var Or = we(Mt, 2);
158185
158742
  {
158186
158743
  var xi = (n3) => {
@@ -158188,16 +158745,16 @@ function ha(e3, t3) {
158188
158745
  {
158189
158746
  var y2 = (E) => {
158190
158747
  var p2 = la(), x2 = X3(p2);
158191
- Ge(x2, () => c3(re2).expired), z70(p2), Pe(() => se(p2, "title", c3(He))), ne(E, p2);
158748
+ Ge(x2, () => c3(re2).expired), z69(p2), Pe(() => se(p2, "title", c3(He))), ne(E, p2);
158192
158749
  }, T2 = (E) => {
158193
158750
  var p2 = sa(), x2 = X3(p2);
158194
- Ge(x2, () => c3(re2).error), z70(p2), Pe(() => se(p2, "title", c3(He))), ne(E, p2);
158751
+ Ge(x2, () => c3(re2).error), z69(p2), Pe(() => se(p2, "title", c3(He))), ne(E, p2);
158195
158752
  };
158196
158753
  $e(_2, (E) => {
158197
158754
  c3(C2) === b2.EXPIRED ? E(y2) : E(T2, false);
158198
158755
  });
158199
158756
  }
158200
- z70(u3), ne(n3, u3);
158757
+ z69(u3), ne(n3, u3);
158201
158758
  };
158202
158759
  $e(Or, (n3) => {
158203
158760
  (c3(He) || c3(C2) === b2.EXPIRED) && n3(xi);
@@ -158207,7 +158764,7 @@ function ha(e3, t3) {
158207
158764
  {
158208
158765
  var $i = (n3) => {
158209
158766
  var u3 = ua(), _2 = X3(u3), y2 = X3(_2);
158210
- Ge(y2, () => c3(re2).footer), z70(_2), z70(u3), ne(n3, u3);
158767
+ Ge(y2, () => c3(re2).footer), z69(_2), z69(u3), ne(n3, u3);
158211
158768
  };
158212
158769
  $e(Fr, (n3) => {
158213
158770
  c3(re2).footer && (k() !== true || c3(Dt)) && n3($i);
@@ -158223,7 +158780,7 @@ function ha(e3, t3) {
158223
158780
  v2() && n3(Ci);
158224
158781
  });
158225
158782
  }
158226
- return z70(ot), nn(ot, (n3) => D2(B, n3), () => c3(B)), Pe(
158783
+ return z69(ot), nn(ot, (n3) => D2(B, n3), () => c3(B)), Pe(
158227
158784
  (n3) => {
158228
158785
  se(ot, "data-state", c3(C2)), se(ot, "data-floating", v2()), Pr = Fo(mt, 1, "altcha-checkbox", null, Pr, n3), se(We, "id", c3(cr)), We.required = r4() !== "onsubmit" && (!v2() || r4() !== "off");
158229
158786
  },
@@ -158970,7 +159527,7 @@ function multiStepReducer(state, action) {
158970
159527
  case "reset":
158971
159528
  return createInitialMultiStepState(action.initialData);
158972
159529
  default:
158973
- return assertNever7(action);
159530
+ return assertNever8(action);
158974
159531
  }
158975
159532
  }
158976
159533
  function getVisibleSteps(steps2, data) {
@@ -159829,7 +160386,7 @@ var init_DatePicker = __esm({
159829
160386
  dateOptions,
159830
160387
  required = true,
159831
160388
  isLoading = false,
159832
- isEmpty: isEmpty2 = false,
160389
+ isEmpty = false,
159833
160390
  hasMore = false,
159834
160391
  onLoadMore
159835
160392
  }) => {
@@ -159843,7 +160400,7 @@ var init_DatePicker = __esm({
159843
160400
  /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--muted ab-text--sm", children: "Loading available dates..." })
159844
160401
  ] });
159845
160402
  }
159846
- if (isEmpty2) {
160403
+ if (isEmpty) {
159847
160404
  return /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
159848
160405
  /* @__PURE__ */ jsxs("label", { className: "ab-label", children: [
159849
160406
  "Select Date",
@@ -160394,7 +160951,7 @@ function buildBookingPaymentOptionViewModel(input) {
160394
160951
  };
160395
160952
  }
160396
160953
  default:
160397
- return assertNever7(input.option);
160954
+ return assertNever8(input.option);
160398
160955
  }
160399
160956
  }
160400
160957
  function buildInstalmentSchedulePreview(input) {
@@ -160451,7 +161008,7 @@ function buildInstalmentSchedulePreview(input) {
160451
161008
  })));
160452
161009
  }
160453
161010
  default:
160454
- return assertNever7(input.option.plan);
161011
+ return assertNever8(input.option.plan);
160455
161012
  }
160456
161013
  }
160457
161014
  function getPaymentCadenceLabel(plan) {
@@ -161204,7 +161761,7 @@ function pollingReducer(state, action) {
161204
161761
  case "timeout":
161205
161762
  return state;
161206
161763
  default:
161207
- return assertNever7(state);
161764
+ return assertNever8(state);
161208
161765
  }
161209
161766
  case "polling-timed-out":
161210
161767
  return {
@@ -161213,7 +161770,7 @@ function pollingReducer(state, action) {
161213
161770
  error: new Error("Polling timed out")
161214
161771
  };
161215
161772
  default:
161216
- return assertNever7(action);
161773
+ return assertNever8(action);
161217
161774
  }
161218
161775
  }
161219
161776
  var init_usePolling_state = __esm({
@@ -161394,7 +161951,7 @@ function bookingSubmissionReducer(state, action) {
161394
161951
  feedback: { tag: "idle" }
161395
161952
  };
161396
161953
  default:
161397
- return assertNever7(action);
161954
+ return assertNever8(action);
161398
161955
  }
161399
161956
  }
161400
161957
  function selectIsSubmitting2(state) {
@@ -161726,7 +162283,7 @@ function validateFormData(data) {
161726
162283
  return errors;
161727
162284
  }
161728
162285
  var EMAIL_REGEX;
161729
- var init_validation4 = __esm({
162286
+ var init_validation3 = __esm({
161730
162287
  "../blocks/src/system/runtime/shared/utils/validation.ts"() {
161731
162288
  EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
161732
162289
  }
@@ -161750,7 +162307,7 @@ var init_utils11 = __esm({
161750
162307
  init_scrollToBlock();
161751
162308
  init_themePortalRoot();
161752
162309
  init_urlParams();
161753
- init_validation4();
162310
+ init_validation3();
161754
162311
  init_wizardSteps();
161755
162312
  }
161756
162313
  });
@@ -162795,7 +163352,7 @@ function eligibilityLookupReducer(state, action) {
162795
163352
  error: action.message
162796
163353
  };
162797
163354
  default:
162798
- return assertNever7(action);
163355
+ return assertNever8(action);
162799
163356
  }
162800
163357
  }
162801
163358
  function existingRegistrationLookupReducer(state, action) {
@@ -162813,7 +163370,7 @@ function existingRegistrationLookupReducer(state, action) {
162813
163370
  registration: action.registration
162814
163371
  };
162815
163372
  default:
162816
- return assertNever7(action);
163373
+ return assertNever8(action);
162817
163374
  }
162818
163375
  }
162819
163376
  var initialEligibilityLookupState, initialExistingRegistrationLookupState;
@@ -164462,7 +165019,7 @@ function validateFormData2(formData) {
164462
165019
  }
164463
165020
  return errors;
164464
165021
  }
164465
- var init_validation5 = __esm({
165022
+ var init_validation4 = __esm({
164466
165023
  "../blocks/src/system/runtime/nodes/event-registration/validation.ts"() {
164467
165024
  "use client";
164468
165025
  }
@@ -165402,7 +165959,7 @@ var init_useEventRegistrationWizard = __esm({
165402
165959
  "use client";
165403
165960
  init_api();
165404
165961
  init_events2();
165405
- init_validation5();
165962
+ init_validation4();
165406
165963
  init_hooks3();
165407
165964
  init_portalLogout();
165408
165965
  init_useWaitlistClaim();
@@ -166186,6 +166743,14 @@ var init_CourseRegistrationErrorBoundary = __esm({
166186
166743
  };
166187
166744
  }
166188
166745
  });
166746
+ function TeamMemberInlineList({
166747
+ teamMembers
166748
+ }) {
166749
+ return /* @__PURE__ */ jsx(Fragment, { children: teamMembers.map((teamMember, index2) => /* @__PURE__ */ jsxs(React56__default.Fragment, { children: [
166750
+ index2 > 0 ? ", " : "",
166751
+ teamMember.profilePath ? /* @__PURE__ */ jsx("a", { href: teamMember.profilePath, children: teamMember.name }) : teamMember.name
166752
+ ] }, teamMember.id)) });
166753
+ }
166189
166754
  function CourseCard({
166190
166755
  course,
166191
166756
  isSelected,
@@ -166266,7 +166831,7 @@ function CourseSummary({
166266
166831
  teamMembers.length > 0 && /* @__PURE__ */ jsxs("div", { className: "cr-summary__venue", children: [
166267
166832
  /* @__PURE__ */ jsx("strong", { children: "Team:" }),
166268
166833
  " ",
166269
- teamMembers.map((teamMember) => teamMember.name).join(", ")
166834
+ /* @__PURE__ */ jsx(TeamMemberInlineList, { teamMembers })
166270
166835
  ] }),
166271
166836
  showPrice && pricing.display.kind !== "unavailable" && /* @__PURE__ */ jsxs("p", { className: "cr-summary__price", children: [
166272
166837
  /* @__PURE__ */ jsx("strong", { children: pricing.selectableOptions.length > 0 ? "Pricing:" : "Price:" }),
@@ -168034,7 +168599,7 @@ function shopPassesMembershipsReducer(state, action) {
168034
168599
  returnNotice: null
168035
168600
  };
168036
168601
  default:
168037
- return assertNever7(action);
168602
+ return assertNever8(action);
168038
168603
  }
168039
168604
  }
168040
168605
  function getOpenCheckout(state) {
@@ -168880,7 +169445,7 @@ function shopCheckoutReducer(state, action) {
168880
169445
  notice: action.notice
168881
169446
  };
168882
169447
  default:
168883
- return assertNever7(action);
169448
+ return assertNever8(action);
168884
169449
  }
168885
169450
  }
168886
169451
  var initialShopCheckoutState;
@@ -169298,7 +169863,7 @@ function giftingClientReducer(state, action) {
169298
169863
  purchaseNotice: action.notice
169299
169864
  };
169300
169865
  default:
169301
- return assertNever7(action);
169866
+ return assertNever8(action);
169302
169867
  }
169303
169868
  }
169304
169869
  function resolveGiftingPurchaseNotice(search, defaultSuccessMessage) {
@@ -173003,7 +173568,7 @@ function formSubmissionReducer(_state, action) {
173003
173568
  case "submission-failed":
173004
173569
  return { tag: "failed", message: action.message };
173005
173570
  default:
173006
- return assertNever7(action);
173571
+ return assertNever8(action);
173007
173572
  }
173008
173573
  }
173009
173574
  var initialFormSubmissionState;
@@ -173737,32 +174302,14 @@ var init_repeaterFieldDefaults = __esm({
173737
174302
  "../block-form/src/widgets/RepeaterField/repeaterFieldDefaults.ts"() {
173738
174303
  }
173739
174304
  });
174305
+
174306
+ // ../block-form/src/widgets/UrlField/urlFieldSchema.ts
173740
174307
  function buildUrlFieldSchema(field) {
173741
- const message2 = "Enter a valid web address";
173742
- const validator = (value) => {
173743
- if (!value) {
173744
- return !field.required;
173745
- }
173746
- if (field.allowRelative && value.startsWith("/")) {
173747
- return true;
173748
- }
173749
- try {
173750
- const parsed = new URL(value);
173751
- return ALLOWED_PROTOCOLS.includes(parsed.protocol);
173752
- } catch {
173753
- return false;
173754
- }
173755
- };
173756
- const base2 = z.string().trim().refine(validator, message2);
173757
- if (field.required) {
173758
- return base2.min(1, { message: "This field is required" });
173759
- }
173760
- return z.union([base2, z.literal("")]).optional().nullable();
174308
+ return buildCanonicalFieldSchema(field);
173761
174309
  }
173762
- var ALLOWED_PROTOCOLS;
173763
174310
  var init_urlFieldSchema = __esm({
173764
174311
  "../block-form/src/widgets/UrlField/urlFieldSchema.ts"() {
173765
- ALLOWED_PROTOCOLS = ["http:", "https:"];
174312
+ init_canonicalValidation();
173766
174313
  }
173767
174314
  });
173768
174315
 
@@ -173841,18 +174388,14 @@ var init_dateTimeFieldDefaults = __esm({
173841
174388
  "../block-form/src/widgets/DateTimeField/dateTimeFieldDefaults.ts"() {
173842
174389
  }
173843
174390
  });
174391
+
174392
+ // ../block-form/src/widgets/SlugField/slugFieldSchema.ts
173844
174393
  function buildSlugFieldSchema(field) {
173845
- const base2 = z.string().regex(SLUG_PATTERN2, `${field.label} must use lowercase letters, numbers, and dashes`);
173846
- const withLength = field.maxLength ? base2.max(field.maxLength, { message: `${field.label} must be at most ${field.maxLength} characters` }) : base2;
173847
- if (field.required) {
173848
- return withLength.min(1, { message: `${field.label} is required` });
173849
- }
173850
- return z.union([withLength, z.literal("")]).optional().nullable();
174394
+ return buildCanonicalFieldSchema(field);
173851
174395
  }
173852
- var SLUG_PATTERN2;
173853
174396
  var init_slugFieldSchema = __esm({
173854
174397
  "../block-form/src/widgets/SlugField/slugFieldSchema.ts"() {
173855
- SLUG_PATTERN2 = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(?:[a-z0-9]+(?:-[a-z0-9]+)*))*$/;
174398
+ init_canonicalValidation();
173856
174399
  }
173857
174400
  });
173858
174401
 
@@ -173864,51 +174407,14 @@ var init_slugFieldDefaults = __esm({
173864
174407
  "../block-form/src/widgets/SlugField/slugFieldDefaults.ts"() {
173865
174408
  }
173866
174409
  });
174410
+
174411
+ // ../block-form/src/widgets/LinkField/linkFieldSchema.ts
173867
174412
  function buildLinkFieldSchema(field) {
173868
- if (field.required) {
173869
- return linkSchema2;
173870
- }
173871
- return z.union([linkSchema2, z.null()]).optional();
174413
+ return buildCanonicalFieldSchema(field);
173872
174414
  }
173873
- var internalLinkSchema2, externalLinkSchema2, customLinkSchema2, pageLinkSchema2, entryLinkSchema2, linkSchema2;
173874
174415
  var init_linkFieldSchema = __esm({
173875
174416
  "../block-form/src/widgets/LinkField/linkFieldSchema.ts"() {
173876
- internalLinkSchema2 = z.object({
173877
- kind: z.literal("internal"),
173878
- routeId: z.string().min(1),
173879
- entityId: z.string().min(1),
173880
- entityType: z.enum(["page", "content"]),
173881
- href: z.string().min(1),
173882
- title: z.string().min(1),
173883
- typeLabel: z.string().min(1),
173884
- contentTypeKey: z.string().nullable().optional(),
173885
- contentTypeName: z.string().nullable().optional(),
173886
- updatedAt: z.string().nullable().optional()
173887
- }).passthrough();
173888
- externalLinkSchema2 = z.object({
173889
- kind: z.literal("external"),
173890
- href: z.string().min(1)
173891
- }).passthrough();
173892
- customLinkSchema2 = z.object({
173893
- kind: z.literal("url"),
173894
- href: z.string().min(1)
173895
- }).passthrough();
173896
- pageLinkSchema2 = z.object({
173897
- kind: z.literal("page"),
173898
- identifier: z.string().min(1)
173899
- }).passthrough();
173900
- entryLinkSchema2 = z.object({
173901
- kind: z.literal("entry"),
173902
- contentType: z.string().min(1),
173903
- identifier: z.string().min(1)
173904
- }).passthrough();
173905
- linkSchema2 = z.union([
173906
- internalLinkSchema2,
173907
- externalLinkSchema2,
173908
- customLinkSchema2,
173909
- pageLinkSchema2,
173910
- entryLinkSchema2
173911
- ]);
174417
+ init_canonicalValidation();
173912
174418
  }
173913
174419
  });
173914
174420
 
@@ -173926,6 +174432,55 @@ var init_linkFieldDefaults = __esm({
173926
174432
  "../block-form/src/widgets/LinkField/linkFieldDefaults.ts"() {
173927
174433
  }
173928
174434
  });
174435
+ function buildRichTextSchema(options) {
174436
+ let schema = RichTextValueSchema;
174437
+ if (options?.required) {
174438
+ const label = options.label ?? "This field";
174439
+ schema = schema.refine(
174440
+ (val) => {
174441
+ const doc3 = isRecord5(val) && "doc" in val ? val.doc : val;
174442
+ const content = isRecord5(doc3) ? doc3.content : void 0;
174443
+ if (!Array.isArray(content) || content.length === 0) return false;
174444
+ const first2 = content[0];
174445
+ if (content.length === 1 && isRecord5(first2) && first2.type === "paragraph" && (!("content" in first2) || first2.content == null)) {
174446
+ return false;
174447
+ }
174448
+ return true;
174449
+ },
174450
+ {
174451
+ message: `${label} is required`
174452
+ }
174453
+ );
174454
+ }
174455
+ return schema;
174456
+ }
174457
+ var TipTapMarkSchema, TipTapNodeSchema, RichTextValueSchema;
174458
+ var init_richTextSchema = __esm({
174459
+ "../blocks/src/system/manifest/richTextSchema.ts"() {
174460
+ init_typeGuards2();
174461
+ TipTapMarkSchema = z.object({
174462
+ type: z.string(),
174463
+ attrs: z.record(z.string(), z.unknown()).optional()
174464
+ });
174465
+ TipTapNodeSchema = z.lazy(
174466
+ () => z.object({
174467
+ type: z.string(),
174468
+ content: z.array(TipTapNodeSchema).optional(),
174469
+ text: z.string().optional(),
174470
+ attrs: z.record(z.string(), z.unknown()).optional(),
174471
+ marks: z.array(TipTapMarkSchema).optional()
174472
+ })
174473
+ );
174474
+ RichTextValueSchema = z.union([
174475
+ // New format: TipTap document directly
174476
+ TipTapNodeSchema,
174477
+ // Legacy format: wrapped in { doc: {...} }
174478
+ z.object({
174479
+ doc: TipTapNodeSchema
174480
+ })
174481
+ ]);
174482
+ }
174483
+ });
173929
174484
  function buildRichTextFieldSchema(config) {
173930
174485
  const schema = buildRichTextSchema({
173931
174486
  required: config.required,
@@ -173956,30 +174511,14 @@ var init_richTextFieldDefaults = __esm({
173956
174511
  };
173957
174512
  }
173958
174513
  });
174514
+
174515
+ // ../block-form/src/widgets/MediaField/mediaFieldSchema.ts
173959
174516
  function buildMediaFieldSchema(config) {
173960
- let schema = MediaValueSchema.nullable();
173961
- if (config.required) {
173962
- schema = schema.refine((val) => val !== null, {
173963
- message: `${config.label} is required`
173964
- });
173965
- }
173966
- return schema;
174517
+ return buildCanonicalFieldSchema(config);
173967
174518
  }
173968
- var MediaValueSchema;
173969
174519
  var init_mediaFieldSchema = __esm({
173970
174520
  "../block-form/src/widgets/MediaField/mediaFieldSchema.ts"() {
173971
- MediaValueSchema = z.object({
173972
- kind: z.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
173973
- url: z.string().url(),
173974
- title: z.string().optional(),
173975
- alt: z.string().optional(),
173976
- caption: z.string().optional(),
173977
- credit: z.string().optional(),
173978
- width: z.number().optional(),
173979
- height: z.number().optional(),
173980
- size: z.number().optional(),
173981
- mimeType: z.string().optional()
173982
- });
174521
+ init_canonicalValidation();
173983
174522
  }
173984
174523
  });
173985
174524
 
@@ -173991,15 +174530,14 @@ var init_mediaFieldDefaults = __esm({
173991
174530
  "../block-form/src/widgets/MediaField/mediaFieldDefaults.ts"() {
173992
174531
  }
173993
174532
  });
174533
+
174534
+ // ../block-form/src/widgets/ReferenceField/referenceFieldSchema.ts
173994
174535
  function buildReferenceFieldSchema(field, _ctx) {
173995
- const schema = z.string();
173996
- if (field.required) {
173997
- return schema.refine((value) => value.trim().length > 0, "This field is required");
173998
- }
173999
- return schema.optional().nullable().or(z.literal(""));
174536
+ return buildCanonicalFieldSchema(field);
174000
174537
  }
174001
174538
  var init_referenceFieldSchema = __esm({
174002
174539
  "../block-form/src/widgets/ReferenceField/referenceFieldSchema.ts"() {
174540
+ init_canonicalValidation();
174003
174541
  }
174004
174542
  });
174005
174543
 
@@ -192758,7 +193296,7 @@ var init_PreviewRichTextEditor = __esm({
192758
193296
  const isEditingRef = useRef(false);
192759
193297
  const initialDoc = normaliseDoc(value ?? doc3);
192760
193298
  const chosenVariant = variant ?? "full";
192761
- const { editor, isEmpty: isEmpty2, config } = useRichTextEditor({
193299
+ const { editor, isEmpty, config } = useRichTextEditor({
192762
193300
  content: initialDoc,
192763
193301
  editable: true,
192764
193302
  variant: chosenVariant
@@ -192835,7 +193373,7 @@ var init_PreviewRichTextEditor = __esm({
192835
193373
  {
192836
193374
  editor,
192837
193375
  config,
192838
- isEmpty: isEmpty2,
193376
+ isEmpty,
192839
193377
  className: `relative w-full min-h-[30px] rounded border border-dashed ${showAffordance ? "border-slate-400/75 bg-white/5" : "border-transparent bg-transparent"}`,
192840
193378
  contentClassName: "cursor-text",
192841
193379
  placeholderClassName: "text-gray-400",
@@ -193690,7 +194228,9 @@ function isSameLinkValue(a2, b3) {
193690
194228
  if (!a2 || !b3 || a2.kind !== b3.kind) return false;
193691
194229
  switch (a2.kind) {
193692
194230
  case "internal":
193693
- return b3.kind === "internal" && a2.routeId === b3.routeId && a2.entityId === b3.entityId && a2.entityType === b3.entityType && a2.href === b3.href && a2.title === b3.title && a2.typeLabel === b3.typeLabel && a2.contentTypeKey === b3.contentTypeKey && a2.contentTypeName === b3.contentTypeName && a2.updatedAt === b3.updatedAt;
194231
+ if (b3.kind !== "internal" || a2.routeId !== b3.routeId) return false;
194232
+ if (!isInternalResolvedLinkValue(a2) || !isInternalResolvedLinkValue(b3)) return true;
194233
+ return a2.entityId === b3.entityId && a2.entityType === b3.entityType && a2.href === b3.href && a2.title === b3.title && a2.typeLabel === b3.typeLabel && a2.contentTypeKey === b3.contentTypeKey && a2.contentTypeName === b3.contentTypeName && a2.updatedAt === b3.updatedAt;
193694
194234
  case "page":
193695
194235
  return b3.kind === "page" && a2.identifier === b3.identifier;
193696
194236
  case "entry":
@@ -193709,6 +194249,7 @@ function getDisplayTitle2(item) {
193709
194249
  var init_utils22 = __esm({
193710
194250
  "../editor-blocks/src/widgets/link/utils.ts"() {
193711
194251
  init_navigation2();
194252
+ init_src6();
193712
194253
  }
193713
194254
  });
193714
194255
  function getActiveTab(value) {
@@ -194017,6 +194558,12 @@ function LinkTriggerContent({ value }) {
194017
194558
  return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Select a link..." });
194018
194559
  }
194019
194560
  if (value.kind === "internal") {
194561
+ if (!isInternalResolvedLinkValue(value)) {
194562
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
194563
+ /* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: value.routeId, children: "Internal route" }),
194564
+ /* @__PURE__ */ jsx(Badge2, { variant: "secondary", className: "shrink-0", children: "Internal" })
194565
+ ] });
194566
+ }
194020
194567
  return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
194021
194568
  /* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: value.title || void 0, children: value.title || "Untitled" }),
194022
194569
  /* @__PURE__ */ jsx(Badge2, { variant: "secondary", className: "shrink-0", children: value.typeLabel })
@@ -194113,6 +194660,7 @@ function LinkWidget({
194113
194660
  var init_LinkWidget = __esm({
194114
194661
  "../editor-blocks/src/widgets/link/LinkWidget.tsx"() {
194115
194662
  "use client";
194663
+ init_src6();
194116
194664
  init_src();
194117
194665
  init_lucide_react();
194118
194666
  init_client4();
@@ -194541,8 +195089,8 @@ function unwrapValue(value) {
194541
195089
  if (typeof value === "string") {
194542
195090
  return value;
194543
195091
  }
194544
- if (isObjectRecord(value)) {
194545
- if (isObjectRecord(value.doc)) {
195092
+ if (isObjectRecord2(value)) {
195093
+ if (isObjectRecord2(value.doc)) {
194546
195094
  return value.doc;
194547
195095
  }
194548
195096
  if (typeof value.type === "string") {
@@ -197404,9 +197952,9 @@ function blockSaveabilityEqual(left, right) {
197404
197952
  if (left.issues.length !== right.issues.length) {
197405
197953
  return false;
197406
197954
  }
197407
- return left.issues.every((issue, index2) => {
197955
+ return left.issues.every((issue2, index2) => {
197408
197956
  const nextIssue = right.issues[index2];
197409
- return nextIssue?.fieldPath === issue.fieldPath && nextIssue.message === issue.message;
197957
+ return nextIssue?.fieldPath === issue2.fieldPath && nextIssue.message === issue2.message;
197410
197958
  });
197411
197959
  }
197412
197960
  var init_BlockForm = __esm({
@@ -200522,38 +201070,38 @@ var internalLinkPayloadSchema = z.object({
200522
201070
  contentTypeName: z.string().nullable().optional(),
200523
201071
  updatedAt: z.string().nullable().optional()
200524
201072
  }).passthrough();
200525
- var externalLinkSchema3 = z.object({
201073
+ var externalLinkSchema2 = z.object({
200526
201074
  kind: z.literal("external"),
200527
201075
  // Navigation external links are expected to be absolute URLs.
200528
201076
  href: z.string().url()
200529
201077
  });
200530
- var customLinkSchema3 = z.object({
201078
+ var customLinkSchema2 = z.object({
200531
201079
  kind: z.literal("url"),
200532
201080
  href: z.string().min(1)
200533
201081
  });
200534
- var pageLinkSchema3 = z.object({
201082
+ var pageLinkSchema2 = z.object({
200535
201083
  kind: z.literal("page"),
200536
201084
  identifier: z.string().min(1)
200537
201085
  });
200538
- var entryLinkSchema3 = z.object({
201086
+ var entryLinkSchema2 = z.object({
200539
201087
  kind: z.literal("entry"),
200540
201088
  contentType: z.string().min(1),
200541
201089
  identifier: z.string().min(1)
200542
201090
  });
200543
201091
  var linkPayloadSchema = z.discriminatedUnion("kind", [
200544
201092
  internalLinkPayloadSchema,
200545
- pageLinkSchema3,
200546
- entryLinkSchema3,
200547
- externalLinkSchema3,
200548
- customLinkSchema3,
201093
+ pageLinkSchema2,
201094
+ entryLinkSchema2,
201095
+ externalLinkSchema2,
201096
+ customLinkSchema2,
200549
201097
  portalLinkPayloadSchema,
200550
201098
  cartLinkPayloadSchema
200551
201099
  ]);
200552
201100
  var navigationLinkInputSchemaOptions = [
200553
- pageLinkSchema3,
200554
- entryLinkSchema3,
200555
- externalLinkSchema3,
200556
- customLinkSchema3,
201101
+ pageLinkSchema2,
201102
+ entryLinkSchema2,
201103
+ externalLinkSchema2,
201104
+ customLinkSchema2,
200557
201105
  portalLinkPayloadSchema,
200558
201106
  cartLinkPayloadSchema
200559
201107
  ];
@@ -201317,11 +201865,11 @@ siteBannerSettingsSchema.superRefine((value, ctx) => {
201317
201865
  return;
201318
201866
  }
201319
201867
  const analysis = analyzeSiteBannerBody(value.body);
201320
- for (const issue of analysis.issues) {
201868
+ for (const issue2 of analysis.issues) {
201321
201869
  ctx.addIssue({
201322
201870
  code: z.ZodIssueCode.custom,
201323
201871
  path: ["body"],
201324
- message: siteBannerBodyIssueMessage(issue)
201872
+ message: siteBannerBodyIssueMessage(issue2)
201325
201873
  });
201326
201874
  }
201327
201875
  });
@@ -201355,8 +201903,8 @@ function analyzeSiteBannerBody(body) {
201355
201903
  issues
201356
201904
  };
201357
201905
  }
201358
- function siteBannerBodyIssueMessage(issue) {
201359
- switch (issue) {
201906
+ function siteBannerBodyIssueMessage(issue2) {
201907
+ switch (issue2) {
201360
201908
  case "empty":
201361
201909
  return "Banner message is required when the banner is enabled.";
201362
201910
  case "too-many-paragraphs":
@@ -201761,7 +202309,7 @@ function previewCustomizeHistoryEntryFromAction(editorModel, action) {
201761
202309
  };
201762
202310
  }
201763
202311
  default:
201764
- return assertNever5(action, "Unhandled preview customize action");
202312
+ return assertNever6(action, "Unhandled preview customize action");
201765
202313
  }
201766
202314
  }
201767
202315
  function previewCustomizeUndoActionForEntry(entry) {
@@ -201802,7 +202350,7 @@ function previewCustomizeActionForEntryValue(entry, valueKey) {
201802
202350
  };
201803
202351
  }
201804
202352
  default:
201805
- return assertNever5(entry, "Unhandled preview customize history entry");
202353
+ return assertNever6(entry, "Unhandled preview customize history entry");
201806
202354
  }
201807
202355
  }
201808
202356
  function supportedPinnedChoiceValue(choice) {
@@ -201824,7 +202372,7 @@ function previewCustomizeHistoryEntryStillApplies(entry, editorModel) {
201824
202372
  (boundary) => boundary.boundaryId === entry.boundaryId && boundary.previousBlockId === entry.previousBlockId && boundary.nextBlockId === entry.nextBlockId
201825
202373
  );
201826
202374
  default:
201827
- return assertNever5(entry, "Unhandled preview customize history entry");
202375
+ return assertNever6(entry, "Unhandled preview customize history entry");
201828
202376
  }
201829
202377
  }
201830
202378
  function previewCustomizeHistoryEntryEquals(left, right) {
@@ -201838,7 +202386,7 @@ function previewCustomizeHistoryEntryEquals(left, right) {
201838
202386
  case "boundary":
201839
202387
  return right.kind === "boundary" && left.boundaryId === right.boundaryId && left.previousBlockId === right.previousBlockId && left.nextBlockId === right.nextBlockId && left.fromBoundaryOptionId === right.fromBoundaryOptionId && left.toBoundaryOptionId === right.toBoundaryOptionId;
201840
202388
  default:
201841
- return assertNever5(left, "Unhandled preview customize history entry");
202389
+ return assertNever6(left, "Unhandled preview customize history entry");
201842
202390
  }
201843
202391
  }
201844
202392
 
@@ -201879,7 +202427,7 @@ function previewCustomizeWorkflowPageState(workflow) {
201879
202427
  case "loaded":
201880
202428
  return workflow.pageState;
201881
202429
  default:
201882
- return assertNever5(workflow, "Unhandled preview customize workflow state");
202430
+ return assertNever6(workflow, "Unhandled preview customize workflow state");
201883
202431
  }
201884
202432
  }
201885
202433
  function beginPreviewCustomizeApply(workflow, action) {
@@ -201974,7 +202522,7 @@ function confirmPreviewCustomizeMutation(workflow, response) {
201974
202522
  case "stale":
201975
202523
  return workflow;
201976
202524
  default:
201977
- return assertNever5(workflow.mutation, "Unhandled preview customize mutation");
202525
+ return assertNever6(workflow.mutation, "Unhandled preview customize mutation");
201978
202526
  }
201979
202527
  }
201980
202528
  function rejectPreviewCustomizeMutation(previousWorkflow, outcome) {
@@ -202008,7 +202556,7 @@ function previewCustomizeFailureMessage(workflow) {
202008
202556
  case "redoing":
202009
202557
  return null;
202010
202558
  default:
202011
- return assertNever5(workflow.mutation, "Unhandled preview customize mutation");
202559
+ return assertNever6(workflow.mutation, "Unhandled preview customize mutation");
202012
202560
  }
202013
202561
  }
202014
202562
  function skippedPreviewCustomizeOutcome(reason) {
@@ -202040,7 +202588,7 @@ function skippedPreviewCustomizeMessage(reason) {
202040
202588
  case "cannot-redo":
202041
202589
  return "No design choice is available to redo.";
202042
202590
  default:
202043
- return assertNever5(reason, "Unhandled preview customize skip reason");
202591
+ return assertNever6(reason, "Unhandled preview customize skip reason");
202044
202592
  }
202045
202593
  }
202046
202594
  function skipReasonForNewMutation(workflow) {
@@ -202063,7 +202611,7 @@ function isPendingMutation(mutation) {
202063
202611
  case "stale":
202064
202612
  return false;
202065
202613
  default:
202066
- return assertNever5(mutation, "Unhandled preview customize mutation");
202614
+ return assertNever6(mutation, "Unhandled preview customize mutation");
202067
202615
  }
202068
202616
  }
202069
202617
  function confirmedLoadedState(current, response) {
@@ -202138,7 +202686,7 @@ function applyPreviewCustomizeActionToLoadedState(state, action) {
202138
202686
  }
202139
202687
  };
202140
202688
  default:
202141
- return assertNever5(action, "Unhandled preview customize action");
202689
+ return assertNever6(action, "Unhandled preview customize action");
202142
202690
  }
202143
202691
  }
202144
202692
  function optimisticBoundaryBreakChoice(editorModel, boundary, action) {
@@ -202156,7 +202704,7 @@ function optimisticBoundaryBreakChoice(editorModel, boundary, action) {
202156
202704
  effectiveValue: autoBoundaryEffectiveValue(editorModel, boundary)
202157
202705
  };
202158
202706
  default:
202159
- return assertNever5(action, "Unhandled optimistic boundary action");
202707
+ return assertNever6(action, "Unhandled optimistic boundary action");
202160
202708
  }
202161
202709
  }
202162
202710
  function autoBoundaryEffectiveValue(editorModel, boundary) {
@@ -202416,7 +202964,7 @@ function pageDesignEditorActionForPersistence(action) {
202416
202964
  case "set-boundary":
202417
202965
  return action;
202418
202966
  default:
202419
- return assertNever5(action, "Unhandled page design editor action");
202967
+ return assertNever6(action, "Unhandled page design editor action");
202420
202968
  }
202421
202969
  }
202422
202970
  function classifyApplyActionError(error) {
@@ -202459,7 +203007,7 @@ function blockIdForRuntimePatch(action) {
202459
203007
  case "reset-boundary":
202460
203008
  return action.previousBlockId;
202461
203009
  default:
202462
- return assertNever5(action, "Unhandled runtime patch action");
203010
+ return assertNever6(action, "Unhandled runtime patch action");
202463
203011
  }
202464
203012
  }
202465
203013
  function currentLocalBlockContent(uiStore, targetBlockId) {
@@ -205114,7 +205662,7 @@ function boundaryBreakDisplay(boundary) {
205114
205662
  resetLabel: "Use default break"
205115
205663
  };
205116
205664
  default:
205117
- return assertNever5(boundary.breakChoice, "Unhandled boundary break choice");
205665
+ return assertNever6(boundary.breakChoice, "Unhandled boundary break choice");
205118
205666
  }
205119
205667
  }
205120
205668
  function formatBlockKindLabel2(blockKind) {