@epam/ai-dial-ui-kit 0.15.0-dev.4 → 0.15.0-dev.42

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 (202) hide show
  1. package/README.md +191 -0
  2. package/dist/CHANGELOG.md +75 -0
  3. package/dist/DateCellRenderer-ChqbDlQ2.cjs +1 -0
  4. package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-Cl_mNbi1.cjs} +31 -31
  5. package/dist/IconButton-DHOFapLo.cjs +1 -0
  6. package/dist/JsonEditor-CpSpVa0v.cjs +1 -0
  7. package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-CPzMv3lE.cjs} +1 -1
  8. package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-NYMcKLJy.cjs} +1 -1
  9. package/dist/MarkdownEditorContainer-DVPRplYf.cjs +1 -0
  10. package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
  11. package/dist/components/Button/constants.js +9 -8
  12. package/dist/components/Dropdown/Dropdown.js +70 -65
  13. package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
  14. package/dist/components/Dropdown/constants.js +16 -14
  15. package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
  16. package/dist/components/FileManager/FileManager.js +373 -372
  17. package/dist/components/FileManager/FileManagerProvider.js +266 -264
  18. package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
  19. package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
  20. package/dist/components/New/Accordion/Accordion.js +87 -71
  21. package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +206 -0
  22. package/dist/components/New/AutocompleteTagInput/utils.js +11 -0
  23. package/dist/components/New/Avatar/Avatar.js +70 -0
  24. package/dist/components/New/Badge/Badge.js +45 -0
  25. package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
  26. package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
  27. package/dist/components/New/Breadcrumbs/constants.js +41 -0
  28. package/dist/components/New/Button/Button.js +32 -32
  29. package/dist/components/New/Button/ButtonWrappers.js +93 -37
  30. package/dist/components/New/Button/constants.js +3 -0
  31. package/dist/components/New/Button/utils.js +18 -8
  32. package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
  33. package/dist/components/New/Calendar/Calendar.js +301 -265
  34. package/dist/components/New/Calendar/constants.js +5 -5
  35. package/dist/components/New/CaptionText/CaptionText.js +18 -15
  36. package/dist/components/New/CardShell/CardShell.js +5 -3
  37. package/dist/components/New/Checkbox/Checkbox.js +67 -56
  38. package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
  39. package/dist/components/New/CloseButton/CloseButton.js +18 -16
  40. package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
  41. package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +38 -37
  42. package/dist/components/New/ConfirmationPopup/constants.js +8 -11
  43. package/dist/components/New/Dropdown/Dropdown.js +112 -105
  44. package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
  45. package/dist/components/New/Dropdown/constants.js +22 -17
  46. package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
  47. package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
  48. package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
  49. package/dist/components/New/FileIcon/FileIcon.js +55 -0
  50. package/dist/components/New/FileIcon/constants.js +134 -0
  51. package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
  52. package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
  53. package/dist/components/New/FileName/FileName.js +78 -0
  54. package/dist/components/New/FilterChips/FilterChips.js +43 -0
  55. package/dist/components/New/FilterChips/constants.js +5 -0
  56. package/dist/components/New/FolderName/FolderName.js +16 -0
  57. package/dist/components/New/FolderPath/FolderPath.js +29 -28
  58. package/dist/components/New/Highlight/Highlight.js +23 -30
  59. package/dist/components/New/IconButton/IconButton.js +30 -28
  60. package/dist/components/New/InfoButton/InfoButton.js +13 -11
  61. package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
  62. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
  63. package/dist/components/New/InteractiveTooltip/constants.js +2 -2
  64. package/dist/components/New/Label/Label.js +13 -8
  65. package/dist/components/New/MenuItem/MenuItem.js +29 -27
  66. package/dist/components/New/MenuItem/constants.js +9 -8
  67. package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
  68. package/dist/components/New/Notification/Notification.js +33 -29
  69. package/dist/components/New/NumberInput/NumberInput.js +42 -33
  70. package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
  71. package/dist/components/New/Popup/Popup.js +46 -44
  72. package/dist/components/New/Popup/constants.js +3 -3
  73. package/dist/components/New/Radio/Radio.js +75 -64
  74. package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
  75. package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
  76. package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
  77. package/dist/components/New/Search/Search.js +29 -27
  78. package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
  79. package/dist/components/New/Select/CollapsedSelectTags.js +127 -0
  80. package/dist/components/New/Select/MultiSelectTags.js +18 -15
  81. package/dist/components/New/Select/Select.js +219 -197
  82. package/dist/components/New/Select/constants.js +23 -20
  83. package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
  84. package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
  85. package/dist/components/New/Switch/Switch.js +69 -58
  86. package/dist/components/New/Tabs/Tabs.js +125 -61
  87. package/dist/components/New/Tag/Tag.js +42 -40
  88. package/dist/components/New/TagInput/TagInput.js +48 -44
  89. package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
  90. package/dist/components/New/Tooltip/TooltipContent.js +11 -9
  91. package/dist/components/New/Tooltip/constants.js +1 -1
  92. package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
  93. package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
  94. package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
  95. package/dist/components/New/TransferQueue/constants.js +24 -0
  96. package/dist/components/New/constants/overlay.js +17 -9
  97. package/dist/components/Popup/constants.js +8 -8
  98. package/dist/components/ProgressBar/ProgressBar.js +45 -33
  99. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
  100. package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
  101. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
  102. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
  103. package/dist/components/SchemaRenderer/types.js +19 -8
  104. package/dist/components/SchemaRenderer/utils.js +122 -95
  105. package/dist/components/Skeleton/Skeleton.js +25 -19
  106. package/dist/components/Spinner/Spinner.js +7 -5
  107. package/dist/components/Tooltip/TooltipContent.js +11 -11
  108. package/dist/components-manifest.json +1653 -71
  109. package/dist/constants/public-class-names.js +210 -0
  110. package/dist/dial-ui-kit.cjs +2 -2
  111. package/dist/dial-ui-kit.js +346 -299
  112. package/dist/editor-Bc9xzKuR.cjs +1 -0
  113. package/dist/editors.cjs +1 -1
  114. package/dist/file-manager.cjs +1 -1
  115. package/dist/grid.cjs +1 -1
  116. package/dist/index.css +2 -2
  117. package/dist/lazy-Cy9WobJf.cjs +1 -0
  118. package/dist/merge-classes-BEJXjzkx.cjs +1 -0
  119. package/dist/migration-guides/0.15.0/legacy-theme-variable-fallbacks-removal.md +69 -0
  120. package/dist/migration-guides/README.md +1 -0
  121. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
  122. package/dist/src/components/FileManager/FileManager.d.ts +2 -0
  123. package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
  124. package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
  125. package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
  126. package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +97 -0
  127. package/dist/src/components/New/AutocompleteTagInput/utils.d.ts +17 -0
  128. package/dist/src/components/New/AutocompleteTagInput/utils.spec.d.ts +1 -0
  129. package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
  130. package/dist/src/components/New/Badge/Badge.d.ts +47 -0
  131. package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
  132. package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
  133. package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
  134. package/dist/src/components/New/Button/Button.d.ts +4 -1
  135. package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
  136. package/dist/src/components/New/Button/utils.d.ts +15 -0
  137. package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
  138. package/dist/src/components/New/Calendar/Calendar.d.ts +7 -1
  139. package/dist/src/components/New/Calendar/constants.d.ts +1 -1
  140. package/dist/src/components/New/ConfirmationPopup/constants.d.ts +0 -1
  141. package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
  142. package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
  143. package/dist/src/components/New/EntityIdentity/EntityIdentity.d.ts +85 -0
  144. package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
  145. package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
  146. package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
  147. package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
  148. package/dist/src/components/New/FileName/FileName.d.ts +79 -0
  149. package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
  150. package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
  151. package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
  152. package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
  153. package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
  154. package/dist/src/components/New/Notification/Notification.d.ts +18 -0
  155. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  156. package/dist/src/components/New/Select/CollapsedSelectTags.d.ts +22 -0
  157. package/dist/src/components/New/Select/MultiSelectTags.d.ts +5 -0
  158. package/dist/src/components/New/Select/Select.d.ts +9 -0
  159. package/dist/src/components/New/Select/constants.d.ts +3 -2
  160. package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
  161. package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
  162. package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
  163. package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
  164. package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
  165. package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
  166. package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
  167. package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
  168. package/dist/src/components/New/constants/overlay.d.ts +13 -0
  169. package/dist/src/components/Popup/constants.d.ts +1 -1
  170. package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
  171. package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
  172. package/dist/src/constants/public-class-names.d.ts +201 -0
  173. package/dist/src/index.d.ts +36 -1
  174. package/dist/src/types/accordion.d.ts +7 -0
  175. package/dist/src/types/avatar.d.ts +7 -0
  176. package/dist/src/types/badge.d.ts +16 -0
  177. package/dist/src/types/breadcrumbs.d.ts +9 -0
  178. package/dist/src/types/button.d.ts +1 -0
  179. package/dist/src/types/entity-type.d.ts +9 -0
  180. package/dist/src/types/transfer-queue.d.ts +10 -0
  181. package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
  182. package/dist/src/utils/avatar.d.ts +12 -0
  183. package/dist/src/utils/sub-menu-floating.d.ts +7 -4
  184. package/dist/types/accordion.js +4 -0
  185. package/dist/types/avatar.js +4 -0
  186. package/dist/types/badge.js +5 -0
  187. package/dist/types/breadcrumbs.js +4 -0
  188. package/dist/types/button.js +3 -3
  189. package/dist/types/entity-type.js +4 -0
  190. package/dist/types/transfer-queue.js +4 -0
  191. package/dist/use-file-manager-tabs-C-dMqEFy.cjs +3 -0
  192. package/dist/utils/avatar.js +22 -0
  193. package/dist/utils/merge-classes.js +12 -5
  194. package/dist/utils/sub-menu-floating.js +99 -54
  195. package/package.json +4 -7
  196. package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
  197. package/dist/IconButton-DWqoaBWf.cjs +0 -1
  198. package/dist/JsonEditor-qv1Z0dLX.cjs +0 -1
  199. package/dist/MarkdownEditorContainer-Bzcnoemw.cjs +0 -1
  200. package/dist/lazy-tfN4sKhq.cjs +0 -1
  201. package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
  202. package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./use-file-manager-tabs-DjdR_mYM.cjs"),Ae=require("./Switch-CUKClcEz.cjs"),n=require("react/jsx-runtime"),h=require("react"),$=require("@tabler/icons-react"),ae=require("classnames"),M=require("./DateCellRenderer-BVM-Q8yx.cjs"),H=require("./icon-CrGVkVpG.cjs"),I=require("./merge-classes-Dipy1Ih1.cjs"),P=require("./DateCellRenderer-ssp7eaZY.cjs"),T=require("./IconButton-DWqoaBWf.cjs"),Wn=require("react-dom"),ot=require("./lazy-tfN4sKhq.cjs"),le=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function qn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const gr=qn(h),He=({label:e,className:t,icon:r,selected:s,closable:a,onClick:i,onRemove:o})=>{const l=I.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return n.jsxs("div",{className:l,onClick:i,children:[n.jsx(M.DialIcon,{icon:r}),n.jsx(M.DialEllipsisTooltip,{text:e}),a&&o&&n.jsx(x.DialButton,{className:"p-0",iconAfter:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:c=>o(c)})]},e)},Jt=({label:e="Error",className:t})=>n.jsx(He,{label:e,className:I.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var st=(e=>(e.Default="default",e.Compact="compact",e))(st||{});const Zn={[st.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[st.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},Yn=({title:e,value:t,description:r,variant:s=st.Default,error:a,isLoading:i,className:o,delta:l,deltaPositive:c,deltaUnit:u,compareValues:d})=>{const f=Zn[s],g=c!==void 0?c:(l??0)>=0,p=l===void 0?null:`${l>=0?`+${l}`:String(l)}${u??""}`;return n.jsxs("div",{className:I.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||i?"gap-2":"gap-1",f.container,o),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:f.title,children:e}),n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:p})]}):n.jsx("span",{className:f.title,children:e}),a?n.jsx(Jt,{className:"self-start"}):i?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-start"}):d?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(M.DialEllipsisTooltip,{text:d[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(M.DialEllipsisTooltip,{text:d[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:f.value,children:d[1].value})]})]}):n.jsx("span",{className:f.value,children:t}),!a&&!i&&f.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},er=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],Xn=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Qn=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},ut=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:i,colorMap:o=er,className:l,titleClassName:c,valueClassName:u,inline:d,ariaLabel:f})=>{const g=e==null,p=!!(r||s||!g),m=Xn(g?0:e,t),b=Qn(m,o),v=i??(g?"—":e),y=f??(typeof a=="string"?a:void 0),D=r||s,N=r?n.jsx(Jt,{}):s?n.jsx(x.DialLoader,{fullWidth:!1}):n.jsx("span",{className:I.mergeClasses("shrink-0 tabular-nums text-end",d?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:v}),S=p?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":y,className:I.mergeClasses("w-full overflow-hidden rounded-sm",d?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!D&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:b}})}):null,C=n.jsx("span",{className:I.mergeClasses("dial-small-text text-primary",c),children:a});return d?n.jsxs("div",{className:I.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:C}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:S}),N]})]}):n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[C,N]}),S]})},Ur=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,onToggle:l,className:c,headerClassName:u,contentClassName:d})=>{const f=s!==void 0,[g,p]=h.useState(a),m=o?!0:f?s:g,b=h.useId(),v=()=>{if(i)return;const y=!m;f||p(y),l?.(y)};return n.jsxs("div",{className:I.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":b,disabled:i||o,onClick:v,className:I.mergeClasses("flex w-full items-center gap-2 p-4 text-left",i?"cursor-not-allowed":"cursor-pointer",o&&"cursor-default",u),children:[!o&&n.jsx(M.DialIcon,{className:ae("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:b,role:"region",className:I.mergeClasses("px-4 pb-4",d),children:r})]})},Jn=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:i,maxValue:o,colorMap:l,defaultExpanded:c=!0,nonCollapsible:u,isLoading:d,onBarClick:f,inline:g,barTitleClassName:p,barValueClassName:m,barClassName:b,barDescriptions:v,className:y})=>{const D=Object.entries(s),N=g?I.mergeClasses("text-secondary",p):p,S=i?"dial-tiny-text text-secondary":void 0,C=t?n.jsx(T.DialTooltip,{tooltip:t,children:e}):e,w=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],R="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",_="group flex flex-col gap-1.5",O=I.mergeClasses("flex flex-col gap-1.5 pl-2",f&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",b);return n.jsx(Ur,{title:C,description:r,defaultExpanded:c,nonCollapsible:u,className:y,children:n.jsx("div",{className:I.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:d?n.jsx(x.DialLoader,{fullWidth:!1,className:"self-center"}):a?w.map(A=>{const j=A in s?s[A]:null,k=A in a?a[A]:null,V=typeof j=="number"&&typeof k=="number"?parseFloat((k-j).toFixed(3)):null,ee=V!=null&&V!==0,U=ee&&V>0,B=ee?U?`+${V}`:String(V):null,F=v?.[A],G=n.jsx("span",{className:"dial-small-text text-secondary",children:A}),Z=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[F?n.jsx(T.DialTooltip,{tooltip:F,children:G}):G,B!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",U?"bg-success text-success":"bg-error text-error"),children:B})]}),n.jsxs("div",{className:O,children:[n.jsx(ut,{title:i?.[0],value:j,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:A}),n.jsx(ut,{title:i?.[1],value:k,maxValue:o,colorMap:l,inline:g,titleClassName:S,ariaLabel:`${A} compare`})]})]});return f?n.jsx("button",{type:"button",onClick:()=>f(A,j),className:I.mergeClasses(_,R),children:Z},A):n.jsx("div",{className:_,children:Z},A)}):D.map(([A,j])=>{const k=n.jsx(ut,{title:A,value:j,maxValue:o,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:b}),z=f?n.jsx("button",{type:"button",onClick:()=>f(A,j),className:R,children:k}):k,V=v?.[A];return V?n.jsx(T.DialTooltip,{tooltip:V,triggerClassName:"flex flex-col",children:z},A):n.jsx(h.Fragment,{children:z},A)})})})},es="#FF4E50",ts=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},hr=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const u=ts(c,t);u>=0&&(r[u]+=1)});const a=Math.max(0,s,...r),i=c=>a>0?c/a:0,o={from:0,to:0,color:es,count:s,ratio:i(s),isZeroBucket:!0},l=t.map((c,u)=>({from:c.from,to:c.to,color:c.color,count:r[u],ratio:i(r[u]),isZeroBucket:!1}));return[o,...l]},Kr=e=>e<=0?2:e%2===0?e:e+1,rs=e=>{const t=Kr(e);return[t,t/2,0]},Ot=e=>`${Math.round(e*100)/100}`,Wr=(e,t)=>e===t?Ot(e):`${Ot(e)}-${Ot(t)}`,At=128,ns=(e,t)=>{const r=Wr(e,t);return e===t?`scored ${r}`:`scored between ${r}`},mr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:ns(a.from,a.to)})]}),ss=({title:e,values:t,colorMap:r=er,valueTitle:s="values",showCount:a,isLoading:i,className:o,compareValues:l,valueSetLabel:c,compareValueSetLabel:u})=>{const d=hr(t,r),f=l?hr(l,r):void 0,g=t.length,p=l?.length??0,m=Math.max(g,p),b=Kr(m),v=rs(m),y=C=>C.map(w=>({...w,ratio:b>0?w.count/b:0})),D=y(d),N=f?y(f):void 0,S=(C,w,R,_)=>{if(C.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${C.ratio*100}%`}})});const O=_?{backgroundImage:`repeating-linear-gradient(135deg, ${C.color} 0px, ${C.color} 1px, transparent 1px, transparent 4px)`,borderColor:C.color}:{backgroundColor:C.color};return n.jsx(T.DialTooltip,{placement:"bottom",tooltip:w,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${C.ratio*100}%`,...O},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})})};return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",o),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),i?n.jsx("div",{className:"flex items-center justify-center",style:{height:At},children:n.jsx(x.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:At},children:v.map((C,w)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${w/(v.length-1)*100}%`,transform:"translateY(-50%)"},children:C},C))}),n.jsxs("div",{className:"relative min-w-0",children:[v.map((C,w)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${w/(v.length-1)*100}%`}},C)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:At},children:N?D.map((C,w)=>{const R=N[w],_=`${C.count} out of ${g} ${s}`,O=`${R.count} out of ${p} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[S(C,mr(c,C.count,g,s,C),_,!0),S(R,mr(u,R.count,p,s,R),O,!1)]},w)}):D.map((C,w)=>{const R=`${C.count} out of ${g} ${s}`;return C.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${C.ratio*100}%`}})},w):n.jsx(T.DialTooltip,{placement:"bottom",tooltip:R,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":R,className:I.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${C.ratio*100}%`,backgroundColor:C.color},children:a&&C.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:C.count})})},w)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:D.map((C,w)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Wr(C.from,C.to)},w))})]})]})},as=({value:e,max:t=100,size:r=T.ElementSize.Standard,labelProps:s,valueLabel:a,id:i,className:o,"aria-label":l,...c})=>{const u=h.useId(),d=i??u,f=!!s?.label,g=f?s?.id??`${d}-label`:void 0,p=t>0?t:0,m=Number.isFinite(e)?e:0,b=Math.min(Math.max(m,0),p),v=p>0?b/p*100:0,y=n.jsx("div",{...c,id:d,role:"progressbar","aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":p,"aria-labelledby":g,"aria-label":T.resolveAccessibleName(l,f?void 0:"Progress"),className:I.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===T.ElementSize.Small?"h-1":"h-2",o),children:n.jsx("div",{style:{width:`${v}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!f&&!a?y:n.jsxs("div",{className:"flex w-full flex-col gap-1",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(P.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),y]})},is=7,os=2,ls=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var ft=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(ft||{});const cs=(e,t,r)=>e===t?"active":r<is||Math.abs(e-t)<=os?"adjacent":"far",ds=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=ls(t);return n.jsxs("nav",{"aria-label":"Pagination",className:I.mergeClasses("flex items-center gap-2",s),children:[n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretLeftFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(i=>{const o=cs(i,e,t);return n.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":`Page ${i}`,"aria-current":i===e?"page":void 0,className:I.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",o===ft.Active&&"h-[8px] w-[32px]",o===ft.Adjacent&&"size-[8px]",o===ft.Far&&"size-[4px]")},i)})}),n.jsx(T.DialIconButton,{icon:n.jsx($.IconCaretRightFilled,{size:H.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:T.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},Gt=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:i,onChange:o,className:l,...c})=>{const u=h.useCallback(p=>{o?.(p.target.checked,t)},[o,t]),d=ae("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),f=ae("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx($.IconMinus,{className:f,...H.BASE_ICON_PROPS}):r?n.jsx($.IconCheck,{className:f,...H.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:d,htmlFor:t,"aria-description":c["aria-description"]||M.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(M.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:i,className:"invisible size-0"})]})};var ve=(e=>(e.VALID="valid",e.ERROR="error",e))(ve||{});const us=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"border-accent-secondary text-primary";case ve.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case ve.VALID:return"border-primary text-primary";case ve.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},fs=(e,t)=>{if(t===e.id)switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case ve.VALID:return"bg-accent-secondary";case ve.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ps=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",i="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",o=()=>r===e.id&&e.status===ve.ERROR?n.jsx($.IconExclamationCircle,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===ve.VALID?n.jsx($.IconCheck,{stroke:2,size:H.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ae(a,us(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ae(i,fs(e,r)),children:o()}),n.jsx("span",{children:e.name})]})},gs=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const i=e.findIndex(c=>c.id===t),o=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,o).every(c=>c.status===ve.VALID)||o<i)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,i)=>n.jsx(ps,{currentStep:t,onChangeStep:s,step:a,index:i},a.id))})},_t=e=>(e.toString().split(".")[1]??"").length,hs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:i,labels:o,formatValue:l,onChange:c,className:u,trackClassName:d,fillClassName:f,thumbClassName:g,labelsClassName:p,"aria-label":m,"aria-labelledby":b,...v})=>{const y=h.useRef(null),D=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=_t(s),S=l?l(e):e.toFixed(N),C=h.useCallback(O=>{const A=y.current;if(!A)return e;const j=A.getBoundingClientRect(),k=(O-j.left)/j.width,z=t+k*(r-t),V=_t(s),ee=parseFloat((Math.round((z-t)/s)*s+t).toFixed(V));return Math.min(r,Math.max(t,ee))},[t,r,s,e]),w=h.useCallback(O=>{a||(O.currentTarget.setPointerCapture(O.pointerId),c?.(C(O.clientX)))},[a,C,c]),R=h.useCallback(O=>{a||O.buttons===0||c?.(C(O.clientX))},[a,C,c]),_=h.useCallback(O=>{if(a)return;const A=_t(s),j=V=>parseFloat((Math.round((V-t)/s)*s+t).toFixed(A)),k=V=>Math.min(r,Math.max(t,V));let z=e;switch(O.key){case"ArrowRight":case"ArrowUp":z=k(j(e+s));break;case"ArrowLeft":case"ArrowDown":z=k(j(e-s));break;case"Home":z=t;break;case"End":z=r;break;default:return}O.preventDefault(),z!==e&&c?.(z)},[a,e,s,t,r,c]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",u),...v,children:[i&&n.jsx(Ae.DialLabel,{...i,htmlFor:v.id}),n.jsxs("div",{ref:y,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:w,onPointerMove:R,children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",d)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",f),style:{width:`${D}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":b,className:I.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",g),style:{left:`${D}%`},onKeyDown:_,children:S})]}),o&&n.jsx("div",{className:I.mergeClasses("dial-tiny-text flex text-secondary",p),children:o.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"flex-1 text-center",children:o[1]}),n.jsx("span",{children:o[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o[0]}),n.jsx("span",{className:"ml-auto",children:o[1]})]})})]})},ms=({label:e,text:t,tooltip:r,children:s,postfix:a,className:i})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",s?"":"max-w-[200px]",i),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(T.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),qr=h.createContext({dragDropManager:void 0});function De(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var xr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),br=function(){return Math.random().toString(36).substring(7).split("").join(".")},vr={INIT:"@@redux/INIT"+br(),REPLACE:"@@redux/REPLACE"+br()};function xs(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function bs(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Ds(e))return"date";if(ys(e))return"error";var r=vs(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function vs(e){return typeof e.constructor=="function"?e.constructor.name:null}function ys(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ds(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ke(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=bs(e)),t}function Zr(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?De(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?De(1):"Expected the enhancer to be a function. Instead, received: '"+Ke(r)+"'");return r(Zr)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?De(2):"Expected the root reducer to be a function. Instead, received: '"+Ke(e)+"'");var a=e,i=t,o=[],l=o,c=!1;function u(){l===o&&(l=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?De(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(b){if(typeof b!="function")throw new Error(process.env.NODE_ENV==="production"?De(4):"Expected the listener to be a function. Instead, received: '"+Ke(b)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?De(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return u(),l.push(b),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?De(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,u();var D=l.indexOf(b);l.splice(D,1),o=null}}}function g(b){if(!xs(b))throw new Error(process.env.NODE_ENV==="production"?De(7):"Actions must be plain objects. Instead, the actual type was: '"+Ke(b)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof b.type>"u")throw new Error(process.env.NODE_ENV==="production"?De(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?De(9):"Reducers may not dispatch actions.");try{c=!0,i=a(i,b)}finally{c=!1}for(var v=o=l,y=0;y<v.length;y++){var D=v[y];D()}return b}function p(b){if(typeof b!="function")throw new Error(process.env.NODE_ENV==="production"?De(10):"Expected the nextReducer to be a function. Instead, received: '"+Ke(b));a=b,g({type:vr.REPLACE})}function m(){var b,v=f;return b={subscribe:function(D){if(typeof D!="object"||D===null)throw new Error(process.env.NODE_ENV==="production"?De(11):"Expected the observer to be an object. Instead, received: '"+Ke(D)+"'");function N(){D.next&&D.next(d())}N();var S=v(N);return{unsubscribe:S}}},b[xr]=function(){return this},b}return g({type:vr.INIT}),s={dispatch:g,subscribe:f,getState:d,replaceReducer:p},s[xr]=m,s}function q(e,t,...r){if(Cs()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function Cs(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Ns(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function Is(e,t){return e.filter(r=>r!==t)}function Yr(e){return typeof e=="object"}function Ss(e,t){const r=new Map,s=i=>{r.set(i,r.has(i)?r.get(i)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((i,o)=>{i===1&&a.push(o)}),a}function js(e,t){return e.filter(r=>t.indexOf(r)>-1)}const tr="dnd-core/INIT_COORDS",vt="dnd-core/BEGIN_DRAG",rr="dnd-core/PUBLISH_DRAG_SOURCE",yt="dnd-core/HOVER",Dt="dnd-core/DROP",Ct="dnd-core/END_DRAG";function yr(e,t){return{type:tr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Ts={type:tr,payload:{clientOffset:null,sourceClientOffset:null}};function ws(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:o}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(yr(i)),Es(r,l,c);const u=_s(r,l);if(u==null){e.dispatch(Ts);return}let d=null;if(i){if(!o)throw new Error("getSourceClientOffset must be defined");Os(o),d=o(u)}e.dispatch(yr(i,d));const g=c.getSource(u).beginDrag(l,u);if(g==null)return;As(g),c.pinSource(u);const p=c.getSourceType(u);return{type:vt,payload:{itemType:p,item:g,sourceId:u,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function Es(e,t,r){q(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){q(r.getSource(s),"Expected sourceIds to be registered.")})}function Os(e){q(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function As(e){q(Yr(e),"Item must be an object.")}function _s(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function Rs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ks(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Rs(e,a,r[a])})}return e}function Ps(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();Ls(s),Bs(s).forEach((o,l)=>{const c=Ms(o,l,a,s),u={type:Dt,payload:{dropResult:ks({},r,c)}};e.dispatch(u)})}}function Ls(e){q(e.isDragging(),"Cannot call drop while not dragging."),q(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Ms(e,t,r,s){const a=r.getTarget(e);let i=a?a.drop(s,e):void 0;return Fs(i),typeof i>"u"&&(i=t===0?{}:s.getDropResult()),i}function Fs(e){q(typeof e>"u"||Yr(e),"Drop result must either be an object or undefined.")}function Bs(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function zs(e){return function(){const r=e.getMonitor(),s=e.getRegistry();$s(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Ct}}}function $s(e){q(e.isDragging(),"Cannot call endDrag while not dragging.")}function Ut(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Hs(e){return function(r,{clientOffset:s}={}){Vs(r);const a=r.slice(0),i=e.getMonitor(),o=e.getRegistry(),l=i.getItemType();return Us(a,o,l),Gs(a,i,o),Ks(a,i,o),{type:yt,payload:{targetIds:a,clientOffset:s||null}}}}function Vs(e){q(Array.isArray(e),"Expected targetIds to be an array.")}function Gs(e,t,r){q(t.isDragging(),"Cannot call hover while not dragging."),q(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];q(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(a);q(i,"Expected targetIds to be registered.")}}function Us(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],i=t.getTargetType(a);Ut(i,r)||e.splice(s,1)}}function Ks(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ws(e){return function(){if(e.getMonitor().isDragging())return{type:rr}}}function qs(e){return{beginDrag:ws(e),publishDragSource:Ws(e),hover:Hs(e),drop:Ps(e),endDrag:zs(e)}}class Zs{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(i){return(...o)=>{const l=i.apply(t,o);typeof l<"u"&&r(l)}}const a=qs(this);return Object.keys(a).reduce((i,o)=>{const l=a[o];return i[o]=s(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Ys(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Xr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xs(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Xr(Ys(t,s),r)}function Qs(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Xr(t,r)}const rt=[],nr=[];rt.__IS_NONE__=!0;nr.__IS_ALL__=!0;function Js(e,t){return e===rt?!1:e===nr||typeof t>"u"?!0:js(t,e).length>0}class ea{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;q(typeof t=="function","listener must be a function."),q(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),l=o.stateId;try{l===a||l===a+1&&!Js(o.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){q(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return q(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(q(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return Ut(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(q(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),i=this.getItemType();if(i&&!Ut(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const l=o.indexOf(t);return s?l===o.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xs(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Qs(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Dr=typeof global<"u"?global:self,Qr=Dr.MutationObserver||Dr.WebKitMutationObserver;function Jr(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function ta(e){let t=1;const r=new Qr(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const ra=typeof Qr=="function"?ta:Jr;class na{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=ra(this.flush),this.requestErrorThrow=Jr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class sa{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class aa{create(t){const r=this.freeTasks,s=r.length?r.pop():new sa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const en=new na,ia=new aa(en.registerPendingError);function oa(e){en.enqueueTask(ia.create(e))}const sr="dnd-core/ADD_SOURCE",ar="dnd-core/ADD_TARGET",ir="dnd-core/REMOVE_SOURCE",Nt="dnd-core/REMOVE_TARGET";function la(e){return{type:sr,payload:{sourceId:e}}}function ca(e){return{type:ar,payload:{targetId:e}}}function da(e){return{type:ir,payload:{sourceId:e}}}function ua(e){return{type:Nt,payload:{targetId:e}}}function fa(e){q(typeof e.canDrag=="function","Expected canDrag to be a function."),q(typeof e.beginDrag=="function","Expected beginDrag to be a function."),q(typeof e.endDrag=="function","Expected endDrag to be a function.")}function pa(e){q(typeof e.canDrop=="function","Expected canDrop to be a function."),q(typeof e.hover=="function","Expected hover to be a function."),q(typeof e.drop=="function","Expected beginDrag to be a function.")}function Kt(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Kt(r,!1));return}q(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ce;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ce||(Ce={}));let ga=0;function ha(){return ga++}function ma(e){const t=ha().toString();switch(e){case Ce.SOURCE:return`S${t}`;case Ce.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Cr(e){switch(e[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,i]}=r.next();if(i===t)return!0;s=!!a}while(!s);return!1}class xa{addSource(t,r){Kt(t),fa(r);const s=this.addHandler(Ce.SOURCE,t,r);return this.store.dispatch(la(s)),s}addTarget(t,r){Kt(t,!0),pa(r);const s=this.addHandler(Ce.TARGET,t,r);return this.store.dispatch(ca(s)),s}containsHandler(t){return Nr(this.dragSources,t)||Nr(this.dropTargets,t)}getSource(t,r=!1){return q(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return q(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Cr(t)===Ce.SOURCE}isTargetId(t){return Cr(t)===Ce.TARGET}removeSource(t){q(this.getSource(t),"Expected an existing source."),this.store.dispatch(da(t)),oa(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){q(this.getTarget(t),"Expected an existing target."),this.store.dispatch(ua(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);q(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){q(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=ma(t);return this.types.set(a,r),t===Ce.SOURCE?this.dragSources.set(a,s):t===Ce.TARGET&&this.dropTargets.set(a,s),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const ba=(e,t)=>e===t;function va(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function ya(e,t,r=ba){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function Da(e=rt,t){switch(t.type){case yt:break;case sr:case ar:case Nt:case ir:return rt;case vt:case rr:case Ct:case Dt:default:return nr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=Ss(r,s);if(!(a.length>0||!ya(r,s)))return rt;const o=s[s.length-1],l=r[r.length-1];return o!==l&&(o&&a.push(o),l&&a.push(l)),a}function Ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Ca(e,a,r[a])})}return e}const Ir={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ia(e=Ir,t){const{payload:r}=t;switch(t.type){case tr:case vt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case yt:return va(e.clientOffset,r.clientOffset)?e:Na({},e,{clientOffset:r.clientOffset});case Ct:case Dt:return Ir;default:return e}}function Sa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Sa(e,a,r[a])})}return e}const ja={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ta(e=ja,t){const{payload:r}=t;switch(t.type){case vt:return We({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case rr:return We({},e,{isSourcePublic:!0});case yt:return We({},e,{targetIds:r.targetIds});case Nt:return e.targetIds.indexOf(r.targetId)===-1?e:We({},e,{targetIds:Is(e.targetIds,r.targetId)});case Dt:return We({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ct:return We({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function wa(e=0,t){switch(t.type){case sr:case ar:return e+1;case ir:case Nt:return e-1;default:return e}}function Ea(e=0){return e+1}function Oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Oa(e,a,r[a])})}return e}function _a(e={},t){return{dirtyHandlerIds:Da(e.dirtyHandlerIds,{type:t.type,payload:Aa({},t.payload,{prevTargetIds:Ns(e,"dragOperation.targetIds",[])})}),dragOffset:Ia(e.dragOffset,t),refCount:wa(e.refCount,t),dragOperation:Ta(e.dragOperation,t),stateId:Ea(e.stateId)}}function Ra(e,t=void 0,r={},s=!1){const a=ka(s),i=new ea(a,new xa(a)),o=new Zs(a,i),l=e(o,t,r);return o.receiveBackend(l),o}function ka(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Zr(_a,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Pa(e,t){if(e==null)return{};var r=La(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function La(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Sr=0;const pt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Ma=h.memo(function(t){var{children:r}=t,s=Pa(t,["children"]);const[a,i]=Fa(s);return h.useEffect(()=>{if(i){const o=tn();return++Sr,()=>{--Sr===0&&(o[pt]=null)}}},[]),n.jsx(qr.Provider,{value:a,children:r})});function Fa(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=Ba(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function Ba(e,t=tn(),r,s){const a=t;return a[pt]||(a[pt]={dragDropManager:Ra(e,t,r,s)}),a[pt]}function tn(){return typeof global<"u"?global:window}var Rt,jr;function za(){return jr||(jr=1,Rt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,i;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=s;a--!==0;){var o=i[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Rt}var $a=za();const Ha=x.getDefaultExportFromCjs($a),Ve=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Va(e,t,r){const[s,a]=h.useState(()=>t(e)),i=h.useCallback(()=>{const o=t(e);Ha(s,o)||(a(o),r&&r())},[s,e,r]);return Ve(i),[s,i]}function Ga(e,t,r){const[s,a]=Va(e,t,r);return Ve(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(a,{handlerIds:[o]})},[e,a]),s}function rn(e,t,r){return Ga(t,e||(()=>({})),()=>r.reconnect())}function nn(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function Ua(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function Ka(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let kt=!1,Pt=!1;class Wa{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){q(!kt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kt=!1}}isDragging(){if(!this.sourceId)return!1;q(!Pt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Pt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Lt=!1;class qa{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;q(!Lt,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Lt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lt=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Za(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ya(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function Wt(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<i.length;c++){const u=i[c];if(!l(u))return!1;const d=e[u],f=t[u];if(a=void 0,a===!1||a===void 0&&d!==f)return!1}return!0}function qt(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xa(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Qa(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const i=t;return e(i,r),i}const s=t;return Xa(s),Ja(s,r?i=>e(i,r):e)}}function sn(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Qa(s);t[r]=()=>a}}),t}function Tr(e,t){typeof e=="function"?e(t):e.current=t}function Ja(e,t){const r=e.ref;return q(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Tr(r,s),Tr(t,s)}}):h.cloneElement(e,{ref:t})}class ei{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Wt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Wt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=sn({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,qt(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,qt(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class ti{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Wt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=sn({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,qt(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Xe(){const{dragDropManager:e}=h.useContext(qr);return q(e!=null,"Expected drag drop context"),e}function ri(e,t){const r=Xe(),s=h.useMemo(()=>new ei(r.getBackend()),[r]);return Ve(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ve(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function ni(){const e=Xe();return h.useMemo(()=>new Wa(e),[e])}class si{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:i}=s;return i?i(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function ai(e,t,r){const s=h.useMemo(()=>new si(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function ii(e){return h.useMemo(()=>{const t=e.type;return q(t!=null,"spec.type must be defined"),t},[e])}function oi(e,t,r){const s=Xe(),a=ai(e,t,r),i=ii(e);Ve(function(){if(i!=null){const[l,c]=Ya(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,i])}function li(e,t){const r=nn(e,t);q(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const s=ni(),a=ri(r.options,r.previewOptions);return oi(r,s,a),[rn(r.collect,s,a),Ua(a),Ka(a)]}function ci(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function di(e){const t=Xe(),r=h.useMemo(()=>new ti(t.getBackend()),[t]);return Ve(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ui(){const e=Xe();return h.useMemo(()=>new qa(e),[e])}function fi(e){const{accept:t}=e;return h.useMemo(()=>(q(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class pi{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function gi(e,t){const r=h.useMemo(()=>new pi(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function hi(e,t,r){const s=Xe(),a=gi(e,t),i=fi(e);Ve(function(){const[l,c]=Za(i,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,i.map(o=>o.toString()).join("|")])}function or(e,t){const r=nn(e,t),s=ui(),a=di(r.options);return hi(r,s,a),[rn(r.collect,s,a),ci(a)]}const wr="column",mi="flex items-center",xi="mr-3 cursor-move text-secondary",bi=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:i="Drag item"})=>{const o=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:u},d,f]=li(()=>({type:wr,item:{id:e,originalIndex:c},collect:p=>{const m=p.getItem();return{isDragging:p.isDragging()&&m?.id===e}},end:(p,m)=>{if(!p)return;!m.didDrop()&&typeof a=="function"&&p.originalIndex>-1&&a(p.id,p.originalIndex)}}),[e,c,a]),[,g]=or(()=>({accept:wr,hover:p=>{if(!(!p||p.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(p.id,m)}}}),[s,a,e]);return f(g(l)),d(o),n.jsxs("div",{ref:l,className:I.mergeClasses(mi,r),style:{opacity:u?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:o,className:xi,"aria-label":i,children:n.jsx($.IconGripVertical,{...H.BASE_ICON_PROPS})}),t]})},It=({iconClassName:e,label:t,...r})=>t?n.jsx(x.DialDangerButton,{...r,label:t,appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}):n.jsx(M.DialDangerIconButton,{...r,appearance:T.ButtonAppearance.Ghost,icon:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS,className:e||""})}),vi=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-textarea dial-input px-3 py-2",u.invalid&&"dial-input-error",u.disabled&&"dial-input-disable",i?"resize":"resize-none",e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-1",a),children:[o&&n.jsx(Ae.DialLabel,{...o,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(x.DialErrorText,{text:s}),!s&&n.jsx(x.DialCaptionText,{text:l})]})},yi="inline-flex items-center rounded bg-layer-3",Di="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",Ci="relative z-10 bg-controls-accent-primary-alpha-active text-primary",Ni="text-secondary hover:text-primary",Ii="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",Si=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:i})=>{const o=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const u=c.findIndex(g=>g.value===t);let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=(u+1)%c.length;break;case"ArrowLeft":case"ArrowUp":d=(u-1+c.length)%c.length;break;case"Home":d=0;break;case"End":d=c.length-1;break;default:return}l.preventDefault();const f=c[d];f&&f.value!==t&&r(f.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":i,className:I.mergeClasses(yi,a),children:e.map((l,c)=>{const u=l.value===t,d=c===0,f=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":u,tabIndex:u?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:o,className:I.mergeClasses(Di,!f&&"-mr-px",d&&"rounded-l",f&&"rounded-r",u?Ci:Ni,g&&Ii),children:[l.icon,l.label]},l.value)})})},Mt=8,ji=24,an=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:i,errorText:o,invalid:l,disabled:c,collapseTagOverflow:u=!1,readOnly:d=!1,containerClassName:f,tagClassName:g,onChange:p})=>{const m=h.useRef(null),b=h.useRef([]),v=h.useRef(null),[y,D]=h.useState(e),[N,S]=h.useState(""),[C,w]=h.useState(!1),[R,_]=h.useState(e.length),O=h.useCallback(B=>F=>{b.current[B]=F},[]),A=h.useCallback(()=>{if(!u)return;const B=m.current;if(!B)return;const F=B.offsetWidth;if(F===0)return;const G=v.current?.offsetWidth??0,te=F-(d?0:ji)-Mt;let re=0,W=0;for(let se=0;se<y.length;se++){const de=b.current[se];if(!de)continue;const ue=de.offsetWidth+Mt;if(re+ue>te)break;re+=ue,W++}if(W<y.length&&W>0)for(;re+G>te&&W>0;){W--;const se=b.current[W]?.offsetWidth??0;re-=se+Mt}_(W)},[u,d,y.length]),j=B=>{const F=B.trim().replace(/,$/,"");if(F&&!y.includes(F)){const G=[F,...y];D(G),p?.(G)}},k=B=>{(B.key===","||B.key==="Enter")&&(B.preventDefault(),j(N),S(""))},z=()=>{N.trim()&&(j(N),S(""))},V=B=>{const F=y.filter((G,Z)=>Z!==B);D(F),p?.(F)},ee=()=>o?n.jsx(x.DialErrorText,{text:o}):i?n.jsx(x.DialCaptionText,{text:i}):null;h.useEffect(()=>{if(u)return;const B=new ResizeObserver(()=>{if(m.current){const F=m.current.scrollHeight>m.current.clientHeight+10;w(F)}});return m.current&&B.observe(m.current),()=>B.disconnect()},[y,u]),h.useEffect(()=>{if(!u){_(y.length);return}_(y.length);const B=new ResizeObserver(()=>{A()}),F=m.current;return F&&B.observe(F),A(),()=>B.disconnect()},[u,A,y]),h.useEffect(()=>{D(e)},[JSON.stringify(e)]);const U=n.jsxs("div",{ref:m,className:ae("flex gap-2 items-center relative",u?"flex-nowrap overflow-hidden w-full min-w-0":ae("flex-wrap",C?"flex-col-reverse":"flex-row"),f),children:[(u?y.slice(0,R):y).map((B,F)=>n.jsx(He,{label:B,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>V(F):void 0},B+F)),u&&R<y.length&&n.jsx(T.DialTooltip,{tooltip:y.slice(R).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(He,{label:`+${y.length-R}`})}),!d&&n.jsx("input",{id:s,type:"text",value:N,onChange:B=>S(B.target.value),onKeyDown:k,onBlur:z,className:ae("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",u?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),u&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[y.map((B,F)=>n.jsx("div",{ref:O(F),className:"inline-flex shrink-0",children:n.jsx(He,{label:B,className:g,closable:!c&&!d,onRemove:!c&&!d?()=>V(F):void 0})},`measure-${B}-${F}`)),n.jsx("div",{ref:v,className:"inline-flex shrink-0",children:n.jsx(He,{label:`+${y.length}`})})]})]});return d?U:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Ae.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ae("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:U}),ee()]})},on=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(an,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Ft=e=>gr.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},gr.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),ln=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:i,onOpen:o,elementId:l,errorText:c,invalid:u,emptyValueText:d,placeholder:f,editable:g=!1,onValueChange:p,collapseTagOverflow:m=!1,iconBefore:b})=>{const v=Array.isArray(s)&&s.length>0,y=typeof s=="string"&&!!s.trim(),D=v||y?s:f?void 0:d,N=r?void 0:o,S=h.useCallback(_=>{p?.(_.target.value)},[p]),C=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ae("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[b&&n.jsx(M.DialIcon,{icon:b}),n.jsx("input",{type:"text",className:ae("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:f||d,onChange:S,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:o,"aria-label":"open-popup",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]}),n.jsx(x.DialErrorText,{text:c})]}),w=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ae("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",i,r&&"dial-input-disable",(c||u)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[b&&n.jsx(M.DialIcon,{icon:b}),n.jsx(T.DialTooltip,{tooltip:D==null?void 0:String(D),children:D||!f?n.jsx("span",{className:a,children:D}):n.jsx("span",{className:"text-secondary",children:f})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})}),n.jsx(x.DialErrorText,{text:c})]}),R=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ae("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[b&&n.jsx(M.DialIcon,{icon:b}),n.jsx(on,{placeholder:f,selectedItems:D,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(M.DialIcon,{icon:n.jsx(Ft,{role:"img",width:H.BASE_ICON_SIZE,height:H.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[v?R():g?C():w(),t&&Wn.createPortal(e,document.body)]})},Ti=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:i,valueClassName:o,inputClassName:l,emptyValueText:c,placeholder:u,onClose:d,header:f,portalId:g,onApply:p,onCancel:m,cancelButtonTitle:b="Cancel",applyButtonTitle:v="Apply",isValid:y,selectedRadioValue:D,onChangeRadioField:N,id:S,size:C=x.PopupSize.Md})=>{const[w,R]=h.useState(!1),_=h.useCallback(()=>{r||R(!0)},[r]),O=h.useCallback(()=>{R(!1),d?.()},[d]),A=h.useCallback(()=>{m?.(),O()},[m,O]),j=h.useCallback(()=>{p(),O()},[p,O]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Ae.DialLabel,{label:e,htmlFor:t}),n.jsx(ln,{disabled:r,open:w,selectedValue:i??a.find(k=>k.id===s)?.name,valueClassName:o,inputClassName:ae(l,"py-2","px-3"),emptyValueText:c,placeholder:u,onOpen:_,children:n.jsx(x.DialPopup,{open:w,onClose:A,header:f,portalId:g,size:C,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(x.DialNeutralButton,{label:b,onClick:A}),n.jsx(x.DialPrimaryButton,{label:v,onClick:j,disabled:!y})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(x.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:D,onChange:N,elementId:S,orientation:x.RadioGroupOrientation.Column})})})})]})},wi="Create",Ei="Cancel",Oi="flex items-center justify-end gap-2 px-6 py-3",Ai=({header:e,open:t=!1,submitLabel:r=wi,cancelLabel:s=Ei,isLoading:a=!1,disableSubmitButton:i=!1,className:o,submitClassName:l,onClose:c,onSubmit:u,onCancel:d,children:f,dividers:g=!0,size:p=x.PopupSize.Md,footer:m})=>{const b=a?null:n.jsxs("div",{className:Oi,children:[n.jsx(x.DialNeutralButton,{label:s,onClick:()=>d?d():c?.()}),n.jsx(x.DialPrimaryButton,{className:l,label:r,disabled:i,onClick:()=>u()})]}),v=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(x.DialLoader,{size:50})}):f??null,[f,a]);return n.jsx(x.DialPopup,{open:t,header:e,className:o,dividers:g,onClose:()=>c?.(),footer:m??b,size:p,children:v()})},_i=/^0+\.(\d+)?$/,Ri=/^0+/,Zt=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=d=>!d||d==="-"?d:String(d)?.match(_i)?String(d)?.replace(Ri,"0"):Number(d),c=d=>{if([".","-","+","e","E"].includes(d.key)){d.preventDefault();return}x.handleKeyDown(d,"number",r,s)},u=d=>{const f=d.clipboardData.getData("text"),g=f.replace(/\D/g,"");if(g!==f&&(d.preventDefault(),g)){const p=d.currentTarget,m=p.selectionStart??0,b=p.selectionEnd??0,v=p.value.slice(0,m)+g+p.value.slice(b);t?.(l(v))}};return n.jsx(x.DialInput,{type:"number",min:r,max:s,onChange:d=>t?.(l(d)),onKeyDown:e?c:a,onPaste:e?u:i,...o})},ki=({onClick:e})=>n.jsx($.IconEyeOff,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),Pi=({onClick:e})=>n.jsx($.IconEye,{...H.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),cn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(x.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(ki,{onClick:()=>s(!1)}):n.jsx(Pi,{onClick:()=>s(!0)})})},dn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(o=>o.value===s)?.label??s,i=e.find(o=>o.value===s)?.icon;return n.jsx(He,{label:a,onRemove:o=>r?.(o,s),icon:i?n.jsx(M.DialIcon,{icon:i}):null,className:"max-w-full"},s)})});var ht=(e=>(e.Sm="sm",e.Md="md",e))(ht||{}),mt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(mt||{});const Li="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",Mi="w-full rounded flex flex-col",nt="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",Fi="bg-accent-primary-alpha",Yt="bg-accent-primary-alpha border-l border-accent-primary border-1",xt="opacity-75",Bi=352,zi=4,$i=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),Hi=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:i,context:o,getReferenceProps:l,getFloatingProps:c}=M.useSubMenuFloating(zi,"listbox",!!e.disabled),u=e.children?.some(d=>t.includes(d.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!u,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ae(nt,u&&Yt,e.disabled&&xt),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(M.DialIcon,{icon:e.icon}),n.jsx(M.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx($.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(M.SubMenuPanel,{refs:a,floatingStyles:i,context:o,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(d=>{const f=t.includes(d.value);return n.jsx("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":!!d.disabled,disabled:d.disabled,className:ae(nt,f&&Yt,d.disabled&&xt),onClick:()=>!d.disabled&&r(d.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[d.icon&&n.jsx(M.DialIcon,{icon:d.icon}),n.jsx(M.DialEllipsisTooltip,{text:d.labelNode??d.label})]})},d.value)})})]})},ke=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:i=mt.Primary,size:o=ht.Md,prefix:l,customSelectedValue:c,placeholder:u="Select...",searchable:d=!1,searchSize:f=T.ElementSize.Standard,searchPlaceholder:g,selectAll:p=!1,invalid:m,selectAllLabel:b="Select all",emptyStateTitle:v="No options available",emptyStateDescription:y,emptyStateIcon:D,disabled:N=!1,className:S,listClassName:C,closable:w=!1,header:R,footer:_,onClose:O,onChange:A,inlineSearch:j=!1,dismissRef:k,onFooterClick:z,open:V,onOpenChange:ee,onInlineQueryChange:U,customMultiSelectTagsRenderer:B})=>{const F=h.useId(),[G,Z]=h.useState(!1),te=V!==void 0,re=te?!!V:G,W=h.useCallback(E=>{te||Z(E),ee?.(E)},[te,ee]),[se,de]=h.useState(j&&c||""),ue=h.useRef(null),ce=h.useCallback(E=>{E!==se&&(de(E||""),U?.(E||""))},[U,se]),pe=s!==void 0,[ge,fe]=h.useState(a),K=pe?s:ge,X=h.useMemo(()=>t?Array.isArray(K)?K:[]:typeof K=="string"?[K]:[],[K,t]),Ne=h.useMemo(()=>{const E=se.trim().toLowerCase();return E?e.filter(Q=>Q.label.toLowerCase().includes(E)):e},[e,se]);h.useEffect(()=>{!re&&!j&&ce("")},[j,re,ce]);const Me=h.useRef(c);h.useEffect(()=>{j&&c!==Me.current&&(re||(Me.current=c,ce(c||"")))},[c,j,re,ce]);const he=h.useCallback(E=>{pe||fe(E),A?.(E)},[pe,A]),Fe=h.useCallback(E=>{if(t){const Q=new Set(X);Q.has(E)?Q.delete(E):Q.add(E),he(Array.from(Q));return}if(he(E),j){const Q=e.find(xe=>xe.value===E)??e.flatMap(xe=>xe.children??[]).find(xe=>xe.value===E);Q&&ce(Q.label)}W(!1)},[t,he,j,W,X,e,ce]),je=h.useCallback((E,Q)=>{if(E.stopPropagation(),!t){he("");return}const xe=X.filter(Et=>Et!==Q);he(xe)},[t,X,he]),ne=h.useMemo(()=>Ne.filter(E=>!E.disabled),[Ne]),_e=h.useMemo(()=>ne.filter(E=>X.includes(E.value)).length,[ne,X]),Ie=h.useCallback(E=>{j&&!t&&!E&&Fe(se),W(E)},[Fe,j,t,se,W]),{allSelectedInFiltered:Be,someSelectedInFiltered:tt}=h.useMemo(()=>{const E=ne.length>0&&_e===ne.length;return{allSelectedInFiltered:E,someSelectedInFiltered:_e>0&&!E}},[ne,_e]),ye=h.useCallback(()=>{if(!(!t||ne.length===0))if(Be){const E=new Set(ne.map(Q=>Q.value));he(X.filter(Q=>!E.has(Q)))}else{const E=new Set(X);ne.forEach(Q=>E.add(Q.value)),he(Array.from(E))}},[Be,t,ne,X,he]),ze=X.length>0;h.useEffect(()=>{re&&j&&!t&&!N&&requestAnimationFrame(()=>{const E=ue.current;if(!E)return;E.focus();const Q=E.value?.length??0;E.setSelectionRange?.(Q,Q)})},[re,j,t,N]);const Re=!t&&ze?X[0]:void 0,me=h.useMemo(()=>Re?e.find(E=>E.value===Re)??e.flatMap(E=>E.children??[]).find(E=>E.value===Re):void 0,[e,Re]),wt=h.useCallback(()=>t?ze?B?.(e,X,je)||n.jsx(dn,{options:e,selectedValues:X,handleRemoveTag:je}):n.jsx("span",{className:"text-secondary truncate",children:u}):me?n.jsxs(n.Fragment,{children:[me.icon&&n.jsx(M.DialIcon,{icon:me.icon}),n.jsx(M.DialEllipsisTooltip,{text:me.labelNode??(l?`${l} ${me.label}`:me.label)}),me?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:me.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:u}),[ze,t,c,l,s,u,me,e,X,je,B]);h.useImperativeHandle(k,()=>({dismiss:()=>{W(!1)}}));const Te=h.useCallback(()=>{ce(X.length===1?me?.label??se:"")},[se,X.length,ce,me?.label]),$e=h.useCallback(()=>{N||(W(!re),j&&!t&&(Te(),ue.current?.focus()))},[N,j,re,t,Te,W]);return n.jsx(M.DialDropdown,{open:re,onOpenChange:Ie,disabled:N,closable:w,onClose:O,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:Bi,listClassName:C,renderOverlay:()=>n.jsxs("div",{id:`list-${r||F}`,role:"listbox","aria-multiselectable":t||void 0,className:Mi,children:[R&&n.jsx(n.Fragment,{children:typeof R=="function"?R():R}),(d||w)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&n.jsx(x.DialSearch,{size:f,placeholder:g,onChange:ce,value:se,id:`search-${r||F}`,containerClassName:I.mergeClasses(x.SIZE_CONFIG[f].containerClassName,"w-full")}),w&&n.jsx(x.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM}),onClick:E=>{O?.(E),W(!1)}})]}),t&&p&&ne.length>0&&n.jsx("div",{className:ae(nt,"mt-2"),children:n.jsx(Gt,{id:`${r||F}-selectAll`,label:b,checked:Be,indeterminate:tt,onChange:ye,ariaLabel:b})}),n.jsx("div",{className:ae("overflow-y-auto max-h-[352px]",j&&Ne.length===0?"":"py-1"),children:Ne.length===0?!j&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:D??n.jsx($.IconClipboardX,{size:H.DIAL_ICON_SIZE.LG,stroke:.5}),title:v,description:y})}):Ne.map(E=>{const Q=X.includes(E.value);return t?n.jsxs("div",{role:"option","aria-selected":Q,"aria-disabled":!!E.disabled,className:ae(nt,Q&&Fi,E.disabled&&xt,"w-full"),children:[n.jsx(Gt,{id:`${r||F}-${E.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[E.icon&&n.jsx(M.DialIcon,{icon:E.icon}),n.jsx("span",{className:"truncate",children:E.labelNode??E.label})]}),checked:Q,disabled:E.disabled,onChange:()=>!E.disabled&&Fe(E.value),ariaLabel:E.label}),E.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:E.description})]},E.value):E.children?.length?n.jsx(Hi,{opt:E,selectedValues:X,onSelect:Fe},E.value):n.jsx("button",{role:"option",type:"button","aria-selected":Q,"aria-disabled":!!E.disabled,disabled:E.disabled,className:ae(nt,Q&&Yt,E.disabled&&xt),onClick:()=>!E.disabled&&Fe(E.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[E.icon&&n.jsx(M.DialIcon,{icon:E.icon}),n.jsx(M.DialEllipsisTooltip,{text:E.labelNode??E.label}),E.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:E.description})]})},E.value)})}),_&&n.jsx("div",{onClick:E=>{z?.(E),z&&W(!1)},children:typeof _=="function"?_():_})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":`list-${r||F}`,className:I.mergeClasses(Li,N&&"opacity-75 !cursor-not-allowed !border-primary",o===ht.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",i===mt.Secondary?"!bg-layer-4 !h-auto":"",S),onMouseDown:E=>{N||j&&!t&&(Te(),E.preventDefault())},onClick:()=>{$e()},onKeyDown:E=>{(E.key===" "||E.code==="Space")&&(E.preventDefault(),$e())},children:[j&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||F}`,type:"text",placeholder:g??u,value:se||"",onChange:E=>ce(E.currentTarget.value.trimStart()),onFocus:()=>!N&&W(!0),onMouseDown:E=>{Te(),E.stopPropagation()},onClick:E=>{E.stopPropagation()},onKeyDown:E=>{E.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:ue,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:wt()}),!j&&n.jsx(M.DialIcon,{icon:$i,className:ae("text-primary",re&&"rotate-180")})]})})},Vi=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:i,id:o,caption:l,readonly:c,value:u,defaultEmptyText:d,...f})=>{const g=h.useCallback(()=>{if(!u||Array.isArray(u)&&u.length===0)return d??"None";if(Array.isArray(u))return n.jsx(dn,{options:f.options,selectedValues:u});{const p=f.options?.find(m=>m.value===u);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||u})}},[u,f.options,d]);return n.jsx(x.DialFormItem,{id:o,label:e,required:t,description:l,error:i,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:d,children:n.jsx(ke,{className:a,value:u,elementId:o,invalid:!!i,...f})})};function un(e){let t=null;return()=>(t==null&&(t=e()),t)}function Gi(e,t){return e.filter(r=>r!==t)}function Ui(e,t){const r=new Set,s=i=>r.add(i);e.forEach(s),t.forEach(s);const a=[];return r.forEach(i=>a.push(i)),a}class Ki{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ui(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Gi(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const St="__NATIVE_FILE__",fn="__NATIVE_URL__",pn="__NATIVE_TEXT__",gn="__NATIVE_HTML__",Er=Object.freeze(Object.defineProperty({__proto__:null,FILE:St,HTML:gn,TEXT:pn,URL:fn},Symbol.toStringTag,{value:"Module"}));function Bt(e,t,r){const s=t.reduce((a,i)=>a||e.getData(i),"");return s??r}const Xt={[St]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[gn]:{exposeProperties:{html:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[fn]:{exposeProperties:{urls:(e,t)=>Bt(e,t,"").split(`
2
- `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[pn]:{exposeProperties:{text:(e,t)=>Bt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function qi(e,t){const r=Xt[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new Wi(r);return s.loadDataTransfer(t),s}function zt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Xt).filter(r=>{const s=Xt[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Zi=un(()=>/firefox/i.test(navigator.userAgent)),hn=un(()=>!!window.safari);class Or{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:i,c3s:o}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,u=o.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const p=r[d];if(p<t)c=d+1;else if(p>t)u=d-1;else return s[d]}l=Math.max(0,u);const f=t-r[l],g=f*f;return s[l]+a[l]*f+i[l]*g+o[l]*f*g}constructor(t,r){const{length:s}=t,a=[];for(let p=0;p<s;p++)a.push(p);a.sort((p,m)=>t[p]<t[m]?-1:1);const i=[],o=[];let l,c;for(let p=0;p<s-1;p++)l=t[p+1]-t[p],c=r[p+1]-r[p],i.push(l),o.push(c/l);const u=[o[0]];for(let p=0;p<i.length-1;p++){const m=o[p],b=o[p+1];if(m*b<=0)u.push(0);else{l=i[p];const v=i[p+1],y=l+v;u.push(3*y/((y+v)/m+(y+l)/b))}}u.push(o[o.length-1]);const d=[],f=[];let g;for(let p=0;p<u.length-1;p++){g=o[p];const m=u[p],b=1/i[p],v=m+u[p+1]-g-g;d.push((g-m-v)*b),f.push(v*b*b)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=d,this.c3s=f}}const Yi=1;function mn(e){const t=e.nodeType===Yi?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function ct(e){return{x:e.clientX,y:e.clientY}}function Xi(e){var t;return e.nodeName==="IMG"&&(Zi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Qi(e,t,r,s){let a=e?t.width:r,i=e?t.height:s;return hn()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function Ji(e,t,r,s,a){const i=Xi(t),l=mn(i?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:d}=e,{anchorX:f,anchorY:g}=s,{dragPreviewWidth:p,dragPreviewHeight:m}=Qi(i,t,u,d),b=()=>{let w=new Or([0,.5,1],[c.y,c.y/d*m,c.y+m-d]).interpolate(g);return hn()&&i&&(w+=(window.devicePixelRatio-1)*m),w},v=()=>new Or([0,.5,1],[c.x,c.x/u*p,c.x+p-u]).interpolate(f),{offsetX:y,offsetY:D}=a,N=y===0||y,S=D===0||D;return{x:N?y:v(),y:S?D:b()}}class eo{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){to(e,a,r[a])})}return e}class ro{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=o=>this.handleDragStart(o,t),i=o=>this.handleSelectStart(o);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",i),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=o=>this.handleDragEnter(o,t),a=o=>this.handleDragOver(o,t),i=o=>this.handleDrop(o,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",i),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Ar({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Ar({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Er).some(r=>Er[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=qi(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,s){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&mn(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const o=ct(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:l}=a,c=zt(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),g=this.sourcePreviewNodes.get(d)||f;if(g){const{anchorX:p,anchorY:m,offsetX:b,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),N=Ji(f,g,o,{anchorX:p,anchorY:m},{offsetX:b,offsetY:v});l.setDragImage(g,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=zt(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ct(a)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=ct(a),this.scheduleHover(i),(i||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else zt(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ct(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new eo(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ki(this.isNodeInDocument)}}const no=function(t,r,s){return new ro(t,r,s)},so=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:i,multiple:o,fileFormatError:l,fileCountError:c,fileSizeError:u,getIsFileFormatError:d,getIsFileSizeError:f})=>{const g=h.useRef(null),p=h.useRef(null),[m,b]=h.useState([]),[v,y]=h.useState(!1),[D,N]=h.useState(!1),S=h.useCallback(U=>{const B=U.target.files;if(B&&B.length>0){const F=Array.from(B),G=d?.(F),Z=f?.(F);G?y(!0):Z?N(!0):e(F)}},[d,f,e]),C=h.useCallback(U=>i&&U?.length>i,[i]),w=h.useMemo(()=>v||D||C(m),[v,D,C,m]),R=()=>{b([]),y(!1),N(!1)},_=h.useMemo(()=>v?n.jsx(x.DialErrorText,{text:l}):D?n.jsx(x.DialErrorText,{text:u}):C(m)?n.jsx(x.DialErrorText,{text:c}):null,[c,l,u,m,C,v,D]);h.useEffect(()=>{R()},[a]);const[{isOver:O,canDrop:A},j]=or(()=>({accept:[St],drop(U){const B=U.files,F=d?.(B)??!1,G=f?.(B)??!1,Z=C?.(B)??!1;if(y(F),N(G),F||G||Z){b(B);return}e(B),R()},collect:U=>({isOver:U.isOver(),canDrop:U.canDrop()})}),[e,d,f,C]),k=U=>{(U.key==="Enter"||U.key==="Space")&&(U.preventDefault(),p.current?.click())},z=U=>{U?.preventDefault();const B=Array.from(U.dataTransfer?.items??[]);y(!!d?.(B)),N(!!f?.(B)),b(B)},V=U=>{U.target===U.currentTarget&&R()},ee=ae("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!A&&!w&&"border-primary",A&&(O?"border-accent-primary":"border-hover"),w&&"border-error");return j(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ee,ref:g,onDragOver:z,onDragLeave:V,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:k,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&n.jsx("p",{className:"mb-1",children:t}),r&&n.jsx("p",{className:"mb-0.5",children:r}),s&&n.jsx(x.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,label:s,onClick:()=>p.current?.click()})]}),n.jsx("input",{multiple:o,id:"file",type:"file",ref:p,hidden:!0,accept:a,onChange:S})]}),n.jsx(n.Fragment,{children:_})]})},ao=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx($.IconExclamationCircle,{...H.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(x.DialInput,{...r,iconBefore:a(),containerClassName:ae("h-[40px] p-0",s&&"h-[60px]"),className:ae("rounded-r-none border-r-0",s&&"text-error",t)})},io=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:i,fileFormatError:o,fileSizeError:l,fileCountError:c})=>{const u=h.useRef(null),[d,f]=h.useState(!1),[g,p]=h.useState(!1),[m,b]=h.useState(0),v=h.useCallback(()=>{f(!1),p(!1),b(0)},[]),y=h.useCallback(O=>!!(i&&t.length+O.length>i),[i,t.length]),D=d||g,[{isOver:N,canDrop:S},C]=or(()=>({accept:[St],drop(O){const A=O.files,j=[...t,...A],k=s?.(A)??!1,z=a?.(A)??!1,V=y?.(A)??!1;if(f(k),p(z),k||z||V){b(A.length);return}r(j),v()},collect:O=>({isOver:O.isOver(),canDrop:O.canDrop()})}),[t,r,s,a,y,v]),w=O=>{O.preventDefault();const A=Array.from(O.dataTransfer?.items??[]);f(!!s?.(A)),p(!1),b(A.length)},R=O=>{O.target===O.currentTarget&&v()};C(u);const _=y(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:u,onDragOver:w,onDragLeave:R,className:ae("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!D&&!_&&(S&&N?"border-accent-primary":"border-primary"),(D||_)&&"border-error"),children:e}),d&&n.jsx(x.DialErrorText,{text:o}),g&&n.jsx(x.DialErrorText,{text:l}),!d&&!g&&_&&n.jsx(x.DialErrorText,{text:c})]})},xn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:i,errorText:o,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:u,getIsFileFormatError:d,getIsFileSizeError:f,maxFilesCount:g}=e,p=h.useCallback((v,y)=>{v.stopPropagation(),a(t?.filter(D=>D.name!==y)||[])},[a,t]),m=h.useCallback(v=>n.jsx(It,{"aria-label":l,onClick:y=>p(y,v)}),[l,p]),b=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((v,y)=>n.jsx(ao,{id:v.name,value:v.name,iconAfter:m(v.name),iconBefore:r||s?.(v.name),invalid:i?.(v),error:i?.(v)?o:""},v.name+y))}),[t,r,s,i,o,m]);return n.jsx(Ma,{backend:no,children:!t||t.length===0?n.jsx(so,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx(io,{existingFiles:t,onDrop:a,getIsFileFormatError:d,getIsFileSizeError:f,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:b}),c?.(t)&&n.jsx(x.DialErrorText,{text:u})]})})},oo=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:i,maxMultiFilesSize:o,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,multiple:f=!0,acceptTypes:g,deleteAllButtonLabel:p,addButtonLabel:m,additionalActionButtons:b,...v})=>{const y=h.useRef(null),D=()=>y.current?.click(),N=()=>{e([])},S=h.useCallback(_=>_?.some(O=>!(g==="/"||g?.toLowerCase()?.includes(O?.type?.toLowerCase()))),[g]),C=h.useCallback(_=>{if(!i)return!1;const O=i*(1024*1024);return _?.some(A=>{const j=A.size;return!!j&&j>O})},[i]),w=h.useCallback(_=>{if(!o||!f)return!1;const O=o*1024*1024;return _.reduce((j,k)=>j+k.size,0)>O},[o,f]),R=h.useCallback(_=>{const O=_.target.files;if(O&&O.length>0){const A=Array.from(O),j=S(A),k=C(A);!j&&!k&&e([...s||[],...A])}},[S,C,e,s]);return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[n.jsx(Ae.DialLabel,{label:`${t}: ${f?s?.length||0:""}`,htmlFor:r}),f&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(x.DialNeutralButton,{label:p,iconBefore:n.jsx($.IconTrashX,{...H.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(x.DialPrimaryButton,{appearance:T.ButtonAppearance.Ghost,iconBefore:n.jsx($.IconPlus,{...H.BASE_ICON_PROPS}),label:m,onClick:D}),b]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:f,ref:y,hidden:!0,accept:g,onChange:R}),n.jsx(xn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:f,fileFormatError:l,fileCountError:c,fileSizeError:u,multiFilesSizeError:d,getIsFileFormatError:S,getIsFileSizeError:C,getIsMultiFilesSizeError:w,...v})]})},lo=({icon:e,ariaLabel:t,size:r=T.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:i,iconClassName:o,caretIcon:l=n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:u="bottom-start",matchReferenceWidth:d=!1,open:f,onOpenChange:g,defaultOpen:p=!1,...m})=>{const b=r===T.ElementSize.Small,[v,y]=h.useState(p),D=f??v,N=b?"w-8 px-0":"w-10 px-0",S={[T.ElementSize.Small]:"size-5",[T.ElementSize.Standard]:"size-6",[T.ElementSize.Large]:"size-7"},C=w=>{y(w),g?.(w)};return n.jsx(M.DialDropdown,{...m,disabled:s,placement:u,matchReferenceWidth:d,className:a,open:D,onOpenChange:C,defaultOpen:p,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:I.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",b?"h-8 px-2":"h-10 px-2",c?void 0:N,i),children:[n.jsx(M.DialIcon,{icon:e,className:I.mergeClasses("flex items-center justify-center text-inherit",S[r],c&&"-mr-2",o)}),c&&n.jsxs("div",{className:"relative z-10 inline-grid size-5 shrink-0 place-items-center",children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(M.DialIcon,{icon:l,className:I.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",D&&"rotate-180")})]})]})})},co="application/octet-stream";function uo(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=$t(s,!0),i=e.filter(c=>c!==r).map(c=>{const u=c.path||c.url||"",d=fo(c.nodeType),f=d===x.DialFileNodeType.FOLDER,g=$t(u,f);let p;return c.parentPath===null||c.parentPath===void 0?p=a:c.parentPath===""?p="":p=$t(c.parentPath,!0),{...c,originalPath:u,path:g,parentPath:p,nodeType:d}}),o=new Map;i.forEach(c=>{const u={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:po(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===x.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===x.DialFileNodeType.ITEM&&(u.extension=go(c.name),u.contentType=c.contentType||co,u.contentLength=c.contentLength||0),o.set(c.path,u)});const l=[];return o.forEach(c=>{if(c.parentPath===a)l.push(c);else{const u=c.path.lastIndexOf(c.name||""),d=c.path.slice(0,u),f=o.get(d);f&&f.nodeType===x.DialFileNodeType.FOLDER?(f.items=f.items||[],f.items.push(c)):l.push(c)}}),l}function $t(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function fo(e){return e.toUpperCase()==="FOLDER"?x.DialFileNodeType.FOLDER:x.DialFileNodeType.ITEM}function po(e){if(!e)return;const t=e.toUpperCase();return Object.values(x.DialFileResourceType).find(s=>s.toUpperCase()===t)}function go(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function ho(e,t="Prompts",r="prompts/public/",s="root"){const a=uo(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:x.DialFileNodeType.FOLDER,folderId:s,items:a}]}const bn=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(i=>i.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var qe=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(qe||{}),at=(e=>(e.Select="select",e.Radio="radio",e))(at||{}),jt=(e=>(e.Row="row",e.Column="column",e))(jt||{}),J=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(J||{});const mo={noItemSchema:"No item schema defined.",noItemsYet:"No items yet. Add one below.",addItem:"Add Item",selectTypeToAdd:"Select type to add…",noConfigurableProperties:"No configurable properties.",noFieldsYet:"No fields yet. Add one below.",keyColumnHeader:"Key",valueColumnHeader:"Value",addField:"Add Field",keyInputPlaceholder:"Enter key",stringInputPlaceholder:"Enter a value",integerInputPlaceholder:"Enter a whole number",numberInputPlaceholder:"Enter a number",enumSelectPlaceholder:"Select an option",selectTypePlaceholder:"Select type",removeItemAriaLabel:"Remove item",removeFieldAriaLabel:"Remove field"},vn=h.createContext(null);function Se(){const e=h.useContext(vn);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function _r(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function Y(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let i=t;for(const d of a)i=i?.[d];if(!i||typeof i!="object")return e;const{$ref:o,...l}=s,c=i;s={...c.$ref?Y(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...i}=s;let o={};for(const l of a)o=_r(o,Y(l,t,r+1));s=_r(o,i)}return s}function yn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-r.index}).map(({entry:t})=>t)}function Tt(e){return e==null||e===""}function Ue(e){return e.type===J.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function bt(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function Dn(e,t){return e.type===J.Null?"null":e.$ref?Y(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function Ee(e,t,r=0){if(r>15)return;const s=Y(e,t);if("default"in s)return s.default;if(s.discriminator&&s.oneOf){const a=Object.keys(s.discriminator.mapping)[0];if(a){const i=Y({$ref:s.discriminator.mapping[a]},t);return{...Ee(i,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ue(s)){if(s.properties){const a={};let i=!1;for(const[o,l]of Object.entries(s.properties)){const c=Ee(l,t,r+1);c!==void 0&&(a[o]=c,i=!0)}return i?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function we(e,t,r,s="",a=0){if(a>15)return[];const i=[],o=Y(t,r);if(o.anyOf){const u=o.anyOf.filter(d=>d.type!==J.Null);return e!=null&&u.length===1?we(e,u[0],r,s,a+1):i}if(o.oneOf&&o.discriminator){const u=o.discriminator.propertyName,d=e?.[u];if(d&&o.discriminator.mapping[d]){const f={$ref:o.discriminator.mapping[d]},g=Y(f,r);return we(e,g,r,s,a+1)}return i}if(o.type===J.Array||!o.type&&Array.isArray(e)){if(Array.isArray(e)&&o.items)for(let u=0;u<e.length;u++){const d=we(e[u],o.items,r,`${s}[${u}]`,a+1);i.push(...d)}return i}if(!Ue(o))return i;const l=o.required??[],c=e;for(const u of l){const d=o.properties?.[u];if(d&&Y(d,r).isHidden)continue;const f=s?`${s}.${u}`:u,g=c?.[u];if(Tt(g)){const p=d?.title??bt(u);i.push({path:f,message:`${p} is required`})}}if(c&&o.properties)for(const[u,d]of Object.entries(o.properties)){if(Y(d,r).isHidden)continue;const f=s?`${s}.${u}`:u,g=c[u];if(g!=null){const p=we(g,d,r,f,a+1);i.push(...p)}}if(c&&o.additionalProperties!=null&&o.additionalProperties!==!1&&typeof o.additionalProperties=="object"){const u=o.additionalProperties;for(const[d,f]of Object.entries(c)){const g=s?`${s}.${d}`:d,p=we(f,u,r,g,a+1);i.push(...p)}}return i}function lr(e,t,r){const s=Y(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ue(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!Y(c,r).isHidden),i=a.length,o=e;return`${a.filter(([c])=>{const u=o?.[c];return u!=null&&u!==""}).length}/${i} fields`}return""}function xo(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===J.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>Y(a,r).type===J.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>Y(a,r).type===J.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const i=Y(a,r);return i.type===J.Number||i.type===J.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>Y(a,r).type===J.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(i.discriminator&&i.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const i=Y(t[a],r);if(Ue(i)||i.oneOf)return a}return 0}return 0}function bo(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function Cn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case J.String:return"";case J.Boolean:return!1;case J.Array:return[];case J.Integer:case J.Number:return;default:return{}}}const it=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:i,onRemove:o,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[u,d]=h.useState(l),f=a===0,g="rounded border border-secondary",p=I.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",f?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",u?"rounded-t":"rounded"),m=I.mergeClasses("border-t border-secondary",f?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:p,onClick:()=>d(b=>!b),role:"button","aria-expanded":u,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:u?n.jsx($.IconChevronDown,{size:16,stroke:2}):n.jsx($.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:I.mergeClasses("flex-1 truncate",f?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Ae.DialInfoButton,{caption:t}),r&&n.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:r}),s>0?n.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[n.jsx(M.DialIcon,{icon:n.jsx($.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(M.DialIcon,{icon:n.jsx($.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),o&&n.jsx(It,{size:T.ElementSize.Small,onClick:b=>{b.stopPropagation(),o()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),u&&n.jsx("div",{className:m,children:i})]})},Nn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:i,label:o})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:u=new Set,skipUntouched:d=!1}=Se(),f=Y(e,l),g=Ue(f),p=f.type===J.Array;if(g||p){const v=lr(t,f,l),y=we(t,f,l,s.join(".")),D=s.join("."),N=D+".",S=!d||u.has(D)||[...u].some(C=>C.startsWith(N));return n.jsx(it,{title:o??f.title??s[s.length-1]??"Section",description:f.description,level:a,summary:v,errorCount:S?y.length:0,defaultExpanded:c,children:n.jsx(Oe,{schema:f,value:t,onChange:r,path:s,level:a+1,required:i})})}const b=(!d||u.has(s.join(".")))&&i&&Tt(t)?`${o??"Field"} is required`:void 0;return n.jsx(x.DialFormItem,{label:o,required:i,description:f.description,error:b,children:n.jsx(Oe,{schema:f,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:!0})})},gt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o}=Se(),l=Y(e,i),c=yn(Object.entries(l.properties??{}).filter(([,f])=>!Y(f,i).isHidden)),u=l.required??[],d=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([f,g])=>{const m=Y(g,i).title??g.title??bt(f),b=u.includes(f);return n.jsx(Nn,{schema:g,value:d[f],onChange:v=>r({...d,[f]:v}),path:[...s,f],level:a,required:b,label:m},f)})})},vo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,defaultExpanded:c=!0}=Se(),u=Array.isArray(t)?t:[],d=e.items,[f,g]=h.useState(void 0);if(!d)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemSchema});const p=h.useMemo(()=>Y(d,i),[d,i]),m=h.useMemo(()=>p.discriminator,[p]),b=h.useMemo(()=>m?.propertyName,[m]),v=h.useMemo(()=>m?Object.keys(m.mapping).map(S=>({value:S,label:S})):[],[m]),y=()=>{const S=f??v[0]?.value;let C;if(m&&S){const w=Y({$ref:m.mapping[S]},i);C={...Ee(w,i)??{},[m.propertyName]:S}}else C=Ee(p,i)??Cn(p);r([...u,C])},D=S=>{r(u.filter((C,w)=>w!==S))},N=(S,C)=>{r(u.map((w,R)=>R===S?C:w))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noItemsYet}),u.map((S,C)=>{const w=bo(S,b,C),R=lr(S,p,i),_=we(S,p,i,`${s.join(".")}[${C}]`);return n.jsx(it,{title:w,level:a,summary:R,errorCount:_.length,onRemove:l?void 0:()=>D(C),defaultExpanded:c,removeItemAriaLabel:o.removeItemAriaLabel,children:n.jsx(Oe,{schema:d,value:S,onChange:O=>N(C,O),path:[...s,String(C)],level:a+1})},C)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:v,value:f??v[0]?.value,placeholder:o.selectTypeToAdd,onChange:S=>{const C=typeof S=="string"?S:S[0];g(C)}})}),n.jsx(x.DialGhostButton,{label:o.addItem,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})]})]})},yo=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1}=Se(),c=h.useId(),u=e.discriminator;if(u){const v=u.propertyName,y=u.mapping,D=Object.keys(y).map(w=>({value:w,label:w})),N=typeof t=="object"&&t!==null?t[v]:void 0,S=N?Y({$ref:y[N]},i):void 0,C=w=>{const R=Y({$ref:y[w]},i),_=Ee(R,i)??{};r({..._,[v]:w})};if(e.discriminatorDisplay===at.Radio){const w=e.discriminatorOrientation===jt.Row,R=N?(()=>{const _=Y({$ref:y[N]},i),{[v]:O,...A}=_.properties??{};return{..._,properties:A}})():void 0;return w?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(y).map(_=>{const O=Y({$ref:y[_]},i);return n.jsx(M.DialRadioButton,{name:c,value:_,inputId:`${c}-${_}`,label:O.title??_,checked:N===_,disabled:l,onChange:()=>C(_)},_)})}),R&&n.jsx(gt,{schema:R,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(y).map(_=>{const O=Y({$ref:y[_]},i),A=N===_,{[v]:j,...k}=O.properties??{},z={...O,properties:k};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:_,inputId:`${c}-${_}`,label:O.title??_,checked:A,disabled:l,onChange:()=>C(_)}),A&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(gt,{schema:z,value:t,onChange:r,path:s,level:a})})]},_)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:D,value:N,placeholder:o.selectTypePlaceholder,disabled:l,onChange:w=>{const R=typeof w=="string"?w:w[0];R&&C(R)}})}),S&&n.jsx("div",{className:"pl-3",children:n.jsx(gt,{schema:S,value:t,onChange:r,path:s,level:a})})]})}const d=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let v=0;v<d.length;v++)if(Y(d[v],i).required?.every(D=>D in t))return v}return 0})(),p=v=>{const y=Y(d[v],i),D=Ee(y,i);r(D??null)},m=d[g];if(e.discriminatorDisplay===at.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:d.map((v,y)=>{const D=Y(v,i),N=Dn(v,i)??`Option ${y+1}`,S=g===y;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(M.DialRadioButton,{name:c,value:String(y),inputId:`${c}-${y}`,label:N,checked:S,disabled:l,onChange:()=>p(y)}),S&&D&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Oe,{schema:D,value:t,onChange:r,path:s,level:a})})]},y)})});const b=d.map((v,y)=>{const D=Y(v,i);return{value:String(y),label:D.title??`Option ${y+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:b,value:String(g),disabled:l,onChange:v=>{const y=typeof v=="string"?v:v[0];p(Number(y))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},Do=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,readonly:o=!1}=Se(),l=e.anyOf??[],c=l.map((m,b)=>({value:String(b),label:Dn(m,i)})),u=xo(t,l,i),d=l[u],g=Y(d,i).type===J.Null,p=m=>{const b=Y(l[m],i);if(b.type===J.Null){r(null);return}const v=Ee(b,i);if(v!==void 0){r(v);return}switch(b.type){case J.Array:r([]);break;case J.String:r("");break;case J.Boolean:r(!1);break;case J.Integer:case J.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(ke,{options:c,value:String(u),disabled:o,onChange:m=>{const b=typeof m=="string"?m:m[0];p(Number(b))}})}),!g&&d&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Oe,{schema:d,value:t,onChange:r,path:s,level:a})})]})},In=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:i,readonly:o=!1,inputClassName:l,acceptableResourceTypes:c}=Se(),u=e.const!==void 0,d=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===J.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(p=>{const m=c?.[p];return Array.isArray(m)?m.map(b=>{const v=String(b);return{value:v,label:v}}):[]});return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:p=>r(typeof p=="string"?p:p[0]),placeholder:i.enumSelectPlaceholder,className:l})}if(u)return n.jsx(x.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(d&&e.enumDisplay===at.Radio){const g=e.enumOrientation===jt.Row;return n.jsx("div",{role:"radiogroup",className:g?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(p=>{const m=String(p);return n.jsx(M.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:o,onChange:b=>r(b)},m)})})}if(d){const g=e.enum.map(p=>({value:String(p),label:String(p)}));return n.jsx(ke,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:o,onChange:p=>r(typeof p=="string"?p:p[0]),placeholder:i.enumSelectPlaceholder})}switch(e.type){case J.Boolean:return n.jsx(Ae.DialSwitch,{switchId:a,isOn:!!t,disabled:o,onChange:g=>r(g)});case J.Integer:return n.jsx(Zt,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.integerInputPlaceholder,containerClassName:l});case J.Number:return n.jsx(Zt,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:i.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(cn,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l}):n.jsx(x.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:o,onChange:g=>r(g??void 0),placeholder:i.stringInputPlaceholder,containerClassName:l})}},Rr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Sn=e=>!!(e.oneOf||e.anyOf||e.type===J.Array||Ue(e)),Co=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,onKeyChange:a,onValueChange:i,onRemove:o,keyInputPlaceholder:l,removeFieldAriaLabel:c,path:u,level:d,readonly:f=!1,inputClassName:g})=>{const{rootSchema:p,texts:m,defaultExpanded:b=!0,touchedPaths:v=new Set,markTouched:y=()=>{},skipUntouched:D=!1}=Se(),[N,S]=h.useState(t),C=Sn(s),w=[...u,e,"key"].join("."),_=(!D||v.has(w))&&t==="",O=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:C?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(x.DialInput,{value:N,disabled:f,invalid:_,onChange:z=>S(z??""),onBlur:()=>{y(w),N!==t&&a(N)},placeholder:l,containerClassName:g}),n.jsx(x.DialErrorText,{text:_?`${m.keyColumnHeader} is required`:void 0})]}),!C&&n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{schema:s,value:r,onChange:i})}),!f&&n.jsx(It,{size:T.ElementSize.Small,onClick:o,"aria-label":c,className:"shrink-0 p-1"})]});if(!C)return O;const A=[...u,t],j=lr(r,s,p),k=we(r,s,p,A.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[O,n.jsx(it,{title:t,level:d,summary:j,errorCount:k.length+(_?1:0),defaultExpanded:b,children:n.jsx(Oe,{schema:s,value:r,onChange:i,path:A,level:d+1})})]})},No=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:i,texts:o,readonly:l=!1,inputClassName:c}=Se(),u=e.additionalProperties===!0||e.additionalProperties==null?{type:"string"}:typeof e.additionalProperties=="object"?Y(e.additionalProperties,i):{type:"string"},d=Sn(u),[f,g]=h.useState(()=>Object.entries(t??{}).map(([N,S])=>Rr(N,S))),p=N=>Object.fromEntries(N.filter(S=>S.key!=="").map(S=>[S.key,S.value])),m=(N,S)=>{const C=f.map((w,R)=>R===N?{...w,key:S}:w);g(C),r(p(C))},b=(N,S)=>{const C=f.map((w,R)=>R===N?{...w,value:S}:w);g(C),r(p(C))},v=()=>d?Ee(u,i)??Cn(u):"",y=()=>{g(N=>[...N,Rr("",v())])},D=N=>{const S=f.filter((C,w)=>w!==N);g(S),r(p(S))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[f.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:o.noFieldsYet}),f.length>0&&!d&&n.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[n.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:o.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:o.valueColumnHeader})]}),f.map((N,S)=>n.jsx(Co,{pairId:N.id,pairKey:N.key,pairValue:N.value,valueSchema:u,onKeyChange:C=>m(S,C),onValueChange:C=>b(S,C),onRemove:()=>D(S),keyInputPlaceholder:o.keyInputPlaceholder,removeFieldAriaLabel:o.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},N.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(x.DialGhostButton,{label:o.addField,iconBefore:n.jsx($.IconPlus,{size:16,stroke:2}),onClick:y})})]})},jn=({value:e,onChange:t,theme:r=ot.EditorThemes.dark,height:s=240})=>{const{readonly:a}=Se(),[i,o]=h.useState(null),[l,c]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-qv1Z0dLX.cjs")).then(d=>{o(()=>d.DialJsonEditor)})},[]);const u=d=>{const f=d??"";c(f);try{t(JSON.parse(f))}catch{}};return n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&n.jsx(i,{value:l,currentTheme:r,onChange:u,options:{readOnly:a}})})},Oe=({schema:e,value:t,onChange:r,path:s,level:a,required:i,suppressInlineError:o=!1})=>{const{rootSchema:l,renderField:c,markTouched:u=()=>{},touchedPaths:d=new Set,skipUntouched:f=!1,jsonEditorTheme:g}=Se(),p=Y(e,l),m=y=>{u(s.join(".")),r(y)},b=!f||d.has(s.join("."));let v;if(p.oneOf)v=n.jsx(yo,{schema:p,value:t,onChange:m,path:s,level:a});else if(p.anyOf&&p.type!==J.Object)v=n.jsx(Do,{schema:p,value:t,onChange:m,path:s,level:a});else if(Ue(p)){const y=p.additionalProperties!=null&&p.additionalProperties!==!1,D=!p.properties||Object.keys(p.properties).length===0;y&&D?v=n.jsx(No,{schema:p,value:t,onChange:m,path:s,level:a}):D&&p.additionalProperties!==!1?v=n.jsx(jn,{value:t,onChange:m,theme:g}):v=n.jsx(gt,{schema:p,value:t,onChange:m,path:s,level:a})}else if(p.type===J.Array)v=n.jsx(vo,{schema:p,value:t,onChange:m,path:s,level:a});else{const y=b&&i&&Tt(t),D=!o&&y?`${p.title??"Field"} is required`:void 0;v=n.jsxs(n.Fragment,{children:[n.jsx(In,{schema:p,value:t,onChange:m,invalid:y}),n.jsx(x.DialErrorText,{text:D})]})}return c?c(s,p,v):v},Io=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:i=!0,inputClassName:o,variant:l=qe.Sections,onChange:c,onPropertyChange:u,onDefaultValues:d,renderField:f,skipUntouched:g=!1,jsonEditorTheme:p,acceptableResourceTypes:m})=>{const b=h.useMemo(()=>({...mo,...r}),[r]),v=h.useMemo(()=>t||(Ee(e,e)??{}),[]),[y,D]=h.useState(v),[N,S]=h.useState(new Set),C=h.useCallback(j=>{S(k=>k.has(j)?k:new Set([...k,j]))},[]);h.useEffect(()=>{d?.(v)},[]);const w=(j,k)=>{const z={...y,[j]:k};D(z),c?.(z),u?.(j,k)},R=new Set(Object.keys(e.properties??{})),_=Object.keys(y).filter(j=>!R.has(j)),O=yn(Object.entries(e.properties??{}).filter(([,j])=>!Y(j,e).isHidden)),A=e.required??[];return n.jsx(vn.Provider,{value:{rootSchema:e,texts:b,readonly:a,defaultExpanded:i,inputClassName:o,jsonEditorTheme:p,acceptableResourceTypes:m,renderField:f,touchedPaths:N,markTouched:C,skipUntouched:g},children:n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-4",s),children:[O.map(([j,k])=>{const z=Y(k,e),V=z.title??k.title??bt(j),ee=A.includes(j),U=y[j];if(l===qe.Flat)return n.jsx(Nn,{schema:k,value:U,onChange:Z=>w(j,Z),path:[j],level:0,required:ee,label:V},j);if(l===qe.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:V}),n.jsx(Oe,{schema:k,value:U,onChange:Z=>w(j,Z),path:[j],level:0,required:ee})]},j);const B=we(U,z,e,j),F=j+".",G=!g||N.has(j)||[...N].some(Z=>Z.startsWith(F));return n.jsx(it,{title:V,description:z.description,level:0,defaultExpanded:i,errorCount:G?ee&&Tt(U)?Math.max(B.length,1):B.length:0,children:n.jsx(Oe,{schema:k,value:U,onChange:Z=>w(j,Z),path:[j],level:1,required:ee})},j)}),_.map(j=>{const k=bt(j),z=n.jsx(jn,{value:y[j],onChange:V=>w(j,V),theme:p});return l===qe.Sections?n.jsx(it,{title:k,level:0,defaultExpanded:i,children:z},j):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:k}),z]},j)})]})})},So=e=>({info:n.jsx($.IconInfoCircleFilled,{size:e.size}),error:n.jsx($.IconAlertCircleFilled,{size:e.size}),warning:n.jsx($.IconAlertTriangleFilled,{size:e.size}),success:n.jsx($.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(x.Spinner,{size:e.size}),general:n.jsx($.IconCheck,{size:e.size,stroke:e.stroke})}),jo={[x.NotificationVariant.Info]:"bg-info text-info",[x.NotificationVariant.Success]:"bg-success text-success",[x.NotificationVariant.Warning]:"bg-warning text-warning",[x.NotificationVariant.Error]:"bg-error text-error",[x.NotificationVariant.Loading]:"bg-layer-raised text-info",[x.NotificationVariant.General]:"bg-layer-sunken text-primary"},To={[x.NotificationVariant.Info]:"status",[x.NotificationVariant.Success]:"status",[x.NotificationVariant.Warning]:"alert",[x.NotificationVariant.Error]:"alert",[x.NotificationVariant.Loading]:"status",[x.NotificationVariant.General]:"status"},wo="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",cr=({variant:e=x.NotificationVariant.Info,type:t=x.NotificationType.Toast,title:r,message:s,className:a,iconSize:i=24,iconStroke:o=2,closable:l=!1,onClose:c,children:u,textClassName:d,...f})=>{const g=h.useMemo(()=>So({size:i,stroke:o})[e],[e,i,o]),p=d??(t===x.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:To[e],...f,className:I.mergeClasses(wo,jo[e],t===x.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===x.NotificationType.SectionMessage&&e===x.NotificationVariant.Loading&&"border-secondary",a),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(M.DialIcon,{icon:g})}),r?n.jsxs("div",{className:I.mergeClasses("flex min-w-0 text-primary break-words",p),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),u,l&&n.jsx("div",{className:"relative size-[40px]",children:n.jsx(P.CloseButton,{className:"absolute top-[-2px] right-0 size-auto hover:bg-transparent ",ariaLabel:"Close notification",onClose:m=>c?.(m)})})]})},kr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},Eo=e=>e===1?"!truncate !whitespace-nowrap":`${kr[e]??kr[2]} !whitespace-normal`,Oo=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const i=Eo(a);if(!t.trim())return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:e});const o=e.toLowerCase().indexOf(t.toLowerCase()),l=o===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,o),n.jsx("mark",{className:I.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(o,o+t.length)}),e.slice(o+t.length)]});return n.jsx(P.EllipsisTooltip,{className:I.mergeClasses(i,s),text:l})},Ao=({className:e,children:t,...r})=>n.jsx("article",{...r,className:I.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e),children:t}),Qe=(e,t)=>({type:s,...a})=>n.jsx(cr,{...a,variant:e,type:s||t}),Je=(e,t)=>({variant:s,...a})=>n.jsx(cr,{...a,variant:s||t,type:e}),_o=Qe(x.NotificationVariant.Error,x.NotificationType.Toast),Ro=Qe(x.NotificationVariant.Info,x.NotificationType.Toast),ko=Qe(x.NotificationVariant.Success,x.NotificationType.Toast),Po=Qe(x.NotificationVariant.Warning,x.NotificationType.Toast),Lo=Qe(x.NotificationVariant.Loading,x.NotificationType.Toast),Mo=Qe(x.NotificationVariant.General,x.NotificationType.Toast),Fo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Error),Bo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Info),zo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Success),$o=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Warning),Ho=Je(x.NotificationType.SectionMessage,x.NotificationVariant.Loading),Vo=Je(x.NotificationType.SectionMessage,x.NotificationVariant.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const Go="en-GB",Uo={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},Tn="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",wn="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",En="!border-error",Ko="z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Wo="flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus",qo="bg-control-accent text-control-permanent",Zo="text-accent dial-small-semi-text",Yo="text-control-disable-primary",On="text-secondary",Xo=n.jsx($.IconCalendar,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On}),Pr={prev:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Qo=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(i,o)=>{const l=new Date(a);return l.setDate(a.getDate()+o),l})},Lr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Mr=(e,t,r)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},Jo=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Fr=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),el=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),dt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,Br=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},tl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),rl=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},An=5,_n=e=>e.charAt(0).toUpperCase()+e.slice(1),nl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return _n(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),sl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,An+r));return{value:String(r+1),label:_n(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),zr=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:i,panel:o,labelledBy:l,panelLabel:c})=>{const u=M.useThemeScope(),[d,f]=h.useState(!1),{refs:g,floatingStyles:p,context:m}=le.useFloating({open:d,onOpenChange:S=>f(t?!1:S),placement:"bottom-start",whileElementsMounted:le.autoUpdate,middleware:[le.offset(8),le.flip({padding:8}),le.shift({padding:8})]}),b=le.useClick(m,{enabled:!t}),v=le.useDismiss(m),y=le.useRole(m,{role:"dialog"}),{getReferenceProps:D,getFloatingProps:N}=le.useInteractions([b,v,y]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":d,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:I.mergeClasses(Tn,"focus-visible:outline focus-visible:outline-focus",r&&En,t&&wn,i),...D(),children:s}),d&&n.jsx(le.FloatingPortal,{children:n.jsx(le.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:p,"aria-label":c,className:I.mergeClasses(Ko,u,a),...N(),children:o(()=>f(!1))})})})]})},$r=({id:e,value:t,onChange:r,disabled:s,invalid:a,className:i,ariaLabel:o,placeholder:l="--:--",timezoneLabel:c})=>{const[u,d]=h.useState(t);h.useEffect(()=>{d(t)},[t]);const f=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":o,placeholder:l,disabled:s,value:u,onChange:g=>{const p=rl(g.target.value);d(p),tl(p)&&r(p)},className:I.mergeClasses(Tn,a&&En,s&&wn,i)});return c?n.jsxs("div",{className:"relative w-full",children:[f,n.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:c})]}):f},al=({mode:e=be.Date,value:t,onChange:r,labelProps:s,placeholder:a,disabled:i=!1,invalid:o=!1,id:l,className:c,minDate:u,maxDate:d,locale:f=Go,fieldClassName:g,showTimezone:p=!1})=>{const m=a??Uo[e],b=t instanceof Date?t:null,v=h.useId(),y=l??v,D=s?.id??`${y}-label`,N=!!s?.label,S=typeof s?.label=="string"?s.label:void 0,C=N?`${D} ${y}`:void 0,w=s?n.jsx(P.Label,{...s,id:D,htmlFor:y}):null,[R,_]=h.useState(()=>b??new Date),O=h.useMemo(()=>new Date,[]),A=h.useMemo(()=>p?bn({locale:f}):null,[p,f]),j=h.useMemo(()=>nl(f),[f]),k=h.useMemo(()=>sl(f),[f]),z=h.useMemo(()=>Qo(R.getFullYear(),R.getMonth()),[R]),V=F=>{_(G=>new Date(G.getFullYear(),G.getMonth()+F,1))},ee=(F,G)=>{if(Mr(F,u,d))return;const Z=e===be.DateTime&&b?Br(F,dt(b)):F;r?.(Z),e===be.Date&&G()},U=F=>{r?.(Br(b??new Date,F))},B=()=>b?e===be.DateTime?`${Fr(b,f)}, ${dt(b)}`:Fr(b,f):m;if(e===be.Time){const F=typeof t=="string"?t:b?dt(b):"";return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[w,n.jsx($r,{id:y,value:F,onChange:G=>r?.(G),disabled:i,invalid:o,placeholder:m,className:g,timezoneLabel:A})]})}if(e===be.Weekday){const F=typeof t=="string"?t:void 0,G=k.find(Z=>Z.value===F);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[w,n.jsx(zr,{id:y,disabled:i,invalid:o,labelledBy:C,panelLabel:S??m,fieldClassName:g,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!G&&"text-secondary"),children:G?.label??m}),n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:On})]}),panel:Z=>n.jsx("div",{role:"listbox","aria-label":S??m,className:"flex flex-col gap-0.5",children:k.map(te=>n.jsx("button",{type:"button",role:"option","aria-selected":te.value===F,className:I.mergeClasses("flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus",te.value===F&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(te.value),Z()},children:te.label},te.value))})})]})}return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-y-3",c),children:[w,n.jsx(zr,{id:y,disabled:i,invalid:o,labelledBy:C,panelLabel:S??m,fieldClassName:g,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:I.mergeClasses("truncate",!b&&"text-secondary"),children:B()}),Xo]}),panel:F=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(P.StaticIconButton,{"aria-label":"Previous month",icon:Pr.prev,size:T.ElementSize.Small,onClick:()=>V(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Jo(R,f)}),n.jsx(P.StaticIconButton,{"aria-label":"Next month",icon:Pr.next,size:T.ElementSize.Small,onClick:()=>V(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[j.map(G=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:G},G)),z.map(G=>{const Z=G.getMonth()!==R.getMonth(),te=Lr(G,b),re=Lr(G,O),W=Mr(G,u,d);return n.jsx("button",{type:"button",disabled:W,"aria-label":el(G,f),"aria-pressed":te,"aria-current":re?"date":void 0,className:I.mergeClasses(Wo,Z&&Yo,re&&!te&&Zo,te&&qo,W&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>ee(G,F),children:G.getDate()},G.toISOString())})]}),e===be.DateTime&&n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[n.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),n.jsx($r,{ariaLabel:"Time",value:b?dt(b):"",onChange:U,className:"w-[120px] px-3 py-1.5"})]})]})})]})},il=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const i=n.jsx(M.DialIcon,{icon:n.jsx($.IconFolder,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),o=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:i}:{}}));return n.jsx(x.DialBreadcrumb,{className:s,ariaLabel:a,separator:n.jsx(M.DialIcon,{icon:n.jsx($.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:o,labelClassName:I.mergeClasses(t,"text-secondary","!cursor-default")})},et=({label:e,variant:t,appearance:r=T.ButtonAppearance.Solid,size:s=T.ElementSize.Standard,className:a,textClassName:i,iconAfter:o,iconBefore:l,type:c="button",tooltipProps:u,href:d,target:f,rel:g,disabled:p,...m})=>{const b=I.mergeClasses("dial-kit-base-button",t&&P.getButtonClassNames(t,r),s===T.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===T.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===T.ElementSize.Small&&"dial-kit-base-button-small",r!==T.ButtonAppearance.Link&&(s===T.ElementSize.Small?"px-2":"px-4"),s!==T.ElementSize.Small&&r!==T.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),v=e?void 0:u?.tooltip,y=T.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],v),D=n.jsxs(n.Fragment,{children:[n.jsx(M.DialIcon,{icon:l}),e&&n.jsx("span",{className:i,children:e}),n.jsx(M.DialIcon,{icon:o})]}),N=m,S=d!==void 0?n.jsx("a",{...N,href:p?void 0:d,target:f,rel:g??(f==="_blank"?"noopener noreferrer":void 0),"aria-disabled":p||void 0,tabIndex:p?-1:N.tabIndex,onClick:p?void 0:N.onClick,className:b,"aria-label":y,children:D}):n.jsx("button",{...m,type:c,disabled:p,className:b,"aria-label":y,children:D});return u?n.jsx(P.Tooltip,{asChild:!0,...u,children:S}):S},dr=(e,t)=>({appearance:s,...a})=>n.jsx(et,{...a,variant:e,appearance:s||t}),ur=(e,t)=>({variant:s,...a})=>n.jsx(et,{...a,variant:s||t,appearance:e}),Rn=dr(T.ButtonVariant.Primary,T.ButtonAppearance.Solid),fr=dr(T.ButtonVariant.Neutral,T.ButtonAppearance.Solid),ol=dr(T.ButtonVariant.Danger,T.ButtonAppearance.Solid),ll=ur(T.ButtonAppearance.Link,T.ButtonVariant.Primary),cl=ur(T.ButtonAppearance.Ghost,T.ButtonVariant.Primary),dl=ur(T.ButtonAppearance.Outlined,T.ButtonVariant.Neutral),ul=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const i=I.mergeClasses("flex items-center justify-center rounded-full size-[40px]","dial-kit-enhanced-target","dial-kit-fab-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",e),o=n.jsx("button",{...a,type:s,className:i,"aria-label":T.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx($.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(T.DialTooltip,{...r,children:o}):o},fl=e=>n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",e&&"rotate-180")}),pl=({variant:e,appearance:t,items:r,...s})=>{const[a,i]=h.useState(!1),o=h.useMemo(()=>fl(a),[a]);return n.jsx("div",{children:n.jsx(P.Dropdown,{items:r,onOpenChange:l=>i(l),children:n.jsx(et,{...s,iconAfter:o,variant:e||T.ButtonVariant.Primary,appearance:t||T.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":a})})})},kn=({label:e,size:t,isOpen:r=!1,"aria-label":s,...a})=>{const i=t===T.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":r,"aria-label":s?`${s} ${e}`:void 0,className:I.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",i,a.className),...a,children:[e,n.jsx($.IconChevronDown,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:I.mergeClasses("transition-transform",r&&"rotate-180")})]})},gl=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:i,placement:o="bottom-end",matchReferenceWidth:l=!1,listClassName:c,ariaLabel:u})=>{const[d,f]=h.useState(!1),[g,p]=h.useState(r??e[0]?.key),m=t!==void 0,b=m?t:g,v=h.useMemo(()=>{const D=e.find(N=>N.key===b);return D?.label?String(D.label):""},[e,b]),y=h.useCallback(({key:D})=>{const N=e.find(S=>S.key===D);N&&(m||p(D),s?.(N))},[e,m,s]);return n.jsx(P.Dropdown,{items:e,placement:o,matchReferenceWidth:l,listClassName:c,disabled:i,onOpenChange:f,onItemClick:y,children:n.jsx(kn,{label:v,size:a,isOpen:d,disabled:i,"aria-label":u})})},Pe=({text:e,className:t,variant:r=x.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:I.mergeClasses("dial-tiny-text",r===x.CaptionType.Error?"text-error":"text-secondary",t),children:e}):null,Le=({...e})=>n.jsx(Pe,{...e,variant:x.CaptionType.Error}),hl="bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-accent-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-accent-active",ml={[T.ElementSize.Small]:"size-[24px]",[T.ElementSize.Standard]:"size-[40px]",[T.ElementSize.Large]:"size-[48px]"},xl=({icon:e,onClick:t,disabled:r,size:s=T.ElementSize.Standard,className:a})=>n.jsx("div",{className:I.mergeClasses("border-l border-tertiary",ml[s]),children:n.jsx(P.IconButton,{className:I.mergeClasses(hl,s===T.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),bl=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Pn=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!bl.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const i=e.currentTarget.value,o=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??o,c=i.slice(0,o)+e.key+i.slice(l),u=parseFloat(c);if(!isNaN(u)){if(r!==void 0&&u<+r){e.preventDefault();return}if(s!==void 0&&u>+s){e.preventDefault();return}}}}},Ln={[T.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[T.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[T.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},Ge=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:i=T.ElementSize.Standard,...o})=>n.jsxs("div",{className:I.mergeClasses("flex flex-col",Ln[i].stackGap,a),children:[e&&n.jsx(P.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Mn,{id:s,size:i,...o}),n.jsx(Le,{text:t}),!t&&n.jsx(Pe,{text:r})]})]}),Mn=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:i,iconBefore:o,iconAfter:l,wrapperClassName:c,type:u,inputRef:d,value:f,tooltipText:g,min:p,onChange:m,max:b,inputButtonProps:v,wrapperRef:y,size:D=T.ElementSize.Standard,...N})=>{const S=Ln[D],C=h.useRef(null),w=le.useMergeRefs([d,C]),R=u==="number"||p!==void 0||b!==void 0;h.useEffect(()=>{const j=C.current;if(!j||!R||t)return;const k=z=>{z.preventDefault()};return j.addEventListener("wheel",k,{passive:!1}),()=>{j.removeEventListener("wheel",k)}},[t,R,u]);const _=j=>{Pn(j,u,p,b)},O=j=>{const k=j.currentTarget.value;if(R&&k!==""){const z=parseFloat(k);if(isNaN(z)&&k!=="-"&&k!=="."||!isNaN(z)&&(p!==void 0&&z<+p||b!==void 0&&z>+b))return}m?.(k||void 0)},A=()=>n.jsxs("div",{ref:y,className:I.mergeClasses("dial-kit-input flex flex-row items-center justify-between",S.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&S.paddingStart,!v&&S.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(Mn,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:D,id:`${r}_textBefore`})}),n.jsx(M.DialIcon,{icon:o}),i,n.jsx("input",{ref:w,type:u,autoComplete:u==="password"?"new-password":"off",value:f??"",className:I.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:O,onKeyDown:_,min:p,disabled:t,max:b,...N}),a&&n.jsxs("p",{className:I.mergeClasses("text-secondary",S.postfixText),children:[" ",a]}),n.jsx(M.DialIcon,{icon:l}),v&&n.jsx(xl,{size:D,...v,disabled:t})]});return t&&u!=="password"?n.jsx(P.Tooltip,{tooltip:g||f,children:A()}):A()};var Ye=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(Ye||{});const vl="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",yl={[Ye.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ye.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Dl="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",Cl="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ze=({label:e,icon:t,appearance:r=Ye.Outlined,selected:s=!1,disabled:a=!1,closable:i=!1,removeLabel:o,className:l,title:c,onClick:u,onRemove:d,onKeyDown:f,...g})=>{const p=r===Ye.Selectable,m=!!u&&!a,b=i&&!!d&&!a,v=p&&s,y=D=>{f?.(D),!(!m||D.defaultPrevented)&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),D.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":p&&m?s:void 0,onClick:a?void 0:u,onKeyDown:y,className:I.mergeClasses(vl,v?"dial-tiny-semi-text":"dial-tiny-text",yl[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Dl,Cl],l),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),b&&n.jsx(P.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:T.ElementSize.Small,"aria-label":o??`Remove ${e}`,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:D=>{D.stopPropagation(),d?.(D)}})]})},Fn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx(n.Fragment,{children:t.map(s=>{const a=e.find(i=>i.value===s);return n.jsx(Ze,{label:a?.label??s,closable:!!r,onRemove:i=>r?.(i,s),icon:a?.icon,className:"max-w-full border border-tertiary"},s)})}),Nl=I.mergeClasses("w-full flex flex-col"),Il=P.overlayItemClassName,Sl="!max-w-[var(--reference-width)]",jl="max-h-[344px] overflow-y-auto",Tl=P.overlayGap,wl=P.overlaySubMenuClassName,El=n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Ol="text-secondary transition-transform",Al=8,_l=n.jsx($.IconSearch,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rl=n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),kl=n.jsx(P.SvgNoData,{width:H.DIAL_ICON_SIZE.LG,height:H.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pl=({opt:e,selectedValues:t,mark:r=P.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:i,refs:o,floatingStyles:l,context:c,getReferenceProps:u,getFloatingProps:d}=M.useSubMenuFloating(Tl,"listbox",!!e.disabled),f=e.children?.some(p=>t.includes(p.value)),g=n.jsx(P.MenuItem,{ref:o.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!f,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:El,...u()});return n.jsxs(le.FloatingNode,{id:i,children:[e.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(M.SubMenuPanel,{refs:o,floatingStyles:l,context:c,getFloatingProps:d,role:"listbox",surfaceClassName:wl,children:e.children.map(p=>{const m=n.jsx(P.MenuItem,{role:"option","aria-selected":t.includes(p.value),"aria-disabled":!!p.disabled,disabled:p.disabled,mark:r,selected:t.includes(p.value),ellipsisLabel:!0,icon:p.icon,label:p.labelNode??p.label,rightControl:p.rightControl,onClick:()=>!p.disabled&&s(p.value)});return n.jsx(h.Fragment,{children:p.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:p.interactiveTooltip.placement,content:p.interactiveTooltip.content,contentClassName:p.interactiveTooltip.contentClassName,children:m}):m},p.value)})})]})},Ll=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:i=T.ElementSize.Standard,prefix:o,customSelectedValue:l,placeholder:c="Select...",labelProps:u,error:d,caption:f,ariaLabel:g,searchable:p=!1,searchSize:m=T.ElementSize.Standard,searchPlaceholder:b,selectAll:v=!1,invalid:y,selectAllLabel:D="Select all",selectedOptionMark:N=P.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:C,emptyStateIcon:w,disabled:R=!1,className:_,fieldClassName:O,listClassName:A,closable:j=!1,header:k,footer:z,onClose:V,onChange:ee,dismissRef:U,onFooterClick:B,open:F,onOpenChange:G,onSearchQueryChange:Z,customMultiSelectTagsRenderer:te})=>{const re=h.useId(),W=r||re,se=`list-${W}`,de=i===T.ElementSize.Small,[ue,ce]=h.useState(!1),pe=F!==void 0,ge=pe?!!F:ue,fe=h.useCallback(L=>{pe||ce(L),G?.(L)},[pe,G]),[K,X]=h.useState(""),Ne=h.useCallback(L=>{L!==K&&(X(L||""),Z?.(L||""))},[Z,K]),Me=s!==void 0,[he,Fe]=h.useState(a),je=Me?s:he,ne=h.useMemo(()=>t?Array.isArray(je)?je:[]:typeof je=="string"?[je]:[],[je,t]),_e=h.useMemo(()=>{const L=K.trim().toLowerCase();return L?e.filter(oe=>oe.label.toLowerCase().includes(L)):e},[e,K]);h.useEffect(()=>{ge||Ne("")},[ge,Ne]);const Ie=h.useCallback(L=>{Me||Fe(L),ee?.(L)},[Me,ee]),Be=h.useCallback(L=>{if(t){const oe=new Set(ne);oe.has(L)?oe.delete(L):oe.add(L),Ie(Array.from(oe));return}Ie(L),fe(!1)},[t,Ie,fe,ne]),tt=h.useCallback((L,oe)=>{if(L.stopPropagation(),!t){Ie("");return}const lt=ne.filter(Kn=>Kn!==oe);Ie(lt)},[t,ne,Ie]),ye=h.useMemo(()=>_e.filter(L=>!L.disabled),[_e]),ze=h.useMemo(()=>ye.filter(L=>ne.includes(L.value)).length,[ye,ne]),{allSelectedInFiltered:Re,someSelectedInFiltered:me}=h.useMemo(()=>{const L=ye.length>0&&ze===ye.length;return{allSelectedInFiltered:L,someSelectedInFiltered:ze>0&&!L}},[ye,ze]),wt=h.useCallback(()=>{if(!(!t||ye.length===0))if(Re){const L=new Set(ye.map(oe=>oe.value));Ie(ne.filter(oe=>!L.has(oe)))}else{const L=new Set(ne);ye.forEach(oe=>L.add(oe.value)),Ie(Array.from(L))}},[Re,t,ye,ne,Ie]),Te=ne.length>0,$e=!t&&Te?ne[0]:void 0,E=h.useMemo(()=>$e?e.find(L=>L.value===$e)??e.flatMap(L=>L.children??[]).find(L=>L.value===$e):void 0,[e,$e]),Q=E?o?`${o} ${E.label}`:E.label:void 0,xe=h.useMemo(()=>t?Te?n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:te?.(e,ne,tt)??n.jsx(Fn,{options:e,selectedValues:ne,handleRemoveTag:tt})}):null:!E||!E.labelNode&&!E.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(P.EllipsisTooltip,{text:E.labelNode??Q}),E.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:E.description})]}),[te,tt,Te,t,e,Q,ne,E]),Et=t||xe?"":Q||(l&&s?l:""),Hn=typeof u?.label=="string"?u.label:void 0,Vn=xe?[T.resolveAccessibleName(g,Hn),t?ne.map(L=>e.find(oe=>oe.value===L)?.label??L).join(", "):Q].filter(Boolean).join(", ")||void 0:T.resolveAccessibleName(g);h.useImperativeHandle(U,()=>({dismiss:()=>{fe(!1)}}));const Gn=h.useCallback(L=>{R||(L.key==="ArrowDown"||L.key==="ArrowUp")&&(L.preventDefault(),ge||fe(!0))},[R,ge,fe]),Un=()=>n.jsxs("div",{id:se,role:"listbox","aria-multiselectable":t||void 0,className:Nl,children:[k&&n.jsx(n.Fragment,{children:typeof k=="function"?k():k}),(p||j)&&(e.length>Al||!!K)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[p&&n.jsx(Ge,{id:`search-${W}`,size:m,placeholder:b,"aria-label":b||"Search options",onChange:L=>Ne(L),value:K,iconBefore:_l,containerClassName:"w-full"}),j&&n.jsx(P.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:T.ElementSize.Small,icon:Rl,onClick:L=>{V?.(L),fe(!1)}})]}),t&&v&&ye.length>0&&n.jsx("div",{className:I.mergeClasses(Il,"mt-2"),children:n.jsx(P.Checkbox,{id:`${W}-selectAll`,labelProps:{label:D},isSelected:Re,isIndeterminate:me,onChange:wt})}),n.jsx("div",{role:"none",className:jl,children:_e.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(M.DialNoDataContent,{icon:w??kl,title:S,description:C})}):_e.map(L=>{const oe=ne.includes(L.value);if(L.children?.length)return n.jsx(Pl,{opt:L,selectedValues:ne,mark:t?P.MenuItemMark.Checkbox:N,onSelect:Be},L.value);const lt=t?n.jsx(P.MenuItem,{id:`${W}-${L.value}`,role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:P.MenuItemMark.Checkbox,selected:oe,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>Be(L.value)}):n.jsx(P.MenuItem,{role:"option","aria-selected":oe,"aria-disabled":!!L.disabled,disabled:L.disabled,mark:N,selected:oe,ellipsisLabel:!0,icon:L.icon,label:L.labelNode??L.label,description:L.description,rightControl:L.rightControl,onClick:()=>!L.disabled&&Be(L.value)});return n.jsx(h.Fragment,{children:L.interactiveTooltip?n.jsx(P.InteractiveTooltip,{asChild:!0,placement:L.interactiveTooltip.placement,content:L.interactiveTooltip.content,contentClassName:L.interactiveTooltip.contentClassName,children:lt}):lt},L.value)})}),z&&n.jsx("div",{onClick:L=>{B?.(L),B&&fe(!1)},children:typeof z=="function"?z():z})]});return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",_),children:[u&&n.jsx(P.Label,{...u,htmlFor:W}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(P.Dropdown,{open:ge,onOpenChange:fe,disabled:R,closable:j,onClose:V,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:I.mergeClasses(Sl,A),className:"w-full",renderOverlay:Un,children:n.jsx(Ge,{id:W,size:i,disabled:R,invalid:y,value:Et,placeholder:xe?void 0:c,readOnly:!0,iconBefore:t?void 0:E?.icon,iconAfter:n.jsx($.IconChevronDown,{size:de?H.DIAL_ICON_SIZE.SM:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses(Ol,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":se,"aria-autocomplete":"none","aria-label":Vn,containerClassName:"w-full",wrapperClassName:I.mergeClasses(!R&&"cursor-pointer",t&&Te&&["!h-auto flex-wrap py-1.5",de?"min-h-[24px]":"min-h-[40px]"],O),className:I.mergeClasses("cursor-pointer",xe&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Gn,children:xe})}),n.jsx(Le,{text:d}),!d&&n.jsx(Pe,{text:f})]})]})};var Bn=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(Bn||{});const Hr={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Ml=e=>typeof e=="boolean"?Hr[e?"both":"none"]:Hr[e],Fl=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:i=!1,labelProps:o,caption:l,id:c,...u})=>{const d=I.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",u.invalid&&"dial-kit-input-error",u.disabled&&"dial-kit-input-disable",Ml(i),e);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",a),children:[o&&n.jsx(P.Label,{...o,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:d,onChange:f=>r?.(f.currentTarget.value),...u}),n.jsx(Le,{text:s}),!s&&n.jsx(Pe,{text:l})]})]})},Bl=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=T.ElementSize.Standard,...a})=>{const[i,o]=h.useState(!1),l=i&&!r;return h.useEffect(()=>{r&&o(!1)},[r]),n.jsx(Ge,{...a,size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx($.IconEyeOff,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconEye,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>o(c=>!c)})})},zl=/^0+\.(\d+)?$/,$l=/^0+/,Hl=[".","-","+","e","E"],Vr=e=>!e||e==="-"?e:String(e).match(zl)?String(e).replace($l,"0"):Number(e),Vl=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:i,...o})=>{const l=u=>{if(e&&Hl.includes(u.key)){u.preventDefault();return}Pn(u,"number",r,s),a?.(u)},c=u=>{if(e){const d=u.clipboardData.getData("text"),f=d.replace(/\D/g,"");if(f!==d&&(u.preventDefault(),f)){const g=u.currentTarget,p=g.selectionStart??0,m=g.selectionEnd??0,b=g.value.slice(0,p)+f+g.value.slice(m);t?.(Vr(b))}}i?.(u)};return n.jsx(Ge,{...o,type:"number",min:r,max:s,onChange:u=>t?.(Vr(u)),onKeyDown:l,onPaste:c})},Gl="z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Ul="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Kl="flex flex-row items-center justify-between px-6 py-4",Wl="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",ql="border-b border-tertiary",Zl="flex flex-row items-center gap-2 px-6 py-4",Yl="border-t border-tertiary",Ht="flex shrink-0 flex-row items-center gap-2",Xl={[x.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[x.PopupSize.Md]:"max-w-full md:max-w-[800px]",[x.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},pr=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:i,titleClassName:o,headerClassName:l,bodyClassName:c,children:u,footer:d,footerClassName:f,onClose:g,onBack:p,backAriaLabel:m="Back",headerActions:b,headerDivider:v=!1,mainButtons:y,additionalButtons:D,additionalButtonsOnLeft:N=!1,footerDivider:S=!1,size:C=x.PopupSize.Md,hideClose:w=!1,closeAriaLabel:R="Close dialog",closeOnOutsideClick:_=!0,preventKeyboardOnOpen:O=!1})=>{const A=M.useThemeScope(),j=h.useRef(null),k=h.useId(),{refs:z,context:V}=le.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),ee=le.useRole(V,{role:"dialog"}),U=le.useDismiss(V,{outsidePress:_}),{getFloatingProps:B}=le.useInteractions([ee,U]);if(!e)return null;const F=typeof t=="string"?`popup-heading-${k}`:void 0,G=W=>W?typeof W=="string"?n.jsx("h2",{id:F,className:I.mergeClasses(Wl,o),children:n.jsx(P.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:n.jsx("span",{}),Z=w?null:n.jsx(P.CloseButton,{ariaLabel:R,onClose:W=>g?.(W)}),te=(W,se=[])=>se.map(({variant:de=T.ButtonVariant.Neutral,...ue},ce)=>n.jsx(et,{variant:de,...ue},`${W}-${ce}`)),re=()=>{if(d!==void 0)return d;if(!y?.length&&!D?.length)return null;const W=te("additional",D);return n.jsxs("div",{className:I.mergeClasses(Zl,S&&Yl,f),children:[N&&W.length>0&&n.jsx("div",{className:Ht,children:W}),n.jsxs("div",{className:I.mergeClasses(Ht,"ml-auto"),children:[!N&&W,te("main",y)]})]})};return n.jsx(le.FloatingPortal,{id:s,children:n.jsx(le.FloatingOverlay,{className:I.mergeClasses(Gl,A,i),children:n.jsx(le.FloatingFocusManager,{context:V,initialFocus:O?j:z.floating,children:n.jsxs("div",{ref:z.setFloating,...B(),role:"dialog","aria-modal":"true","aria-labelledby":F,"aria-label":F?void 0:r,className:I.mergeClasses(Ul,Xl[C],a),children:[O&&n.jsx("div",{ref:j,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:I.mergeClasses(Kl,v&&ql,l),children:[p&&n.jsx(P.GhostIconButton,{"aria-label":m,size:T.ElementSize.Small,className:"mr-2",onClick:p,icon:n.jsx($.IconChevronLeft,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),G(t),b?n.jsxs("div",{className:Ht,children:[b,Z]}):Z]}),n.jsx("div",{className:I.mergeClasses("grow overflow-auto",c),children:u}),re()]})})})})},Ql="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Jl="text-secondary dial-small-paragraph-text px-6 pb-4",ec="px-6 py-4 h-[120px]",tc="Cancel",rc="Ok",Vt={[x.ConfirmationPopupVariant.Info]:{confirm:{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Solid}},[x.ConfirmationPopupVariant.Danger]:{container:"border-t-4 border-error",confirm:{variant:T.ButtonVariant.Danger,appearance:T.ButtonAppearance.Solid}}},nc=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=rc,cancelLabel:i=tc,isLoading:o=!1,disableConfirmButton:l=!1,className:c,confirmClassName:u,onClose:d,onConfirm:f,onCancel:g,children:p,variant:m=x.ConfirmationPopupVariant.Info,size:b=x.PopupSize.Sm,footer:v,hideClose:y,...D})=>{const N=o?null:n.jsxs("div",{className:Ql,children:[n.jsx(fr,{label:i,onClick:()=>g?g():d?.()}),n.jsx(et,{variant:Vt[m].confirm.variant,appearance:Vt[m].confirm.appearance,className:u,label:a,disabled:l,onClick:f})]}),S=h.useCallback(()=>o?n.jsx("div",{className:ec,children:n.jsx(x.Spinner,{size:40})}):p??(t?n.jsx("div",{className:I.mergeClasses(Jl,r),children:t}):null),[p,t,o,r]);return n.jsx(pr,{...D,open:s,header:e,className:I.mergeClasses(Vt[m].container,c),onClose:()=>d?.(),footer:v??N,size:b,hideClose:y??(!o&&v===void 0),children:S()})},sc=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:i,nonCollapsible:o,ariaLabel:l,onToggle:c,className:u,headerClassName:d,contentClassName:f})=>{const g=s!==void 0,[p,m]=h.useState(a),b=o?!0:g?s:p,v=h.useId(),y=`accordion-header-${v}`,D=`accordion-content-${v}`,N=()=>{if(i)return;const C=!b;g||m(C),c?.(C)},S=n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!o&&n.jsx($.IconChevronRight,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",b&&"rotate-90")})]});return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",u),children:[o?n.jsx("div",{id:y,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",d),children:S}):n.jsx("button",{id:y,type:"button","aria-expanded":b,"aria-controls":b?D:void 0,"aria-label":T.resolveAccessibleName(l),disabled:i,onClick:N,className:I.mergeClasses("flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",i?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",d),children:S}),b&&n.jsx("div",{id:D,role:"region","aria-labelledby":y,className:I.mergeClasses("px-4 dial-small-text text-primary",f),children:r})]})},ac=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:i,className:o,...l})=>{const c=h.useId(),u=e??c,d=i?`${u}-caption`:void 0,f=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:I.mergeClasses("flex items-center gap-2",o),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:u,checked:r,"aria-checked":r,disabled:s,onChange:f,"aria-label":T.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":d,className:"peer sr-only"}),n.jsx("label",{htmlFor:u,className:I.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":I.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:I.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(P.Label,{size:T.ElementSize.Standard,...t,htmlFor:u,className:I.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),i&&n.jsx("span",{id:d,className:"dial-tiny-text text-secondary ml-[44px]",children:i})]})},ic="flex flex-col gap-2",oc="flex",lc="mt-2 ml-[26px]",cc={[x.RadioGroupOrientation.Column]:"flex-col gap-y-3",[x.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},zn=({items:e,value:t,onChange:r,name:s,id:a,orientation:i=x.RadioGroupOrientation.Column,labelProps:o,disabled:l,error:c,caption:u,ariaLabel:d,className:f,optionsClassName:g,radioClassName:p,contentClassName:m})=>{const b=h.useId(),v=a??b,y=`${v}-label`,D=c?`${v}-error`:void 0,N=!c&&u?`${v}-caption`:void 0,S=T.resolveAccessibleName(o?.label);return n.jsxs("div",{className:I.mergeClasses(ic,f),children:[o&&n.jsx(P.Label,{...o,id:y}),n.jsx("div",{role:"radiogroup","aria-labelledby":S?y:void 0,"aria-label":S?void 0:T.resolveAccessibleName(d),"aria-describedby":[D,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:I.mergeClasses(oc,cc[i],g),children:e.map(C=>{const w=C.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(P.Radio,{id:`${v}-${C.value}`,name:s??v,value:C.value,labelProps:C.label==null?void 0:{label:C.label},"aria-label":C["aria-label"],caption:C.caption,isSelected:w,disabled:l||C.disabled,onChange:r,className:p}),w&&C.content?n.jsx("div",{className:I.mergeClasses(lc,m),children:C.content}):null]},C.value)})}),n.jsx(Le,{id:D,text:c}),!c&&n.jsx(Pe,{id:N,text:u})]})},dc="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",uc="min-w-0 flex-1 truncate text-primary",fc="min-w-0 flex-1 truncate text-secondary",pc="shrink-0 text-secondary",gc="px-6 pb-4",hc="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",mc="Cancel",xc="Apply",bc=({items:e,value:t,customValue:r,header:s,onApply:a,id:i,labelProps:o,placeholder:l,selectedValue:c,onSelectionChange:u,onCancel:d,onClose:f,isValid:g=!0,applyButtonLabel:p=xc,cancelButtonLabel:m=mc,size:b=x.PopupSize.Md,portalId:v,disabled:y,invalid:D,error:N,caption:S,ariaLabel:C,className:w,fieldClassName:R})=>{const _=h.useId(),O=i??_,A=`${O}-label`,j=`${O}-value`,k=N?`${O}-error`:void 0,z=!N&&S?`${O}-caption`:void 0,[V,ee]=h.useState(!1),U=c!==void 0,[B,F]=h.useState(t),G=U?c:B,Z=h.useCallback(()=>{y||(U||F(t),ee(!0))},[y,U,t]),te=h.useCallback(()=>{ee(!1),f?.()},[f]),re=h.useCallback(()=>{d?.(),te()},[d,te]),W=h.useCallback(()=>{a(G),te()},[a,G,te]),se=h.useCallback(K=>{U||F(K),u?.(K)},[U,u]),de=T.resolveAccessibleName(o?.label),ue=de?void 0:T.resolveAccessibleName(C),ce=de?A:ue&&`${O}-name`,pe=T.resolveAccessibleName(s),ge=e.find(K=>K.value===t)?.label,fe=r??ge;return n.jsxs("div",{className:I.mergeClasses("flex w-full flex-col gap-2",w),children:[o&&n.jsx(P.Label,{...o,id:A,htmlFor:O}),n.jsxs("div",{className:"flex flex-col gap-1",children:[ue&&n.jsx("span",{id:ce,className:"sr-only",children:ue}),n.jsxs("button",{type:"button",id:O,disabled:y,"aria-haspopup":"dialog","aria-expanded":V,"aria-labelledby":ce?`${ce} ${j}`:void 0,"aria-describedby":[k,z].filter(Boolean).join(" ")||void 0,onClick:Z,className:I.mergeClasses(dc,D&&"dial-kit-input-error",y&&"dial-kit-input-disable",R),children:[n.jsx("span",{id:j,className:fe==null?fc:uc,children:fe??l}),n.jsx($.IconMaximize,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:pc})]}),n.jsx(Le,{id:k,text:N}),!N&&n.jsx(Pe,{id:z,text:S})]}),n.jsx(pr,{open:V,header:s,ariaLabel:pe?void 0:de,portalId:v,size:b,onClose:re,footer:n.jsxs("div",{className:hc,children:[n.jsx(fr,{label:m,onClick:re}),n.jsx(Rn,{label:p,disabled:!g,onClick:W})]}),children:n.jsx("div",{className:gc,children:n.jsx(zn,{id:`${O}-options`,items:e,value:G,onChange:se,orientation:x.RadioGroupOrientation.Column,ariaLabel:de??pe})})})]})},vc=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:i,size:o=T.ElementSize.Small,className:l,...c})=>{const u=h.useCallback(f=>{a?.(f),s?.(!r)},[a,s,r]),d=n.jsx(P.IconButton,{...c,size:o,variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":T.resolveAccessibleName(c["aria-label"],i?.tooltip),onClick:u,className:I.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l)});return i?n.jsx(P.Tooltip,{asChild:!0,...i,children:d}):d},yc=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Dc="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Cc="flex h-8 min-w-8 grow shrink-0 basis-auto items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus",Nc="bg-layer-raised text-accent shadow-xs",Ic="bg-transparent text-secondary",Sc="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",jc="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",Tc="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",wc="cursor-not-allowed bg-transparent text-control-disable-primary",Ec=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:i,"aria-label":o})=>{const l=h.useRef({}),c=e.find(f=>f.value===t),u=c&&!c.disabled?c.value:e.find(f=>!f.disabled)?.value,d=h.useCallback(f=>{if(s||!yc.includes(f.key))return;const g=e.filter(y=>!y.disabled);if(g.length===0)return;const p=Math.max(g.findIndex(y=>y.value===t),0),m=g.length-1;let b=p;switch(f.key){case"ArrowRight":case"ArrowDown":b=p===m?0:p+1;break;case"ArrowLeft":case"ArrowUp":b=p===0?m:p-1;break;case"Home":b=0;break;case"End":b=m;break}f.preventDefault();const v=g[b];l.current[v.value]?.focus(),v.value!==t&&r(v.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":o,"aria-disabled":s||void 0,onKeyDown:d,className:I.mergeClasses(Dc,a),children:e.map(f=>{const g=f.value===t,p=s||f.disabled;return n.jsxs("button",{ref:m=>{l.current[f.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":T.resolveAccessibleName(f["aria-label"],typeof f.label=="string"?f.label:void 0),tabIndex:f.value===u?0:-1,disabled:p,onClick:()=>r(f.value),className:I.mergeClasses(Cc,g?Nc:Ic,p?g?Tc:wc:g?Sc:jc,i),children:[f.icon,f.label]},f.value)})})},Oc=["ArrowRight","ArrowLeft","Home","End"],Ac=({tabs:e,activeTabId:t,onTabChange:r,ariaLabel:s,className:a,tabClassName:i})=>{const o=h.useRef({}),l=e.find(d=>d.id===t),c=l&&!l.disabled?l.id:e.find(d=>!d.disabled)?.id,u=h.useCallback(d=>{if(!Oc.includes(d.key)||e.length===0)return;const f=e.filter(v=>!v.disabled);if(f.length===0)return;const g=Math.max(f.findIndex(v=>v.id===t),0),p=f.length-1;let m=g;switch(d.key){case"ArrowRight":m=g===p?0:g+1;break;case"ArrowLeft":m=g===0?p:g-1;break;case"Home":m=0;break;case"End":m=p;break}d.preventDefault();const b=f[m];o.current[b.id]?.focus(),b.id!==t&&r(b.id)},[e,t,r]);return n.jsx("div",{role:"tablist","aria-label":s,onKeyDown:u,className:I.mergeClasses("flex justify-start gap-1",a),children:e.map(d=>{const f=t===d.id,g=!!d.disabled;return n.jsxs("button",{ref:p=>{o.current[d.id]=p},type:"button",role:"tab","aria-selected":f,disabled:g,tabIndex:d.id===c?0:-1,onClick:()=>r(d.id),className:I.mergeClasses("dial-small-paragraph-semi-text dial-kit-enhanced-target","border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",g&&"cursor-not-allowed border-control-disable-primary text-control-disable-primary",!g&&(f?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),i),children:[n.jsx("span",{children:d.label}),d.count!=null&&n.jsx("span",{className:I.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"bg-layer-sunken text-control-disable-primary",!g&&(f?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:d.count})]},d.id)})})},Qt=(e,t)=>{const r=(t??"").split(",").map(i=>i.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(i=>{if(i.startsWith("."))return s.endsWith(i);if(i.endsWith("/*")){const o=i.slice(0,-1);return a.length>o.length&&a.startsWith(o)}return a===i})},_c=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:i,multiple:o=!1,disabled:l=!1,errorText:c,icon:u,id:d,ariaLabel:f,className:g})=>{const p=h.useId(),m=d??`file-dropzone-${p}`,b=c?`${m}-error`:void 0,[v,y]=h.useState(!1),D=h.useRef(0),N=h.useCallback(A=>{if(A.length===0)return;const j=o?A:A.slice(0,1),k=j.filter(V=>Qt(V,i)),z=j.filter(V=>!Qt(V,i));z.length>0&&a?.(z),k.length>0&&s(k)},[i,o,s,a]),S=h.useCallback(A=>{N(Array.from(A.target.files??[])),A.target.value=""},[N]),C=h.useCallback(()=>{D.current=0,y(!1)},[]),w=h.useCallback(A=>{l||(A.preventDefault(),D.current+=1,y(!0))},[l]),R=h.useCallback(A=>{l||(A.preventDefault(),A.dataTransfer.dropEffect="copy")},[l]),_=h.useCallback(()=>{l||(D.current-=1,D.current<=0&&C())},[l,C]),O=h.useCallback(A=>{A.preventDefault(),!l&&(C(),N(Array.from(A.dataTransfer?.files??[])))},[l,C,N]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(P.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:i,multiple:o,disabled:l,onChange:S,"aria-label":T.resolveAccessibleName(typeof t!="string"?f:void 0),"aria-describedby":b,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:w,onDragOver:R,onDragLeave:_,onDrop:O,className:I.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&v&&"border-accent bg-control-accent-alpha",!l&&!v&&"border-secondary hover:border-accent",c&&!v&&"border-error hover:border-error",g),children:[u??n.jsx($.IconUpload,{size:H.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:I.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:I.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Le,{id:b,text:c})]})},Rc=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,i=0;for(const o of t){const l=o+s;if(a+l>e)break;a+=l,i++}if(i===t.length)return i;for(;i>0&&a+r>e;)i--,a-=t[i]+s;return i},kc=4,Pc=24,Gr=e=>parseFloat(e)||0,Lc=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Mc=()=>{},Fc=({id:e,value:t,defaultValue:r,size:s=T.ElementSize.Standard,labelProps:a,placeholder:i,caption:o,error:l,invalid:c,disabled:u=!1,readOnly:d=!1,collapseTagOverflow:f=!1,ariaLabel:g,tagListLabel:p="Tags",className:m,fieldClassName:b,tagClassName:v,onChange:y})=>{const D=h.useId(),N=e||D,S=s===T.ElementSize.Small,C=h.useRef(null),w=h.useRef([]),R=h.useRef(null),_=t!==void 0,[O,A]=h.useState(r??[]),j=_?t:O,k=j.length,[z,V]=h.useState(""),[ee,U]=h.useState(k),B=!d&&!u,F=h.useCallback(K=>{_||A(K),y?.(K)},[_,y]),G=h.useCallback(K=>X=>{w.current[K]=X},[]),Z=h.useCallback(()=>{const K=C.current;if(!K||K.clientWidth===0){U(j.length);return}const{paddingLeft:X,paddingRight:Ne}=getComputedStyle(K);U(Rc({availableWidth:K.clientWidth-Gr(X)-Gr(Ne)-(d?0:Pc),tagWidths:j.map((Me,he)=>w.current[he]?.offsetWidth??0),overflowChipWidth:R.current?.offsetWidth??0,gap:kc}))},[d,j]);h.useEffect(()=>{if(!f){U(k);return}const K=C.current;if(!K)return;const X=new ResizeObserver(()=>Z());return X.observe(K),Z(),()=>X.disconnect()},[f,Z,k]);const te=I.mergeClasses(f?"shrink-0":"min-w-0",v),re=K=>{const X=Lc(K.trim()).trim();!X||j.includes(X)||F([...j,X])},W=K=>{F(j.filter(X=>X!==K))},se=()=>{re(z),V("")},de=K=>{if(B){if(K.key==="Enter"||K.key===","){K.preventDefault(),se();return}K.key==="Backspace"&&!z&&k>0&&(K.preventDefault(),F(j.slice(0,-1)))}},ue=()=>{B&&z.trim()&&se()},ce=f?j.slice(0,ee):j,pe=f?j.slice(ee):[],ge=pe.join(", "),fe=k>0&&n.jsxs("span",{role:"list","aria-label":p,className:I.mergeClasses("relative flex min-w-0 items-center gap-1",f?"flex-nowrap":"flex-wrap"),children:[ce.map(K=>n.jsx(Ze,{role:"listitem",label:K,className:te,disabled:u,closable:B,onRemove:B?()=>W(K):void 0},K)),pe.length>0&&n.jsx(Ze,{role:"listitem",label:`+${pe.length}`,"aria-label":ge,title:ge,className:I.mergeClasses("shrink-0",v),disabled:u}),f&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[j.map((K,X)=>n.jsx("span",{ref:G(X),className:"inline-flex",children:n.jsx(Ze,{label:K,className:v,disabled:u,closable:B,onRemove:B?Mc:void 0})},K)),n.jsx("span",{ref:R,className:"inline-flex",children:n.jsx(Ze,{label:`+${k}`,className:v})})]})]});return n.jsx(Ge,{id:N,size:s,labelProps:a,caption:o,error:l,invalid:c,disabled:u,readOnly:d,value:z,placeholder:k>0?void 0:i,"aria-label":g,wrapperRef:C,onChange:K=>V(K??""),onKeyDown:de,onBlur:ue,containerClassName:I.mergeClasses("w-full",m),wrapperClassName:I.mergeClasses(k>0&&["!h-auto",S?"min-h-[24px] py-0.5":"min-h-[40px] py-1.5",f?"flex-nowrap overflow-hidden":"flex-wrap"],b),className:I.mergeClasses("w-auto flex-1",f?"min-w-[24px]":"min-w-[100px]",d&&"cursor-default"),children:fe})},Bc={[T.ElementSize.Small]:H.DIAL_ICON_SIZE.SM,[T.ElementSize.Standard]:H.DIAL_ICON_SIZE.MD,[T.ElementSize.Large]:H.DIAL_ICON_SIZE.MD},zc=({size:e=T.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:i,onChange:o,wrapperClassName:l,inputRef:c,...u})=>{const d=h.useRef(null),f=le.useMergeRefs([c,d]),g=!!i&&!a,p=h.useCallback(()=>{o?.(void 0),d.current?.focus()},[o]);return n.jsx(Ge,{...u,size:e,value:i,disabled:a,onChange:o,placeholder:t,inputRef:f,wrapperClassName:I.mergeClasses(r&&"dial-kit-input-borderless",l),iconBefore:n.jsx($.IconSearch,{size:Bc[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(P.GhostIconButton,{size:T.ElementSize.Small,"aria-label":s,icon:n.jsx($.IconX,{size:H.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:p}):void 0})},$c=16,Hc=e=>(e.toString().split(".")[1]??"").length,Vc=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:i,labelProps:o,labels:l,formatValue:c,showValue:u=!1,caption:d,error:f,onChange:g,containerClassName:p,trackClassName:m,fillClassName:b,className:v,...y})=>{const D=h.useId(),N=e??D,S=d&&!f?`${N}-caption`:void 0,C=f?`${N}-error`:void 0,w=s-r,R=w>0?Math.min(100,Math.max(0,(t-r)/w*100)):0,_=`calc(${R}% + ${(.5-R/100)*$c}px)`,O=c?c(t):t.toFixed(Hc(a)),A=h.useCallback(j=>{g?.(Number(j.target.value))},[g]);return n.jsxs("div",{className:I.mergeClasses("flex flex-col gap-2",p),children:[(o||u)&&n.jsxs("div",{className:"flex items-center gap-2",children:[o&&n.jsx(P.Label,{...o,htmlFor:N}),u&&n.jsx("span",{"aria-hidden":"true",className:I.mergeClasses("dial-small-text ml-auto",i?"text-control-disable-primary":"text-primary"),children:O})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"relative flex h-6 items-center",children:[n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",i?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:I.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",i?"bg-control-disable-secondary":"bg-control-accent",b),style:{width:_}}),n.jsx("input",{...y,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:i,onChange:A,"aria-label":T.resolveAccessibleName(typeof o?.label!="string"?y["aria-label"]:void 0),"aria-valuetext":c?O:void 0,"aria-describedby":C??S,className:I.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",v)})]}),l&&n.jsx("div",{className:"dial-tiny-text flex text-secondary",children:l.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"flex-1 text-center",children:l[1]}),n.jsx("span",{children:l[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"ml-auto",children:l[1]})]})}),n.jsx(Le,{id:C,text:f}),!f&&n.jsx(Pe,{id:S,text:d})]})]})},Gc=48,Uc=({children:e,title:t,width:r=280,collapsedWidth:s=Gc,isOpened:a,defaultOpened:i=!0,onToggle:o,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:d="Expand sidebar",className:f,titleClassName:g,contentClassName:p,footerClassName:m})=>{const b=a!==void 0,[v,y]=h.useState(i),D=b?a:v,N=`collapsible-sidebar-content-${h.useId()}`,S=D?u:d,C=w=>{const R=!D;b||y(R),o?.(R,w)};return n.jsxs("aside",{"aria-label":c,style:{width:`${D?r:s}px`},className:I.mergeClasses("flex flex-col justify-between",f),children:[n.jsx("div",{id:N,hidden:!D,className:I.mergeClasses("min-h-0 flex-1 overflow-auto p-4",p),children:e}),n.jsx("div",{hidden:D,className:I.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:I.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",D?"justify-end px-2":"justify-center",m),children:[D&&l,n.jsx(P.IconButton,{variant:T.ButtonVariant.Primary,appearance:T.ButtonAppearance.Ghost,size:T.ElementSize.Standard,onClick:C,"aria-label":S,"aria-expanded":D,"aria-controls":N,tooltipProps:{tooltip:S},icon:D?n.jsx($.IconChevronsLeft,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx($.IconChevronsRight,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Kc=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:i,ariaLabel:o,onWidthChange:l,customHandler:c,handlerClassName:u})=>{const d=e===x.ResizableContainerSide.Left,f=d?$.IconChevronLeft:$.IconChevronRight,g=p=>{let m;switch(p.key){case"ArrowLeft":m=r+(d?i:-i);break;case"ArrowRight":m=r+(d?-i:i);break;case"Home":m=s;break;case"End":m=a;break;default:return}p.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:I.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",u),children:c??n.jsx(f,{size:H.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:I.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",d?"right-full":"left-full")})})},Wc=16,$n=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:i,onResize:o,side:l=x.ResizableContainerSide.Right,keyboardStep:c=Wc,ariaLabel:u="Resize panel",className:d,resizeHandlerClassName:f,resizeHandler:g})=>{const[p,m]=h.useState(!1),[b,v]=h.useState(a??t),y=s!==void 0,D=y?s:b,N=h.useRef(null),S=h.useCallback(()=>{m(!0)},[]),C=h.useCallback(()=>{m(!1);const _=N.current?.resizable?.getBoundingClientRect(),O=_?Math.round(_.width):t;y||v(O),i?.(O)},[i,y,t]),w=h.useCallback(_=>{const O=Math.min(r,Math.max(t,_));O!==D&&(y||(v(O),N.current?.updateSize({width:O,height:"100%"})),o?.(O),i?.(O))},[r,t,D,y,o,i]),R=h.useMemo(()=>{const _=l===x.ResizableContainerSide.Left,O=n.jsx(Kc,{side:l,isResizing:p,width:D,minWidth:t,maxWidth:r,step:c,ariaLabel:u,onWidthChange:w,customHandler:g,handlerClassName:f});return{size:y?{width:D,height:"100%"}:void 0,defaultSize:y?void 0:{width:D,height:"100%"},minWidth:t,maxWidth:r,enable:{left:_,right:!_},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:_?O:void 0,right:_?void 0:O},onResizeStart:S,onResize:(A,j,k)=>{o?.(Math.round(k.offsetWidth))},onResizeStop:C}},[l,y,D,t,r,c,u,w,g,f,p,S,C,o]);return n.jsx(x.Resizable,{ref:N,...R,children:n.jsx("div",{className:I.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",d),children:e})})},qc=({enabled:e=!0,children:t,...r})=>e?n.jsx($n,{...r,children:t}):t;exports.ConfirmationPopupVariant=x.ConfirmationPopupVariant;exports.DialBreadcrumb=x.DialBreadcrumb;exports.DialBreadcrumbItem=x.DialBreadcrumbItem;exports.DialButton=x.DialButton;exports.DialButtonDropdown=x.DialButtonDropdown;exports.DialCaptionText=x.DialCaptionText;exports.DialCollapsibleSidebar=x.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=x.DialConditionalResizableContainer;exports.DialConfirmationPopup=x.DialConfirmationPopup;exports.DialDangerButton=x.DialDangerButton;exports.DialDestinationFolderPopup=x.DialDestinationFolderPopup;exports.DialErrorText=x.DialErrorText;exports.DialFileIcon=x.DialFileIcon;exports.DialFileManager=x.DialFileManager;exports.DialFileManagerActions=x.DialFileManagerActions;exports.DialFileManagerTabs=x.DialFileManagerTabs;exports.DialFileName=x.DialFileName;exports.DialFileNodeType=x.DialFileNodeType;exports.DialFilePermission=x.DialFilePermission;exports.DialFileResourceType=x.DialFileResourceType;exports.DialFolderName=x.DialFolderName;exports.DialFoldersTree=x.DialFoldersTree;exports.DialFormItem=x.DialFormItem;exports.DialGhostButton=x.DialGhostButton;exports.DialInput=x.DialInput;exports.DialItemType=x.DialItemType;exports.DialLinkButton=x.DialLinkButton;exports.DialLoader=x.DialLoader;exports.DialNeutralButton=x.DialNeutralButton;exports.DialNotification=x.DialNotification;exports.DialPopup=x.DialPopup;exports.DialPrimaryButton=x.DialPrimaryButton;exports.DialRadioGroup=x.DialRadioGroup;exports.DialResizableContainer=x.DialResizableContainer;exports.DialSearch=x.DialSearch;exports.DialSharedEntityIndicator=x.DialSharedEntityIndicator;exports.DialTabs=x.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=x.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=x.FileManagerColumnKey;exports.FileManagerProvider=x.FileManagerProvider;exports.FlexibleActionsDirection=x.FlexibleActionsDirection;exports.FormItemOrientation=x.FormItemOrientation;exports.NAME_COLUMN=x.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=x.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=x.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=x.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=x.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=x.NotificationType;exports.NotificationVariant=x.NotificationVariant;exports.PopupSize=x.PopupSize;exports.RadioGroupOrientation=x.RadioGroupOrientation;exports.ResizableContainerSide=x.ResizableContainerSide;exports.SIZE_COLUMN=x.SIZE_COLUMN;exports.ScreenResolution=x.ScreenResolution;exports.Skeleton=x.Skeleton;exports.SkeletonAvatarShape=x.SkeletonAvatarShape;exports.SkeletonAvatarSize=x.SkeletonAvatarSize;exports.SkeletonVariant=x.SkeletonVariant;exports.Spinner=x.Spinner;exports.TabOrientation=x.TabOrientation;exports.TabView=x.TabView;exports.UPDATED_AT_COLUMN=x.UPDATED_AT_COLUMN;exports.editableContainerProps=x.editableContainerProps;exports.useDialFileManagerTabs=x.useDialFileManagerTabs;exports.useEditableItem=x.useEditableItem;exports.useFileManagerContext=x.useFileManagerContext;exports.DialLabel=Ae.DialLabel;exports.DialSwitch=Ae.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=M.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=M.DEFAULT_LOCALE;exports.DialCloseButton=M.DialCloseButton;exports.DialDangerIconButton=M.DialDangerIconButton;exports.DialDateCellRenderer=M.DialDateCellRenderer;exports.DialDropdown=M.DialDropdown;exports.DialEllipsisTooltip=M.DialEllipsisTooltip;exports.DialGhostIconButton=M.DialGhostIconButton;exports.DialGrid=M.DialGrid;exports.DialIcon=M.DialIcon;exports.DialNeutralIconButton=M.DialNeutralIconButton;exports.DialNoDataContent=M.DialNoDataContent;exports.DialPrimaryIconButton=M.DialPrimaryIconButton;exports.DialRadioButton=M.DialRadioButton;exports.DialSecondaryIconButton=M.DialSecondaryIconButton;exports.DialSuccessIconButton=M.DialSuccessIconButton;exports.DialTertiaryIconButton=M.DialTertiaryIconButton;exports.DropdownItemType=M.DropdownItemType;exports.DropdownTrigger=M.DropdownTrigger;exports.DropdownType=M.DropdownType;exports.GridSelectionMode=M.GridSelectionMode;exports.ThemeScope=M.ThemeScope;exports.baseColumnComparator=M.baseColumnComparator;exports.checkColDefsChanges=M.checkColDefsChanges;exports.convertGridDateToDate=M.convertToDate;exports.convertToDate=M.convertToDate;exports.useThemeScope=M.useThemeScope;exports.BASE_ICON_PROPS=H.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=H.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=H.DIAL_ICON_SIZE;exports.mergeClasses=I.mergeClasses;exports.Checkbox=P.Checkbox;exports.CheckboxBox=P.CheckboxBox;exports.CloseButton=P.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=P.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=P.DEFAULT_LOCALE;exports.DangerIconButton=P.DangerIconButton;exports.DateCellRenderer=P.DateCellRenderer;exports.Dropdown=P.Dropdown;exports.EllipsisTooltip=P.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=P.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=P.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=P.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=P.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=P.GRID_THEME_PARAMS;exports.GhostIconButton=P.GhostIconButton;exports.Grid=P.Grid;exports.IconButton=P.IconButton;exports.InfoButton=P.InfoButton;exports.InteractiveTooltip=P.InteractiveTooltip;exports.Label=P.Label;exports.MenuItem=P.MenuItem;exports.MenuItemMark=P.MenuItemMark;exports.NeutralIconButton=P.NeutralIconButton;exports.NoDataContent=P.NoDataContent;exports.PrimaryIconButton=P.PrimaryIconButton;exports.Radio=P.Radio;exports.StaticIconButton=P.StaticIconButton;exports.Tooltip=P.Tooltip;exports.TooltipContainer=P.TooltipContainer;exports.TooltipContent=P.TooltipContent;exports.TooltipPlacement=P.TooltipPlacement;exports.TooltipTrigger=P.TooltipTrigger;exports.ButtonAppearance=T.ButtonAppearance;exports.ButtonVariant=T.ButtonVariant;exports.DialIconButton=T.DialIconButton;exports.DialTooltip=T.DialTooltip;exports.DialTooltipContainer=T.DialTooltipContainer;exports.DialTooltipContent=T.DialTooltipContent;exports.DialTooltipTrigger=T.DialTooltipTrigger;exports.ElementSize=T.ElementSize;exports.EditorThemes=ot.EditorThemes;exports.LazyDialJsonEditor=ot.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=ot.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=ot.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=sc;exports.AnalyticsCardVariant=st;exports.Button=et;exports.ButtonDropdown=pl;exports.Calendar=al;exports.CalendarMode=be;exports.CaptionText=Pe;exports.CardShell=Ao;exports.CollapsibleSidebar=Uc;exports.ConditionalResizableContainer=qc;exports.ConfirmationPopup=nc;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=er;exports.DangerButton=ol;exports.DialAccordion=Ur;exports.DialAnalyticsBar=ut;exports.DialAnalyticsBarGroup=Jn;exports.DialAnalyticsCard=Yn;exports.DialAnalyticsErrorTag=Jt;exports.DialAnalyticsHistogram=ss;exports.DialAutocompleteInputValue=on;exports.DialCheckbox=Gt;exports.DialDraggableItem=bi;exports.DialDropdownIcon=lo;exports.DialFormPopup=Ai;exports.DialInputPopup=ln;exports.DialLabelledText=ms;exports.DialLoadFileArea=xn;exports.DialLoadFileAreaField=oo;exports.DialNumberInput=Zt;exports.DialPagination=ds;exports.DialPasswordInput=cn;exports.DialRadioGroupPopupField=Ti;exports.DialRemoveButton=It;exports.DialSchemaRenderer=Io;exports.DialSegmentedControl=Si;exports.DialSelect=ke;exports.DialSelectField=Vi;exports.DialSlider=hs;exports.DialSteps=gs;exports.DialTag=He;exports.DialTagInput=an;exports.DialTextarea=vi;exports.ErrorMessageNotification=Fo;exports.ErrorText=Le;exports.ErrorToastNotification=_o;exports.FabButton=ul;exports.FileDropzone=_c;exports.FolderPath=il;exports.GeneralMessageNotification=Vo;exports.GeneralToastNotification=Mo;exports.GhostButton=cl;exports.Highlight=Oo;exports.InfoMessageNotification=Bo;exports.InfoToastNotification=Ro;exports.InlineSelect=gl;exports.InlineSelectTrigger=kn;exports.Input=Ge;exports.JsonSchemaType=J;exports.LinkButton=ll;exports.LoadingMessageNotification=Ho;exports.LoadingToastNotification=Lo;exports.MultiSelectTags=Fn;exports.NeutralButton=fr;exports.Notification=cr;exports.NumberInput=Vl;exports.OutlinedButton=dl;exports.PasswordInput=Bl;exports.Popup=pr;exports.PrimaryButton=Rn;exports.ProgressBar=as;exports.RadioGroup=zn;exports.RadioGroupPopupField=bc;exports.ResizableContainer=$n;exports.SchemaDisplayMode=at;exports.SchemaOrientation=jt;exports.SchemaRendererVariant=qe;exports.Search=zc;exports.SegmentedControl=Ec;exports.Select=Ll;exports.SelectSize=ht;exports.SelectVariant=mt;exports.Slider=Vc;exports.StepStatus=ve;exports.SuccessMessageNotification=zo;exports.SuccessToastNotification=ko;exports.Switch=ac;exports.Tabs=Ac;exports.Tag=Ze;exports.TagAppearance=Ye;exports.TagInput=Fc;exports.Textarea=Fl;exports.TextareaResize=Bn;exports.ToggleIconButton=vc;exports.WarningMessageNotification=$o;exports.WarningToastNotification=Po;exports.getTimezoneLabel=bn;exports.matchesAccept=Qt;exports.wrapInRootFolder=ho;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./use-file-manager-tabs-C-dMqEFy.cjs"),Be=require("./Switch-DE6MrcqJ.cjs"),n=require("react/jsx-runtime"),h=require("react"),B=require("@tabler/icons-react"),ce=require("classnames"),j=require("./DateCellRenderer-Cl_mNbi1.cjs"),$=require("./icon-CrGVkVpG.cjs"),y=require("./merge-classes-BEJXjzkx.cjs"),k=require("./DateCellRenderer-ChqbDlQ2.cjs"),O=require("./IconButton-DHOFapLo.cjs"),ws=require("react-dom"),bt=require("./lazy-Cy9WobJf.cjs"),ee=require("@floating-ui/react"),ie=require("./icon-DhjrDQ8I.cjs");function Es(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ar=Es(h),Ue=({label:e,className:t,icon:r,selected:s,closable:a,onClick:o,onRemove:i})=>{const l=y.mergeClasses("flex items-center gap-1 cursor-pointer dial-tiny-text px-2 h-[24px] border text-primary rounded-[8px]",s?"hover:bg-controls-accent-primary-alpha-active bg-accent-primary-alpha border-accent-primary":"bg-neutral border-primary",t);return n.jsxs("div",{className:l,onClick:o,children:[n.jsx(j.DialIcon,{icon:r}),n.jsx(j.DialEllipsisTooltip,{text:e}),a&&i&&n.jsx(v.DialButton,{className:"p-0",iconAfter:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM}),onClick:c=>i(c)})]},e)},pr=({label:e="Error",className:t})=>n.jsx(Ue,{label:e,className:y.mergeClasses("dial-tiny-semi-text cursor-default rounded-[120px] border-transparent bg-error text-error",t)});var gt=(e=>(e.Default="default",e.Compact="compact",e))(gt||{});const Os={[gt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",showDescription:!0},[gt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",showDescription:!1}},As=({title:e,value:t,description:r,variant:s=gt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:c,deltaUnit:d,compareValues:f})=>{const p=Os[s],g=c!==void 0?c:(l??0)>=0,u=l===void 0?null:`${l>=0?`+${l}`:String(l)}${d??""}`;return n.jsxs("div",{className:y.mergeClasses("flex flex-col rounded-lg border border-secondary p-4",a||o?"gap-2":"gap-1",p.container,i),children:[l!==void 0?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:p.title,children:e}),n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",g?"bg-success text-success":"bg-error text-error"),children:u})]}):n.jsx("span",{className:p.title,children:e}),a?n.jsx(pr,{className:"self-start"}):o?n.jsx(v.DialLoader,{fullWidth:!1,className:"self-start"}):f?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(j.DialEllipsisTooltip,{text:f[0].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[0].value})]}),n.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-controls-disable-accent"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n.jsx(j.DialEllipsisTooltip,{text:f[1].title,className:"dial-tiny-text text-secondary"}),n.jsx("span",{className:p.value,children:f[1].value})]})]}):n.jsx("span",{className:p.value,children:t}),!a&&!o&&p.showDescription&&r!=null&&r!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:r})]})},gr=[{from:0,to:.1,color:"#F26B5B"},{from:.1,to:.2,color:"#E5764A"},{from:.2,to:.3,color:"#E08C3F"},{from:.3,to:.4,color:"#D9A638"},{from:.4,to:.5,color:"#D4BE3A"},{from:.5,to:.6,color:"#B8C94A"},{from:.6,to:.7,color:"#7EC96B"},{from:.7,to:.8,color:"#4ECBA8"},{from:.8,to:.9,color:"#4EC5C5"},{from:.9,to:1,color:"#4DC87A"},{from:1,to:1,color:"#30E070"}],_s=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),Ls=(e,t)=>{if(e<=0)return;let r;for(const s of t)(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=s.color);return r},St=({value:e,maxValue:t=1,error:r,isLoading:s,title:a,valueLabel:o,colorMap:i=gr,className:l,titleClassName:c,valueClassName:d,inline:f,ariaLabel:p})=>{const g=e==null,u=!!(r||s||!g),m=_s(g?0:e,t),C=Ls(m,i),x=o??(g?"—":e),b=p??(typeof a=="string"?a:void 0),I=r||s,N=r?n.jsx(pr,{}):s?n.jsx(v.DialLoader,{fullWidth:!1}):n.jsx("span",{className:y.mergeClasses("shrink-0 tabular-nums text-end",f?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",d),children:x}),T=u?n.jsx("div",{role:"progressbar","aria-valuenow":r||s||typeof e!="number"?void 0:e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":b,className:y.mergeClasses("w-full overflow-hidden rounded-sm",f?"h-1":"h-2",r?"bg-error":"bg-layer-1"),children:!I&&n.jsx("div",{className:"h-full rounded-sm transition-[width] duration-300",style:{width:`${m*100}%`,backgroundColor:C}})}):null,S=n.jsx("span",{className:y.mergeClasses("dial-small-text text-primary",c),children:a});return f?n.jsxs("div",{className:y.mergeClasses("flex flex-row items-center gap-2",l),children:[n.jsx("div",{className:"w-1/2 min-w-0",children:S}),n.jsxs("div",{className:"flex w-1/2 flex-row items-center gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1",children:T}),N]})]}):n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-1",l),children:[n.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[S,N]}),T]})},bn=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:c,headerClassName:d,contentClassName:f})=>{const p=s!==void 0,[g,u]=h.useState(a),m=i?!0:p?s:g,C=h.useId(),x=()=>{if(o)return;const b=!m;p||u(b),l?.(b)};return n.jsxs("div",{className:y.mergeClasses("rounded border border-secondary",c),children:[n.jsxs("button",{type:"button","aria-expanded":m,"aria-controls":C,disabled:o||i,onClick:x,className:y.mergeClasses("flex w-full items-center gap-2 p-4 text-left",o?"cursor-not-allowed":"cursor-pointer",i&&"cursor-default",d),children:[!i&&n.jsx(j.DialIcon,{className:ce("text-secondary transition-transform",m&&"rotate-90"),icon:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM})}),n.jsx("span",{className:"dial-body-text text-primary",children:e}),t!=null&&t!==!1&&n.jsx("span",{className:"dial-tiny-text text-secondary",children:t})]}),m&&n.jsx("div",{id:C,role:"region",className:y.mergeClasses("px-4 pb-4",f),children:r})]})},ks=({title:e,titleTooltip:t,description:r,data:s,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:c=!0,nonCollapsible:d,isLoading:f,onBarClick:p,inline:g,barTitleClassName:u,barValueClassName:m,barClassName:C,barDescriptions:x,className:b})=>{const I=Object.entries(s),N=g?y.mergeClasses("text-secondary",u):u,T=o?"dial-tiny-text text-secondary":void 0,S=t?n.jsx(O.DialTooltip,{tooltip:t,children:e}):e,D=a?[...new Set([...Object.keys(s),...Object.keys(a)])]:[],_="cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary",E="group flex flex-col gap-1.5",A=y.mergeClasses("flex flex-col gap-1.5 pl-2",p&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",C);return n.jsx(bn,{title:S,description:r,defaultExpanded:c,nonCollapsible:d,className:b,children:n.jsx("div",{className:y.mergeClasses("flex flex-col",a?"gap-4":g?"gap-2":"gap-3"),children:f?n.jsx(v.DialLoader,{fullWidth:!1,className:"self-center"}):a?D.map(L=>{const w=L in s?s[L]:null,M=L in a?a[L]:null,K=typeof w=="number"&&typeof M=="number"?parseFloat((M-w).toFixed(3)):null,te=K!=null&&K!==0,G=te&&K>0,z=te?G?`+${K}`:String(K):null,H=x?.[L],q=n.jsx("span",{className:"dial-small-text text-secondary",children:L}),U=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[H?n.jsx(O.DialTooltip,{tooltip:H,children:q}):q,z!=null&&n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",G?"bg-success text-success":"bg-error text-error"),children:z})]}),n.jsxs("div",{className:A,children:[n.jsx(St,{title:o?.[0],value:w,maxValue:i,colorMap:l,inline:g,titleClassName:T,ariaLabel:L}),n.jsx(St,{title:o?.[1],value:M,maxValue:i,colorMap:l,inline:g,titleClassName:T,ariaLabel:`${L} compare`})]})]});return p?n.jsx("button",{type:"button",onClick:()=>p(L,w),className:y.mergeClasses(E,_),children:U},L):n.jsx("div",{className:E,children:U},L)}):I.map(([L,w])=>{const M=n.jsx(St,{title:L,value:w,maxValue:i,colorMap:l,inline:g,titleClassName:N,valueClassName:m,className:C}),F=p?n.jsx("button",{type:"button",onClick:()=>p(L,w),className:_,children:M}):M,K=x?.[L];return K?n.jsx(O.DialTooltip,{tooltip:K,triggerClassName:"flex flex-col",children:F},L):n.jsx(h.Fragment,{children:F},L)})})})},Rs="#FF4E50",Ms=(e,t)=>{let r=-1;return t.forEach((s,a)=>{(s.from===s.to?e>=s.from:e>s.from&&e<=s.to)&&(r=a)}),r},_r=(e,t)=>{const r=t.map(()=>0);let s=0;e.forEach(c=>{if(c<=0){s+=1;return}const d=Ms(c,t);d>=0&&(r[d]+=1)});const a=Math.max(0,s,...r),o=c=>a>0?c/a:0,i={from:0,to:0,color:Rs,count:s,ratio:o(s),isZeroBucket:!0},l=t.map((c,d)=>({from:c.from,to:c.to,color:c.color,count:r[d],ratio:o(r[d]),isZeroBucket:!1}));return[i,...l]},Cn=e=>e<=0?2:e%2===0?e:e+1,Ps=e=>{const t=Cn(e);return[t,t/2,0]},Gt=e=>`${Math.round(e*100)/100}`,vn=(e,t)=>e===t?Gt(e):`${Gt(e)}-${Gt(t)}`,Ut=128,Fs=(e,t)=>{const r=vn(e,t);return e===t?`scored ${r}`:`scored between ${r}`},Lr=(e,t,r,s,a)=>n.jsxs("div",{className:"flex flex-col gap-0.5",children:[e&&n.jsx("strong",{children:e}),n.jsxs("span",{children:[t," out of ",r," ",s]}),n.jsx("span",{children:Fs(a.from,a.to)})]}),Bs=({title:e,values:t,colorMap:r=gr,valueTitle:s="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:c,compareValueSetLabel:d})=>{const f=_r(t,r),p=l?_r(l,r):void 0,g=t.length,u=l?.length??0,m=Math.max(g,u),C=Cn(m),x=Ps(m),b=S=>S.map(D=>({...D,ratio:C>0?D.count/C:0})),I=b(f),N=p?b(p):void 0,T=(S,D,_,E)=>{if(S.count===0)return n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${S.ratio*100}%`}})});const A=E?{backgroundImage:`repeating-linear-gradient(135deg, ${S.color} 0px, ${S.color} 1px, transparent 1px, transparent 4px)`,borderColor:S.color}:{backgroundColor:S.color};return n.jsx(O.DialTooltip,{placement:"bottom",tooltip:D,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":_,className:"flex min-h-2 w-full items-center justify-center rounded-sm border border-transparent",style:{height:`${S.ratio*100}%`,...A},children:a&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})})};return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",i),children:[n.jsx("span",{className:"dial-small-text text-primary",children:e}),o?n.jsx("div",{className:"flex items-center justify-center",style:{height:Ut},children:n.jsx(v.DialLoader,{fullWidth:!1})}):n.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1",children:[n.jsx("div",{"data-histogram-y-axis":!0,"aria-hidden":"true",className:"relative",style:{height:Ut},children:x.map((S,D)=>n.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${D/(x.length-1)*100}%`,transform:"translateY(-50%)"},children:S},S))}),n.jsxs("div",{className:"relative min-w-0",children:[x.map((S,D)=>n.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${D/(x.length-1)*100}%`}},S)),n.jsx("div",{className:"relative flex items-end gap-1",style:{height:Ut},children:N?I.map((S,D)=>{const _=N[D],E=`${S.count} out of ${g} ${s}`,A=`${_.count} out of ${u} ${s}`;return n.jsxs("div",{className:"flex h-full flex-1 items-end",children:[T(S,Lr(c,S.count,g,s,S),E,!0),T(_,Lr(d,_.count,u,s,_),A,!1)]},D)}):I.map((S,D)=>{const _=`${S.count} out of ${g} ${s}`;return S.count===0?n.jsx("div",{className:"flex h-full flex-1 items-end","aria-hidden":"true",children:n.jsx("div",{className:"min-h-2 w-full rounded-sm",style:{height:`${S.ratio*100}%`}})},D):n.jsx(O.DialTooltip,{placement:"bottom",tooltip:_,triggerClassName:"flex h-full flex-1 items-end",children:n.jsx("div",{role:"img","aria-label":_,className:y.mergeClasses("flex min-h-2 w-full items-center justify-center rounded-sm border","border-transparent"),style:{height:`${S.ratio*100}%`,backgroundColor:S.color},children:a&&S.count>0&&n.jsx("span",{className:"dial-tiny-semi-text text-primary",children:S.count})})},D)})})]}),n.jsx("div",{}),n.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((S,D)=>n.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:vn(S.from,S.to)},D))})]})]})},yn=({value:e,max:t=100,size:r=O.ElementSize.Standard,labelProps:s,valueLabel:a,id:o,className:i,"aria-label":l,...c})=>{const d=h.useId(),f=o??d,p=!!s?.label,g=p?s?.id??`${f}-label`:void 0,u=t>0?t:0,m=Number.isFinite(e)?e:0,C=Math.min(Math.max(m,0),u),x=u>0?C/u*100:0,b=n.jsx("div",{...c,id:f,role:"progressbar","aria-valuenow":C,"aria-valuemin":0,"aria-valuemax":u,"aria-labelledby":g,"aria-label":O.resolveAccessibleName(l,p?void 0:"Progress"),className:y.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===O.ElementSize.Small?"h-1":"h-2",i,!p&&!a&&j.DIAL_KIT_CLASS.progressBar),children:n.jsx("div",{style:{width:`${x}%`},className:"h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"})});return!p&&!a?b:n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-1",j.DIAL_KIT_CLASS.progressBar),children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[s&&n.jsx(k.Label,{...s,id:g}),a&&n.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),b]})},zs=7,$s=2,Hs=e=>e<=0?[]:Array.from({length:e},(t,r)=>r+1);var Dt=(e=>(e.Active="active",e.Adjacent="adjacent",e.Far="far",e))(Dt||{});const Vs=(e,t,r)=>e===t?"active":r<zs||Math.abs(e-t)<=$s?"adjacent":"far",Ks=({page:e,totalPages:t,onPageChange:r,className:s})=>{const a=Hs(t);return n.jsxs("nav",{"aria-label":"Pagination",className:y.mergeClasses("flex items-center gap-2",s),children:[n.jsx(O.DialIconButton,{icon:n.jsx(B.IconCaretLeftFilled,{size:$.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:O.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page"}),n.jsx("div",{className:"flex flex-row items-center gap-2",children:a.map(o=>{const i=Vs(o,e,t);return n.jsx("button",{type:"button",onClick:()=>r(o),"aria-label":`Page ${o}`,"aria-current":o===e?"page":void 0,className:y.mergeClasses("dial-pagination-dot rounded-full focus-visible:outline outline-offset-0 transition-all duration-300 ease-in-out",i===Dt.Active&&"h-[8px] w-[32px]",i===Dt.Adjacent&&"size-[8px]",i===Dt.Far&&"size-[4px]")},o)})}),n.jsx(O.DialIconButton,{icon:n.jsx(B.IconCaretRightFilled,{size:$.DIAL_ICON_SIZE.SM,className:"text-secondary"}),size:O.ElementSize.Small,className:"!p-0 items-center flex justify-center",disabled:e>=t,onClick:()=>r(e+1),"aria-label":"Next page"})]})},sr=({label:e,id:t,checked:r,indeterminate:s,disabled:a,ariaLabel:o,onChange:i,className:l,...c})=>{const d=h.useCallback(u=>{i?.(u.target.checked,t)},[i,t]),f=ce("flex flex-row items-center cursor-pointer text-accent-primary small-medium min-w-0",`${r||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":"",l),p=ce("border rounded",a?"bg-layer-4 border-icon-secondary":""),g=()=>s?n.jsx(B.IconMinus,{className:p,...$.BASE_ICON_PROPS}):r?n.jsx(B.IconCheck,{className:p,...$.BASE_ICON_PROPS}):null;return n.jsxs("label",{...c,className:f,htmlFor:t,"aria-description":c["aria-description"]||j.ariaDescription,children:[g(),e&&(typeof e=="string"?n.jsx(j.DialEllipsisTooltip,{text:e,className:"ml-2 text-primary"}):e),n.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:d,id:t,checked:r,"aria-checked":s?"mixed":r,"aria-disabled":a||void 0,"aria-label":e?void 0:o,className:"invisible size-0"})]})};var De=(e=>(e.VALID="valid",e.ERROR="error",e))(De||{});const Gs=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"border-accent-secondary text-primary";case De.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case De.VALID:return"border-primary text-primary";case De.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Us=(e,t)=>{if(t===e.id)switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case De.VALID:return"bg-accent-secondary";case De.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Zs=({step:e,index:t,currentStep:r,onChangeStep:s})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny-text cursor-pointer dial-step",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",i=()=>r===e.id&&e.status===De.ERROR?n.jsx(B.IconExclamationCircle,{stroke:2,size:$.DIAL_ICON_SIZE.SM}):r!==e.id&&e.status===De.VALID?n.jsx(B.IconCheck,{stroke:2,size:$.DIAL_ICON_SIZE.SM}):t+1;return n.jsxs("button",{className:ce(a,Gs(e,r)),onClick:()=>s(e.id),children:[n.jsx("span",{className:ce(o,Us(e,r)),children:i()}),n.jsx("span",{children:e.name})]})},Ws=({steps:e,currentStep:t,onChangeStep:r})=>{const s=a=>{const o=e.findIndex(c=>c.id===t),i=e.findIndex(c=>c.id===a);if(a===t)return;(e.slice(0,i).every(c=>c.status===De.VALID)||i<o)&&r(a)};return n.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>n.jsx(Zs,{currentStep:t,onChangeStep:s,step:a,index:o},a.id))})},Zt=e=>(e.toString().split(".")[1]??"").length,qs=({value:e,min:t=0,max:r=1,step:s=.1,disabled:a=!1,labelProps:o,labels:i,formatValue:l,onChange:c,className:d,trackClassName:f,fillClassName:p,thumbClassName:g,labelsClassName:u,"aria-label":m,"aria-labelledby":C,...x})=>{const b=h.useRef(null),I=Math.max(0,Math.min(100,(e-t)/(r-t)*100)),N=Zt(s),T=l?l(e):e.toFixed(N),S=h.useCallback(A=>{const L=b.current;if(!L)return e;const w=L.getBoundingClientRect(),M=(A-w.left)/w.width,F=t+M*(r-t),K=Zt(s),te=parseFloat((Math.round((F-t)/s)*s+t).toFixed(K));return Math.min(r,Math.max(t,te))},[t,r,s,e]),D=h.useCallback(A=>{a||(A.currentTarget.setPointerCapture(A.pointerId),c?.(S(A.clientX)))},[a,S,c]),_=h.useCallback(A=>{a||A.buttons===0||c?.(S(A.clientX))},[a,S,c]),E=h.useCallback(A=>{if(a)return;const L=Zt(s),w=K=>parseFloat((Math.round((K-t)/s)*s+t).toFixed(L)),M=K=>Math.min(r,Math.max(t,K));let F=e;switch(A.key){case"ArrowRight":case"ArrowUp":F=M(w(e+s));break;case"ArrowLeft":case"ArrowDown":F=M(w(e-s));break;case"Home":F=t;break;case"End":F=r;break;default:return}A.preventDefault(),F!==e&&c?.(F)},[a,e,s,t,r,c]);return n.jsxs("div",{className:y.mergeClasses("flex flex-col",a&&"pointer-events-none opacity-50",d),...x,children:[o&&n.jsx(Be.DialLabel,{...o,htmlFor:x.id}),n.jsxs("div",{ref:b,className:"relative flex h-[38px] cursor-pointer items-center",onPointerDown:D,onPointerMove:_,children:[n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute inset-x-0 h-3 rounded-[10px] bg-layer-1",f)}),n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute left-0 h-3 rounded-[10px] bg-controls-accent-primary",p),style:{width:`${I}%`}}),n.jsx("div",{role:"slider",tabIndex:a?-1:0,"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":r,"aria-disabled":a||void 0,"aria-label":m,"aria-labelledby":C,className:y.mergeClasses("dial-small-text absolute -translate-x-1/2 flex size-[38px] cursor-grab select-none items-center justify-center rounded-full bg-layer-3 text-primary shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",g),style:{left:`${I}%`},onKeyDown:E,children:T})]}),i&&n.jsx("div",{className:y.mergeClasses("dial-tiny-text flex text-secondary",u),children:i.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i[0]}),n.jsx("span",{className:"flex-1 text-center",children:i[1]}),n.jsx("span",{children:i[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:i[0]}),n.jsx("span",{className:"ml-auto",children:i[1]})]})})]})},Ys=({label:e,text:t,tooltip:r,children:s,postfix:a,className:o})=>n.jsxs("div",{className:y.mergeClasses("flex flex-col",s?"":"max-w-[200px]",o),children:[e&&n.jsx("label",{className:"dial-tiny-text mb-2 text-secondary",children:e}),s||n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(O.DialTooltip,{triggerClassName:"text-primary flex-1 min-w-0",tooltip:r||t,children:t}),a||null]})]}),In=h.createContext({dragDropManager:void 0});function Ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var kr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Rr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mr={INIT:"@@redux/INIT"+Rr(),REPLACE:"@@redux/REPLACE"+Rr()};function Xs(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Qs(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(ta(e))return"date";if(ea(e))return"error";var r=Js(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Js(e){return typeof e.constructor=="function"?e.constructor.name:null}function ea(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ta(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function tt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Qs(e)),t}function Sn(e,t,r){var s;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(1):"Expected the enhancer to be a function. Instead, received: '"+tt(r)+"'");return r(Sn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(2):"Expected the root reducer to be a function. Instead, received: '"+tt(e)+"'");var a=e,o=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(4):"Expected the listener to be a function. Instead, received: '"+tt(C)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var x=!0;return d(),l.push(C),function(){if(x){if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");x=!1,d();var I=l.indexOf(C);l.splice(I,1),i=null}}}function g(C){if(!Xs(C))throw new Error(process.env.NODE_ENV==="production"?Ne(7):"Actions must be plain objects. Instead, the actual type was: '"+tt(C)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof C.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ne(9):"Reducers may not dispatch actions.");try{c=!0,o=a(o,C)}finally{c=!1}for(var x=i=l,b=0;b<x.length;b++){var I=x[b];I()}return C}function u(C){if(typeof C!="function")throw new Error(process.env.NODE_ENV==="production"?Ne(10):"Expected the nextReducer to be a function. Instead, received: '"+tt(C));a=C,g({type:Mr.REPLACE})}function m(){var C,x=p;return C={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?Ne(11):"Expected the observer to be an object. Instead, received: '"+tt(I)+"'");function N(){I.next&&I.next(f())}N();var T=x(N);return{unsubscribe:T}}},C[kr]=function(){return this},C}return g({type:Mr.INIT}),s={dispatch:g,subscribe:p,getState:f,replaceReducer:u},s[kr]=m,s}function J(e,t,...r){if(ra()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let s;if(t===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;s=new Error(t.replace(/%s/g,function(){return r[a++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}function ra(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function na(e,t,r){return t.split(".").reduce((s,a)=>s&&s[a]?s[a]:r||null,e)}function sa(e,t){return e.filter(r=>r!==t)}function Dn(e){return typeof e=="object"}function aa(e,t){const r=new Map,s=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(s),t.forEach(s);const a=[];return r.forEach((o,i)=>{o===1&&a.push(i)}),a}function oa(e,t){return e.filter(r=>t.indexOf(r)>-1)}const hr="dnd-core/INIT_COORDS",Lt="dnd-core/BEGIN_DRAG",mr="dnd-core/PUBLISH_DRAG_SOURCE",kt="dnd-core/HOVER",Rt="dnd-core/DROP",Mt="dnd-core/END_DRAG";function Pr(e,t){return{type:hr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const ia={type:hr,payload:{clientOffset:null,sourceClientOffset:null}};function la(e){return function(r=[],s={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=s,l=e.getMonitor(),c=e.getRegistry();e.dispatch(Pr(o)),ca(r,l,c);const d=fa(r,l);if(d==null){e.dispatch(ia);return}let f=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");da(i),f=i(d)}e.dispatch(Pr(o,f));const g=c.getSource(d).beginDrag(l,d);if(g==null)return;ua(g),c.pinSource(d);const u=c.getSourceType(d);return{type:Lt,payload:{itemType:u,item:g,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!a}}}}function ca(e,t,r){J(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(s){J(r.getSource(s),"Expected sourceIds to be registered.")})}function da(e){J(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function ua(e){J(Dn(e),"Item must be an object.")}function fa(e,t){let r=null;for(let s=e.length-1;s>=0;s--)if(t.canDragSource(e[s])){r=e[s];break}return r}function pa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ga(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){pa(e,a,r[a])})}return e}function ha(e){return function(r={}){const s=e.getMonitor(),a=e.getRegistry();ma(s),Ca(s).forEach((i,l)=>{const c=xa(i,l,a,s),d={type:Rt,payload:{dropResult:ga({},r,c)}};e.dispatch(d)})}}function ma(e){J(e.isDragging(),"Cannot call drop while not dragging."),J(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function xa(e,t,r,s){const a=r.getTarget(e);let o=a?a.drop(s,e):void 0;return ba(o),typeof o>"u"&&(o=t===0?{}:s.getDropResult()),o}function ba(e){J(typeof e>"u"||Dn(e),"Drop result must either be an object or undefined.")}function Ca(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function va(e){return function(){const r=e.getMonitor(),s=e.getRegistry();ya(r);const a=r.getSourceId();return a!=null&&(s.getSource(a,!0).endDrag(r,a),s.unpinSource()),{type:Mt}}}function ya(e){J(e.isDragging(),"Cannot call endDrag while not dragging.")}function ar(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Ia(e){return function(r,{clientOffset:s}={}){Sa(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return Na(a,i,l),Da(a,o,i),ja(a,o,i),{type:kt,payload:{targetIds:a,clientOffset:s||null}}}}function Sa(e){J(Array.isArray(e),"Expected targetIds to be an array.")}function Da(e,t,r){J(t.isDragging(),"Cannot call hover while not dragging."),J(!t.didDrop(),"Cannot call hover after drop.");for(let s=0;s<e.length;s++){const a=e[s];J(e.lastIndexOf(a)===s,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);J(o,"Expected targetIds to be registered.")}}function Na(e,t,r){for(let s=e.length-1;s>=0;s--){const a=e[s],o=t.getTargetType(a);ar(o,r)||e.splice(s,1)}}function ja(e,t,r){e.forEach(function(s){r.getTarget(s).hover(t,s)})}function Ta(e){return function(){if(e.getMonitor().isDragging())return{type:mr}}}function wa(e){return{beginDrag:la(e),publishDragSource:Ta(e),hover:Ia(e),drop:ha(e),endDrag:va(e)}}class Ea{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function s(o){return(...i)=>{const l=o.apply(t,i);typeof l<"u"&&r(l)}}const a=wa(this);return Object.keys(a).reduce((o,i)=>{const l=a[i];return o[i]=s(l),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const s=this.store.getState().refCount>0;this.backend&&(s&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!s&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function Oa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Aa(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:s}=e;return!t||!r||!s?null:Nn(Oa(t,s),r)}function _a(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Nn(t,r)}const ut=[],xr=[];ut.__IS_NONE__=!0;xr.__IS_ALL__=!0;function La(e,t){return e===ut?!1:e===xr||typeof t>"u"?!0:oa(t,e).length>0}class ka{subscribeToStateChange(t,r={}){const{handlerIds:s}=r;J(typeof t=="function","listener must be a function."),J(typeof s>"u"||Array.isArray(s),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const o=()=>{const i=this.store.getState(),l=i.stateId;try{l===a||l===a+1&&!La(i.dirtyHandlerIds,s)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){J(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const s=()=>{const a=this.store.getState().dragOffset;a!==r&&(r=a,t())};return this.store.subscribe(s)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return J(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(J(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const s=this.registry.getTargetType(t),a=this.getItemType();return ar(s,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(J(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const s=this.registry.getSourceType(t),a=this.getItemType();return s!==a?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:s}=r;if(!this.isDragging())return!1;const a=this.registry.getTargetType(t),o=this.getItemType();if(o&&!ar(a,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const l=i.indexOf(t);return s?l===i.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Aa(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return _a(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Fr=typeof global<"u"?global:self,jn=Fr.MutationObserver||Fr.WebKitMutationObserver;function Tn(e){return function(){const r=setTimeout(a,0),s=setInterval(a,50);function a(){clearTimeout(r),clearInterval(s),e()}}}function Ra(e){let t=1;const r=new jn(e),s=document.createTextNode("");return r.observe(s,{characterData:!0}),function(){t=-t,s.data=t}}const Ma=typeof jn=="function"?Ra:Tn;class Pa{enqueueTask(t){const{queue:r,requestFlush:s}=this;r.length||(s(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let s=0,a=t.length-this.index;s<a;s++)t[s]=t[s+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Ma(this.flush),this.requestErrorThrow=Tn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Fa{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class Ba{create(t){const r=this.freeTasks,s=r.length?r.pop():new Fa(this.onError,a=>r[r.length]=a);return s.task=t,s}constructor(t){this.onError=t,this.freeTasks=[]}}const wn=new Pa,za=new Ba(wn.registerPendingError);function $a(e){wn.enqueueTask(za.create(e))}const br="dnd-core/ADD_SOURCE",Cr="dnd-core/ADD_TARGET",vr="dnd-core/REMOVE_SOURCE",Pt="dnd-core/REMOVE_TARGET";function Ha(e){return{type:br,payload:{sourceId:e}}}function Va(e){return{type:Cr,payload:{targetId:e}}}function Ka(e){return{type:vr,payload:{sourceId:e}}}function Ga(e){return{type:Pt,payload:{targetId:e}}}function Ua(e){J(typeof e.canDrag=="function","Expected canDrag to be a function."),J(typeof e.beginDrag=="function","Expected beginDrag to be a function."),J(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Za(e){J(typeof e.canDrop=="function","Expected canDrop to be a function."),J(typeof e.hover=="function","Expected hover to be a function."),J(typeof e.drop=="function","Expected beginDrag to be a function.")}function or(e,t){if(t&&Array.isArray(e)){e.forEach(r=>or(r,!1));return}J(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Te;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Te||(Te={}));let Wa=0;function qa(){return Wa++}function Ya(e){const t=qa().toString();switch(e){case Te.SOURCE:return`S${t}`;case Te.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Br(e){switch(e[0]){case"S":return Te.SOURCE;case"T":return Te.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function zr(e,t){const r=e.entries();let s=!1;do{const{done:a,value:[,o]}=r.next();if(o===t)return!0;s=!!a}while(!s);return!1}class Xa{addSource(t,r){or(t),Ua(r);const s=this.addHandler(Te.SOURCE,t,r);return this.store.dispatch(Ha(s)),s}addTarget(t,r){or(t,!0),Za(r);const s=this.addHandler(Te.TARGET,t,r);return this.store.dispatch(Va(s)),s}containsHandler(t){return zr(this.dragSources,t)||zr(this.dropTargets,t)}getSource(t,r=!1){return J(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return J(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return J(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return J(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Br(t)===Te.SOURCE}isTargetId(t){return Br(t)===Te.TARGET}removeSource(t){J(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ka(t)),$a(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){J(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Ga(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);J(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){J(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,s){const a=Ya(t);return this.types.set(a,r),t===Te.SOURCE?this.dragSources.set(a,s):t===Te.TARGET&&this.dropTargets.set(a,s),a}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Qa=(e,t)=>e===t;function Ja(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function eo(e,t,r=Qa){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!r(e[s],t[s]))return!1;return!0}function to(e=ut,t){switch(t.type){case kt:break;case br:case Cr:case Pt:case vr:return ut;case Lt:case mr:case Mt:case Rt:default:return xr}const{targetIds:r=[],prevTargetIds:s=[]}=t.payload,a=aa(r,s);if(!(a.length>0||!eo(r,s)))return ut;const i=s[s.length-1],l=r[r.length-1];return i!==l&&(i&&a.push(i),l&&a.push(l)),a}function ro(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function no(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ro(e,a,r[a])})}return e}const $r={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function so(e=$r,t){const{payload:r}=t;switch(t.type){case hr:case Lt:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case kt:return Ja(e.clientOffset,r.clientOffset)?e:no({},e,{clientOffset:r.clientOffset});case Mt:case Rt:return $r;default:return e}}function ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){ao(e,a,r[a])})}return e}const oo={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function io(e=oo,t){const{payload:r}=t;switch(t.type){case Lt:return rt({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case mr:return rt({},e,{isSourcePublic:!0});case kt:return rt({},e,{targetIds:r.targetIds});case Pt:return e.targetIds.indexOf(r.targetId)===-1?e:rt({},e,{targetIds:sa(e.targetIds,r.targetId)});case Rt:return rt({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Mt:return rt({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function lo(e=0,t){switch(t.type){case br:case Cr:return e+1;case vr:case Pt:return e-1;default:return e}}function co(e=0){return e+1}function uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){uo(e,a,r[a])})}return e}function po(e={},t){return{dirtyHandlerIds:to(e.dirtyHandlerIds,{type:t.type,payload:fo({},t.payload,{prevTargetIds:na(e,"dragOperation.targetIds",[])})}),dragOffset:so(e.dragOffset,t),refCount:lo(e.refCount,t),dragOperation:io(e.dragOperation,t),stateId:co(e.stateId)}}function go(e,t=void 0,r={},s=!1){const a=ho(s),o=new ka(a,new Xa(a)),i=new Ea(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function ho(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Sn(po,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function mo(e,t){if(e==null)return{};var r=xo(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function xo(e,t){if(e==null)return{};var r={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}let Hr=0;const Nt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var bo=h.memo(function(t){var{children:r}=t,s=mo(t,["children"]);const[a,o]=Co(s);return h.useEffect(()=>{if(o){const i=En();return++Hr,()=>{--Hr===0&&(i[Nt]=null)}}},[]),n.jsx(In.Provider,{value:a,children:r})});function Co(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=vo(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function vo(e,t=En(),r,s){const a=t;return a[Nt]||(a[Nt]={dragDropManager:go(e,t,r,s)}),a[Nt]}function En(){return typeof global<"u"?global:window}var Wt,Vr;function yo(){return Vr||(Vr=1,Wt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var s,a,o;if(Array.isArray(t)){if(s=t.length,s!=r.length)return!1;for(a=s;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),s=o.length,s!==Object.keys(r).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Wt}var Io=yo();const So=v.getDefaultExportFromCjs(Io),Ze=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Do(e,t,r){const[s,a]=h.useState(()=>t(e)),o=h.useCallback(()=>{const i=t(e);So(s,i)||(a(i),r&&r())},[s,e,r]);return Ze(o),[s,o]}function No(e,t,r){const[s,a]=Do(e,t,r);return Ze(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),s}function On(e,t,r){return No(t,e||(()=>({})),()=>r.reconnect())}function An(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),h.useMemo(()=>typeof e=="function"?e():e,r)}function jo(e){return h.useMemo(()=>e.hooks.dragSource(),[e])}function To(e){return h.useMemo(()=>e.hooks.dragPreview(),[e])}let qt=!1,Yt=!1;class wo{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){J(!qt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return qt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{qt=!1}}isDragging(){if(!this.sourceId)return!1;J(!Yt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Yt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Yt=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Xt=!1;class Eo{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;J(!Xt,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Xt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Xt=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function Oo(e,t,r){const s=r.getRegistry(),a=s.addTarget(e,t);return[a,()=>s.removeTarget(a)]}function Ao(e,t,r){const s=r.getRegistry(),a=s.addSource(e,t);return[a,()=>s.removeSource(a)]}function ir(e,t,r,s){let a;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<o.length;c++){const d=o[c];if(!l(d))return!1;const f=e[d],p=t[d];if(a=void 0,a===!1||a===void 0&&f!==p)return!1}return!0}function lr(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _o(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Lo(e){return(t=null,r=null)=>{if(!h.isValidElement(t)){const o=t;return e(o,r),o}const s=t;return _o(s),ko(s,r?o=>e(o,r):e)}}function _n(e){const t={};return Object.keys(e).forEach(r=>{const s=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=Lo(s);t[r]=()=>a}}),t}function Kr(e,t){typeof e=="function"?e(t):e.current=t}function ko(e,t){const r=e.ref;return J(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(e,{ref:s=>{Kr(r,s),Kr(t,s)}}):h.cloneElement(e,{ref:t})}class Ro{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,s=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(s&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ir(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ir(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=_n({dragSource:(r,s)=>{this.clearDragSource(),this.dragSourceOptions=s||null,lr(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,s)=>{this.clearDragPreview(),this.dragPreviewOptions=s||null,lr(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class Mo{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ir(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=_n({dropTarget:(r,s)=>{this.clearDropTarget(),this.dropTargetOptions=s,lr(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function ot(){const{dragDropManager:e}=h.useContext(In);return J(e!=null,"Expected drag drop context"),e}function Po(e,t){const r=ot(),s=h.useMemo(()=>new Ro(r.getBackend()),[r]);return Ze(()=>(s.dragSourceOptions=e||null,s.reconnect(),()=>s.disconnectDragSource()),[s,e]),Ze(()=>(s.dragPreviewOptions=t||null,s.reconnect(),()=>s.disconnectDragPreview()),[s,t]),s}function Fo(){const e=ot();return h.useMemo(()=>new wo(e),[e])}class Bo{beginDrag(){const t=this.spec,r=this.monitor;let s=null;return typeof t.item=="object"?s=t.item:typeof t.item=="function"?s=t.item(r):s={},s??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const s=this.spec,a=this.monitor,{isDragging:o}=s;return o?o(a):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,s=this.connector,{end:a}=t;a&&a(r.getItem(),r),s.reconnect()}constructor(t,r,s){this.spec=t,this.monitor=r,this.connector=s}}function zo(e,t,r){const s=h.useMemo(()=>new Bo(e,t,r),[t,r]);return h.useEffect(()=>{s.spec=e},[e]),s}function $o(e){return h.useMemo(()=>{const t=e.type;return J(t!=null,"spec.type must be defined"),t},[e])}function Ho(e,t,r){const s=ot(),a=zo(e,t,r),o=$o(e);Ze(function(){if(o!=null){const[l,c]=Ao(o,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c}},[s,t,r,a,o])}function Vo(e,t){const r=An(e,t);J(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const s=Fo(),a=Po(r.options,r.previewOptions);return Ho(r,s,a),[On(r.collect,s,a),jo(a),To(a)]}function Ko(e){return h.useMemo(()=>e.hooks.dropTarget(),[e])}function Go(e){const t=ot(),r=h.useMemo(()=>new Mo(t.getBackend()),[t]);return Ze(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Uo(){const e=ot();return h.useMemo(()=>new Eo(e),[e])}function Zo(e){const{accept:t}=e;return h.useMemo(()=>(J(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Wo{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function qo(e,t){const r=h.useMemo(()=>new Wo(e,t),[t]);return h.useEffect(()=>{r.spec=e},[e]),r}function Yo(e,t,r){const s=ot(),a=qo(e,t),o=Zo(e);Ze(function(){const[l,c]=Oo(o,a,s);return t.receiveHandlerId(l),r.receiveHandlerId(l),c},[s,t,a,r,o.map(i=>i.toString()).join("|")])}function yr(e,t){const r=An(e,t),s=Uo(),a=Go(r.options);return Yo(r,s,a),[On(r.collect,s,a),Ko(a)]}const Gr="column",Xo="flex items-center",Qo="mr-3 cursor-move text-secondary",Jo=({id:e,children:t,className:r,onFind:s,onMove:a,ariaLabel:o="Drag item"})=>{const i=h.useRef(null),l=h.useRef(null),c=typeof s=="function"?s(e):-1,[{isDragging:d},f,p]=Vo(()=>({type:Gr,item:{id:e,originalIndex:c},collect:u=>{const m=u.getItem();return{isDragging:u.isDragging()&&m?.id===e}},end:(u,m)=>{if(!u)return;!m.didDrop()&&typeof a=="function"&&u.originalIndex>-1&&a(u.id,u.originalIndex)}}),[e,c,a]),[,g]=yr(()=>({accept:Gr,hover:u=>{if(!(!u||u.id===e)&&typeof s=="function"&&typeof a=="function"){const m=s(e);a(u.id,m)}}}),[s,a,e]);return p(g(l)),f(i),n.jsxs("div",{ref:l,className:y.mergeClasses(Xo,r),style:{opacity:d?0:1},"aria-roledescription":"Draggable item",children:[n.jsx("div",{ref:i,className:Qo,"aria-label":o,children:n.jsx(B.IconGripVertical,{...$.BASE_ICON_PROPS})}),t]})},Ft=({iconClassName:e,label:t,...r})=>t?n.jsx(v.DialDangerButton,{...r,label:t,appearance:O.ButtonAppearance.Ghost,iconBefore:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS,className:e||""})}):n.jsx(j.DialDangerIconButton,{...r,appearance:O.ButtonAppearance.Ghost,icon:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS,className:e||""})}),ei=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=y.mergeClasses("dial-textarea dial-input px-3 py-2",d.invalid&&"dial-input-error",d.disabled&&"dial-input-disable",o?"resize":"resize-none",e);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-1",a),children:[i&&n.jsx(Be.DialLabel,{...i,htmlFor:c}),n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(v.DialErrorText,{text:s}),!s&&n.jsx(v.DialCaptionText,{text:l})]})},ti="inline-flex items-center rounded bg-layer-3",ri="flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10",ni="relative z-10 bg-controls-accent-primary-alpha-active text-primary",si="text-secondary hover:text-primary",ai="text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent",oi=({options:e,value:t,onChange:r,disabled:s,className:a,ariaLabel:o})=>{const i=h.useCallback(l=>{if(s)return;const c=e.filter(g=>!g.disabled);if(c.length===0)return;const d=c.findIndex(g=>g.value===t);let f=null;switch(l.key){case"ArrowRight":case"ArrowDown":f=(d+1)%c.length;break;case"ArrowLeft":case"ArrowUp":f=(d-1+c.length)%c.length;break;case"Home":f=0;break;case"End":f=c.length-1;break;default:return}l.preventDefault();const p=c[f];p&&p.value!==t&&r(p.value)},[s,e,t,r]);return n.jsx("div",{role:"tablist","aria-label":o,className:y.mergeClasses(ti,a),children:e.map((l,c)=>{const d=l.value===t,f=c===0,p=c===e.length-1,g=s||l.disabled;return n.jsxs("button",{type:"button",role:"tab","aria-selected":d,tabIndex:d?0:-1,disabled:g,onClick:()=>r(l.value),onKeyDown:i,className:y.mergeClasses(ri,!p&&"-mr-px",f&&"rounded-l",p&&"rounded-r",d?ni:si,g&&ai),children:[l.icon,l.label]},l.value)})})},Qt=8,ii=24,Ln=({initialTags:e=[],label:t,required:r,elementId:s,placeholder:a,captionDescription:o,errorText:i,invalid:l,disabled:c,collapseTagOverflow:d=!1,readOnly:f=!1,containerClassName:p,tagClassName:g,onChange:u})=>{const m=h.useRef(null),C=h.useRef([]),x=h.useRef(null),[b,I]=h.useState(e),[N,T]=h.useState(""),[S,D]=h.useState(!1),[_,E]=h.useState(e.length),A=h.useCallback(z=>H=>{C.current[z]=H},[]),L=h.useCallback(()=>{if(!d)return;const z=m.current;if(!z)return;const H=z.offsetWidth;if(H===0)return;const q=x.current?.offsetWidth??0,ae=H-(f?0:ii)-Qt;let Y=0,Z=0;for(let re=0;re<b.length;re++){const oe=C.current[re];if(!oe)continue;const le=oe.offsetWidth+Qt;if(Y+le>ae)break;Y+=le,Z++}if(Z<b.length&&Z>0)for(;Y+q>ae&&Z>0;){Z--;const re=C.current[Z]?.offsetWidth??0;Y-=re+Qt}E(Z)},[d,f,b.length]),w=z=>{const H=z.trim().replace(/,$/,"");if(H&&!b.includes(H)){const q=[H,...b];I(q),u?.(q)}},M=z=>{(z.key===","||z.key==="Enter")&&(z.preventDefault(),w(N),T(""))},F=()=>{N.trim()&&(w(N),T(""))},K=z=>{const H=b.filter((q,U)=>U!==z);I(H),u?.(H)},te=()=>i?n.jsx(v.DialErrorText,{text:i}):o?n.jsx(v.DialCaptionText,{text:o}):null;h.useEffect(()=>{if(d)return;const z=new ResizeObserver(()=>{if(m.current){const H=m.current.scrollHeight>m.current.clientHeight+10;D(H)}});return m.current&&z.observe(m.current),()=>z.disconnect()},[b,d]),h.useEffect(()=>{if(!d){E(b.length);return}E(b.length);const z=new ResizeObserver(()=>{L()}),H=m.current;return H&&z.observe(H),L(),()=>z.disconnect()},[d,L,b]),h.useEffect(()=>{I(e)},[JSON.stringify(e)]);const G=n.jsxs("div",{ref:m,className:ce("flex gap-2 items-center relative",d?"flex-nowrap overflow-hidden w-full min-w-0":ce("flex-wrap",S?"flex-col-reverse":"flex-row"),p),children:[(d?b.slice(0,_):b).map((z,H)=>n.jsx(Ue,{label:z,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>K(H):void 0},z+H)),d&&_<b.length&&n.jsx(O.DialTooltip,{tooltip:b.slice(_).join(", "),triggerClassName:"inline-flex shrink-0 cursor-pointer",children:n.jsx(Ue,{label:`+${b.length-_}`})}),!f&&n.jsx("input",{id:s,type:"text",value:N,onChange:z=>T(z.target.value),onKeyDown:M,onBlur:F,className:ce("dial-input outline-none !border-none w-full flex-1 !p-1 !h-auto",d?"min-w-0":"min-w-[100px]"),placeholder:a??"",disabled:c}),d&&n.jsxs("div",{className:"absolute left-0 top-0 invisible pointer-events-none h-0 overflow-hidden whitespace-nowrap","aria-hidden":!0,children:[b.map((z,H)=>n.jsx("div",{ref:A(H),className:"inline-flex shrink-0",children:n.jsx(Ue,{label:z,className:g,closable:!c&&!f,onRemove:!c&&!f?()=>K(H):void 0})},`measure-${z}-${H}`)),n.jsx("div",{ref:x,className:"inline-flex shrink-0",children:n.jsx(Ue,{label:`+${b.length}`})})]})]});return f?G:n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(Be.DialLabel,{label:t,required:r,htmlFor:s}),n.jsx("div",{className:ce("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:G}),te()]})},kn=({selectedItems:e,placeholder:t,collapseTagOverflow:r=!1,listClassName:s,listElementClassName:a})=>e?.length?n.jsx(Ln,{readOnly:!0,initialTags:e,collapseTagOverflow:r,containerClassName:s,tagClassName:a}):t?n.jsx("span",{className:"text-secondary",children:t}):null,Jt=e=>Ar.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ar.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),Rn=({children:e,open:t,disabled:r=!1,selectedValue:s,valueClassName:a,inputClassName:o,onOpen:i,elementId:l,errorText:c,invalid:d,emptyValueText:f,placeholder:p,editable:g=!1,onValueChange:u,collapseTagOverflow:m=!1,iconBefore:C})=>{const x=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),I=x||b?s:p?void 0:f,N=r?void 0:i,T=h.useCallback(E=>{u?.(E.target.value)},[u]),S=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between",o,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx("input",{type:"text",className:ce("flex-1 min-w-0 bg-transparent outline-none border-none p-0 dial-small-text text-primary placeholder:text-secondary",a),value:typeof s=="string"?s:"",placeholder:p||f,onChange:T,disabled:r,id:l,"aria-label":"input-popup-field"})]}),!r&&n.jsx("button",{type:"button",className:"shrink-0 cursor-pointer bg-transparent border-none p-0 ml-1",onClick:i,"aria-label":"open-popup",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]}),n.jsx(v.DialErrorText,{text:c})]}),D=()=>n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"w-full",onClick:N,"aria-label":"open-popup",id:l,children:n.jsxs("div",{className:ce("dial-input px-3 py-2 dial-input-field flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",o,r&&"dial-input-disable",(c||d)&&"dial-input-error"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx(O.DialTooltip,{tooltip:I==null?void 0:String(I),children:I||!p?n.jsx("span",{className:a,children:I}):n.jsx("span",{className:"text-secondary",children:p})})]}),!r&&n.jsx("div",{className:"shrink-0",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]})}),n.jsx(v.DialErrorText,{text:c})]}),_=()=>n.jsx("div",{className:"w-full",onClick:N,children:n.jsxs("div",{className:ce("dial-input px-3 py-2 flex flex-row items-center gap-x-2 w-full justify-between cursor-pointer",r&&"dial-input-disable"),children:[n.jsxs("div",{className:"flex flex-row items-center gap-x-2 flex-1 min-w-0",children:[C&&n.jsx(j.DialIcon,{icon:C}),n.jsx(kn,{placeholder:p,selectedItems:I,collapseTagOverflow:m})]}),!r&&n.jsx("div",{className:"ml-1",children:n.jsx(j.DialIcon,{icon:n.jsx(Jt,{role:"img",width:$.BASE_ICON_SIZE,height:$.BASE_ICON_SIZE})})})]})});return n.jsxs(n.Fragment,{children:[x?_():g?S():D(),t&&ws.createPortal(e,document.body)]})},li=({label:e,htmlFor:t,disabled:r,selectedValue:s,radioButtons:a,customInputValue:o,valueClassName:i,inputClassName:l,emptyValueText:c,placeholder:d,onClose:f,header:p,portalId:g,onApply:u,onCancel:m,cancelButtonTitle:C="Cancel",applyButtonTitle:x="Apply",isValid:b,selectedRadioValue:I,onChangeRadioField:N,id:T,size:S=v.PopupSize.Md})=>{const[D,_]=h.useState(!1),E=h.useCallback(()=>{r||_(!0)},[r]),A=h.useCallback(()=>{_(!1),f?.()},[f]),L=h.useCallback(()=>{m?.(),A()},[m,A]),w=h.useCallback(()=>{u(),A()},[u,A]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(Be.DialLabel,{label:e,htmlFor:t}),n.jsx(Rn,{disabled:r,open:D,selectedValue:o??a.find(M=>M.id===s)?.name,valueClassName:i,inputClassName:ce(l,"py-2","px-3"),emptyValueText:c,placeholder:d,onOpen:E,children:n.jsx(v.DialPopup,{open:D,onClose:L,header:p,portalId:g,size:S,footer:n.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[n.jsx(v.DialNeutralButton,{label:C,onClick:L}),n.jsx(v.DialPrimaryButton,{label:x,onClick:w,disabled:!b})]}),children:n.jsx("div",{className:"px-6 py-4",children:n.jsx(v.DialRadioGroup,{radioButtons:a,labelClassName:"dial-small-text",activeRadioButton:I,onChange:N,elementId:T,orientation:v.RadioGroupOrientation.Column})})})})]})},ci="Create",di="Cancel",ui="flex items-center justify-end gap-2 px-6 py-3",fi=({header:e,open:t=!1,submitLabel:r=ci,cancelLabel:s=di,isLoading:a=!1,disableSubmitButton:o=!1,className:i,submitClassName:l,onClose:c,onSubmit:d,onCancel:f,children:p,dividers:g=!0,size:u=v.PopupSize.Md,footer:m})=>{const C=a?null:n.jsxs("div",{className:ui,children:[n.jsx(v.DialNeutralButton,{label:s,onClick:()=>f?f():c?.()}),n.jsx(v.DialPrimaryButton,{className:l,label:r,disabled:o,onClick:()=>d()})]}),x=h.useCallback(()=>a?n.jsx("div",{className:"px-6 py-4 h-[120px]",children:n.jsx(v.DialLoader,{size:50})}):p??null,[p,a]);return n.jsx(v.DialPopup,{open:t,header:e,className:i,dividers:g,onClose:()=>c?.(),footer:m??C,size:u,children:x()})},pi=/^0+\.(\d+)?$/,gi=/^0+/,cr=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=f=>!f||f==="-"?f:String(f)?.match(pi)?String(f)?.replace(gi,"0"):Number(f),c=f=>{if([".","-","+","e","E"].includes(f.key)){f.preventDefault();return}v.handleKeyDown(f,"number",r,s)},d=f=>{const p=f.clipboardData.getData("text"),g=p.replace(/\D/g,"");if(g!==p&&(f.preventDefault(),g)){const u=f.currentTarget,m=u.selectionStart??0,C=u.selectionEnd??0,x=u.value.slice(0,m)+g+u.value.slice(C);t?.(l(x))}};return n.jsx(v.DialInput,{type:"number",min:r,max:s,onChange:f=>t?.(l(f)),onKeyDown:e?c:a,onPaste:e?d:o,...i})},hi=({onClick:e})=>n.jsx(B.IconEyeOff,{...$.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),mi=({onClick:e})=>n.jsx(B.IconEye,{...$.BASE_ICON_PROPS,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),Mn=({...e})=>{const[t,r]=h.useState(!1),s=h.useCallback(a=>{r(a)},[]);return n.jsx(v.DialInput,{type:t?"text":"password",...e,iconAfter:e.disabled?null:t?n.jsx(hi,{onClick:()=>s(!1)}):n.jsx(mi,{onClick:()=>s(!0)})})},Pn=({options:e,selectedValues:t,handleRemoveTag:r})=>n.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(s=>{const a=e.find(i=>i.value===s)?.label??s,o=e.find(i=>i.value===s)?.icon;return n.jsx(Ue,{label:a,onRemove:i=>r?.(i,s),icon:o?n.jsx(j.DialIcon,{icon:o}):null,className:"max-w-full"},s)})});var Tt=(e=>(e.Sm="sm",e.Md="md",e))(Tt||{}),wt=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(wt||{});const xi="dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer",bi="w-full rounded flex flex-col",ft="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",Ci="bg-accent-primary-alpha",dr="bg-accent-primary-alpha border-l border-accent-primary border-1",Et="opacity-75",vi=352,yi=4,Ii=n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM}),Si=({opt:e,selectedValues:t,onSelect:r})=>{const{isOpen:s,refs:a,floatingStyles:o,context:i,getReferenceProps:l,getFloatingProps:c}=j.useSubMenuFloating(yi,"listbox",!!e.disabled),d=e.children?.some(f=>t.includes(f.value));return n.jsxs(n.Fragment,{children:[n.jsxs("button",{ref:a.setReference,type:"button",role:"option","aria-haspopup":"listbox","aria-expanded":s,"aria-selected":!!d,"aria-disabled":!!e.disabled,disabled:e.disabled,className:ce(ft,d&&dr,e.disabled&&Et),...l(),children:[n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.icon&&n.jsx(j.DialIcon,{icon:e.icon}),n.jsx(j.DialEllipsisTooltip,{text:e.labelNode??e.label})]}),n.jsx(B.IconChevronRight,{size:14,className:"shrink-0"})]}),s&&n.jsx(j.SubMenuPanel,{refs:a,floatingStyles:o,context:i,getFloatingProps:c,role:"listbox",className:"w-max py-1",children:e.children.map(f=>{const p=t.includes(f.value);return n.jsx("button",{type:"button",role:"option","aria-selected":p,"aria-disabled":!!f.disabled,disabled:f.disabled,className:ce(ft,p&&dr,f.disabled&&Et),onClick:()=>!f.disabled&&r(f.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.icon&&n.jsx(j.DialIcon,{icon:f.icon}),n.jsx(j.DialEllipsisTooltip,{text:f.labelNode??f.label})]})},f.value)})})]})},_e=({options:e,multiple:t=!1,elementId:r,value:s,defaultValue:a,variant:o=wt.Primary,size:i=Tt.Md,prefix:l,customSelectedValue:c,placeholder:d="Select...",searchable:f=!1,searchSize:p=O.ElementSize.Standard,searchPlaceholder:g,selectAll:u=!1,invalid:m,selectAllLabel:C="Select all",emptyStateTitle:x="No options available",emptyStateDescription:b,emptyStateIcon:I,disabled:N=!1,className:T,listClassName:S,closable:D=!1,header:_,footer:E,onClose:A,onChange:L,inlineSearch:w=!1,dismissRef:M,onFooterClick:F,open:K,onOpenChange:te,onInlineQueryChange:G,customMultiSelectTagsRenderer:z})=>{const H=h.useId(),[q,U]=h.useState(!1),ae=K!==void 0,Y=ae?!!K:q,Z=h.useCallback(R=>{ae||U(R),te?.(R)},[ae,te]),[re,oe]=h.useState(w&&c||""),le=h.useRef(null),ue=h.useCallback(R=>{R!==re&&(oe(R||""),G?.(R||""))},[G,re]),me=s!==void 0,[Ce,ge]=h.useState(a),W=me?s:Ce,Q=h.useMemo(()=>t?Array.isArray(W)?W:[]:typeof W=="string"?[W]:[],[W,t]),we=h.useMemo(()=>{const R=re.trim().toLowerCase();return R?e.filter(ne=>ne.label.toLowerCase().includes(R)):e},[e,re]);h.useEffect(()=>{!Y&&!w&&ue("")},[w,Y,ue]);const ke=h.useRef(c);h.useEffect(()=>{w&&c!==ke.current&&(Y||(ke.current=c,ue(c||"")))},[c,w,Y,ue]);const X=h.useCallback(R=>{me||ge(R),L?.(R)},[me,L]),de=h.useCallback(R=>{if(t){const ne=new Set(Q);ne.has(R)?ne.delete(R):ne.add(R),X(Array.from(ne));return}if(X(R),w){const ne=e.find(Ie=>Ie.value===R)??e.flatMap(Ie=>Ie.children??[]).find(Ie=>Ie.value===R);ne&&ue(ne.label)}Z(!1)},[t,X,w,Z,Q,e,ue]),Ee=h.useCallback((R,ne)=>{if(R.stopPropagation(),!t){X("");return}const Ie=Q.filter(Vt=>Vt!==ne);X(Ie)},[t,Q,X]),xe=h.useMemo(()=>we.filter(R=>!R.disabled),[we]),fe=h.useMemo(()=>xe.filter(R=>Q.includes(R.value)).length,[xe,Q]),Qe=h.useCallback(R=>{w&&!t&&!R&&de(re),Z(R)},[de,w,t,re,Z]),{allSelectedInFiltered:ye,someSelectedInFiltered:ct}=h.useMemo(()=>{const R=xe.length>0&&fe===xe.length;return{allSelectedInFiltered:R,someSelectedInFiltered:fe>0&&!R}},[xe,fe]),Je=h.useCallback(()=>{if(!(!t||xe.length===0))if(ye){const R=new Set(xe.map(ne=>ne.value));X(Q.filter(ne=>!R.has(ne)))}else{const R=new Set(Q);xe.forEach(ne=>R.add(ne.value)),X(Array.from(R))}},[ye,t,xe,Q,X]),ve=Q.length>0;h.useEffect(()=>{Y&&w&&!t&&!N&&requestAnimationFrame(()=>{const R=le.current;if(!R)return;R.focus();const ne=R.value?.length??0;R.setSelectionRange?.(ne,ne)})},[Y,w,t,N]);const ze=!t&&ve?Q[0]:void 0,be=h.useMemo(()=>ze?e.find(R=>R.value===ze)??e.flatMap(R=>R.children??[]).find(R=>R.value===ze):void 0,[e,ze]),Ht=h.useCallback(()=>t?ve?z?.(e,Q,Ee)||n.jsx(Pn,{options:e,selectedValues:Q,handleRemoveTag:Ee}):n.jsx("span",{className:"text-secondary truncate",children:d}):be?n.jsxs(n.Fragment,{children:[be.icon&&n.jsx(j.DialIcon,{icon:be.icon}),n.jsx(j.DialEllipsisTooltip,{text:be.labelNode??(l?`${l} ${be.label}`:be.label)}),be?.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:be.description})]}):c&&s?c:n.jsx("span",{className:"text-secondary truncate",children:d}),[ve,t,c,l,s,d,be,e,Q,Ee,z]);h.useImperativeHandle(M,()=>({dismiss:()=>{Z(!1)}}));const et=h.useCallback(()=>{ue(Q.length===1?be?.label??re:"")},[re,Q.length,ue,be?.label]),Ge=h.useCallback(()=>{N||(Z(!Y),w&&!t&&(et(),le.current?.focus()))},[N,w,Y,t,et,Z]);return n.jsx(j.DialDropdown,{open:Y,onOpenChange:Qe,disabled:N,closable:D,onClose:A,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:f?null:vi,listClassName:S,renderOverlay:()=>n.jsxs("div",{id:`list-${r||H}`,role:"listbox","aria-multiselectable":t||void 0,className:bi,children:[_&&n.jsx(n.Fragment,{children:typeof _=="function"?_():_}),(f||D)&&e.length>8&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[f&&n.jsx(v.DialSearch,{size:p,placeholder:g,onChange:ue,value:re,id:`search-${r||H}`,containerClassName:y.mergeClasses(v.SIZE_CONFIG[p].containerClassName,"w-full")}),D&&n.jsx(v.DialButton,{"aria-label":"Close select",className:"shrink-0",iconBefore:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM}),onClick:R=>{A?.(R),Z(!1)}})]}),t&&u&&xe.length>0&&n.jsx("div",{className:ce(ft,"mt-2"),children:n.jsx(sr,{id:`${r||H}-selectAll`,label:C,checked:ye,indeterminate:ct,onChange:Je,ariaLabel:C})}),n.jsx("div",{className:ce("overflow-y-auto max-h-[352px]",w&&we.length===0?"":"py-1"),children:we.length===0?!w&&n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:I??n.jsx(B.IconClipboardX,{size:$.DIAL_ICON_SIZE.LG,stroke:.5}),title:x,description:b})}):we.map(R=>{const ne=Q.includes(R.value);return t?n.jsxs("div",{role:"option","aria-selected":ne,"aria-disabled":!!R.disabled,className:ce(ft,ne&&Ci,R.disabled&&Et,"w-full"),children:[n.jsx(sr,{id:`${r||H}-${R.value}`,label:n.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[R.icon&&n.jsx(j.DialIcon,{icon:R.icon}),n.jsx("span",{className:"truncate",children:R.labelNode??R.label})]}),checked:ne,disabled:R.disabled,onChange:()=>!R.disabled&&de(R.value),ariaLabel:R.label}),R.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:R.description})]},R.value):R.children?.length?n.jsx(Si,{opt:R,selectedValues:Q,onSelect:de},R.value):n.jsx("button",{role:"option",type:"button","aria-selected":ne,"aria-disabled":!!R.disabled,disabled:R.disabled,className:ce(ft,ne&&dr,R.disabled&&Et),onClick:()=>!R.disabled&&de(R.value),children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[R.icon&&n.jsx(j.DialIcon,{icon:R.icon}),n.jsx(j.DialEllipsisTooltip,{text:R.labelNode??R.label}),R.description&&n.jsx("div",{className:"text-secondary dial-small-text",children:R.description})]})},R.value)})}),E&&n.jsx("div",{onClick:R=>{F?.(R),F&&Z(!1)},children:typeof E=="function"?E():E})]}),children:n.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":Y,"aria-controls":`list-${r||H}`,className:y.mergeClasses(xi,N&&"opacity-75 !cursor-not-allowed !border-primary",i===Tt.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",m&&"dial-input-error",o===wt.Secondary?"!bg-layer-4 !h-auto":"",T),onMouseDown:R=>{N||w&&!t&&(et(),R.preventDefault())},onClick:()=>{Ge()},onKeyDown:R=>{(R.key===" "||R.code==="Space")&&(R.preventDefault(),Ge())},children:[w&&!t?n.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:n.jsx("input",{id:`inline-${r||H}`,type:"text",placeholder:g??d,value:re||"",onChange:R=>ue(R.currentTarget.value.trimStart()),onFocus:()=>!N&&Z(!0),onMouseDown:R=>{et(),R.stopPropagation()},onClick:R=>{R.stopPropagation()},onKeyDown:R=>{R.stopPropagation()},className:"bg-transparent outline-none w-full dial-small-text",ref:le,disabled:N,"aria-disabled":N,autoComplete:"off"})}):n.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:Ht()}),!w&&n.jsx(j.DialIcon,{icon:Ii,className:ce("text-primary",Y&&"rotate-180")})]})})},Di=({label:e,required:t,captionDescription:r,containerClassName:s,selectClassName:a,error:o,id:i,caption:l,readonly:c,value:d,defaultEmptyText:f,...p})=>{const g=h.useCallback(()=>{if(!d||Array.isArray(d)&&d.length===0)return f??"None";if(Array.isArray(d))return n.jsx(Pn,{options:p.options,selectedValues:d});{const u=p.options?.find(m=>m.value===d);return n.jsx("span",{"aria-readonly":!0,className:"text-primary",children:u?.label||d})}},[d,p.options,f]);return n.jsx(v.DialFormItem,{id:i,label:e,required:t,description:l,error:o,captionDescription:r,className:s,readonly:c,value:g(),defaultEmptyText:f,children:n.jsx(_e,{className:a,value:d,elementId:i,invalid:!!o,...p})})};function Fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ni(e,t){return e.filter(r=>r!==t)}function ji(e,t){const r=new Set,s=o=>r.add(o);e.forEach(s),t.forEach(s);const a=[];return r.forEach(o=>a.push(o)),a}class Ti{enter(t){const r=this.entered.length,s=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=ji(this.entered.filter(s),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Ni(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class wi{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(s=>{const a=this.config.exposeProperties[s];a!=null&&(r[s]={value:a(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const Bt="__NATIVE_FILE__",Bn="__NATIVE_URL__",zn="__NATIVE_TEXT__",$n="__NATIVE_HTML__",Ur=Object.freeze(Object.defineProperty({__proto__:null,FILE:Bt,HTML:$n,TEXT:zn,URL:Bn},Symbol.toStringTag,{value:"Module"}));function er(e,t,r){const s=t.reduce((a,o)=>a||e.getData(o),"");return s??r}const ur={[Bt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[$n]:{exposeProperties:{html:(e,t)=>er(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Bn]:{exposeProperties:{urls:(e,t)=>er(e,t,"").split(`
2
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[zn]:{exposeProperties:{text:(e,t)=>er(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ei(e,t){const r=ur[e];if(!r)throw new Error(`native type ${e} has no configuration`);const s=new wi(r);return s.loadDataTransfer(t),s}function tr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(ur).filter(r=>{const s=ur[r];return s?.matchesTypes?s.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Oi=Fn(()=>/firefox/i.test(navigator.userAgent)),Hn=Fn(()=>!!window.safari);class Zr{interpolate(t){const{xs:r,ys:s,c1s:a,c2s:o,c3s:i}=this;let l=r.length-1;if(t===r[l])return s[l];let c=0,d=i.length-1,f;for(;c<=d;){f=Math.floor(.5*(c+d));const u=r[f];if(u<t)c=f+1;else if(u>t)d=f-1;else return s[f]}l=Math.max(0,d);const p=t-r[l],g=p*p;return s[l]+a[l]*p+o[l]*g+i[l]*p*g}constructor(t,r){const{length:s}=t,a=[];for(let u=0;u<s;u++)a.push(u);a.sort((u,m)=>t[u]<t[m]?-1:1);const o=[],i=[];let l,c;for(let u=0;u<s-1;u++)l=t[u+1]-t[u],c=r[u+1]-r[u],o.push(l),i.push(c/l);const d=[i[0]];for(let u=0;u<o.length-1;u++){const m=i[u],C=i[u+1];if(m*C<=0)d.push(0);else{l=o[u];const x=o[u+1],b=l+x;d.push(3*b/((b+x)/m+(b+l)/C))}}d.push(i[i.length-1]);const f=[],p=[];let g;for(let u=0;u<d.length-1;u++){g=i[u];const m=d[u],C=1/o[u],x=m+d[u+1]-g-g;f.push((g-m-x)*C),p.push(x*C*C)}this.xs=t,this.ys=r,this.c1s=d,this.c2s=f,this.c3s=p}}const Ai=1;function Vn(e){const t=e.nodeType===Ai?e:e.parentElement;if(!t)return null;const{top:r,left:s}=t.getBoundingClientRect();return{x:s,y:r}}function vt(e){return{x:e.clientX,y:e.clientY}}function _i(e){var t;return e.nodeName==="IMG"&&(Oi()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Li(e,t,r,s){let a=e?t.width:r,o=e?t.height:s;return Hn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function ki(e,t,r,s,a){const o=_i(t),l=Vn(o?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:d,offsetHeight:f}=e,{anchorX:p,anchorY:g}=s,{dragPreviewWidth:u,dragPreviewHeight:m}=Li(o,t,d,f),C=()=>{let D=new Zr([0,.5,1],[c.y,c.y/f*m,c.y+m-f]).interpolate(g);return Hn()&&o&&(D+=(window.devicePixelRatio-1)*m),D},x=()=>new Zr([0,.5,1],[c.x,c.x/d*u,c.x+u-d]).interpolate(p),{offsetX:b,offsetY:I}=a,N=b===0||b,T=I===0||I;return{x:N?b:x(),y:T?I:C()}}class Ri{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),s.forEach(function(a){Mi(e,a,r[a])})}return e}class Pi{profile(){var t,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,r,s){return this.sourcePreviewNodeOptions.set(t,s),this.sourcePreviewNodes.set(t,r),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,s){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,s);const a=i=>this.handleDragStart(i,t),o=i=>this.handleSelectStart(i);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const s=i=>this.handleDragEnter(i,t),a=i=>this.handleDragOver(i,t),o=i=>this.handleDrop(i,t);return r.addEventListener("dragenter",s),r.addEventListener("dragover",a),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",s),r.removeEventListener("dragover",a),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return Wr({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return Wr({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ur).some(r=>Ur[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Ei(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var s;return(s=this.rootElement)===null||s===void 0?void 0:s.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,s){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const o=this.sourceNodes.get(a);return o&&Vn(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const i=vt(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:i});const{dataTransfer:l}=a,c=tr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),p=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||p;if(g){const{anchorX:u,anchorY:m,offsetX:C,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),N=ki(p,g,i,{anchorX:u,anchorY:m},{offsetX:C,offsetY:x});l.setDragImage(g,N.x,N.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:l}=a,c=tr(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,o.length>0&&this.actions.hover(o,{clientOffset:vt(a)}),o.some(l=>this.monitor.canDropOnTarget(l))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=vt(a),this.scheduleHover(o),(o||[]).some(l=>this.monitor.canDropOnTarget(l))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;a.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(a.dataTransfer)}else tr(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:vt(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const o=a.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(a.preventDefault(),o.dragDrop()))},this.options=new Ri(r,s),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ti(this.isNodeInDocument)}}const Fi=function(t,r,s){return new Pi(t,r,s)},Bi=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:s,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:c,fileSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p})=>{const g=h.useRef(null),u=h.useRef(null),[m,C]=h.useState([]),[x,b]=h.useState(!1),[I,N]=h.useState(!1),T=h.useCallback(G=>{const z=G.target.files;if(z&&z.length>0){const H=Array.from(z),q=f?.(H),U=p?.(H);q?b(!0):U?N(!0):e(H)}},[f,p,e]),S=h.useCallback(G=>o&&G?.length>o,[o]),D=h.useMemo(()=>x||I||S(m),[x,I,S,m]),_=()=>{C([]),b(!1),N(!1)},E=h.useMemo(()=>x?n.jsx(v.DialErrorText,{text:l}):I?n.jsx(v.DialErrorText,{text:d}):S(m)?n.jsx(v.DialErrorText,{text:c}):null,[c,l,d,m,S,x,I]);h.useEffect(()=>{_()},[a]);const[{isOver:A,canDrop:L},w]=yr(()=>({accept:[Bt],drop(G){const z=G.files,H=f?.(z)??!1,q=p?.(z)??!1,U=S?.(z)??!1;if(b(H),N(q),H||q||U){C(z);return}e(z),_()},collect:G=>({isOver:G.isOver(),canDrop:G.canDrop()})}),[e,f,p,S]),M=G=>{(G.key==="Enter"||G.key==="Space")&&(G.preventDefault(),u.current?.click())},F=G=>{G?.preventDefault();const z=Array.from(G.dataTransfer?.items??[]);b(!!f?.(z)),N(!!p?.(z)),C(z)},K=G=>{G.target===G.currentTarget&&_()},te=ce("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!L&&!D&&"border-primary",L&&(A?"border-accent-primary":"border-hover"),D&&"border-error");return w(g),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:te,ref:g,onDragOver:F,onDragLeave:K,children:[n.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:M,className:"flex flex-col items-center cursor-pointer size-full text-secondary dial-tiny-text justify-center",children:[t&&n.jsx("p",{className:"mb-1",children:t}),r&&n.jsx("p",{className:"mb-0.5",children:r}),s&&n.jsx(v.DialPrimaryButton,{appearance:O.ButtonAppearance.Ghost,label:s,onClick:()=>u.current?.click()})]}),n.jsx("input",{multiple:i,id:"file",type:"file",ref:u,hidden:!0,accept:a,onChange:T})]}),n.jsx(n.Fragment,{children:E})]})},zi=({iconBefore:e,className:t,...r})=>{const s=r.invalid,a=()=>n.jsx("div",{className:"mr-2",children:s?n.jsx(B.IconExclamationCircle,{...$.BASE_ICON_PROPS,className:"text-error"}):e});return n.jsx(v.DialInput,{...r,iconBefore:a(),containerClassName:ce("h-[40px] p-0",s&&"h-[60px]"),className:ce("rounded-r-none border-r-0",s&&"text-error",t)})},$i=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:s,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:c})=>{const d=h.useRef(null),[f,p]=h.useState(!1),[g,u]=h.useState(!1),[m,C]=h.useState(0),x=h.useCallback(()=>{p(!1),u(!1),C(0)},[]),b=h.useCallback(A=>!!(o&&t.length+A.length>o),[o,t.length]),I=f||g,[{isOver:N,canDrop:T},S]=yr(()=>({accept:[Bt],drop(A){const L=A.files,w=[...t,...L],M=s?.(L)??!1,F=a?.(L)??!1,K=b?.(L)??!1;if(p(M),u(F),M||F||K){C(L.length);return}r(w),x()},collect:A=>({isOver:A.isOver(),canDrop:A.canDrop()})}),[t,r,s,a,b,x]),D=A=>{A.preventDefault();const L=Array.from(A.dataTransfer?.items??[]);p(!!s?.(L)),u(!1),C(L.length)},_=A=>{A.target===A.currentTarget&&x()};S(d);const E=b(Array.from({length:m}));return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{ref:d,onDragOver:D,onDragLeave:_,className:ce("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!E&&(T&&N?"border-accent-primary":"border-primary"),(I||E)&&"border-error"),children:e}),f&&n.jsx(v.DialErrorText,{text:i}),g&&n.jsx(v.DialErrorText,{text:l}),!f&&!g&&E&&n.jsx(v.DialErrorText,{text:c})]})},Kn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:s,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:c,multiFilesSizeError:d,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g}=e,u=h.useCallback((x,b)=>{x.stopPropagation(),a(t?.filter(I=>I.name!==b)||[])},[a,t]),m=h.useCallback(x=>n.jsx(Ft,{"aria-label":l,onClick:b=>u(b,x)}),[l,u]),C=h.useMemo(()=>n.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((x,b)=>n.jsx(zi,{id:x.name,value:x.name,iconAfter:m(x.name),iconBefore:r||s?.(x.name),invalid:o?.(x),error:o?.(x)?i:""},x.name+b))}),[t,r,s,o,i,m]);return n.jsx(bo,{backend:Fi,children:!t||t.length===0?n.jsx(Bi,{...e,onChange:a}):n.jsxs(n.Fragment,{children:[n.jsx($i,{existingFiles:t,onDrop:a,getIsFileFormatError:f,getIsFileSizeError:p,maxFilesCount:g,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:C}),c?.(t)&&n.jsx(v.DialErrorText,{text:d})]})})},Hi=({onChange:e,fieldTitle:t,elementId:r,files:s,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,multiple:p=!0,acceptTypes:g,deleteAllButtonLabel:u,addButtonLabel:m,additionalActionButtons:C,...x})=>{const b=h.useRef(null),I=()=>b.current?.click(),N=()=>{e([])},T=h.useCallback(E=>E?.some(A=>!(g==="/"||g?.toLowerCase()?.includes(A?.type?.toLowerCase()))),[g]),S=h.useCallback(E=>{if(!o)return!1;const A=o*(1024*1024);return E?.some(L=>{const w=L.size;return!!w&&w>A})},[o]),D=h.useCallback(E=>{if(!i||!p)return!1;const A=i*1024*1024;return E.reduce((w,M)=>w+M.size,0)>A},[i,p]),_=h.useCallback(E=>{const A=E.target.files;if(A&&A.length>0){const L=Array.from(A),w=T(L),M=S(L);!w&&!M&&e([...s||[],...L])}},[T,S,e,s]);return n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[n.jsx(Be.DialLabel,{label:`${t}: ${p?s?.length||0:""}`,htmlFor:r}),p&&!!s?.length&&n.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[n.jsx(v.DialNeutralButton,{label:u,iconBefore:n.jsx(B.IconTrashX,{...$.BASE_ICON_PROPS}),onClick:N}),(a?a>s?.length:!0)&&n.jsx(v.DialPrimaryButton,{appearance:O.ButtonAppearance.Ghost,iconBefore:n.jsx(B.IconPlus,{...$.BASE_ICON_PROPS}),label:m,onClick:I}),C]})]}),s&&s.length>0&&n.jsx("input",{id:"file",type:"file",multiple:p,ref:b,hidden:!0,accept:g,onChange:_}),n.jsx(Kn,{files:s,onChange:e,acceptTypes:g,maxFilesCount:a,multiple:p,fileFormatError:l,fileCountError:c,fileSizeError:d,multiFilesSizeError:f,getIsFileFormatError:T,getIsFileSizeError:S,getIsMultiFilesSizeError:D,...x})]})},Vi=({icon:e,ariaLabel:t,size:r=O.ElementSize.Standard,disabled:s=!1,className:a,buttonClassName:o,iconClassName:i,caretIcon:l=n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM}),showCaret:c=!0,placement:d="bottom-start",matchReferenceWidth:f=!1,open:p,onOpenChange:g,defaultOpen:u=!1,...m})=>{const C=r===O.ElementSize.Small,[x,b]=h.useState(u),I=p??x,N=C?"w-8 px-0":"w-10 px-0",T={[O.ElementSize.Small]:"size-5",[O.ElementSize.Standard]:"size-6",[O.ElementSize.Large]:"size-7"},S=D=>{b(D),g?.(D)};return n.jsx(j.DialDropdown,{...m,disabled:s,placement:d,matchReferenceWidth:f,className:a,open:I,onOpenChange:S,defaultOpen:u,children:n.jsxs("button",{type:"button","aria-label":t,disabled:s,className:y.mergeClasses("group flex items-center justify-center rounded border border-transparent bg-layer-4 text-primary","enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active","focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",C?"h-8 px-2":"h-10 px-2",c?void 0:N,o),children:[n.jsx(j.DialIcon,{icon:e,className:y.mergeClasses("flex items-center justify-center text-inherit",T[r],c&&"-mr-2",i,j.DIAL_KIT_CLASS.dropdownIcon)}),c&&n.jsxs("div",{className:y.mergeClasses("relative z-10 inline-grid size-5 shrink-0 place-items-center",j.DIAL_KIT_CLASS.dropdownIconCaret),children:[n.jsx("div",{className:"absolute inset-0 rounded-full bg-layer-2"}),n.jsx(j.DialIcon,{icon:l,className:y.mergeClasses("relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",I&&"rotate-180")})]})]})})},Ki="application/octet-stream";function Gi(e,t){if(!e||e.length===0)return[];const r=e.find(c=>c.parentPath===""&&c.nodeType==="FOLDER");if(!r)return[];const s=r.path||r.url||"",a=rr(s,!0),o=e.filter(c=>c!==r).map(c=>{const d=c.path||c.url||"",f=Ui(c.nodeType),p=f===v.DialFileNodeType.FOLDER,g=rr(d,p);let u;return c.parentPath===null||c.parentPath===void 0?u=a:c.parentPath===""?u="":u=rr(c.parentPath,!0),{...c,originalPath:d,path:g,parentPath:u,nodeType:f}}),i=new Map;o.forEach(c=>{const d={...c,id:c.originalPath,name:c.name,path:c.path,parentPath:c.parentPath,nodeType:c.nodeType,resourceType:Zi(c.resourceType),folderId:t,updatedAt:c.updatedAt?new Date(c.updatedAt).toISOString():new Date().toISOString(),items:c.nodeType===v.DialFileNodeType.FOLDER?[]:void 0};c.nodeType===v.DialFileNodeType.ITEM&&(d.extension=Wi(c.name),d.contentType=c.contentType||Ki,d.contentLength=c.contentLength||0),i.set(c.path,d)});const l=[];return i.forEach(c=>{if(c.parentPath===a)l.push(c);else{const d=c.path.lastIndexOf(c.name||""),f=c.path.slice(0,d),p=i.get(f);p&&p.nodeType===v.DialFileNodeType.FOLDER?(p.items=p.items||[],p.items.push(c)):l.push(c)}}),l}function rr(e,t){try{let r=decodeURIComponent(e);return t?r.endsWith("/")||(r+="/"):r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t&&!e.endsWith("/")?e+"/":!t&&e.endsWith("/")?e.slice(0,-1):e}}function Ui(e){return e.toUpperCase()==="FOLDER"?v.DialFileNodeType.FOLDER:v.DialFileNodeType.ITEM}function Zi(e){if(!e)return;const t=e.toUpperCase();return Object.values(v.DialFileResourceType).find(s=>s.toUpperCase()===t)}function Wi(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function qi(e,t="Prompts",r="prompts/public/",s="root"){const a=Gi(e,s);return[{id:s,name:t,path:r,parentPath:"",nodeType:v.DialFileNodeType.FOLDER,folderId:s,items:a}]}const Gn=({locale:e,timeZone:t,date:r=new Date}={})=>{const s=t??Intl.DateTimeFormat().resolvedOptions().timeZone;try{const a=new Intl.DateTimeFormat(e,{timeZone:s,timeZoneName:"longOffset"}).formatToParts(r).find(o=>o.type==="timeZoneName")?.value;return a?`(${a}) ${s}`:s}catch{return s}};var st=(e=>(e.Sections="sections",e.Flat="flat",e.FlatSections="flat-sections",e))(st||{}),ht=(e=>(e.Select="select",e.Radio="radio",e))(ht||{}),zt=(e=>(e.Row="row",e.Column="column",e))(zt||{}),V=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Object="object",e.Array="array",e.Null="null",e))(V||{});const Yi={noItemSchema:"No item schema defined.",noItemsYet:"No items yet. Add one below.",addItem:"Add Item",selectTypeToAdd:"Select type to add…",noConfigurableProperties:"No configurable properties.",noFieldsYet:"No fields yet. Add one below.",keyColumnHeader:"Key",valueColumnHeader:"Value",addField:"Add Field",keyInputPlaceholder:"Enter key",stringInputPlaceholder:"Enter a value",integerInputPlaceholder:"Enter a whole number",numberInputPlaceholder:"Enter a number",enumSelectPlaceholder:"Select an option",selectTypePlaceholder:"Select type",removeItemAriaLabel:"Remove item",removeFieldAriaLabel:"Remove field",typeColumnHeader:"Type",entryTypeString:"String",entryTypeNumber:"Number",entryTypeBoolean:"Boolean",entryTypeNull:"Null",entryTypeObject:"Object",entryTypeArray:"Array",entryTypeChangeWarning:"Changing type will reset the current value.",booleanTrueOption:"True",booleanFalseOption:"False",invalidJsonError:"Invalid JSON"},Un=h.createContext(null);function Le(){const e=h.useContext(Un);if(!e)throw new Error("useSchemaContext must be used inside DialSchemaRenderer");return e}function qr(e,t){const r={...e,...t};return(e.properties||t.properties)&&(r.properties={...e.properties,...t.properties}),(e.required||t.required)&&(r.required=Array.from(new Set([...e.required??[],...t.required??[]]))),r}function se(e,t,r=0){if(r>10)return e;let s=e;if(s.$ref){const a=s.$ref.replace(/^#\//,"").split("/");let o=t;for(const f of a)o=o?.[f];if(!o||typeof o!="object")return e;const{$ref:i,...l}=s,c=o;s={...c.$ref?se(c,t,r+1):c,...l}}if(s.allOf&&s.allOf.length>0){const{allOf:a,...o}=s;let i={};for(const l of a)i=qr(i,se(l,t,r+1));s=qr(i,o)}return s}function Zn(e){return e.map((t,r)=>({entry:t,index:r})).sort((t,r)=>{const s=t.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0,a=r.entry[1]["dial:meta"]?.["dial:propertyOrder"]??1/0;return s!==a?s-a:t.index-r.index}).map(({entry:t})=>t)}function $t(e){return e==null||e===""}function Ye(e){return e.type===V.Object||e.properties!=null&&e.oneOf==null&&e.anyOf==null&&e.type==null}function Ot(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}const Ir=e=>`"${e}" is required`;function Wn(e,t){return e.type===V.Null?"null":e.$ref?se(e,t).title??e.$ref.split("/").pop()??"Option":e.title?e.title:e.type?Array.isArray(e.type)?e.type.join(" | "):e.type:e.discriminator?Object.keys(e.discriminator.mapping).join(" | "):e.const!=null?String(e.const):e.oneOf?"One of options":"Option"}function Pe(e,t,r=0){if(r>15)return;const s=se(e,t);if("default"in s)return s.default;if(s.discriminator&&s.oneOf){const a=Object.keys(s.discriminator.mapping)[0];if(a){const o=se({$ref:s.discriminator.mapping[a]},t);return{...Pe(o,t,r+1)??{},[s.discriminator.propertyName]:a}}}if(Ye(s)){if(s.properties){const a={};let o=!1;for(const[i,l]of Object.entries(s.properties)){const c=Pe(l,t,r+1);c!==void 0&&(a[i]=c,o=!0)}return o?a:void 0}if(s.additionalProperties!=null&&s.additionalProperties!==!1)return{}}}function Me(e,t,r,s="",a=0){if(a>15)return[];const o=[],i=se(t,r);if(i.anyOf){const d=i.anyOf.filter(f=>f.type!==V.Null);return e!=null&&d.length===1?Me(e,d[0],r,s,a+1):o}if(i.oneOf&&i.discriminator){const d=i.discriminator.propertyName,f=e?.[d];if(f&&i.discriminator.mapping[f]){const p={$ref:i.discriminator.mapping[f]},g=se(p,r);return Me(e,g,r,s,a+1)}return o}if(i.type===V.Array||!i.type&&Array.isArray(e)){if(Array.isArray(e)&&i.items)for(let d=0;d<e.length;d++){const f=Me(e[d],i.items,r,`${s}[${d}]`,a+1);o.push(...f)}return o}if(!Ye(i))return o;const l=i.required??[],c=e;for(const d of l){const f=i.properties?.[d];if(f&&se(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c?.[d];if($t(g)){const u=f?.title??Ot(d);o.push({path:p,message:Ir(u)})}}if(c&&i.properties)for(const[d,f]of Object.entries(i.properties)){if(se(f,r).isHidden)continue;const p=s?`${s}.${d}`:d,g=c[d];if(g!=null){const u=Me(g,f,r,p,a+1);o.push(...u)}}if(c&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const d=i.additionalProperties;for(const[f,p]of Object.entries(c)){const g=s?`${s}.${f}`:f,u=Me(p,d,r,g,a+1);o.push(...u)}}return o}function Sr(e,t,r){const s=se(t,r);if(Array.isArray(e))return`${e.length} item${e.length!==1?"s":""}`;if(Ye(s)&&s.properties){const a=Object.entries(s.properties).filter(([,c])=>!se(c,r).isHidden),o=a.length,i=e;return`${a.filter(([c])=>{const d=i?.[c];return d!=null&&d!==""}).length}/${o} fields`}return""}function Xi(e,t,r){if(e==null){const s=t.findIndex(a=>a.type===V.Null);return s>=0?s:0}if(Array.isArray(e)){const s=t.findIndex(a=>se(a,r).type===V.Array);return s>=0?s:0}if(typeof e=="boolean"){const s=t.findIndex(a=>se(a,r).type===V.Boolean);return s>=0?s:0}if(typeof e=="number"){const s=t.findIndex(a=>{const o=se(a,r);return o.type===V.Number||o.type===V.Integer});return s>=0?s:0}if(typeof e=="string"){const s=t.findIndex(a=>se(a,r).type===V.String);return s>=0?s:0}if(typeof e=="object"){const s=e;for(let a=0;a<t.length;a++){const o=se(t[a],r);if(o.discriminator&&o.discriminator.propertyName in s)return a}for(let a=0;a<t.length;a++){const o=se(t[a],r);if(Ye(o)||o.oneOf)return a}return 0}return 0}function Qi(e,t,r){if(t&&typeof e=="object"&&e!==null){const s=e[t];if(s)return`Item ${r+1}: ${s}`}if(typeof e=="object"&&e!==null){const s=e,a=s.name??s.title??s.id;if(a)return`Item ${r+1}: ${a}`}return`Item ${r+1}`}function qn(e){switch(Array.isArray(e.type)?e.type[0]:e.type){case V.String:return"";case V.Boolean:return!1;case V.Array:return[];case V.Integer:case V.Number:return;default:return{}}}const Ji=[V.String,V.Number,V.Boolean,V.Null,V.Object,V.Array];function el(e){return Array.isArray(e)?V.Array:typeof e=="object"&&e!==null?V.Object:typeof e=="boolean"?V.Boolean:typeof e=="number"?V.Number:e===null?V.Null:V.String}const tl={[V.String]:"",[V.Number]:0,[V.Boolean]:!1,[V.Null]:null,[V.Object]:{},[V.Array]:[]};function rl(e){return tl[e]}const mt=({title:e,description:t,summary:r,errorCount:s=0,level:a=0,children:o,onRemove:i,defaultExpanded:l=!0,removeItemAriaLabel:c="Remove item"})=>{const[d,f]=h.useState(l),p=a===0,g="rounded border border-secondary",u=y.mergeClasses("flex items-center gap-2 cursor-pointer select-none transition-colors",p?"px-4 py-3 bg-layer-3 hover:bg-layer-4":"px-3 py-2 bg-layer-4 hover:bg-layer-3",d?"rounded-t":"rounded"),m=y.mergeClasses("border-t border-secondary",p?"p-4":"p-3");return n.jsxs("div",{className:g,children:[n.jsxs("div",{className:u,onClick:()=>f(C=>!C),role:"button","aria-expanded":d,children:[n.jsx("span",{className:"shrink-0 text-secondary",children:d?n.jsx(B.IconChevronDown,{size:16,stroke:2}):n.jsx(B.IconChevronRight,{size:16,stroke:2})}),n.jsx("span",{className:y.mergeClasses("flex-1 truncate",p?"dial-small-semi-text text-primary":"dial-small-text text-primary"),children:e}),t&&n.jsx(Be.DialInfoButton,{caption:t}),r&&n.jsx("span",{className:"dial-tiny-text text-secondary whitespace-nowrap ml-2",children:r}),s>0?n.jsxs("span",{className:"flex items-center gap-1 dial-tiny-text text-error whitespace-nowrap",children:[n.jsx(j.DialIcon,{icon:n.jsx(B.IconAlertTriangle,{size:13,stroke:2})}),s," error",s>1?"s":""]}):n.jsx(j.DialIcon,{icon:n.jsx(B.IconCheck,{size:13,stroke:2}),className:"text-success shrink-0"}),i&&n.jsx(Ft,{size:O.ElementSize.Small,onClick:C=>{C.stopPropagation(),i()},"aria-label":c,className:"ml-1 shrink-0 p-0.5"})]}),d&&n.jsx("div",{className:m,children:o})]})},Yn=({schema:e,value:t,onChange:r,path:s,level:a=0,required:o,label:i})=>{const{rootSchema:l,defaultExpanded:c=!0,touchedPaths:d=new Set,skipUntouched:f=!1}=Le(),p=se(e,l),g=Ye(p),u=p.type===V.Array;if(g||u){const x=Sr(t,p,l),b=Me(t,p,l,s.join(".")),I=s.join("."),N=I+".",T=!f||d.has(I)||[...d].some(S=>S.startsWith(N));return n.jsx(mt,{title:i??p.title??s[s.length-1]??"Section",description:p.description,level:a,summary:x,errorCount:T?b.length:0,defaultExpanded:c,children:n.jsx(Fe,{schema:p,value:t,onChange:r,path:s,level:a+1,required:o})})}const C=(!f||d.has(s.join(".")))&&o&&$t(t)?Ir(i??"Field"):void 0;return n.jsx(v.DialFormItem,{label:i,required:o,description:p.description,error:C,children:n.jsx(Fe,{schema:p,value:t,onChange:r,path:s,level:a,required:o,suppressInlineError:!0})})},jt=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i}=Le(),l=se(e,o),c=Zn(Object.entries(l.properties??{}).filter(([,p])=>!se(p,o).isHidden)),d=l.required??[],f=t??{};return c.length===0?n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noConfigurableProperties}):n.jsx("div",{className:"flex flex-col gap-4",children:c.map(([p,g])=>{const m=se(g,o).title??g.title??Ot(p),C=d.includes(p);return n.jsx(Yn,{schema:g,value:f[p],onChange:x=>r({...f,[p]:x}),path:[...s,p],level:a,required:C,label:m},p)})})},nl=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:c=!0}=Le(),d=Array.isArray(t)?t:[],f=e.items,[p,g]=h.useState(void 0);if(!f)return n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemSchema});const u=h.useMemo(()=>se(f,o),[f,o]),m=h.useMemo(()=>u.discriminator,[u]),C=h.useMemo(()=>m?.propertyName,[m]),x=h.useMemo(()=>m?Object.keys(m.mapping).map(T=>({value:T,label:T})):[],[m]),b=()=>{const T=p??x[0]?.value;let S;if(m&&T){const D=se({$ref:m.mapping[T]},o);S={...Pe(D,o)??{},[m.propertyName]:T}}else S=Pe(u,o)??qn(u);r([...d,S])},I=T=>{r(d.filter((S,D)=>D!==T))},N=(T,S)=>{r(d.map((D,_)=>_===T?S:D))};return n.jsxs("div",{className:"flex flex-col gap-3",children:[d.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noItemsYet}),d.map((T,S)=>{const D=Qi(T,C,S),_=Sr(T,u,o),E=Me(T,u,o,`${s.join(".")}[${S}]`);return n.jsx(mt,{title:D,level:a,summary:_,errorCount:E.length,onRemove:l?void 0:()=>I(S),defaultExpanded:c,removeItemAriaLabel:i.removeItemAriaLabel,children:n.jsx(Fe,{schema:f,value:T,onChange:A=>N(S,A),path:[...s,String(S)],level:a+1})},S)}),!l&&n.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[x.length>0&&n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(_e,{options:x,value:p??x[0]?.value,placeholder:i.selectTypeToAdd,onChange:T=>{const S=typeof T=="string"?T:T[0];g(S)}})}),n.jsx(v.DialGhostButton,{label:i.addItem,iconBefore:n.jsx(B.IconPlus,{size:16,stroke:2}),onClick:b})]})]})},sl=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Le(),c=h.useId(),d=e.discriminator;if(d){const x=d.propertyName,b=d.mapping,I=Object.keys(b).map(D=>({value:D,label:D})),N=typeof t=="object"&&t!==null?t[x]:void 0,T=N?se({$ref:b[N]},o):void 0,S=D=>{const _=se({$ref:b[D]},o),E=Pe(_,o)??{};r({...E,[x]:D})};if(e.discriminatorDisplay===ht.Radio){const D=e.discriminatorOrientation===zt.Row,_=N?(()=>{const E=se({$ref:b[N]},o),{[x]:A,...L}=E.properties??{};return{...E,properties:L}})():void 0;return D?n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{role:"radiogroup",className:"flex flex-row flex-wrap gap-4",children:Object.keys(b).map(E=>{const A=se({$ref:b[E]},o);return n.jsx(j.DialRadioButton,{name:c,value:E,inputId:`${c}-${E}`,label:A.title??E,checked:N===E,disabled:l,onChange:()=>S(E)},E)})}),_&&n.jsx(jt,{schema:_,value:t,onChange:r,path:s,level:a})]}):n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:Object.keys(b).map(E=>{const A=se({$ref:b[E]},o),L=N===E,{[x]:w,...M}=A.properties??{},F={...A,properties:M};return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:E,inputId:`${c}-${E}`,label:A.title??E,checked:L,disabled:l,onChange:()=>S(E)}),L&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(jt,{schema:F,value:t,onChange:r,path:s,level:a})})]},E)})})}return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(_e,{options:I,value:N,placeholder:i.selectTypePlaceholder,disabled:l,onChange:D=>{const _=typeof D=="string"?D:D[0];_&&S(_)}})}),T&&n.jsx("div",{className:"pl-3",children:n.jsx(jt,{schema:T,value:t,onChange:r,path:s,level:a})})]})}const f=e.oneOf??[],g=(()=>{if(t==null)return 0;if(typeof t=="object"&&!Array.isArray(t)){for(let x=0;x<f.length;x++)if(se(f[x],o).required?.every(I=>I in t))return x}return 0})(),u=x=>{const b=se(f[x],o),I=Pe(b,o);r(I??null)},m=f[g];if(e.discriminatorDisplay===ht.Radio)return n.jsx("div",{role:"radiogroup",className:"flex flex-col gap-2",children:f.map((x,b)=>{const I=se(x,o),N=Wn(x,o)??`Option ${b+1}`,T=g===b;return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(j.DialRadioButton,{name:c,value:String(b),inputId:`${c}-${b}`,label:N,checked:T,disabled:l,onChange:()=>u(b)}),T&&I&&n.jsx("div",{className:"ml-6 mt-2",children:n.jsx(Fe,{schema:I,value:t,onChange:r,path:s,level:a})})]},b)})});const C=f.map((x,b)=>{const I=se(x,o);return{value:String(b),label:I.title??`Option ${b+1}`}});return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(_e,{options:C,value:String(g),disabled:l,onChange:x=>{const b=typeof x=="string"?x:x[0];u(Number(b))}})}),m&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Fe,{schema:m,value:t,onChange:r,path:s,level:a})})]})},al=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,readonly:i=!1}=Le(),l=e.anyOf??[],c=l.map((m,C)=>({value:String(C),label:Wn(m,o)})),d=Xi(t,l,o),f=l[d],g=se(f,o).type===V.Null,u=m=>{const C=se(l[m],o);if(C.type===V.Null){r(null);return}const x=Pe(C,o);if(x!==void 0){r(x);return}switch(C.type){case V.Array:r([]);break;case V.String:r("");break;case V.Boolean:r(!1);break;case V.Integer:case V.Number:r(0);break;default:r({});break}};return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("div",{className:"flex-1 max-w-[280px]",children:n.jsx(_e,{options:c,value:String(d),disabled:i,onChange:m=>{const C=typeof m=="string"?m:m[0];u(Number(C))}})}),!g&&f&&n.jsx("div",{className:"pl-3 border-l-2 border-secondary",children:n.jsx(Fe,{schema:f,value:t,onChange:r,path:s,level:a})})]})},Xn=({schema:e,value:t,onChange:r,invalid:s})=>{const a=h.useId(),{texts:o,readonly:i=!1,inputClassName:l,acceptableResourceTypes:c}=Le(),d=e.const!==void 0,f=Array.isArray(e.enum)&&e.enum.length>0;if(e["dial:resource"]===!0&&Array.isArray(e.acceptableResourceTypes)&&e.acceptableResourceTypes.length>0&&(e.type===V.String||e.type===void 0)){const g=(e.acceptableResourceTypes??[]).flatMap(u=>{const m=c?.[u];return Array.isArray(m)?m.map(C=>{const x=String(C);return{value:x,label:x}}):[]});return n.jsx(_e,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder,className:l})}if(d)return n.jsx(v.DialInput,{value:String(e.const??""),disabled:!0,onChange:void 0,className:"opacity-60"});if(f&&e.enumDisplay===ht.Radio){const g=e.enumOrientation===zt.Row;return n.jsx("div",{role:"radiogroup",className:g?"flex flex-row flex-wrap gap-x-4 gap-y-2":"flex flex-col gap-2",children:e.enum.map(u=>{const m=String(u);return n.jsx(j.DialRadioButton,{name:a,value:m,inputId:`${a}-${m}`,label:m,checked:t!=null?String(t)===m:!1,disabled:i,onChange:C=>r(C)},m)})})}if(f){const g=e.enum.map(u=>({value:String(u),label:String(u)}));return n.jsx(_e,{options:g,value:t!=null?String(t):void 0,invalid:s,disabled:i,onChange:u=>r(typeof u=="string"?u:u[0]),placeholder:o.enumSelectPlaceholder})}switch(e.type){case V.Boolean:return n.jsx(Be.DialSwitch,{switchId:a,isOn:!!t,disabled:i,onChange:g=>r(g)});case V.Integer:return n.jsx(cr,{integer:!0,value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:o.integerInputPlaceholder,containerClassName:l});case V.Number:return n.jsx(cr,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g!==void 0?Number(g):void 0),placeholder:o.numberInputPlaceholder,containerClassName:l});default:return e.isProtected?n.jsx(Mn,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l}):n.jsx(v.DialInput,{value:t!=null?String(t):"",invalid:s,disabled:i,onChange:g=>r(g??void 0),placeholder:o.stringInputPlaceholder,containerClassName:l})}},Dr=({value:e,onChange:t,theme:r=bt.EditorThemes.dark,height:s=240})=>{const{readonly:a,texts:o}=Le(),[i,l]=h.useState(null),[c,d]=h.useState(()=>JSON.stringify(e,null,2));h.useEffect(()=>{typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-CpSpVa0v.cjs")).then(g=>{l(()=>g.DialJsonEditor)})},[]);let f=!1;try{JSON.parse(c)}catch{f=!0}const p=g=>{const u=g??"";d(u);try{t(JSON.parse(u))}catch{}};return n.jsxs("div",{children:[n.jsx("div",{className:"border border-primary rounded",style:{height:`${s}px`},children:i&&n.jsx(i,{value:c,currentTheme:r,onChange:p,options:{readOnly:a}})}),n.jsx(v.DialErrorText,{text:f?o.invalidJsonError:void 0})]})},Yr=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),Qn=e=>!!(e.oneOf||e.anyOf||e.type===V.Array||Ye(e)),ol={[V.String]:"entryTypeString",[V.Number]:"entryTypeNumber",[V.Boolean]:"entryTypeBoolean",[V.Null]:"entryTypeNull",[V.Object]:"entryTypeObject",[V.Array]:"entryTypeArray"},il=({pairId:e,pairKey:t,pairValue:r,valueSchema:s,isUnschematizedValue:a,jsonEditorTheme:o,onKeyChange:i,onValueChange:l,onRemove:c,keyInputPlaceholder:d,removeFieldAriaLabel:f,path:p,level:g,readonly:u=!1,inputClassName:m})=>{const{rootSchema:C,texts:x,defaultExpanded:b=!0,touchedPaths:I=new Set,markTouched:N=()=>{},skipUntouched:T=!1}=Le(),[S,D]=h.useState(t),_=Qn(s),[E,A]=h.useState(()=>el(r)),L=a&&(E===V.Object||E===V.Array),w=a&&E===V.Null,M=_||L,F=[...p,e,"key"].join("."),te=(!T||I.has(F))&&t==="",G=h.useCallback(oe=>{l(rl(oe)),A(oe)},[l]),z=h.useMemo(()=>Ji.map(oe=>({value:oe,label:x[ol[oe]]})),[x]),H=h.useMemo(()=>[{value:"true",label:x.booleanTrueOption},{value:"false",label:x.booleanFalseOption}],[x]),q=`${e}-key-error`,U=a&&E===V.Boolean,ae=n.jsxs("div",{className:"flex gap-2 items-start",children:[n.jsxs("div",{className:M?"flex-1 min-w-0":"w-2/5 min-w-0",children:[n.jsx(v.DialInput,{value:S,disabled:u,invalid:te,"aria-describedby":te?q:void 0,onChange:oe=>D(oe??""),onBlur:()=>{N(F),S!==t&&i(S)},placeholder:d,containerClassName:m}),n.jsx(v.DialErrorText,{id:q,text:te?`${x.keyColumnHeader} is required`:void 0})]}),!_&&!L&&n.jsx("div",{className:"flex-1 min-w-0",children:w?n.jsx(v.DialInput,{value:"null",disabled:!0,onChange:void 0,className:"opacity-60"}):U?n.jsx(_e,{options:H,value:r?"true":"false",disabled:u,onChange:oe=>{const le=typeof oe=="string"?oe:oe[0];le&&l(le==="true")}}):n.jsx(Xn,{schema:a?{type:E}:s,value:r,onChange:l})}),a&&n.jsx("div",{className:"w-28 shrink-0",children:n.jsx(O.DialTooltip,{tooltip:x.entryTypeChangeWarning,triggerClassName:"block",children:n.jsx(_e,{options:z,value:E,disabled:u,onChange:oe=>{const le=typeof oe=="string"?oe:oe[0];le&&G(le)}})})}),!u&&n.jsx(Ft,{size:O.ElementSize.Small,onClick:c,"aria-label":f,className:"shrink-0 p-1"})]});if(!M)return ae;if(L)return n.jsxs("div",{className:"flex flex-col gap-2",children:[ae,n.jsx(Dr,{value:r,onChange:l,theme:o},E)]});const Y=[...p,t],Z=Sr(r,s,C),re=Me(r,s,C,Y.join("."));return n.jsxs("div",{className:"flex flex-col gap-2",children:[ae,n.jsx(mt,{title:t,level:g,summary:Z,errorCount:re.length+(te?1:0),defaultExpanded:b,children:n.jsx(Fe,{schema:s,value:r,onChange:l,path:Y,level:g+1})})]})},ll=({schema:e,value:t,onChange:r,path:s,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,inputClassName:c,jsonEditorTheme:d}=Le(),f=e.additionalProperties===!0||e.additionalProperties==null,p=f?{type:"string"}:typeof e.additionalProperties=="object"?se(e.additionalProperties,o):{type:"string"},g=Qn(p),[u,m]=h.useState(()=>Object.entries(t??{}).map(([S,D])=>Yr(S,D))),C=S=>Object.fromEntries(S.filter(D=>D.key!=="").map(D=>[D.key,D.value])),x=(S,D)=>{const _=u.map((E,A)=>A===S?{...E,key:D}:E);m(_),r(C(_))},b=(S,D)=>{const _=u.map((E,A)=>A===S?{...E,value:D}:E);m(_),r(C(_))},I=()=>g?Pe(p,o)??qn(p):"",N=()=>{m(S=>[...S,Yr("",I())])},T=S=>{const D=u.filter((_,E)=>E!==S);m(D),r(C(D))};return n.jsxs("div",{className:"flex flex-col gap-2",children:[u.length===0&&n.jsx("p",{className:"dial-tiny-text text-secondary italic",children:i.noFieldsYet}),u.length>0&&!g&&n.jsxs("div",{className:"flex gap-2 mb-1 pr-7",children:[n.jsx("span",{className:"w-2/5 dial-tiny-text text-secondary font-medium",children:i.keyColumnHeader}),n.jsx("span",{className:"flex-1 dial-tiny-text text-secondary font-medium",children:i.valueColumnHeader}),f&&n.jsx("span",{className:"w-28 shrink-0 dial-tiny-text text-secondary font-medium",children:i.typeColumnHeader})]}),u.map((S,D)=>n.jsx(il,{pairId:S.id,pairKey:S.key,pairValue:S.value,valueSchema:p,isUnschematizedValue:f,jsonEditorTheme:d,onKeyChange:_=>x(D,_),onValueChange:_=>b(D,_),onRemove:()=>T(D),keyInputPlaceholder:i.keyInputPlaceholder,removeFieldAriaLabel:i.removeFieldAriaLabel,path:s,level:a,readonly:l,inputClassName:c},S.id)),!l&&n.jsx("div",{className:"pt-1",children:n.jsx(v.DialGhostButton,{label:i.addField,iconBefore:n.jsx(B.IconPlus,{size:16,stroke:2}),onClick:N})})]})},Fe=({schema:e,value:t,onChange:r,path:s,level:a,required:o,suppressInlineError:i=!1})=>{const{rootSchema:l,renderField:c,markTouched:d=()=>{},touchedPaths:f=new Set,skipUntouched:p=!1,jsonEditorTheme:g}=Le(),u=se(e,l),m=b=>{d(s.join(".")),r(b)},C=!p||f.has(s.join("."));let x;if(u.oneOf)x=n.jsx(sl,{schema:u,value:t,onChange:m,path:s,level:a});else if(u.anyOf&&u.type!==V.Object)x=n.jsx(al,{schema:u,value:t,onChange:m,path:s,level:a});else if(Ye(u)){const b=u.additionalProperties!=null&&u.additionalProperties!==!1,I=!u.properties||Object.keys(u.properties).length===0;b&&I?x=n.jsx(ll,{schema:u,value:t,onChange:m,path:s,level:a}):I&&u.additionalProperties!==!1?x=n.jsx(Dr,{value:t,onChange:m,theme:g}):x=n.jsx(jt,{schema:u,value:t,onChange:m,path:s,level:a})}else if(u.type===V.Array)x=n.jsx(nl,{schema:u,value:t,onChange:m,path:s,level:a});else{const b=C&&o&&$t(t),I=!i&&b?Ir(u.title??"Field"):void 0;x=n.jsxs(n.Fragment,{children:[n.jsx(Xn,{schema:u,value:t,onChange:m,invalid:b}),n.jsx(v.DialErrorText,{text:I})]})}return c?c(s,u,x):x},cl=({schema:e,defaultValue:t,texts:r,className:s,readonly:a=!1,defaultExpanded:o=!0,inputClassName:i,variant:l=st.Sections,onChange:c,onPropertyChange:d,onDefaultValues:f,renderField:p,skipUntouched:g=!1,jsonEditorTheme:u,acceptableResourceTypes:m})=>{const C=h.useMemo(()=>({...Yi,...r}),[r]),x=h.useMemo(()=>t||(Pe(e,e)??{}),[]),[b,I]=h.useState(x),[N,T]=h.useState(new Set),S=h.useCallback(w=>{T(M=>M.has(w)?M:new Set([...M,w]))},[]);h.useEffect(()=>{f?.(x)},[]);const D=(w,M)=>{const F={...b,[w]:M};I(F),c?.(F),d?.(w,M)},_=new Set(Object.keys(e.properties??{})),E=Object.keys(b).filter(w=>!_.has(w)),A=Zn(Object.entries(e.properties??{}).filter(([,w])=>!se(w,e).isHidden)),L=e.required??[];return n.jsx(Un.Provider,{value:{rootSchema:e,texts:C,readonly:a,defaultExpanded:o,inputClassName:i,jsonEditorTheme:u,acceptableResourceTypes:m,renderField:p,touchedPaths:N,markTouched:S,skipUntouched:g},children:n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-4",s),children:[A.map(([w,M])=>{const F=se(M,e),K=F.title??M.title??Ot(w),te=L.includes(w),G=b[w];if(l===st.Flat)return n.jsx(Yn,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:0,required:te,label:K},w);if(l===st.FlatSections)return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:K}),n.jsx(Fe,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:0,required:te})]},w);const z=Me(G,F,e,w),H=w+".",q=!g||N.has(w)||[...N].some(U=>U.startsWith(H));return n.jsx(mt,{title:K,description:F.description,level:0,defaultExpanded:o,errorCount:q?te&&$t(G)?Math.max(z.length,1):z.length:0,children:n.jsx(Fe,{schema:M,value:G,onChange:U=>D(w,U),path:[w],level:1,required:te})},w)}),E.map(w=>{const M=Ot(w),F=n.jsx(Dr,{value:b[w],onChange:K=>D(w,K),theme:u});return l===st.Sections?n.jsx(mt,{title:M,level:0,defaultExpanded:o,children:F},w):n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("h2",{className:"dial-small-semi-text text-primary",children:M}),F]},w)})]})})},dl=e=>({info:n.jsx(B.IconInfoCircleFilled,{size:e.size}),error:n.jsx(B.IconAlertCircleFilled,{size:e.size}),warning:n.jsx(B.IconAlertTriangleFilled,{size:e.size}),success:n.jsx(B.IconCircleCheckFilled,{size:e.size}),loading:n.jsx(v.Spinner,{size:e.size}),general:n.jsx(B.IconCheck,{size:e.size,stroke:e.stroke})}),ul={[v.NotificationVariant.Info]:"bg-info text-info",[v.NotificationVariant.Success]:"bg-success text-success",[v.NotificationVariant.Warning]:"bg-warning text-warning",[v.NotificationVariant.Error]:"bg-error text-error",[v.NotificationVariant.Loading]:"bg-layer-raised text-info",[v.NotificationVariant.General]:"bg-layer-sunken text-primary"},fl={[v.NotificationVariant.Info]:"status",[v.NotificationVariant.Success]:"status",[v.NotificationVariant.Warning]:"alert",[v.NotificationVariant.Error]:"alert",[v.NotificationVariant.Loading]:"status",[v.NotificationVariant.General]:"status"},pl="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",Nr=({variant:e=v.NotificationVariant.Info,type:t=v.NotificationType.Toast,title:r,message:s,action:a,className:o,iconSize:i=24,iconStroke:l=2,closable:c=!1,onClose:d,children:f,textClassName:p,...g})=>{const u=h.useMemo(()=>dl({size:i,stroke:l})[e],[e,i,l]),m=p??(t===v.NotificationType.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return n.jsxs("div",{role:fl[e],...g,className:y.mergeClasses(pl,ul[e],t===v.NotificationType.Toast&&"min-w-[200px] max-w-[600px] shadow-lg",t===v.NotificationType.SectionMessage&&e===v.NotificationVariant.Loading&&"border-secondary",o,j.DIAL_KIT_CLASS.notification),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:n.jsx(j.DialIcon,{icon:u})}),r?n.jsxs("div",{className:y.mergeClasses("flex min-w-0 text-primary break-words",m),children:[n.jsx("div",{className:"dial-small-paragraph-semi-text min-w-0 break-words",children:r}),n.jsx("div",{className:"dial-small-paragraph-text min-w-0 break-words",children:s})]}):n.jsx("div",{className:"dial-small-paragraph-text min-w-0 text-primary break-words",children:s})]}),a!=null&&n.jsx("div",{className:"flex shrink-0 items-center",children:a}),f,c&&n.jsx(k.CloseButton,{className:"shrink-0 self-start",ariaLabel:"Close notification",onClose:C=>d?.(C)})]})},Xr={2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"},gl=e=>e===1?"!truncate !whitespace-nowrap":`${Xr[e]??Xr[2]} !whitespace-normal`,Jn=({text:e,query:t,markClassName:r,className:s,maxLines:a=2})=>{const o=y.mergeClasses(gl(a),s,j.DIAL_KIT_CLASS.highlight);if(!t.trim())return n.jsx(k.EllipsisTooltip,{className:o,text:e});const i=e.toLowerCase().indexOf(t.toLowerCase()),l=i===-1?e:n.jsxs(n.Fragment,{children:[e.slice(0,i),n.jsx("mark",{className:y.mergeClasses("text-accent bg-control-accent-alpha-hover",r),children:e.slice(i,i+t.length)}),e.slice(i+t.length)]});return n.jsx(k.EllipsisTooltip,{className:o,text:l})},hl=({className:e,children:t,...r})=>n.jsx("article",{...r,className:y.mergeClasses("relative flex flex-col gap-3 rounded-[20px] border-2 border-transparent p-5","bg-layer-raised shadow-md transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-[3px] hover:shadow-lg motion-reduce:transition-none motion-reduce:hover:translate-y-0",e,j.DIAL_KIT_CLASS.cardShell),children:t}),it=(e,t)=>({type:s,...a})=>n.jsx(Nr,{...a,variant:e,type:s||t}),lt=(e,t)=>({variant:s,...a})=>n.jsx(Nr,{...a,variant:s||t,type:e}),ml=it(v.NotificationVariant.Error,v.NotificationType.Toast),xl=it(v.NotificationVariant.Info,v.NotificationType.Toast),bl=it(v.NotificationVariant.Success,v.NotificationType.Toast),Cl=it(v.NotificationVariant.Warning,v.NotificationType.Toast),vl=it(v.NotificationVariant.Loading,v.NotificationType.Toast),yl=it(v.NotificationVariant.General,v.NotificationType.Toast),Il=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Error),Sl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Info),Dl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Success),Nl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Warning),jl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.Loading),Tl=lt(v.NotificationType.SectionMessage,v.NotificationVariant.General);var Se=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(Se||{});const wl="en-GB",El={[Se.Date]:"Select date",[Se.DateTime]:"Select date and time",[Se.Time]:"--:--",[Se.Weekday]:"Select day"},es="flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus",ts="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",rs="!border-error",Ol="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",Al="flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus",_l="bg-control-accent text-control-permanent",Ll="text-accent dial-small-semi-text",kl="text-control-disable-primary",ns="text-secondary",Rl=n.jsx(B.IconCalendar,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ns}),Qr={prev:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),next:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})},Ml=(e,t)=>{const s=(new Date(e,t,1).getDay()+6)%7,a=new Date(e,t,1-s);return Array.from({length:42},(o,i)=>{const l=new Date(a);return l.setDate(a.getDate()+i),l})},Jr=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),en=(e,t,r)=>{const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate());if(s<a)return!0}if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>a)return!0}return!1},Pl=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),tn=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Fl=(e,t)=>e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),yt=e=>`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,rn=(e,t)=>{const[r,s]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,s||0,0,0),a},Bl=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),zl=e=>{const t=e.replace(/\D/g,"").slice(0,4);let r=t.slice(0,2);const s=t.slice(2,4);if(r.length===2&&(r=String(Math.min(Number(r),23)).padStart(2,"0")),s.length===0)return r;const a=String(Math.min(Number(s),59)).padStart(s.length,"0");return`${r}:${a}`},ss=5,as=e=>e.charAt(0).toUpperCase()+e.slice(1),$l=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,ss+r));return as(s.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Hl=e=>Array.from({length:7},(t,r)=>{const s=new Date(Date.UTC(1970,0,ss+r));return{value:String(r+1),label:as(s.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),nn=({id:e,disabled:t,invalid:r,trigger:s,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,panelLabel:c})=>{const d=j.useThemeScope(),[f,p]=h.useState(!1),{refs:g,floatingStyles:u,context:m}=ee.useFloating({open:f,onOpenChange:T=>p(t?!1:T),placement:"bottom-start",whileElementsMounted:ee.autoUpdate,middleware:[ee.offset(8),ee.flip({padding:8}),ee.shift({padding:8})]}),C=ee.useClick(m,{enabled:!t}),x=ee.useDismiss(m),b=ee.useRole(m,{role:"dialog"}),{getReferenceProps:I,getFloatingProps:N}=ee.useInteractions([C,x,b]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:e,ref:g.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-disabled":t,"aria-labelledby":l,tabIndex:t?-1:0,className:y.mergeClasses(es,"focus-visible:outline focus-visible:outline-focus",r&&rs,t&&ts,o),...I(),children:s}),f&&n.jsx(ee.FloatingPortal,{children:n.jsx(ee.FloatingFocusManager,{context:m,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:g.setFloating,style:u,"aria-label":c,className:y.mergeClasses(Ol,d,a),...N(),children:i(()=>p(!1))})})})]})},sn=({id:e,value:t,onChange:r,onBlur:s,disabled:a,invalid:o,className:i,ariaLabel:l,placeholder:c="--:--",timezoneLabel:d})=>{const[f,p]=h.useState(t);h.useEffect(()=>{p(t)},[t]);const g=n.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,placeholder:c,disabled:a,value:f,onChange:u=>{const m=zl(u.target.value);p(m),Bl(m)&&r(m)},onBlur:s,className:y.mergeClasses(es,o&&rs,a&&ts,i)});return d?n.jsxs("div",{className:"relative w-full",children:[g,n.jsx("span",{className:"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",children:d})]}):g},Vl=({mode:e=Se.Date,value:t,onChange:r,onBlur:s,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,id:c,className:d,minDate:f,maxDate:p,locale:g=wl,fieldClassName:u,showTimezone:m=!1})=>{const C=o??El[e],x=t instanceof Date?t:null,b=h.useId(),I=c??b,N=a?.id??`${I}-label`,T=!!a?.label,S=typeof a?.label=="string"?a.label:void 0,D=T?`${N} ${I}`:void 0,_=a?n.jsx(k.Label,{...a,id:N,htmlFor:I}):null,[E,A]=h.useState(()=>x??new Date),L=h.useMemo(()=>new Date,[]),w=h.useMemo(()=>m?Gn({locale:g}):null,[m,g]),M=h.useMemo(()=>$l(g),[g]),F=h.useMemo(()=>Hl(g),[g]),K=h.useMemo(()=>Ml(E.getFullYear(),E.getMonth()),[E]),te=q=>{A(U=>new Date(U.getFullYear(),U.getMonth()+q,1))},G=(q,U)=>{if(en(q,f,p))return;const ae=e===Se.DateTime&&x?rn(q,yt(x)):q;r?.(ae),e===Se.Date&&U()},z=q=>{r?.(rn(x??new Date,q))},H=()=>x?e===Se.DateTime?`${tn(x,g)}, ${yt(x)}`:tn(x,g):C;if(e===Se.Time){const q=typeof t=="string"?t:x?yt(x):"";return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(sn,{id:I,value:q,onChange:U=>r?.(U),onBlur:s,disabled:i,invalid:l,placeholder:C,className:u,timezoneLabel:w})]})}if(e===Se.Weekday){const q=typeof t=="string"?t:void 0,U=F.find(ae=>ae.value===q);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(nn,{id:I,disabled:i,invalid:l,labelledBy:D,panelLabel:S??C,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:y.mergeClasses("truncate",!U&&"text-secondary"),children:U?.label??C}),n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:ns})]}),panel:ae=>n.jsx("div",{role:"listbox","aria-label":S??C,className:"flex flex-col gap-0.5",children:F.map(Y=>n.jsx("button",{type:"button",role:"option","aria-selected":Y.value===q,className:y.mergeClasses("flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus",Y.value===q&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(Y.value),ae()},children:Y.label},Y.value))})})]})}return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-y-3",d,j.DIAL_KIT_CLASS.calendar),children:[_,n.jsx(nn,{id:I,disabled:i,invalid:l,labelledBy:D,panelLabel:S??C,fieldClassName:u,trigger:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:y.mergeClasses("truncate",!x&&"text-secondary"),children:H()}),Rl]}),panel:q=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(k.StaticIconButton,{"aria-label":"Previous month",icon:Qr.prev,size:O.ElementSize.Small,onClick:()=>te(-1)}),n.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Pl(E,g)}),n.jsx(k.StaticIconButton,{"aria-label":"Next month",icon:Qr.next,size:O.ElementSize.Small,onClick:()=>te(1)})]}),n.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(U=>n.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:U},U)),K.map(U=>{const ae=U.getMonth()!==E.getMonth(),Y=Jr(U,x),Z=Jr(U,L),re=en(U,f,p);return n.jsx("button",{type:"button",disabled:re,"aria-label":Fl(U,g),"aria-pressed":Y,"aria-current":Z?"date":void 0,className:y.mergeClasses(Al,ae&&kl,Z&&!Y&&Ll,Y&&_l,re&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>G(U,q),children:U.getDate()},U.toISOString())})]}),e===Se.DateTime&&n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-secondary pt-3",children:[n.jsx("span",{className:"dial-small-text text-primary",children:"Time"}),n.jsx(sn,{ariaLabel:"Time",value:x?yt(x):"",onChange:z,onBlur:s,className:"w-[120px] px-3 py-1.5"})]})]})})]})},Kl=({segments:e,labelClassName:t="dial-small-text",leafClassName:r="dial-small-semi-text",className:s,ariaLabel:a="Folder path"})=>{const o=n.jsx(j.DialIcon,{icon:n.jsx(B.IconFolder,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),className:"text-secondary"}),i=e.map((l,c)=>({label:c===e.length-1?n.jsx("span",{className:r,children:l}):l,disabled:!0,...c===0?{iconBefore:o}:{}}));return n.jsx(v.DialBreadcrumb,{className:y.mergeClasses(s,j.DIAL_KIT_CLASS.folderPath),ariaLabel:a,separator:n.jsx(j.DialIcon,{icon:n.jsx(B.IconChevronRight,{size:14,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),className:"text-secondary"}),pathItems:i,labelClassName:y.mergeClasses(t,"text-secondary","!cursor-default")})};var We=(e=>(e.Small="small",e.Heading="heading",e))(We||{});const Gl="w-full overflow-hidden",Ul="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",an="flex min-w-0 items-center gap-2",on={[We.Small]:"dial-small-text",[We.Heading]:"dial-h2-text"},Zl={[We.Small]:"dial-small-semi-text",[We.Heading]:"dial-h2-text"},Wl={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},ql="flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors",Yl="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Xl="cursor-default text-primary",Ql="cursor-default text-secondary",ln="inline-flex flex-none items-center leading-none text-secondary",Jl="dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",ec=3,tc=4,rc=n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),nc=({items:e,maxVisibleItems:t=tc,size:r=We.Small,separator:s=rc,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const c=Math.max(t,ec),d=h.useMemo(()=>e.length>c?e.slice(1,-(c-2)):[],[e,c]),f=h.useMemo(()=>d.map((m,C)=>({key:String(C),label:m.label,icon:m.icon})),[d]),p=h.useCallback(({key:m,domEvent:C})=>{const x=d[Number(m)];x&&(x.onClick?.(C),!x.onClick&&x.href&&!C.defaultPrevented&&(window.location.href=x.href))},[d]);if(e.length===0)return null;const g=e.slice(d.length+1),u=(m,{index:C,isFirst:x,isCurrent:b})=>{const I=!b&&(!!m.href||!!m.onClick),N=y.mergeClasses(ql,I?Yl:b?y.mergeClasses(Xl,Zl[r]):Ql,l,j.DIAL_KIT_CLASS.breadcrumbsItem),T=n.jsxs(n.Fragment,{children:[m.icon,n.jsx(k.EllipsisTooltip,{text:m.label})]});return n.jsxs("li",{className:y.mergeClasses(an,on[r],Wl[b?"last":x?"first":"middle"]),children:[I?m.href?n.jsx("a",{href:m.href,onClick:m.onClick,className:N,children:T}):n.jsx("button",{type:"button",onClick:m.onClick,className:N,children:T}):n.jsx("span",{className:N,"aria-current":b?"page":void 0,children:T}),!b&&n.jsx("span",{className:ln,"aria-hidden":"true",children:s})]},`segment-${C}`)};return n.jsx("nav",{"aria-label":a,className:y.mergeClasses(Gl,i,j.DIAL_KIT_CLASS.breadcrumbs),children:n.jsxs("ol",{className:Ul,children:[u(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),d.length>0&&n.jsxs("li",{className:y.mergeClasses(an,on[r],"shrink-0"),children:[n.jsx(k.Dropdown,{items:f,onItemClick:p,placement:"bottom-start",matchReferenceWidth:!1,children:n.jsx("button",{type:"button","aria-label":o,className:Jl,children:n.jsx(B.IconDots,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),n.jsx("span",{className:ln,"aria-hidden":"true",children:s})]}),g.map((m,C)=>u(m,{index:e.length-g.length+C,isFirst:!1,isCurrent:C===g.length-1}))]})})},Xe=({label:e,variant:t,appearance:r=O.ButtonAppearance.Solid,size:s=O.ElementSize.Standard,className:a,textClassName:o,iconAfter:i,iconBefore:l,type:c="button",tooltipProps:d,href:f,target:p,rel:g,disabled:u,...m})=>{const C=y.mergeClasses("dial-kit-base-button",t&&k.getButtonClassNames(t,r),s===O.ElementSize.Small?"dial-tiny-semi-text":"dial-small-paragraph-semi-text",s===O.ElementSize.Small?"h-[24px] gap-1":"h-[40px] gap-2",s===O.ElementSize.Small&&"dial-kit-base-button-small",r!==O.ButtonAppearance.Link&&(s===O.ElementSize.Small?"px-2":"px-4"),s!==O.ElementSize.Small&&r!==O.ButtonAppearance.Link&&"dial-kit-enhanced-target",a),x=e?void 0:d?.tooltip,b=O.resolveAccessibleName(typeof e=="string"?e:void 0,m["aria-label"],x),I=n.jsxs(n.Fragment,{children:[n.jsx(j.DialIcon,{icon:l}),e&&n.jsx("span",{className:o,children:e}),n.jsx(j.DialIcon,{icon:i})]}),N=m,T=f!==void 0?n.jsx("a",{...N,href:u?void 0:f,target:p,rel:g??(p==="_blank"?"noopener noreferrer":void 0),"aria-disabled":u||void 0,tabIndex:u?-1:N.tabIndex,onClick:u?void 0:N.onClick,className:C,"aria-label":b,children:I}):n.jsx("button",{...m,...k.getDisabledButtonProps(u,d,m.onClick),type:c,className:C,"aria-label":b,children:I});return d?n.jsx(k.Tooltip,{asChild:!0,...d,children:T}):T},jr=(e,t)=>({appearance:s,...a})=>n.jsx(Xe,{...a,variant:e,appearance:s||t}),Tr=(e,t)=>({variant:s,...a})=>n.jsx(Xe,{...a,variant:s||t,appearance:e}),os=jr(O.ButtonVariant.Primary,O.ButtonAppearance.Solid),wr=jr(O.ButtonVariant.Neutral,O.ButtonAppearance.Solid),sc=jr(O.ButtonVariant.Danger,O.ButtonAppearance.Solid),nt={x1:"-5.06",y1:"2.26",x2:"30.62",y2:"22.63",from:"var(--stroke-gradient-1, #5976E9)",to:"var(--stroke-gradient-2, #885DF2)"},ac=({appearance:e=O.ButtonAppearance.Outlined,iconBefore:t,iconAfter:r,style:s,...a})=>{const o=`dial-kit-starter-gradient-${h.useId().replace(/[^\w-]/g,"")}`,i=n.jsx("svg",{className:"pointer-events-none absolute size-0 overflow-hidden","aria-hidden":"true",focusable:"false",children:n.jsx("defs",{children:n.jsxs("linearGradient",{id:o,x1:nt.x1,y1:nt.y1,x2:nt.x2,y2:nt.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:nt.from}),n.jsx("stop",{offset:"1",stopColor:nt.to})]})})}),l=c=>n.jsxs(n.Fragment,{children:[i,c]});return n.jsx(Xe,{...a,variant:O.ButtonVariant.Starter,appearance:e,iconBefore:t?l(t):void 0,iconAfter:r&&!t?l(r):r,style:{"--dial-kit-starter-icon-stroke":`url(#${o})`,...s}})},oc=Tr(O.ButtonAppearance.Link,O.ButtonVariant.Primary),ic=Tr(O.ButtonAppearance.Ghost,O.ButtonVariant.Primary),lc=Tr(O.ButtonAppearance.Outlined,O.ButtonVariant.Neutral),cc=({className:e,icon:t,tooltipProps:r,type:s="button",...a})=>{const o=y.mergeClasses("flex items-center justify-center rounded-full size-[40px]","dial-kit-enhanced-target","dial-kit-fab-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0",e),i=n.jsx("button",{...a,type:s,className:o,"aria-label":O.resolveAccessibleName(a["aria-label"],r?.tooltip),children:t||n.jsx(B.IconArrowNarrowDown,{size:24,stroke:1.5,"aria-hidden":"true"})});return r?n.jsx(O.DialTooltip,{...r,children:i}):i},dc=e=>n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:y.mergeClasses("transition-transform",e&&"rotate-180")}),uc=({variant:e,appearance:t,items:r,dropdownProps:s,...a})=>{const[o,i]=h.useState(!1),l=h.useMemo(()=>dc(o),[o]);return n.jsx("div",{className:j.DIAL_KIT_CLASS.buttonDropdown,children:n.jsx(k.Dropdown,{...s,items:r,onOpenChange:c=>i(c),children:n.jsx(Xe,{...a,iconAfter:l,variant:e||O.ButtonVariant.Primary,appearance:t||O.ButtonAppearance.Solid,"aria-haspopup":"menu","aria-expanded":o})})})},is=({label:e,size:t,isOpen:r=!1,labelClassName:s,className:a,"aria-label":o,...i})=>{const l=t===O.ElementSize.Small?"h-[32px]":"h-[40px] dial-kit-enhanced-target";return n.jsxs("button",{type:"button",...i,"aria-haspopup":"menu","aria-expanded":r,"aria-label":o?`${o} ${e}`:void 0,className:y.mergeClasses("dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus","flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary","hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",l,a,j.DIAL_KIT_CLASS.inlineSelect),children:[n.jsx("span",{className:s,children:e}),n.jsx(B.IconChevronDown,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":!0,className:y.mergeClasses("transition-transform",r&&"rotate-180")})]})},fc=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:s,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:c,listStyle:d,ariaLabel:f,triggerClassName:p,triggerLabelClassName:g,open:u,onOpenChange:m})=>{const[C,x]=h.useState(!1),b=u!==void 0,I=b?u:C,N=h.useCallback(L=>{b||x(L),m?.(L)},[b,m]),[T,S]=h.useState(r??e[0]?.key),D=t!==void 0,_=D?t:T,E=h.useMemo(()=>{const L=e.find(w=>w.key===_);return L?.label?String(L.label):""},[e,_]),A=h.useCallback(({key:L})=>{const w=e.find(M=>M.key===L);w&&(D||S(L),s?.(w))},[e,D,s]);return n.jsx(k.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:c,listStyle:d,disabled:o,open:b?u:void 0,onOpenChange:N,onItemClick:A,children:n.jsx(is,{label:E,size:a,isOpen:I,disabled:o,"aria-label":f,className:p,labelClassName:g})})},Ve=({text:e,className:t,variant:r=v.CaptionType.Description,...s})=>e?n.jsx("span",{...s,role:"alert",className:y.mergeClasses("dial-tiny-text",r===v.CaptionType.Error?"text-error":"text-secondary",t,j.DIAL_KIT_CLASS.captionText,r===v.CaptionType.Error&&j.DIAL_KIT_CLASS.errorText),children:e}):null,Ke=({...e})=>n.jsx(Ve,{...e,variant:v.CaptionType.Error}),pc="bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-accent-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-accent-active",gc={[O.ElementSize.Small]:"size-[24px]",[O.ElementSize.Standard]:"size-[40px]",[O.ElementSize.Large]:"size-[48px]"},hc=({icon:e,onClick:t,disabled:r,size:s=O.ElementSize.Standard,className:a})=>n.jsx("div",{className:y.mergeClasses("border-l border-tertiary",gc[s]),children:n.jsx(k.IconButton,{className:y.mergeClasses(pc,s===O.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:s})}),mc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],ls=(e,t,r,s)=>{if((t==="number"||r!==void 0||s!==void 0)&&!mc.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if((r!==void 0||s!==void 0)&&e.currentTarget.selectionStart!==null){const o=e.currentTarget.value,i=e.currentTarget.selectionStart,l=e.currentTarget.selectionEnd??i,c=o.slice(0,i)+e.key+o.slice(l),d=parseFloat(c);if(!isNaN(d)){if(r!==void 0&&d<+r){e.preventDefault();return}if(s!==void 0&&d>+s){e.preventDefault();return}}}}},cs={[O.ElementSize.Small]:{field:"dial-kit-input-small gap-x-1",paddingStart:"pl-2",paddingEnd:"pr-2",stackGap:"gap-1",postfixText:"dial-tiny-text"},[O.ElementSize.Standard]:{field:"gap-x-2 py-2",paddingStart:"pl-3",paddingEnd:"pr-3",stackGap:"gap-2",postfixText:"dial-small-text"},[O.ElementSize.Large]:{field:"gap-x-2 py-3",paddingStart:"pl-4",paddingEnd:"pr-4",stackGap:"gap-2",postfixText:"dial-body-text"}},$e=({labelProps:e,error:t,caption:r,id:s,containerClassName:a,size:o=O.ElementSize.Standard,...i})=>n.jsxs("div",{className:y.mergeClasses("flex flex-col",cs[o].stackGap,a),children:[e&&n.jsx(k.Label,{...e,htmlFor:s}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(ds,{id:s,size:o,...i}),n.jsx(Ke,{text:t}),!t&&n.jsx(Ve,{text:r})]})]}),ds=({invalid:e,disabled:t,prefix:r,className:s,postfix:a,children:o,iconBefore:i,iconAfter:l,wrapperClassName:c,type:d,inputRef:f,value:p,tooltipText:g,min:u,onChange:m,max:C,inputButtonProps:x,wrapperRef:b,size:I=O.ElementSize.Standard,...N})=>{const T=cs[I],S=h.useRef(null),D=ee.useMergeRefs([f,S]),_=d==="number"||u!==void 0||C!==void 0;h.useEffect(()=>{const w=S.current;if(!w||!_||t)return;const M=F=>{F.preventDefault()};return w.addEventListener("wheel",M,{passive:!1}),()=>{w.removeEventListener("wheel",M)}},[t,_,d]);const E=w=>{ls(w,d,u,C)},A=w=>{const M=w.currentTarget.value;if(_&&M!==""){const F=parseFloat(M);if(isNaN(F)&&M!=="-"&&M!=="."||!isNaN(F)&&(u!==void 0&&F<+u||C!==void 0&&F>+C))return}m?.(M||void 0)},L=()=>n.jsxs("div",{ref:b,className:y.mergeClasses("dial-kit-input flex flex-row items-center justify-between",T.field,e&&"dial-kit-input-error",t&&"dial-kit-input-disable",!r&&T.paddingStart,!x&&T.paddingEnd,c),"aria-label":"input-container",children:[r&&n.jsx("div",{className:"border-r border-secondary",children:n.jsx(ds,{wrapperClassName:"!rounded-r-none",className:"truncate",value:r,disabled:!0,size:I,id:`${r}_textBefore`})}),n.jsx(j.DialIcon,{icon:i}),o,n.jsx("input",{ref:D,type:d,autoComplete:d==="password"?"new-password":"off",value:p??"",className:y.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",s),onChange:A,onKeyDown:E,min:u,disabled:t,max:C,...N}),a&&n.jsxs("p",{className:y.mergeClasses("text-secondary",T.postfixText),children:[" ",a]}),n.jsx(j.DialIcon,{icon:l}),x&&n.jsx(hc,{size:I,...x,disabled:t})]});return t&&d!=="password"?n.jsx(k.Tooltip,{tooltip:g||p,children:L()}):L()},us=({availableWidth:e,tagWidths:t,overflowChipWidth:r,gap:s})=>{if(e<=0)return t.length;let a=0,o=0;for(const i of t){const l=i+s;if(a+l>e)break;a+=l,o++}if(o===t.length)return o;for(;o>0&&a+r>e;)o--,a-=t[o]+s;return o};var qe=(e=>(e.Outlined="outlined",e.Selectable="selectable",e))(qe||{});const xc="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",bc={[qe.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[qe.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"}},Cc="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",vc="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ae=({label:e,icon:t,appearance:r=qe.Outlined,selected:s=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:c,onClick:d,onRemove:f,onKeyDown:p,...g})=>{const u=r===qe.Selectable,m=!!d&&!a,C=o&&!!f&&!a,x=u&&s,b=I=>{p?.(I),!(!m||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return n.jsxs("span",{...g,role:m?"button":g.role,tabIndex:m?0:g.tabIndex,"aria-disabled":a||void 0,"aria-pressed":u&&m?s:void 0,onClick:a?void 0:d,onKeyDown:b,className:y.mergeClasses(xc,x?"dial-tiny-semi-text":"dial-tiny-text",bc[r][s?"selected":"default"],a&&"cursor-not-allowed",m&&[Cc,vc],l,j.DIAL_KIT_CLASS.tag),children:[t&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:t}),n.jsx("span",{className:"truncate",title:c??e,children:e}),C&&n.jsx(k.GhostIconButton,{className:"size-[16px] shrink-0 dial-kit-minimum-target",size:O.ElementSize.Small,"aria-label":i??`Remove ${e}`,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:I=>{I.stopPropagation(),f?.(I)}})]})},At="h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2",pt=({options:e,selectedValues:t,handleRemoveTag:r,tagClassName:s})=>n.jsx(n.Fragment,{children:t.map(a=>{const o=e.find(i=>i.value===a);return n.jsx(Ae,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:y.mergeClasses(At,s)},a)})}),yc=8,Ic=e=>e.stopPropagation(),Sc=e=>{e.key!=="Escape"&&e.stopPropagation()},Dc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const s=h.useRef(null),a=h.useRef(null),[o,i]=h.useState(null),l=h.useCallback(()=>{const p=s.current,g=a.current;if(!p||!g)return;const u=Array.from(g.children,C=>C.offsetWidth),m=u.pop()??0;i(us({tagWidths:u,overflowChipWidth:m,availableWidth:p.clientWidth,gap:yc}))},[]);h.useLayoutEffect(()=>{l()},[l,e,t]),h.useLayoutEffect(()=>{const p=s.current;return p?j.observeElementSize(p,l):void 0},[l]);const c=o??t.length,d=t.slice(0,c),f=t.slice(c);return n.jsxs("div",{ref:s,className:"relative flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[n.jsx(pt,{options:e,selectedValues:d,handleRemoveTag:r,tagClassName:"min-w-0"}),f.length>0&&n.jsx(k.InteractiveTooltip,{asChild:!0,placement:k.TooltipPlacement.Bottom,content:n.jsx("div",{className:"flex flex-wrap gap-2",onClick:Ic,onKeyDown:Sc,children:n.jsx(pt,{options:e,selectedValues:f,handleRemoveTag:r})}),children:n.jsx(Ae,{label:`+${f.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${f.length} more selected: ${f.map(p=>e.find(g=>g.value===p)?.label??p).join(", ")}`,title:"",className:y.mergeClasses(At,"shrink-0")})}),n.jsxs("div",{ref:a,"aria-hidden":"true",inert:!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 w-max gap-2 overflow-hidden",children:[n.jsx(pt,{options:e,selectedValues:t,handleRemoveTag:r,tagClassName:"shrink-0"}),n.jsx(Ae,{label:`+${t.length}`,className:y.mergeClasses(At,"shrink-0")})]})]})},Nc=y.mergeClasses("w-full flex flex-col"),jc=k.overlayItemClassName,Tc="!max-w-[var(--reference-width)]",wc=y.mergeClasses("max-h-[344px] overflow-y-auto py-1",k.overlayListClassName),Ec=k.overlayGap,Oc=k.overlaySubMenuListClassName,Ac=n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),_c="text-secondary transition-transform",Lc=8,kc=n.jsx(B.IconSearch,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Rc=n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Mc=n.jsx(k.SvgNoData,{width:$.DIAL_ICON_SIZE.LG,height:$.DIAL_ICON_SIZE.LG,"aria-hidden":"true"}),Pc=({opt:e,selectedValues:t,mark:r=k.MenuItemMark.Tint,onSelect:s})=>{const{isOpen:a,nodeId:o,refs:i,floatingStyles:l,context:c,getReferenceProps:d,getFloatingProps:f}=j.useSubMenuFloating(Ec,"listbox",!!e.disabled),p=e.children?.some(u=>t.includes(u.value)),g=n.jsx(k.MenuItem,{ref:i.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!p,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:Ac,...d()});return n.jsxs(ee.FloatingNode,{id:o,children:[e.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:g}):g,a&&n.jsx(j.SubMenuPanel,{refs:i,floatingStyles:l,context:c,getFloatingProps:f,role:"listbox",surfaceClassName:Oc,children:e.children.map(u=>{const m=n.jsx(k.MenuItem,{role:"option","aria-selected":t.includes(u.value),"aria-disabled":!!u.disabled,disabled:u.disabled,mark:r,selected:t.includes(u.value),ellipsisLabel:!0,icon:u.icon,label:u.labelNode??u.label,rightControl:u.rightControl,onClick:()=>!u.disabled&&s(u.value)});return n.jsx(h.Fragment,{children:u.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:u.interactiveTooltip.placement,content:u.interactiveTooltip.content,contentClassName:u.interactiveTooltip.contentClassName,children:m}):m},u.value)})})]})},Fc=({options:e,multiple:t=!1,id:r,value:s,defaultValue:a,size:o=O.ElementSize.Standard,prefix:i,customSelectedValue:l,placeholder:c="Select...",labelProps:d,error:f,caption:p,ariaLabel:g,searchable:u=!1,searchSize:m=O.ElementSize.Standard,searchPlaceholder:C,selectAll:x=!1,invalid:b,selectAllLabel:I="Select all",collapseTagOverflow:N=!1,selectedOptionMark:T=k.MenuItemMark.Tint,emptyStateTitle:S="No options available",emptyStateDescription:D,emptyStateIcon:_,disabled:E=!1,className:A,fieldClassName:L,listClassName:w,closable:M=!1,header:F,footer:K,onClose:te,onChange:G,dismissRef:z,onFooterClick:H,open:q,onOpenChange:U,onSearchQueryChange:ae,customMultiSelectTagsRenderer:Y})=>{const Z=h.useId(),re=r||Z,oe=`list-${re}`,le=o===O.ElementSize.Small,[ue,me]=h.useState(!1),Ce=q!==void 0,ge=Ce?!!q:ue,W=h.useCallback(P=>{Ce||me(P),U?.(P)},[Ce,U]),[Q,we]=h.useState(""),ke=h.useCallback(P=>{P!==Q&&(we(P||""),ae?.(P||""))},[ae,Q]),X=s!==void 0,[de,Ee]=h.useState(a),xe=X?s:de,fe=h.useMemo(()=>t?Array.isArray(xe)?xe:[]:typeof xe=="string"?[xe]:[],[xe,t]),Qe=h.useMemo(()=>{const P=Q.trim().toLowerCase();return P?e.filter(pe=>pe.label.toLowerCase().includes(P)):e},[e,Q]);h.useEffect(()=>{ge||ke("")},[ge,ke]);const ye=h.useCallback(P=>{X||Ee(P),G?.(P)},[X,G]),ct=h.useCallback(P=>{if(t){const pe=new Set(fe);pe.has(P)?pe.delete(P):pe.add(P),ye(Array.from(pe));return}ye(P),W(!1)},[t,ye,W,fe]),Je=h.useCallback((P,pe)=>{if(P.stopPropagation(),!t){ye("");return}const Ct=fe.filter(Ts=>Ts!==pe);ye(Ct)},[t,fe,ye]),ve=h.useMemo(()=>Qe.filter(P=>!P.disabled),[Qe]),ze=h.useMemo(()=>ve.filter(P=>fe.includes(P.value)).length,[ve,fe]),{allSelectedInFiltered:be,someSelectedInFiltered:Ht}=h.useMemo(()=>{const P=ve.length>0&&ze===ve.length;return{allSelectedInFiltered:P,someSelectedInFiltered:ze>0&&!P}},[ve,ze]),et=h.useCallback(()=>{if(!(!t||ve.length===0))if(be){const P=new Set(ve.map(pe=>pe.value));ye(fe.filter(pe=>!P.has(pe)))}else{const P=new Set(fe);ve.forEach(pe=>P.add(pe.value)),ye(Array.from(P))}},[be,t,ve,fe,ye]),Ge=fe.length>0,R=!t&&Ge?fe[0]:void 0,ne=h.useMemo(()=>R?e.find(P=>P.value===R)??e.flatMap(P=>P.children??[]).find(P=>P.value===R):void 0,[e,R]),Ie=ne?i?`${i} ${ne.label}`:ne.label:void 0,Vt=j.useIsMobileScreen(),Kt=t&&N&&!Y&&!Vt,dt=h.useMemo(()=>t?Ge?Kt?n.jsx(Dc,{options:e,selectedValues:fe,handleRemoveTag:Je}):n.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:Y?.(e,fe,Je)??n.jsx(pt,{options:e,selectedValues:fe,handleRemoveTag:Je})}):null:!ne||!ne.labelNode&&!ne.description?null:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[n.jsx(k.EllipsisTooltip,{text:ne.labelNode??Ie}),ne.description&&n.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:ne.description})]}),[Kt,Y,Je,Ge,t,e,Ie,fe,ne]),Is=t||dt?"":Ie||(l&&s?l:""),Ss=typeof d?.label=="string"?d.label:void 0,Ds=dt?[O.resolveAccessibleName(g,Ss),t?fe.map(P=>e.find(pe=>pe.value===P)?.label??P).join(", "):Ie].filter(Boolean).join(", ")||void 0:O.resolveAccessibleName(g);h.useImperativeHandle(z,()=>({dismiss:()=>{W(!1)}}));const Ns=h.useCallback(P=>{E||(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),ge||W(!0))},[E,ge,W]),js=()=>n.jsxs("div",{id:oe,role:"listbox","aria-multiselectable":t||void 0,className:Nc,children:[F&&n.jsx(n.Fragment,{children:typeof F=="function"?F():F}),(u||M)&&(e.length>Lc||!!Q)&&n.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[u&&n.jsx($e,{id:`search-${re}`,size:m,placeholder:C,"aria-label":C||"Search options",onChange:P=>ke(P),value:Q,iconBefore:kc,containerClassName:"w-full"}),M&&n.jsx(k.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:O.ElementSize.Small,icon:Rc,onClick:P=>{te?.(P),W(!1)}})]}),t&&x&&ve.length>0&&n.jsx("div",{className:y.mergeClasses(jc,"mt-2"),children:n.jsx(k.Checkbox,{id:`${re}-selectAll`,labelProps:{label:I},isSelected:be,isIndeterminate:Ht,onChange:et})}),n.jsx("div",{role:"none",className:wc,children:Qe.length===0?n.jsx("div",{className:"px-2 py-3",children:n.jsx(j.DialNoDataContent,{icon:_??Mc,title:S,description:D})}):Qe.map(P=>{const pe=fe.includes(P.value);if(P.children?.length)return n.jsx(Pc,{opt:P,selectedValues:fe,mark:t?k.MenuItemMark.Checkbox:T,onSelect:ct},P.value);const Ct=t?n.jsx(k.MenuItem,{id:`${re}-${P.value}`,role:"option","aria-selected":pe,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:k.MenuItemMark.Checkbox,selected:pe,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>ct(P.value)}):n.jsx(k.MenuItem,{role:"option","aria-selected":pe,"aria-disabled":!!P.disabled,disabled:P.disabled,mark:T,selected:pe,ellipsisLabel:!0,icon:P.icon,label:P.labelNode??P.label,description:P.description,rightControl:P.rightControl,onClick:()=>!P.disabled&&ct(P.value)});return n.jsx(h.Fragment,{children:P.interactiveTooltip?n.jsx(k.InteractiveTooltip,{asChild:!0,placement:P.interactiveTooltip.placement,content:P.interactiveTooltip.content,contentClassName:P.interactiveTooltip.contentClassName,children:Ct}):Ct},P.value)})}),K&&n.jsx("div",{onClick:P=>{H?.(P),H&&W(!1)},children:typeof K=="function"?K():K})]});return n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-2",A,j.DIAL_KIT_CLASS.select),children:[d&&n.jsx(k.Label,{...d,htmlFor:re}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(k.Dropdown,{open:ge,onOpenChange:W,disabled:E,closable:M,onClose:te,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:y.mergeClasses(Tc,w),className:"w-full",renderOverlay:js,children:n.jsx($e,{id:re,size:o,disabled:E,invalid:b,value:Is,placeholder:dt?void 0:c,readOnly:!0,iconBefore:t?void 0:ne?.icon,iconAfter:n.jsx(B.IconChevronDown,{size:le?$.DIAL_ICON_SIZE.SM:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses(_c,ge&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":oe,"aria-autocomplete":"none","aria-label":Ds,containerClassName:"w-full",wrapperClassName:y.mergeClasses(!E&&"cursor-pointer",t&&Ge&&!Kt&&["!h-auto flex-wrap py-2",le?"min-h-[24px]":"min-h-[40px]"],L),className:y.mergeClasses("cursor-pointer",dt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ns,children:dt})}),n.jsx(Ke,{text:f}),!f&&n.jsx(Ve,{text:p})]})]})};var fs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(fs||{});const cn={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Bc=e=>typeof e=="boolean"?cn[e?"both":"none"]:cn[e],zc=({className:e="",value:t,onChange:r,error:s,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:c,...d})=>{const f=y.mergeClasses("dial-kit-textarea dial-kit-input px-3 py-2",d.invalid&&"dial-kit-input-error",d.disabled&&"dial-kit-input-disable",Bc(o),e);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",a),children:[i&&n.jsx(k.Label,{...i,htmlFor:c}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("textarea",{id:c,value:t||"",className:f,onChange:p=>r?.(p.currentTarget.value),...d}),n.jsx(Ke,{text:s}),!s&&n.jsx(Ve,{text:l})]})]})},$c=({showPasswordLabel:e="Show password",hidePasswordLabel:t="Hide password",disabled:r,size:s=O.ElementSize.Standard,...a})=>{const[o,i]=h.useState(!1),l=o&&!r;return h.useEffect(()=>{r&&i(!1)},[r]),n.jsx($e,{...a,wrapperClassName:y.mergeClasses(a.wrapperClassName,j.DIAL_KIT_CLASS.passwordInput),size:s,disabled:r,type:l?"text":"password",iconAfter:r?void 0:n.jsx(k.GhostIconButton,{size:O.ElementSize.Small,"aria-label":l?t:e,"aria-pressed":l,icon:l?n.jsx(B.IconEyeOff,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(B.IconEye,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:()=>i(c=>!c)})})},Hc=/^0+\.(\d+)?$/,Vc=/^0+/,Kc=[".","-","+","e","E"],dn=e=>!e||e==="-"?e:String(e).match(Hc)?String(e).replace(Vc,"0"):Number(e),Gc=({integer:e,onChange:t,min:r,max:s,onKeyDown:a,onPaste:o,...i})=>{const l=d=>{if(e&&Kc.includes(d.key)){d.preventDefault();return}ls(d,"number",r,s),a?.(d)},c=d=>{if(e){const f=d.clipboardData.getData("text"),p=f.replace(/\D/g,"");if(p!==f&&(d.preventDefault(),p)){const g=d.currentTarget,u=g.selectionStart??0,m=g.selectionEnd??0,C=g.value.slice(0,u)+p+g.value.slice(m);t?.(dn(C))}}o?.(d)};return n.jsx($e,{...i,wrapperClassName:y.mergeClasses(i.wrapperClassName,j.DIAL_KIT_CLASS.numberInput),type:"number",min:r,max:s,onChange:d=>t?.(dn(d)),onKeyDown:l,onPaste:c})},Uc="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Zc="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Wc="flex flex-row items-center justify-between px-6 py-4",qc="flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary",Yc="border-b border-tertiary",Xc="flex flex-row items-center gap-2 px-6 py-4",Qc="border-t border-tertiary",nr="flex shrink-0 flex-row items-center gap-2",Jc={[v.PopupSize.Sm]:"max-w-full md:max-w-[400px]",[v.PopupSize.Md]:"max-w-full md:max-w-[800px]",[v.PopupSize.Lg]:"max-w-full md:max-w-[1200px]"},Er=({open:e=!1,header:t,ariaLabel:r,portalId:s,className:a,overlayClassName:o,titleClassName:i,headerClassName:l,bodyClassName:c,children:d,footer:f,footerClassName:p,onClose:g,onBack:u,backAriaLabel:m="Back",headerActions:C,headerDivider:x=!1,mainButtons:b,additionalButtons:I,additionalButtonsOnLeft:N=!1,footerDivider:T=!1,size:S=v.PopupSize.Md,hideClose:D=!1,closeAriaLabel:_="Close dialog",closeOnOutsideClick:E=!0,preventKeyboardOnOpen:A=!1})=>{const L=j.useThemeScope(),w=h.useRef(null),M=h.useId(),{refs:F,context:K}=ee.useFloating({open:e,onOpenChange:Z=>{Z||g?.(null)}}),te=ee.useRole(K,{role:"dialog"}),G=ee.useDismiss(K,{outsidePress:E}),{getFloatingProps:z}=ee.useInteractions([te,G]);if(!e)return null;const H=typeof t=="string"?`popup-heading-${M}`:void 0,q=Z=>Z?typeof Z=="string"?n.jsx("h2",{id:H,className:y.mergeClasses(qc,i),children:n.jsx(k.Tooltip,{tooltip:Z,triggerClassName:"truncate",children:Z})}):Z:n.jsx("span",{}),U=D?null:n.jsx(k.CloseButton,{ariaLabel:_,onClose:Z=>g?.(Z)}),ae=(Z,re=[])=>re.map(({variant:oe=O.ButtonVariant.Neutral,...le},ue)=>n.jsx(Xe,{variant:oe,...le},`${Z}-${ue}`)),Y=()=>{if(f!==void 0)return f;if(!b?.length&&!I?.length)return null;const Z=ae("additional",I);return n.jsxs("div",{className:y.mergeClasses(Xc,T&&Qc,p),children:[N&&Z.length>0&&n.jsx("div",{className:nr,children:Z}),n.jsxs("div",{className:y.mergeClasses(nr,"ml-auto"),children:[!N&&Z,ae("main",b)]})]})};return n.jsx(ee.FloatingPortal,{id:s,children:n.jsx(ee.FloatingOverlay,{className:y.mergeClasses(Uc,L,o),children:n.jsx(ee.FloatingFocusManager,{context:K,initialFocus:A?w:F.floating,children:n.jsxs("div",{ref:F.setFloating,...z(),role:"dialog","aria-modal":"true","aria-labelledby":H,"aria-label":H?void 0:r,className:y.mergeClasses(Zc,Jc[S],a,j.DIAL_KIT_CLASS.popup),children:[A&&n.jsx("div",{ref:w,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),n.jsxs("div",{className:y.mergeClasses(Wc,x&&Yc,l),children:[u&&n.jsx(k.GhostIconButton,{"aria-label":m,size:O.ElementSize.Small,className:"mr-2",onClick:u,icon:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),q(t),C?n.jsxs("div",{className:nr,children:[C,U]}):U]}),n.jsx("div",{className:y.mergeClasses("grow overflow-auto",c),children:d}),Y()]})})})})},ed="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",td="text-secondary dial-small-paragraph-text px-6 pb-4",rd="px-6 py-4 h-[120px]",nd="Cancel",sd="Ok",un={[v.ConfirmationPopupVariant.Info]:{confirm:{variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Solid}},[v.ConfirmationPopupVariant.Danger]:{confirm:{variant:O.ButtonVariant.Danger,appearance:O.ButtonAppearance.Solid}}},ps=({header:e,description:t,descriptionClassName:r,open:s=!1,confirmLabel:a=sd,cancelLabel:o=nd,isLoading:i=!1,disableConfirmButton:l=!1,className:c,confirmClassName:d,onClose:f,onConfirm:p,onCancel:g,children:u,variant:m=v.ConfirmationPopupVariant.Info,size:C=v.PopupSize.Sm,footer:x,hideClose:b,...I})=>{const N=i?null:n.jsxs("div",{className:ed,children:[n.jsx(wr,{label:o,onClick:()=>g?g():f?.()}),n.jsx(Xe,{variant:un[m].confirm.variant,appearance:un[m].confirm.appearance,className:d,label:a,disabled:l,onClick:p})]}),T=h.useCallback(()=>i?n.jsx("div",{className:rd,children:n.jsx(v.Spinner,{size:40})}):u??(t?n.jsx("div",{className:y.mergeClasses(td,r),children:t}):null),[u,t,i,r]);return n.jsx(Er,{...I,open:s,header:e,className:y.mergeClasses(c,j.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>f?.(),footer:x??N,size:C,hideClose:b??(!i&&x===void 0),children:T()})};var _t=(e=>(e.Start="start",e.End="end",e))(_t||{});const ad=({title:e,description:t,children:r,expanded:s,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:c,caretPosition:d=_t.End,className:f,headerClassName:p,contentClassName:g})=>{const u=s!==void 0,[m,C]=h.useState(a),x=i?!0:u?s:m,b=h.useId(),I=`accordion-header-${b}`,N=`accordion-content-${b}`,T=()=>{if(o)return;const A=!x;u||C(A),c?.(A)},S=d===_t.Start,D=i?null:n.jsx(B.IconChevronRight,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses("shrink-0 text-secondary transition-transform motion-reduce:transition-none",x?"rotate-90":"rtl:rotate-180")}),_=n.jsxs(n.Fragment,{children:[S&&D,n.jsxs("span",{className:"flex min-w-0 flex-col",children:[n.jsx("span",{className:"truncate dial-body-text text-primary",children:e}),t?n.jsx("span",{className:"truncate dial-tiny-text text-secondary",children:t}):null]}),!S&&D]}),E=S?"justify-start gap-2":"justify-between";return n.jsxs("div",{className:y.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",f,j.DIAL_KIT_CLASS.accordion),children:[i?n.jsx("div",{id:I,className:y.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,p),children:_}):n.jsx("button",{id:I,type:"button","aria-expanded":x,"aria-controls":N,"aria-label":O.resolveAccessibleName(l),disabled:o,onClick:T,className:y.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",E,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",p),children:_}),n.jsx("div",{inert:!x,className:y.mergeClasses("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:n.jsx("div",{className:"min-h-0 overflow-hidden",children:n.jsx("div",{className:"pt-3",children:n.jsx("div",{id:N,role:"region","aria-labelledby":I,className:y.mergeClasses("px-4 dial-small-text text-primary",g),children:r})})})})]})},od=({id:e,labelProps:t,isOn:r=!1,disabled:s,onChange:a,caption:o,className:i,...l})=>{const c=h.useId(),d=e??c,f=o?`${d}-caption`:void 0,p=h.useCallback(g=>{a?.(g.target.checked)},[a]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:y.mergeClasses("flex items-center gap-2",i,j.DIAL_KIT_CLASS.switch),children:[n.jsx("input",{...l,type:"checkbox",role:"switch",id:d,checked:r,"aria-checked":r,disabled:s,onChange:p,"aria-label":O.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":f,className:"peer sr-only"}),n.jsx("label",{htmlFor:d,className:y.mergeClasses("flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",r?"justify-end":"justify-start",s?"cursor-not-allowed bg-control-disable-primary":y.mergeClasses("cursor-pointer",r?"bg-control-accent hover:bg-control-accent-hover":"bg-control-neutral-default hover:bg-control-neutral-hover-strong")),children:n.jsx("span",{className:y.mergeClasses("size-3.5 shrink-0 rounded-full",s?"bg-control-disable-secondary":"bg-control-neutral")})}),t&&n.jsx(k.Label,{size:O.ElementSize.Standard,...t,htmlFor:d,className:y.mergeClasses("py-[1px]",s?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",t.className)})]}),o&&n.jsx("span",{id:f,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},id="flex flex-col gap-2",ld="flex",cd="mt-2 ml-[26px]",dd={[v.RadioGroupOrientation.Column]:"flex-col gap-y-3",[v.RadioGroupOrientation.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},gs=({items:e,value:t,onChange:r,name:s,id:a,orientation:o=v.RadioGroupOrientation.Column,labelProps:i,disabled:l,error:c,caption:d,ariaLabel:f,className:p,optionsClassName:g,radioClassName:u,contentClassName:m})=>{const C=h.useId(),x=a??C,b=`${x}-label`,I=c?`${x}-error`:void 0,N=!c&&d?`${x}-caption`:void 0,T=O.resolveAccessibleName(i?.label);return n.jsxs("div",{className:y.mergeClasses(id,p,j.DIAL_KIT_CLASS.radioGroup),children:[i&&n.jsx(k.Label,{...i,id:b}),n.jsx("div",{role:"radiogroup","aria-labelledby":T?b:void 0,"aria-label":T?void 0:O.resolveAccessibleName(f),"aria-describedby":[I,N].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:y.mergeClasses(ld,dd[o],g),children:e.map(S=>{const D=S.value===t;return n.jsxs("div",{className:"flex min-w-0 flex-col",children:[n.jsx(k.Radio,{id:`${x}-${S.value}`,name:s??x,value:S.value,labelProps:S.label==null?void 0:{label:S.label},"aria-label":S["aria-label"],caption:S.caption,isSelected:D,disabled:l||S.disabled,onChange:r,className:u}),D&&S.content?n.jsx("div",{className:y.mergeClasses(cd,m),children:S.content}):null]},S.value)})}),n.jsx(Ke,{id:I,text:c}),!c&&n.jsx(Ve,{id:N,text:d})]})},ud="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",fd="min-w-0 flex-1 truncate text-primary",pd="min-w-0 flex-1 truncate text-secondary",gd="shrink-0 text-secondary",hd="px-6 pb-4",md="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",xd="Cancel",bd="Apply",Cd=({items:e,value:t,customValue:r,header:s,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:c,onSelectionChange:d,onCancel:f,onClose:p,isValid:g=!0,applyButtonLabel:u=bd,cancelButtonLabel:m=xd,size:C=v.PopupSize.Md,portalId:x,disabled:b,invalid:I,error:N,caption:T,ariaLabel:S,className:D,fieldClassName:_})=>{const E=h.useId(),A=o??E,L=`${A}-label`,w=`${A}-value`,M=N?`${A}-error`:void 0,F=!N&&T?`${A}-caption`:void 0,[K,te]=h.useState(!1),G=c!==void 0,[z,H]=h.useState(t),q=G?c:z,U=h.useCallback(()=>{b||(G||H(t),te(!0))},[b,G,t]),ae=h.useCallback(()=>{te(!1),p?.()},[p]),Y=h.useCallback(()=>{f?.(),ae()},[f,ae]),Z=h.useCallback(()=>{a(q),ae()},[a,q,ae]),re=h.useCallback(W=>{G||H(W),d?.(W)},[G,d]),oe=O.resolveAccessibleName(i?.label),le=oe?void 0:O.resolveAccessibleName(S),ue=oe?L:le&&`${A}-name`,me=O.resolveAccessibleName(s),Ce=e.find(W=>W.value===t)?.label,ge=r??Ce;return n.jsxs("div",{className:y.mergeClasses("flex w-full flex-col gap-2",D,j.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&n.jsx(k.Label,{...i,id:L,htmlFor:A}),n.jsxs("div",{className:"flex flex-col gap-1",children:[le&&n.jsx("span",{id:ue,className:"sr-only",children:le}),n.jsxs("button",{type:"button",id:A,disabled:b,"aria-haspopup":"dialog","aria-expanded":K,"aria-labelledby":ue?`${ue} ${w}`:void 0,"aria-describedby":[M,F].filter(Boolean).join(" ")||void 0,onClick:U,className:y.mergeClasses(ud,I&&"dial-kit-input-error",b&&"dial-kit-input-disable",_),children:[n.jsx("span",{id:w,className:ge==null?pd:fd,children:ge??l}),n.jsx(B.IconMaximize,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:gd})]}),n.jsx(Ke,{id:M,text:N}),!N&&n.jsx(Ve,{id:F,text:T})]}),n.jsx(Er,{open:K,header:s,ariaLabel:me?void 0:oe,portalId:x,size:C,onClose:Y,footer:n.jsxs("div",{className:md,children:[n.jsx(wr,{label:m,onClick:Y}),n.jsx(os,{label:u,disabled:!g,onClick:Z})]}),children:n.jsx("div",{className:hd,children:n.jsx(gs,{id:`${A}-options`,items:e,value:q,onChange:re,orientation:v.RadioGroupOrientation.Column,ariaLabel:oe??me})})})]})},vd=({icon:e,selectedIcon:t,isSelected:r=!1,onToggle:s,onClick:a,tooltipProps:o,size:i=O.ElementSize.Small,className:l,...c})=>{const d=h.useCallback(p=>{a?.(p),s?.(!r)},[a,s,r]),f=n.jsx(k.IconButton,{...c,size:i,variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Ghost,icon:r?t??e:e,"aria-pressed":r,"aria-label":O.resolveAccessibleName(c["aria-label"],o?.tooltip),onClick:d,className:y.mergeClasses("!rounded","[&_svg]:size-4",r&&"!text-accent",l,j.DIAL_KIT_CLASS.toggleIconButton)});return o?n.jsx(k.Tooltip,{asChild:!0,...o,children:f}):f},yd=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Id="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Sd="flex h-8 min-w-8 grow shrink-0 basis-auto items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus",Dd="bg-layer-raised text-accent shadow-xs",Nd="bg-transparent text-secondary",jd="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Td="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",wd="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",Ed="cursor-not-allowed bg-transparent text-control-disable-primary",Od=({items:e,value:t,onChange:r,disabled:s,className:a,segmentClassName:o,"aria-label":i})=>{const l=h.useRef({}),c=e.find(p=>p.value===t),d=c&&!c.disabled?c.value:e.find(p=>!p.disabled)?.value,f=h.useCallback(p=>{if(s||!yd.includes(p.key))return;const g=e.filter(b=>!b.disabled);if(g.length===0)return;const u=Math.max(g.findIndex(b=>b.value===t),0),m=g.length-1;let C=u;switch(p.key){case"ArrowRight":case"ArrowDown":C=u===m?0:u+1;break;case"ArrowLeft":case"ArrowUp":C=u===0?m:u-1;break;case"Home":C=0;break;case"End":C=m;break}p.preventDefault();const x=g[C];l.current[x.value]?.focus(),x.value!==t&&r(x.value)},[s,e,t,r]);return n.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,onKeyDown:f,className:y.mergeClasses(Id,a,j.DIAL_KIT_CLASS.segmentedControl),children:e.map(p=>{const g=p.value===t,u=s||p.disabled;return n.jsxs("button",{ref:m=>{l.current[p.value]=m},type:"button",role:"radio","aria-checked":g,"aria-label":O.resolveAccessibleName(p["aria-label"],typeof p.label=="string"?p.label:void 0),tabIndex:p.value===d?0:-1,disabled:u,onClick:()=>r(p.value),className:y.mergeClasses(Sd,g?Dd:Nd,u?g?wd:Ed:g?jd:Td,o,j.DIAL_KIT_CLASS.segmentedControlItem),children:[p.icon,p.label]},p.value)})})},Ad={[v.TabOrientation.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[v.TabOrientation.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},_d=({tabs:e,activeTabId:t,onTabChange:r,orientation:s=v.TabOrientation.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:c,sectionLabelClassName:d})=>{const f=h.useRef({}),p=h.useId(),g=s===v.TabOrientation.Vertical,u=e.find(b=>b.id===t),m=u&&!u.disabled?u.id:e.find(b=>!b.disabled)?.id,C=h.useCallback(b=>{const{next:I,previous:N}=Ad[s];if(![I,N,"Home","End"].includes(b.key)||e.length===0)return;const T=e.filter(A=>!A.disabled);if(T.length===0)return;const S=Math.max(T.findIndex(A=>A.id===t),0),D=T.length-1;let _=S;b.key===I?_=S===D?0:S+1:b.key===N?_=S===0?D:S-1:b.key==="Home"?_=0:_=D,b.preventDefault();const E=T[_];f.current[E.id]?.focus(),E.id!==t&&r(E.id)},[e,t,r,s]),x=n.jsx("div",{role:"tablist","aria-orientation":g?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?p:void 0,onKeyDown:C,className:y.mergeClasses(g?"flex flex-col gap-1 px-2":"flex justify-start gap-1",!a&&i,l,j.DIAL_KIT_CLASS.tabList,!a&&j.DIAL_KIT_CLASS.tabs),children:e.map(b=>{const I=t===b.id,N=!!b.disabled;return n.jsxs("button",{ref:T=>{f.current[b.id]=T},type:"button",role:"tab","aria-selected":I,disabled:N,tabIndex:b.id===m?0:-1,onClick:()=>r(b.id),className:y.mergeClasses("dial-kit-enhanced-target flex items-center gap-2 text-start","transition-colors motion-reduce:transition-none","focus-visible:outline focus-visible:outline-focus",g?["h-11 w-full rounded-lg px-3 desktop:h-10","focus-visible:-outline-offset-1",I?"dial-small-semi-text":"dial-small-text text-secondary"]:["dial-small-paragraph-semi-text border-b-2 border-transparent px-3 py-2","focus-visible:outline-offset-2"],N&&(g?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!N&&(g?I?"bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover":"hover:bg-control-accent-alpha-hover":I?"dial-kit-tab-selected-underline text-primary":"border-transparent text-secondary"),c,j.DIAL_KIT_CLASS.tab,I&&j.DIAL_KIT_CLASS.tabSelected),children:[b.icon&&n.jsx("span",{"aria-hidden":"true",className:"flex shrink-0",children:b.icon}),n.jsx("span",{className:y.mergeClasses(g&&!I&&!N&&"text-primary"),children:b.label}),b.count!=null&&n.jsx("span",{className:y.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",g&&"ms-auto",N&&"bg-layer-sunken text-control-disable-primary",!N&&(I?"bg-control-accent-alpha text-accent":"bg-layer-sunken text-secondary")),children:b.count})]},b.id)})});return a?n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-3",i,j.DIAL_KIT_CLASS.tabs),children:[n.jsx("div",{className:y.mergeClasses("flex h-16 shrink-0 items-center",g?"px-4":"px-3"),children:n.jsx("span",{id:p,className:y.mergeClasses("dial-h1-text text-primary",d,j.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),x]}):x},Ld="flex flex-nowrap items-center gap-1",kd="min-w-max flex-1 justify-center",Rd=({items:e,value:t,onChange:r,stretch:s=!1,className:a,chipClassName:o,"aria-label":i,"aria-labelledby":l})=>n.jsx("div",{role:"group","aria-label":i,"aria-labelledby":l,className:y.mergeClasses(Ld,a,j.DIAL_KIT_CLASS.filterChips),children:e.map(c=>n.jsx(Ae,{label:c.label,icon:c.icon,appearance:qe.Selectable,selected:c.value===t,onClick:()=>r(c.value),className:y.mergeClasses(s&&kd,o)},c.value))}),fr=(e,t)=>{const r=(t??"").split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(r.length===0)return!0;const s=e.name.toLowerCase(),a=e.type.toLowerCase();return r.some(o=>{if(o.startsWith("."))return s.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,-1);return a.length>i.length&&a.startsWith(i)}return a===o})},Md=({labelProps:e,label:t,description:r,onChange:s,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:c,icon:d,id:f,ariaLabel:p,className:g})=>{const u=h.useId(),m=f??`file-dropzone-${u}`,C=c?`${m}-error`:void 0,[x,b]=h.useState(!1),I=h.useRef(0),N=h.useCallback(L=>{if(L.length===0)return;const w=i?L:L.slice(0,1),M=w.filter(K=>fr(K,o)),F=w.filter(K=>!fr(K,o));F.length>0&&a?.(F),M.length>0&&s(M)},[o,i,s,a]),T=h.useCallback(L=>{N(Array.from(L.target.files??[])),L.target.value=""},[N]),S=h.useCallback(()=>{I.current=0,b(!1)},[]),D=h.useCallback(L=>{l||(L.preventDefault(),I.current+=1,b(!0))},[l]),_=h.useCallback(L=>{l||(L.preventDefault(),L.dataTransfer.dropEffect="copy")},[l]),E=h.useCallback(()=>{l||(I.current-=1,I.current<=0&&S())},[l,S]),A=h.useCallback(L=>{L.preventDefault(),!l&&(S(),N(Array.from(L.dataTransfer?.files??[])))},[l,S,N]);return n.jsxs("div",{className:"flex flex-col gap-1",children:[e&&n.jsx(k.Label,{...e,htmlFor:m}),n.jsx("input",{id:m,type:"file",accept:o,multiple:i,disabled:l,onChange:T,"aria-label":O.resolveAccessibleName(typeof t!="string"?p:void 0),"aria-describedby":C,"aria-invalid":c?!0:void 0,className:"peer sr-only"}),n.jsxs("label",{htmlFor:m,onDragEnter:D,onDragOver:_,onDragLeave:E,onDrop:A,className:y.mergeClasses("flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center","transition-colors motion-reduce:transition-none","peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",l?"cursor-not-allowed border-secondary bg-layer-sunken":"cursor-pointer bg-layer-base",!l&&x&&"border-accent bg-control-accent-alpha",!l&&!x&&"border-secondary hover:border-accent",c&&!x&&"border-error hover:border-error",g,j.DIAL_KIT_CLASS.fileDropzone),children:[d??n.jsx(B.IconUpload,{size:$.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:l?"text-control-disable-primary":"text-secondary"}),n.jsxs("span",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:y.mergeClasses("dial-small-text",l?"text-control-disable-primary":"text-primary"),children:t}),r&&n.jsx("span",{className:y.mergeClasses("dial-tiny-text",l?"text-control-disable-primary":"text-secondary"),children:r})]})]}),n.jsx(Ke,{id:C,text:c})]})},hs=({label:e="Shared",tooltip:t,size:r=12,className:s})=>n.jsx(k.Tooltip,{tooltip:t||"Shared",asChild:!0,children:n.jsx("span",{role:"img","aria-label":e,className:y.mergeClasses("flex shrink-0 rounded-sm bg-layer-raised text-accent",s,j.DIAL_KIT_CLASS.sharedEntityIndicator),children:n.jsx(B.IconArrowUpRight,{size:r,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})});var je=(e=>(e.Images="images",e.Video="video",e.Audio="audio",e.Code="code",e.Text="text",e.Pdf="pdf",e.Spreadsheet="spreadsheet",e.Presentation="presentation",e.Archive="archive",e.Dial="dial",e.Other="other",e))(je||{});const Pd={images:["apng","avif","bmp","gif","heic","heif","ico","jpeg","jpg","png","svg","tif","tiff","webp"],video:["avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"],audio:["aac","aiff","flac","m4a","mid","midi","mp3","oga","ogg","opus","wav","wma"],code:["bash","c","cjs","cpp","cs","css","go","h","hpp","htm","html","ini","ipynb","java","js","json","jsx","kt","less","lua","mjs","php","ps1","py","r","rb","rs","sass","scala","scss","sh","sql","svelte","swift","toml","ts","tsx","vue","xml","yaml","yml","zsh"],text:["doc","docx","log","markdown","md","odt","rtf","text","txt"],pdf:["pdf"],spreadsheet:["csv","numbers","ods","tsv","xls","xlsm","xlsx"],presentation:["key","odp","pps","ppsx","ppt","pptx"],archive:["7z","bz2","gz","rar","tar","tgz","xz","zip"],dial:["dial"]},Fd=new Map(Object.entries(Pd).flatMap(([e,t])=>t.map(r=>[r,e]))),Bd=e=>Fd.get(e)??"other",fn="var(--text-control-permanent, #FCFCFC)",It={x1:"20.4167",y1:"-3.33333",x2:"2.5",y2:"20",from:"var(--bg-visual-blue, #D6EDF9)",to:"var(--stroke-gradient-1, #5976E9)"},zd="#1B212D",$d={[je.Images]:{path:"M11.0002 8.66667H11.0036M7.00024 11.3333L8.66691 9.66667C8.97624 9.369 9.35758 9.369 9.66691 9.66667L11.3336 11.3333M10.6669 10.6667L11.0002 10.3333C11.3096 10.0357 11.6909 10.0357 12.0002 10.3333L13.0002 11.3333M7.00024 8C7.00024 7.73478 7.1056 7.48043 7.29314 7.29289C7.48067 7.10536 7.73503 7 8.00024 7H12.0002C12.2655 7 12.5198 7.10536 12.7074 7.29289C12.8949 7.48043 13.0002 7.73478 13.0002 8V12C13.0002 12.2652 12.8949 12.5196 12.7074 12.7071C12.5198 12.8946 12.2655 13 12.0002 13H8.00024C7.73503 13 7.48067 12.8946 7.29314 12.7071C7.1056 12.5196 7.00024 12.2652 7.00024 12V8Z",sheet:It},[je.Code]:{path:"M8.33358 8.66665L7.00024 9.99998L8.33358 11.3333M11.6669 8.66665L13.0002 9.99998L11.6669 11.3333M10.6669 7.33331L9.33358 12.6666",sheet:{x1:"16.6667",y1:"0",x2:"2.08333",y2:"20.4167",from:"var(--bg-control-inverted, #57647A)",to:zd}},[je.Text]:{path:"M7.3335 8H12.6668M7.3335 10H12.6668M7.3335 12H11.3335",sheet:{x1:"25.8333",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-violet-1, #DDE3F9)",to:"var(--bg-gradient-1, #1D4ED8)"}},[je.Spreadsheet]:{path:"M7.33325 10.1667H12.6666M9.99992 7.5V12.8333M7.33325 8.16667C7.33325 7.98986 7.40349 7.82029 7.52851 7.69526C7.65354 7.57024 7.82311 7.5 7.99992 7.5H11.9999C12.1767 7.5 12.3463 7.57024 12.4713 7.69526C12.5963 7.82029 12.6666 7.98986 12.6666 8.16667V12.1667C12.6666 12.3435 12.5963 12.513 12.4713 12.6381C12.3463 12.7631 12.1767 12.8333 11.9999 12.8333H7.99992C7.82311 12.8333 7.65354 12.7631 7.52851 12.6381C7.40349 12.513 7.33325 12.3435 7.33325 12.1667V8.16667Z",sheet:{x1:"20.4167",y1:"-3.75",x2:"2.91667",y2:"20.4167",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-1, #059669)"}},[je.Pdf]:{fillPath:"M12.5373 10.3151C12.0382 10.3151 11.4137 10.4021 11.2094 10.4328C10.3637 9.54967 10.1231 9.04771 10.069 8.91388C10.1423 8.72544 10.3975 8.0096 10.4338 7.09022C10.4517 6.62991 10.3544 6.28596 10.1447 6.06792C9.93533 5.85024 9.68191 5.83331 9.60924 5.83331C9.35443 5.83331 8.92697 5.96216 8.92697 6.82503C8.92697 7.5737 9.27603 8.36813 9.37252 8.57339C8.86416 10.0536 8.31837 11.0669 8.20248 11.2753C6.15974 12.0444 6 12.788 6 12.9988C6 13.3775 6.26973 13.6036 6.72152 13.6036C7.8192 13.6036 8.8209 11.7607 8.98653 11.4407C9.76614 11.1301 10.8096 10.9377 11.0749 10.8918C11.8357 11.6166 12.7157 11.81 13.0811 11.81C13.3561 11.81 14 11.81 14 11.148C14 10.5332 13.2121 10.3151 12.5373 10.3151ZM12.4844 10.7497C13.0773 10.7497 13.234 10.9458 13.234 11.0494C13.234 11.1145 13.2093 11.3268 12.8915 11.3268C12.6065 11.3268 12.1145 11.1621 11.6303 10.8047C11.8322 10.7782 12.131 10.7497 12.4844 10.7497ZM9.57812 6.25458C9.63218 6.25458 9.66777 6.27195 9.69711 6.31264C9.86764 6.54926 9.73014 7.32242 9.56279 7.92745C9.40124 7.40867 9.28 6.61264 9.45058 6.33259C9.48392 6.27793 9.52204 6.25458 9.57812 6.25458ZM9.29017 10.8856C9.50483 10.452 9.74542 9.81997 9.87646 9.46253C10.1387 9.90147 10.4914 10.309 10.6954 10.53C10.0603 10.6639 9.57969 10.7976 9.29017 10.8856ZM6.4264 13.0566C6.41226 13.0399 6.41017 13.0045 6.42083 12.9621C6.44317 12.8731 6.61396 12.4322 7.84924 11.8796C7.67236 12.1582 7.39585 12.5563 7.09208 12.8537C6.87825 13.0538 6.71174 13.1553 6.59719 13.1553C6.55621 13.1553 6.49974 13.1442 6.4264 13.0566Z",sheet:{x1:"26.25",y1:"-11.6667",x2:"2.5",y2:"20",from:"var(--bg-visual-red, #FCE7F3)",to:"var(--bg-control-error-active, #CC4545)"}},[je.Audio]:{path:"M9 11.5C9 11.7652 8.89464 12.0195 8.70711 12.2071C8.51957 12.3946 8.26522 12.5 8 12.5C7.73478 12.5 7.48043 12.3946 7.29289 12.2071C7.10536 12.0195 7 11.7652 7 11.5C7 11.2347 7.10536 10.9804 7.29289 10.7929C7.48043 10.6053 7.73478 10.5 8 10.5C8.26522 10.5 8.51957 10.6053 8.70711 10.7929C8.89464 10.9804 9 11.2347 9 11.5ZM9 11.5V7.16663H12.3333V11.5M12.3333 11.5C12.3333 11.7652 12.228 12.0195 12.0404 12.2071C11.8529 12.3946 11.5985 12.5 11.3333 12.5C11.0681 12.5 10.8138 12.3946 10.6262 12.2071C10.4387 12.0195 10.3333 11.7652 10.3333 11.5C10.3333 11.2347 10.4387 10.9804 10.6262 10.7929C10.8138 10.6053 11.0681 10.5 11.3333 10.5C11.5985 10.5 11.8529 10.6053 12.0404 10.7929C12.228 10.9804 12.3333 11.2347 12.3333 11.5ZM9 8.49996H12.3333",sheet:It},[je.Video]:{path:"M9.99996 13.1667C11.8409 13.1667 13.3333 11.6743 13.3333 9.83333C13.3333 7.99238 11.8409 6.5 9.99996 6.5C8.15901 6.5 6.66663 7.99238 6.66663 9.83333C6.66663 11.6743 8.15901 13.1667 9.99996 13.1667ZM9.33337 8.5L11.3334 9.83333L9.33337 11.1667V8.5Z",sheet:It},[je.Presentation]:{path:"M7 7.33331H13M7.33333 7.33331V10.6666C7.33333 10.8435 7.40357 11.013 7.5286 11.1381C7.65362 11.2631 7.82319 11.3333 8 11.3333H12C12.1768 11.3333 12.3464 11.2631 12.4714 11.1381C12.5964 11.013 12.6667 10.8435 12.6667 10.6666V7.33331M10 11.3333V12.6666M9 12.6666H11M8.66667 9.99998L9.66667 8.99998L10.3333 9.66665L11.3333 8.66665",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-brown, #FDE8D8)",to:"var(--text-visual-brown-2, #B45309)"}},[je.Archive]:{path:"M10.0001 6.66669H9.58341M10.8334 7.451H10.4167M10.0001 8.23531H9.58341M10.8334 9.01963H10.4167M10.0001 9.80394H9.58341M10.8334 10.5883H10.4167M10.0001 11.3726C10.2211 11.3726 10.4331 11.4552 10.5893 11.6023C10.7456 11.7494 10.8334 11.9489 10.8334 12.1569V12.9412C10.8334 13.0452 10.7895 13.1449 10.7114 13.2185C10.6332 13.292 10.5273 13.3334 10.4167 13.3334H9.58341C9.47291 13.3334 9.36693 13.292 9.28879 13.2185C9.21065 13.1449 9.16675 13.0452 9.16675 12.9412V12.1569C9.16675 11.9489 9.25455 11.7494 9.41083 11.6023C9.56711 11.4552 9.77907 11.3726 10.0001 11.3726Z",sheet:{x1:"24.5",y1:"-9.5",x2:"2.5",y2:"20",from:"var(--bg-visual-green-1, #CDE8E5)",to:"var(--text-visual-green-3, #065F46)"}},[je.Dial]:{path:"M8.26392 7.44049C8.80816 7.44049 9.28449 7.50578 9.69653 7.63092L9.69849 7.6319C10.1079 7.75343 10.4556 7.938 10.7463 8.1817L10.7483 8.18365C11.0312 8.41601 11.2537 8.72491 11.4104 9.12115V9.12213C11.5666 9.51456 11.6496 9.98403 11.6497 10.5381C11.6497 11.5957 11.3539 12.3492 10.8108 12.8565C10.2602 13.3708 9.47204 13.6504 8.39868 13.6505H6.71313V7.44049H8.26392Z",fillPath:"M12.7167 12.1008L12.9558 12.3564L12.9558 12.3564L12.7167 12.1008ZM11.4504 6.20825L11.3486 6.54311L11.3507 6.54375L11.4504 6.20825ZM12.637 6.833L12.4119 7.10109L12.4147 7.10334L12.637 6.833ZM13.4108 7.9263L13.0853 8.05488L13.0856 8.05566L13.4108 7.9263ZM11.1666 12.8853L11.0909 12.5436V12.5436L11.1666 12.8853ZM10.4391 12.6553C10.2487 12.689 10.1217 12.8706 10.1553 13.0609C10.189 13.2513 10.3706 13.3783 10.5609 13.3447L10.5 13L10.4391 12.6553ZM13.6781 9.49291H13.3281C13.3281 10.5655 13.0283 11.33 12.4776 11.8451L12.7167 12.1008L12.9558 12.3564C13.687 11.6724 14.0281 10.6984 14.0281 9.49291H13.6781ZM7.9751 6.12805H8.3251C8.3251 6.24476 8.23053 6.35 8.1009 6.35V6V5.65C7.83231 5.65 7.6251 5.86989 7.6251 6.12805H7.9751ZM8.1009 6V6.35H9.89799V6V5.65H8.1009V6ZM9.89799 6V6.35C10.449 6.35 10.9312 6.41618 11.3486 6.54311L11.4504 6.20825L11.5522 5.87339C11.0566 5.72265 10.5039 5.65 9.89799 5.65V6ZM11.4504 6.20825L11.3507 6.54375C11.7654 6.66701 12.1173 6.85376 12.4119 7.10107L12.637 6.833L12.862 6.56492C12.4875 6.2506 12.0484 6.02084 11.5501 5.87275L11.4504 6.20825ZM12.637 6.833L12.4147 7.10334C12.7016 7.33926 12.9264 7.65273 13.0853 8.05488L13.4108 7.9263L13.7363 7.79772C13.5387 7.29746 13.2477 6.88206 12.8593 6.56265L12.637 6.833ZM13.4108 7.9263L13.0856 8.05566C13.2441 8.45409 13.3281 8.93071 13.3281 9.49291H13.6781H14.0281C14.0281 8.86239 13.934 8.29465 13.736 7.79694L13.4108 7.9263ZM7.9751 7.21882H8.3251V6.12805H7.9751H7.6251V7.21882H7.9751ZM12.7167 12.1008L12.4776 11.8451C12.117 12.1824 11.6591 12.4177 11.0909 12.5436L11.1666 12.8853L11.2423 13.227C11.9168 13.0776 12.4923 12.7898 12.9558 12.3564L12.7167 12.1008ZM11.1666 12.8853L11.0909 12.5436C11.091 12.5435 11.0826 12.5452 11.0606 12.5493C11.041 12.5528 11.0155 12.5573 10.9857 12.5625C10.926 12.5729 10.8511 12.5857 10.7756 12.5984C10.6269 12.6236 10.472 12.6495 10.4391 12.6553L10.5 13L10.5609 13.3447C10.6064 13.3366 11.1725 13.2425 11.2423 13.227L11.1666 12.8853Z",sheet:"var(--bg-gradient-2, #885DF2)"},[je.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:It}},Hd=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${h.useId().replace(/[^\w-]/g,"")}`,{path:s,fillPath:a,sheet:o}=$d[t],i=typeof o=="string";return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M17.4999 3.97859V16C17.4999 18.2091 15.709 20 13.4999 20H6.5C4.29086 20 2.5 18.2091 2.5 16V4C2.5 1.79086 4.29086 0 6.5 0H13.1683H13.5213C15.7186 0 17.4999 1.78128 17.4999 3.97859Z",fill:i?o:`url(#${r})`}),s&&n.jsx("path",{d:s,stroke:fn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&n.jsx("path",{d:a,fill:fn}),!i&&n.jsx("defs",{children:n.jsxs("linearGradient",{id:r,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:o.from}),n.jsx("stop",{offset:"1",stopColor:o.to})]})})]})},Vd=({size:e})=>{const t=`dial-kit-folder-gradient-${h.useId().replace(/[^\w-]/g,"")}`;return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[n.jsx("path",{d:"M6.38992 3.75H4.66663C3.00977 3.75 1.66663 5.09315 1.66663 6.75V7.91667H7.16339L10.8333 5.79247L7.85075 4.1297C7.40412 3.8807 6.90127 3.75 6.38992 3.75Z",fill:"var(--stroke-gradient-1, #5976E9)"}),n.jsx("path",{d:"M14.3333 5.41669C16.5424 5.41669 18.3333 7.20755 18.3333 9.41669V12.25C18.3333 14.4592 16.5424 16.25 14.3333 16.25H5.66663C3.45749 16.25 1.66663 14.4592 1.66663 12.25V7.6708C1.66663 7.11851 2.11434 6.6708 2.66663 6.6708H6.89447C7.43998 6.6708 7.97973 6.55922 8.48053 6.34291L9.86582 5.74458C10.3666 5.52827 10.9064 5.41669 11.4519 5.41669H14.3333Z",fill:`url(#${t})`}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"17.0833",y1:"5.83335",x2:"9.38489",y2:"19.6653",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"var(--stroke-secondary, #D1DBEA)"}),n.jsx("stop",{offset:"0.91",stopColor:"var(--stroke-gradient-1, #5976E9)"})]})})]})},Kd=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Gd=(e,t)=>e===v.DialItemType.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Ud=(e,t,r)=>e===v.DialItemType.Folder?n.jsx(Vd,{size:r}):n.jsx(Hd,{size:r,kind:Bd(t)}),Or=({type:e,name:t,fileExtension:r,shared:s=!1,loading:a=!1,size:o=$.DIAL_ICON_SIZE.MD,className:i,decorative:l=!1,label:c,loadingLabel:d="Loading",sharedIndicatorClassName:f,sharedIndicatorTooltip:p})=>{if(e!==v.DialItemType.File&&e!==v.DialItemType.Folder)return null;const g=e===v.DialItemType.File?Kd(t,r):"",u=Gd(e,g),m=c??(s?`${u}, shared`:u),C=l?{"aria-hidden":!0}:a?{}:{role:"img","aria-label":m};return n.jsxs("span",{className:y.mergeClasses("relative inline-flex shrink-0 items-center justify-center text-secondary",i,j.DIAL_KIT_CLASS.fileIcon),...C,children:[a?n.jsx(v.Spinner,{size:o,ariaLabel:d}):Ud(e,g,o),s&&n.jsx(hs,{tooltip:p,className:y.mergeClasses("absolute -bottom-0.5 -left-0.5",f)})]})},ms=({name:e,type:t=v.DialItemType.File,fileExtension:r,shared:s=!1,loading:a=!1,loadingLabel:o,iconSize:i,details:l,isInvalidName:c=!1,className:d,nameClassName:f,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,sharedLabel:u="Shared",hideTooltip:m=!1,tooltipContent:C})=>n.jsxs("div",{className:y.mergeClasses("flex w-full min-w-0 items-center gap-2",d,j.DIAL_KIT_CLASS.fileName),children:[n.jsx(Or,{name:e,type:t,fileExtension:r,shared:s,loading:a,loadingLabel:o,size:i,sharedIndicatorClassName:p,sharedIndicatorTooltip:g,decorative:!a}),n.jsxs("div",{className:y.mergeClasses("flex min-w-0 flex-1",{"flex-col gap-1":!!l}),children:[n.jsx(k.EllipsisTooltip,{className:y.mergeClasses("dial-small-paragraph-text",c?"text-secondary":"text-primary",f),text:e,hideTooltip:m,customTooltipContent:C}),s&&n.jsx("span",{className:"sr-only",children:u}),l]})]}),Zd=({className:e,...t})=>n.jsx(ms,{...t,type:v.DialItemType.Folder,className:y.mergeClasses(e,j.DIAL_KIT_CLASS.folderName)}),Wd=({open:e,onClose:t,title:r,ariaLabel:s,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:c,className:d,overlayClassName:f,headerClassName:p,style:g,overlayStyle:u,bodyClassName:m,titleClassName:C,portalId:x})=>{const b=j.useThemeScope(),I=`bottom-sheet-title-${h.useId()}`,{refs:N,context:T}=ee.useFloating({open:e,onOpenChange:E=>{E||t()}}),S=ee.useRole(T,{role:"dialog"}),D=ee.useDismiss(T,{outsidePress:l}),{getFloatingProps:_}=ee.useInteractions([S,D]);return e?n.jsx(ee.FloatingPortal,{id:x,children:n.jsx(ee.FloatingOverlay,{lockScroll:!0,style:u,className:y.mergeClasses("z-popup flex items-end bg-backdrop",b,f),children:n.jsx(ee.FloatingFocusManager,{context:T,initialFocus:N.floating,children:n.jsxs("div",{ref:N.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":r?I:void 0,"aria-label":r?void 0:s,style:g,className:y.mergeClasses("flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-none","animate-slideUp motion-reduce:animate-none",d,j.DIAL_KIT_CLASS.bottomSheet),children:[r&&n.jsxs("div",{className:y.mergeClasses("relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",p),children:[a&&n.jsx(k.GhostIconButton,{"aria-label":o,className:"absolute start-4",onClick:a,icon:n.jsx(B.IconArrowLeft,{size:$.DIAL_ICON_SIZE.LG,stroke:ie.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),n.jsx("h2",{id:I,className:y.mergeClasses("min-w-0 truncate text-primary",C??"dial-body-semi-text"),children:r}),n.jsx(k.CloseButton,{ariaLabel:i,onClose:t,size:O.ElementSize.Standard,className:"absolute end-4"})]}),n.jsx("div",{className:y.mergeClasses("min-h-0 overflow-y-auto",m),children:c})]})})})}):null};var He=(e=>(e.Outlined="outlined",e.Filled="filled",e))(He||{}),Re=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(Re||{});const qd={[Re.Blue]:"bg-blue text-blue",[Re.Green]:"bg-green-2 text-green-1",[Re.Violet]:"bg-violet-2 text-violet-1",[Re.Indigo]:"bg-violet-1 text-violet-2",[Re.Brown]:"bg-brown text-brown-2",[Re.Red]:"bg-red text-red"},Yd={[He.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[He.Filled]:"rounded-full"},Xd={[He.Outlined]:"dial-tiny-text",[He.Filled]:"dial-caption-lead-semi-text"},Qd=({label:e,variant:t=He.Outlined,color:r=Re.Blue,icon:s,textClassName:a,className:o,...i})=>n.jsxs("span",{...i,className:y.mergeClasses("inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",Yd[t],t===He.Filled&&qd[r],o,j.DIAL_KIT_CLASS.badge),children:[s&&n.jsx("span",{className:"flex shrink-0 items-center","aria-hidden":"true",children:s}),n.jsx("span",{className:a??Xd[t],children:e})]});var at=(e=>(e.Circle="circle",e.Square="square",e))(at||{});const pn=[{background:"bg-green-1",foreground:"text-green-2"},{background:"bg-violet-2",foreground:"text-violet-1"},{background:"bg-brown",foreground:"text-brown-2"},{background:"bg-red",foreground:"text-red"},{background:"bg-green-2",foreground:"text-green-3"},{background:"bg-blue",foreground:"text-accent"},{background:"bg-violet-1",foreground:"text-violet-2"}],Jd=e=>{let t=0;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r);return pn[t%pn.length]},gn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",xs=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(gn(t[0])+gn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},eu={[at.Circle]:"rounded-full",[at.Square]:"rounded-md"},bs=({name:e,initials:t,src:r,alt:s="",size:a=32,shape:o=at.Circle,className:i,textClassName:l,onImageError:c})=>{const[d,f]=h.useState(),p=!!r&&d!==r,g=s!=="",u=x=>y.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",eu[o],x,i,j.DIAL_KIT_CLASS.avatar);if(p)return n.jsx("img",{src:r,alt:s,width:a,height:a,className:y.mergeClasses(u(),"object-cover"),onError:x=>{f(r),c?.(x)}});const{background:m,foreground:C}=Jd(e);return n.jsx("span",{role:g?"img":void 0,"aria-label":g?s:void 0,"aria-hidden":g?void 0:!0,className:u(y.mergeClasses(m,C)),style:{width:a,height:a,fontSize:l?void 0:Math.round(a*.4)},children:n.jsx("span",{className:y.mergeClasses("leading-none",l??"font-semibold"),children:t??xs(e)})})};var he=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(he||{});const tu={[he.Model]:"Model",[he.Agent]:"Agent",[he.Toolset]:"Toolset",[he.Skill]:"Skill",[he.Prompt]:"Prompt"},hn={[he.Model]:"text-blue",[he.Agent]:"text-green-1",[he.Toolset]:"text-brown-2",[he.Skill]:"text-violet-1",[he.Prompt]:"text-violet-2"},ru={[he.Model]:"bg-blue",[he.Agent]:"bg-green-2",[he.Toolset]:"bg-brown",[he.Skill]:"bg-violet-2",[he.Prompt]:"bg-violet-1"},nu=["h1","h2","h3","h4","h5","h6"],su=e=>nu[Math.min(6,Math.max(1,Math.round(e)))-1],au=({item:e,labels:t,showVersion:r=!0,hasFeaturedTag:s=!0,iconSize:a=48,headingLevel:o=3,query:i,footer:l,statusBadge:c,className:d,nameClassName:f="dial-h3-text",typeClassName:p="dial-caption-lead-semi-text",versionClassName:g="dial-tiny-text",iconClassName:u,featuredChipClassName:m})=>{const C=su(o),x=s&&!!e.isFeatured,b=c!=null||x,I=r?e.version:void 0;return n.jsxs("div",{className:y.mergeClasses("flex items-start gap-2",d,j.DIAL_KIT_CLASS.entityIdentity),children:[n.jsx(bs,{name:e.name,src:e.iconUrl,size:a,shape:at.Square,className:y.mergeClasses("rounded-[14px]",u)}),n.jsxs("div",{className:y.mergeClasses("flex min-w-0 flex-1 flex-col gap-1",l!=null&&"self-stretch"),children:[n.jsxs("div",{className:"relative flex items-center justify-between",children:[n.jsx("span",{className:y.mergeClasses("uppercase",p,hn[e.type]),children:t?.type??tu[e.type]}),b&&n.jsxs("div",{className:"absolute end-0 top-[-6px] flex items-center gap-2",children:[c,x&&n.jsx("span",{className:y.mergeClasses("flex h-6 items-center justify-center rounded-2xl px-2","dial-caption-lead-semi-text",ru[e.type],hn[e.type],m),children:t?.featured??"Featured"})]})]}),n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx(C,{className:y.mergeClasses("min-w-0 shrink text-primary",f),children:i?n.jsx(Jn,{text:e.name,query:i,maxLines:1}):n.jsx(k.EllipsisTooltip,{text:e.name})}),I!=null&&n.jsx(k.EllipsisTooltip,{className:y.mergeClasses("max-w-[30%] shrink-0 text-secondary",g),text:I})]}),l!=null&&n.jsx("div",{className:"mt-auto pt-1",children:l})]})]})},ou=({open:e,onClose:t,header:r,ariaLabel:s,headerActions:a,onBack:o,backAriaLabel:i="Back",backDisabled:l=!1,closeAriaLabel:c="Close",closeDisabled:d=!1,hideClose:f=!1,closeOnOutsideClick:p=!0,children:g,className:u,overlayClassName:m,headerClassName:C,style:x,overlayStyle:b,bodyClassName:I,titleClassName:N,portalId:T})=>{const S=j.useThemeScope(),D=`side-drawer-title-${h.useId()}`,_=typeof r=="string",{refs:E,context:A}=ee.useFloating({open:e,onOpenChange:K=>{K||t()}}),L=ee.useRole(A,{role:"dialog"}),w=ee.useDismiss(A,{outsidePress:p}),{getFloatingProps:M}=ee.useInteractions([L,w]),F=r!=null||o!=null||!f;return n.jsx(ee.FloatingPortal,{id:T,children:n.jsx(ee.FloatingOverlay,{lockScroll:e,style:b,className:y.mergeClasses("z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0",S,m),children:n.jsx(ee.FloatingFocusManager,{context:A,disabled:!e,initialFocus:E.floating,children:n.jsxs("div",{ref:E.setFloating,...M(),role:"dialog","aria-modal":"true","aria-labelledby":_?D:void 0,"aria-label":_?void 0:s,inert:!e,style:x,className:y.mergeClasses("fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-none","desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary","transition-transform duration-300 motion-reduce:transition-none",e?"translate-x-0":"translate-x-full rtl:-translate-x-full",u,j.DIAL_KIT_CLASS.sideDrawer),children:[F&&n.jsxs("div",{className:y.mergeClasses("flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",C),children:[o&&n.jsx(k.GhostIconButton,{"aria-label":i,disabled:l,onClick:o,icon:n.jsx(B.IconChevronLeft,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,className:"rtl:-scale-x-100","aria-hidden":"true"})}),_?n.jsx("h2",{id:D,className:y.mergeClasses("min-w-0 flex-1 truncate text-primary",N??"dial-h2-text"),children:r}):n.jsx("div",{className:"min-w-0 flex-1",children:r}),a,!f&&n.jsx(k.CloseButton,{ariaLabel:c,onClose:t,disabled:d,size:O.ElementSize.Standard})]}),n.jsx("div",{className:y.mergeClasses("min-h-0 flex-1 overflow-y-auto",I),children:g})]})})})})},iu=4,lu=24,mn=e=>parseFloat(e)||0,cu=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},du=()=>{},uu=({id:e,value:t,defaultValue:r,size:s=O.ElementSize.Standard,labelProps:a,placeholder:o,caption:i,error:l,invalid:c,disabled:d=!1,readOnly:f=!1,collapseTagOverflow:p=!1,ariaLabel:g,tagListLabel:u="Tags",className:m,fieldClassName:C,tagClassName:x,onChange:b})=>{const I=h.useId(),N=e||I,T=s===O.ElementSize.Small,S=h.useRef(null),D=h.useRef([]),_=h.useRef(null),E=t!==void 0,[A,L]=h.useState(r??[]),w=E?t:A,M=w.length,[F,K]=h.useState(""),[te,G]=h.useState(M),z=!f&&!d,H=h.useCallback(W=>{E||L(W),b?.(W)},[E,b]),q=h.useCallback(W=>Q=>{D.current[W]=Q},[]),U=h.useCallback(()=>{const W=S.current;if(!W||W.clientWidth===0){G(w.length);return}const{paddingLeft:Q,paddingRight:we}=getComputedStyle(W);G(us({availableWidth:W.clientWidth-mn(Q)-mn(we)-(f?0:lu),tagWidths:w.map((ke,X)=>D.current[X]?.offsetWidth??0),overflowChipWidth:_.current?.offsetWidth??0,gap:iu}))},[f,w]);h.useEffect(()=>{if(!p){G(M);return}const W=S.current;if(!W)return;const Q=new ResizeObserver(()=>U());return Q.observe(W),U(),()=>Q.disconnect()},[p,U,M]);const ae=y.mergeClasses(p?"shrink-0":"min-w-0",x),Y=W=>{const Q=cu(W.trim()).trim();!Q||w.includes(Q)||H([...w,Q])},Z=W=>{H(w.filter(Q=>Q!==W))},re=()=>{Y(F),K("")},oe=W=>{if(z){if(W.key==="Enter"||W.key===","){W.preventDefault(),re();return}W.key==="Backspace"&&!F&&M>0&&(W.preventDefault(),H(w.slice(0,-1)))}},le=()=>{z&&F.trim()&&re()},ue=p?w.slice(0,te):w,me=p?w.slice(te):[],Ce=me.join(", "),ge=M>0&&n.jsxs("span",{role:"list","aria-label":u,className:y.mergeClasses("relative flex min-w-0 items-center gap-1",p?"flex-nowrap":"flex-wrap"),children:[ue.map(W=>n.jsx(Ae,{role:"listitem",label:W,className:ae,disabled:d,closable:z,onRemove:z?()=>Z(W):void 0},W)),me.length>0&&n.jsx(Ae,{role:"listitem",label:`+${me.length}`,"aria-label":Ce,title:Ce,className:y.mergeClasses("shrink-0",x),disabled:d}),p&&n.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[w.map((W,Q)=>n.jsx("span",{ref:q(Q),className:"inline-flex",children:n.jsx(Ae,{label:W,className:x,disabled:d,closable:z,onRemove:z?du:void 0})},W)),n.jsx("span",{ref:_,className:"inline-flex",children:n.jsx(Ae,{label:`+${M}`,className:x})})]})]});return n.jsx($e,{id:N,size:s,labelProps:a,caption:i,error:l,invalid:c,disabled:d,readOnly:f,value:F,placeholder:M>0?void 0:o,"aria-label":g,wrapperRef:S,onChange:W=>K(W??""),onKeyDown:oe,onBlur:le,containerClassName:y.mergeClasses("w-full",m),wrapperClassName:y.mergeClasses(M>0&&["!h-auto",T?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",p?"flex-nowrap overflow-hidden":"flex-wrap"],C,j.DIAL_KIT_CLASS.tagInput),className:y.mergeClasses("w-auto flex-1",p?"min-w-[24px]":"min-w-[100px]",f&&"cursor-default"),children:ge})},fu=(e,t,r,s)=>{const a=t.trim().toLowerCase(),o=new Set(r);return e.filter(({value:i,label:l,description:c})=>!o.has(i)&&[l,i,c].some(d=>d?.toLowerCase().includes(a))).slice(0,Math.max(s,0))},pu=5,gu=({id:e,value:t,defaultValue:r,suggestions:s,maxSuggestions:a=pu,size:o=O.ElementSize.Standard,labelProps:i,placeholder:l,caption:c,error:d,invalid:f=!1,disabled:p=!1,readOnly:g=!1,ariaLabel:u,tagListLabel:m="Tags",getRemoveTagLabel:C,className:x,fieldClassName:b,tagClassName:I,listClassName:N,onChange:T})=>{const S=h.useId(),D=e||S,_=`${D}-listbox`,E=j.useThemeScope(),A=o===O.ElementSize.Small,L=t!==void 0,[w,M]=h.useState(r??[]),F=L?t:w,K=F.length>0,te=!g&&!p,[G,z]=h.useState(""),[H,q]=h.useState(!1),[U,ae]=h.useState(0),Y=h.useMemo(()=>fu(s,G,F,a),[G,a,s,F]),Z=H&&te&&Y.length>0,re=Math.min(U,Y.length-1),oe=X=>`${_}-option-${X}`,{refs:le,floatingStyles:ue}=ee.useFloating({open:Z,placement:"bottom-start",whileElementsMounted:ee.autoUpdate,middleware:[ee.offset(k.overlayGap),ee.flip({padding:k.overlayGap}),ee.size({padding:k.overlayGap,apply({rects:X,availableHeight:de,elements:Ee}){Ee.floating.style.width=`${Math.round(X.reference.width)}px`,Ee.floating.style.maxHeight=`${Math.floor(de)}px`}})]}),me=h.useCallback(X=>{L||M(X),T?.(X)},[L,T]),Ce=()=>{q(!1),ae(0)},ge=X=>{const de=X.trim();de&&!F.includes(de)&&me([...F,de]),z(""),Ce()},W=X=>me(F.filter(de=>de!==X)),Q=X=>{const de=X??"";z(de),q(!!de.trim()),ae(0)},we=X=>{if(te)switch(X.key){case"ArrowDown":case"ArrowUp":{if(X.preventDefault(),q(!0),!Z)return;const de=X.key==="ArrowDown"?1:-1;ae((re+de+Y.length)%Y.length);return}case"Enter":case",":X.preventDefault(),ge(Z?Y[re].value:G);return;case"Escape":Z&&X.preventDefault(),Ce();return;case"Backspace":!G&&K&&(X.preventDefault(),me(F.slice(0,-1)));return}},ke=X=>X.preventDefault();return n.jsxs(n.Fragment,{children:[n.jsx($e,{id:D,role:"combobox","aria-autocomplete":"list","aria-expanded":Z,"aria-controls":_,"aria-activedescendant":Z?oe(re):void 0,"aria-invalid":f||void 0,"aria-label":u,size:o,labelProps:i,caption:c,error:d,invalid:f,disabled:p,readOnly:g,value:G,placeholder:K?void 0:l,wrapperRef:le.setReference,onChange:Q,onKeyDown:we,onBlur:Ce,containerClassName:y.mergeClasses("w-full",x),wrapperClassName:y.mergeClasses(K&&["!h-auto flex-wrap gap-1 py-2",A?"min-h-[24px]":"min-h-[40px]"],b,j.DIAL_KIT_CLASS.autocompleteTagInput),className:y.mergeClasses("w-auto min-w-[100px] flex-1",g&&"cursor-default"),children:K&&n.jsx("span",{role:"list","aria-label":m,className:"flex min-w-0 flex-wrap items-center gap-1",children:F.map(X=>n.jsx(Ae,{role:"listitem",label:X,className:y.mergeClasses(At,"min-w-0",I),disabled:p,closable:te,removeLabel:C?.(X),onRemove:te?()=>W(X):void 0},X))})}),n.jsx(ee.FloatingPortal,{children:n.jsx("div",{ref:le.setFloating,id:_,role:"listbox","aria-label":m,hidden:!Z,style:ue,className:y.mergeClasses("z-floating overflow-y-auto",k.overlaySurfaceClassName,k.overlayListClassName,E,N),children:Z&&Y.map((X,de)=>{const Ee=de===re;return n.jsx(k.MenuItem,{id:oe(de),role:"option","aria-selected":Ee,tabIndex:-1,label:X.label,description:X.description,mark:k.MenuItemMark.Tint,selected:Ee,onMouseDown:ke,onMouseEnter:()=>ae(de),onClick:()=>ge(X.value)},X.value)})})})]})},hu={[O.ElementSize.Small]:$.DIAL_ICON_SIZE.SM,[O.ElementSize.Standard]:$.DIAL_ICON_SIZE.MD,[O.ElementSize.Large]:$.DIAL_ICON_SIZE.MD},mu=({size:e=O.ElementSize.Standard,placeholder:t="Search...",withoutBorder:r=!1,clearLabel:s="Clear search",disabled:a,value:o,onChange:i,wrapperClassName:l,inputRef:c,...d})=>{const f=h.useRef(null),p=ee.useMergeRefs([c,f]),g=!!o&&!a,u=h.useCallback(()=>{i?.(void 0),f.current?.focus()},[i]);return n.jsx($e,{...d,size:e,value:o,disabled:a,onChange:i,placeholder:t,inputRef:p,wrapperClassName:y.mergeClasses(r&&"dial-kit-input-borderless",l,j.DIAL_KIT_CLASS.search),iconBefore:n.jsx(B.IconSearch,{size:hu[e],stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":"true"}),iconAfter:g?n.jsx(k.GhostIconButton,{size:O.ElementSize.Small,"aria-label":s,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:u}):void 0})},xu=16,bu=e=>(e.toString().split(".")[1]??"").length,Cu=({id:e,value:t,min:r=0,max:s=1,step:a=.1,disabled:o,labelProps:i,labels:l,formatValue:c,showValue:d=!1,caption:f,error:p,onChange:g,containerClassName:u,trackClassName:m,fillClassName:C,className:x,...b})=>{const I=h.useId(),N=e??I,T=f&&!p?`${N}-caption`:void 0,S=p?`${N}-error`:void 0,D=s-r,_=D>0?Math.min(100,Math.max(0,(t-r)/D*100)):0,E=`calc(${_}% + ${(.5-_/100)*xu}px)`,A=c?c(t):t.toFixed(bu(a)),L=h.useCallback(w=>{g?.(Number(w.target.value))},[g]);return n.jsxs("div",{className:y.mergeClasses("flex flex-col gap-2",u),children:[(i||d)&&n.jsxs("div",{className:"flex items-center gap-2",children:[i&&n.jsx(k.Label,{...i,htmlFor:N}),d&&n.jsx("span",{"aria-hidden":"true",className:y.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:A})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"relative flex h-6 items-center",children:[n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute inset-x-0 h-1 rounded-full",o?"bg-control-disable-primary":"bg-control-neutral-active",m)}),n.jsx("div",{className:y.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",C),style:{width:E}}),n.jsx("input",{...b,type:"range",id:N,value:t,min:r,max:s,step:a,disabled:o,onChange:L,"aria-label":O.resolveAccessibleName(typeof i?.label!="string"?b["aria-label"]:void 0),"aria-valuetext":c?A:void 0,"aria-describedby":S??T,className:y.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",x)})]}),l&&n.jsx("div",{className:"dial-tiny-text flex text-secondary",children:l.length===3?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"flex-1 text-center",children:l[1]}),n.jsx("span",{children:l[2]})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:l[0]}),n.jsx("span",{className:"ml-auto",children:l[1]})]})}),n.jsx(Ke,{id:S,text:p}),!p&&n.jsx(Ve,{id:T,text:f})]})]})},vu=48,yu=({children:e,title:t,width:r=280,collapsedWidth:s=vu,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:c="Sidebar",collapseLabel:d="Collapse sidebar",expandLabel:f="Expand sidebar",className:p,titleClassName:g,contentClassName:u,footerClassName:m})=>{const C=a!==void 0,[x,b]=h.useState(o),I=C?a:x,N=`collapsible-sidebar-content-${h.useId()}`,T=I?d:f,S=D=>{const _=!I;C||b(_),i?.(_,D)};return n.jsxs("aside",{"aria-label":c,style:{width:`${I?r:s}px`},className:y.mergeClasses("flex flex-col justify-between",p,j.DIAL_KIT_CLASS.collapsibleSidebar),children:[n.jsx("div",{id:N,hidden:!I,className:y.mergeClasses("min-h-0 flex-1 overflow-auto p-4",u),children:e}),n.jsx("div",{hidden:I,className:y.mergeClasses("rotate-180 px-3 py-4 [writing-mode:tb-rl] dial-small-text text-primary",g),children:t}),n.jsxs("div",{className:y.mergeClasses("flex h-12 shrink-0 flex-row items-center gap-2 border-t border-tertiary py-1",I?"justify-end px-2":"justify-center",m),children:[I&&l,n.jsx(k.IconButton,{variant:O.ButtonVariant.Primary,appearance:O.ButtonAppearance.Ghost,size:O.ElementSize.Standard,onClick:S,"aria-label":T,"aria-expanded":I,"aria-controls":N,tooltipProps:{tooltip:T},icon:I?n.jsx(B.IconChevronsLeft,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}):n.jsx(B.IconChevronsRight,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})]})]})},Iu=({side:e,isResizing:t,width:r,minWidth:s,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:c,handlerClassName:d})=>{const f=e===v.ResizableContainerSide.Left,p=f?B.IconChevronLeft:B.IconChevronRight,g=u=>{let m;switch(u.key){case"ArrowLeft":m=r+(f?o:-o);break;case"ArrowRight":m=r+(f?-o:o);break;case"Home":m=s;break;case"End":m=a;break;default:return}u.preventDefault(),l(m)};return n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":i,"aria-valuenow":r,"aria-valuemin":s,"aria-valuemax":a,tabIndex:0,onKeyDown:g,className:y.mergeClasses("relative h-full w-0.5 cursor-col-resize bg-control-accent text-accent","opacity-0 transition-opacity motion-reduce:transition-none","group-hover:opacity-100 focus-visible:opacity-100","focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",t&&"opacity-100",d),children:c??n.jsx(p,{size:$.DIAL_ICON_SIZE.MD,stroke:ie.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:y.mergeClasses("pointer-events-none absolute top-1/2 -translate-y-1/2",f?"right-full":"left-full")})})},Su=16,Cs=({children:e,minWidth:t,maxWidth:r,width:s,defaultWidth:a,onResizeStop:o,onResize:i,side:l=v.ResizableContainerSide.Right,keyboardStep:c=Su,ariaLabel:d="Resize panel",className:f,resizeHandlerClassName:p,resizeHandler:g})=>{const[u,m]=h.useState(!1),[C,x]=h.useState(a??t),b=s!==void 0,I=b?s:C,N=h.useRef(null),T=h.useCallback(()=>{m(!0)},[]),S=h.useCallback(()=>{m(!1);const E=N.current?.resizable?.getBoundingClientRect(),A=E?Math.round(E.width):t;b||x(A),o?.(A)},[o,b,t]),D=h.useCallback(E=>{const A=Math.min(r,Math.max(t,E));A!==I&&(b||(x(A),N.current?.updateSize({width:A,height:"100%"})),i?.(A),o?.(A))},[r,t,I,b,i,o]),_=h.useMemo(()=>{const E=l===v.ResizableContainerSide.Left,A=n.jsx(Iu,{side:l,isResizing:u,width:I,minWidth:t,maxWidth:r,step:c,ariaLabel:d,onWidthChange:D,customHandler:g,handlerClassName:p});return{size:b?{width:I,height:"100%"}:void 0,defaultSize:b?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:E,right:!E},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:E?A:void 0,right:E?void 0:A},onResizeStart:T,onResize:(L,w,M)=>{i?.(Math.round(M.offsetWidth))},onResizeStop:S}},[l,b,I,t,r,c,d,D,g,p,u,T,S,i]);return n.jsx(v.Resizable,{ref:N,..._,children:n.jsx("div",{className:y.mergeClasses("group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",f,j.DIAL_KIT_CLASS.resizableContainer),children:e})})},Du=({enabled:e=!0,children:t,...r})=>e?n.jsx(Cs,{...r,children:t}):t;var Oe=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(Oe||{});const vs=8e3,xt="flex size-7 shrink-0 items-center justify-center",ys={cancelItemAriaLabel:e=>`Cancel "${e}"`,itemProgressAriaLabel:e=>`"${e}" in progress`,successLabel:"Completed",canceledLabel:"Canceled",failedMessage:"Failed",warningMessage:"Completed with warnings",queueProgressAriaLabel:"Progress",queueProgressValueText:(e,t)=>`${e} of ${t}`,collapseAriaLabel:"Collapse",expandAriaLabel:"Expand",closeAriaLabel:"Close",closeConfirmHeader:"Close?",closeConfirmDescriptionInProgress:"Some items are still in progress.",closeConfirmDescriptionFailed:"Some items have failed.",closeConfirmDescriptionMixed:"Some items are still in progress, and some have failed.",closeConfirmLabel:"Close",closeCancelLabel:"Cancel"},Nu=({title:e,failedCount:t,isCollapsed:r,itemsId:s,labels:a,onToggleCollapse:o,onClose:i})=>{const l=r?B.IconChevronUp:B.IconChevronDown;return n.jsxs("div",{className:"mx-4 flex items-center justify-between border-b border-tertiary py-3",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"dial-small-paragraph-semi-text truncate text-primary",children:e}),t>0&&n.jsx("span",{className:"dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent",children:t})]}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(k.GhostIconButton,{"aria-label":r?a.expandAriaLabel:a.collapseAriaLabel,"aria-expanded":!r,"aria-controls":s,size:O.ElementSize.Small,icon:n.jsx(l,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:o,className:xt}),n.jsx(k.GhostIconButton,{"aria-label":a.closeAriaLabel,size:O.ElementSize.Small,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:i,className:xt})]})]})},xn=({message:e,isError:t})=>{const r=t?B.IconAlertCircleFilled:B.IconAlertTriangleFilled;return n.jsx(k.Tooltip,{tooltip:e,asChild:!0,children:n.jsx("span",{className:xt,role:"img","aria-label":e,tabIndex:0,children:n.jsx(r,{size:$.DIAL_ICON_SIZE.SM,className:t?"text-error":"text-warning-icon","aria-hidden":!0})})})},ju=({item:e,labels:t,onCancel:r})=>{const s=e.status===Oe.Canceled;return n.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[n.jsx(Or,{type:v.DialItemType.File,name:e.name,size:$.DIAL_ICON_SIZE.MD,className:y.mergeClasses(s&&"opacity-50"),decorative:!0}),n.jsx(k.EllipsisTooltip,{text:e.name,className:y.mergeClasses("dial-small-text",s?"text-secondary":"text-primary")}),e.status===Oe.InProgress&&n.jsxs("div",{className:y.mergeClasses(xt,"grid"),children:[n.jsx(v.Spinner,{size:$.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:y.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0")}),r&&n.jsx(k.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:O.ElementSize.Small,icon:n.jsx(B.IconX,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===Oe.Success&&n.jsx("span",{className:xt,role:"img","aria-label":t.successLabel,children:n.jsx(B.IconCheck,{size:$.DIAL_ICON_SIZE.SM,stroke:ie.DIAL_KIT_ICON_STROKE,className:"text-accent","aria-hidden":!0})}),e.status===Oe.Warning&&n.jsx(xn,{message:e.message||t.warningMessage,isError:!1}),e.status===Oe.Failed&&n.jsx(xn,{message:e.message||t.failedMessage,isError:!0}),s&&n.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Tu=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===Oe.InProgress?0:100)),0)/e.length),wu=(e,t,r)=>e&&t?r.closeConfirmDescriptionMixed:t?r.closeConfirmDescriptionFailed:r.closeConfirmDescriptionInProgress,Eu=({title:e,items:t,onClose:r,onCancelItem:s,labels:a,autoCloseDelay:o=vs,className:i,bodyClassName:l})=>{const[c,d]=h.useState(!1),[f,p]=h.useState(!1),g=h.useId(),u={...ys,...a},m=t.filter(D=>D.status===Oe.InProgress).length,C=m>0,x=t.filter(D=>D.status===Oe.Failed).length,b=x>0,I=t.length>0&&t.every(D=>D.status===Oe.Success),N=h.useCallback(()=>{C||b?p(!0):r()},[C,b,r]),T=h.useCallback(()=>{p(!1),r()},[r]),S=h.useCallback(()=>{d(D=>!D)},[]);return h.useEffect(()=>{if(!I||o<=0)return;const D=setTimeout(r,o);return()=>clearTimeout(D)},[I,o,r]),t.length===0?null:n.jsxs("div",{role:"status","aria-live":"polite",className:y.mergeClasses("w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",i,j.DIAL_KIT_CLASS.transferQueue),children:[n.jsx(Nu,{title:e,failedCount:x,isCollapsed:c,itemsId:g,labels:u,onToggleCollapse:S,onClose:N}),c&&C&&n.jsx(yn,{value:Tu(t),size:O.ElementSize.Small,"aria-label":u.queueProgressAriaLabel,"aria-valuetext":u.queueProgressValueText(t.length-m,t.length)}),!c&&n.jsx("div",{id:g,className:y.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(D=>n.jsx(ju,{item:D,labels:u,onCancel:s},D.id))}),n.jsx(ps,{open:f,header:u.closeConfirmHeader,description:wu(C,b,u),confirmLabel:u.closeConfirmLabel,cancelLabel:u.closeCancelLabel,variant:v.ConfirmationPopupVariant.Danger,onConfirm:T,onClose:()=>p(!1)})]})};exports.ConfirmationPopupVariant=v.ConfirmationPopupVariant;exports.DialBreadcrumb=v.DialBreadcrumb;exports.DialBreadcrumbItem=v.DialBreadcrumbItem;exports.DialButton=v.DialButton;exports.DialButtonDropdown=v.DialButtonDropdown;exports.DialCaptionText=v.DialCaptionText;exports.DialCollapsibleSidebar=v.DialCollapsibleSidebar;exports.DialConditionalResizableContainer=v.DialConditionalResizableContainer;exports.DialConfirmationPopup=v.DialConfirmationPopup;exports.DialDangerButton=v.DialDangerButton;exports.DialDestinationFolderPopup=v.DialDestinationFolderPopup;exports.DialErrorText=v.DialErrorText;exports.DialFileIcon=v.DialFileIcon;exports.DialFileManager=v.DialFileManager;exports.DialFileManagerActions=v.DialFileManagerActions;exports.DialFileManagerTabs=v.DialFileManagerTabs;exports.DialFileName=v.DialFileName;exports.DialFileNodeType=v.DialFileNodeType;exports.DialFilePermission=v.DialFilePermission;exports.DialFileResourceType=v.DialFileResourceType;exports.DialFolderName=v.DialFolderName;exports.DialFoldersTree=v.DialFoldersTree;exports.DialFormItem=v.DialFormItem;exports.DialGhostButton=v.DialGhostButton;exports.DialInput=v.DialInput;exports.DialItemType=v.DialItemType;exports.DialLinkButton=v.DialLinkButton;exports.DialLoader=v.DialLoader;exports.DialNeutralButton=v.DialNeutralButton;exports.DialNotification=v.DialNotification;exports.DialPopup=v.DialPopup;exports.DialPrimaryButton=v.DialPrimaryButton;exports.DialRadioGroup=v.DialRadioGroup;exports.DialResizableContainer=v.DialResizableContainer;exports.DialSearch=v.DialSearch;exports.DialSharedEntityIndicator=v.DialSharedEntityIndicator;exports.DialTabs=v.DialTabs;exports.EDITABLE_CONTAINER_ATTRIBUTE=v.EDITABLE_CONTAINER_ATTRIBUTE;exports.FileManagerColumnKey=v.FileManagerColumnKey;exports.FileManagerProvider=v.FileManagerProvider;exports.FlexibleActionsDirection=v.FlexibleActionsDirection;exports.FormItemOrientation=v.FormItemOrientation;exports.NAME_COLUMN=v.NAME_COLUMN;exports.NOT_ALLOWED_SPACES=v.NOT_ALLOWED_SPACES;exports.NOT_ALLOWED_SPACES_REGEXP=v.NOT_ALLOWED_SPACES_REGEXP;exports.NOT_ALLOWED_SYMBOLS=v.NOT_ALLOWED_SYMBOLS;exports.NOT_ALLOWED_SYMBOLS_REGEXP=v.NOT_ALLOWED_SYMBOLS_REGEXP;exports.NotificationType=v.NotificationType;exports.NotificationVariant=v.NotificationVariant;exports.PopupSize=v.PopupSize;exports.RadioGroupOrientation=v.RadioGroupOrientation;exports.ResizableContainerSide=v.ResizableContainerSide;exports.SIZE_COLUMN=v.SIZE_COLUMN;exports.ScreenResolution=v.ScreenResolution;exports.Skeleton=v.Skeleton;exports.SkeletonAvatarShape=v.SkeletonAvatarShape;exports.SkeletonAvatarSize=v.SkeletonAvatarSize;exports.SkeletonVariant=v.SkeletonVariant;exports.Spinner=v.Spinner;exports.TabOrientation=v.TabOrientation;exports.TabView=v.TabView;exports.UPDATED_AT_COLUMN=v.UPDATED_AT_COLUMN;exports.editableContainerProps=v.editableContainerProps;exports.useDialFileManagerTabs=v.useDialFileManagerTabs;exports.useEditableItem=v.useEditableItem;exports.useFileManagerContext=v.useFileManagerContext;exports.DialLabel=Be.DialLabel;exports.DialSwitch=Be.DialSwitch;exports.DEFAULT_GRID_DATE_FORMAT_OPTIONS=j.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_GRID_DATE_LOCALE=j.DEFAULT_LOCALE;exports.DIAL_KIT_CLASS=j.DIAL_KIT_CLASS;exports.DialCloseButton=j.DialCloseButton;exports.DialDangerIconButton=j.DialDangerIconButton;exports.DialDateCellRenderer=j.DialDateCellRenderer;exports.DialDropdown=j.DialDropdown;exports.DialEllipsisTooltip=j.DialEllipsisTooltip;exports.DialGhostIconButton=j.DialGhostIconButton;exports.DialGrid=j.DialGrid;exports.DialIcon=j.DialIcon;exports.DialNeutralIconButton=j.DialNeutralIconButton;exports.DialNoDataContent=j.DialNoDataContent;exports.DialPrimaryIconButton=j.DialPrimaryIconButton;exports.DialRadioButton=j.DialRadioButton;exports.DialSecondaryIconButton=j.DialSecondaryIconButton;exports.DialSuccessIconButton=j.DialSuccessIconButton;exports.DialTertiaryIconButton=j.DialTertiaryIconButton;exports.DropdownItemType=j.DropdownItemType;exports.DropdownTrigger=j.DropdownTrigger;exports.DropdownType=j.DropdownType;exports.GridSelectionMode=j.GridSelectionMode;exports.ThemeScope=j.ThemeScope;exports.baseColumnComparator=j.baseColumnComparator;exports.checkColDefsChanges=j.checkColDefsChanges;exports.convertGridDateToDate=j.convertToDate;exports.convertToDate=j.convertToDate;exports.useThemeScope=j.useThemeScope;exports.BASE_ICON_PROPS=$.BASE_ICON_PROPS;exports.BASE_ICON_SIZE=$.BASE_ICON_SIZE;exports.DIAL_ICON_SIZE=$.DIAL_ICON_SIZE;exports.mergeClasses=y.mergeClasses;exports.Checkbox=k.Checkbox;exports.CheckboxBox=k.CheckboxBox;exports.CloseButton=k.CloseButton;exports.DEFAULT_DATE_FORMAT_OPTIONS=k.DEFAULT_DATE_FORMAT_OPTIONS;exports.DEFAULT_DATE_LOCALE=k.DEFAULT_LOCALE;exports.DangerIconButton=k.DangerIconButton;exports.DateCellRenderer=k.DateCellRenderer;exports.Dropdown=k.Dropdown;exports.EllipsisTooltip=k.EllipsisTooltip;exports.GRID_ALIGN_RIGHT_CLASS=k.GRID_ALIGN_RIGHT_CLASS;exports.GRID_ROOT_CLASS=k.GRID_ROOT_CLASS;exports.GRID_ROW_HEIGHT=k.ROW_HEIGHT;exports.GRID_SELECTION_COLUMN_ID=k.GRID_SELECTION_COLUMN_ID;exports.GRID_THEME_PARAMS=k.GRID_THEME_PARAMS;exports.GhostIconButton=k.GhostIconButton;exports.Grid=k.Grid;exports.IconButton=k.IconButton;exports.InfoButton=k.InfoButton;exports.InteractiveTooltip=k.InteractiveTooltip;exports.Label=k.Label;exports.MenuItem=k.MenuItem;exports.MenuItemMark=k.MenuItemMark;exports.NeutralIconButton=k.NeutralIconButton;exports.NoDataContent=k.NoDataContent;exports.PrimaryIconButton=k.PrimaryIconButton;exports.Radio=k.Radio;exports.StaticIconButton=k.StaticIconButton;exports.Tooltip=k.Tooltip;exports.TooltipContainer=k.TooltipContainer;exports.TooltipContent=k.TooltipContent;exports.TooltipPlacement=k.TooltipPlacement;exports.TooltipTrigger=k.TooltipTrigger;exports.ButtonAppearance=O.ButtonAppearance;exports.ButtonVariant=O.ButtonVariant;exports.DialIconButton=O.DialIconButton;exports.DialTooltip=O.DialTooltip;exports.DialTooltipContainer=O.DialTooltipContainer;exports.DialTooltipContent=O.DialTooltipContent;exports.DialTooltipTrigger=O.DialTooltipTrigger;exports.ElementSize=O.ElementSize;exports.EditorThemes=bt.EditorThemes;exports.LazyDialJsonEditor=bt.LazyDialJsonEditor;exports.LazyDialMarkdownEditor=bt.LazyDialMarkdownEditor;exports.LazyMarkdownEditor=bt.LazyMarkdownEditor;exports.DIAL_KIT_ICON_STROKE=ie.DIAL_KIT_ICON_STROKE;exports.Accordion=ad;exports.AccordionCaretPosition=_t;exports.AnalyticsCardVariant=gt;exports.AutocompleteTagInput=gu;exports.Avatar=bs;exports.AvatarShape=at;exports.Badge=Qd;exports.BadgeColor=Re;exports.BadgeVariant=He;exports.BottomSheet=Wd;exports.Breadcrumbs=nc;exports.BreadcrumbsSize=We;exports.Button=Xe;exports.ButtonDropdown=uc;exports.Calendar=Vl;exports.CalendarMode=Se;exports.CaptionText=Ve;exports.CardShell=hl;exports.CollapsibleSidebar=yu;exports.ConditionalResizableContainer=Du;exports.ConfirmationPopup=ps;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=gr;exports.DEFAULT_TRANSFER_QUEUE_LABELS=ys;exports.DangerButton=sc;exports.DialAccordion=bn;exports.DialAnalyticsBar=St;exports.DialAnalyticsBarGroup=ks;exports.DialAnalyticsCard=As;exports.DialAnalyticsErrorTag=pr;exports.DialAnalyticsHistogram=Bs;exports.DialAutocompleteInputValue=kn;exports.DialCheckbox=sr;exports.DialDraggableItem=Jo;exports.DialDropdownIcon=Vi;exports.DialFormPopup=fi;exports.DialInputPopup=Rn;exports.DialLabelledText=Ys;exports.DialLoadFileArea=Kn;exports.DialLoadFileAreaField=Hi;exports.DialNumberInput=cr;exports.DialPagination=Ks;exports.DialPasswordInput=Mn;exports.DialRadioGroupPopupField=li;exports.DialRemoveButton=Ft;exports.DialSchemaRenderer=cl;exports.DialSegmentedControl=oi;exports.DialSelect=_e;exports.DialSelectField=Di;exports.DialSlider=qs;exports.DialSteps=Ws;exports.DialTag=Ue;exports.DialTagInput=Ln;exports.DialTextarea=ei;exports.EntityIdentity=au;exports.EntityType=he;exports.ErrorMessageNotification=Il;exports.ErrorText=Ke;exports.ErrorToastNotification=ml;exports.FabButton=cc;exports.FileDropzone=Md;exports.FileIcon=Or;exports.FileName=ms;exports.FilterChips=Rd;exports.FolderName=Zd;exports.FolderPath=Kl;exports.GeneralMessageNotification=Tl;exports.GeneralToastNotification=yl;exports.GhostButton=ic;exports.Highlight=Jn;exports.InfoMessageNotification=Sl;exports.InfoToastNotification=xl;exports.InlineSelect=fc;exports.InlineSelectTrigger=is;exports.Input=$e;exports.JsonSchemaType=V;exports.LinkButton=oc;exports.LoadingMessageNotification=jl;exports.LoadingToastNotification=vl;exports.MultiSelectTags=pt;exports.NeutralButton=wr;exports.Notification=Nr;exports.NumberInput=Gc;exports.OutlinedButton=lc;exports.PasswordInput=$c;exports.Popup=Er;exports.PrimaryButton=os;exports.ProgressBar=yn;exports.RadioGroup=gs;exports.RadioGroupPopupField=Cd;exports.ResizableContainer=Cs;exports.SchemaDisplayMode=ht;exports.SchemaOrientation=zt;exports.SchemaRendererVariant=st;exports.Search=mu;exports.SegmentedControl=Od;exports.Select=Fc;exports.SelectSize=Tt;exports.SelectVariant=wt;exports.SharedEntityIndicator=hs;exports.SideDrawer=ou;exports.Slider=Cu;exports.StarterButton=ac;exports.StepStatus=De;exports.SuccessMessageNotification=Dl;exports.SuccessToastNotification=bl;exports.Switch=od;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=vs;exports.Tabs=_d;exports.Tag=Ae;exports.TagAppearance=qe;exports.TagInput=uu;exports.Textarea=zc;exports.TextareaResize=fs;exports.ToggleIconButton=vd;exports.TransferQueue=Eu;exports.TransferQueueItemStatus=Oe;exports.WarningMessageNotification=Nl;exports.WarningToastNotification=Cl;exports.extractInitials=xs;exports.getTimezoneLabel=Gn;exports.matchesAccept=fr;exports.wrapInRootFolder=qi;