@persona/design-system 0.10.8 → 0.10.10

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 (197) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/{Badge-8YzapjWf.mjs → Badge-BCdsVKuj.mjs} +2 -2
  3. package/dist/{Badge-8YzapjWf.mjs.map → Badge-BCdsVKuj.mjs.map} +1 -1
  4. package/dist/{Breadcrumbs-Dft2TR4v.mjs → Breadcrumbs-CMf3Uvow.mjs} +4 -4
  5. package/dist/{Breadcrumbs-Dft2TR4v.mjs.map → Breadcrumbs-CMf3Uvow.mjs.map} +1 -1
  6. package/dist/Card2.d.mts +2 -2
  7. package/dist/{CardV2-BRJbRSts.mjs → CardV2-CrV6eEQb.mjs} +15 -5
  8. package/dist/CardV2-CrV6eEQb.mjs.map +1 -0
  9. package/dist/{CheckboxGroupField-DnVqlpwi.d.mts → CheckboxGroupField-Bpu2j6G2.d.mts} +2 -2
  10. package/dist/CheckboxGroupField.d.mts +1 -1
  11. package/dist/{Combobox-fYZjpn5-.d.mts → Combobox-CIKqTYZt.d.mts} +3 -3
  12. package/dist/{Combobox-DQxaOCLA.mjs → Combobox-Gb_j1dg6.mjs} +5 -5
  13. package/dist/{Combobox-DQxaOCLA.mjs.map → Combobox-Gb_j1dg6.mjs.map} +1 -1
  14. package/dist/Combobox.d.mts +2 -2
  15. package/dist/{ComboboxBase-Mb8HyeAI.d.mts → ComboboxBase-BPXqJHaQ.d.mts} +2 -2
  16. package/dist/ComboboxBase.d.mts +1 -1
  17. package/dist/{ComboboxMultiSelect-C87lkXr7.d.mts → ComboboxMultiSelect-BwkkSymj.d.mts} +2 -2
  18. package/dist/ComboboxMultiSelect.d.mts +1 -1
  19. package/dist/{ComboboxSingleSelect-CIYakRW5.d.mts → ComboboxSingleSelect-CdNNJNkp.d.mts} +3 -3
  20. package/dist/ComboboxSingleSelect.d.mts +1 -1
  21. package/dist/{CompactBar-D67CdcIo.d.mts → CompactBar-BLZZWtIE.d.mts} +2 -2
  22. package/dist/CompactBar.d.mts +1 -1
  23. package/dist/{ControlBar-34th2yt4.d.mts → ControlBar-B3Jn8G0k.d.mts} +5 -4
  24. package/dist/ControlBar.d.mts +1 -1
  25. package/dist/{DataTable-BZtzdtVs.d.mts → DataTable-BE9inUi-.d.mts} +5 -5
  26. package/dist/{DataTable-BvA2H9D9.mjs → DataTable-CIZJ1vO8.mjs} +10 -10
  27. package/dist/{DataTable-BvA2H9D9.mjs.map → DataTable-CIZJ1vO8.mjs.map} +1 -1
  28. package/dist/DataTable.d.mts +1 -1
  29. package/dist/{DatePicker-D-_ibUd1.mjs → DatePicker-C9redLBr.mjs} +4 -4
  30. package/dist/{DatePicker-D-_ibUd1.mjs.map → DatePicker-C9redLBr.mjs.map} +1 -1
  31. package/dist/{DropdownButton-BiFRlSVD.mjs → DropdownButton-DpLG-cIj.mjs} +3 -3
  32. package/dist/{DropdownButton-BiFRlSVD.mjs.map → DropdownButton-DpLG-cIj.mjs.map} +1 -1
  33. package/dist/DropdownButton.d.mts +1 -1
  34. package/dist/{DropdownMenu-DVxXQDRC.d.mts → DropdownMenu-B6D4stkF.d.mts} +2 -2
  35. package/dist/{DropdownMenu-Q8S-9rXm.mjs → DropdownMenu-c8XK2Lr4.mjs} +2 -2
  36. package/dist/{DropdownMenu-Q8S-9rXm.mjs.map → DropdownMenu-c8XK2Lr4.mjs.map} +1 -1
  37. package/dist/DropdownMenu.d.mts +1 -1
  38. package/dist/{FloatingToolbar-Df90f7Dm.mjs → FloatingToolbar-DLRaE0o7.mjs} +3 -3
  39. package/dist/{FloatingToolbar-Df90f7Dm.mjs.map → FloatingToolbar-DLRaE0o7.mjs.map} +1 -1
  40. package/dist/{FormField-BStxmlZT.mjs → FormField-Cf1VMvoa.mjs} +7 -7
  41. package/dist/{FormField-BStxmlZT.mjs.map → FormField-Cf1VMvoa.mjs.map} +1 -1
  42. package/dist/{HoverCopyableField-CW7Jxmni.mjs → HoverCopyableField-XHC_n9tp.mjs} +2 -2
  43. package/dist/{HoverCopyableField-CW7Jxmni.mjs.map → HoverCopyableField-XHC_n9tp.mjs.map} +1 -1
  44. package/dist/{IconButton-DftINsp7.mjs → IconButton-DxHB2g80.mjs} +2 -2
  45. package/dist/{IconButton-DftINsp7.mjs.map → IconButton-DxHB2g80.mjs.map} +1 -1
  46. package/dist/IndexTableLayout.d.mts +4 -4
  47. package/dist/InlineCombobox.d.mts +1 -1
  48. package/dist/InlineInput.d.mts +1 -1
  49. package/dist/{Input-DtO3qMnE.mjs → Input-RHXujO9u.mjs} +2 -2
  50. package/dist/{Input-DtO3qMnE.mjs.map → Input-RHXujO9u.mjs.map} +1 -1
  51. package/dist/{Link-DKYmdL9t.mjs → Link-D_kCyLYX.mjs} +2 -2
  52. package/dist/{Link-DKYmdL9t.mjs.map → Link-D_kCyLYX.mjs.map} +1 -1
  53. package/dist/{ListBox-CDG0EAPg.mjs → ListBox-BZp6exb8.mjs} +6 -6
  54. package/dist/{ListBox-CDG0EAPg.mjs.map → ListBox-BZp6exb8.mjs.map} +1 -1
  55. package/dist/{ListBox-DxOACf6N.d.mts → ListBox-DpFcM-dM.d.mts} +2 -2
  56. package/dist/ListBox.d.mts +1 -1
  57. package/dist/{ListBoxField-CgnDuhUw.d.mts → ListBoxField-DL6Zk8TU.d.mts} +4 -4
  58. package/dist/ListBoxField.d.mts +1 -1
  59. package/dist/{LogicRow-Dv_1G1TC.d.mts → LogicRow-BakOUtzx.d.mts} +2 -2
  60. package/dist/LogicRow.d.mts +1 -1
  61. package/dist/{Menu-EIT_MwK6.mjs → Menu-BVn1jh46.mjs} +2 -2
  62. package/dist/{Menu-EIT_MwK6.mjs.map → Menu-BVn1jh46.mjs.map} +1 -1
  63. package/dist/{Menu-BfjvH8mr.d.mts → Menu-D6OrKCTC.d.mts} +2 -2
  64. package/dist/Menu.d.mts +1 -1
  65. package/dist/{Modal-BGlRX63w.mjs → Modal-De5_bPJ_.mjs} +4 -4
  66. package/dist/{Modal-BGlRX63w.mjs.map → Modal-De5_bPJ_.mjs.map} +1 -1
  67. package/dist/PageHeader-7_Hf6rHl.mjs +81 -0
  68. package/dist/PageHeader-7_Hf6rHl.mjs.map +1 -0
  69. package/dist/{PageHeader-DRatgscC.d.mts → PageHeader-UPiqJpIF.d.mts} +11 -3
  70. package/dist/PageHeader.d.mts +1 -1
  71. package/dist/{Pagination-C8hPOu0l.mjs → Pagination-DMH2IaV0.mjs} +5 -5
  72. package/dist/{Pagination-C8hPOu0l.mjs.map → Pagination-DMH2IaV0.mjs.map} +1 -1
  73. package/dist/{Pii-Bvh_kfGN.mjs → Pii-24D_nSRQ.mjs} +2 -2
  74. package/dist/{Pii-Bvh_kfGN.mjs.map → Pii-24D_nSRQ.mjs.map} +1 -1
  75. package/dist/{Select-CaG6OQi1.d.mts → Select-CR9TjFfo.d.mts} +2 -2
  76. package/dist/{Select-DkUMz4LG.mjs → Select-DOlw_LPR.mjs} +4 -4
  77. package/dist/{Select-DkUMz4LG.mjs.map → Select-DOlw_LPR.mjs.map} +1 -1
  78. package/dist/Select.d.mts +1 -1
  79. package/dist/SmartTextInputField.d.mts +2 -2
  80. package/dist/{StatusIndicator-Zf75KK3O.mjs → StatusIndicator-CzRaEFSz.mjs} +2 -2
  81. package/dist/{StatusIndicator-Zf75KK3O.mjs.map → StatusIndicator-CzRaEFSz.mjs.map} +1 -1
  82. package/dist/{Sticker-Bi_fezCO.mjs → Sticker-C1_6I08u.mjs} +3 -3
  83. package/dist/{Sticker-Bi_fezCO.mjs.map → Sticker-C1_6I08u.mjs.map} +1 -1
  84. package/dist/{TabBar-DpXYsWgS.mjs → TabBar-BCFO38E0.mjs} +3 -3
  85. package/dist/{TabBar-DpXYsWgS.mjs.map → TabBar-BCFO38E0.mjs.map} +1 -1
  86. package/dist/{TableBox-BfSF36Gy.mjs → TableBox-DNQsgQ8x.mjs} +4 -4
  87. package/dist/{TableBox-BfSF36Gy.mjs.map → TableBox-DNQsgQ8x.mjs.map} +1 -1
  88. package/dist/TableBox.d.mts +1 -1
  89. package/dist/{TableBoxCell-B9KMWebc.d.mts → TableBoxCell-CsRt_5gP.d.mts} +4 -4
  90. package/dist/TableBoxCell.d.mts +1 -1
  91. package/dist/{TableBoxField-0uIGzBhF.d.mts → TableBoxField-Db0Vjo6Z.d.mts} +5 -5
  92. package/dist/TableBoxField.d.mts +1 -1
  93. package/dist/{TableBoxRow-PjBBDcEk.d.mts → TableBoxRow-exMlZyc4.d.mts} +2 -2
  94. package/dist/TableBoxRow.d.mts +1 -1
  95. package/dist/{TableBoxRowActions-B7stm6Q3.d.mts → TableBoxRowActions-UO9YN34k.d.mts} +2 -2
  96. package/dist/TableBoxRowActions.d.mts +1 -1
  97. package/dist/{TableControls-BZ8RrYOc.mjs → TableControls-BrP_BqnF.mjs} +14 -14
  98. package/dist/TableControls-BrP_BqnF.mjs.map +1 -0
  99. package/dist/{TableControls-DT2YpFK8.d.mts → TableControls-Clo_0Mty.d.mts} +4 -4
  100. package/dist/TableControls.d.mts +1 -1
  101. package/dist/{TableControlsContext-CHuLxfa7.d.mts → TableControlsContext-BNd6z9mD.d.mts} +2 -2
  102. package/dist/TableControlsContext.d.mts +1 -1
  103. package/dist/{TableViewConfigurationDropdown-BWBBUXCs.d.mts → TableViewConfigurationDropdown-Cp7ausV_.d.mts} +2 -2
  104. package/dist/TableViewConfigurationDropdown.d.mts +1 -1
  105. package/dist/{TechnicalSticker-B_JlBkXZ.mjs → TechnicalSticker-Cq5jzYKQ.mjs} +2 -2
  106. package/dist/{TechnicalSticker-B_JlBkXZ.mjs.map → TechnicalSticker-Cq5jzYKQ.mjs.map} +1 -1
  107. package/dist/{clientFilterUtils-scLlIuP_.d.mts → clientFilterUtils-CGHYF5NE.d.mts} +2 -2
  108. package/dist/clientFilterUtils.d.mts +1 -1
  109. package/dist/components/Accordion/index.mjs +1 -1
  110. package/dist/components/Attribute/index.mjs +2 -2
  111. package/dist/components/Badge/index.mjs +1 -1
  112. package/dist/components/Banner/index.mjs +1 -1
  113. package/dist/components/BottomPanel/index.mjs +4 -4
  114. package/dist/components/Breadcrumbs/index.mjs +1 -1
  115. package/dist/components/Button/index.mjs +1 -1
  116. package/dist/components/ButtonGroup/index.mjs +1 -1
  117. package/dist/components/CardV2/index.mjs +1 -1
  118. package/dist/components/CodeHighlight/index.mjs +1 -1
  119. package/dist/components/Combobox/index.d.mts +2 -2
  120. package/dist/components/Combobox/index.mjs +1 -1
  121. package/dist/components/DataTable/TableControls/index.d.mts +7 -7
  122. package/dist/components/DataTable/TableControls/index.mjs +1 -1
  123. package/dist/components/DataTable/index.d.mts +5 -5
  124. package/dist/components/DataTable/index.mjs +1 -1
  125. package/dist/components/DataTable/types.d.mts +1 -1
  126. package/dist/components/DatePicker/index.mjs +1 -1
  127. package/dist/components/DropdownButton/index.mjs +1 -1
  128. package/dist/components/DropdownMenu/index.d.mts +1 -1
  129. package/dist/components/DropdownMenu/index.mjs +1 -1
  130. package/dist/components/FloatingPanel/index.mjs +2 -2
  131. package/dist/components/FloatingToolbar/index.mjs +1 -1
  132. package/dist/components/FormField/index.d.mts +4 -4
  133. package/dist/components/FormField/index.mjs +1 -1
  134. package/dist/components/HoverCopyableField/index.mjs +1 -1
  135. package/dist/components/ImageTile/index.mjs +2 -2
  136. package/dist/components/Input/index.mjs +1 -1
  137. package/dist/components/Link/index.mjs +1 -1
  138. package/dist/components/ListBox/index.d.mts +3 -3
  139. package/dist/components/ListBox/index.mjs +1 -1
  140. package/dist/components/MaskedInput/index.mjs +1 -1
  141. package/dist/components/Menu/index.d.mts +1 -1
  142. package/dist/components/Menu/index.mjs +1 -1
  143. package/dist/components/Modal/index.mjs +1 -1
  144. package/dist/components/PageHeader/index.d.mts +1 -1
  145. package/dist/components/PageHeader/index.mjs +1 -1
  146. package/dist/components/Pagination/index.mjs +1 -1
  147. package/dist/components/Pii/index.mjs +1 -1
  148. package/dist/components/RichTextEditor/index.mjs +4 -4
  149. package/dist/components/RightPanel/index.mjs +1 -1
  150. package/dist/components/Select/index.d.mts +1 -1
  151. package/dist/components/Select/index.mjs +1 -1
  152. package/dist/components/SmartTextInput/index.mjs +2 -2
  153. package/dist/components/StatusIndicator/index.mjs +1 -1
  154. package/dist/components/Sticker/index.mjs +1 -1
  155. package/dist/components/TabBar/index.mjs +1 -1
  156. package/dist/components/TableBox/index.d.mts +1 -1
  157. package/dist/components/TableBox/index.mjs +1 -1
  158. package/dist/components/TechnicalSticker/index.mjs +1 -1
  159. package/dist/components/Tile/index.mjs +1 -1
  160. package/dist/components/Toast/index.mjs +1 -1
  161. package/dist/components/VersionHistory/index.mjs +4 -4
  162. package/dist/fieldPickerOptions.d.mts +1 -1
  163. package/dist/{filters-yfzOlqKx.d.mts → filters-DTBc0mE7.d.mts} +2 -2
  164. package/dist/filters.d.mts +1 -1
  165. package/dist/{helpers-BeCjgAeE.d.mts → helpers-CBJ2AqGZ.d.mts} +2 -2
  166. package/dist/helpers.d.mts +1 -1
  167. package/dist/{index-BEHNqAZa.d.mts → index-OkdnW-u5.d.mts} +3 -3
  168. package/dist/{inputFields-BnCdmuBt.d.mts → inputFields-DpHeZiFX.d.mts} +4 -4
  169. package/dist/inputFields.d.mts +1 -1
  170. package/dist/lib/GlobalStyles.d.mts +19 -2
  171. package/dist/lib/GlobalStyles.mjs +50 -1
  172. package/dist/lib/GlobalStyles.mjs.map +1 -1
  173. package/dist/lib/schemaOptions.mjs +9 -4
  174. package/dist/lib/schemaOptions.mjs.map +1 -1
  175. package/dist/patterns/CardGrouping/index.mjs +4 -4
  176. package/dist/patterns/IndexTableLayout/index.mjs +2 -2
  177. package/dist/patterns/LayoutLoadingShimmer/index.mjs +2 -2
  178. package/dist/patterns/WizardModal/index.mjs +2 -2
  179. package/dist/theme.mjs +1 -1
  180. package/dist/{types-BXJ6qAGy.d.mts → types-BEdERA4v.d.mts} +2 -2
  181. package/dist/{types-BeFBvQ1c.d.mts → types-BiqzeNsa.d.mts} +2 -2
  182. package/dist/types5.d.mts +1 -1
  183. package/dist/useColumnConfiguration.d.mts +2 -2
  184. package/dist/useComboboxFooterAction.d.mts +1 -1
  185. package/dist/{useTableColumns-DJFy0Gp8.d.mts → useTableColumns-Xd14vx_h.d.mts} +2 -2
  186. package/dist/useTableColumns.d.mts +1 -1
  187. package/dist/useTruncation.d.mts +1 -1
  188. package/dist/variables/charting.mjs +1 -1
  189. package/dist/variables/charting.mjs.map +1 -1
  190. package/llms.txt +3 -3
  191. package/package.json +3 -3
  192. package/skills/ui-authoring/COMPONENTS.md +1 -1
  193. package/skills/ui-authoring/PATTERNS.md +7 -0
  194. package/dist/CardV2-BRJbRSts.mjs.map +0 -1
  195. package/dist/PageHeader-DEKTopzU.mjs +0 -75
  196. package/dist/PageHeader-DEKTopzU.mjs.map +0 -1
  197. package/dist/TableControls-BZ8RrYOc.mjs.map +0 -1
@@ -12,11 +12,11 @@ import { Z_INDICES } from "../../lib/zindex.mjs";
12
12
  import { focusStyle } from "../../mixins/focus.mjs";
13
13
  import "../../variables/effect.mjs";
14
14
  import { n as Stack, t as HStack } from "../../Stack-Bzom2BTR.mjs";
15
- import { n as Button } from "../../IconButton-DftINsp7.mjs";
15
+ import { n as Button } from "../../IconButton-DxHB2g80.mjs";
16
16
  import { n as useFormField } from "../../useFormField-pOVkb5BK.mjs";
17
17
  import Input_default from "../Input/index.mjs";
18
18
  import { n as ErrorText } from "../../FormControl-BztNXLn6.mjs";
19
- import { m as FormField, n as TableBoxField, p as splitOutFormFieldProps } from "../../FormField-BStxmlZT.mjs";
19
+ import { m as FormField, n as TableBoxField, p as splitOutFormFieldProps } from "../../FormField-Cf1VMvoa.mjs";
20
20
  import PillType from "./PillType.mjs";
21
21
  import { ErrorMessageByKind, NodeType, isASTChainNode, isASTContainerNode, isMethodChainNode } from "./parser/smart-text/types.mjs";
22
22
  import { parse as peg$parse } from "./parser/smart-text/parser.mjs";
@@ -1,2 +1,2 @@
1
- import { n as StatusIndicator, t as STATUSES } from "../../StatusIndicator-Zf75KK3O.mjs";
1
+ import { n as StatusIndicator, t as STATUSES } from "../../StatusIndicator-CzRaEFSz.mjs";
2
2
  export { STATUSES, StatusIndicator, StatusIndicator as default };
@@ -1,2 +1,2 @@
1
- import { a as StyledTruncatedText, i as StickerContentContainer, n as Sticker, r as StickerContainer, t as STICKER_COLOR_CONFIG } from "../../Sticker-Bi_fezCO.mjs";
1
+ import { a as StyledTruncatedText, i as StickerContentContainer, n as Sticker, r as StickerContainer, t as STICKER_COLOR_CONFIG } from "../../Sticker-C1_6I08u.mjs";
2
2
  export { STICKER_COLOR_CONFIG, Sticker, Sticker as default, StickerContainer, StickerContentContainer, StyledTruncatedText };
@@ -1,2 +1,2 @@
1
- import { a as TabContainer, i as TabBar, n as StyledTab, r as Tab, t as TabBarIconButton_default } from "../../TabBar-DpXYsWgS.mjs";
1
+ import { a as TabContainer, i as TabBar, n as StyledTab, r as Tab, t as TabBarIconButton_default } from "../../TabBar-BCFO38E0.mjs";
2
2
  export { StyledTab, Tab, TabBar, TabBar as default, TabBarIconButton_default as TabBarIconButton, TabContainer };
@@ -1,3 +1,3 @@
1
1
  import { t as DragDirection } from "../../useTableBoxDragAndDrop-MwbXWWDQ.mjs";
2
- import { a as TableBox, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "../../TableBoxCell-B9KMWebc.mjs";
2
+ import { a as TableBox, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "../../TableBoxCell-CsRt_5gP.mjs";
3
3
  export { DragDirection, InlineEditConfig, TableBoxContext, TableBoxProps, TableBox as default };
@@ -1,2 +1,2 @@
1
- import { n as TableBoxContext, t as TableBox } from "../../TableBox-BfSF36Gy.mjs";
1
+ import { n as TableBoxContext, t as TableBox } from "../../TableBox-DNQsgQ8x.mjs";
2
2
  export { TableBoxContext, TableBox as default };
@@ -1,2 +1,2 @@
1
- import { t as TechnicalSticker } from "../../TechnicalSticker-B_JlBkXZ.mjs";
1
+ import { t as TechnicalSticker } from "../../TechnicalSticker-Cq5jzYKQ.mjs";
2
2
  export { TechnicalSticker, TechnicalSticker as default };
@@ -3,7 +3,7 @@ import { semanticColor } from "../../lib/semanticColor.mjs";
3
3
  import { i as Paragraph, n as Heading } from "../../Text-D0vEReED.mjs";
4
4
  import { t as TextUnderlineTooltip } from "../../Tooltip-YViXzMdm.mjs";
5
5
  import { n as Stack, t as HStack } from "../../Stack-Bzom2BTR.mjs";
6
- import { n as Sticker } from "../../Sticker-Bi_fezCO.mjs";
6
+ import { n as Sticker } from "../../Sticker-C1_6I08u.mjs";
7
7
  import { Color, Spacing } from "@persona/design-tokens";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { ArrowRightIcon } from "@persona/icons/12px";
@@ -6,7 +6,7 @@ import { withAlpha } from "../../lib/color.mjs";
6
6
  import "../../lib/message.mjs";
7
7
  import { isActive, isFocused, isHovered, isNotDisabled } from "../../lib/pseudoClass.mjs";
8
8
  import "../../variables/effect.mjs";
9
- import { t as IconButton } from "../../IconButton-DftINsp7.mjs";
9
+ import { t as IconButton } from "../../IconButton-DxHB2g80.mjs";
10
10
  import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import { CircleAlertIcon, CircleCheckIcon, CircleInfoIcon } from "@persona/icons";
@@ -4,12 +4,12 @@ import { i as Paragraph } from "../../Text-D0vEReED.mjs";
4
4
  import { focusOutline } from "../../mixins/focus.mjs";
5
5
  import { semanticScrollbar } from "../../mixins/scrollbar.mjs";
6
6
  import { n as Stack, t as HStack } from "../../Stack-Bzom2BTR.mjs";
7
- import { n as Button, t as IconButton } from "../../IconButton-DftINsp7.mjs";
8
- import { n as DropdownMenu_default } from "../../DropdownMenu-Q8S-9rXm.mjs";
7
+ import { n as Button, t as IconButton } from "../../IconButton-DxHB2g80.mjs";
8
+ import { n as DropdownMenu_default } from "../../DropdownMenu-c8XK2Lr4.mjs";
9
9
  import { t as Spinner } from "../../Spinner-CXb-KUs1.mjs";
10
- import { i as Modal_default } from "../../Modal-BGlRX63w.mjs";
10
+ import { i as Modal_default } from "../../Modal-De5_bPJ_.mjs";
11
11
  import { t as TextAreaWithStyle } from "../../TextArea-Dro-HH8O.mjs";
12
- import { n as StatusIndicator } from "../../StatusIndicator-Zf75KK3O.mjs";
12
+ import { n as StatusIndicator } from "../../StatusIndicator-CzRaEFSz.mjs";
13
13
  import { useCallback, useMemo, useState } from "react";
14
14
  import { Color, Spacing } from "@persona/design-tokens";
15
15
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-Mb8HyeAI.mjs";
1
+ import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-BPXqJHaQ.mjs";
2
2
  import { t as FieldRegistry } from "./FieldRegistry-C2NVPhMO.mjs";
3
3
 
4
4
  //#region src/components/DataTable/TableControls/FiltersV2/fieldPickerOptions.d.ts
@@ -1,4 +1,4 @@
1
- import { i as BaseFilterConfig, l as FilterTypeDefinition, t as ActiveFilter, u as FilterTypeResolver } from "./types-BXJ6qAGy.mjs";
1
+ import { i as BaseFilterConfig, l as FilterTypeDefinition, t as ActiveFilter, u as FilterTypeResolver } from "./types-BEdERA4v.mjs";
2
2
  import { ComponentProps } from "react";
3
3
  import * as _$styled_components0 from "styled-components";
4
4
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
@@ -19,4 +19,4 @@ declare const Filters: <TFilter extends BaseFilterConfig>({
19
19
  }) => _$react_jsx_runtime0.JSX.Element;
20
20
  //#endregion
21
21
  export { resolveFilterTypeDefinition as a, isFilterActive as i, FiltersContainer as n, synchronizeActiveFilters as o, getActiveFilters as r, Filters as t };
22
- //# sourceMappingURL=filters-yfzOlqKx.d.mts.map
22
+ //# sourceMappingURL=filters-DTBc0mE7.d.mts.map
@@ -1,2 +1,2 @@
1
- import { a as resolveFilterTypeDefinition, i as isFilterActive, n as FiltersContainer, o as synchronizeActiveFilters, r as getActiveFilters, t as Filters } from "./filters-yfzOlqKx.mjs";
1
+ import { a as resolveFilterTypeDefinition, i as isFilterActive, n as FiltersContainer, o as synchronizeActiveFilters, r as getActiveFilters, t as Filters } from "./filters-DTBc0mE7.mjs";
2
2
  export { Filters, FiltersContainer, getActiveFilters, isFilterActive, resolveFilterTypeDefinition, synchronizeActiveFilters };
@@ -1,6 +1,6 @@
1
1
  import { n as CheckboxProps } from "./Checkbox-Clt9mCTk.mjs";
2
2
  import { i as CommonStrings } from "./strings-DQZIO-n7.mjs";
3
- import { S as RenderValueStickerFormatConfig, b as DatetimeConfig, d as DataTableColumnImageFormat, h as DataTableColumnStringFormat, l as DataTableColumnFormat, p as DataTableColumnPiiFormat, y as DateConfig } from "./types-BeFBvQ1c.mjs";
3
+ import { S as RenderValueStickerFormatConfig, b as DatetimeConfig, d as DataTableColumnImageFormat, h as DataTableColumnStringFormat, l as DataTableColumnFormat, p as DataTableColumnPiiFormat, y as DateConfig } from "./types-BiqzeNsa.mjs";
4
4
  import { ReactNode } from "react";
5
5
 
6
6
  //#region src/components/DataTable/helpers.d.ts
@@ -87,4 +87,4 @@ declare const renderAsLightweightImage: (value: unknown, config?: DataTableColum
87
87
  declare const renderAsPDSFormat: <TData = unknown>(value: unknown, format?: DataTableColumnFormat<TData>, row?: TData, options?: PDSFormatOptions) => string | ReactNode;
88
88
  //#endregion
89
89
  export { renderAsDate as a, renderAsNumber as c, renderAsSticker as d, renderAsString as f, renderAsCopyableString as i, renderAsPDSFormat as l, renderAsCheckbox as n, renderAsDatetime as o, renderAsURL as p, renderAsCheckboxHeader as r, renderAsLightweightImage as s, PDSFormatOptions as t, renderAsPii as u };
90
- //# sourceMappingURL=helpers-BeCjgAeE.d.mts.map
90
+ //# sourceMappingURL=helpers-CBJ2AqGZ.d.mts.map
@@ -1,2 +1,2 @@
1
- import { a as renderAsDate, c as renderAsNumber, d as renderAsSticker, f as renderAsString, i as renderAsCopyableString, l as renderAsPDSFormat, n as renderAsCheckbox, o as renderAsDatetime, p as renderAsURL, r as renderAsCheckboxHeader, s as renderAsLightweightImage, t as PDSFormatOptions, u as renderAsPii } from "./helpers-BeCjgAeE.mjs";
1
+ import { a as renderAsDate, c as renderAsNumber, d as renderAsSticker, f as renderAsString, i as renderAsCopyableString, l as renderAsPDSFormat, n as renderAsCheckbox, o as renderAsDatetime, p as renderAsURL, r as renderAsCheckboxHeader, s as renderAsLightweightImage, t as PDSFormatOptions, u as renderAsPii } from "./helpers-CBJ2AqGZ.mjs";
2
2
  export { PDSFormatOptions, renderAsCheckbox, renderAsCheckboxHeader, renderAsCopyableString, renderAsDate, renderAsDatetime, renderAsLightweightImage, renderAsNumber, renderAsPDSFormat, renderAsPii, renderAsSticker, renderAsString, renderAsURL };
@@ -1,5 +1,5 @@
1
- import { n as ListBoxItemProps, r as ListBoxProps$1 } from "./ListBox-DxOACf6N.mjs";
2
- import { n as LogicRowProps } from "./LogicRow-Dv_1G1TC.mjs";
1
+ import { n as ListBoxItemProps, r as ListBoxProps$1 } from "./ListBox-DpFcM-dM.mjs";
2
+ import { n as LogicRowProps } from "./LogicRow-BakOUtzx.mjs";
3
3
  import * as _$react from "react";
4
4
  import * as _$react_aria_components0 from "react-aria-components";
5
5
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
@@ -52,4 +52,4 @@ declare const ListBox: {
52
52
  };
53
53
  //#endregion
54
54
  export { ListBox as t };
55
- //# sourceMappingURL=index-BEHNqAZa.d.mts.map
55
+ //# sourceMappingURL=index-OkdnW-u5.d.mts.map
@@ -1,11 +1,11 @@
1
1
  import { n as CheckboxProps } from "./Checkbox-Clt9mCTk.mjs";
2
- import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-C87lkXr7.mjs";
3
- import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-CIYakRW5.mjs";
2
+ import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-BwkkSymj.mjs";
3
+ import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-CdNNJNkp.mjs";
4
4
  import { n as FormFieldBaseProps } from "./FormField-BW5uMzId.mjs";
5
5
  import { a as InputProps } from "./Input-DH-5dKor.mjs";
6
6
  import { n as RadioGroupProps } from "./RadioGroup-D_z37ZOU.mjs";
7
7
  import { i as SegmentedControlProps } from "./SegmentedControl-yVK6kkcx.mjs";
8
- import { i as SelectProps } from "./Select-CaG6OQi1.mjs";
8
+ import { i as SelectProps } from "./Select-CR9TjFfo.mjs";
9
9
  import { t as TextAreaProps } from "./TextArea-BJWEaURJ.mjs";
10
10
  import { n as ToggleProps } from "./Toggle-CeIDF9yS.mjs";
11
11
  import * as _$react from "react";
@@ -68,4 +68,4 @@ type ComboboxMultiSelectFieldProps<T = string> = ImplementsFormField & ComboboxM
68
68
  declare const ComboboxField: (props: ComboboxSingleSelectFieldProps | ComboboxMultiSelectFieldProps) => _$react_jsx_runtime0.JSX.Element;
69
69
  //#endregion
70
70
  export { ToggleField as _, ComboboxSingleSelectFieldProps as a, RadioGroupFieldProps as c, SelectField as d, SelectFieldProps as f, TextFieldProps as g, TextField as h, ComboboxMultiSelectFieldProps as i, SegmentedControlField as l, TextAreaFieldProps as m, CheckboxFieldProps as n, ImplementsFormField as o, TextAreaField as p, ComboboxField as r, RadioGroupField as s, CheckboxField as t, SegmentedControlFieldProps as u, ToggleFieldProps as v, splitOutFormFieldProps as y };
71
- //# sourceMappingURL=inputFields-BnCdmuBt.d.mts.map
71
+ //# sourceMappingURL=inputFields-DpHeZiFX.d.mts.map
@@ -1,2 +1,2 @@
1
- import { _ as ToggleField, a as ComboboxSingleSelectFieldProps, c as RadioGroupFieldProps, d as SelectField, f as SelectFieldProps, g as TextFieldProps, h as TextField, i as ComboboxMultiSelectFieldProps, l as SegmentedControlField, m as TextAreaFieldProps, n as CheckboxFieldProps, o as ImplementsFormField, p as TextAreaField, r as ComboboxField, s as RadioGroupField, t as CheckboxField, u as SegmentedControlFieldProps, v as ToggleFieldProps, y as splitOutFormFieldProps } from "./inputFields-BnCdmuBt.mjs";
1
+ import { _ as ToggleField, a as ComboboxSingleSelectFieldProps, c as RadioGroupFieldProps, d as SelectField, f as SelectFieldProps, g as TextFieldProps, h as TextField, i as ComboboxMultiSelectFieldProps, l as SegmentedControlField, m as TextAreaFieldProps, n as CheckboxFieldProps, o as ImplementsFormField, p as TextAreaField, r as ComboboxField, s as RadioGroupField, t as CheckboxField, u as SegmentedControlFieldProps, v as ToggleFieldProps, y as splitOutFormFieldProps } from "./inputFields-DpHeZiFX.mjs";
2
2
  export { CheckboxField, CheckboxFieldProps, ComboboxField, ComboboxMultiSelectFieldProps, ComboboxSingleSelectFieldProps, ImplementsFormField, RadioGroupField, RadioGroupFieldProps, SegmentedControlField, SegmentedControlFieldProps, SelectField, SelectFieldProps, TextAreaField, TextAreaFieldProps, TextField, TextFieldProps, ToggleField, ToggleFieldProps, splitOutFormFieldProps };
@@ -1,8 +1,25 @@
1
+ import { n as MaybeSemanticTheme } from "../semanticColor-BKbCliyl.mjs";
1
2
  import * as _$styled_components0 from "styled-components";
2
3
 
3
4
  //#region src/lib/GlobalStyles.d.ts
5
+ /**
6
+ * Theme-independent base sheet. It must stay static (no theme interpolations): consumers serialize
7
+ * it outside React (`globalStylesRaw.join('')`, e.g. for themeless iframes), so a function here
8
+ * would stringify into the CSS.
9
+ */
4
10
  declare const globalStylesRaw: _$styled_components0.FlattenSimpleInterpolation;
5
- declare const _default: _$styled_components0.GlobalStyleComponent<{}, _$styled_components0.DefaultTheme>;
11
+ /**
12
+ * Re-points the page chrome (canvas, text, links) at the theme's semantic palette, so a dark
13
+ * `PDSProvider colorMode` paints a dark page instead of the static light `globalStylesRaw` colours.
14
+ * Emits nothing under a theme without the semantic namespace (no `colorMode`, Relay), so those keep
15
+ * exactly the `globalStylesRaw` output. Print always uses the light palette.
16
+ */
17
+ declare const semanticPageChromeRaw: _$styled_components0.FlattenInterpolation<_$styled_components0.ThemedStyledProps<{
18
+ theme?: MaybeSemanticTheme;
19
+ }, any>>;
20
+ declare const _default: _$styled_components0.GlobalStyleComponent<{
21
+ theme?: MaybeSemanticTheme;
22
+ }, _$styled_components0.DefaultTheme>;
6
23
  //#endregion
7
- export { _default as default, globalStylesRaw };
24
+ export { _default as default, globalStylesRaw, semanticPageChromeRaw };
8
25
  //# sourceMappingURL=GlobalStyles.d.mts.map
@@ -1,6 +1,13 @@
1
1
  import { n as createGlobalStyle, r as css } from "../styledComponentsInterop-Cs5CCPRy.mjs";
2
+ import { semanticOnly } from "./semanticColor.mjs";
3
+ import { semanticLight } from "../variables/semantic.mjs";
2
4
  import { Color, Typography } from "@persona/design-tokens";
3
5
  //#region src/lib/GlobalStyles.tsx
6
+ /**
7
+ * Theme-independent base sheet. It must stay static (no theme interpolations): consumers serialize
8
+ * it outside React (`globalStylesRaw.join('')`, e.g. for themeless iframes), so a function here
9
+ * would stringify into the CSS.
10
+ */
4
11
  const globalStylesRaw = css`
5
12
  body {
6
13
  height: 100%;
@@ -42,10 +49,52 @@ const globalStylesRaw = css`
42
49
  }
43
50
  }
44
51
  `;
52
+ /**
53
+ * Re-points the page chrome (canvas, text, links) at the theme's semantic palette, so a dark
54
+ * `PDSProvider colorMode` paints a dark page instead of the static light `globalStylesRaw` colours.
55
+ * Emits nothing under a theme without the semantic namespace (no `colorMode`, Relay), so those keep
56
+ * exactly the `globalStylesRaw` output. Print always uses the light palette.
57
+ */
58
+ const semanticPageChromeRaw = css`
59
+ ${semanticOnly((tokens) => css`
60
+ html,
61
+ body {
62
+ background: ${tokens.SurfacePage};
63
+ }
64
+
65
+ body {
66
+ color: ${tokens.FgPrimary};
67
+ }
68
+
69
+ a {
70
+ color: ${tokens.FgAccent};
71
+
72
+ &:focus-visible {
73
+ outline-color: ${tokens.BorderFocus};
74
+ }
75
+ }
76
+
77
+ @media print {
78
+ html,
79
+ body {
80
+ background: ${semanticLight.SurfacePage};
81
+ }
82
+
83
+ body {
84
+ color: ${semanticLight.FgPrimary};
85
+ }
86
+
87
+ a {
88
+ color: ${semanticLight.FgAccent};
89
+ }
90
+ }
91
+ `)}
92
+ `;
45
93
  var GlobalStyles_default = createGlobalStyle`
46
94
  ${globalStylesRaw}
95
+ ${semanticPageChromeRaw}
47
96
  `;
48
97
  //#endregion
49
- export { GlobalStyles_default as default, globalStylesRaw };
98
+ export { GlobalStyles_default as default, globalStylesRaw, semanticPageChromeRaw };
50
99
 
51
100
  //# sourceMappingURL=GlobalStyles.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalStyles.mjs","names":[],"sources":["../../src/lib/GlobalStyles.tsx"],"sourcesContent":["import { createGlobalStyle, css } from 'styled-components';\n\nimport { Color, Typography } from '@persona/design-tokens';\n\nexport const globalStylesRaw = css`\n body {\n height: 100%;\n width: 100%;\n background: ${Color.BackgroundSecondary};\n color: ${Color.TextPrimary};\n ${Typography.TextMedium};\n -webkit-font-smoothing: antialiased;\n\n /* For iOS scrolling */\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n a {\n color: ${Color.PrimaryPurple};\n font-size: inherit;\n line-height: inherit;\n text-decoration: none;\n\n /* Only show outline when focused via keyboard */\n &:focus-visible {\n outline: 2px auto ${Color.BorderFocus};\n outline-offset: 2px;\n }\n }\n\n b {\n font-weight: ${Typography.TextMediumBold.fontWeight};\n }\n\n @page {\n size: portrait;\n }\n\n @media print {\n body {\n overflow: visible;\n }\n }\n`;\n\nexport default createGlobalStyle`\n ${globalStylesRaw}\n`;\n"],"mappings":";;;AAIA,MAAa,kBAAkB,GAAG;;;;kBAIhB,MAAM,oBAAoB;aAC/B,MAAM,YAAY;MACzB,WAAW,WAAW;;;;;;;;;aASf,MAAM,cAAc;;;;;;;0BAOP,MAAM,YAAY;;;;;;mBAMzB,WAAW,eAAe,WAAW;;;;;;;;;;;;;AAcxD,IAAA,uBAAe,iBAAiB;IAC5B,gBAAgB"}
1
+ {"version":3,"file":"GlobalStyles.mjs","names":[],"sources":["../../src/lib/GlobalStyles.tsx"],"sourcesContent":["import { createGlobalStyle, css } from 'styled-components';\n\nimport { Color, Typography } from '@persona/design-tokens';\n\nimport { semanticOnly } from '#src/lib/semanticColor';\nimport { semanticLight } from '#src/variables/semantic';\n\n/**\n * Theme-independent base sheet. It must stay static (no theme interpolations): consumers serialize\n * it outside React (`globalStylesRaw.join('')`, e.g. for themeless iframes), so a function here\n * would stringify into the CSS.\n */\nexport const globalStylesRaw = css`\n body {\n height: 100%;\n width: 100%;\n background: ${Color.BackgroundSecondary};\n color: ${Color.TextPrimary};\n ${Typography.TextMedium};\n -webkit-font-smoothing: antialiased;\n\n /* For iOS scrolling */\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n a {\n color: ${Color.PrimaryPurple};\n font-size: inherit;\n line-height: inherit;\n text-decoration: none;\n\n /* Only show outline when focused via keyboard */\n &:focus-visible {\n outline: 2px auto ${Color.BorderFocus};\n outline-offset: 2px;\n }\n }\n\n b {\n font-weight: ${Typography.TextMediumBold.fontWeight};\n }\n\n @page {\n size: portrait;\n }\n\n @media print {\n body {\n overflow: visible;\n }\n }\n`;\n\n/**\n * Re-points the page chrome (canvas, text, links) at the theme's semantic palette, so a dark\n * `PDSProvider colorMode` paints a dark page instead of the static light `globalStylesRaw` colours.\n * Emits nothing under a theme without the semantic namespace (no `colorMode`, Relay), so those keep\n * exactly the `globalStylesRaw` output. Print always uses the light palette.\n */\nexport const semanticPageChromeRaw = css`\n ${semanticOnly(\n (tokens) => css`\n html,\n body {\n background: ${tokens.SurfacePage};\n }\n\n body {\n color: ${tokens.FgPrimary};\n }\n\n a {\n color: ${tokens.FgAccent};\n\n &:focus-visible {\n outline-color: ${tokens.BorderFocus};\n }\n }\n\n @media print {\n html,\n body {\n background: ${semanticLight.SurfacePage};\n }\n\n body {\n color: ${semanticLight.FgPrimary};\n }\n\n a {\n color: ${semanticLight.FgAccent};\n }\n }\n `,\n )}\n`;\n\nexport default createGlobalStyle`\n ${globalStylesRaw}\n ${semanticPageChromeRaw}\n`;\n"],"mappings":";;;;;;;;;;AAYA,MAAa,kBAAkB,GAAG;;;;kBAIhB,MAAM,oBAAoB;aAC/B,MAAM,YAAY;MACzB,WAAW,WAAW;;;;;;;;;aASf,MAAM,cAAc;;;;;;;0BAOP,MAAM,YAAY;;;;;;mBAMzB,WAAW,eAAe,WAAW;;;;;;;;;;;;;;;;;;;AAoBxD,MAAa,wBAAwB,GAAG;IACpC,cACC,WAAW,GAAG;;;sBAGG,OAAO,YAAY;;;;iBAIxB,OAAO,UAAU;;;;iBAIjB,OAAO,SAAS;;;2BAGN,OAAO,YAAY;;;;;;;wBAOtB,cAAc,YAAY;;;;mBAI/B,cAAc,UAAU;;;;mBAIxB,cAAc,SAAS;;;MAIvC,CAAC;;AAGJ,IAAA,uBAAe,iBAAiB;IAC5B,gBAAgB;IAChB,sBAAsB"}
@@ -206,10 +206,15 @@ const getSchemaForVariablePath = ({ path, usableObjects }) => {
206
206
  };
207
207
  const getPrimitiveSchemaId = (schema) => {
208
208
  if (!("type" in schema)) return null;
209
- if (isJsonSchemaObject(schema) && isFileType(schema.fieldType)) return "/schema/field/file";
210
- if (isJsonSchemaDate(schema)) return "/schema/date";
211
- if (isJsonSchemaDateTime(schema)) return "/schema/datetime";
212
- const type = Array.isArray(schema.type) ? getNonNullableType(schema) : schema.type;
209
+ const nonNullableType = Array.isArray(schema.type) ? getNonNullableType(schema) : null;
210
+ const narrowedSchema = nonNullableType ? {
211
+ ...schema,
212
+ type: nonNullableType
213
+ } : schema;
214
+ if (isJsonSchemaObject(narrowedSchema) && isFileType(narrowedSchema.fieldType)) return "/schema/field/file";
215
+ if (isJsonSchemaDate(narrowedSchema)) return "/schema/date";
216
+ if (isJsonSchemaDateTime(narrowedSchema)) return "/schema/datetime";
217
+ const type = Array.isArray(schema.type) ? nonNullableType : schema.type;
213
218
  if (!type) return null;
214
219
  if (type === "integer" || type === "number") return "/schema/number";
215
220
  if (type === "boolean") return "/schema/boolean";
@@ -1 +1 @@
1
- {"version":3,"file":"schemaOptions.mjs","names":[],"sources":["../../src/lib/schemaOptions.ts"],"sourcesContent":["import { compact, flatten, last, sortBy, trim } from 'lodash-es';\n\nimport { assertNever } from './assertNever';\nimport {\n JsonSchemaAllTypes,\n type JsonSchemaCustomTypes,\n JsonSchemaStringifiableTypes,\n EMPTY_JSON_SCHEMA_OBJECT,\n getNonNullableRefSchema,\n genericArrayItemSchema,\n getNonNullableType,\n isConvertedTypeSchema,\n isFileType,\n isFunctionSchema,\n isGenericParameterSchema,\n isJsonSchemaArray,\n isJsonSchemaDate,\n isJsonSchemaDateTime,\n isJsonSchemaObject,\n isJsonSchemaRef,\n isJsonSchemaString,\n isJsonType,\n isPrecedingSchema,\n type JsonSchema,\n type JsonSchemaArray,\n type JsonSchemaBasicTypes,\n type JsonSchemaObject,\n JsonSchemaTypes,\n type JsonSchemaObjectKey,\n} from './jsonSchema';\nimport { getJsonSchemaType } from './jsonSchemaType';\nimport {\n appendedMethodChain,\n type Chain,\n EMPTY_METHOD_CHAIN,\n isIdentifierNode,\n isFunctionNode,\n isStringNode,\n isValid,\n type MethodChainNode,\n MethodChainNodeTypes,\n methodChainToString,\n parseMethodChain,\n parseWithPartialOption,\n type StringNode,\n} from './methodChain';\nimport type { FunctionJsonSchema, ObjectSchemaMap } from './objectSchemaTypes';\nimport {\n getPlatformObjectTypeFromJsonSchema,\n getSchemaId,\n MERGED_SCHEMA_ID,\n PrimitiveSchemaId,\n resolveJssRef,\n} from './platformObject';\n\ntype VariableSchemaObject = {\n value: string;\n schema?: JsonSchema | null;\n isVariable?: boolean;\n};\n\nconst fullNodeName = (node: MethodChainNode): string =>\n `${node.type === MethodChainNodeTypes.CustomFunction ? '@' : ''}${node.name}`;\n\nexport type Option = {\n label: string;\n value: string;\n property: string;\n schema: JsonSchema | FunctionJsonSchema;\n methodChain: Chain | null;\n utility?: boolean;\n workflowObjectKey?: string;\n isVariable?: boolean;\n};\n\nconst SCHEMA_PATH_PATTERN = /\\/schema\\/([a-z][a-z0-9-_]*)/i;\n\n/**\n * Extracts the top-level platform-object key from a schema's `$ref`/`$id`/\n * `objectKey`/`objectType.const` markers. Collapses subtypes to their root\n * (`/schema/verification/document/merged` -> `verification`) because callers\n * compare against top-level `ApiModel` values.\n */\nexport const extractPlatformObjectKey = (\n schema: JsonSchema | null | undefined,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n): string | null => {\n if (!schema) {\n return null;\n }\n if (isJsonSchemaRef(schema)) {\n const refMatch = schema.$ref?.match(SCHEMA_PATH_PATTERN);\n if (refMatch) {\n return refMatch[1];\n }\n return extractPlatformObjectKey(\n resolveJssRef(schema, platformObjectJsonSchema),\n platformObjectJsonSchema,\n );\n }\n if ('$id' in schema && typeof schema.$id === 'string') {\n const idMatch = schema.$id.match(SCHEMA_PATH_PATTERN);\n if (idMatch) {\n return idMatch[1];\n }\n }\n // Serialized PLOB columns carry `objectKey` on a scalar schema (no `$ref`), so\n // read it regardless of `type`, collapsing subtypes to root like the `$ref` branch.\n if ('objectKey' in schema && typeof schema.objectKey === 'string') {\n return schema.objectKey.split('/')[0];\n }\n return getPlatformObjectTypeFromJsonSchema(schema);\n};\n\ntype PossibleType = JsonSchemaTypes | JsonSchemaCustomTypes | JsonSchemaObjectKey;\ntype PossibleArrayType = JsonSchemaBasicTypes | JsonSchemaTypes.Object | JsonSchemaObjectKey;\n\nconst isMatchingType = (\n schema: JsonSchema,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n) => {\n if (allowedTypes.length === 0) {\n return true;\n }\n const jsonSchemaType = getJsonSchemaType(schema);\n // If strings are allowed and the field is string-able, let it through.\n if (\n allowedTypes.some((schemaType) => schemaType === JsonSchemaTypes.String) &&\n JsonSchemaStringifiableTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return true;\n } else if (jsonSchemaType === JsonSchemaAllTypes.Array) {\n const itemsSchema = 'items' in schema ? schema.items : null;\n if (\n !allowedTypes.includes(JsonSchemaAllTypes.Array) ||\n // Don't recurse on array, otherwise we risk matching on objects within the array\n (allowedArrayTypes?.length &&\n !allowedArrayTypes.some((schemaType) => schemaType === getJsonSchemaType(itemsSchema)))\n ) {\n return false;\n }\n } else if (\n jsonSchemaType !== JsonSchemaAllTypes.Object &&\n !allowedTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return false;\n }\n return true;\n};\n\n// isValidOptionHelper returns true if the schema provided is (in order of precedence)\n// 1) not a disallowed by name\n// AND 2) not a disallowed type\n// AND 3) allowed field by name (either explicitly or implicitly)\n// at each level (we recurse down for object types), we check that the fields at the level fit the above 1,2 and 3\n//\n// 1) is straight forward. if a field is named as disallowed it has the most precedence\n// 2) the field is disallowed by type if the allowedTypes are specified AND\n// - if the field is an array, then\n// - arrays are in allowedTypes\n// - AND (its `items` type is in `allowedArrayTypes` OR `allowedArrayTypes` is empty)\n// - if the field is an object, we do nothing since the recursion is handled at the `isValidOptionHelper` level\n// - else, the field type appears in allowedTypes\n// 3) we can be allowed by name\n// - explicitly, which means the field is named explicitly as an allowedFieldPath (this has precedence)\n// - implicitly, which means that there are no fields explicitly named in allowedFieldPath\n// - an object field can be allowed implicitly if it has at least one valid children\nconst isValidOptionHelper = (\n schema: JsonSchema,\n allowedFieldPaths: Set<string>,\n disallowedFieldPaths: Set<string>,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[],\n platformObjectJsonSchema: ObjectSchemaMap,\n traversedSchemaIds = new Set(),\n): boolean => {\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n const dotPath = path.join('.');\n if (disallowedFieldPaths.has(dotPath)) {\n return false;\n }\n if (!isMatchingType(resolvedSchema, allowedTypes, allowedArrayTypes)) {\n return false;\n }\n if (allowedFieldPaths.has(dotPath)) {\n return true;\n }\n // if we are here it means\n // - our type is valid\n // - we are not disallowed\n // - we are not explicitly allowed\n // if we are here, we are only valid if\n // - we are an object and at least one of our properties are valid\n // OR, we are not an object and allowedFieldPaths is empty\n const jsonSchemaType = getJsonSchemaType(resolvedSchema);\n if (jsonSchemaType === JsonSchemaTypes.Object) {\n // A schemaless JSON field is an opaque leaf, so it has no child to qualify it as an option.\n if ('fieldType' in resolvedSchema && isJsonType(resolvedSchema.fieldType)) {\n return allowedFieldPaths.size === 0;\n }\n return (\n 'properties' in resolvedSchema &&\n resolvedSchema.properties != null &&\n Object.entries(resolvedSchema.properties).some(([prop, propSchema]) =>\n isValidOptionHelper(\n propSchema,\n allowedFieldPaths,\n disallowedFieldPaths,\n allowedTypes,\n allowedArrayTypes,\n [...path, prop],\n platformObjectJsonSchema,\n traversedSchemaIds,\n ),\n )\n );\n }\n return allowedFieldPaths.size === 0;\n};\n\nexport const isValidOption = (\n schema: JsonSchema,\n allowedFieldPaths: string[],\n disallowedFieldPaths: string[],\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[] = [],\n platformObjectJsonSchema: ObjectSchemaMap,\n): boolean => {\n const allowedFieldPathsSet =\n allowedFieldPaths == null ? new Set<string>() : new Set<string>(allowedFieldPaths);\n const disallowedFieldPathsSet =\n disallowedFieldPaths == null ? new Set<string>() : new Set<string>(disallowedFieldPaths);\n if (\n allowedFieldPathsSet.size === 0 &&\n disallowedFieldPathsSet.size === 0 &&\n allowedTypes.length === 0 &&\n allowedArrayTypes.length === 0\n ) {\n return true;\n }\n return isValidOptionHelper(\n schema,\n allowedFieldPathsSet,\n disallowedFieldPathsSet,\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n path,\n platformObjectJsonSchema,\n );\n};\n\nconst buildSchemaOptionsFor = (rootSchema: JsonSchemaObject, baseChain: Chain | null) =>\n Object.entries(rootSchema?.properties ?? {}).map(([property, propSchema]) => {\n const appended = appendedMethodChain(baseChain ?? EMPTY_METHOD_CHAIN, property);\n return {\n label: methodChainToString(appended),\n value: methodChainToString(appended),\n property,\n schema: propSchema,\n methodChain: appended,\n workflowObjectKey: 'objectKey' in propSchema ? propSchema.objectKey : undefined,\n isVariable: 'isVariable' in propSchema ? propSchema.isVariable : false,\n };\n });\n\nconst getSupportedArrayFunctions = (\n schema: JsonSchema,\n arrayPrimitive: JsonSchemaObject,\n): string[] => {\n if (isJsonSchemaArray(schema) && schema['supportedFunctions']) {\n return schema['supportedFunctions'];\n }\n return arrayPrimitive['baseSupportedFunctions'] ?? [];\n};\n\nexport const getSchemaOptions = ({\n option,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n digPrimitives = false,\n}: {\n option: Pick<Option, 'schema' | 'methodChain'>;\n optionFilters?: OptionFilters;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n digPrimitives?: boolean;\n}): Option[] => {\n const { schema, methodChain } = option;\n const nullableRefSchema = getNonNullableRefSchema(schema);\n const baseSchema = nullableRefSchema ?? schema;\n const refResolved = isJsonSchemaRef(baseSchema)\n ? resolveJssRef(baseSchema, platformObjectJsonSchema)\n : baseSchema;\n const nonNullable = refResolved && getNonNullableType(refResolved);\n const resolvedSchema = nonNullable\n ? ({ ...refResolved, type: nonNullable } as JsonSchema)\n : refResolved;\n const schemaType = getJsonSchemaType(resolvedSchema);\n\n const schemaOptions = (() => {\n switch (schemaType) {\n case JsonSchemaAllTypes.Object:\n return buildSchemaOptionsFor(resolvedSchema as JsonSchemaObject, methodChain);\n case JsonSchemaAllTypes.Array:\n case JsonSchemaAllTypes.MultiEnum: {\n if (!digPrimitives) {\n return [];\n }\n const arrayPrimitive = primitiveUtilities[PrimitiveSchemaId.Array];\n if (!arrayPrimitive) {\n return [];\n }\n const allOptions = buildSchemaOptionsFor(arrayPrimitive, methodChain);\n const supported = getSupportedArrayFunctions(resolvedSchema, arrayPrimitive);\n return allOptions.filter((opt) => supported.includes(opt.property));\n }\n case JsonSchemaAllTypes.String:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain)\n : [];\n case JsonSchemaAllTypes.Enum: {\n if (digPrimitives && isJsonSchemaString(resolvedSchema)) {\n return buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain);\n }\n return [];\n }\n case JsonSchemaAllTypes.File:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.File], methodChain)\n : [];\n // Integer/Number share a single /schema/number bucket — see the collapse\n // in `getPrimitiveSchemaId` and the backend `JSON_TYPE_TO_SCHEMA_ID`. The\n // default mock primitives don't ship utilities for these, so the lookup\n // returns CCFs only (the only properties merged in by `useChain`).\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Number:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Number]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Number], methodChain)\n : [];\n case JsonSchemaAllTypes.Boolean:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Boolean]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Boolean], methodChain)\n : [];\n // Date and Datetime are distinct buckets, mirroring the backend\n // `PlatformPrimitive::Date` / `PlatformPrimitive::Datetime` split. A\n // calendar-only Date receiver shouldn't surface CCFs authored against\n // timezone-bearing Datetimes (or vice versa).\n case JsonSchemaAllTypes.Date:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Date]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Date], methodChain)\n : [];\n case JsonSchemaAllTypes.Datetime:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Datetime]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Datetime], methodChain)\n : [];\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Null:\n case JsonSchemaAllTypes.Relation:\n case JsonSchemaAllTypes.MaskedString:\n case JsonSchemaAllTypes.Unknown:\n return [];\n default:\n assertNever(schemaType);\n }\n })();\n\n // After a possibly-null value, offer a CCF only when its receiver schema\n // accepts null. Non-CCF members stay for nullable `type` arrays but not\n // for a nullable `$ref | null` union, whose member paths `nextLinkSchema`\n // cannot resolve.\n const possiblyNull = nullableRefSchema != null || nonNullable != null;\n const nullSafeOptions = possiblyNull\n ? schemaOptions.filter((opt) => {\n if (isFunctionSchema(opt.schema) && opt.schema.codeChainFunctionToken != null) {\n return opt.schema.acceptsNullReceiver === true;\n }\n return nullableRefSchema == null;\n })\n : schemaOptions;\n\n const containsFilters = optionFilters && !!flatten(compact(Object.values(optionFilters))).length;\n const finalOptions = containsFilters\n ? filterForAllowedSchemaOptions(nullSafeOptions, optionFilters, platformObjectJsonSchema)\n : nullSafeOptions;\n return sortBy(finalOptions, (opt: Option) => opt.property.replace(/^@/, '')) as Option[];\n};\n\nexport const formatDisplayValue = (value: any) => {\n return typeof value === 'string' ? value : trim(JSON.stringify(value, null, 1), '\"');\n};\n\n/**\n * Resolves the schema at a dotted path (e.g. \"account.birthDate\").\n * Tries direct key lookup first, then traverses into nested object .properties by path part.\n * Normalizes kebab/snake at each level for key lookup.\n */\nexport function getSchemaByPath(\n properties: Record<string, JsonSchema> | null | undefined,\n path: string,\n): JsonSchema | undefined {\n if (!properties || !path) {\n return undefined;\n }\n\n const lookup = (props: Record<string, JsonSchema>, key: string): JsonSchema | undefined =>\n props[key] ?? props[key.replace(/_/g, '-')] ?? props[key.replace(/-/g, '_')];\n\n const byFullPath = lookup(properties, path);\n if (byFullPath != null) {\n return byFullPath;\n }\n\n const i = path.indexOf('.');\n if (i === -1) {\n return undefined;\n }\n const nestedKey = path.slice(0, i);\n const rest = path.slice(i + 1);\n const next = lookup(properties, nestedKey);\n if (next == null || !isJsonSchemaObject(next) || !next.properties) {\n return undefined;\n }\n return getSchemaByPath(next.properties, rest);\n}\n\nconst parseMethodChainForJSS = (path: string): Chain | null => {\n const { methodChain, partial, valid } = parseWithPartialOption(path);\n if (!valid) {\n return null;\n }\n\n if (partial.length > 0) {\n return appendedMethodChain(methodChain, partial);\n }\n\n return methodChain;\n};\n\n/**\n * The schema resolved for a key admitted by `additionalProperties: true`: valid, with an unknown\n * type. Compared by identity (e.g. by the SmartTextInput validator), so do not copy it.\n */\nexport const UNTYPED_ADDITIONAL_PROPERTY_SCHEMA: JsonSchema = Object.freeze({});\n\n/**\n * Resolves an identifier that is not a declared property of `currentSchema` through the object's\n * `additionalProperties`: its schema when one is given, `UNTYPED_ADDITIONAL_PROPERTY_SCHEMA` when\n * it is `true`, and null when extra keys are not allowed.\n */\nconst additionalPropertySchema = (\n currentSchema: JsonSchema | null,\n link: MethodChainNode,\n platformObjectJsonSchema: ObjectSchemaMap,\n): JsonSchema | null => {\n if (currentSchema == null || !isIdentifierNode(link)) {\n return null;\n }\n const resolved = isJsonSchemaRef(currentSchema)\n ? resolveJssRef(currentSchema, platformObjectJsonSchema)\n : currentSchema;\n if (!isJsonSchemaObject(resolved) || resolved.properties?.[link.name] != null) {\n return null;\n }\n const { additionalProperties } = resolved;\n if (additionalProperties === true) {\n return UNTYPED_ADDITIONAL_PROPERTY_SCHEMA;\n }\n return typeof additionalProperties === 'object' && additionalProperties != null\n ? additionalProperties\n : null;\n};\n\nexport const getSchemaForFieldPath = ({\n path,\n initialSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n}: {\n path: string;\n initialSchema: JsonSchema;\n platformObjectJsonSchema?: ObjectSchemaMap;\n primitiveUtilities?: ObjectSchemaMap;\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n if (!initialSchema || (!('type' in initialSchema) && !('$ref' in initialSchema))) {\n return { schema: null, propertyName: null };\n }\n\n const schema: JsonSchema = isJsonSchemaRef(initialSchema)\n ? resolveJssRef(initialSchema, platformObjectJsonSchema)\n : initialSchema;\n\n if (path === '' || !isValid(path)) {\n return { schema: null, propertyName: null };\n }\n const methodChain = parseMethodChain(path);\n if (!methodChain) {\n return { schema: null, propertyName: null };\n }\n const result = methodChain.links.reduce<JsonSchema | null>((currentSchema, link) => {\n return (\n nextLinkSchema({\n currentSchema,\n nextLink: link,\n platformObjectJsonSchema,\n primitiveUtilities,\n }) ?? additionalPropertySchema(currentSchema, link, platformObjectJsonSchema)\n );\n }, schema);\n\n const propertyName = result ? last(methodChain.links)?.name || null : null;\n return { schema: result, propertyName };\n};\n\n/**\n * Get the schema for a variable path from usableObjects.\n */\nexport const getSchemaForVariablePath = ({\n path,\n usableObjects,\n}: {\n path: string;\n usableObjects: VariableSchemaObject[];\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n // just variables\n const syntheticSchema: JsonSchemaObject = {\n type: JsonSchemaTypes.Object,\n properties: Object.fromEntries(\n usableObjects\n .filter((obj) => obj.schema != null && obj.isVariable === true)\n .map((obj) => [obj.value, obj.schema!]),\n ),\n };\n\n return getSchemaForFieldPath({\n path,\n initialSchema: syntheticSchema,\n });\n};\n\nconst getPrimitiveSchemaId = (schema: JsonSchema): string | null => {\n if (!('type' in schema)) {\n return null;\n }\n // File type has special naming: 'file' -> '/schema/field/file'\n // because the backend uses Field::File.name.underscore = 'field/file'\n // File fields have type: 'object' with fieldType: 'file'\n if (isJsonSchemaObject(schema) && isFileType(schema.fieldType)) {\n return PrimitiveSchemaId.File;\n }\n // Date and Datetime are encoded as `{type: 'string', format: 'date'|'date-time'}`.\n // Check before the generic string branch so date receivers don't bucket as String.\n if (isJsonSchemaDate(schema)) {\n return PrimitiveSchemaId.Date;\n }\n if (isJsonSchemaDateTime(schema)) {\n return PrimitiveSchemaId.Datetime;\n }\n const type = Array.isArray(schema.type) ? getNonNullableType(schema) : schema.type;\n if (!type) {\n return null;\n }\n // Integer and Number share one CCF bucket — mirrors the backend collapse\n // in JSON_TYPE_TO_SCHEMA_ID. A CCF authored against a Number receiver\n // fires for both .length-style integers and float-typed values.\n if (type === JsonSchemaTypes.Integer || type === JsonSchemaTypes.Number) {\n return PrimitiveSchemaId.Number;\n }\n if (type === JsonSchemaTypes.Boolean) {\n return PrimitiveSchemaId.Boolean;\n }\n return getSchemaId(type);\n};\n\nexport const nextLinkSchema = ({\n currentSchema,\n nextLink,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n currentSchema: JsonSchema | null;\n nextLink: MethodChainNode;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): JsonSchema | null => {\n if (!currentSchema) {\n return null;\n }\n // Runtime dispatches a typed null only to a CCF whose receiver schema\n // accepts null, so a nullable value resolves only through such CCFs.\n if (nextLink.type === MethodChainNodeTypes.CustomFunction) {\n const unwrapped = getNonNullableRefSchema(currentSchema);\n const nonNullType = unwrapped ? null : getNonNullableType(currentSchema);\n const receiver =\n unwrapped ?? (nonNullType ? ({ ...currentSchema, type: nonNullType } as JsonSchema) : null);\n if (receiver) {\n const fn = getFunctionSchemaForNode({\n parentSchema: currentSchema,\n functionName: fullNodeName(nextLink),\n isCustomFunction: true,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n if (fn?.acceptsNullReceiver !== true) {\n return null;\n }\n currentSchema = receiver;\n }\n }\n if (isJsonSchemaRef(currentSchema)) {\n currentSchema = resolveJssRef(currentSchema, platformObjectJsonSchema);\n } else if (isJsonSchemaArray(currentSchema) && isJsonSchemaRef(currentSchema.items)) {\n currentSchema = {\n ...currentSchema,\n items: {\n ...resolveJssRef(currentSchema.items, platformObjectJsonSchema),\n },\n };\n }\n if (!('type' in currentSchema)) {\n return null;\n }\n\n const schemaId = getPrimitiveSchemaId(currentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilityReturnType = getPrimitiveUtilitiesReturnSchema(\n currentSchema,\n nextLink,\n primitiveUtilities[schemaId],\n );\n if (utilityReturnType) {\n return utilityReturnType;\n }\n }\n if ('properties' in currentSchema) {\n const propertySchema = currentSchema.properties[fullNodeName(nextLink)];\n if (propertySchema && isFunctionSchema(propertySchema)) {\n return propertySchema.properties.returnType;\n }\n return propertySchema ?? null;\n }\n return null;\n};\n\n/**\n * Returns the FunctionJsonSchema for `functionName` within `parentSchema`, checking both\n * primitive utilities (e.g. array/string methods) and direct object properties.\n * Returns null if not found or not a function schema.\n */\nexport const getFunctionSchemaForNode = ({\n parentSchema,\n functionName,\n isCustomFunction,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n parentSchema: JsonSchema;\n functionName: string;\n isCustomFunction: boolean;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): FunctionJsonSchema | null => {\n if (isCustomFunction) {\n parentSchema = getNonNullableRefSchema(parentSchema) ?? parentSchema;\n }\n if (isJsonSchemaRef(parentSchema)) {\n parentSchema = resolveJssRef(parentSchema, platformObjectJsonSchema);\n }\n\n const schemaId = getPrimitiveSchemaId(parentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilitySchema = primitiveUtilities[schemaId].properties[functionName];\n if (utilitySchema && isFunctionSchema(utilitySchema)) {\n return utilitySchema;\n }\n }\n\n if (isJsonSchemaObject(parentSchema) && functionName in parentSchema.properties) {\n const propSchema = parentSchema.properties[functionName];\n if (isFunctionSchema(propSchema)) {\n return propSchema;\n }\n }\n\n return null;\n};\n\n// When the result is an array of platform objects (identified by objectKey on items),\n// inject a $ref so the schema structure matches has_many associations.\n// This ensures consistent operator options in conditionals.\nconst injectRefForPlatformObjectArray = (schema: JsonSchema | null): JsonSchema | null => {\n if (\n schema &&\n isJsonSchemaArray(schema) &&\n isJsonSchemaObject(schema.items) &&\n 'objectKey' in schema.items &&\n schema.items.objectKey\n ) {\n const schemaId = getSchemaId(schema.items.objectKey, MERGED_SCHEMA_ID);\n return {\n ...schema,\n items: {\n ...schema.items,\n $ref: schemaId,\n },\n };\n }\n return schema;\n};\n\nconst getPrimitiveUtilitiesReturnSchema = (\n object: JsonSchema,\n node: MethodChainNode,\n schema: JsonSchemaObject<JsonSchema | FunctionJsonSchema>,\n): JsonSchema | null => {\n const name = fullNodeName(node);\n if (!(name in schema.properties)) {\n return null;\n }\n\n const utilitySchema = schema.properties[name];\n\n const returnSchema = isFunctionSchema(utilitySchema)\n ? utilitySchema.properties.returnType\n : utilitySchema;\n\n const itemSchema = genericArrayItemSchema(object, returnSchema);\n if (itemSchema) {\n return itemSchema;\n }\n\n if (isPrecedingSchema(returnSchema)) {\n return object;\n }\n\n if (\n isConvertedTypeSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n return returnSchema.schemaByValue[stringNode.value] ?? EMPTY_JSON_SCHEMA_OBJECT;\n }\n\n if (\n isGenericParameterSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n const objectSchema = isJsonSchemaArray(object) ? object.items : object;\n if (isJsonSchemaObject(objectSchema)) {\n const path = stringNode.value.split('.');\n const resultSchema = path.reduce<JsonSchema | null>((schema, key) => {\n if (schema == null || !isJsonSchemaObject(schema) || !schema.properties[key]) {\n return null;\n }\n return schema.properties[key];\n }, objectSchema);\n\n return injectRefForPlatformObjectArray(resultSchema);\n }\n }\n\n return 'genericType' in returnSchema ? EMPTY_JSON_SCHEMA_OBJECT : returnSchema;\n};\n\n/**\n * @param path\n * @param allowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n * @param fieldPathsAreStrictMatch - true if we only want to match exact paths in allowedFieldPaths and disallowedFieldPaths\n */\nconst isAllowedPath = (path: string, allowedFieldPaths: string[]) => {\n return allowedFieldPaths.some((fieldPath) => {\n const valueIsPartialMatch = fieldPath.startsWith(path);\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsPartialMatch || valueIsNestedProp;\n });\n};\n\n/**\n * @param path\n * @param disallowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n */\nconst isDisallowedPath = (path: string, disallowedFieldPaths: string[]) => {\n return disallowedFieldPaths.some((fieldPath) => {\n const valueIsMatch = fieldPath === path;\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsMatch || valueIsNestedProp;\n });\n};\n\nexport const isTypeMatch = ({\n fieldJsonSchema,\n types,\n platformObjectJsonSchema = {},\n arrayTypes,\n traversedSchemaIds = new Set(),\n}: {\n fieldJsonSchema: JsonSchema;\n types: PossibleType[];\n platformObjectJsonSchema: ObjectSchemaMap;\n arrayTypes?: PossibleArrayType[];\n traversedSchemaIds?: Set<string>;\n}): boolean => {\n const resolvedSchema = isJsonSchemaRef(fieldJsonSchema)\n ? resolveJssRef(fieldJsonSchema, platformObjectJsonSchema)\n : fieldJsonSchema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n\n const fieldJsonSchemaType = getJsonSchemaType(resolvedSchema);\n switch (fieldJsonSchemaType) {\n case JsonSchemaAllTypes.Object: {\n const objectSchema = resolvedSchema as JsonSchemaObject;\n // For generic JsonSchemaObjectKey such as 'report' or 'verification', we match on subtypes\n // like 'business-watchlist' as well; otherwise, generics don't show anything\n const isObjectKeyOfType = (type: JsonSchemaObjectKey) =>\n objectSchema.objectKey &&\n types.includes(type) &&\n objectSchema.objectKey.split('/')[0] === type;\n\n if (\n types.includes(JsonSchemaTypes.Object) ||\n (objectSchema.objectKey && types.includes(objectSchema.objectKey)) ||\n isObjectKeyOfType('report') ||\n isObjectKeyOfType('verification')\n ) {\n return true;\n }\n\n return Object.values(objectSchema.properties || {}).some((propJsonSchema) =>\n isTypeMatch({\n fieldJsonSchema: propJsonSchema,\n types,\n platformObjectJsonSchema,\n arrayTypes,\n traversedSchemaIds: traversedSchemaIds,\n }),\n );\n }\n case JsonSchemaAllTypes.Array: {\n const arraySchema = resolvedSchema as JsonSchemaArray;\n const itemSchema = isJsonSchemaRef(arraySchema.items)\n ? resolveJssRef(arraySchema.items, platformObjectJsonSchema)\n : arraySchema.items;\n return (\n types.includes(JsonSchemaAllTypes.Array) &&\n // Don't recurse on array, otherwise we risk matching on objects within the array\n !!arrayTypes &&\n arrayTypes.some(\n (schemaType) =>\n schemaType === getJsonSchemaType(itemSchema) ||\n (isJsonSchemaObject(itemSchema) && schemaType === itemSchema.objectKey),\n )\n );\n }\n case JsonSchemaAllTypes.String:\n case JsonSchemaAllTypes.Number:\n case JsonSchemaAllTypes.Boolean:\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Date:\n case JsonSchemaAllTypes.Datetime:\n case JsonSchemaAllTypes.Enum:\n case JsonSchemaAllTypes.MultiEnum:\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Unknown: {\n return types.some((schemaType) => schemaType === fieldJsonSchemaType);\n }\n default:\n return false;\n }\n};\n\nexport interface OptionFilters {\n allowedArrayTypes?: PossibleArrayType[];\n allowedFieldPaths?: string[];\n allowedTypes?: PossibleType[];\n disallowedFieldPaths?: string[];\n fieldPathsAreStrictMatch?: boolean;\n requiredPropertyShape?: string[]; // Array of property names that must exist in the schema\n}\n\nexport const hasRequiredPropertyShape = (\n schema: JsonSchema,\n requiredPropertyShape: string[],\n platformObjectJsonSchema: ObjectSchemaMap = {},\n checkRecursively: boolean = true,\n): boolean => {\n if (!requiredPropertyShape?.length) {\n return true;\n }\n\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (\n resolvedSchema &&\n 'type' in resolvedSchema &&\n resolvedSchema.type === JsonSchemaTypes.Object &&\n 'properties' in resolvedSchema &&\n resolvedSchema.properties\n ) {\n const schemaProperties = resolvedSchema.properties as Record<string, JsonSchema>;\n const hasAllProperties = requiredPropertyShape.every(\n (propName) => propName in schemaProperties,\n );\n\n if (hasAllProperties) {\n return true;\n }\n\n if (checkRecursively) {\n return Object.values(schemaProperties).some((propSchema) =>\n hasRequiredPropertyShape(\n propSchema,\n requiredPropertyShape,\n platformObjectJsonSchema,\n checkRecursively,\n ),\n );\n }\n }\n return false;\n};\n\nconst filterForAllowedSchemaOptions = (\n options: Option[] = [],\n {\n allowedArrayTypes,\n allowedFieldPaths,\n allowedTypes,\n disallowedFieldPaths,\n fieldPathsAreStrictMatch,\n requiredPropertyShape,\n }: OptionFilters,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n) => {\n let filteredOptions = options;\n\n if (fieldPathsAreStrictMatch) {\n if (allowedFieldPaths?.length || disallowedFieldPaths?.length || allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isValidOption(\n option.schema,\n allowedFieldPaths ?? [],\n disallowedFieldPaths ?? [],\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n option.value.split('.'),\n platformObjectJsonSchema,\n ),\n );\n }\n } else {\n if (allowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isAllowedPath(option.value, allowedFieldPaths),\n );\n }\n if (disallowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter(\n (option) => !isDisallowedPath(option.value, disallowedFieldPaths),\n );\n }\n if (allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isTypeMatch({\n fieldJsonSchema: option.schema,\n types: allowedTypes,\n platformObjectJsonSchema,\n arrayTypes: allowedArrayTypes,\n }),\n );\n }\n }\n\n // Add a recursive function to check if schema or any nested schema has the required properties\n if (requiredPropertyShape?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n hasRequiredPropertyShape(option.schema, requiredPropertyShape, platformObjectJsonSchema),\n );\n }\n\n return filteredOptions;\n};\n\nexport const getOptionForValue = ({\n value,\n jsonSchema,\n schemaForFieldPath,\n}: {\n value: string;\n jsonSchema: JsonSchema;\n schemaForFieldPath: (\n path: string,\n initialSchema: JsonSchema,\n ) => { schema: JsonSchema | null; propertyName: string | null };\n}): Option | null => {\n const { schema, propertyName } = schemaForFieldPath(value, jsonSchema);\n if (!schema || !propertyName) {\n return null;\n }\n\n const methodChain = parseMethodChainForJSS(value);\n return {\n label: methodChain ? methodChainToString(methodChain) : value,\n value: methodChain ? methodChainToString(methodChain) : value,\n property: propertyName,\n schema,\n methodChain,\n };\n};\n\nexport const validatePath = ({\n path,\n jsonSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n optionFilters,\n}: {\n path: string;\n jsonSchema: JsonSchema;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n optionFilters?: OptionFilters;\n}) => {\n const schemaOptions = getSchemaOptions({\n option: { schema: jsonSchema, methodChain: parseMethodChainForJSS('') },\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n const { methodChain, partial } = parseWithPartialOption(path);\n\n const matchedSchemaOptions = methodChain.links.reduce<Option[]>((currentSchema, link) => {\n if (currentSchema.length === 0) {\n return [];\n }\n const optionMatch = currentSchema.find((option) => option.property === link.name);\n if (optionMatch) {\n return getSchemaOptions({\n option: optionMatch,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n }\n return [];\n }, schemaOptions);\n\n const optionsWithPartiallyMatchedFinalLink = matchedSchemaOptions.filter((option) =>\n option.property.includes(partial),\n );\n return {\n valid: optionsWithPartiallyMatchedFinalLink.length > 0,\n schemaOptions: optionsWithPartiallyMatchedFinalLink,\n partial,\n };\n};\n\n/**\n * Given a method chain that corresponds to the passed schema, find the right-most indentifier that\n * is a platform object and split the method chain on that identifier, with the platform object on\n * the left side.\n *\n * This function is used to optimize a method chain into two parts, left side for server resolution\n * and right side for client resolution.\n *\n * For example:\n * current_case.fields.field_a -> ['current_case', 'fields.field_a']\n * current_case.inquiries.first.id -> ['current_case.inquiries.first', 'id']\n * current_case.account.fields.field_b -> ['current_case.account', 'fields.field_b']\n */\nexport const splitAtNearestParentObject = (\n chain: Chain,\n currentSchema: JsonSchemaObject,\n platformSchemaMap: ObjectSchemaMap,\n primitiveUtilities: ObjectSchemaMap,\n): [leftChain: Chain, rightChain: Chain] => {\n // Create a list of schemas that match each link in the method chain.\n // The list is reversed such that the first schema matches the last link of the method chain\n // for the next step.\n const leafUpLinkSchemas: (JsonSchema | null)[] = [currentSchema];\n for (const link of chain.links) {\n const nextSchema = nextLinkSchema({\n currentSchema: leafUpLinkSchemas[0],\n nextLink: link,\n platformObjectJsonSchema: platformSchemaMap,\n primitiveUtilities,\n });\n leafUpLinkSchemas.unshift(nextSchema);\n }\n\n // List of links that correspond to the left and right sides of the split.\n // As we walk the schema from leaf to root, we move links to the right side.\n const leafUpLeftLinks = [...chain.links].reverse();\n const leafUpRightLinks: typeof leafUpLeftLinks = [];\n\n for (const [i, linkSchema] of leafUpLinkSchemas.entries()) {\n if (!linkSchema) {\n // When the schema is unknown, check if the current link is an identifier accessing a\n // property on an unresolvable platform object ref. If any remaining schema in the\n // ancestor chain is a $ref (or array of $refs), we're within a platform object whose\n // schema couldn't be resolved — push the identifier to the client (right) side.\n if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nearestPlatformAncestor = leafUpLinkSchemas\n .slice(i + 1)\n .find(\n (s) => s && (isJsonSchemaRef(s) || (isJsonSchemaArray(s) && isJsonSchemaRef(s.items))),\n );\n if (nearestPlatformAncestor) {\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n continue;\n }\n }\n // If we are missing schema, break out asap to keep links on the left.\n break;\n } else if ('$id' in linkSchema || isJsonSchemaRef(linkSchema)) {\n break;\n } else if (isJsonSchemaArray(linkSchema)) {\n if ('$id' in linkSchema.items || isJsonSchemaRef(linkSchema.items)) {\n break;\n }\n // Array-returning functions (filter, sort, etc.) on platform object arrays\n // must be resolved server-side even when the items ref cannot be resolved.\n if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n }\n } else if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n } else if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nextSchema = leafUpLinkSchemas[i + 1];\n // If the preceding schema has a primitive schema ID in the utilities, the identifier\n // was resolved via primitive utilities (e.g. 'trim' on a string, 'count' on an array).\n // The server handles these inline, so keep the whole chain server-side.\n if (nextSchema) {\n const primitiveId = getPrimitiveSchemaId(nextSchema);\n if (primitiveId && primitiveId in primitiveUtilities) {\n break;\n }\n }\n // Real special case here. If:\n // - The current link is an identifier\n // - The next schema is an array\n // = break out, because we don't want to load the whole array into the client\n if (nextSchema && isJsonSchemaArray(nextSchema)) {\n break;\n }\n }\n\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n }\n\n const leftChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpLeftLinks.reverse(),\n };\n const rightChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpRightLinks.reverse(),\n };\n return [leftChain, rightChain];\n};\n"],"mappings":";;;;;;AA6DA,MAAM,gBAAgB,SACpB,GAAG,KAAK,SAAS,qBAAqB,iBAAiB,MAAM,KAAK,KAAK;AAazE,MAAM,sBAAsB;;;;;;;AAQ5B,MAAa,4BACX,QACA,2BAA4C,EAAE,KAC5B;AAClB,KAAI,CAAC,OACH,QAAO;AAET,KAAI,gBAAgB,OAAO,EAAE;EAC3B,MAAM,WAAW,OAAO,MAAM,MAAM,oBAAoB;AACxD,MAAI,SACF,QAAO,SAAS;AAElB,SAAO,yBACL,cAAc,QAAQ,yBAAyB,EAC/C,yBACD;;AAEH,KAAI,SAAS,UAAU,OAAO,OAAO,QAAQ,UAAU;EACrD,MAAM,UAAU,OAAO,IAAI,MAAM,oBAAoB;AACrD,MAAI,QACF,QAAO,QAAQ;;AAKnB,KAAI,eAAe,UAAU,OAAO,OAAO,cAAc,SACvD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I,CAAC,YAAY;AAKf,OAAI,iBAAiB,gBAAgB,GAAG;QACN,kBAC7B,MAAM,IAAI,EAAE,CACZ,MACE,MAAM,MAAM,gBAAgB,EAAE,IAAK,kBAAkB,EAAE,IAAI,gBAAgB,EAAE,MAAM,EAE7D,EAAE;AAC3B,sBAAiB,KAAK,gBAAgB,OAAO,CAAE;AAC/C;;;AAIJ;aACS,SAAS,cAAc,gBAAgB,WAAW,CAC3D;WACS,kBAAkB,WAAW,EAAE;AACxC,OAAI,SAAS,WAAW,SAAS,gBAAgB,WAAW,MAAM,CAChE;AAIF,OAAI,eAAe,gBAAgB,GAAG,CACpC;aAEO,eAAe,gBAAgB,GAAG,CAC3C;WACS,iBAAiB,gBAAgB,GAAG,EAAE;GAC/C,MAAM,aAAa,kBAAkB,IAAI;AAIzC,OAAI,YAAY;IACd,MAAM,cAAc,qBAAqB,WAAW;AACpD,QAAI,eAAe,eAAe,mBAChC;;AAOJ,OAAI,cAAc,kBAAkB,WAAW,CAC7C;;AAIJ,mBAAiB,KAAK,gBAAgB,OAAO,CAAE;;AAWjD,QAAO,CAAC;EAPN,MAAM,qBAAqB;EAC3B,OAAO,gBAAgB,SAAS;EAMjB,EAAE;EAHjB,MAAM,qBAAqB;EAC3B,OAAO,iBAAiB,SAAS;EAEN,CAAC"}
1
+ {"version":3,"file":"schemaOptions.mjs","names":[],"sources":["../../src/lib/schemaOptions.ts"],"sourcesContent":["import { compact, flatten, last, sortBy, trim } from 'lodash-es';\n\nimport { assertNever } from './assertNever';\nimport {\n JsonSchemaAllTypes,\n type JsonSchemaCustomTypes,\n JsonSchemaStringifiableTypes,\n EMPTY_JSON_SCHEMA_OBJECT,\n getNonNullableRefSchema,\n genericArrayItemSchema,\n getNonNullableType,\n isConvertedTypeSchema,\n isFileType,\n isFunctionSchema,\n isGenericParameterSchema,\n isJsonSchemaArray,\n isJsonSchemaDate,\n isJsonSchemaDateTime,\n isJsonSchemaObject,\n isJsonSchemaRef,\n isJsonSchemaString,\n isJsonType,\n isPrecedingSchema,\n type JsonSchema,\n type JsonSchemaArray,\n type JsonSchemaBasicTypes,\n type JsonSchemaObject,\n JsonSchemaTypes,\n type JsonSchemaObjectKey,\n} from './jsonSchema';\nimport { getJsonSchemaType } from './jsonSchemaType';\nimport {\n appendedMethodChain,\n type Chain,\n EMPTY_METHOD_CHAIN,\n isIdentifierNode,\n isFunctionNode,\n isStringNode,\n isValid,\n type MethodChainNode,\n MethodChainNodeTypes,\n methodChainToString,\n parseMethodChain,\n parseWithPartialOption,\n type StringNode,\n} from './methodChain';\nimport type { FunctionJsonSchema, ObjectSchemaMap } from './objectSchemaTypes';\nimport {\n getPlatformObjectTypeFromJsonSchema,\n getSchemaId,\n MERGED_SCHEMA_ID,\n PrimitiveSchemaId,\n resolveJssRef,\n} from './platformObject';\n\ntype VariableSchemaObject = {\n value: string;\n schema?: JsonSchema | null;\n isVariable?: boolean;\n};\n\nconst fullNodeName = (node: MethodChainNode): string =>\n `${node.type === MethodChainNodeTypes.CustomFunction ? '@' : ''}${node.name}`;\n\nexport type Option = {\n label: string;\n value: string;\n property: string;\n schema: JsonSchema | FunctionJsonSchema;\n methodChain: Chain | null;\n utility?: boolean;\n workflowObjectKey?: string;\n isVariable?: boolean;\n};\n\nconst SCHEMA_PATH_PATTERN = /\\/schema\\/([a-z][a-z0-9-_]*)/i;\n\n/**\n * Extracts the top-level platform-object key from a schema's `$ref`/`$id`/\n * `objectKey`/`objectType.const` markers. Collapses subtypes to their root\n * (`/schema/verification/document/merged` -> `verification`) because callers\n * compare against top-level `ApiModel` values.\n */\nexport const extractPlatformObjectKey = (\n schema: JsonSchema | null | undefined,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n): string | null => {\n if (!schema) {\n return null;\n }\n if (isJsonSchemaRef(schema)) {\n const refMatch = schema.$ref?.match(SCHEMA_PATH_PATTERN);\n if (refMatch) {\n return refMatch[1];\n }\n return extractPlatformObjectKey(\n resolveJssRef(schema, platformObjectJsonSchema),\n platformObjectJsonSchema,\n );\n }\n if ('$id' in schema && typeof schema.$id === 'string') {\n const idMatch = schema.$id.match(SCHEMA_PATH_PATTERN);\n if (idMatch) {\n return idMatch[1];\n }\n }\n // Serialized PLOB columns carry `objectKey` on a scalar schema (no `$ref`), so\n // read it regardless of `type`, collapsing subtypes to root like the `$ref` branch.\n if ('objectKey' in schema && typeof schema.objectKey === 'string') {\n return schema.objectKey.split('/')[0];\n }\n return getPlatformObjectTypeFromJsonSchema(schema);\n};\n\ntype PossibleType = JsonSchemaTypes | JsonSchemaCustomTypes | JsonSchemaObjectKey;\ntype PossibleArrayType = JsonSchemaBasicTypes | JsonSchemaTypes.Object | JsonSchemaObjectKey;\n\nconst isMatchingType = (\n schema: JsonSchema,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n) => {\n if (allowedTypes.length === 0) {\n return true;\n }\n const jsonSchemaType = getJsonSchemaType(schema);\n // If strings are allowed and the field is string-able, let it through.\n if (\n allowedTypes.some((schemaType) => schemaType === JsonSchemaTypes.String) &&\n JsonSchemaStringifiableTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return true;\n } else if (jsonSchemaType === JsonSchemaAllTypes.Array) {\n const itemsSchema = 'items' in schema ? schema.items : null;\n if (\n !allowedTypes.includes(JsonSchemaAllTypes.Array) ||\n // Don't recurse on array, otherwise we risk matching on objects within the array\n (allowedArrayTypes?.length &&\n !allowedArrayTypes.some((schemaType) => schemaType === getJsonSchemaType(itemsSchema)))\n ) {\n return false;\n }\n } else if (\n jsonSchemaType !== JsonSchemaAllTypes.Object &&\n !allowedTypes.some((schemaType) => schemaType === jsonSchemaType)\n ) {\n return false;\n }\n return true;\n};\n\n// isValidOptionHelper returns true if the schema provided is (in order of precedence)\n// 1) not a disallowed by name\n// AND 2) not a disallowed type\n// AND 3) allowed field by name (either explicitly or implicitly)\n// at each level (we recurse down for object types), we check that the fields at the level fit the above 1,2 and 3\n//\n// 1) is straight forward. if a field is named as disallowed it has the most precedence\n// 2) the field is disallowed by type if the allowedTypes are specified AND\n// - if the field is an array, then\n// - arrays are in allowedTypes\n// - AND (its `items` type is in `allowedArrayTypes` OR `allowedArrayTypes` is empty)\n// - if the field is an object, we do nothing since the recursion is handled at the `isValidOptionHelper` level\n// - else, the field type appears in allowedTypes\n// 3) we can be allowed by name\n// - explicitly, which means the field is named explicitly as an allowedFieldPath (this has precedence)\n// - implicitly, which means that there are no fields explicitly named in allowedFieldPath\n// - an object field can be allowed implicitly if it has at least one valid children\nconst isValidOptionHelper = (\n schema: JsonSchema,\n allowedFieldPaths: Set<string>,\n disallowedFieldPaths: Set<string>,\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[],\n platformObjectJsonSchema: ObjectSchemaMap,\n traversedSchemaIds = new Set(),\n): boolean => {\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n const dotPath = path.join('.');\n if (disallowedFieldPaths.has(dotPath)) {\n return false;\n }\n if (!isMatchingType(resolvedSchema, allowedTypes, allowedArrayTypes)) {\n return false;\n }\n if (allowedFieldPaths.has(dotPath)) {\n return true;\n }\n // if we are here it means\n // - our type is valid\n // - we are not disallowed\n // - we are not explicitly allowed\n // if we are here, we are only valid if\n // - we are an object and at least one of our properties are valid\n // OR, we are not an object and allowedFieldPaths is empty\n const jsonSchemaType = getJsonSchemaType(resolvedSchema);\n if (jsonSchemaType === JsonSchemaTypes.Object) {\n // A schemaless JSON field is an opaque leaf, so it has no child to qualify it as an option.\n if ('fieldType' in resolvedSchema && isJsonType(resolvedSchema.fieldType)) {\n return allowedFieldPaths.size === 0;\n }\n return (\n 'properties' in resolvedSchema &&\n resolvedSchema.properties != null &&\n Object.entries(resolvedSchema.properties).some(([prop, propSchema]) =>\n isValidOptionHelper(\n propSchema,\n allowedFieldPaths,\n disallowedFieldPaths,\n allowedTypes,\n allowedArrayTypes,\n [...path, prop],\n platformObjectJsonSchema,\n traversedSchemaIds,\n ),\n )\n );\n }\n return allowedFieldPaths.size === 0;\n};\n\nexport const isValidOption = (\n schema: JsonSchema,\n allowedFieldPaths: string[],\n disallowedFieldPaths: string[],\n allowedTypes: PossibleType[],\n allowedArrayTypes: PossibleArrayType[],\n path: string[] = [],\n platformObjectJsonSchema: ObjectSchemaMap,\n): boolean => {\n const allowedFieldPathsSet =\n allowedFieldPaths == null ? new Set<string>() : new Set<string>(allowedFieldPaths);\n const disallowedFieldPathsSet =\n disallowedFieldPaths == null ? new Set<string>() : new Set<string>(disallowedFieldPaths);\n if (\n allowedFieldPathsSet.size === 0 &&\n disallowedFieldPathsSet.size === 0 &&\n allowedTypes.length === 0 &&\n allowedArrayTypes.length === 0\n ) {\n return true;\n }\n return isValidOptionHelper(\n schema,\n allowedFieldPathsSet,\n disallowedFieldPathsSet,\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n path,\n platformObjectJsonSchema,\n );\n};\n\nconst buildSchemaOptionsFor = (rootSchema: JsonSchemaObject, baseChain: Chain | null) =>\n Object.entries(rootSchema?.properties ?? {}).map(([property, propSchema]) => {\n const appended = appendedMethodChain(baseChain ?? EMPTY_METHOD_CHAIN, property);\n return {\n label: methodChainToString(appended),\n value: methodChainToString(appended),\n property,\n schema: propSchema,\n methodChain: appended,\n workflowObjectKey: 'objectKey' in propSchema ? propSchema.objectKey : undefined,\n isVariable: 'isVariable' in propSchema ? propSchema.isVariable : false,\n };\n });\n\nconst getSupportedArrayFunctions = (\n schema: JsonSchema,\n arrayPrimitive: JsonSchemaObject,\n): string[] => {\n if (isJsonSchemaArray(schema) && schema['supportedFunctions']) {\n return schema['supportedFunctions'];\n }\n return arrayPrimitive['baseSupportedFunctions'] ?? [];\n};\n\nexport const getSchemaOptions = ({\n option,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n digPrimitives = false,\n}: {\n option: Pick<Option, 'schema' | 'methodChain'>;\n optionFilters?: OptionFilters;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n digPrimitives?: boolean;\n}): Option[] => {\n const { schema, methodChain } = option;\n const nullableRefSchema = getNonNullableRefSchema(schema);\n const baseSchema = nullableRefSchema ?? schema;\n const refResolved = isJsonSchemaRef(baseSchema)\n ? resolveJssRef(baseSchema, platformObjectJsonSchema)\n : baseSchema;\n const nonNullable = refResolved && getNonNullableType(refResolved);\n const resolvedSchema = nonNullable\n ? ({ ...refResolved, type: nonNullable } as JsonSchema)\n : refResolved;\n const schemaType = getJsonSchemaType(resolvedSchema);\n\n const schemaOptions = (() => {\n switch (schemaType) {\n case JsonSchemaAllTypes.Object:\n return buildSchemaOptionsFor(resolvedSchema as JsonSchemaObject, methodChain);\n case JsonSchemaAllTypes.Array:\n case JsonSchemaAllTypes.MultiEnum: {\n if (!digPrimitives) {\n return [];\n }\n const arrayPrimitive = primitiveUtilities[PrimitiveSchemaId.Array];\n if (!arrayPrimitive) {\n return [];\n }\n const allOptions = buildSchemaOptionsFor(arrayPrimitive, methodChain);\n const supported = getSupportedArrayFunctions(resolvedSchema, arrayPrimitive);\n return allOptions.filter((opt) => supported.includes(opt.property));\n }\n case JsonSchemaAllTypes.String:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain)\n : [];\n case JsonSchemaAllTypes.Enum: {\n if (digPrimitives && isJsonSchemaString(resolvedSchema)) {\n return buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.String], methodChain);\n }\n return [];\n }\n case JsonSchemaAllTypes.File:\n return digPrimitives\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.File], methodChain)\n : [];\n // Integer/Number share a single /schema/number bucket — see the collapse\n // in `getPrimitiveSchemaId` and the backend `JSON_TYPE_TO_SCHEMA_ID`. The\n // default mock primitives don't ship utilities for these, so the lookup\n // returns CCFs only (the only properties merged in by `useChain`).\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Number:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Number]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Number], methodChain)\n : [];\n case JsonSchemaAllTypes.Boolean:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Boolean]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Boolean], methodChain)\n : [];\n // Date and Datetime are distinct buckets, mirroring the backend\n // `PlatformPrimitive::Date` / `PlatformPrimitive::Datetime` split. A\n // calendar-only Date receiver shouldn't surface CCFs authored against\n // timezone-bearing Datetimes (or vice versa).\n case JsonSchemaAllTypes.Date:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Date]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Date], methodChain)\n : [];\n case JsonSchemaAllTypes.Datetime:\n return digPrimitives && primitiveUtilities[PrimitiveSchemaId.Datetime]\n ? buildSchemaOptionsFor(primitiveUtilities[PrimitiveSchemaId.Datetime], methodChain)\n : [];\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Null:\n case JsonSchemaAllTypes.Relation:\n case JsonSchemaAllTypes.MaskedString:\n case JsonSchemaAllTypes.Unknown:\n return [];\n default:\n assertNever(schemaType);\n }\n })();\n\n // After a possibly-null value, offer a CCF only when its receiver schema\n // accepts null. Non-CCF members stay for nullable `type` arrays but not\n // for a nullable `$ref | null` union, whose member paths `nextLinkSchema`\n // cannot resolve.\n const possiblyNull = nullableRefSchema != null || nonNullable != null;\n const nullSafeOptions = possiblyNull\n ? schemaOptions.filter((opt) => {\n if (isFunctionSchema(opt.schema) && opt.schema.codeChainFunctionToken != null) {\n return opt.schema.acceptsNullReceiver === true;\n }\n return nullableRefSchema == null;\n })\n : schemaOptions;\n\n const containsFilters = optionFilters && !!flatten(compact(Object.values(optionFilters))).length;\n const finalOptions = containsFilters\n ? filterForAllowedSchemaOptions(nullSafeOptions, optionFilters, platformObjectJsonSchema)\n : nullSafeOptions;\n return sortBy(finalOptions, (opt: Option) => opt.property.replace(/^@/, '')) as Option[];\n};\n\nexport const formatDisplayValue = (value: any) => {\n return typeof value === 'string' ? value : trim(JSON.stringify(value, null, 1), '\"');\n};\n\n/**\n * Resolves the schema at a dotted path (e.g. \"account.birthDate\").\n * Tries direct key lookup first, then traverses into nested object .properties by path part.\n * Normalizes kebab/snake at each level for key lookup.\n */\nexport function getSchemaByPath(\n properties: Record<string, JsonSchema> | null | undefined,\n path: string,\n): JsonSchema | undefined {\n if (!properties || !path) {\n return undefined;\n }\n\n const lookup = (props: Record<string, JsonSchema>, key: string): JsonSchema | undefined =>\n props[key] ?? props[key.replace(/_/g, '-')] ?? props[key.replace(/-/g, '_')];\n\n const byFullPath = lookup(properties, path);\n if (byFullPath != null) {\n return byFullPath;\n }\n\n const i = path.indexOf('.');\n if (i === -1) {\n return undefined;\n }\n const nestedKey = path.slice(0, i);\n const rest = path.slice(i + 1);\n const next = lookup(properties, nestedKey);\n if (next == null || !isJsonSchemaObject(next) || !next.properties) {\n return undefined;\n }\n return getSchemaByPath(next.properties, rest);\n}\n\nconst parseMethodChainForJSS = (path: string): Chain | null => {\n const { methodChain, partial, valid } = parseWithPartialOption(path);\n if (!valid) {\n return null;\n }\n\n if (partial.length > 0) {\n return appendedMethodChain(methodChain, partial);\n }\n\n return methodChain;\n};\n\n/**\n * The schema resolved for a key admitted by `additionalProperties: true`: valid, with an unknown\n * type. Compared by identity (e.g. by the SmartTextInput validator), so do not copy it.\n */\nexport const UNTYPED_ADDITIONAL_PROPERTY_SCHEMA: JsonSchema = Object.freeze({});\n\n/**\n * Resolves an identifier that is not a declared property of `currentSchema` through the object's\n * `additionalProperties`: its schema when one is given, `UNTYPED_ADDITIONAL_PROPERTY_SCHEMA` when\n * it is `true`, and null when extra keys are not allowed.\n */\nconst additionalPropertySchema = (\n currentSchema: JsonSchema | null,\n link: MethodChainNode,\n platformObjectJsonSchema: ObjectSchemaMap,\n): JsonSchema | null => {\n if (currentSchema == null || !isIdentifierNode(link)) {\n return null;\n }\n const resolved = isJsonSchemaRef(currentSchema)\n ? resolveJssRef(currentSchema, platformObjectJsonSchema)\n : currentSchema;\n if (!isJsonSchemaObject(resolved) || resolved.properties?.[link.name] != null) {\n return null;\n }\n const { additionalProperties } = resolved;\n if (additionalProperties === true) {\n return UNTYPED_ADDITIONAL_PROPERTY_SCHEMA;\n }\n return typeof additionalProperties === 'object' && additionalProperties != null\n ? additionalProperties\n : null;\n};\n\nexport const getSchemaForFieldPath = ({\n path,\n initialSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n}: {\n path: string;\n initialSchema: JsonSchema;\n platformObjectJsonSchema?: ObjectSchemaMap;\n primitiveUtilities?: ObjectSchemaMap;\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n if (!initialSchema || (!('type' in initialSchema) && !('$ref' in initialSchema))) {\n return { schema: null, propertyName: null };\n }\n\n const schema: JsonSchema = isJsonSchemaRef(initialSchema)\n ? resolveJssRef(initialSchema, platformObjectJsonSchema)\n : initialSchema;\n\n if (path === '' || !isValid(path)) {\n return { schema: null, propertyName: null };\n }\n const methodChain = parseMethodChain(path);\n if (!methodChain) {\n return { schema: null, propertyName: null };\n }\n const result = methodChain.links.reduce<JsonSchema | null>((currentSchema, link) => {\n return (\n nextLinkSchema({\n currentSchema,\n nextLink: link,\n platformObjectJsonSchema,\n primitiveUtilities,\n }) ?? additionalPropertySchema(currentSchema, link, platformObjectJsonSchema)\n );\n }, schema);\n\n const propertyName = result ? last(methodChain.links)?.name || null : null;\n return { schema: result, propertyName };\n};\n\n/**\n * Get the schema for a variable path from usableObjects.\n */\nexport const getSchemaForVariablePath = ({\n path,\n usableObjects,\n}: {\n path: string;\n usableObjects: VariableSchemaObject[];\n}): {\n schema: JsonSchema | null;\n propertyName: string | null;\n} => {\n // just variables\n const syntheticSchema: JsonSchemaObject = {\n type: JsonSchemaTypes.Object,\n properties: Object.fromEntries(\n usableObjects\n .filter((obj) => obj.schema != null && obj.isVariable === true)\n .map((obj) => [obj.value, obj.schema!]),\n ),\n };\n\n return getSchemaForFieldPath({\n path,\n initialSchema: syntheticSchema,\n });\n};\n\nconst getPrimitiveSchemaId = (schema: JsonSchema): string | null => {\n if (!('type' in schema)) {\n return null;\n }\n // The object/date/date-time guards match an exact scalar `type`, so narrow an exactly-nullable\n // union to its non-null member first. The cast mirrors `nextLinkSchema`'s receiver narrowing:\n // spreading a union member with a different `type` can't be expressed as a `JsonSchema` member.\n const nonNullableType = Array.isArray(schema.type) ? getNonNullableType(schema) : null;\n const narrowedSchema = nonNullableType\n ? ({ ...schema, type: nonNullableType } as JsonSchema)\n : schema;\n // File type has special naming: 'file' -> '/schema/field/file'\n // because the backend uses Field::File.name.underscore = 'field/file'\n // File fields have type: 'object' with fieldType: 'file'\n if (isJsonSchemaObject(narrowedSchema) && isFileType(narrowedSchema.fieldType)) {\n return PrimitiveSchemaId.File;\n }\n // Date and Datetime are encoded as `{type: 'string', format: 'date'|'date-time'}`.\n // Check before the generic string branch so date receivers don't bucket as String.\n if (isJsonSchemaDate(narrowedSchema)) {\n return PrimitiveSchemaId.Date;\n }\n if (isJsonSchemaDateTime(narrowedSchema)) {\n return PrimitiveSchemaId.Datetime;\n }\n const type = Array.isArray(schema.type) ? nonNullableType : schema.type;\n if (!type) {\n return null;\n }\n // Integer and Number share one CCF bucket — mirrors the backend collapse\n // in JSON_TYPE_TO_SCHEMA_ID. A CCF authored against a Number receiver\n // fires for both .length-style integers and float-typed values.\n if (type === JsonSchemaTypes.Integer || type === JsonSchemaTypes.Number) {\n return PrimitiveSchemaId.Number;\n }\n if (type === JsonSchemaTypes.Boolean) {\n return PrimitiveSchemaId.Boolean;\n }\n return getSchemaId(type);\n};\n\nexport const nextLinkSchema = ({\n currentSchema,\n nextLink,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n currentSchema: JsonSchema | null;\n nextLink: MethodChainNode;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): JsonSchema | null => {\n if (!currentSchema) {\n return null;\n }\n // Runtime dispatches a typed null only to a CCF whose receiver schema\n // accepts null, so a nullable value resolves only through such CCFs.\n if (nextLink.type === MethodChainNodeTypes.CustomFunction) {\n const unwrapped = getNonNullableRefSchema(currentSchema);\n const nonNullType = unwrapped ? null : getNonNullableType(currentSchema);\n const receiver =\n unwrapped ?? (nonNullType ? ({ ...currentSchema, type: nonNullType } as JsonSchema) : null);\n if (receiver) {\n const fn = getFunctionSchemaForNode({\n parentSchema: currentSchema,\n functionName: fullNodeName(nextLink),\n isCustomFunction: true,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n if (fn?.acceptsNullReceiver !== true) {\n return null;\n }\n currentSchema = receiver;\n }\n }\n if (isJsonSchemaRef(currentSchema)) {\n currentSchema = resolveJssRef(currentSchema, platformObjectJsonSchema);\n } else if (isJsonSchemaArray(currentSchema) && isJsonSchemaRef(currentSchema.items)) {\n currentSchema = {\n ...currentSchema,\n items: {\n ...resolveJssRef(currentSchema.items, platformObjectJsonSchema),\n },\n };\n }\n if (!('type' in currentSchema)) {\n return null;\n }\n\n const schemaId = getPrimitiveSchemaId(currentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilityReturnType = getPrimitiveUtilitiesReturnSchema(\n currentSchema,\n nextLink,\n primitiveUtilities[schemaId],\n );\n if (utilityReturnType) {\n return utilityReturnType;\n }\n }\n if ('properties' in currentSchema) {\n const propertySchema = currentSchema.properties[fullNodeName(nextLink)];\n if (propertySchema && isFunctionSchema(propertySchema)) {\n return propertySchema.properties.returnType;\n }\n return propertySchema ?? null;\n }\n return null;\n};\n\n/**\n * Returns the FunctionJsonSchema for `functionName` within `parentSchema`, checking both\n * primitive utilities (e.g. array/string methods) and direct object properties.\n * Returns null if not found or not a function schema.\n */\nexport const getFunctionSchemaForNode = ({\n parentSchema,\n functionName,\n isCustomFunction,\n platformObjectJsonSchema,\n primitiveUtilities,\n}: {\n parentSchema: JsonSchema;\n functionName: string;\n isCustomFunction: boolean;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n}): FunctionJsonSchema | null => {\n if (isCustomFunction) {\n parentSchema = getNonNullableRefSchema(parentSchema) ?? parentSchema;\n }\n if (isJsonSchemaRef(parentSchema)) {\n parentSchema = resolveJssRef(parentSchema, platformObjectJsonSchema);\n }\n\n const schemaId = getPrimitiveSchemaId(parentSchema);\n if (schemaId && schemaId in primitiveUtilities) {\n const utilitySchema = primitiveUtilities[schemaId].properties[functionName];\n if (utilitySchema && isFunctionSchema(utilitySchema)) {\n return utilitySchema;\n }\n }\n\n if (isJsonSchemaObject(parentSchema) && functionName in parentSchema.properties) {\n const propSchema = parentSchema.properties[functionName];\n if (isFunctionSchema(propSchema)) {\n return propSchema;\n }\n }\n\n return null;\n};\n\n// When the result is an array of platform objects (identified by objectKey on items),\n// inject a $ref so the schema structure matches has_many associations.\n// This ensures consistent operator options in conditionals.\nconst injectRefForPlatformObjectArray = (schema: JsonSchema | null): JsonSchema | null => {\n if (\n schema &&\n isJsonSchemaArray(schema) &&\n isJsonSchemaObject(schema.items) &&\n 'objectKey' in schema.items &&\n schema.items.objectKey\n ) {\n const schemaId = getSchemaId(schema.items.objectKey, MERGED_SCHEMA_ID);\n return {\n ...schema,\n items: {\n ...schema.items,\n $ref: schemaId,\n },\n };\n }\n return schema;\n};\n\nconst getPrimitiveUtilitiesReturnSchema = (\n object: JsonSchema,\n node: MethodChainNode,\n schema: JsonSchemaObject<JsonSchema | FunctionJsonSchema>,\n): JsonSchema | null => {\n const name = fullNodeName(node);\n if (!(name in schema.properties)) {\n return null;\n }\n\n const utilitySchema = schema.properties[name];\n\n const returnSchema = isFunctionSchema(utilitySchema)\n ? utilitySchema.properties.returnType\n : utilitySchema;\n\n const itemSchema = genericArrayItemSchema(object, returnSchema);\n if (itemSchema) {\n return itemSchema;\n }\n\n if (isPrecedingSchema(returnSchema)) {\n return object;\n }\n\n if (\n isConvertedTypeSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n return returnSchema.schemaByValue[stringNode.value] ?? EMPTY_JSON_SCHEMA_OBJECT;\n }\n\n if (\n isGenericParameterSchema(returnSchema) &&\n isFunctionNode(node) &&\n node.params[returnSchema.position] &&\n isStringNode(node.params[returnSchema.position])\n ) {\n const stringNode = node.params[returnSchema.position] as StringNode;\n const objectSchema = isJsonSchemaArray(object) ? object.items : object;\n if (isJsonSchemaObject(objectSchema)) {\n const path = stringNode.value.split('.');\n const resultSchema = path.reduce<JsonSchema | null>((schema, key) => {\n if (schema == null || !isJsonSchemaObject(schema) || !schema.properties[key]) {\n return null;\n }\n return schema.properties[key];\n }, objectSchema);\n\n return injectRefForPlatformObjectArray(resultSchema);\n }\n }\n\n return 'genericType' in returnSchema ? EMPTY_JSON_SCHEMA_OBJECT : returnSchema;\n};\n\n/**\n * @param path\n * @param allowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n * @param fieldPathsAreStrictMatch - true if we only want to match exact paths in allowedFieldPaths and disallowedFieldPaths\n */\nconst isAllowedPath = (path: string, allowedFieldPaths: string[]) => {\n return allowedFieldPaths.some((fieldPath) => {\n const valueIsPartialMatch = fieldPath.startsWith(path);\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsPartialMatch || valueIsNestedProp;\n });\n};\n\n/**\n * @param path\n * @param disallowedFieldPaths - can be a complete path to a base type field\n * (e.g. 'data.some.string_field'), or a partial path to an object ('data')\n */\nconst isDisallowedPath = (path: string, disallowedFieldPaths: string[]) => {\n return disallowedFieldPaths.some((fieldPath) => {\n const valueIsMatch = fieldPath === path;\n const valueIsNestedProp = path.startsWith(`${fieldPath}.`);\n return valueIsMatch || valueIsNestedProp;\n });\n};\n\nexport const isTypeMatch = ({\n fieldJsonSchema,\n types,\n platformObjectJsonSchema = {},\n arrayTypes,\n traversedSchemaIds = new Set(),\n}: {\n fieldJsonSchema: JsonSchema;\n types: PossibleType[];\n platformObjectJsonSchema: ObjectSchemaMap;\n arrayTypes?: PossibleArrayType[];\n traversedSchemaIds?: Set<string>;\n}): boolean => {\n const resolvedSchema = isJsonSchemaRef(fieldJsonSchema)\n ? resolveJssRef(fieldJsonSchema, platformObjectJsonSchema)\n : fieldJsonSchema;\n\n if (resolvedSchema.$id) {\n if (traversedSchemaIds.has(resolvedSchema.$id)) {\n // We've already traversed this schema ID, which there were no\n // valid types found for it, so return false to avoid infinite loops\n return false;\n } else {\n // If we haven't traversed this schema ID yet, add it to the set\n // This allows us to avoid infinite loops when resolving references\n // in recursive schemas\n traversedSchemaIds.add(resolvedSchema.$id);\n }\n }\n\n const fieldJsonSchemaType = getJsonSchemaType(resolvedSchema);\n switch (fieldJsonSchemaType) {\n case JsonSchemaAllTypes.Object: {\n const objectSchema = resolvedSchema as JsonSchemaObject;\n // For generic JsonSchemaObjectKey such as 'report' or 'verification', we match on subtypes\n // like 'business-watchlist' as well; otherwise, generics don't show anything\n const isObjectKeyOfType = (type: JsonSchemaObjectKey) =>\n objectSchema.objectKey &&\n types.includes(type) &&\n objectSchema.objectKey.split('/')[0] === type;\n\n if (\n types.includes(JsonSchemaTypes.Object) ||\n (objectSchema.objectKey && types.includes(objectSchema.objectKey)) ||\n isObjectKeyOfType('report') ||\n isObjectKeyOfType('verification')\n ) {\n return true;\n }\n\n return Object.values(objectSchema.properties || {}).some((propJsonSchema) =>\n isTypeMatch({\n fieldJsonSchema: propJsonSchema,\n types,\n platformObjectJsonSchema,\n arrayTypes,\n traversedSchemaIds: traversedSchemaIds,\n }),\n );\n }\n case JsonSchemaAllTypes.Array: {\n const arraySchema = resolvedSchema as JsonSchemaArray;\n const itemSchema = isJsonSchemaRef(arraySchema.items)\n ? resolveJssRef(arraySchema.items, platformObjectJsonSchema)\n : arraySchema.items;\n return (\n types.includes(JsonSchemaAllTypes.Array) &&\n // Don't recurse on array, otherwise we risk matching on objects within the array\n !!arrayTypes &&\n arrayTypes.some(\n (schemaType) =>\n schemaType === getJsonSchemaType(itemSchema) ||\n (isJsonSchemaObject(itemSchema) && schemaType === itemSchema.objectKey),\n )\n );\n }\n case JsonSchemaAllTypes.String:\n case JsonSchemaAllTypes.Number:\n case JsonSchemaAllTypes.Boolean:\n case JsonSchemaAllTypes.Integer:\n case JsonSchemaAllTypes.Date:\n case JsonSchemaAllTypes.Datetime:\n case JsonSchemaAllTypes.Enum:\n case JsonSchemaAllTypes.MultiEnum:\n case JsonSchemaAllTypes.GroupedEnum:\n case JsonSchemaAllTypes.Unknown: {\n return types.some((schemaType) => schemaType === fieldJsonSchemaType);\n }\n default:\n return false;\n }\n};\n\nexport interface OptionFilters {\n allowedArrayTypes?: PossibleArrayType[];\n allowedFieldPaths?: string[];\n allowedTypes?: PossibleType[];\n disallowedFieldPaths?: string[];\n fieldPathsAreStrictMatch?: boolean;\n requiredPropertyShape?: string[]; // Array of property names that must exist in the schema\n}\n\nexport const hasRequiredPropertyShape = (\n schema: JsonSchema,\n requiredPropertyShape: string[],\n platformObjectJsonSchema: ObjectSchemaMap = {},\n checkRecursively: boolean = true,\n): boolean => {\n if (!requiredPropertyShape?.length) {\n return true;\n }\n\n const resolvedSchema = isJsonSchemaRef(schema)\n ? resolveJssRef(schema, platformObjectJsonSchema)\n : schema;\n\n if (\n resolvedSchema &&\n 'type' in resolvedSchema &&\n resolvedSchema.type === JsonSchemaTypes.Object &&\n 'properties' in resolvedSchema &&\n resolvedSchema.properties\n ) {\n const schemaProperties = resolvedSchema.properties as Record<string, JsonSchema>;\n const hasAllProperties = requiredPropertyShape.every(\n (propName) => propName in schemaProperties,\n );\n\n if (hasAllProperties) {\n return true;\n }\n\n if (checkRecursively) {\n return Object.values(schemaProperties).some((propSchema) =>\n hasRequiredPropertyShape(\n propSchema,\n requiredPropertyShape,\n platformObjectJsonSchema,\n checkRecursively,\n ),\n );\n }\n }\n return false;\n};\n\nconst filterForAllowedSchemaOptions = (\n options: Option[] = [],\n {\n allowedArrayTypes,\n allowedFieldPaths,\n allowedTypes,\n disallowedFieldPaths,\n fieldPathsAreStrictMatch,\n requiredPropertyShape,\n }: OptionFilters,\n platformObjectJsonSchema: ObjectSchemaMap = {},\n) => {\n let filteredOptions = options;\n\n if (fieldPathsAreStrictMatch) {\n if (allowedFieldPaths?.length || disallowedFieldPaths?.length || allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isValidOption(\n option.schema,\n allowedFieldPaths ?? [],\n disallowedFieldPaths ?? [],\n allowedTypes ?? [],\n allowedArrayTypes ?? [],\n option.value.split('.'),\n platformObjectJsonSchema,\n ),\n );\n }\n } else {\n if (allowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isAllowedPath(option.value, allowedFieldPaths),\n );\n }\n if (disallowedFieldPaths?.length) {\n filteredOptions = filteredOptions.filter(\n (option) => !isDisallowedPath(option.value, disallowedFieldPaths),\n );\n }\n if (allowedTypes?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n isTypeMatch({\n fieldJsonSchema: option.schema,\n types: allowedTypes,\n platformObjectJsonSchema,\n arrayTypes: allowedArrayTypes,\n }),\n );\n }\n }\n\n // Add a recursive function to check if schema or any nested schema has the required properties\n if (requiredPropertyShape?.length) {\n filteredOptions = filteredOptions.filter((option) =>\n hasRequiredPropertyShape(option.schema, requiredPropertyShape, platformObjectJsonSchema),\n );\n }\n\n return filteredOptions;\n};\n\nexport const getOptionForValue = ({\n value,\n jsonSchema,\n schemaForFieldPath,\n}: {\n value: string;\n jsonSchema: JsonSchema;\n schemaForFieldPath: (\n path: string,\n initialSchema: JsonSchema,\n ) => { schema: JsonSchema | null; propertyName: string | null };\n}): Option | null => {\n const { schema, propertyName } = schemaForFieldPath(value, jsonSchema);\n if (!schema || !propertyName) {\n return null;\n }\n\n const methodChain = parseMethodChainForJSS(value);\n return {\n label: methodChain ? methodChainToString(methodChain) : value,\n value: methodChain ? methodChainToString(methodChain) : value,\n property: propertyName,\n schema,\n methodChain,\n };\n};\n\nexport const validatePath = ({\n path,\n jsonSchema,\n platformObjectJsonSchema = {},\n primitiveUtilities = {},\n optionFilters,\n}: {\n path: string;\n jsonSchema: JsonSchema;\n platformObjectJsonSchema: ObjectSchemaMap;\n primitiveUtilities: ObjectSchemaMap;\n optionFilters?: OptionFilters;\n}) => {\n const schemaOptions = getSchemaOptions({\n option: { schema: jsonSchema, methodChain: parseMethodChainForJSS('') },\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n const { methodChain, partial } = parseWithPartialOption(path);\n\n const matchedSchemaOptions = methodChain.links.reduce<Option[]>((currentSchema, link) => {\n if (currentSchema.length === 0) {\n return [];\n }\n const optionMatch = currentSchema.find((option) => option.property === link.name);\n if (optionMatch) {\n return getSchemaOptions({\n option: optionMatch,\n optionFilters,\n platformObjectJsonSchema,\n primitiveUtilities,\n });\n }\n return [];\n }, schemaOptions);\n\n const optionsWithPartiallyMatchedFinalLink = matchedSchemaOptions.filter((option) =>\n option.property.includes(partial),\n );\n return {\n valid: optionsWithPartiallyMatchedFinalLink.length > 0,\n schemaOptions: optionsWithPartiallyMatchedFinalLink,\n partial,\n };\n};\n\n/**\n * Given a method chain that corresponds to the passed schema, find the right-most indentifier that\n * is a platform object and split the method chain on that identifier, with the platform object on\n * the left side.\n *\n * This function is used to optimize a method chain into two parts, left side for server resolution\n * and right side for client resolution.\n *\n * For example:\n * current_case.fields.field_a -> ['current_case', 'fields.field_a']\n * current_case.inquiries.first.id -> ['current_case.inquiries.first', 'id']\n * current_case.account.fields.field_b -> ['current_case.account', 'fields.field_b']\n */\nexport const splitAtNearestParentObject = (\n chain: Chain,\n currentSchema: JsonSchemaObject,\n platformSchemaMap: ObjectSchemaMap,\n primitiveUtilities: ObjectSchemaMap,\n): [leftChain: Chain, rightChain: Chain] => {\n // Create a list of schemas that match each link in the method chain.\n // The list is reversed such that the first schema matches the last link of the method chain\n // for the next step.\n const leafUpLinkSchemas: (JsonSchema | null)[] = [currentSchema];\n for (const link of chain.links) {\n const nextSchema = nextLinkSchema({\n currentSchema: leafUpLinkSchemas[0],\n nextLink: link,\n platformObjectJsonSchema: platformSchemaMap,\n primitiveUtilities,\n });\n leafUpLinkSchemas.unshift(nextSchema);\n }\n\n // List of links that correspond to the left and right sides of the split.\n // As we walk the schema from leaf to root, we move links to the right side.\n const leafUpLeftLinks = [...chain.links].reverse();\n const leafUpRightLinks: typeof leafUpLeftLinks = [];\n\n for (const [i, linkSchema] of leafUpLinkSchemas.entries()) {\n if (!linkSchema) {\n // When the schema is unknown, check if the current link is an identifier accessing a\n // property on an unresolvable platform object ref. If any remaining schema in the\n // ancestor chain is a $ref (or array of $refs), we're within a platform object whose\n // schema couldn't be resolved — push the identifier to the client (right) side.\n if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nearestPlatformAncestor = leafUpLinkSchemas\n .slice(i + 1)\n .find(\n (s) => s && (isJsonSchemaRef(s) || (isJsonSchemaArray(s) && isJsonSchemaRef(s.items))),\n );\n if (nearestPlatformAncestor) {\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n continue;\n }\n }\n // If we are missing schema, break out asap to keep links on the left.\n break;\n } else if ('$id' in linkSchema || isJsonSchemaRef(linkSchema)) {\n break;\n } else if (isJsonSchemaArray(linkSchema)) {\n if ('$id' in linkSchema.items || isJsonSchemaRef(linkSchema.items)) {\n break;\n }\n // Array-returning functions (filter, sort, etc.) on platform object arrays\n // must be resolved server-side even when the items ref cannot be resolved.\n if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n }\n } else if (isFunctionNode(leafUpLeftLinks[0])) {\n break;\n } else if (isIdentifierNode(leafUpLeftLinks[0])) {\n const nextSchema = leafUpLinkSchemas[i + 1];\n // If the preceding schema has a primitive schema ID in the utilities, the identifier\n // was resolved via primitive utilities (e.g. 'trim' on a string, 'count' on an array).\n // The server handles these inline, so keep the whole chain server-side.\n if (nextSchema) {\n const primitiveId = getPrimitiveSchemaId(nextSchema);\n if (primitiveId && primitiveId in primitiveUtilities) {\n break;\n }\n }\n // Real special case here. If:\n // - The current link is an identifier\n // - The next schema is an array\n // = break out, because we don't want to load the whole array into the client\n if (nextSchema && isJsonSchemaArray(nextSchema)) {\n break;\n }\n }\n\n leafUpRightLinks.push(leafUpLeftLinks.shift()!);\n }\n\n const leftChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpLeftLinks.reverse(),\n };\n const rightChain: Chain = {\n type: MethodChainNodeTypes.Chain,\n links: leafUpRightLinks.reverse(),\n };\n return [leftChain, rightChain];\n};\n"],"mappings":";;;;;;AA6DA,MAAM,gBAAgB,SACpB,GAAG,KAAK,SAAS,qBAAqB,iBAAiB,MAAM,KAAK,KAAK;AAazE,MAAM,sBAAsB;;;;;;;AAQ5B,MAAa,4BACX,QACA,2BAA4C,EAAE,KAC5B;AAClB,KAAI,CAAC,OACH,QAAO;AAET,KAAI,gBAAgB,OAAO,EAAE;EAC3B,MAAM,WAAW,OAAO,MAAM,MAAM,oBAAoB;AACxD,MAAI,SACF,QAAO,SAAS;AAElB,SAAO,yBACL,cAAc,QAAQ,yBAAyB,EAC/C,yBACD;;AAEH,KAAI,SAAS,UAAU,OAAO,OAAO,QAAQ,UAAU;EACrD,MAAM,UAAU,OAAO,IAAI,MAAM,oBAAoB;AACrD,MAAI,QACF,QAAO,QAAQ;;AAKnB,KAAI,eAAe,UAAU,OAAO,OAAO,cAAc,SACvD,QAAO,OAAO,UAAU,MAAM,IAAI,CAAC;AAErC,QAAO,oCAAoC,OAAO;;AAMpD,MAAM,kBACJ,QACA,cACA,sBACG;AACH,KAAI,aAAa,W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,MAAI,CAAC,YAAY;AAKf,OAAI,iBAAiB,gBAAgB,GAAG;QACN,kBAC7B,MAAM,IAAI,EAAE,CACZ,MACE,MAAM,MAAM,gBAAgB,EAAE,IAAK,kBAAkB,EAAE,IAAI,gBAAgB,EAAE,MAAM,EAE7D,EAAE;AAC3B,sBAAiB,KAAK,gBAAgB,OAAO,CAAE;AAC/C;;;AAIJ;aACS,SAAS,cAAc,gBAAgB,WAAW,CAC3D;WACS,kBAAkB,WAAW,EAAE;AACxC,OAAI,SAAS,WAAW,SAAS,gBAAgB,WAAW,MAAM,CAChE;AAIF,OAAI,eAAe,gBAAgB,GAAG,CACpC;aAEO,eAAe,gBAAgB,GAAG,CAC3C;WACS,iBAAiB,gBAAgB,GAAG,EAAE;GAC/C,MAAM,aAAa,kBAAkB,IAAI;AAIzC,OAAI,YAAY;IACd,MAAM,cAAc,qBAAqB,WAAW;AACpD,QAAI,eAAe,eAAe,mBAChC;;AAOJ,OAAI,cAAc,kBAAkB,WAAW,CAC7C;;AAIJ,mBAAiB,KAAK,gBAAgB,OAAO,CAAE;;AAWjD,QAAO,CAAC;EAPN,MAAM,qBAAqB;EAC3B,OAAO,gBAAgB,SAAS;EAMjB,EAAE;EAHjB,MAAM,qBAAqB;EAC3B,OAAO,iBAAiB,SAAS;EAEN,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { a as styled } from "../../styledComponentsInterop-Cs5CCPRy.mjs";
2
+ import { semanticColor } from "../../lib/semanticColor.mjs";
2
3
  import { HeadlessAriaButton } from "../../lib/HeadlessAriaButton.mjs";
3
4
  import { n as RouterLink } from "../../router-BxmA940v.mjs";
4
5
  import { TruncatedText } from "../../lib/TruncatedText.mjs";
5
- import { semanticColor } from "../../lib/semanticColor.mjs";
6
6
  import { i as Paragraph, n as Heading$1 } from "../../Text-D0vEReED.mjs";
7
7
  import "../../variables/transitions.mjs";
8
8
  import { a as Tooltip } from "../../Tooltip-YViXzMdm.mjs";
9
9
  import { focusStyle } from "../../mixins/focus.mjs";
10
10
  import { n as Stack, t as HStack } from "../../Stack-Bzom2BTR.mjs";
11
- import { n as Button$1, t as IconButton } from "../../IconButton-DftINsp7.mjs";
12
- import { n as DropdownMenu_default } from "../../DropdownMenu-Q8S-9rXm.mjs";
13
- import { t as DropdownButton } from "../../DropdownButton-BiFRlSVD.mjs";
11
+ import { n as Button$1, t as IconButton } from "../../IconButton-DxHB2g80.mjs";
12
+ import { n as DropdownMenu_default } from "../../DropdownMenu-c8XK2Lr4.mjs";
13
+ import { t as DropdownButton } from "../../DropdownButton-DpLG-cIj.mjs";
14
14
  import { n as SingleColumnLayout } from "../../PageLayout-DjtGrvJa.mjs";
15
15
  import { cloneElement } from "react";
16
16
  import { Color, Spacing } from "@persona/design-tokens";